/*! For license information please see main.68d48eb2.js.LICENSE.txt */ (()=>{var __webpack_modules__={10(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},113(e,t,n){n(83094)("asyncIterator")},123(e,t,n){var r=n(44371),i=n(41126),o=n(51804),a=n(86356),s=n(15808),l=n(53963),c=n(84236),u=n(44968),d=n(16092),h=n(64278),f=TypeError,p=function(e,t){this.stopped=e,this.result=t},g=p.prototype;e.exports=function(e,t,n){var m,v,y,b,w,A,_,C=n&&n.that,x=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_ITERATOR),S=!(!n||!n.INTERRUPTED),D=r(t,C),k=function(e){return m&&h(m,"normal",e),new p(!0,e)},T=function(e){return x?(o(e),S?D(e[0],e[1],k):D(e[0],e[1])):S?D(e,k):D(e)};if(E)m=e;else{if(!(v=d(e)))throw f(a(e)+" is not iterable");if(s(v)){for(y=0,b=l(e);b>y;y++)if((w=T(e[y]))&&c(g,w))return w;return new p(!1)}m=u(e,v)}for(A=m.next;!(_=i(A,m)).done;){try{w=T(_.value)}catch(O){h(m,"throw",O)}if("object"==typeof w&&w&&c(g,w))return w}return new p(!1)}},203(e,t,n){"use strict";n.d(t,{N:()=>o});var r=n(20875),i=n.n(r);function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return i().compareTwoStrings(e,t)>n}},289(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631),i=n(7086),o=function(){function e(e,t,n){this.alreadyEmbedded=!1,this.ref=e,this.doc=t,this.embedder=n}return e.prototype.embed=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n,o;return r.__generator(this,function(r){switch(r.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:e=r.sent(),this.doc.catalog.has(i.PDFName.of("Names"))||this.doc.catalog.set(i.PDFName.of("Names"),this.doc.context.obj({})),(t=this.doc.catalog.lookup(i.PDFName.of("Names"),i.PDFDict)).has(i.PDFName.of("EmbeddedFiles"))||t.set(i.PDFName.of("EmbeddedFiles"),this.doc.context.obj({})),(n=t.lookup(i.PDFName.of("EmbeddedFiles"),i.PDFDict)).has(i.PDFName.of("Names"))||n.set(i.PDFName.of("Names"),this.doc.context.obj([])),(o=n.lookup(i.PDFName.of("Names"),i.PDFArray)).push(i.PDFHexString.fromText(this.embedder.fileName)),o.push(e),this.doc.catalog.has(i.PDFName.of("AF"))||this.doc.catalog.set(i.PDFName.of("AF"),this.doc.context.obj([])),this.doc.catalog.lookup(i.PDFName.of("AF"),i.PDFArray).push(e),this.alreadyEmbedded=!0,r.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}();t.default=o},319(e,t,n){var r=n(41126),i=n(51804),o=n(11942),a=n(38635),s=n(86248),l=TypeError;e.exports=function(e,t){var n=e.exec;if(o(n)){var c=r(n,e,t);return null!==c&&i(c),c}if("RegExp"===a(e))return r(s,e,t);throw l("RegExp#exec called on incompatible receiver")}},353(e){e.exports="object"==typeof window&&"object"!=typeof Deno},392(e,t){"use strict";var n=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.ReactComponent=void 0;var r=function(e){function t(t,n,r){var i=e.call(this)||this;return i.portal=null,i.reactComponent=t,i.portalManager=n,i.componentType=r,i.statelessComponent=i.isStateless(i.reactComponent),i}return n(t,e),t.prototype.getGui=function(){return this.eParentElement},t.prototype.destroy=function(){return this.componentInstance&&"function"==typeof this.componentInstance.destroy&&this.componentInstance.destroy(),this.portalManager.destroyPortal(this.portal)},t.prototype.createParentElement=function(e){var t=this.portalManager.getComponentWrappingElement(),n=document.createElement(t||"div");return n.classList.add("ag-react-container"),e.reactContainer=n,n},t.prototype.addParentContainerStyleAndClasses=function(){var e=this;this.componentInstance&&(this.componentInstance.getReactContainerStyle&&this.componentInstance.getReactContainerStyle()&&Object.assign(this.eParentElement.style,this.componentInstance.getReactContainerStyle()),this.componentInstance.getReactContainerClasses&&this.componentInstance.getReactContainerClasses()&&this.componentInstance.getReactContainerClasses().forEach(function(t){return e.eParentElement.classList.add(t)}))},t.prototype.statelessComponentRendered=function(){return this.eParentElement.childElementCount>0||this.eParentElement.childNodes.length>0},t.prototype.getFrameworkComponentInstance=function(){return this.componentInstance},t.prototype.isStatelessComponent=function(){return this.statelessComponent},t.prototype.getReactComponentName=function(){return this.reactComponent.name},t.prototype.getMemoType=function(){return this.hasSymbol()?Symbol.for("react.memo"):60115},t.prototype.hasSymbol=function(){return"function"===typeof Symbol&&Symbol.for},t.prototype.isStateless=function(e){return"function"===typeof e&&!(e.prototype&&e.prototype.isReactComponent)||"object"===typeof e&&e.$$typeof===this.getMemoType()},t.prototype.hasMethod=function(e){var t=this.getFrameworkComponentInstance();return!!t&&null!==t[e]||this.fallbackMethodAvailable(e)},t.prototype.callMethod=function(e,t){var n=this,r=this.getFrameworkComponentInstance();if(this.isStatelessComponent())return this.fallbackMethod(e,t&&t[0]?t[0]:{});if(r){var i=r[e];return i?i.apply(r,t):this.fallbackMethodAvailable(e)?this.fallbackMethod(e,t&&t[0]?t[0]:{}):void 0}setTimeout(function(){return n.callMethod(e,t)})},t.prototype.addMethod=function(e,t){this[e]=t},t}(function(){});t.ReactComponent=r},466(e,t,n){"use strict";n.d(t,{p:()=>l,l:()=>s});var r=n(9950),i=n(65155),o=n(78536),a=n(44414);const s=e=>{let{children:t}=e;const n=(0,i.W6)(),{search:s}=(0,i.zy)(),{mapId:l}=(0,i.g)();return(0,r.useEffect)(()=>{o.Fr&&l&&n.replace("/maps/".concat(l,"/basic").concat(s))},[n,l,s]),o.Fr?null:(0,a.jsx)(a.Fragment,{children:t})},l=e=>{let{children:t}=e;const n=(0,i.W6)(),{search:s}=(0,i.zy)(),{mapId:l}=(0,i.g)();return(0,r.useEffect)(()=>{!o.Fr&&l&&n.replace("/maps/".concat(l).concat(s))},[n,l,s]),o.Fr?(0,a.jsx)(a.Fragment,{children:t}):null}},525(e,t,n){"use strict";var r=n(26470);function i(){return i=r||function(e){for(var t=1;to});var r=n(9950),i=n(2946);function o(e,t){return r.useMemo(function(){return null==e&&null==t?null:function(n){(0,i.A)(e,n),(0,i.A)(t,n)}},[e,t])}},562(e,t,n){"use strict";n.d(t,{A:()=>r});const r=(0,n(87970).A)({prop:"boxShadow",themeKey:"shadows"})},707(e,t,n){"use strict";var r=n(85072),i=n.n(r),o=n(97825),a=n.n(o),s=n(77659),l=n.n(s),c=n(55056),u=n.n(c),d=n(10540),h=n.n(d),f=n(41113),p=n.n(f),g=n(94935),m={};m.styleTagTransform=p(),m.setAttributes=u(),m.insert=l().bind(null,"head"),m.domAPI=a(),m.insertStyleElement=h();i()(g.A,m),g.A&&g.A.locals&&g.A.locals},754(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(58168),i=n(80045),o=n(9950),a=n(2803),s=n(33720),l=n(53755),c=o.forwardRef(function(e,t){var n=e.children,s=e.classes,c=e.className,u=e.focusVisibleClassName,d=(0,i.A)(e,["children","classes","className","focusVisibleClassName"]);return o.createElement(l.A,(0,r.A)({className:(0,a.default)(s.root,c),focusVisibleClassName:(0,a.default)(u,s.focusVisible),ref:t},d),n,o.createElement("span",{className:s.focusHighlight}))});const u=(0,s.A)(function(e){return{root:{display:"block",textAlign:"inherit",width:"100%","&:hover $focusHighlight":{opacity:e.palette.action.hoverOpacity},"&$focusVisible $focusHighlight":{opacity:.12}},focusVisible:{},focusHighlight:{overflow:"hidden",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:"inherit",opacity:0,backgroundColor:"currentcolor",transition:e.transitions.create("opacity",{duration:e.transitions.duration.short})}}},{name:"MuiCardActionArea"})(c)},806(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(7658),i=n(38458);function o(e,t,n){var o=(0,i.A)(t,e);return(0,r.A)(e,o,n),n}},807(e,t,n){"use strict";function r(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;ir})},860(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631),i=n(19507),o=n(85800),a=r.__importDefault(n(72234)),s=function(){function e(e){this.idx=0,this.line=0,this.column=0,this.bytes=e,this.length=this.bytes.length}return e.prototype.moveTo=function(e){this.idx=e},e.prototype.next=function(){var e=this.bytes[this.idx++];return e===a.default.Newline?(this.line+=1,this.column=0):this.column+=1,e},e.prototype.assertNext=function(e){if(this.peek()!==e)throw new i.NextByteAssertionError(this.position(),e,this.peek());return this.next()},e.prototype.peek=function(){return this.bytes[this.idx]},e.prototype.peekAhead=function(e){return this.bytes[this.idx+e]},e.prototype.peekAt=function(e){return this.bytes[e]},e.prototype.done=function(){return this.idx>=this.length},e.prototype.offset=function(){return this.idx},e.prototype.slice=function(e,t){return this.bytes.slice(e,t)},e.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},e.of=function(t){return new e(t)},e.fromPDFRawStream=function(t){return e.of(o.decodePDFRawStream(t).decode())},e}();t.default=s},887(e,t,n){var r=n(16993),i=n(11791);e.exports=function(e,t,n,o,a){return new i(r().w(e,t,n,o),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},905(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631),i=r.__importDefault(n(86426)),o=r.__importDefault(n(52617)),a=n(19507),s=r.__importDefault(n(60786)),l=r.__importDefault(n(36467)),c=r.__importDefault(n(73203)),u=r.__importDefault(n(45324)),d=r.__importDefault(n(2162)),h=r.__importDefault(n(92286)),f=r.__importDefault(n(50376)),p=r.__importDefault(n(10453)),g=r.__importDefault(n(96322)),m=r.__importDefault(n(16066)),v=r.__importDefault(n(78952)),y=r.__importDefault(n(41578)),b=n(75998),w=n(55339),A=function(e,t){var n=e[0],r=t[0];return n.objectNumber-r.objectNumber},_=function(){function e(){this.largestObjectNumber=0,this.header=o.default.forVersion(1,7),this.trailerInfo={},this.indirectObjects=new Map,this.rng=w.SimpleRNG.withSeed(1)}return e.prototype.assign=function(e,t){this.indirectObjects.set(e,t),e.objectNumber>this.largestObjectNumber&&(this.largestObjectNumber=e.objectNumber)},e.prototype.nextRef=function(){return this.largestObjectNumber+=1,g.default.of(this.largestObjectNumber)},e.prototype.register=function(e){var t=this.nextRef();return this.assign(t,e),t},e.prototype.delete=function(e){return this.indirectObjects.delete(e)},e.prototype.lookupMaybe=function(e){for(var t=[],n=1;ns,bU:()=>c,cM:()=>a,kY:()=>l});var r=n(89379),i=n(64467),o=n(18280),a=class e extends o.XQ{static lc_name(){return"ChatMessage"}static _chatMessageClass(){return e}constructor(e,t){("string"===typeof e||Array.isArray(e))&&(e={content:e,role:t}),super(e),(0,i.A)(this,"type","generic"),(0,i.A)(this,"role",void 0),this.role=e.role}static isInstance(e){return super.isInstance(e)&&"generic"===e.type}get _printableFields(){return(0,r.A)((0,r.A)({},super._printableFields),{},{role:this.role})}},s=class extends o.gj{static lc_name(){return"ChatMessageChunk"}constructor(e,t){("string"===typeof e||Array.isArray(e))&&(e={content:e,role:t}),super(e),(0,i.A)(this,"type","generic"),(0,i.A)(this,"role",void 0),this.role=e.role}concat(e){var t;return new(0,this.constructor)({content:(0,o._I)(this.content,e.content),additional_kwargs:(0,o.ns)(this.additional_kwargs,e.additional_kwargs),response_metadata:(0,o.ns)(this.response_metadata,e.response_metadata),role:this.role,id:null!==(t=this.id)&&void 0!==t?t:e.id})}static isInstance(e){return super.isInstance(e)&&"generic"===e.type}get _printableFields(){return(0,r.A)((0,r.A)({},super._printableFields),{},{role:this.role})}};function l(e){return"generic"===e._getType()}function c(e){return"generic"===e._getType()}},1195(e,t,n){"use strict";var r=n(24994),i=n(6305);t.A=void 0;var o=i(n(9950)),a=(0,r(n(53209)).default)(o.createElement("path",{d:"M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z"}),"UnfoldMore");t.A=a},1203(e,t,n){"use strict";n.d(t,{A:()=>w});var r=n(58168),i=n(80045),o=n(9950),a=n(2803),s=n(56822),l=n(32776);const c=(0,l.A)(o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),u=(0,l.A)(o.createElement("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked");var d=n(33720);const h=(0,d.A)(function(e){return{root:{position:"relative",display:"flex","&$checked $layer":{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}},layer:{left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},checked:{}}},{name:"PrivateRadioButtonIcon"})(function(e){var t=e.checked,n=e.classes,r=e.fontSize;return o.createElement("div",{className:(0,a.default)(n.root,t&&n.checked)},o.createElement(c,{fontSize:r}),o.createElement(u,{fontSize:r,className:n.layer}))});var f=n(37751),p=n(52521),g=n(68023),m=n(37949);var v=o.createElement(h,{checked:!0}),y=o.createElement(h,null),b=o.forwardRef(function(e,t){var n=e.checked,l=e.classes,c=e.color,u=void 0===c?"secondary":c,d=e.name,h=e.onChange,f=e.size,b=void 0===f?"medium":f,w=(0,i.A)(e,["checked","classes","color","name","onChange","size"]),A=o.useContext(m.A),_=n,C=(0,g.A)(h,A&&A.onChange),x=d;return A&&("undefined"===typeof _&&(_=A.value===e.value),"undefined"===typeof x&&(x=A.name)),o.createElement(s.A,(0,r.A)({color:u,type:"radio",icon:o.cloneElement(y,{fontSize:"small"===b?"small":"medium"}),checkedIcon:o.cloneElement(v,{fontSize:"small"===b?"small":"medium"}),classes:{root:(0,a.default)(l.root,l["color".concat((0,p.A)(u))]),checked:l.checked,disabled:l.disabled},name:x,checked:_,onChange:C,ref:t},w))});const w=(0,d.A)(function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:(0,f.X4)(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:(0,f.X4)(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}},{name:"MuiRadio"})(b)},1205(e,t,n){var r=n(57787),i=n(24312),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),l=s&&"something"===function(){}.name,c=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:c}},1302(e,t,n){"use strict";var r=n(94217);e.exports=function(e,t){var n=t.ownerDocument.defaultView.getSelection(),i=n.anchorNode,o=n.anchorOffset,a=n.focusNode,s=n.focusOffset;return 0===n.rangeCount||null==i||null==a?{selectionState:e.getSelection().set("hasFocus",!1),needsRecovery:!1}:r(e,t,i,o,a,s)}},1311(e,t,n){"use strict";n.d(t,{Ay:()=>g,aR:()=>m});var r=n(9950),i=n(80974),o=n(28379),a=n(63027),s=n(67021),l=n(84865),c=n(33507),u=n(52394),d=n(34229),h=n(44414);const{calculateTranscriptLag:f}=n(32853),p=(0,i.A)({textContainer:{padding:5,overflowY:"scroll",height:170,fontSize:"1rem","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},copyButton:{marginTop:8,textAlign:"center",display:"flex",justifyContent:"space-between",alignItems:"center"},lagMetric:{fontSize:"0.7rem",color:"#999",marginRight:8}}),g=()=>{const e=p(),{meetingTranscriptActive:t}=(0,s.R)(),{userId:n}=(0,c.A)(),{mapId:i}=(0,u.A)(),g="".concat(n,":").concat(i,"_meetingTranscript"),[m,v]=(0,o.A)(g,""),[y,b]=(0,r.useState)(null),w=(0,r.useRef)(null),[A,_]=(0,r.useState)(!0),C=(0,r.useCallback)(()=>{if(!w.current)return;const{scrollTop:e,scrollHeight:t,clientHeight:n}=w.current;_(t-e-n<120)},[]);return(0,r.useEffect)(()=>(t||v(""),()=>v("")),[t]),(0,r.useEffect)(()=>{const e=e=>{if(e.detail){const t=e.detail.proofreadText||(0,l.$w)(e.detail.transcript||[]);v(t);const{updatedAt:n,renderedAt:r}=e.detail,i=f(n,r);b(i)}};return window.addEventListener("meeting-transcript",e),()=>{window.removeEventListener("meeting-transcript",e)}},[]),(0,r.useEffect)(()=>{const e=w.current;e&&A&&(e.scrollTop=e.scrollHeight)},[m,A]),t?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{ref:w,className:e.textContainer,onScroll:C,children:m?m.split("\n\n").map(e=>(0,h.jsx)("p",{style:{paddingY:4},children:e},e)):"No transcript here"}),m&&(0,h.jsxs)("div",{className:e.copyButton,children:[null!==y&&(0,h.jsxs)("span",{className:e.lagMetric,children:["Lag: ",y,"s"]}),(0,h.jsx)(d.A,{text:m,label:(0,h.jsx)(a.A,{id:"devModeCopyTranscript"})})]})]}):null},m=(e,t,n)=>{const r=Date.now();window.dispatchEvent(new CustomEvent("meeting-transcript",{detail:{transcript:e,proofreadText:t,updatedAt:n,renderedAt:r}}))}},1389(e,t,n){"use strict";n.d(t,{A:()=>h});var r=n(89379),i=n(80045),o=(n(9950),n(39884)),a=n(68168),s=n(63027),l=n(77817),c=n(41355),u=n(44414);const d=["handleOpenFileDialog","handleClose"],h=e=>{let{handleOpenFileDialog:t,handleClose:n}=e,h=(0,i.A)(e,d);const{lastSelectedNode:f}=(0,c.A)();return(0,u.jsxs)(o.A,(0,r.A)((0,r.A)({},h),{},{disabled:!f||f.isRoot,onClick:e=>{e.stopPropagation(),t(),n&&n()},children:[(0,u.jsx)(a.A,{children:(0,u.jsx)(l.A,{})}),(0,u.jsx)(s.A,{id:"toolbarMenuImage"})]}))}},1411(e,t,n){"use strict";n.d(t,{RA:()=>r.RA,cH:()=>r.cH,k5:()=>r.k5,pf:()=>r.pf,qA:()=>r.qA,vc:()=>r.vc});var r=n(75865)},1481(e,t,n){"use strict";n.d(t,{w:()=>i});var r=n(75876);function i(e,t){return null!==e&&void 0!==e?e:(0,r.L)(t)}},1581(e,t,n){"use strict";var r=n(20678),i=n(59990),o=n(4639),a=n(74816),s=o.OrderedMap,l=o.List,c=function(e,t,n){if(e){var r=t.get(e);r&&t.set(e,n(r))}},u=function(e,t,n,r,i){if(!i)return e;var o="after"===r,a=t.getKey(),s=n.getKey(),u=t.getParentKey(),d=t.getNextSiblingKey(),h=t.getPrevSiblingKey(),f=n.getParentKey(),p=o?n.getNextSiblingKey():s,g=o?s:n.getPrevSiblingKey();return e.withMutations(function(e){c(u,e,function(e){var t=e.getChildKeys();return e.merge({children:t.delete(t.indexOf(a))})}),c(h,e,function(e){return e.merge({nextSibling:d})}),c(d,e,function(e){return e.merge({prevSibling:h})}),c(p,e,function(e){return e.merge({prevSibling:a})}),c(g,e,function(e){return e.merge({nextSibling:a})}),c(f,e,function(e){var t=e.getChildKeys(),n=t.indexOf(s),r=o?n+1:0!==n?n-1:0,i=t.toArray();return i.splice(r,0,a),e.merge({children:l(i)})}),c(a,e,function(e){return e.merge({nextSibling:p,prevSibling:g,parent:f})})})};e.exports=function(e,t,n,o){"replace"===o&&a(!1);var l=n.getKey(),c=t.getKey();c===l&&a(!1);var d=e.getBlockMap(),h=t instanceof r,f=[t],p=d.delete(c);h&&(f=[],p=d.withMutations(function(e){var n=t.getNextSiblingKey(),r=i(t,e);e.toSeq().skipUntil(function(e){return e.getKey()===c}).takeWhile(function(e){var t=e.getKey(),i=t===c,o=n&&t!==n,a=!n&&e.getParentKey()&&(!r||t!==r);return!!(i||o||a)}).forEach(function(t){f.push(t),e.delete(t.getKey())})}));var g=p.toSeq().takeUntil(function(e){return e===n}),m=p.toSeq().skipUntil(function(e){return e===n}).skip(1),v=f.map(function(e){return[e.getKey(),e]}),y=s();if("before"===o){var b=e.getBlockBefore(l);b&&b.getKey()===t.getKey()&&a(!1),y=g.concat([].concat(v,[[l,n]]),m).toOrderedMap()}else if("after"===o){var w=e.getBlockAfter(l);w&&w.getKey()===c&&a(!1),y=g.concat([[l,n]].concat(v),m).toOrderedMap()}return e.merge({blockMap:u(y,t,n,o,h),selectionBefore:e.getSelectionAfter(),selectionAfter:e.getSelectionAfter().merge({anchorKey:c,focusKey:c})})}},1591(e,t,n){"use strict";n.d(t,{D_:()=>d,SN:()=>J,Sg:()=>f,VZ:()=>Y,ih:()=>ye,rN:()=>ve,vt:()=>me});var r=n(58168),i=n(37985),o=n(92901),a=n(77387),s=n(9417),l=n(98587),c={}.constructor;function u(e){if(null==e||"object"!==typeof e)return e;if(Array.isArray(e))return e.map(u);if(e.constructor!==c)return e;var t={};for(var n in e)t[n]=u(e[n]);return t}function d(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=u(t),o=r.plugins.onCreateRule(e,i,n);return o||(e[0],null)}var h=function(e,t){for(var n="",r=0;r<+~=|^:(),"'`\s])/g,y="undefined"!==typeof CSS&&CSS.escape,b=function(e){return y?y(e):e.replace(v,"\\$1")},w=function(){function e(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(t,e,this));var o=null==i||!1===i,a=e in this.style;if(o&&!a&&!r)return this;var s=o&&a;if(s?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;var l=this.options.sheet;return l&&l.attached,this},e}(),A=function(e){function t(t,n,r){var i;i=e.call(this,t,n,r)||this;var o=r.selector,a=r.scoped,l=r.sheet,c=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=c((0,s.A)((0,s.A)(i)),l),i.selectorText="."+b(i.id)),i}(0,a.A)(t,e);var n=t.prototype;return n.applyTo=function(e){var t=this.renderer;if(t){var n=this.toJSON();for(var r in n)t.setProperty(e,r,n[r])}return this},n.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!==typeof n?e[t]=n:Array.isArray(n)&&(e[t]=f(n))}return e},n.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?(0,r.A)({},e,{allowEmpty:!0}):e;return m(this.selectorText,this.style,n)},(0,o.A)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,n=this.renderable;if(n&&t)t.setSelector(n,e)||t.replaceRule(n,this)}},get:function(){return this.selectorText}}]),t}(w),_={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new A(e,t,n)}},C={indent:1,children:!0},x=/@([\w-]+)/,E=function(){function e(e,t,n){this.type="conditional",this.isProcessed=!1,this.key=e;var i=e.match(x);for(var o in this.at=i?i[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new Y((0,r.A)({},n,{parent:this})),t)this.rules.add(o,t[o]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.replaceRule=function(e,t,n){var r=this.rules.replace(e,t,n);return r&&this.options.jss.plugins.onProcessRule(r),r},t.toString=function(e){void 0===e&&(e=C);var t=p(e).linebreak;if(null==e.indent&&(e.indent=C.indent),null==e.children&&(e.children=C.children),!1===e.children)return this.query+" {}";var n=this.rules.toString(e);return n?this.query+" {"+t+n+t+"}":""},e}(),S=/@media|@supports\s+/,D={onCreateRule:function(e,t,n){return S.test(e)?new E(e,t,n):null}},k={indent:1,children:!0},T=/@keyframes\s+([\w-]+)/,O=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var i=e.match(T);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,s=n.generateId;for(var l in this.id=!1===o?this.name:b(s(this,a)),this.rules=new Y((0,r.A)({},n,{parent:this})),t)this.rules.add(l,t[l],(0,r.A)({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=k);var t=p(e).linebreak;if(null==e.indent&&(e.indent=k.indent),null==e.children&&(e.children=k.children),!1===e.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(e);return n&&(n=""+t+n+t),this.at+" "+this.id+" {"+n+"}"},e}(),I=/@keyframes\s+/,P=/\$([\w-]+)/g,M=function(e,t){return"string"===typeof e?e.replace(P,function(e,n){return n in t?t[n]:e}):e},R=function(e,t,n){var r=e[t],i=M(r,n);i!==r&&(e[t]=i)},N={onCreateRule:function(e,t,n){return"string"===typeof e&&I.test(e)?new O(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n?("animation-name"in e&&R(e,"animation-name",n.keyframes),"animation"in e&&R(e,"animation",n.keyframes),e):e},onChangeValue:function(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return M(e,r.keyframes);default:return e}}},j=function(e){function t(){return e.apply(this,arguments)||this}return(0,a.A)(t,e),t.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?(0,r.A)({},e,{allowEmpty:!0}):e;return m(this.key,this.style,n)},t}(w),F={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new j(e,t,n):null}},L=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){var t=p(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,n=t.attached,r=(0,l.A)(t,["attached"]),i=p(r).linebreak,o="",a=0;a0){var n=function(e,t){for(var n=0;nt.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"===typeof r){var i=function(e){for(var t=le(),n=0;nn?n:t},fe=function(){function e(e){this.getPropertyValue=ie,this.setProperty=oe,this.removeProperty=ae,this.setSelector=se,this.hasInsertedRules=!1,this.cssRules=[],e&&Z.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},n=t.media,r=t.meta,i=t.element;this.element=i||function(){var e=document.createElement("style");return e.textContent="\n",e}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var o=ue();o&&this.element.setAttribute("nonce",o)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var n=t.insertionPoint,r=ce(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"===typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(e,i.nextSibling)}else le().appendChild(e)}(this.element,this.sheet.options);var e=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;e&&(e.options.link?this.insertRules(e.rules):this.element.textContent="\n"+e.toString()+"\n")},t.insertRules=function(e,t){for(var n=0;n1?arguments[1]:void 0)}}),a("includes")},1681(e,t,n){"use strict";function r(e,t){return function(){return null}}n.r(t),n.d(t,{HTMLElementType:()=>y,chainPropTypes:()=>r,deepmerge:()=>i.A,elementAcceptingRef:()=>l,elementTypeAcceptingRef:()=>c,exactProp:()=>u,formatMuiErrorMessage:()=>d.A,getDisplayName:()=>v,ponyfillGlobal:()=>b,refType:()=>w});var i=n(35385),o=n(89561),a=n.n(o);var s=(a().element,function(){return null});s.isRequired=(a().element.isRequired,function(){return null});const l=s;const c=(o.elementType,function(){return null});function u(e){return e}var d=n(81282),h=n(82284),f=n(26429),p=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.displayName||e.name||function(e){var t="".concat(e).match(p);return t&&t[1]||""}(e)||t}function m(e,t,n){var r=g(t);return e.displayName||(""!==r?"".concat(n,"(").concat(r,")"):n)}function v(e){if(null!=e){if("string"===typeof e)return e;if("function"===typeof e)return g(e,"Component");if("object"===(0,h.A)(e))switch(e.$$typeof){case f.ForwardRef:return m(e,e.render,"ForwardRef");case f.Memo:return m(e,e.type,"memo");default:return}}}function y(e,t,n,r,i){return null}const b="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();const w=a().oneOfType([a().func,a().object])},1877(e,t,n){"use strict";n.d(t,{tj:()=>a,tw:()=>s});var r=n(96598),i=n(87409);const o=e=>e!==r.Of||i.$Z,a=e=>({audio:o(e)}),s=async(e,t)=>{var n,o;if(t!==r.Of)return{acousticStatus:null,fullDuplexBargeIn:!0};const a=null!==(n=null===(o=e.getAudioTracks)||void 0===o?void 0:o.call(e))&&void 0!==n?n:[],s=await Promise.allSettled(a.map(e=>"function"===typeof e.applyConstraints?e.applyConstraints(i.$Z):Promise.reject(new Error("applyConstraints unavailable")))),l=a.length>0&&s.every(e=>"fulfilled"===e.status),c=(0,i.d)(e,l);return{acousticStatus:c,fullDuplexBargeIn:c.fullDuplexBargeIn}}},1887(e,t,n){var r=n(42300),i=n(77440);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}},1890(e,t,n){"use strict";n.d(t,{PI:()=>p});var r=n(89379),i=n(64467),o=n(19495),a=n(56218),s=n(10600),l=n(33587),c=n(39432),u=n(72940),d=n(54746),h=n(58828),f=n(20659);(0,l.V)({},{BaseLLM:()=>p,LLM:()=>g});var p=class e extends f.j_{constructor(){super(...arguments),(0,i.A)(this,"lc_namespace",["langchain","llms",this._llmType()])}async invoke(t,n){const r=e._convertInputToPromptValue(t);return(await this.generatePrompt([r],n,null===n||void 0===n?void 0:n.callbacks)).generations[0][0].text}_streamResponseChunks(e,t,n){return(0,s.A)(function*(){throw new Error("Not implemented.")})()}_separateRunnableConfigFromCallOptionsCompat(e){const[t,n]=super._separateRunnableConfigFromCallOptions(e);return n.signal=t.signal,[t,n]}_streamIterator(t,n){var r=this;return(0,s.A)(function*(){if(r._streamResponseChunks===e.prototype._streamResponseChunks)yield r.invoke(t,n);else{const p=e._convertInputToPromptValue(t),[g,m]=r._separateRunnableConfigFromCallOptionsCompat(n),v=yield(0,a.A)(u.Td.configure(g.callbacks,r.callbacks,g.tags,r.tags,g.metadata,r.metadata,{verbose:r.verbose})),y={options:m,invocation_params:null===r||void 0===r?void 0:r.invocationParams(m),batch_size:1},b=yield(0,a.A)(null===v||void 0===v?void 0:v.handleLLMStart(r.toJSON(),[p.toString()],g.runId,void 0,y,void 0,void 0,g.runName));let w=new h.mu({text:""});try{var i,s=!1,l=!1;try{for(var c,d=(0,o.A)(r._streamResponseChunks(p.toString(),m,null===b||void 0===b?void 0:b[0]));s=!(c=yield(0,a.A)(d.next())).done;s=!1){const e=c.value;w=w?w.concat(e):e,"string"===typeof e.text&&(yield e.text)}}catch(f){l=!0,i=f}finally{try{s&&null!=d.return&&(yield(0,a.A)(d.return()))}finally{if(l)throw i}}}catch(f){throw yield(0,a.A)(Promise.all((null!==b&&void 0!==b?b:[]).map(e=>null===e||void 0===e?void 0:e.handleLLMError(f)))),f}yield(0,a.A)(Promise.all((null!==b&&void 0!==b?b:[]).map(e=>null===e||void 0===e?void 0:e.handleLLMEnd({generations:[[w]]}))))}})()}async generatePrompt(e,t,n){const r=e.map(e=>e.toString());return this.generate(r,t,n)}invocationParams(e){return{}}_flattenLLMResult(e){const t=[];for(let n=0;nnull===e||void 0===e?void 0:e.handleLLMError(S))),S}const e=this._flattenLLMResult(f);await Promise.all((null!==(_=l)&&void 0!==_?_:[]).map((t,n)=>null===t||void 0===t?void 0:t.handleLLMEnd(e[n])))}const E=(null===(s=l)||void 0===s?void 0:s.map(e=>e.runId))||void 0;return Object.defineProperty(f,h.SP,{value:E?{runIds:E}:void 0,configurable:!0}),f}async _generateCached(e){let{prompts:t,cache:n,llmStringKey:i,parsedOptions:o,handledOptions:a,runId:s}=e;const l=await u.Td.configure(a.callbacks,this.callbacks,a.tags,this.tags,a.metadata,this.metadata,{verbose:this.verbose}),c={options:o,invocation_params:null===this||void 0===this?void 0:this.invocationParams(o),batch_size:t.length},d=await(null===l||void 0===l?void 0:l.handleLLMStart(this.toJSON(),t,s,void 0,c,void 0,void 0,null===a||void 0===a?void 0:a.runName)),f=[],p=(await Promise.allSettled(t.map(async(e,t)=>{const r=await n.lookup(e,i);return null==r&&f.push(t),r}))).map((e,t)=>({result:e,runManager:null===d||void 0===d?void 0:d[t]})).filter(e=>{let{result:t}=e;return"fulfilled"===t.status&&null!=t.value||"rejected"===t.status}),g=[];await Promise.all(p.map(async(e,t)=>{let{result:n,runManager:i}=e;if("fulfilled"===n.status){const e=n.value;return g[t]=e.map(e=>(e.generationInfo=(0,r.A)((0,r.A)({},e.generationInfo),{},{tokenUsage:{}}),e)),e.length&&await(null===i||void 0===i?void 0:i.handleLLMNewToken(e[0].text)),null===i||void 0===i?void 0:i.handleLLMEnd({generations:[e]},void 0,void 0,void 0,{cached:!0})}return await(null===i||void 0===i?void 0:i.handleLLMError(n.reason,void 0,void 0,void 0,{cached:!0})),Promise.reject(n.reason)}));const m={generations:g,missingPromptIndices:f,startedRunManagers:d};return Object.defineProperty(m,h.SP,{value:d?{runIds:null===d||void 0===d?void 0:d.map(e=>e.runId)}:void 0,configurable:!0}),m}async generate(e,t,n){var r;if(!Array.isArray(e))throw new Error("Argument 'prompts' is expected to be a string[]");let i;i=Array.isArray(t)?{stop:t}:t;const[o,a]=this._separateRunnableConfigFromCallOptionsCompat(i);if(o.callbacks=null!==(r=o.callbacks)&&void 0!==r?r:n,!this.cache)return this._generateUncached(e,a,o);const{cache:s}=this,l=this._getSerializedCacheKeyParametersForCall(a),{generations:c,missingPromptIndices:u,startedRunManagers:d}=await this._generateCached({prompts:e,cache:s,llmStringKey:l,parsedOptions:a,handledOptions:o,runId:o.runId});let h={};if(u.length>0){var f;const t=await this._generateUncached(u.map(t=>e[t]),a,o,void 0!==d?u.map(e=>null===d||void 0===d?void 0:d[e]):void 0);await Promise.all(t.generations.map(async(t,n)=>{const r=u[n];return c[r]=t,s.update(e[r],l,t)})),h=null!==(f=t.llmOutput)&&void 0!==f?f:{}}return{generations:c,llmOutput:h}}_identifyingParams(){return{}}_modelType(){return"base_llm"}},g=class extends p{async _generate(e,t,n){return{generations:await Promise.all(e.map((e,i)=>this._call(e,(0,r.A)((0,r.A)({},t),{},{promptIndex:i}),n).then(e=>[{text:e}])))}}}},1900(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"};t.default=n},1935(e,t,n){"use strict";n.d(t,{E6:()=>o,X6:()=>f});var r=n(33587),i=n(56587),o={};(0,r.V)(o,{JsonPatchError:()=>a,_areEquals:()=>v,applyOperation:()=>h,applyPatch:()=>f,applyReducer:()=>p,deepClone:()=>s,getValueByPointer:()=>d,validate:()=>m,validator:()=>g});const a=i.DF,s=i.LH;function l(e){return Object.getOwnPropertyNames(Object.prototype).includes(e)}const c={add:function(e,t,n){if(l(t))throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){if(l(t))throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){if(l(t))throw new TypeError("JSON-Patch: modifying `__proto__`, `constructor`, or `prototype` prop is banned for security reasons");var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){let r=d(n,this.path);r&&(r=(0,i.LH)(r));const o=h(n,{op:"remove",path:this.from}).removed;return h(n,{op:"add",path:this.path,value:o}),{newDocument:n,removed:r}},copy:function(e,t,n){const r=d(n,this.from);return h(n,{op:"add",path:this.path,value:(0,i.LH)(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:v(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}};var u={add:function(e,t,n){return(0,i.Fq)(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:c.move,copy:c.copy,test:c.test,_get:c._get};function d(e,t){if(""==t)return e;var n={op:"_get",path:t};return h(e,n),n.value}function h(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(n&&("function"==typeof n?n(t,0,e,t.path):g(t,0)),""===t.path){let r={newDocument:e};if("add"===t.op)return r.newDocument=t.value,r;if("replace"===t.op)return r.newDocument=t.value,r.removed=e,r;if("move"===t.op||"copy"===t.op)return r.newDocument=d(e,t.from),"move"===t.op&&(r.removed=e),r;if("test"===t.op){if(r.test=v(e,t.value),!1===r.test)throw new a("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return r.newDocument=e,r}if("remove"===t.op)return r.removed=e,r.newDocument=null,r;if("_get"===t.op)return t.value=e,r;if(n)throw new a("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return r}{r||(e=(0,i.LH)(e));const l=(t.path||"").split("/");let d,h,f,p=e,m=1,v=l.length;for(f="function"==typeof n?n:g;;){if(h=l[m],h&&-1!=h.indexOf("~")&&(h=(0,i.nF)(h)),o&&("__proto__"==h||"prototype"==h&&m>0&&"constructor"==l[m-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&void 0===d&&(void 0===p[h]?d=l.slice(0,m).join("/"):m==v-1&&(d=t.path),void 0!==d&&f(t,0,e,d)),m++,Array.isArray(p)){if("-"===h)h=p.length;else{if(n&&!(0,i.Fq)(h))throw new a("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);(0,i.Fq)(h)&&(h=~~h)}if(m>=v){if(n&&"add"===t.op&&h>p.length)throw new a("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);const r=u[t.op].call(t,p,h,e);if(!1===r.test)throw new a("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return r}}else if(m>=v){const n=c[t.op].call(t,p,h,e);if(!1===n.test)throw new a("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return n}if(p=p[h],n&&m3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(n&&!Array.isArray(t))throw new a("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=(0,i.LH)(e));const s=new Array(t.length);for(let i=0,a=t.length;i0)throw new a('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if(("move"===e.op||"copy"===e.op)&&"string"!==typeof e.from)throw new a("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new a("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&(0,i.Lb)(e.value))throw new a("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n)if("add"==e.op){var o=e.path.split("/").length,s=r.split("/").length;if(o!==s+1&&o!==s)throw new a("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==r)throw new a("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if("move"===e.op||"copy"===e.op){var l=m([{op:"_get",path:e.from,value:void 0}],n);if(l&&"OPERATION_PATH_UNRESOLVABLE"===l.name)throw new a("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}function m(e,t,n){try{if(!Array.isArray(e))throw new a("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)f((0,i.LH)(t),(0,i.LH)(e),n||!0);else{n=n||g;for(var r=0;rD});var r=n(58168),i=n(80045),o=n(9950),a=n(2803),s=n(33720),l=n(68035),c=n(39884),u=n(7692),d=n(5386),h=n(81270),f=n(39886),p=n(72478),g=n(28233),m=n(14602),v=n(97226),y=o.createElement(g.A,null),b=o.createElement(p.A,null),w=o.createElement(p.A,null),A=o.createElement(g.A,null);const _=o.forwardRef(function(e,t){var n=e.backIconButtonProps,a=e.count,s=e.nextIconButtonProps,l=e.onChangePage,c=void 0===l?function(){}:l,u=e.onPageChange,d=void 0===u?function(){}:u,h=e.page,f=e.rowsPerPage,p=(0,i.A)(e,["backIconButtonProps","count","nextIconButtonProps","onChangePage","onPageChange","page","rowsPerPage"]),g=(0,m.A)();return o.createElement("div",(0,r.A)({ref:t},p),o.createElement(v.A,(0,r.A)({onClick:function(e){c(e,h-1),d(e,h-1)},disabled:0===h,color:"inherit"},n),"rtl"===g.direction?y:b),o.createElement(v.A,(0,r.A)({onClick:function(e){c(e,h+1),d(e,h+1)},disabled:-1!==a&&h>=Math.ceil(a/f)-1,color:"inherit"},s),"rtl"===g.direction?w:A))});var C=n(13642),x=function(e){var t=e.from,n=e.to,r=e.count;return"".concat(t,"-").concat(n," of ").concat(-1!==r?r:"more than ".concat(n))},E=[10,25,50,100],S=o.forwardRef(function(e,t){var n,s=e.ActionsComponent,p=void 0===s?_:s,g=e.backIconButtonProps,m=e.backIconButtonText,v=void 0===m?"Previous page":m,y=e.classes,b=e.className,w=e.colSpan,A=e.component,S=void 0===A?d.A:A,D=e.count,k=e.labelDisplayedRows,T=void 0===k?x:k,O=e.labelRowsPerPage,I=void 0===O?"Rows per page:":O,P=e.nextIconButtonProps,M=e.nextIconButtonText,R=void 0===M?"Next page":M,N=e.onChangePage,j=e.onPageChange,F=e.onChangeRowsPerPage,L=e.onRowsPerPageChange,B=e.page,z=e.rowsPerPage,U=e.rowsPerPageOptions,G=void 0===U?E:U,H=e.SelectProps,W=void 0===H?{}:H,V=(0,i.A)(e,["ActionsComponent","backIconButtonProps","backIconButtonText","classes","className","colSpan","component","count","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","nextIconButtonText","onChangePage","onPageChange","onChangeRowsPerPage","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps"]),q=F||L;S!==d.A&&"td"!==S||(n=w||1e3);var K=(0,C.A)(),Y=(0,C.A)(),X=W.native?"option":c.A;return o.createElement(S,(0,r.A)({className:(0,a.default)(y.root,b),colSpan:n,ref:t},V),o.createElement(h.A,{className:y.toolbar},o.createElement("div",{className:y.spacer}),G.length>1&&o.createElement(f.A,{color:"inherit",variant:"body2",className:y.caption,id:Y},I),G.length>1&&o.createElement(u.A,(0,r.A)({classes:{select:y.select,icon:y.selectIcon},input:o.createElement(l.A,{className:(0,a.default)(y.input,y.selectRoot)}),value:z,onChange:q,id:K,labelId:Y},W),G.map(function(e){return o.createElement(X,{className:y.menuItem,key:e.value?e.value:e,value:e.value?e.value:e},e.label?e.label:e)})),o.createElement(f.A,{color:"inherit",variant:"body2",className:y.caption},T({from:0===D?0:B*z+1,to:-1!==D?Math.min(D,(B+1)*z):(B+1)*z,count:-1===D?-1:D,page:B})),o.createElement(p,{className:y.actions,backIconButtonProps:(0,r.A)({title:v,"aria-label":v},g),count:D,nextIconButtonProps:(0,r.A)({title:R,"aria-label":R},P),onChangePage:N,onPageChange:j,page:B,rowsPerPage:z})))});const D=(0,s.A)(function(e){return{root:{color:e.palette.text.primary,fontSize:e.typography.pxToRem(14),overflow:"auto","&:last-child":{padding:0}},toolbar:{minHeight:52,paddingRight:2},spacer:{flex:"1 1 100%"},caption:{flexShrink:0},selectRoot:{marginRight:32,marginLeft:8},select:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"},selectIcon:{},input:{color:"inherit",fontSize:"inherit",flexShrink:0},menuItem:{},actions:{flexShrink:0,marginLeft:20}}},{name:"MuiTablePagination"})(S)},2043(e,t,n){e.exports=n(92299)},2073(e,t,n){"use strict";n.d(t,{$i:()=>W,$e:()=>Z,n_:()=>de,IT:()=>fe,s6:()=>J});var r,i=n(58168);!function(e){e.Idle="idle",e.Loading="loading",e.Error="error",e.Success="success"}(r||(r={}));var o=function(e){this.silent=e},a=0;var s="undefined"===typeof window;function l(){}var c=console||{error:l,warn:l,log:l};function u(e,t){return"function"===typeof e?e(t):e}function d(e,t){if("function"===typeof t)throw new Error;return y(t)?Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{}):t}function h(e,t){return e===t||typeof e===typeof t&&("object"===typeof e&&!Object.keys(t).some(function(n){return!h(e[n],t[n])}))}function f(e){return"number"===typeof e&&e>=0&&e!==1/0}function p(){return"undefined"===typeof document||[void 0,"visible","prerender"].includes(document.visibilityState)}function g(){return void 0===navigator.onLine||navigator.onLine}function m(e,t,n,r){var o,a,s,l;return y(e)?(o=e.queryKey,a=e.queryFn,s=e.config,l=t):y(t)?(o=e,s=t,l=n):(o=e,a=t,s=n,l=r),s=s||{},a&&(s=(0,i.A)({},s,{queryFn:a})),[o,s,l]}function v(e,t){if(e===t)return e;var n=Array.isArray(e)&&Array.isArray(t);if(n||y(e)&&y(t)){for(var r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,a=n?[]:{},s=0,l=0;l0,isFetchedAfterMount:t.updateCount>this.initialUpdateCount,isFetching:t.isFetching,isFetchingMore:t.isFetchingMore,isInitialData:t.isInitialData,isPreviousData:s,isPlaceholderData:l,isStale:this.isStale,refetch:this.refetch,remove:this.remove,updatedAt:a})},t.updateQuery=function(){var e=this.config,t=this.currentQuery,n=e.queryCache.getQueryByHash(e.queryHash);n||(n=e.queryCache.createQuery(e)),n!==t&&(this.previousQueryResult=this.currentResult,this.currentQuery=n,this.initialUpdateCount=n.state.updateCount,n.state.isInitialData?e.keepPreviousData&&t?this.isStale=!0:"function"===typeof e.initialStale?this.isStale=e.initialStale():"boolean"===typeof e.initialStale?this.isStale=e.initialStale:this.isStale="undefined"===typeof n.state.data:this.isStale=n.isStaleByTime(e.staleTime),this.updateResult(),this.listener&&(null==t||t.unsubscribeObserver(this),this.currentQuery.subscribeObserver(this)))},t.onQueryUpdate=function(e){var t=this.config,n=e.type;2!==n&&3!==n&&4!==n||(this.isStale=this.currentQuery.isStaleByTime(t.staleTime));var r=this.currentResult;this.updateResult();var i=this.currentResult;if(2!==n&&3!==n&&4!==n||this.updateTimers(),4!==n||i.isStale!==r.isStale){var o={};2===n?o.onSuccess=!0:3===n&&(o.onError=!0),(t.notifyOnStatusChange||i.data!==r.data||i.error!==r.error)&&(o.listener=!0),this.notify(o)}},t.notify=function(e){var t=this.config,n=this.currentResult,r=this.currentQuery,i=this.listener,o=t.onSuccess,a=t.onSettled,s=t.onError;k.batch(function(){e.onSuccess?(o&&k.schedule(function(){o(n.data)}),a&&k.schedule(function(){a(n.data,null)})):e.onError&&(s&&k.schedule(function(){s(n.error)}),a&&k.schedule(function(){a(void 0,n.error)})),e.listener&&i&&k.schedule(function(){i(n)}),e.globalListeners&&t.queryCache.notifyGlobalListeners(r)})},e}();function O(){}var I=0,P=1,M=2,R=3,N=4;function j(e,t){if(!t)return e&&e.then?e.then(O):Promise.resolve()}function F(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function L(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function B(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function z(e){return function(){for(var t=[],n=0;n0||!f(this.cacheTime)||(this.gcTimeout=setTimeout(function(){e.remove()},this.cacheTime)))},t.cancel=function(e){var t=this.promise;return t&&this.cancelFetch?(this.cancelFetch(e),t.then(l).catch(l)):Promise.resolve(void 0)},t.continue=function(){var e;null==(e=this.continueFetch)||e.call(this)},t.clearTimersObservers=function(){this.observers.forEach(function(e){e.clearTimers()})},t.clearGcTimeout=function(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)},t.setData=function(e,t){var n,r,i=this.state.data,o=u(e,i);(null==(n=(r=this.config).isDataEqual)?void 0:n.call(r,i,o))?o=i:this.config.structuralSharing&&(o=v(i,o));var a=H(this.config,o);this.dispatch({type:M,data:o,canFetchMore:a,updatedAt:null==t?void 0:t.updatedAt})},t.clear=function(){c.warn("react-query: clear() has been deprecated, please use remove() instead"),this.remove()},t.remove=function(){this.queryCache.removeQuery(this)},t.destroy=function(){this.clearGcTimeout(),this.clearTimersObservers(),this.cancel()},t.isActive=function(){return this.observers.some(function(e){return e.config.enabled})},t.isStale=function(){return this.state.isInvalidated||this.state.status!==r.Success||this.observers.some(function(e){return e.getCurrentResult().isStale})},t.isStaleByTime=function(e){return void 0===e&&(e=0),this.state.isInvalidated||this.state.status!==r.Success||this.state.updatedAt+e<=Date.now()},t.onInteraction=function(e){var t=this.observers.find(function(t){var n=t.config,r=t.getCurrentResult().isStale;return n.enabled&&("focus"===e&&("always"===n.refetchOnWindowFocus||n.refetchOnWindowFocus&&r)||"online"===e&&("always"===n.refetchOnReconnect||n.refetchOnReconnect&&r))});t&&t.fetch(),this.continue()},t.subscribe=function(e){var t=new T(this.config);return t.subscribe(e),t},t.subscribeObserver=function(e){this.observers.push(e),this.clearGcTimeout()},t.unsubscribeObserver=function(e){this.observers=this.observers.filter(function(t){return t!==e}),this.observers.length||(this.isTransportCancelable&&this.cancel(),this.scheduleGc())},t.invalidate=function(){this.state.isInvalidated||this.dispatch({type:N})},t.refetch=function(e,t){var n=this.fetch(void 0,t);return(null==e?void 0:e.throwOnError)||(n=n.catch(l)),n},t.fetchMore=function(e,t,n){return this.fetch({fetchMore:{fetchMoreVariable:e,previous:(null==t?void 0:t.previous)||!1}},n)},t.fetch=function(e,t){try{var n=!1,r=this;return F(function(){if(r.promise)return(null==e?void 0:e.fetchMore)&&r.state.data?j(r.cancel(!0)):(n=!0,r.promise)},function(i){if(n)return i;t&&r.updateConfig(t);var o=(t=r.config).queryFnParamsFilter,a=o?o(r.queryKey):r.queryKey;return r.promise=z(function(){return B(function(){var n;return F(function(){return t.infinite?L(r.startInfiniteFetch(t,a,e),function(e){n=e}):L(r.startFetch(t,a,e),function(e){n=e})},function(){return r.setData(n),delete r.promise,n})},function(e){throw w(e)&&e.silent||r.dispatch({type:R,error:e}),w(e)||c.error(e),delete r.promise,e})})(),r.promise})}catch(i){return Promise.reject(i)}},t.startFetch=function(e,t,n){return this.state.isFetching||this.dispatch({type:P}),this.tryFetchData(e,function(){return e.queryFn.apply(e,t)})},t.startInfiniteFetch=function(e,t,n){var r=null==n?void 0:n.fetchMore,i=r||{},o=i.previous,a=i.fetchMoreVariable,s=!!r&&(o?"previous":"next"),l=this.state.data||[],c=z(function(n,r,i){var o=G(n,r);return"undefined"===typeof i&&"undefined"!==typeof o&&e.getFetchMore&&(i=e.getFetchMore(o,n)),Boolean(i)||"undefined"===typeof o?L(e.queryFn.apply(e,t.concat([i])),function(e){return r?[e].concat(n):[].concat(n,[e])}):n});return this.state.isFetching&&this.state.isFetchingMore===s||this.dispatch({type:P,isFetchingMore:s}),this.tryFetchData(e,function(){if(s)return c(l,o,a);if(l.length){for(var e=c([]),t=1;t-1&&q.splice(e,1),null==t&&r.clear({notify:!1})}},[r,t]),X.createElement(Q.Provider,{value:r},n)},$=X.createContext(void 0);function ee(){return X.useContext($)}function te(){var e=!1;return{clearReset:function(){e=!1},reset:function(){e=!0},isReset:function(){return e}}}var ne=X.createContext(te());function re(){var e=X.useRef(!1),t=X.useCallback(function(){return e.current},[]);return X[s?"useEffect":"useLayoutEffect"](function(){return e.current=!0,function(){e.current=!1}},[]),t}function ie(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var oe=0,ae=1,se=2,le=3;function ce(){return(0,i.A)({},A(r.Idle),{data:void 0,error:null})}function ue(e,t){switch(t.type){case oe:return ce();case ae:return(0,i.A)({},A(r.Loading),{data:void 0,error:null});case se:return(0,i.A)({},A(r.Success),{data:t.data,error:null});case le:return(0,i.A)({},A(r.Error),{data:void 0,error:t.error});default:return e}}function de(e,t){void 0===t&&(t={});var n=function(e,t,n){var r=e.getDefaultConfig();return(0,i.A)({},S.mutations,null==r?void 0:r.shared,null==r?void 0:r.mutations,null==t?void 0:t.shared,null==t?void 0:t.mutations,n)}(J(),ee(),t),r=X.useReducer(ue,null,ce),o=r[0],s=function(e){var t=re();return X.useCallback(function(){if(t())return e.apply(void 0,arguments)},[e,t])}(r[1]),l=X.useRef(),u=X.useRef(e);u.current=e;var d=X.useRef(n);d.current=n;var h,f=X.useCallback((h=function(e,t){void 0===t&&(t={});var n=d.current,r=a++;l.current=r;var i,o=function(){return l.current===r};return function(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}(function(){return s({type:ae}),ie(null==n.onMutate?void 0:n.onMutate(e),function(r){return i=r,ie((0,u.current)(e),function(r){return o()&&s({type:se,data:r}),ie(null==n.onSuccess?void 0:n.onSuccess(r,e),function(){return ie(null==t.onSuccess?void 0:t.onSuccess(r,e),function(){return ie(null==n.onSettled?void 0:n.onSettled(r,null,e),function(){return ie(null==t.onSettled?void 0:t.onSettled(r,null,e),function(){return r})})})})})})},function(r){return c.error(r),ie(null==n.onError?void 0:n.onError(r,e,i),function(){return ie(null==t.onError?void 0:t.onError(r,e,i),function(){return ie(null==n.onSettled?void 0:n.onSettled(void 0,r,e,i),function(){return ie(null==t.onSettled?void 0:t.onSettled(void 0,r,e,i),function(){if(o()&&s({type:le,error:r}),t.throwOnError||n.throwOnError)throw r})})})})})},function(){for(var e=[],t=0;tte,lV:()=>V});var r=n(58168),i=n(98587),o=n(9950),a=".".charCodeAt(0),s=/\\(\\)?/g,l=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),c={},u=function(e){if(null===e||void 0===e||!e.length)return[];if("string"!==typeof e)throw new Error("toPath() expects a string");return null==c[e]&&(c[e]=function(e){var t=[];return e.charCodeAt(0)===a&&t.push(""),e.replace(l,function(e,n,r,i){var o=e;r?o=i.replace(s,"$1"):n&&(o=n.trim()),t.push(o)}),t}(e)),c[e]},d=function(e,t){for(var n=u(t),r=e,i=0;i=o.length)return a;var l=o[n];if(isNaN(l)){var c;if(void 0===t||null===t){var u,d=e(void 0,n+1,o,a,s);return void 0===d?void 0:((u={})[l]=d,u)}if(Array.isArray(t))throw new Error("Cannot set a non-numeric property on an array");var f=e(t[l],n+1,o,a,s);if(void 0===f){var p=Object.keys(t).length;if(void 0===t[l]&&0===p)return;return void 0!==t[l]&&p<=1?isNaN(o[n-1])||s?void 0:{}:(t[l],(0,i.A)(t,[l].map(h)))}return(0,r.A)({},t,((c={})[l]=f,c))}var g=Number(l);if(void 0===t||null===t){var m=e(void 0,n+1,o,a,s);if(void 0===m)return;var v=[];return v[g]=m,v}if(!Array.isArray(t))throw new Error("Cannot set a numeric property on an object");var y=e(t[g],n+1,o,a,s),b=[].concat(t);if(s&&void 0===y){if(b.splice(g,1),0===b.length)return}else b[g]=y;return b},p=function(e,t,n,r){if(void 0===r&&(r=!1),void 0===e||null===e)throw new Error("Cannot call setIn() with "+String(e)+" state");if(void 0===t||null===t)throw new Error("Cannot call setIn() with "+String(t)+" key");return f(e,0,u(t),n,r)},g="FINAL_FORM/form-error",m="FINAL_FORM/array-error";function v(e,t){var n=e.errors,r=e.initialValues,i=e.lastSubmittedValues,o=e.submitErrors,a=e.submitFailed,s=e.submitSucceeded,l=e.submitting,c=e.values,u=t.active,h=t.blur,f=t.change,p=t.data,g=t.focus,v=t.modified,y=t.modifiedSinceLastSubmit,b=t.name,w=t.touched,A=t.validating,_=t.visited,C=d(c,b),x=d(n,b);x&&x[m]&&(x=x[m]);var E=o&&d(o,b),S=r&&d(r,b),D=t.isEqual(S,C),k=!x&&!E;return{active:u,blur:h,change:f,data:p,dirty:!D,dirtySinceLastSubmit:!(!i||t.isEqual(d(i,b),C)),error:x,focus:g,initial:S,invalid:!k,length:Array.isArray(C)?C.length:void 0,modified:v,modifiedSinceLastSubmit:y,name:b,pristine:D,submitError:E,submitFailed:a,submitSucceeded:s,submitting:l,touched:w,valid:k,value:C,visited:_,validating:A}}var y=["active","data","dirty","dirtySinceLastSubmit","error","initial","invalid","length","modified","modifiedSinceLastSubmit","pristine","submitError","submitFailed","submitSucceeded","submitting","touched","valid","value","visited","validating"],b=function(e,t){if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),o=0;o0,T=++A,O=Promise.all(S).then((w=T,function(e){return delete C[w],e}));k&&(C[T]=O);var I=function(e){var t=(0,r.A)({},s?i.errors:{},_,e?x:i.asyncErrors),c=function(e){a.forEach(function(r){if(n[r]){var i=d(_,r),a=d(t,r),c=N(o[r]).length,u=E[r];e(r,c&&u||l&&i||(i||s?void 0:a))}})};c(function(e,n){t=p(t,e,n)||{}}),c(function(e,n){if(n&&n[m]){var r=d(t,e),i=[].concat(r);i[m]=n[m],t=p(t,e,i)}}),b(i.errors,t)||(i.errors=t),e&&(i.asyncErrors=x),i.error=_[g]};if(k&&(u.formState.validating++,t()),I(!1),t(),k){var P=function(){u.formState.validating--,t()};O.then(function(){A>T||I(!0)}).then(P,P)}}else t()},F=function(e){if(!h){var t=u.fields,n=u.fieldSubscribers,i=u.formState,o=(0,r.A)({},t),a=function(e){var t=o[e],r=v(i,t),a=t.lastFieldState;t.lastFieldState=r;var s=n[e];s&&I(s,r,a,_,void 0===a)};e?a(e):Object.keys(o).forEach(a)}},L=function(){Object.keys(u.fields).forEach(function(e){u.fields[e].touched=!0})},B=function(){var e=u.fields,t=u.formState,n=u.lastFormState,i=(0,r.A)({},e),o=Object.keys(i),a=!1,s=o.reduce(function(e,n){return!i[n].isEqual(d(t.values,n),d(t.initialValues||{},n))&&(a=!0,e[n]=!0),e},{}),l=o.reduce(function(e,n){var r=t.lastSubmittedValues||{};return i[n].isEqual(d(t.values,n),d(r,n))||(e[n]=!0),e},{});t.pristine=!a,t.dirtySinceLastSubmit=!(!t.lastSubmittedValues||!Object.values(l).some(function(e){return e})),t.modifiedSinceLastSubmit=!(!t.lastSubmittedValues||!Object.keys(i).some(function(e){return i[e].modifiedSinceLastSubmit})),t.valid=!t.error&&!t.submitError&&!T(t.errors)&&!(t.submitErrors&&T(t.submitErrors));var c=function(e){var t=e.active,n=e.dirtySinceLastSubmit,r=e.modifiedSinceLastSubmit,i=e.error,o=e.errors,a=e.initialValues,s=e.pristine,l=e.submitting,c=e.submitFailed,u=e.submitSucceeded,d=e.submitError,h=e.submitErrors,f=e.valid,p=e.validating,g=e.values;return{active:t,dirty:!s,dirtySinceLastSubmit:n,modifiedSinceLastSubmit:r,error:i,errors:o,hasSubmitErrors:!!(d||h&&T(h)),hasValidationErrors:!(!i&&!T(o)),invalid:!f,initialValues:a,pristine:s,submitting:l,submitFailed:c,submitSucceeded:u,submitError:d,submitErrors:h,valid:f,validating:p>0,values:g}}(t),h=o.reduce(function(e,t){return e.modified[t]=i[t].modified,e.touched[t]=i[t].touched,e.visited[t]=i[t].visited,e},{modified:{},touched:{},visited:{}}),f=h.modified,p=h.touched,g=h.visited;return c.dirtyFields=n&&b(n.dirtyFields,s)?n.dirtyFields:s,c.dirtyFieldsSinceLastSubmit=n&&b(n.dirtyFieldsSinceLastSubmit,l)?n.dirtyFieldsSinceLastSubmit:l,c.modified=n&&b(n.modified,f)?n.modified:f,c.touched=n&&b(n.touched,p)?n.touched:p,c.visited=n&&b(n.visited,g)?n.visited:g,n&&b(n,c)?n:c},z=!1,U=!1,G=function e(){if(z)U=!0;else{if(z=!0,t&&t(B(),Object.keys(u.fields).reduce(function(e,t){return e[t]=u.fields[t],e},{})),!h&&(!f||!w)){var n=u.lastFormState,r=B();r!==n&&(u.lastFormState=r,I(u.subscribers,r,n,E))}z=!1,U&&(U=!1,e())}},H=function(){return Object.keys(u.fields).forEach(function(e){return u.fields[e].modifiedSinceLastSubmit=!1})};j(void 0,function(){G()});var W={batch:function(e){h++,e(),h--,F(),G()},blur:function(e){var t=u.fields,n=u.formState,i=t[e];i&&(delete n.active,t[e]=(0,r.A)({},i,{active:!1,touched:!0}),c?j(e,function(){F(),G()}):(F(),G()))},change:function(e,t){var n=u.fields,i=u.formState;if(d(i.values,e)!==t){x(u,e,function(){return t});var o=n[e];o&&(n[e]=(0,r.A)({},o,{modified:!0,modifiedSinceLastSubmit:!!i.lastSubmittedValues})),c?(F(),G()):j(e,function(){F(),G()})}},get destroyOnUnregister(){return!!n},set destroyOnUnregister(e){n=e},focus:function(e){var t=u.fields[e];t&&!t.active&&(u.formState.active=e,t.active=!0,t.visited=!0,F(),G())},mutators:R,getFieldState:function(e){var t=u.fields[e];return t&&t.lastFieldState},getRegisteredFields:function(){return Object.keys(u.fields)},getState:function(){return B()},initialize:function(e){var t=u.fields,n=u.formState,o=(0,r.A)({},t),a="function"===typeof e?e(n.values):e;i||(n.values=a);var s=i?Object.keys(o).reduce(function(e,t){return o[t].isEqual(d(n.values,t),d(n.initialValues||{},t))||(e[t]=d(n.values,t)),e},{}):{};n.initialValues=a,n.values=a,Object.keys(s).forEach(function(e){n.values=p(n.values,e,s[e])||{}}),j(void 0,function(){F(),G()})},isValidationPaused:function(){return f},pauseValidation:function(e){void 0===e&&(e=!0),f=!0,w=e},registerField:function(e,t,r,i){void 0===r&&(r={}),u.fieldSubscribers[e]||(u.fieldSubscribers[e]={index:0,entries:{}});var o=u.fieldSubscribers[e].index++;u.fieldSubscribers[e].entries[o]={subscriber:S(t),subscription:r,notified:!1},u.fields[e]||(u.fields[e]={active:!1,afterSubmit:i&&i.afterSubmit,beforeSubmit:i&&i.beforeSubmit,blur:function(){return W.blur(e)},change:function(t){return W.change(e,t)},data:i&&i.data||{},focus:function(){return W.focus(e)},isEqual:i&&i.isEqual||k,lastFieldState:void 0,modified:!1,modifiedSinceLastSubmit:!1,name:e,touched:!1,valid:!0,validateFields:i&&i.validateFields,validators:{},validating:!1,visited:!1});var a=!1,s=i&&i.silent,l=function(){s?F(e):(G(),F())};if(i){a=!(!i.getValidator||!i.getValidator()),i.getValidator&&(u.fields[e].validators[o]=i.getValidator);var c=void 0===d(u.formState.values,e);void 0===i.initialValue||!c&&d(u.formState.values,e)!==d(u.formState.initialValues,e)||(u.formState.initialValues=p(u.formState.initialValues||{},e,i.initialValue),u.formState.values=p(u.formState.values,e,i.initialValue),j(void 0,l)),void 0!==i.defaultValue&&void 0===i.initialValue&&void 0===d(u.formState.initialValues,e)&&c&&(u.formState.values=p(u.formState.values,e,i.defaultValue))}return a?j(void 0,l):l(),function(){var t=!1;u.fields[e]&&(t=!(!u.fields[e].validators[o]||!u.fields[e].validators[o]()),delete u.fields[e].validators[o]);var r=!!u.fieldSubscribers[e];r&&delete u.fieldSubscribers[e].entries[o];var i=r&&!Object.keys(u.fieldSubscribers[e].entries).length;i&&(delete u.fieldSubscribers[e],delete u.fields[e],t&&(u.formState.errors=p(u.formState.errors,e,void 0)||{}),n&&(u.formState.values=p(u.formState.values,e,void 0,!0)||{})),s||(t?j(void 0,function(){G(),F()}):i&&G())}},reset:function(e){void 0===e&&(e=u.formState.initialValues),u.formState.submitting&&(u.formState.resetWhileSubmitting=!0),u.formState.submitFailed=!1,u.formState.submitSucceeded=!1,delete u.formState.submitError,delete u.formState.submitErrors,delete u.formState.lastSubmittedValues,W.initialize(e||{})},resetFieldState:function(e){u.fields[e]=(0,r.A)({},u.fields[e],{active:!1,lastFieldState:void 0,modified:!1,touched:!1,valid:!0,validating:!1,visited:!1}),j(void 0,function(){F(),G()})},restart:function(e){void 0===e&&(e=u.formState.initialValues),W.batch(function(){for(var t in u.fields)W.resetFieldState(t),u.fields[t]=(0,r.A)({},u.fields[t],{active:!1,lastFieldState:void 0,modified:!1,modifiedSinceLastSubmit:!1,touched:!1,valid:!0,validating:!1,visited:!1});W.reset(e)})},resumeValidation:function(){f=!1,w=!1,y&&j(void 0,function(){F(),G()}),y=!1},setConfig:function(e,r){switch(e){case"debug":t=r;break;case"destroyOnUnregister":n=r;break;case"initialValues":W.initialize(r);break;case"keepDirtyOnReinitialize":i=r;break;case"mutators":a=r,r?(Object.keys(R).forEach(function(e){e in r||delete R[e]}),Object.keys(r).forEach(function(e){R[e]=M(e)})):Object.keys(R).forEach(function(e){delete R[e]});break;case"onSubmit":s=r;break;case"validate":l=r,j(void 0,function(){F(),G()});break;case"validateOnBlur":c=r;break;default:throw new Error("Unrecognised option "+e)}},submit:function(){var e=u.formState;if(!e.submitting){if(delete e.submitErrors,delete e.submitError,e.lastSubmittedValues=(0,r.A)({},e.values),u.formState.error||T(u.formState.errors))return L(),H(),u.formState.submitFailed=!0,G(),void F();var t=Object.keys(C);if(t.length)Promise.all(t.map(function(e){return C[Number(e)]})).then(W.submit,console.error);else if(!Object.keys(u.fields).some(function(e){return u.fields[e].beforeSubmit&&!1===u.fields[e].beforeSubmit()})){var n,i=!1,o=function(t){e.submitting=!1;var r=e.resetWhileSubmitting;return r&&(e.resetWhileSubmitting=!1),t&&T(t)?(e.submitFailed=!0,e.submitSucceeded=!1,e.submitErrors=t,e.submitError=t[g],L()):(r||(e.submitFailed=!1,e.submitSucceeded=!0),Object.keys(u.fields).forEach(function(e){return u.fields[e].afterSubmit&&u.fields[e].afterSubmit()})),G(),F(),i=!0,n&&n(t),t};e.submitting=!0,e.submitFailed=!1,e.submitSucceeded=!1,e.lastSubmittedValues=(0,r.A)({},e.values),H();var a=s(e.values,W,o);if(!i){if(a&&D(a))return G(),F(),a.then(o,function(e){throw o(),e});if(s.length>=3)return G(),F(),new Promise(function(e){n=e});o(a)}}}},subscribe:function(e,t){if(!e)throw new Error("No callback given.");if(!t)throw new Error("No subscription provided. What values do you want to listen to?");var n=S(e),r=u.subscribers,i=r.index++;r.entries[i]={subscriber:n,subscription:t,notified:!1};var o=B();return O(n,t,o,o,E,!0),function(){delete r.entries[i]}}};return W}var M=["render","children","component"];function R(e,t,n){var r=e.render,a=e.children,s=e.component,l=(0,i.A)(e,M);if(s)return o.createElement(s,Object.assign(t,l,{children:a,render:r}));if(r)return r(void 0===a?Object.assign(t,l):Object.assign(t,l,{children:a}));if("function"!==typeof a)throw new Error("Must specify either a render prop, a render function as children, or a component prop to "+n);return a(Object.assign(t,l))}function N(e,t,n){void 0===n&&(n=function(e,t){return e===t});var r=o.useRef(e);o.useEffect(function(){n(e,r.current)||(t(),r.current=e)})}var j=function(e,t){if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),o=0;o component");return t}var K="undefined"!==typeof window&&window.navigator&&window.navigator.product&&"ReactNative"===window.navigator.product;function Y(e){var t=o.useRef(e);return o.useEffect(function(){t.current=e}),o.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r component");return R((0,r.A)({children:l,component:c,ref:t},x),E,"Field("+v+")")})},2225(e,t,n){"use strict";n.d(t,{b:()=>C});var r=n(10255),i=n.n(r),o=n(80898),a=n(58942),s=n(38845),l=n(64237),c=n(67208),u=n(69298),d=n(97580);var h=n(62509),f=n(13994),p=n(99080);class g{constructor(e,t){this.engine=void 0,this.manager=void 0,this.engine=e,this.manager=t}async apply(e,t){var n,r,i,o,a,s,l,c;let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const d=new f.k(this.engine,this.manager),g=new h.y(this.engine,this.manager,d),m=null===(n=this.engine.store.settings)||void 0===n||null===(r=n.recall)||void 0===r?void 0:r.options,v=null!==(i=u.command)&&void 0!==i?i:"",y=null!==(o=u.enableIcons)&&void 0!==o?o:p.N.resolveIconsEnabled(v,m),b=null!==(a=u.enableColors)&&void 0!==a?a:!!t;await g.infuse(e,{leafNode:e,triplets:[],rootNode:e,detectedPersona:t},{updateTitles:null!==(s=u.updateTitles)&&void 0!==s&&s,visual:{icons:{enabled:y,color:null!==(l=u.iconColor)&&void 0!==l?l:null===m||void 0===m?void 0:m.iconColor,shape:null!==(c=u.iconShape)&&void 0!==c?c:null===m||void 0===m?void 0:m.iconShape},colors:{enabled:b}}})}}var m=n(89379),v=n(27747),y=n(13165),b=n(89692),w=n(5955);class A{constructor(e,t){this.engine=void 0,this.manager=void 0,this.strategy=void 0,this.engine=e,this.manager=t,this.strategy=new v.G(e,t)}async buildHierarchy(e,t){const n=t.map(t=>(0,m.A)((0,m.A)({},t),{},{parentNode:e})),{autoNavigation:r}=this.manager.state;for(;n.length>0;){const e=n.shift();if(!e)break;const{triplets:t,relations:i,title:o,children:a=[],parentNode:s}=e,l=this.manager.createChildBatch(s,{title:o});this.manager.addDispatchBatch((0,u.Wz)(s,l.id)),t&&Array.isArray(t)&&i&&await this.strategy.createNodes(l,t,i),this.engine.control.reorgNodes(1/0,new y.A,l,!0,!r),n.unshift(...a.map(e=>(0,m.A)((0,m.A)({},e),{},{parentNode:l})))}const i=(0,w.W)(e),o=(0,b.z7)(e.title,e.width,e.childrenDimensions,i);this.manager.nodeResize(e,(0,m.A)((0,m.A)({},o),{},{x:e.x,y:e.y}))}}const _=i()("app:Command:Section").extend("ERROR*","::");class C extends o.S{async visualizeSection(e){return await s.F.post("/visualize/section",{body:JSON.stringify(e)})}async getTemplate(e){return await s.F.get("/templates/name/".concat(e.trim()))}async run(e,t){if(!t)return!1;const n=(0,c.Bd)(e,t,this.engine.renderNodes);if(!n||!n.length)return!1;const r=(0,l.qe)(t);if(!r)return!1;const i=d.x.resolveEffectivePersona(t,this.engine.mapId);e.startPrompt();try{var o,s,h,f,p,m;const l=await this.getTemplate(r),c=(e=>{var t,n,r;if(!e)return"";const i=[];return e.description&&i.push("Description: ".concat(e.description)),null!==(t=e.visualProfile)&&void 0!==t&&t.tone&&i.push("Tone: ".concat(e.visualProfile.tone)),null!==(n=e.visualProfile)&&void 0!==n&&n.energy&&i.push("Energy: ".concat(e.visualProfile.energy)),null!==(r=e.visualProfile)&&void 0!==r&&r.sentiment&&i.push("Sentiment: ".concat(e.visualProfile.sentiment)),i.length>0?i.join(", "):""})(i||void 0);if(!n.length||!l)return!1;await this.manager.addDispatch((0,u.i8)(e));const d=(0,a.L)(l),v=null===(o=this.engine.store.settings)||void 0===o||null===(s=o.recall)||void 0===s||null===(h=s.options)||void 0===h?void 0:h.sectionModel,y=null===(f=this.engine.store.settings)||void 0===f||null===(p=f.recall)||void 0===p||null===(m=p.options)||void 0===m?void 0:m.extractionModel,b=await this.visualizeSection({template:d,text:n,baselinePersona:c||void 0,modelName:"auto"===v?void 0:v,extractionModelName:"auto"===y?void 0:y});if(!b)throw new Error("Section visualize failed");const{persona:w,children:_}=b,C=new A(this.engine,this.manager);await C.buildHierarchy(e,_),this.manager.commitDispatches();const x=new g(this.engine,this.manager);await x.apply(e,w,{command:t});const{autoNavigation:E}=this.manager.state;return E&&e.zoomTo(void 0),!0}catch(v){return _("Error in section command: ",v),!1}finally{e.stopPrompt()}}}},2272(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(75438),i=n(35079),o=n(78432),a=()=>{},s=new i.TimeoutError;t.default=class extends r{constructor(e){var t,n,r,i;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=a,this._resolveIdle=a,!("number"===typeof(e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:o.default},e)).intervalCap&&e.intervalCap>=1))throw new TypeError("Expected `intervalCap` to be a number from 1 and up, got `".concat(null!==(n=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==n?n:"","` (").concat(typeof e.intervalCap,")"));if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError("Expected `interval` to be a finite number >= 0, got `".concat(null!==(i=null===(r=e.interval)||void 0===r?void 0:r.toString())&&void 0!==i?i:"","` (").concat(typeof e.interval,")"));this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||0===e.interval,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=!0===e.throwOnTimeout,this._isPaused=!1===e.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()},t)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const t=this._queue.dequeue();return!!t&&(this.emit("active"),t(),e&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!("number"===typeof e&&e>=1))throw new TypeError("Expected `concurrency` to be a number from 1 and up, got `".concat(e,"` (").concat(typeof e,")"));this._concurrency=e,this._processQueue()}async add(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((n,r)=>{this._queue.enqueue(async()=>{this._pendingCount++,this._intervalCount++;try{const o=void 0===this._timeout&&void 0===t.timeout?e():i.default(Promise.resolve(e()),void 0===t.timeout?this._timeout:t.timeout,()=>{(void 0===t.throwOnTimeout?this._throwOnTimeout:t.throwOnTimeout)&&r(s)});n(await o)}catch(o){r(o)}this._next()},t),this._tryToStartAnother(),this.emit("add")})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise(e=>{const t=this._resolveEmpty;this._resolveEmpty=()=>{t(),e()}})}async onIdle(){if(0!==this._pendingCount||0!==this._queue.size)return new Promise(e=>{const t=this._resolveIdle;this._resolveIdle=()=>{t(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}}},2404(e,t,n){var r=n(92813),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},2412(e,t,n){"use strict";n.a(e,async(e,r)=>{try{n.d(t,{EA:()=>y,YE:()=>b,rE:()=>w});var i=n(91041),o=n(33141),a=n(64467),s=n(89379),l=n(82277),c=n(96897),u=n(39790),d=n(55149),h=n(61187),f=n(806),p=n(21114),g={976:(e,t,n)=>{n.d(t,{AnnotationLayer:()=>Be,FreeTextAnnotationElement:()=>he,InkAnnotationElement:()=>xe,StampAnnotationElement:()=>Te});var r=n(292),i=n(419),o=n(792);function a(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function s(e){return Math.max(0,Math.min(255,255*e))}class l{static CMYK_G(e){let[t,n,r,i]=e;return["G",1-Math.min(1,.3*t+.59*r+.11*n+i)]}static G_CMYK(e){let[t]=e;return["CMYK",0,0,0,1-t]}static G_RGB(e){let[t]=e;return["RGB",t,t,t]}static G_rgb(e){let[t]=e;return t=s(t),[t,t,t]}static G_HTML(e){let[t]=e;const n=a(t);return"#".concat(n).concat(n).concat(n)}static RGB_G(e){let[t,n,r]=e;return["G",.3*t+.59*n+.11*r]}static RGB_rgb(e){return e.map(s)}static RGB_HTML(e){return"#".concat(e.map(a).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(e){let[t,n,r,i]=e;return["RGB",1-Math.min(1,t+i),1-Math.min(1,r+i),1-Math.min(1,n+i)]}static CMYK_rgb(e){let[t,n,r,i]=e;return[s(1-Math.min(1,t+i)),s(1-Math.min(1,r+i)),s(1-Math.min(1,n+i))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK(e){let[t,n,r]=e;const i=1-t,o=1-n,a=1-r;return["CMYK",i,o,a,Math.min(i,o,a)]}}var c=n(284);const g=1e3,m=new WeakSet;function v(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class y{static create(e){switch(e.data.annotationType){case r.AnnotationType.LINK:return new D(e);case r.AnnotationType.TEXT:return new I(e);case r.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new M(e);case"Btn":return e.data.radioButton?new j(e):e.data.checkBox?new N(e):new F(e);case"Ch":return new L(e);case"Sig":return new R(e)}return new P(e);case r.AnnotationType.POPUP:return new B(e);case r.AnnotationType.FREETEXT:return new he(e);case r.AnnotationType.LINE:return new pe(e);case r.AnnotationType.SQUARE:return new me(e);case r.AnnotationType.CIRCLE:return new ye(e);case r.AnnotationType.POLYLINE:return new we(e);case r.AnnotationType.CARET:return new _e(e);case r.AnnotationType.INK:return new xe(e);case r.AnnotationType.POLYGON:return new Ae(e);case r.AnnotationType.HIGHLIGHT:return new Ee(e);case r.AnnotationType.UNDERLINE:return new Se(e);case r.AnnotationType.SQUIGGLY:return new De(e);case r.AnnotationType.STRIKEOUT:return new ke(e);case r.AnnotationType.STAMP:return new Te(e);case r.AnnotationType.FILEATTACHMENT:return new Pe(e);default:return new _(e)}}}var b=new WeakMap,w=new WeakMap,A=new WeakSet;class _{constructor(e){let{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,u.A)(this,A),(0,d.A)(this,b,{writable:!0,value:null}),(0,d.A)(this,w,{writable:!0,value:!1}),this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData(e){let{titleObj:t,contentsObj:n,richText:r}=e;return!!(null!==t&&void 0!==t&&t.str||null!==n&&void 0!==n&&n.str||null!==r&&void 0!==r&&r.str)}get hasPopupData(){return _._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;(0,p.A)(this,b)||(0,f.A)(this,b,{rect:this.data.rect.slice(0)});const{rect:t}=e;t&&(0,h.A)(this,A,C).call(this,t)}resetEdited(){(0,p.A)(this,b)&&((0,h.A)(this,A,C).call(this,(0,p.A)(this,b).rect),(0,f.A)(this,b,null))}_createContainer(e){const{data:t,parent:{page:n,viewport:i}}=this,o=document.createElement("section");o.setAttribute("data-annotation-id",t.id),this instanceof P||(o.tabIndex=g);const{style:a}=o;if(a.zIndex=this.parent.zIndex++,t.popupRef&&o.setAttribute("aria-haspopup","dialog"),t.alternativeText&&(o.title=t.alternativeText),t.noRotate&&o.classList.add("norotate"),!t.rect||this instanceof B){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,o),o}const{width:s,height:l}=v(t.rect);if(!e&&t.borderStyle.width>0){a.borderWidth="".concat(t.borderStyle.width,"px");const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t="calc(".concat(e,"px * var(--scale-factor)) / calc(").concat(n,"px * var(--scale-factor))");a.borderRadius=t}else if(this instanceof j){const e="calc(".concat(s,"px * var(--scale-factor)) / calc(").concat(l,"px * var(--scale-factor))");a.borderRadius=e}switch(t.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:a.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:a.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:a.borderBottomStyle="solid"}const i=t.borderColor||null;i?((0,f.A)(this,w,!0),a.borderColor=r.Util.makeHexColor(0|i[0],0|i[1],0|i[2])):a.borderWidth=0}const c=r.Util.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:u,pageHeight:d,pageX:h,pageY:p}=i.rawDims;a.left="".concat(100*(c[0]-h)/u,"%"),a.top="".concat(100*(c[1]-p)/d,"%");const{rotation:m}=t;return t.hasOwnCanvas||0===m?(a.width="".concat(100*s/u,"%"),a.height="".concat(100*l/d,"%")):this.setRotation(m,o),o}setRotation(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims,{width:i,height:o}=v(this.data.rect);let a,s;e%180===0?(a=100*i/n,s=100*o/r):(a=100*o/n,s=100*i/r),t.style.width="".concat(a,"%"),t.style.height="".concat(s,"%"),t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const r=n.detail[e],i=r[0],o=r.slice(1);n.target.style[t]=l["".concat(i,"_HTML")](o),this.annotationStorage.setValue(this.data.id,{[t]:l["".concat(i,"_rgb")](o)})};return(0,r.shadow)(this,"_commonActions",{display:e=>{const{display:t}=e.detail,n=t%2===1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===t||2===t})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:t}=e.detail;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const r of Object.keys(t.detail)){const i=e[r]||n[r];null===i||void 0===i||i(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[r,i]of Object.entries(t)){const o=n[r];if(o){o({detail:{[r]:i},target:e}),delete t[r]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,n,r,i]=this.data.rect;if(1===e.length){const[,{x:o,y:a},{x:s,y:l}]=e[0];if(r===o&&i===a&&t===s&&n===l)return}const{style:o}=this.container;let a;if((0,p.A)(this,w)){const{borderColor:e,borderWidth:t}=o;o.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'','')],this.container.classList.add("hasBorder")}const s=r-t,l=i-n,{svgFactory:c}=this,u=c.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const d=c.createElement("defs");u.append(d);const h=c.createElement("clipPath"),f="clippath_".concat(this.data.id);h.setAttribute("id",f),h.setAttribute("clipPathUnits","objectBoundingBox"),d.append(h);for(const[,{x:p,y:m},{x:v,y:y}]of e){var g;const e=c.createElement("rect"),n=(v-t)/s,r=(i-m)/l,o=(p-v)/s,u=(m-y)/l;e.setAttribute("x",n),e.setAttribute("y",r),e.setAttribute("width",o),e.setAttribute("height",u),h.append(e),null===(g=a)||void 0===g||g.push(''))}(0,p.A)(this,w)&&(a.push("')"),o.backgroundImage=a.join("")),this.container.append(u),this.container.style.clipPath="url(#".concat(f,")")}_createPopup(){const{container:e,data:t}=this;e.setAttribute("aria-haspopup","dialog");const n=new B({data:{color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,parentRect:t.rect,borderStyle:0,id:"popup_".concat(t.id),rotation:t.rotation},parent:this.parent,elements:[this]});this.parent.div.append(n.render())}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];if(this._fieldObjects){const i=this._fieldObjects[e];if(i)for(const{page:e,id:o,exportValues:a}of i){if(-1===e)continue;if(o===t)continue;const i="string"===typeof a?a:null,s=document.querySelector('[data-element-id="'.concat(o,'"]'));!s||m.has(s)?n.push({id:o,exportValue:i,domElement:s}):(0,r.warn)("_getElementsByName - element not allowed: ".concat(o))}return n}for(const r of document.getElementsByName(e)){const{exportValue:e}=r,i=r.getAttribute("data-element-id");i!==t&&(m.has(r)&&n.push({id:i,exportValue:e,domElement:r}))}return n}show(){var e;this.container&&(this.container.hidden=!1),null===(e=this.popup)||void 0===e||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),null===(e=this.popup)||void 0===e||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{var n;null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})})}}function C(e){const{container:{style:t},data:{rect:n,rotation:r},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:o,pageX:a,pageY:s}}}}=this;null===n||void 0===n||n.splice(0,4,...e);const{width:l,height:c}=v(e);t.left="".concat(100*(e[0]-a)/i,"%"),t.top="".concat(100*(o-e[3]+s)/o,"%"),0===r?(t.width="".concat(100*l/i,"%"),t.height="".concat(100*c/o,"%")):this.setRotation(r)}var x=new WeakSet,E=new WeakSet,S=new WeakSet;class D extends _{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(e,{isRenderable:!0,ignoreBorder:!(null===t||void 0===t||!t.ignoreBorder),createQuadrilaterals:!0}),(0,u.A)(this,S),(0,u.A)(this,E),(0,u.A)(this,x),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action),r=!0):e.attachment?((0,h.A)(this,E,T).call(this,n,e.attachment,e.attachmentDest),r=!0):e.setOCGState?((0,h.A)(this,S,O).call(this,n,e.setOCGState),r=!0):e.dest?(this._bindLink(n,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(n),this.container}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&(0,h.A)(this,x,k).call(this)}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),(0,h.A)(this,x,k).call(this)}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(t.actions)){const i=n.get(r);i&&(e[i]=()=>{var e;return null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1})}e.onclick||(e.onclick=()=>!1),(0,h.A)(this,x,k).call(this)}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),(0,h.A)(this,x,k).call(this),!this._fieldObjects)return(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(n||(e.onclick=()=>!1));e.onclick=()=>{null===n||void 0===n||n();const{fields:e,refs:i,include:o}=t,a=[];if(0!==e.length||0!==i.length){const t=new Set(i);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===o&&a.push(n)}else for(const t of Object.values(this._fieldObjects))a.push(...t);const s=this.annotationStorage,l=[];for(const t of a){const{id:e}=t;switch(l.push(e),t.type){case"text":{const n=t.defaultValue||"";s.setValue(e,{value:n});break}case"checkbox":case"radiobutton":{const n=t.defaultValue===t.exportValues;s.setValue(e,{value:n});break}case"combobox":case"listbox":{const n=t.defaultValue||"";s.setValue(e,{value:n});break}default:continue}const n=document.querySelector('[data-element-id="'.concat(e,'"]'));n&&(m.has(n)?n.dispatchEvent(new Event("resetform")):(0,r.warn)("_bindResetFormAction - element not allowed: ".concat(e)))}var c;this.enableScripting&&(null===(c=this.linkService.eventBus)||void 0===c||c.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}));return!1}}}function k(){this.container.setAttribute("data-internal-link","")}function T(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>{var e;return null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(t.content,t.filename,n),!1},(0,h.A)(this,x,k).call(this)}function O(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),(0,h.A)(this,x,k).call(this)}class I extends _{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class P extends _{render(){return this.container}showElementAndHideCanvas(e){var t;this.data.hasOwnCanvas&&("CANVAS"===(null===(t=e.previousSibling)||void 0===t?void 0:t.nodeName)&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return r.FeatureTest.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,r,i){n.includes("mouse")?e.addEventListener(n,e=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(n,e=>{var o;if("blur"===n){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===n){if(t.focused)return;t.focused=!0}i&&(null===(o=this.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:i(e)}}))})}_setEventListeners(e,t,n,r){for(const[s,l]of n){var i,o,a;if("Action"===l||null!==(i=this.data.actions)&&void 0!==i&&i[l])"Focus"!==l&&"Blur"!==l||t||(t={focused:!1}),this._setEventListener(e,t,s,l,r),"Focus"!==l||null!==(o=this.data.actions)&&void 0!==o&&o.Blur?"Blur"!==l||null!==(a=this.data.actions)&&void 0!==a&&a.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null)}}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":r.Util.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||9,o=e.style;let a;const s=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(r.LINE_FACTOR*i))||1);a=Math.min(i,s(t/r.LINE_FACTOR))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(i,s(e/r.LINE_FACTOR))}o.fontSize="calc(".concat(a,"px * var(--scale-factor))"),o.color=r.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(o.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class M extends P{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,r){const i=this.annotationStorage;for(const o of this._getElementsByName(e.name,e.id))o.domElement&&(o.domElement[t]=n),i.setValue(o.id,{[r]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){var r;const s=e.getValue(t,{value:this.data.fieldValue});let l=s.value||"";const c=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;c&&l.length>c&&(l=l.slice(0,c));let u=s.formattedValue||(null===(r=this.data.textContent)||void 0===r?void 0:r.join("\n"))||null;u&&this.data.comb&&(u=u.replaceAll(/\s+/g,""));const d={userValue:l,formattedValue:u,lastCommittedValue:null,commitKey:1,focused:!1};var i,o;if(this.data.multiLine)n=document.createElement("textarea"),n.textContent=null!==(i=u)&&void 0!==i?i:l,this.data.doNotScroll&&(n.style.overflowY="hidden");else n=document.createElement("input"),n.type="text",n.setAttribute("value",null!==(o=u)&&void 0!==o?o:l),this.data.doNotScroll&&(n.style.overflowX="hidden");this.data.hasOwnCanvas&&(n.hidden=!0),m.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=g,this._setRequired(n,this.data.required),c&&(n.maxLength=c),n.addEventListener("input",r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,"value",r.target.value,"value"),d.formattedValue=null}),n.addEventListener("resetform",e=>{var t;const r=null!==(t=this.data.defaultFieldValue)&&void 0!==t?t:"";n.value=d.userValue=r,d.formattedValue=null});let h=e=>{const{formattedValue:t}=d;null!==t&&void 0!==t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var a;n.addEventListener("focus",e=>{var t;if(d.focused)return;const{target:n}=e;d.userValue&&(n.value=d.userValue),d.lastCommittedValue=n.value,d.commitKey=1,null!==(t=this.data.actions)&&void 0!==t&&t.Focus||(d.focused=!0)}),n.addEventListener("updatefromsandbox",n=>{this.showElementAndHideCanvas(n.target);const r={value(n){var r;d.userValue=null!==(r=n.detail.value)&&void 0!==r?r:"",e.setValue(t,{value:d.userValue.toString()}),n.target.value=d.userValue},formattedValue(n){const{formattedValue:r}=n.detail;d.formattedValue=r,null!==r&&void 0!==r&&n.target!==document.activeElement&&(n.target.value=r),e.setValue(t,{formattedValue:r})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{var r;const{charLimit:i}=n.detail,{target:o}=n;if(0===i)return void o.removeAttribute("maxLength");o.setAttribute("maxLength",i);let a=d.userValue;!a||a.length<=i||(a=a.slice(0,i),o.value=d.userValue=a,e.setValue(t,{value:a}),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:o.selectionStart,selEnd:o.selectionEnd}}))}};this._dispatchEventFromSandbox(r,n)}),n.addEventListener("keydown",e=>{var n;d.commitKey=1;let r=-1;if("Escape"===e.key?r=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(d.commitKey=3):r=2,-1===r)return;const{value:i}=e.target;d.lastCommittedValue!==i&&(d.lastCommittedValue=i,d.userValue=i,null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,willCommit:!0,commitKey:r,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});const r=h;h=null,n.addEventListener("blur",e=>{var n;if(!d.focused||!e.relatedTarget)return;null!==(n=this.data.actions)&&void 0!==n&&n.Blur||(d.focused=!1);const{value:i}=e.target;var o;(d.userValue=i,d.lastCommittedValue!==i)&&(null===(o=this.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,willCommit:!0,commitKey:d.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}));r(e)}),null!==(a=this.data.actions)&&void 0!==a&&a.Keystroke&&n.addEventListener("beforeinput",e=>{var n;d.lastCommittedValue=null;const{data:r,target:i}=e,{value:o,selectionStart:a,selectionEnd:s}=i;let l=a,c=s;switch(e.inputType){case"deleteWordBackward":{const e=o.substring(0,a).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=o.substring(a).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":a===s&&(l-=1);break;case"deleteContentForward":a===s&&(c+=1)}e.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,change:r||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(n,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.value)}if(h&&n.addEventListener("blur",h),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/c;n.classList.add("comb"),n.style.letterSpacing="calc(".concat(e,"px * var(--scale-factor) - 1ch)")}}else n=document.createElement("div"),n.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 R extends P{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class N extends P{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"===typeof r&&(r="Off"!==r,e.setValue(n,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return m.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.setAttribute("exportValue",t.exportValue),i.tabIndex=g,i.addEventListener("change",r=>{const{name:i,checked:o}=r.target;for(const a of this._getElementsByName(i,n)){const n=o&&a.exportValue===t.exportValue;a.domElement&&(a.domElement.checked=n),e.setValue(a.id,{value:n})}e.setValue(n,{value:o})}),i.addEventListener("resetform",e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",t=>{const r={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(r,t)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class j extends P{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,n=t.id;let r=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if("string"===typeof r&&(r=r!==t.buttonValue,e.setValue(n,{value:r})),r)for(const o of this._getElementsByName(t.fieldName,n))e.setValue(o.id,{value:!1});const i=document.createElement("input");if(m.add(i),i.setAttribute("data-element-id",n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=t.fieldName,r&&i.setAttribute("checked",!0),i.tabIndex=g,i.addEventListener("change",t=>{const{name:r,checked:i}=t.target;for(const o of this._getElementsByName(r,n))e.setValue(o.id,{value:!1});e.setValue(n,{value:i})}),i.addEventListener("resetform",e=>{const n=t.defaultFieldValue;e.target.checked=null!==n&&void 0!==n&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){const r=t.buttonValue;i.addEventListener("updatefromsandbox",t=>{const i={value:t=>{const i=r===t.detail.value;for(const r of this._getElementsByName(t.target.name)){const t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}};this._dispatchEventFromSandbox(i,t)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class F extends D{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),e}}class L extends P{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement("select");m.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=g;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue;for(const n of r.options)n.selected=n.value===t});for(const c of this.data.options){const e=document.createElement("option");e.textContent=c.displayValue,e.value=c.exportValue,n.value.includes(c.exportValue)&&(e.setAttribute("selected",!0),i=!1),r.append(e)}let o=null;if(i){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),r.prepend(e),o=()=>{e.remove(),r.removeEventListener("input",o),o=null},r.addEventListener("input",o)}const a=e=>{const t=e?"value":"textContent",{options:n,multiple:i}=r;return i?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):-1===n.selectedIndex?null:n[n.selectedIndex][t]};let s=a(!1);const l=e=>{const t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",n=>{const i={value(n){var i;null===(i=o)||void 0===i||i();const l=n.detail.value,c=new Set(Array.isArray(l)?l:[l]);for(const e of r.options)e.selected=c.has(e.value);e.setValue(t,{value:a(!0)}),s=a(!1)},multipleSelection(e){r.multiple=!0},remove(n){const i=r.options,o=n.detail.remove;if(i[o].selected=!1,r.remove(o),i.length>0){-1===Array.prototype.findIndex.call(i,e=>e.selected)&&(i[0].selected=!0)}e.setValue(t,{value:a(!0),items:l(n)}),s=a(!1)},clear(n){for(;0!==r.length;)r.remove(0);e.setValue(t,{value:null,items:[]}),s=a(!1)},insert(n){const{index:i,displayValue:o,exportValue:c}=n.detail.insert,u=r.children[i],d=document.createElement("option");d.textContent=o,d.value=c,u?u.before(d):r.append(d),e.setValue(t,{value:a(!0),items:l(n)}),s=a(!1)},items(n){const{items:i}=n.detail;for(;0!==r.length;)r.remove(0);for(const e of i){const{displayValue:t,exportValue:n}=e,i=document.createElement("option");i.textContent=t,i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:a(!0),items:l(n)}),s=a(!1)},indices(n){const r=new Set(n.detail.indices);for(const e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:a(!0)}),s=a(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(i,n)}),r.addEventListener("input",n=>{var r;const i=a(!0),o=a(!1);e.setValue(t,{value:i}),n.preventDefault(),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,change:o,changeEx:i,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],e=>e.target.value)):r.addEventListener("input",function(n){e.setValue(t,{value:a(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class B extends _{constructor(e){const{data:t,elements:n}=e;super(e,{isRenderable:_._hasPopupData(t)}),this.elements=n}render(){this.container.classList.add("popupAnnotation");const e=new se({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}),t=[];for(const n of this.elements)n.popup=e,t.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",t.map(e=>"".concat(r.AnnotationPrefix).concat(e)).join(",")),this.container}}var z=new WeakMap,U=new WeakMap,G=new WeakMap,H=new WeakMap,W=new WeakMap,V=new WeakMap,q=new WeakMap,K=new WeakMap,Y=new WeakMap,X=new WeakMap,Q=new WeakMap,J=new WeakMap,Z=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakSet,ie=new WeakSet,oe=new WeakSet,ae=new WeakSet;class se{constructor(e){let{container:t,color:n,elements:r,titleObj:o,modificationDate:a,contentsObj:s,richText:l,parent:c,rect:g,parentRect:m,open:v}=e;(0,u.A)(this,ae),(0,u.A)(this,oe),(0,u.A)(this,ie),(0,u.A)(this,re),(0,d.A)(this,z,{writable:!0,value:(0,h.A)(this,re,le).bind(this)}),(0,d.A)(this,U,{writable:!0,value:(0,h.A)(this,ae,de).bind(this)}),(0,d.A)(this,G,{writable:!0,value:(0,h.A)(this,oe,ue).bind(this)}),(0,d.A)(this,H,{writable:!0,value:(0,h.A)(this,ie,ce).bind(this)}),(0,d.A)(this,W,{writable:!0,value:null}),(0,d.A)(this,V,{writable:!0,value:null}),(0,d.A)(this,q,{writable:!0,value:null}),(0,d.A)(this,K,{writable:!0,value:null}),(0,d.A)(this,Y,{writable:!0,value:null}),(0,d.A)(this,X,{writable:!0,value:null}),(0,d.A)(this,Q,{writable:!0,value:null}),(0,d.A)(this,J,{writable:!0,value:!1}),(0,d.A)(this,Z,{writable:!0,value:null}),(0,d.A)(this,$,{writable:!0,value:null}),(0,d.A)(this,ee,{writable:!0,value:null}),(0,d.A)(this,te,{writable:!0,value:null}),(0,d.A)(this,ne,{writable:!0,value:!1}),(0,f.A)(this,V,t),(0,f.A)(this,te,o),(0,f.A)(this,q,s),(0,f.A)(this,ee,l),(0,f.A)(this,X,c),(0,f.A)(this,W,n),(0,f.A)(this,$,g),(0,f.A)(this,Q,m),(0,f.A)(this,Y,r),(0,f.A)(this,K,i.PDFDateString.toDateObject(a)),this.trigger=r.flatMap(e=>e.getElementsToTriggerPopup());for(const i of this.trigger)i.addEventListener("click",(0,p.A)(this,H)),i.addEventListener("mouseenter",(0,p.A)(this,G)),i.addEventListener("mouseleave",(0,p.A)(this,U)),i.classList.add("popupTriggerArea");for(const i of r){var y;null===(y=i.container)||void 0===y||y.addEventListener("keydown",(0,p.A)(this,z))}(0,p.A)(this,V).hidden=!0,v&&(0,h.A)(this,ie,ce).call(this)}render(){if((0,p.A)(this,Z))return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:i,pageY:o}}}=(0,p.A)(this,X),a=(0,f.A)(this,Z,document.createElement("div"));if(a.className="popup",(0,p.A)(this,W)){const e=a.style.outlineColor=r.Util.makeHexColor(...(0,p.A)(this,W));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))a.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;a.style.backgroundColor=r.Util.makeHexColor(...(0,p.A)(this,W).map(t=>Math.floor(e*(255-t)+t)))}}const s=document.createElement("span");s.className="header";const l=document.createElement("h1");if(s.append(l),({dir:l.dir,str:l.textContent}=(0,p.A)(this,te)),a.append(s),(0,p.A)(this,K)){const e=document.createElement("span");e.classList.add("popupDate"),e.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),e.setAttribute("data-l10n-args",JSON.stringify({date:(0,p.A)(this,K).toLocaleDateString(),time:(0,p.A)(this,K).toLocaleTimeString()})),s.append(e)}const u=(0,p.A)(this,q),d=(0,p.A)(this,ee);if(null===d||void 0===d||!d.str||null!==u&&void 0!==u&&u.str&&u.str!==d.str){const e=this._formatContents(u);a.append(e)}else c.XfaLayer.render({xfaHtml:d.html,intent:"richText",div:a}),a.lastChild.classList.add("richText","popupContent");let h=!!(0,p.A)(this,Q),g=h?(0,p.A)(this,Q):(0,p.A)(this,$);for(const c of(0,p.A)(this,Y))if(!g||null!==r.Util.intersect(c.data.rect,g)){g=c.data.rect,h=!0;break}const m=r.Util.normalizeRect([g[0],e[3]-g[1]+e[1],g[2],e[3]-g[3]+e[1]]),v=h?g[2]-g[0]+5:0,y=m[0]+v,b=m[1],{style:w}=(0,p.A)(this,V);w.left="".concat(100*(y-i)/t,"%"),w.top="".concat(100*(b-o)/n,"%"),(0,p.A)(this,V).append(a)}_formatContents(e){let{str:t,dir:n}=e;const r=document.createElement("p");r.classList.add("popupContent"),r.dir=n;const i=t.split(/(?:\r\n?|\n)/);for(let o=0,a=i.length;o{"Enter"===e.key&&(i?e.metaKey:e.ctrlKey)&&(0,h.A)(this,Ie,Me).call(this)}),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return(0,p.A)(this,Oe)}addHighlightArea(){this.container.classList.add("highlightArea")}}function Me(){var e;null===(e=this.downloadManager)||void 0===e||e.openOrDownloadData(this.content,this.filename)}var Re=new WeakMap,Ne=new WeakMap,je=new WeakMap,Fe=new WeakSet,Le=new WeakSet;class Be{constructor(e){let{div:t,accessibilityManager:n,annotationCanvasMap:r,annotationEditorUIManager:i,page:o,viewport:a}=e;(0,u.A)(this,Le),(0,u.A)(this,Fe),(0,d.A)(this,Re,{writable:!0,value:null}),(0,d.A)(this,Ne,{writable:!0,value:null}),(0,d.A)(this,je,{writable:!0,value:new Map}),this.div=t,(0,f.A)(this,Re,n),(0,f.A)(this,Ne,r),this.page=o,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=i}async render(e){const{annotations:t}=e,n=this.div;(0,i.setLayerDimensions)(n,this.viewport);const a=new Map,s={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new i.DOMSVGFactory,annotationStorage:e.annotationStorage||new o.AnnotationStorage,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const i of t){if(i.noHTML)continue;const e=i.annotationType===r.AnnotationType.POPUP;if(e){const e=a.get(i.id);if(!e)continue;s.elements=e}else{const{width:e,height:t}=v(i.rect);if(e<=0||t<=0)continue}s.data=i;const t=y.create(s);if(!t.isRenderable)continue;if(!e&&i.popupRef){const e=a.get(i.popupRef);e?e.push(t):a.set(i.popupRef,[t])}const n=t.render();var l;if(i.hidden&&(n.style.visibility="hidden"),(0,h.A)(this,Fe,ze).call(this,n,i.id),t.annotationEditorType>0)(0,p.A)(this,je).set(t.data.id,t),null===(l=this._annotationEditorUIManager)||void 0===l||l.renderAnnotationElement(t)}(0,h.A)(this,Le,Ue).call(this)}update(e){let{viewport:t}=e;const n=this.div;this.viewport=t,(0,i.setLayerDimensions)(n,{rotation:t.rotation}),(0,h.A)(this,Le,Ue).call(this),n.hidden=!1}getEditableAnnotations(){return Array.from((0,p.A)(this,je).values())}getEditableAnnotation(e){return(0,p.A)(this,je).get(e)}}function ze(e,t){var n;const i=e.firstChild||e;i.id="".concat(r.AnnotationPrefix).concat(t),this.div.append(e),null===(n=(0,p.A)(this,Re))||void 0===n||n.moveElementInDOM(this.div,e,i,!1)}function Ue(){if(!(0,p.A)(this,Ne))return;const e=this.div;for(const[t,n]of(0,p.A)(this,Ne)){const r=e.querySelector('[data-annotation-id="'.concat(t,'"]'));if(!r)continue;n.className="annotationContent";const{firstChild:i}=r;i?"CANVAS"===i.nodeName?i.replaceWith(n):i.classList.contains("annotationContent")?i.after(n):i.before(n):r.append(n)}(0,p.A)(this,Ne).clear()}},792:(e,t,n)=>{n.d(t,{AnnotationStorage:()=>g,PrintAnnotationStorage:()=>y,SerializableEmpty:()=>a});var r=n(292),i=n(310),o=n(651);const a=Object.freeze({map:null,hash:"",transfer:void 0});var s=new WeakMap,l=new WeakMap,c=new WeakSet;class g{constructor(){(0,u.A)(this,c),(0,d.A)(this,s,{writable:!0,value:!1}),(0,d.A)(this,l,{writable:!0,value:new Map}),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=(0,p.A)(this,l).get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return(0,p.A)(this,l).get(e)}remove(e){if((0,p.A)(this,l).delete(e),0===(0,p.A)(this,l).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const e of(0,p.A)(this,l).values())if(e instanceof i.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=(0,p.A)(this,l).get(e);let r=!1;if(void 0!==n)for(const[i,o]of Object.entries(t))n[i]!==o&&(r=!0,n[i]=o);else r=!0,(0,p.A)(this,l).set(e,t);r&&(0,h.A)(this,c,m).call(this),t instanceof i.AnnotationEditor&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return(0,p.A)(this,l).has(e)}getAll(){return(0,p.A)(this,l).size>0?(0,r.objectFromMap)((0,p.A)(this,l)):null}setAll(e){for(const[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return(0,p.A)(this,l).size}resetModified(){(0,p.A)(this,s)&&((0,f.A)(this,s,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new y(this)}get serializable(){if(0===(0,p.A)(this,l).size)return a;const e=new Map,t=new o.MurmurHash3_64,n=[],r=Object.create(null);let s=!1;for(const[o,a]of(0,p.A)(this,l)){const n=a instanceof i.AnnotationEditor?a.serialize(!1,r):a;n&&(e.set(o,n),t.update("".concat(o,":").concat(JSON.stringify(n))),s||(s=!!n.bitmap))}if(s)for(const i of e.values())i.bitmap&&n.push(i.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:a}get editorStats(){let e=null;const t=new Map;for(const o of(0,p.A)(this,l).values()){var n;if(!(o instanceof i.AnnotationEditor))continue;const a=o.telemetryFinalData;if(!a)continue;const{type:s}=a;t.has(s)||t.set(s,Object.getPrototypeOf(o).constructor),e||(e=Object.create(null));const l=(n=e)[s]||(n[s]=new Map);for(const[e,t]of Object.entries(a)){var r;if("type"===e)continue;let n=l.get(e);n||(n=new Map,l.set(e,n));const i=null!==(r=n.get(t))&&void 0!==r?r:0;n.set(t,i+1)}}for(const[i,o]of t)e[i]=o.computeTelemetryFinalData(e[i]);return e}}function m(){(0,p.A)(this,s)||((0,f.A)(this,s,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var v=new WeakMap;class y extends g{constructor(e){super(),(0,d.A)(this,v,{writable:!0,value:void 0});const{map:t,hash:n,transfer:r}=e.serializable,i=structuredClone(t,r?{transfer:r}:null);(0,f.A)(this,v,{map:i,hash:n,transfer:r})}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return(0,p.A)(this,v)}}},831:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{PDFDataRangeTransport:()=>ce,PDFWorker:()=>me,build:()=>Se,getDocument:()=>re,version:()=>Ee});var i=n(292),o=n(792),a=n(419),g=n(10),m=n(573),v=n(923),y=n(814),b=n(164),w=n(178),A=n(62),_=n(626),C=n(585),x=n(94),E=n(457),S=n(786),D=n(50),k=e([m,S]);[m,S]=k.then?(await k)():k;const Q=65536,J=100,Z=5e3,$=i.isNodeJS?m.NodeCanvasFactory:a.DOMCanvasFactory,ee=i.isNodeJS?m.NodeCMapReaderFactory:a.DOMCMapReaderFactory,te=i.isNodeJS?m.NodeFilterFactory:a.DOMFilterFactory,ne=i.isNodeJS?m.NodeStandardFontDataFactory:a.DOMStandardFontDataFactory;function re(e){var t,n;if("string"===typeof e||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e}),"object"!==typeof e)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!e.url&&!e.data&&!e.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const r=new le,{docId:o}=r,s=e.url?oe(e.url):null,l=e.data?ae(e.data):null,c=e.httpHeaders||null,u=!0===e.withCredentials,d=null!==(t=e.password)&&void 0!==t?t:null,h=e.range instanceof ce?e.range:null,f=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:Q;let p=e.worker instanceof me?e.worker:null;const g=e.verbosity,m="string"!==typeof e.docBaseUrl||(0,a.isDataScheme)(e.docBaseUrl)?null:e.docBaseUrl,v="string"===typeof e.cMapUrl?e.cMapUrl:null,y=!1!==e.cMapPacked,A=e.CMapReaderFactory||ee,_="string"===typeof e.standardFontDataUrl?e.standardFontDataUrl:null,D=e.StandardFontDataFactory||ne,k=!0!==e.stopAtErrors,T=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,O=!1!==e.isEvalSupported,I="boolean"===typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!i.isNodeJS,P=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,M="boolean"===typeof e.disableFontFace?e.disableFontFace:i.isNodeJS,R=!0===e.fontExtraProperties,N=!0===e.enableXfa,j=e.ownerDocument||globalThis.document,F=!0===e.disableRange,L=!0===e.disableStream,B=!0===e.disableAutoFetch,z=!0===e.pdfBug,U=h?h.length:null!==(n=e.length)&&void 0!==n?n:NaN,G="boolean"===typeof e.useSystemFonts?e.useSystemFonts:!i.isNodeJS&&!M,H="boolean"===typeof e.useWorkerFetch?e.useWorkerFetch:A===a.DOMCMapReaderFactory&&D===a.DOMStandardFontDataFactory&&v&&_&&(0,a.isValidFetchUrl)(v,document.baseURI)&&(0,a.isValidFetchUrl)(_,document.baseURI),W=e.canvasFactory||new $({ownerDocument:j}),V=e.filterFactory||new te({docId:o,ownerDocument:j});(0,i.setVerbosityLevel)(g);const q={canvasFactory:W,filterFactory:V};if(H||(q.cMapReaderFactory=new A({baseUrl:v,isCompressed:y}),q.standardFontDataFactory=new D({baseUrl:_})),!p){const e={verbosity:g,port:b.GlobalWorkerOptions.workerPort};p=e.port?me.fromPort(e):new me(e),r._worker=p}const K={docId:o,apiVersion:"4.2.67",data:l,password:d,disableAutoFetch:B,rangeChunkSize:f,length:U,docBaseUrl:m,enableXfa:N,evaluatorOptions:{maxImageSize:T,disableFontFace:M,ignoreErrors:k,isEvalSupported:O,isOffscreenCanvasSupported:I,canvasMaxAreaInBytes:P,fontExtraProperties:R,useSystemFonts:G,cMapUrl:H?v:null,standardFontDataUrl:H?_:null}},Y={ignoreErrors:k,disableFontFace:M,fontExtraProperties:R,enableXfa:N,ownerDocument:j,disableAutoFetch:B,pdfBug:z,styleElement:null};return p.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");const e=ie(p,K),t=new Promise(function(e){let t;if(h)t=new C.PDFDataTransportStream(h,{disableRange:F,disableStream:L});else if(!l){t=(e=>{if(i.isNodeJS){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&(0,a.isValidFetchUrl)(e.url)?new x.PDFFetchStream(e):new S.PDFNodeStream(e)}return(0,a.isValidFetchUrl)(e.url)?new x.PDFFetchStream(e):new E.PDFNetworkStream(e)})({url:s,length:U,httpHeaders:c,withCredentials:u,rangeChunkSize:f,disableRange:F,disableStream:L})}e(t)});return Promise.all([e,t]).then(function(e){let[t,n]=e;if(r.destroyed)throw new Error("Loading aborted");const i=new w.MessageHandler(o,t,p.port),a=new ye(i,r,n,Y,q);r._transport=a,i.send("Ready",null)})}).catch(r._capability.reject),r}async function ie(e,t){if(e.destroyed)throw new Error("Worker was destroyed");const n=await e.messageHandler.sendWithPromise("GetDocRequest",t,t.data?[t.data.buffer]:null);if(e.destroyed)throw new Error("Worker was destroyed");return n}function oe(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch(t){if(i.isNodeJS&&"string"===typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function ae(e){if(i.isNodeJS&&"undefined"!==typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"===typeof e)return(0,i.stringToBytes)(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||"object"===typeof e&&!isNaN(null===e||void 0===e?void 0:e.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function se(e){return"object"===typeof e&&Number.isInteger(null===e||void 0===e?void 0:e.num)&&e.num>=0&&Number.isInteger(null===e||void 0===e?void 0:e.gen)&&e.gen>=0}class le{constructor(){var e,t;this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d".concat(((0,l.A)(le,le,T,(e=(0,c.A)(le,le,T),t=e++,e)),t)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var e,t;null!==(e=this._worker)&&void 0!==e&&e.port&&(this._worker._pendingDestroy=!0),await(null===(t=this._transport)||void 0===t?void 0:t.destroy())}catch(r){var n;throw null!==(n=this._worker)&&void 0!==n&&n.port&&delete this._worker._pendingDestroy,r}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var T={writable:!0,value:0};class ce{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(const n of this._progressListeners)n(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){(0,i.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class ue{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,i.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:e="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var O=new WeakMap,I=new WeakMap,P=new WeakSet,M=new WeakSet;class de{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,u.A)(this,M),(0,u.A)(this,P),(0,d.A)(this,O,{writable:!0,value:null}),(0,d.A)(this,I,{writable:!0,value:!1}),this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=r?new a.StatTimer:null,this._pdfBug=r,this.commonObjs=n.commonObjs,this.objs=new Ae,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new a.PageViewport({viewBox:this.view,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations(){let{intent:e="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,i.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return(null===(e=this._transport._htmlForXfa)||void 0===e?void 0:e.children[this._pageIndex])||null}render(e){var t,n;let{canvasContext:r,viewport:o,intent:a="display",annotationMode:s=i.AnnotationMode.ENABLE,transform:l=null,background:c=null,optionalContentConfigPromise:u=null,annotationCanvasMap:d=null,pageColors:p=null,printAnnotationStorage:g=null}=e;null===(t=this._stats)||void 0===t||t.time("Overall");const m=this._transport.getRenderingIntent(a,s,g),{renderingIntent:v,cacheKey:y}=m;(0,f.A)(this,I,!1),(0,h.A)(this,M,fe).call(this),u||(u=this._transport.getOptionalContentConfig(v));let b=this._intentStates.get(y);b||(b=Object.create(null),this._intentStates.set(y,b)),b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);const w=!!(v&i.RenderingIntentFlag.PRINT);var A;b.displayReadyCapability||(b.displayReadyCapability=Promise.withResolvers(),b.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(A=this._stats)||void 0===A||A.time("Page Request"),this._pumpOperatorList(m));const _=e=>{var t,n;b.renderTasks.delete(C),(this._maybeCleanupAfterRender||w)&&(0,f.A)(this,I,!0),(0,h.A)(this,P,he).call(this,!w),e?(C.capability.reject(e),this._abortOperatorList({intentState:b,reason:e instanceof Error?e:new Error(e)})):C.capability.resolve(),null===(t=this._stats)||void 0===t||t.timeEnd("Rendering"),null===(n=this._stats)||void 0===n||n.timeEnd("Overall")},C=new xe({callback:_,params:{canvasContext:r,viewport:o,transform:l,background:c},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:b.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:p});((n=b).renderTasks||(n.renderTasks=new Set)).add(C);const x=C.task;return Promise.all([b.displayReadyCapability.promise,u]).then(e=>{var t;let[n,r]=e;if(this.destroyed)_();else{if(null===(t=this._stats)||void 0===t||t.time("Rendering"),!(r.renderingIntent&v))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");C.initializeGraphics({transparency:n,optionalContentConfig:r}),C.operatorListChanged()}}).catch(_),x}getOperatorList(){let{intent:e="display",annotationMode:t=i.AnnotationMode.ENABLE,printAnnotationStorage:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=this._transport.getRenderingIntent(e,t,n,!0);let o,a=this._intentStates.get(r.cacheKey);var s,l;(a||(a=Object.create(null),this._intentStates.set(r.cacheKey,a)),a.opListReadCapability)||(o=Object.create(null),o.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(o))},a.opListReadCapability=Promise.withResolvers(),((s=a).renderTasks||(s.renderTasks=new Set)).add(o),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(l=this._stats)||void 0===l||l.time("Page Request"),this._pumpOperatorList(r));return a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:e=!1,disableNormalization:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(e=>D.XfaText.textContent(e));const t=this.streamTextContent(e);return new Promise(function(e,n){const r=t.getReader(),i={items:[],styles:Object.create(null)};!function t(){r.read().then(function(n){let{value:r,done:o}=n;o?e(i):(Object.assign(i.styles,r.styles),i.items.push(...r.items),t())},n)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),(0,f.A)(this,I,!1),(0,h.A)(this,M,fe).call(this),Promise.all(e)}cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,f.A)(this,I,!0);const t=(0,h.A)(this,P,he).call(this,!1);return e&&t&&this._stats&&(this._stats=new a.StatTimer),t}_startRenderPage(e,t){var n,r;const i=this._intentStates.get(t);i&&(null===(n=this._stats)||void 0===n||n.timeEnd("Page Request"),null===(r=i.displayReadyCapability)||void 0===r||r.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n{a.read().then(e=>{let{value:t,done:n}=e;n?s.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,s),l())},e=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(const e of s.renderTasks)e.operatorListChanged();(0,h.A)(this,P,he).call(this,!0)}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else{if(!s.opListReadCapability)throw e;s.opListReadCapability.reject(e)}}})};l()}_abortOperatorList(e){let{intentState:t,reason:n,force:r=!1}=e;if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!r){if(t.renderTasks.size>0)return;if(n instanceof a.RenderingCancelledException){let e=J;return n.extraDelay>0&&n.extraDelay<1e3&&(e+=n.extraDelay),void(t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:n,force:!0})},e))}}if(t.streamReader.cancel(new i.AbortException(n.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[e,n]of this._intentStates)if(n===t){this._intentStates.delete(e);break}this.cleanup()}}}get stats(){return this._stats}}function he(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if((0,h.A)(this,M,fe).call(this),!(0,p.A)(this,I)||this.destroyed)return!1;if(e)return(0,f.A)(this,O,setTimeout(()=>{(0,f.A)(this,O,null),(0,h.A)(this,P,he).call(this,!1)},Z)),!1;for(const{renderTasks:t,operatorList:n}of this._intentStates.values())if(t.size>0||!n.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),(0,f.A)(this,I,!1),!0}function fe(){(0,p.A)(this,O)&&(clearTimeout((0,p.A)(this,O)),(0,f.A)(this,O,null))}var R=new WeakMap,N=new WeakMap;class pe{constructor(){(0,d.A)(this,R,{writable:!0,value:new Set}),(0,d.A)(this,N,{writable:!0,value:Promise.resolve()})}postMessage(e,t){const n={data:structuredClone(e,t?{transfer:t}:null)};(0,p.A)(this,N).then(()=>{for(const e of(0,p.A)(this,R))e.call(this,n)})}addEventListener(e,t){(0,p.A)(this,R).add(t)}removeEventListener(e,t){(0,p.A)(this,R).delete(t)}terminate(){(0,p.A)(this,R).clear()}}const ge={isWorkerDisabled:!1,fakeWorkerId:0};var j;if(i.isNodeJS)ge.isWorkerDisabled=!0,(j=b.GlobalWorkerOptions).workerSrc||(j.workerSrc="./pdf.worker.mjs");ge.isSameOrigin=function(e,t){let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch(i){return!1}const r=new URL(t,n);return n.origin===r.origin},ge.createCDNWrapper=function(e){const t='await import("'.concat(e,'");');return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};class me{constructor(){let{name:e=null,port:t=null,verbosity:n=(0,i.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,t){var r;if(null!==(r=(0,c.A)(me,me,L))&&void 0!==r&&r.has(t))throw new Error("Cannot use more than one PDFWorker per port.");return((0,c.A)(me,me,L)||(0,l.A)(me,me,L,new WeakMap)).set(t,this),void this._initializeFromPort(t)}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new w.MessageHandler("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!ge.isWorkerDisabled&&!(0,c.A)(me,me,F)){let{workerSrc:t}=me;try{ge.isSameOrigin(window.location.href,t)||(t=ge.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),n=new w.MessageHandler("main","worker",e),r=()=>{e.removeEventListener("error",i),n.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||r()};e.addEventListener("error",i),n.on("test",t=>{e.removeEventListener("error",i),this.destroyed?r():t?(this._messageHandler=n,this._port=e,this._webWorker=e,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),n.destroy(),e.terminate())}),n.on("ready",t=>{if(e.removeEventListener("error",i),this.destroyed)r();else try{o()}catch(n){this._setupFakeWorker()}});const o=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void o()}catch(e){(0,i.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){ge.isWorkerDisabled||((0,i.warn)("Setting up fake worker."),ge.isWorkerDisabled=!0),me._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new pe;this._port=t;const n="fake".concat(ge.fakeWorkerId++),r=new w.MessageHandler(n+"_worker",n,t);e.setup(r,t);const i=new w.MessageHandler(n,n+"_worker",t);this._messageHandler=i,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})}).catch(e=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(e.message,'".')))})}destroy(){var e;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(e=(0,c.A)(me,me,L))||void 0===e||e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){var t;if(null===e||void 0===e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const n=null===(t=(0,c.A)(this,me,L))||void 0===t?void 0:t.get(e.port);if(n){if(n._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new me(e)}static get workerSrc(){if(b.GlobalWorkerOptions.workerSrc)return b.GlobalWorkerOptions.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return(0,i.shadow)(this,"_setupFakeWorkerGlobal",(async()=>{if((0,c.A)(this,me,F))return(0,c.A)(this,me,F);return(await import(this.workerSrc)).WorkerMessageHandler})())}}function ve(){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(t){return null}}var F={get:ve,set:void 0},L={writable:!0,value:void 0},B=new WeakMap,z=new WeakMap,U=new WeakMap,G=new WeakMap,H=new WeakMap,W=new WeakSet;class ye{constructor(e,t,n,r,i){(0,u.A)(this,W),(0,d.A)(this,B,{writable:!0,value:new Map}),(0,d.A)(this,z,{writable:!0,value:new Map}),(0,d.A)(this,U,{writable:!0,value:new Map}),(0,d.A)(this,G,{writable:!0,value:new Map}),(0,d.A)(this,H,{writable:!0,value:null}),this.messageHandler=e,this.loadingTask=t,this.commonObjs=new Ae,this.fontLoader=new g.FontLoader({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return(0,i.shadow)(this,"annotationStorage",new o.AnnotationStorage)}getRenderingIntent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.AnnotationMode.ENABLE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=i.RenderingIntentFlag.DISPLAY,s=o.SerializableEmpty;switch(e){case"any":a=i.RenderingIntentFlag.ANY;break;case"display":break;case"print":a=i.RenderingIntentFlag.PRINT;break;default:(0,i.warn)("getRenderingIntent - invalid intent: ".concat(e))}switch(t){case i.AnnotationMode.DISABLE:a+=i.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case i.AnnotationMode.ENABLE:break;case i.AnnotationMode.ENABLE_FORMS:a+=i.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case i.AnnotationMode.ENABLE_STORAGE:a+=i.RenderingIntentFlag.ANNOTATIONS_STORAGE;s=(a&i.RenderingIntentFlag.PRINT&&n instanceof o.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,i.warn)("getRenderingIntent - invalid annotationMode: ".concat(t))}return r&&(a+=i.RenderingIntentFlag.OPLIST),{renderingIntent:a,cacheKey:"".concat(a,"_").concat(s.hash),annotationStorageSerializable:s}}destroy(){var e;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(e=(0,p.A)(this,H))||void 0===e||e.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const r of(0,p.A)(this,z).values())t.push(r._destroy());(0,p.A)(this,z).clear(),(0,p.A)(this,U).clear(),(0,p.A)(this,G).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const n=this.messageHandler.sendWithPromise("Terminate",null);return t.push(n),Promise.all(t).then(()=>{var e;this.commonObjs.clear(),this.fontLoader.clear(),(0,p.A)(this,B).clear(),this.filterFactory.destroy(),(0,y.cleanupTextLayer)(),null===(e=this._networkStream)||void 0===e||e.cancelAllRequests(new i.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(e,t)=>{(0,i.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then(function(e){let{value:n,done:r}=e;r?t.close():((0,i.assert)(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(n),1,[n]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on("ReaderHeadersReady",e=>{const n=Promise.withResolvers(),r=this._fullReader;return r.headersReady.then(()=>{if(!r.isStreamingSupported||!r.isRangeSupported){var e;if(this._lastProgress)null===(e=t.onProgress)||void 0===e||e.call(t,this._lastProgress);r.onProgress=e=>{var n;null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded,total:e.total})}}n.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},n.reject),n.promise}),e.on("GetRangeReader",(e,t)=>{(0,i.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function(e){let{value:n,done:r}=e;r?t.close():((0,i.assert)(n instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(n),1,[n]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on("GetDoc",e=>{let{pdfInfo:n}=e;this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new ue(n,this))}),e.on("DocException",function(e){let n;switch(e.name){case"PasswordException":n=new i.PasswordException(e.message,e.code);break;case"InvalidPDFException":n=new i.InvalidPDFException(e.message);break;case"MissingPDFException":n=new i.MissingPDFException(e.message);break;case"UnexpectedResponseException":n=new i.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":n=new i.UnknownErrorException(e.message,e.details);break;default:(0,i.unreachable)("DocException - expected a valid Error.")}t._capability.reject(n)}),e.on("PasswordRequest",e=>{if((0,f.A)(this,H,Promise.withResolvers()),t.onPassword){const r=e=>{e instanceof Error?(0,p.A)(this,H).reject(e):(0,p.A)(this,H).resolve({password:e})};try{t.onPassword(r,e.code)}catch(n){(0,p.A)(this,H).reject(n)}}else(0,p.A)(this,H).reject(new i.PasswordException(e.message,e.code));return(0,p.A)(this,H).promise}),e.on("DataLoaded",e=>{var n;null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on("StartRenderPage",e=>{if(this.destroyed)return;(0,p.A)(this,z).get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on("commonobj",t=>{var n;let[r,o,a]=t;if(this.destroyed)return null;if(this.commonObjs.has(r))return null;switch(o){case"Font":const t=this._params;if("error"in a){const e=a.error;(0,i.warn)("Error during font loading: ".concat(e)),this.commonObjs.resolve(r,e);break}const s=t.pdfBug&&null!==(n=globalThis.FontInspector)&&void 0!==n&&n.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,l=new g.FontFaceObject(a,{disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,inspectFont:s});this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!t.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(r,l)});break;case"CopyLocalImage":const{imageRef:c}=a;(0,i.assert)(c,"The imageRef must be defined.");for(const e of(0,p.A)(this,z).values())for(const[,t]of e.objs)if(t.ref===c)return t.dataLen?(this.commonObjs.resolve(r,structuredClone(t)),t.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,a);break;default:throw new Error("Got unknown common object type ".concat(o))}return null}),e.on("obj",e=>{let[t,n,r,o]=e;if(this.destroyed)return;const a=(0,p.A)(this,z).get(n);var s;if(!a.objs.has(t))if(0!==a._intentStates.size)switch(r){case"Image":a.objs.resolve(t,o),(null===o||void 0===o?void 0:o.dataLen)>i.MAX_IMAGE_SIZE_TO_CACHE&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(t,o);break;default:throw new Error("Got unknown object type ".concat(r))}else null===o||void 0===o||null===(s=o.bitmap)||void 0===s||s.close()}),e.on("DocProgress",e=>{var n;this.destroyed||null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded,total:e.total})}),e.on("FetchBuiltInCMap",e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(e):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),e.on("FetchStandardFontData",e=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(e):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var e,t;this.annotationStorage.size<=0&&(0,i.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:n,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:n,filename:null!==(e=null===(t=this._fullReader)||void 0===t?void 0:t.filename)&&void 0!==e?e:null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=(0,p.A)(this,U).get(t);if(n)return n;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&(0,p.A)(this,G).set(n.refStr,e);const r=new de(t,n,this,this._params.pdfBug);return(0,p.A)(this,z).set(t,r),r});return(0,p.A)(this,U).set(t,r),r}getPageIndex(e){return se(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return(0,h.A)(this,W,be).call(this,"GetFieldObjects")}hasJSActions(){return(0,h.A)(this,W,be).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!==typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return(0,h.A)(this,W,be).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return(0,h.A)(this,W,be).call(this,"GetOptionalContentConfig").then(t=>new _.OptionalContentConfig(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=(0,p.A)(this,B).get(e);if(t)return t;const n=this.messageHandler.sendWithPromise(e,null).then(e=>{var t,n,r,i;return{info:e[0],metadata:e[1]?new A.Metadata(e[1]):null,contentDispositionFilename:null!==(t=null===(n=this._fullReader)||void 0===n?void 0:n.filename)&&void 0!==t?t:null,contentLength:null!==(r=null===(i=this._fullReader)||void 0===i?void 0:i.contentLength)&&void 0!==r?r:null}});return(0,p.A)(this,B).set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of(0,p.A)(this,z).values()){if(!e.cleanup())throw new Error("startCleanup: Page ".concat(e.pageNumber," is currently rendering."))}this.commonObjs.clear(),e||this.fontLoader.clear(),(0,p.A)(this,B).clear(),this.filterFactory.destroy(!0),(0,y.cleanupTextLayer)()}}cachedPageNumber(e){var t;if(!se(e))return null;const n=0===e.gen?"".concat(e.num,"R"):"".concat(e.num,"R").concat(e.gen);return null!==(t=(0,p.A)(this,G).get(n))&&void 0!==t?t:null}get loadingParams(){const{disableAutoFetch:e,enableXfa:t}=this._params;return(0,i.shadow)(this,"loadingParams",{disableAutoFetch:e,enableXfa:t})}}function be(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,p.A)(this,B).get(e);if(n)return n;const r=this.messageHandler.sendWithPromise(e,t);return(0,p.A)(this,B).set(e,r),r}const we=Symbol("INITIAL_DATA");var V=new WeakMap,q=new WeakSet;class Ae{constructor(){(0,u.A)(this,q),(0,d.A)(this,V,{writable:!0,value:Object.create(null)})}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t){const n=(0,h.A)(this,q,_e).call(this,e);return n.promise.then(()=>t(n.data)),null}const n=(0,p.A)(this,V)[e];if(!n||n.data===we)throw new Error("Requesting object that isn't resolved yet ".concat(e,"."));return n.data}has(e){const t=(0,p.A)(this,V)[e];return!!t&&t.data!==we}resolve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,h.A)(this,q,_e).call(this,e);n.data=t,n.resolve()}clear(){for(const t in(0,p.A)(this,V)){var e;const{data:n}=(0,p.A)(this,V)[t];null===n||void 0===n||null===(e=n.bitmap)||void 0===e||e.close()}(0,f.A)(this,V,Object.create(null))}*[Symbol.iterator](){for(const e in(0,p.A)(this,V)){const{data:t}=(0,p.A)(this,V)[e];t!==we&&(yield[e,t])}}}function _e(e){var t;return(t=(0,p.A)(this,V))[e]||(t[e]=(0,s.A)((0,s.A)({},Promise.withResolvers()),{},{data:we}))}var K=new WeakMap;class Ce{constructor(e){(0,d.A)(this,K,{writable:!0,value:null}),(0,f.A)(this,K,e),this.onContinue=null}get promise(){return(0,p.A)(this,K).capability.promise}cancel(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,p.A)(this,K).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=(0,p.A)(this,K).operatorList;if(!e)return!1;const{annotationCanvasMap:t}=(0,p.A)(this,K);return e.form||e.canvas&&(null===t||void 0===t?void 0:t.size)>0}}class xe{constructor(e){let{callback:t,params:n,objs:r,commonObjs:i,annotationCanvasMap:o,operatorList:a,pageIndex:s,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:d=!1,pageColors:h=null}=e;this.callback=t,this.params=n,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=o,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=s,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===u&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Ce(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=n.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(e){var t,n;let{transparency:r=!1,optionalContentConfig:i}=e;if(this.cancelled)return;if(this._canvas){if((0,c.A)(xe,xe,Y).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");(0,c.A)(xe,xe,Y).add(this._canvas)}this._pdfBug&&null!==(t=globalThis.StepperManager)&&void 0!==t&&t.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:o,viewport:a,transform:s,background:l}=this.params;this.gfx=new v.CanvasGraphics(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:a,transparency:r,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(n=this.graphicsReadyCallback)||void 0===n||n.call(this)}cancel(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(e=this.gfx)||void 0===e||e.endDrawing(),(0,c.A)(xe,xe,Y).delete(this._canvas),this.callback(t||new a.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),n))}operatorListChanged(){var e;this.graphicsReady?(null===(e=this.stepper)||void 0===e||e.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{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(),(0,c.A)(xe,xe,Y).delete(this._canvas),this.callback())))}}var Y={writable:!0,value:new WeakSet};const Ee="4.2.67",Se="49b388101";r()}catch(X){r(X)}})},583:(e,t,n)=>{n.d(t,{BaseCMapReaderFactory:()=>a,BaseCanvasFactory:()=>o,BaseFilterFactory:()=>i,BaseSVGFactory:()=>l,BaseStandardFontDataFactory:()=>s});var r=n(292);class i{constructor(){this.constructor===i&&(0,r.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addHighlightHCMFilter(e,t,n,r,i){return"none"}destroy(){}}class o{constructor(){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d")}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}class a{constructor(e){let{baseUrl:t=null,isCompressed:n=!0}=e;this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=n}async fetch(e){let{name:t}=e;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const n=this.baseUrl+t+(this.isCompressed?".bcmap":""),i=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(n,i).catch(e=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(n))})}_fetchData(e,t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}class s{constructor(e){let{baseUrl:t=null}=e;this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch(e){let{filename:t}=e;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const n="".concat(this.baseUrl).concat(t);return this._fetchData(n).catch(e=>{throw new Error("Unable to load font data at: ".concat(n))})}_fetchData(e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}class l{constructor(){this.constructor===l&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),n||(r.setAttribute("width","".concat(e,"px")),r.setAttribute("height","".concat(t,"px"))),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox","0 0 ".concat(e," ").concat(t)),r}createElement(e){if("string"!==typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){(0,r.unreachable)("Abstract method `_createSVG` called.")}}},923:(e,t,n)=>{n.d(t,{CanvasGraphics:()=>G});var r=n(292),i=n(419);const o="Fill",s="Stroke",l="Shading";function c(e,t){if(!t)return;const n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}class d{constructor(){this.constructor===d&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class f extends d{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const n of this._colorStops)t.addColorStop(n[0],n[1]);return t}getPattern(e,t,n,a){let l;if(a===s||a===o){const o=t.current.getClippedPathBoundingBox(a,(0,i.getCurrentTransform)(e))||[0,0,0,0],s=Math.ceil(o[2]-o[0])||1,u=Math.ceil(o[3]-o[1])||1,d=t.cachedCanvases.getCanvas("pattern",s,u,!0),h=d.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-o[0],-o[1]),n=r.Util.transform(n,[1,0,0,1,o[0],o[1]]),h.transform(...t.baseTransform),this.matrix&&h.transform(...this.matrix),c(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),l=e.createPattern(d.canvas,"no-repeat");const f=new DOMMatrix(n);l.setTransform(f)}else c(e,this._bbox),l=this._createGradient(e);return l}}function p(e,t,n,r,i,o,a,s){const l=t.coords,c=t.colors,u=e.data,d=4*e.width;let h;l[n+1]>l[r+1]&&(h=n,n=r,r=h,h=o,o=a,a=h),l[r+1]>l[i+1]&&(h=r,r=i,i=h,h=a,a=s,s=h),l[n+1]>l[r+1]&&(h=n,n=r,r=h,h=o,o=a,a=h);const f=(l[n]+t.offsetX)*t.scaleX,p=(l[n+1]+t.offsetY)*t.scaleY,g=(l[r]+t.offsetX)*t.scaleX,m=(l[r+1]+t.offsetY)*t.scaleY,v=(l[i]+t.offsetX)*t.scaleX,y=(l[i+1]+t.offsetY)*t.scaleY;if(p>=y)return;const b=c[o],w=c[o+1],A=c[o+2],_=c[a],C=c[a+1],x=c[a+2],E=c[s],S=c[s+1],D=c[s+2],k=Math.round(p),T=Math.round(y);let O,I,P,M,R,N,j,F;for(let L=k;L<=T;L++){if(Ly?1:m===y?0:(m-L)/(m-y),O=g-(g-v)*e,I=_-(_-E)*e,P=C-(C-S)*e,M=x-(x-D)*e}let e;e=Ly?1:(p-L)/(p-y),R=f-(f-v)*e,N=b-(b-E)*e,j=w-(w-S)*e,F=A-(A-D)*e;const t=Math.round(Math.min(O,R)),n=Math.round(Math.max(O,R));let r=d*L+4*t;for(let i=t;i<=n;i++)e=(O-i)/(O-R),e<0?e=0:e>1&&(e=1),u[r++]=I-(I-N)*e|0,u[r++]=P-(P-j)*e|0,u[r++]=M-(M-F)*e|0,u[r++]=255}}function g(e,t,n){const r=t.coords,i=t.colors;let o,a;switch(t.type){case"lattice":const s=t.verticesPerRow,l=Math.floor(r.length/s)-1,c=s-1;for(o=0;o=r?i=r:n=i/e,{scale:n,size:i}}clipBbox(e,t,n,r,o){const a=r-t,s=o-n;e.ctx.rect(t,n,a,s),e.current.updateRectMinMax((0,i.getCurrentTransform)(e.ctx),[t,n,r,o]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const i=e.ctx,o=e.current;switch(t){case y:const e=this.ctx;i.fillStyle=e.fillStyle,i.strokeStyle=e.strokeStyle,o.fillColor=e.fillStyle,o.strokeColor=e.strokeStyle;break;case b:const a=r.Util.makeHexColor(n[0],n[1],n[2]);i.fillStyle=a,i.strokeStyle=a,o.fillColor=a,o.strokeColor=a;break;default:throw new r.FormatError("Unsupported paint type: ".concat(t))}}getPattern(e,t,n,i){let o=n;i!==l&&(o=r.Util.transform(o,t.baseTransform),this.matrix&&(o=r.Util.transform(o,this.matrix)));const a=this.createPatternCanvas(t);let s=new DOMMatrix(o);s=s.translate(a.offsetX,a.offsetY),s=s.scale(1/a.scaleX,1/a.scaleY);const c=e.createPattern(a.canvas,"repeat");return c.setTransform(s),c}}function A(e){let{src:t,srcPos:n=0,dest:i,width:o,height:a,nonBlackColor:s=4294967295,inverseDecode:l=!1}=e;const c=r.FeatureTest.isLittleEndian?4278190080:255,[u,d]=l?[s,c]:[c,s],h=o>>3,f=7&o,p=t.length;i=new Uint32Array(i.buffer);let g=0;for(let r=0;r0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===s){t||(0,r.unreachable)("Stroke bounding box must include transform.");const e=r.Util.singularValueDecompose2dScale(t),i=e[0]*this.lineWidth/2,o=e[1]*this.lineWidth/2;n[0]-=i,n[1]-=o,n[2]+=i,n[3]+=o}return n}updateClipFromPath(){const e=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function D(e,t){if("undefined"!==typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const n=t.height,i=t.width,o=n%C,a=(n-o)/C,s=0===o?a:a+1,l=e.createImageData(i,C);let c,u=0;const d=t.data,h=l.data;let f,p,g,m;if(t.kind===r.ImageKind.GRAYSCALE_1BPP){const t=d.byteLength,n=new Uint32Array(h.buffer,0,h.byteLength>>2),m=n.length,v=i+7>>3,y=4294967295,b=r.FeatureTest.isLittleEndian?4278190080:255;for(f=0;fv?i:8*e-7,a=-8&o;let s=0,l=0;for(;r>=1}for(;c=a&&(g=o,m=i*g),c=0,p=m;p--;)h[c++]=d[u++],h[c++]=d[u++],h[c++]=d[u++],h[c++]=255;e.putImageData(l,0,f*C)}}}function k(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const n=t.height,r=t.width,i=n%C,o=(n-i)/C,a=0===i?o:o+1,s=e.createImageData(r,C);let l=0;const c=t.data,u=s.data;for(let d=0;d>8,e[o-2]=e[o-2]*i+n*a>>8,e[o-1]=e[o-1]*i+r*a>>8}}}function P(e,t,n){const r=e.length,i=1/255;for(let o=3;o>8]>>8:t[i]*r>>16}}function R(e,t,n,r){const i=r[0],o=r[1],a=r[2]-i,s=r[3]-o;0!==a&&0!==s&&(!function(e,t,n,r,i,o,a,s,l,c,u){const d=!!o,h=d?o[0]:0,f=d?o[1]:0,p=d?o[2]:0,g="Luminosity"===i?M:P,m=Math.min(r,Math.ceil(1048576/n));for(let v=0;v1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing(e){let{transform:t,viewport:n,transparency:r=!1,background:o=null}=e;const a=this.ctx.canvas.width,s=this.ctx.canvas.height,l=this.ctx.fillStyle;if(this.ctx.fillStyle=o||"#ffffff",this.ctx.fillRect(0,0,a,s),this.ctx.fillStyle=l,r){const e=this.cachedCanvases.getCanvas("transparent",a,s);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...(0,i.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),O(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...n.transform),this.viewportScale=n.scale,this.baseTransform=(0,i.getCurrentTransform)(this.ctx)}executeOperatorList(e,t,n,i){const o=e.argsArray,a=e.fnArray;let s=t||0;const l=o.length;if(l===s)return s;const c=l-s>10&&"function"===typeof n,u=c?Date.now()+15:0;let d=0;const h=this.commonObjs,f=this.objs;let p;for(;;){if(void 0!==i&&s===i.nextBreakPoint)return i.breakIt(s,n),s;if(p=a[s],p!==r.OPS.dependency)this[p].apply(this,o[s]);else for(const e of o[s]){const t=e.startsWith("g_")?h:f;if(!t.has(e))return t.get(e,n),s}if(s++,s===l)return s;if(c&&++d>10){if(Date.now()>u)return n(),s;d=0}}}endDrawing(){(0,h.A)(this,z,H).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),(0,h.A)(this,U,W).call(this)}_scaleImage(e,t){const n=e.width,r=e.height;let i,o,a=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=r,u="prescale1";for(;a>2&&l>1||s>2&&c>1;){let t=l,n=c;a>2&&l>1&&(t=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/t),s>2&&c>1&&(n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,s/=c/n),i=this.cachedCanvases.getCanvas(u,t,n),o=i.context,o.clearRect(0,0,t,n),o.drawImage(e,0,0,l,c,0,0,t,n),e=i.canvas,l=t,c=n,u="prescale1"===u?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:a}=e,s=this.current.fillColor,l=this.current.patternFill,c=(0,i.getCurrentTransform)(t);let u,d,h,f;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;d=JSON.stringify(l?c:[c.slice(0,4),s]),u=this._cachedBitmapsMap.get(t),u||(u=new Map,this._cachedBitmapsMap.set(t,u));const n=u.get(d);if(n&&!l){return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}h=n}h||(f=this.cachedCanvases.getCanvas("maskCanvas",n,a),k(f.context,e));let p=r.Util.transform(c,[1/n,0,0,-1/a,0,0]);p=r.Util.transform(p,[1,0,0,1,0,-a]);const[g,m,v,y]=r.Util.getAxialAlignedBoundingBox([0,0,n,a],p),b=Math.round(v-g)||1,w=Math.round(y-m)||1,A=this.cachedCanvases.getCanvas("fillCanvas",b,w),_=A.context,C=g,x=m;_.translate(-C,-x),_.transform(...p),h||(h=this._scaleImage(f.canvas,(0,i.getCurrentTransformInverse)(_)),h=h.img,u&&l&&u.set(d,h)),_.imageSmoothingEnabled=N((0,i.getCurrentTransform)(_),e.interpolate),E(_,h,0,0,h.width,h.height,0,0,n,a),_.globalCompositeOperation="source-in";const S=r.Util.transform((0,i.getCurrentTransformInverse)(_),[1,0,0,1,-C,-x]);return _.fillStyle=l?s.getPattern(t,this,S,o):s,_.fillRect(0,0,n,a),u&&!l&&(this.cachedCanvases.delete("fillCanvas"),u.set(d,A.canvas)),{canvas:A.canvas,offsetX:Math.round(C),offsetY:Math.round(x)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=j[e]}setLineJoin(e){this.ctx.lineJoin=F[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){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(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=r.context;const o=this.ctx;o.setTransform(...(0,i.getCurrentTransform)(this.suspendedCtx)),T(this.suspendedCtx,o),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,r,i,o,a){t.transform(e,n,r,i,o,a),this.__originalTransform(e,n,r,i,o,a)},e.setTransform=function(e,n,r,i,o,a){t.setTransform(e,n,r,i,o,a),this.__originalSetTransform(e,n,r,i,o,a)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,r,i,o,a){t.bezierCurveTo(e,n,r,i,o,a),this.__originalBezierCurveTo(e,n,r,i,o,a)},e.rect=function(e,n,r,i){t.rect(e,n,r,i),this.__originalRect(e,n,r,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(o,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),T(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask;R(this.suspendedCtx,t,this.ctx,e),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()}save(){this.inSMaskMode?(T(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),T(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,n,r,i,o){this.ctx.transform(e,t,n,r,i,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){const o=this.ctx,a=this.current;let s,l,c=a.x,u=a.y;const d=(0,i.getCurrentTransform)(o),h=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],f=h?n.slice(0):null;for(let i=0,p=0,g=e.length;i0&&void 0!==arguments[0])||arguments[0];const t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof n&&null!==n&&void 0!==n&&n.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,(0,i.getCurrentTransformInverse)(t),s),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.ctx,n=this.current.fillColor;let r=!1;this.current.patternFill&&(t.save(),t.fillStyle=n.getPattern(t,this,(0,i.getCurrentTransformInverse)(t),o),r=!0);const a=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==a&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),r&&t.restore(),e&&this.consumePath(a)}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=L}eoClip(){this.pendingClip=B}beginText(){this.current.textMatrix=r.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(const n of e)t.setTransform(...n.transform),t.translate(n.x,n.y),n.addToPath(t,n.fontSize);t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){var n;const i=this.commonObjs.get(e),o=this.current;if(!i)throw new Error("Can't find font for ".concat(e));if(o.fontMatrix=i.fontMatrix||r.FONT_IDENTITY_MATRIX,0!==o.fontMatrix[0]&&0!==o.fontMatrix[3]||(0,r.warn)("Invalid font matrix for font "+e),t<0?(t=-t,o.fontDirection=-1):o.fontDirection=1,this.current.font=i,this.current.fontSize=t,i.isType3Font)return;const a=i.loadedName||"sans-serif",s=(null===(n=i.systemFontInfo)||void 0===n?void 0:n.css)||'"'.concat(a,'", ').concat(i.fallbackName);let l="normal";i.black?l="900":i.bold&&(l="bold");const c=i.italic?"italic":"normal";let u=t;t<16?u=16:t>100&&(u=100),this.current.fontSizeScale=t/u,this.ctx.font="".concat(c," ").concat(l," ").concat(u,"px ").concat(s)}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,r,i,o){this.current.textMatrix=[e,t,n,r,i,o],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,n,o){const a=this.ctx,s=this.current,l=s.font,c=s.textRenderingMode,u=s.fontSize/s.fontSizeScale,d=c&r.TextRenderingMode.FILL_STROKE_MASK,h=!!(c&r.TextRenderingMode.ADD_TO_PATH_FLAG),f=s.patternFill&&!l.missingFile;let p;if((l.disableFontFace||h||f)&&(p=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||f?(a.save(),a.translate(t,n),a.beginPath(),p(a,u),o&&a.setTransform(...o),d!==r.TextRenderingMode.FILL&&d!==r.TextRenderingMode.FILL_STROKE||a.fill(),d!==r.TextRenderingMode.STROKE&&d!==r.TextRenderingMode.FILL_STROKE||a.stroke(),a.restore()):(d!==r.TextRenderingMode.FILL&&d!==r.TextRenderingMode.FILL_STROKE||a.fillText(e,t,n),d!==r.TextRenderingMode.STROKE&&d!==r.TextRenderingMode.FILL_STROKE||a.strokeText(e,t,n)),h){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,i.getCurrentTransform)(a),x:t,y:n,fontSize:u,addToPath:p})}}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let r=3;r0&&t[r]<255){n=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const a=t.fontSize;if(0===a)return;const s=this.ctx,l=t.fontSizeScale,c=t.charSpacing,u=t.wordSpacing,d=t.fontDirection,h=t.textHScale*d,f=e.length,p=n.vertical,g=p?1:-1,m=n.defaultVMetrics,v=a*t.fontMatrix[0],y=t.textRenderingMode===r.TextRenderingMode.FILL&&!n.disableFontFace&&!t.patternFill;let b;if(s.save(),s.transform(...t.textMatrix),s.translate(t.x,t.y+t.textRise),d>0?s.scale(h,-1):s.scale(h,1),t.patternFill){s.save();const e=t.fillColor.getPattern(s,this,(0,i.getCurrentTransformInverse)(s),o);b=(0,i.getCurrentTransform)(s),s.restore(),s.fillStyle=e}let w=t.lineWidth;const A=t.textMatrixScale;if(0===A||0===w){const e=t.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;e!==r.TextRenderingMode.STROKE&&e!==r.TextRenderingMode.FILL_STROKE||(w=this.getSinglePixelWidth())}else w/=A;if(1!==l&&(s.scale(l,l),w/=l),s.lineWidth=w,n.isInvalidPDFjsFont){const n=[];let r=0;for(const t of e)n.push(t.unicode),r+=t.width;return s.fillText(n.join(""),0,0),t.x+=r*v*h,s.restore(),void this.compose()}let _,C=0;for(_=0;_0){const e=1e3*s.measureText(o).width/a*l;if(Anew G(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new w(e,n,this.ctx,o,r)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){const i=r.Util.makeHexColor(e,t,n);this.ctx.strokeStyle=i,this.current.strokeColor=i}setFillRGBColor(e,t,n){const i=r.Util.makeHexColor(e,t,n);this.ctx.fillStyle=i,this.current.fillColor=i,this.current.patternFill=!1}_getPattern(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(e)?t=this.cachedPatterns.get(e):(t=function(e){switch(e[0]){case"RadialAxial":return new f(e);case"Mesh":return new m(e);case"Dummy":return new v}throw new Error("Unknown IR type: ".concat(e[0]))}(this.getObject(e)),this.cachedPatterns.set(e,t)),n&&(t.matrix=n),t}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,(0,i.getCurrentTransformInverse)(t),l);const o=(0,i.getCurrentTransformInverse)(t);if(o){const{width:e,height:n}=t.canvas,[i,a,s,l]=r.Util.getAxialAlignedBoundingBox([0,0,e,n],o);this.ctx.fillRect(i,a,s-i,l-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(e)&&6===e.length&&this.transform(...e),this.baseTransform=(0,i.getCurrentTransform)(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax((0,i.getCurrentTransform)(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||(0,r.info)("TODO: Support non-isolated groups."),e.knockout&&(0,r.warn)("Knockout groups not supported.");const n=(0,i.getCurrentTransform)(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let o=r.Util.getAxialAlignedBoundingBox(e.bbox,(0,i.getCurrentTransform)(t));const a=[0,0,t.canvas.width,t.canvas.height];o=r.Util.intersect(o,a)||[0,0,0,0];const s=Math.floor(o[0]),l=Math.floor(o[1]);let c=Math.max(Math.ceil(o[2])-s,1),u=Math.max(Math.ceil(o[3])-l,1),d=1,h=1;c>_&&(d=c/_,c=_),u>_&&(h=u/_,u=_),this.current.startNewPathAndClipBox([0,0,c,u]);let f="groupAt"+this.groupLevel;e.smask&&(f+="_smask_"+this.smaskCounter++%2);const p=this.cachedCanvases.getCanvas(f,c,u),g=p.context;g.scale(1/d,1/h),g.translate(-s,-l),g.transform(...n),e.smask?this.smaskStack.push({canvas:p.canvas,context:g,offsetX:s,offsetY:l,scaleX:d,scaleY:h,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(s,l),t.scale(d,h),t.save()),T(t,g),this.ctx=g,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=(0,i.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=r.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,o,a){if((0,h.A)(this,z,H).call(this),O(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(t)&&4===t.length){const o=t[2]-t[0],s=t[3]-t[1];if(a&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=o,t[3]=s;const[a,l]=r.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,u=Math.ceil(o*this.outputScaleX*c),d=Math.ceil(s*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(u,d);const{canvas:h,context:f}=this.annotationCanvas;this.annotationCanvasMap.set(e,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=f,this.ctx.save(),this.ctx.setTransform(a,0,0,-l,0,s*l),O(this.ctx)}else O(this.ctx),this.ctx.rect(t[0],t[1],o,s),this.ctx.clip(),this.endPath()}this.current=new S(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...o)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),(0,h.A)(this,U,W).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=function(e){const{width:t,height:n}=e;if(t>1e3||n>1e3)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1;let o,a,s,l=new Uint8Array(i*(n+1));const c=t+7&-8;let u=new Uint8Array(c*n),d=0;for(const g of e.data){let e=128;for(;e>0;)u[d++]=g&e?0:255,e>>=1}let h=0;for(d=0,0!==u[d]&&(l[0]=1,++h),a=1;a>2)+(u[d+1]?4:0)+(u[d-c+1]?8:0),r[e]&&(l[s+a]=r[e],++h),d++;if(u[d-c]!==u[d]&&(l[s+a]=u[d]?2:4,++h),h>1e3)return null}for(d=c*(n-1),s=o*i,0!==u[d]&&(l[s]=8,++h),a=1;a1e3)return null;const f=new Int32Array([0,i,-1,0,-i,0,0,0,1]),p=new Path2D;for(o=0;h&&o<=n;o++){let e=o*i;const n=e+t;for(;e>4,l[e]&=a>>2|a<<2),p.lineTo(e%i,e/i|0),l[e]||--h}while(r!==e);--o}return u=null,l=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(p),e.beginPath(),e.restore()}}(e)),r.compiled))return void r.compiled(n);const i=this._createMaskCanvas(e),o=i.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(o,i.offsetX,i.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;e=this.getObject(e.data,e);const l=this.ctx;l.save();const c=(0,i.getCurrentTransform)(l);l.transform(t,n,o,a,0,0);const u=this._createMaskCanvas(e);l.setTransform(1,0,0,1,u.offsetX-c[4],u.offsetY-c[5]);for(let i=0,d=s.length;it?c/t:1,a=l>t?l/t:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[r,i]=this.getScaleForStroking();if(t.lineWidth=n||1,1===r&&1===i)return void t.stroke();const o=t.getLineDash();if(e&&t.save(),t.scale(r,i),o.length>0){const e=Math.max(r,i);t.setLineDash(o.map(t=>t/e)),t.lineDashOffset/=e}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}function H(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}function W(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}for(const a in r.OPS)void 0!==G.prototype[a]&&(G.prototype[r.OPS[a]]=G.prototype[a])},419:(e,t,n)=>{n.d(t,{DOMCMapReaderFactory:()=>L,DOMCanvasFactory:()=>j,DOMFilterFactory:()=>D,DOMSVGFactory:()=>z,DOMStandardFontDataFactory:()=>B,PDFDateString:()=>J,PageViewport:()=>U,PixelsPerInch:()=>s,RenderingCancelledException:()=>G,StatTimer:()=>K,fetchData:()=>F,getColorValues:()=>ee,getCurrentTransform:()=>te,getCurrentTransformInverse:()=>ne,getFilenameFromUrl:()=>V,getPdfFilenameFromUrl:()=>q,getRGB:()=>$,getXfaPageViewport:()=>Z,isDataScheme:()=>H,isPdfFile:()=>W,isValidFetchUrl:()=>Y,noContextMenu:()=>X,setLayerDimensions:()=>re});var r=n(583),i=n(292);const o="http://www.w3.org/2000/svg";class s{}(0,a.A)(s,"CSS",96),(0,a.A)(s,"PDF",72),(0,a.A)(s,"PDF_TO_CSS_UNITS",s.CSS/s.PDF);var l=new WeakMap,c=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakMap,A=new WeakMap,_=new WeakSet,C=new WeakSet,x=new WeakSet,E=new WeakSet,S=new WeakSet;class D extends r.BaseFilterFactory{constructor(){let{docId:e,ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),(0,u.A)(this,S),(0,u.A)(this,E),(0,u.A)(this,x),(0,u.A)(this,C),(0,u.A)(this,_),(0,d.A)(this,A,{get:O,set:void 0}),(0,d.A)(this,w,{get:T,set:void 0}),(0,d.A)(this,b,{get:k,set:void 0}),(0,d.A)(this,l,{writable:!0,value:void 0}),(0,d.A)(this,c,{writable:!0,value:void 0}),(0,d.A)(this,g,{writable:!0,value:void 0}),(0,d.A)(this,m,{writable:!0,value:void 0}),(0,d.A)(this,v,{writable:!0,value:void 0}),(0,d.A)(this,y,{writable:!0,value:0}),(0,f.A)(this,g,e),(0,f.A)(this,m,t)}addFilter(e){var t,n;if(!e)return"none";let r,i,o,a,s=(0,p.A)(this,b).get(e);if(s)return s;if(1===e.length){const t=e[0],n=new Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;a=r=i=o=n.join(",")}else{const[t,n,s]=e,l=new Array(256),c=new Array(256),u=new Array(256);for(let e=0;e<256;e++)l[e]=t[e]/255,c[e]=n[e]/255,u[e]=s[e]/255;r=l.join(","),i=c.join(","),o=u.join(","),a="".concat(r).concat(i).concat(o)}if(s=(0,p.A)(this,b).get(a),s)return(0,p.A)(this,b).set(e,s),s;const l="g_".concat((0,p.A)(this,g),"_transfer_map_").concat(((0,f.A)(this,y,(t=(0,p.A)(this,y),n=t++,t)),n)),c="url(#".concat(l,")");(0,p.A)(this,b).set(e,c),(0,p.A)(this,b).set(a,c);const u=(0,h.A)(this,C,P).call(this,l);return(0,h.A)(this,E,R).call(this,r,i,o,u),c}addHCMFilter(e,t){var n;const r="".concat(e,"-").concat(t),o="base";let a=(0,p.A)(this,w).get(o);if((null===(n=a)||void 0===n?void 0:n.key)===r)return a.url;var s;a?(null===(s=a.filter)||void 0===s||s.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},(0,p.A)(this,w).set(o,a));if(!e||!t)return a.url;const l=(0,h.A)(this,S,N).call(this,e);e=i.Util.makeHexColor(...l);const c=(0,h.A)(this,S,N).call(this,t);if(t=i.Util.makeHexColor(...c),(0,p.A)(this,A).style.color="","#000000"===e&&"#ffffff"===t||e===t)return a.url;const u=new Array(256);for(let i=0;i<=255;i++){const e=i/255;u[i]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const d=u.join(","),f="g_".concat((0,p.A)(this,g),"_hcm_filter"),m=a.filter=(0,h.A)(this,C,P).call(this,f);(0,h.A)(this,E,R).call(this,d,d,d,m),(0,h.A)(this,_,I).call(this,m);const v=(e,t)=>{const n=l[e]/255,r=c[e]/255,i=new Array(t+1);for(let o=0;o<=t;o++)i[o]=n+o/t*(r-n);return i.join(",")};return(0,h.A)(this,E,R).call(this,v(0,5),v(1,5),v(2,5),m),a.url="url(#".concat(f,")"),a.url}addHighlightHCMFilter(e,t,n,r,i){var o;const a="".concat(t,"-").concat(n,"-").concat(r,"-").concat(i);let s=(0,p.A)(this,w).get(e);if((null===(o=s)||void 0===o?void 0:o.key)===a)return s.url;var l;s?(null===(l=s.filter)||void 0===l||l.remove(),s.key=a,s.url="none",s.filter=null):(s={key:a,url:"none",filter:null},(0,p.A)(this,w).set(e,s));if(!t||!n)return s.url;const[c,u]=[t,n].map((0,h.A)(this,S,N).bind(this));let d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),f=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[m,v]=[r,i].map((0,h.A)(this,S,N).bind(this));f{const r=new Array(256),i=(f-d)/n,o=e/255,a=(t-e)/(255*n);let s=0;for(let l=0;l<=n;l++){const e=Math.round(d+l*i),t=o+l*a;for(let n=s;n<=e;n++)r[n]=t;s=e+1}for(let l=s;l<256;l++)r[l]=r[s-1];return r.join(",")},b="g_".concat((0,p.A)(this,g),"_hcm_").concat(e,"_filter"),x=s.filter=(0,h.A)(this,C,P).call(this,b);return(0,h.A)(this,_,I).call(this,x),(0,h.A)(this,E,R).call(this,y(m[0],v[0],5),y(m[1],v[1],5),y(m[2],v[2],5),x),s.url="url(#".concat(b,")"),s.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==(0,p.A)(this,w).size||((0,p.A)(this,c)&&((0,p.A)(this,c).parentNode.parentNode.remove(),(0,f.A)(this,c,null)),(0,p.A)(this,l)&&((0,p.A)(this,l).clear(),(0,f.A)(this,l,null)),(0,f.A)(this,y,0))}}function k(){return(0,p.A)(this,l)||(0,f.A)(this,l,new Map)}function T(){return(0,p.A)(this,v)||(0,f.A)(this,v,new Map)}function O(){if(!(0,p.A)(this,c)){const e=(0,p.A)(this,m).createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const n=(0,p.A)(this,m).createElementNS(o,"svg");n.setAttribute("width",0),n.setAttribute("height",0),(0,f.A)(this,c,(0,p.A)(this,m).createElementNS(o,"defs")),e.append(n),n.append((0,p.A)(this,c)),(0,p.A)(this,m).body.append(e)}return(0,p.A)(this,c)}function I(e){const t=(0,p.A)(this,m).createElementNS(o,"feColorMatrix");t.setAttribute("type","matrix"),t.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"),e.append(t)}function P(e){const t=(0,p.A)(this,m).createElementNS(o,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),(0,p.A)(this,A).append(t),t}function M(e,t,n){const r=(0,p.A)(this,m).createElementNS(o,t);r.setAttribute("type","discrete"),r.setAttribute("tableValues",n),e.append(r)}function R(e,t,n,r){const i=(0,p.A)(this,m).createElementNS(o,"feComponentTransfer");r.append(i),(0,h.A)(this,x,M).call(this,i,"feFuncR",e),(0,h.A)(this,x,M).call(this,i,"feFuncG",t),(0,h.A)(this,x,M).call(this,i,"feFuncB",n)}function N(e){return(0,p.A)(this,A).style.color=e,$(getComputedStyle((0,p.A)(this,A)).getPropertyValue("color"))}class j extends r.BaseCanvasFactory{constructor(){let{ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}}async function F(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(Y(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);switch(t){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,r)=>{const i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(200!==i.status&&0!==i.status)r(new Error(i.statusText));else{switch(t){case"arraybuffer":case"blob":case"json":return void n(i.response)}n(i.responseText)}},i.send(null)})}class L extends r.BaseCMapReaderFactory{_fetchData(e,t){return F(e,this.isCompressed?"arraybuffer":"text").then(e=>({cMapData:e instanceof ArrayBuffer?new Uint8Array(e):(0,i.stringToBytes)(e),compressionType:t}))}}class B extends r.BaseStandardFontDataFactory{_fetchData(e){return F(e,"arraybuffer").then(e=>new Uint8Array(e))}}class z extends r.BaseSVGFactory{_createSVG(e){return document.createElementNS(o,e)}}class U{constructor(e){let{viewBox:t,scale:n,rotation:r,offsetX:i=0,offsetY:o=0,dontFlip:a=!1}=e;this.viewBox=t,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=o;const s=(t[2]+t[0])/2,l=(t[3]+t[1])/2;let c,u,d,h,f,p,g,m;switch(r%=360,r<0&&(r+=360),r){case 180:c=-1,u=0,d=0,h=1;break;case 90:c=0,u=1,d=1,h=0;break;case 270:c=0,u=-1,d=-1,h=0;break;case 0:c=1,u=0,d=0,h=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(d=-d,h=-h),0===c?(f=Math.abs(l-t[1])*n+i,p=Math.abs(s-t[0])*n+o,g=(t[3]-t[1])*n,m=(t[2]-t[0])*n):(f=Math.abs(s-t[0])*n+i,p=Math.abs(l-t[1])*n+o,g=(t[2]-t[0])*n,m=(t[3]-t[1])*n),this.transform=[c*n,u*n,d*n,h*n,f-c*n*s-d*n*l,p-u*n*s-h*n*l],this.width=g,this.height=m}get rawDims(){const{viewBox:e}=this;return(0,i.shadow)(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone(){let{scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:r=this.offsetY,dontFlip:i=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new U({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}convertToViewportPoint(e,t){return i.Util.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=i.Util.applyTransform([e[0],e[1]],this.transform),n=i.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return i.Util.applyInverseTransform([e,t],this.transform)}}class G extends i.BaseException{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(e,"RenderingCancelledException"),this.extraDelay=t}}function H(e){const t=e.length;let n=0;for(;n1&&void 0!==arguments[1]&&arguments[1]||([e]=e.split(/[#?]/,1)),e.substring(e.lastIndexOf("/")+1)}function q(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof e)return t;if(H(e))return(0,i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let o=n.exec(r[1])||n.exec(r[2])||n.exec(r[3]);if(o&&(o=o[0],o.includes("%")))try{o=n.exec(decodeURIComponent(o))[0]}catch(a){}return o||t}class K{constructor(){(0,a.A)(this,"started",Object.create(null)),(0,a.A)(this,"times",[])}time(e){e in this.started&&(0,i.warn)("Timer is already running for ".concat(e)),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,i.warn)("Timer has not been started for ".concat(e)),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:n}of this.times)t=Math.max(n.length,t);for(const{name:n,start:r,end:i}of this.times)e.push("".concat(n.padEnd(t)," ").concat(i-r,"ms\n"));return e.join("")}}function Y(e,t){try{const{protocol:n}=t?new URL(e,t):new URL(e);return"http:"===n||"https:"===n}catch(n){return!1}}function X(e){e.preventDefault()}let Q;class J{static toDateObject(e){if(!e||"string"!==typeof e)return null;Q||(Q=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const t=Q.exec(e);if(!t)return null;const n=parseInt(t[1],10);let r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let o=parseInt(t[4],10);o=o>=0&&o<=23?o:0;let a=parseInt(t[5],10);a=a>=0&&a<=59?a:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===l?(o+=c,a+=u):"+"===l&&(o-=c,a-=u),new Date(Date.UTC(n,r,i,o,a,s))}}function Z(e,t){let{scale:n=1,rotation:r=0}=t;const{width:i,height:o}=e.attributes.style,a=[0,0,parseInt(i),parseInt(o)];return new U({viewBox:a,scale:n,rotation:r})}function $(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(e=>parseInt(e)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):((0,i.warn)('Not a valid color format: "'.concat(e,'"')),[0,0,0])}function ee(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const r=window.getComputedStyle(t).color;e.set(n,$(r))}t.remove()}function te(e){const{a:t,b:n,c:r,d:i,e:o,f:a}=e.getTransform();return[t,n,r,i,o,a]}function ne(e){const{a:t,b:n,c:r,d:i,e:o,f:a}=e.getTransform().invertSelf();return[t,n,r,i,o,a]}function re(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(t instanceof U){const{pageWidth:r,pageHeight:o}=t.rawDims,{style:a}=e,s=i.FeatureTest.isCSSRoundSupported,l="var(--scale-factor) * ".concat(r,"px"),c="var(--scale-factor) * ".concat(o,"px"),u=s?"round(".concat(l,", 1px)"):"calc(".concat(l,")"),d=s?"round(".concat(c,", 1px)"):"calc(".concat(c,")");n&&t.rotation%180!==0?(a.width=d,a.height=u):(a.width=u,a.height=d)}r&&e.setAttribute("data-main-rotation",t.rotation)}},47:(e,t,n)=>{n.d(t,{DrawLayer:()=>v});var r=n(419),i=n(292),a=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,g=new WeakSet,m=new WeakSet;class v{constructor(e){let{pageIndex:t}=e;(0,u.A)(this,m),(0,u.A)(this,g),(0,d.A)(this,a,{writable:!0,value:null}),(0,d.A)(this,s,{writable:!0,value:0}),(0,d.A)(this,l,{writable:!0,value:new Map}),(0,d.A)(this,c,{writable:!0,value:new Map}),this.pageIndex=t}setParent(e){if((0,p.A)(this,a)){if((0,p.A)(this,a)!==e){if((0,p.A)(this,l).size>0)for(const t of(0,p.A)(this,l).values())t.remove(),e.append(t);(0,f.A)(this,a,e)}}else(0,f.A)(this,a,e)}static get _svgFactory(){return(0,i.shadow)(this,"_svgFactory",new r.DOMSVGFactory)}highlight(e,t,n){var r,i;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=((0,f.A)(this,s,(r=(0,p.A)(this,s),i=r++,r)),i),u=(0,h.A)(this,g,b).call(this,e.box);u.classList.add("highlight"),e.free&&u.classList.add("free");const d=v._svgFactory.createElement("defs");u.append(d);const y=v._svgFactory.createElement("path");d.append(y);const A="path_p".concat(this.pageIndex,"_").concat(a);y.setAttribute("id",A),y.setAttribute("d",e.toSVGPath()),o&&(0,p.A)(this,c).set(a,y);const _=(0,h.A)(this,m,w).call(this,d,A),C=v._svgFactory.createElement("use");return u.append(C),u.setAttribute("fill",t),u.setAttribute("fill-opacity",n),C.setAttribute("href","#".concat(A)),(0,p.A)(this,l).set(a,u),{id:a,clipPathId:"url(#".concat(_,")")}}highlightOutline(e){var t,n;const r=((0,f.A)(this,s,(t=(0,p.A)(this,s),n=t++,t)),n),i=(0,h.A)(this,g,b).call(this,e.box);i.classList.add("highlightOutline");const o=v._svgFactory.createElement("defs");i.append(o);const a=v._svgFactory.createElement("path");o.append(a);const c="path_p".concat(this.pageIndex,"_").concat(r);let u;if(a.setAttribute("id",c),a.setAttribute("d",e.toSVGPath()),a.setAttribute("vector-effect","non-scaling-stroke"),e.free){i.classList.add("free");const e=v._svgFactory.createElement("mask");o.append(e),u="mask_p".concat(this.pageIndex,"_").concat(r),e.setAttribute("id",u),e.setAttribute("maskUnits","objectBoundingBox");const t=v._svgFactory.createElement("rect");e.append(t),t.setAttribute("width","1"),t.setAttribute("height","1"),t.setAttribute("fill","white");const n=v._svgFactory.createElement("use");e.append(n),n.setAttribute("href","#".concat(c)),n.setAttribute("stroke","none"),n.setAttribute("fill","black"),n.setAttribute("fill-rule","nonzero"),n.classList.add("mask")}const d=v._svgFactory.createElement("use");i.append(d),d.setAttribute("href","#".concat(c)),u&&d.setAttribute("mask","url(#".concat(u,")"));const m=d.cloneNode();return i.append(m),d.classList.add("mainOutline"),m.classList.add("secondaryOutline"),(0,p.A)(this,l).set(r,i),r}finalizeLine(e,t){const n=(0,p.A)(this,c).get(e);(0,p.A)(this,c).delete(e),this.updateBox(e,t.box),n.setAttribute("d",t.toSVGPath())}updateLine(e,t){(0,p.A)(this,l).get(e).firstChild.firstChild.setAttribute("d",t.toSVGPath())}removeFreeHighlight(e){this.remove(e),(0,p.A)(this,c).delete(e)}updatePath(e,t){(0,p.A)(this,c).get(e).setAttribute("d",t.toSVGPath())}updateBox(e,t){(0,o.A)(v,v,y).call(v,(0,p.A)(this,l).get(e),t)}show(e,t){(0,p.A)(this,l).get(e).classList.toggle("hidden",!t)}rotate(e,t){(0,p.A)(this,l).get(e).setAttribute("data-main-rotation",t)}changeColor(e,t){(0,p.A)(this,l).get(e).setAttribute("fill",t)}changeOpacity(e,t){(0,p.A)(this,l).get(e).setAttribute("fill-opacity",t)}addClass(e,t){(0,p.A)(this,l).get(e).classList.add(t)}removeClass(e,t){(0,p.A)(this,l).get(e).classList.remove(t)}remove(e){null!==(0,p.A)(this,a)&&((0,p.A)(this,l).get(e).remove(),(0,p.A)(this,l).delete(e))}destroy(){(0,f.A)(this,a,null);for(const e of(0,p.A)(this,l).values())e.remove();(0,p.A)(this,l).clear()}}function y(e){let{x:t=0,y:n=0,width:r=1,height:i=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{style:o}=e;o.top="".concat(100*n,"%"),o.left="".concat(100*t,"%"),o.width="".concat(100*r,"%"),o.height="".concat(100*i,"%")}function b(e){const t=v._svgFactory.create(1,1,!0);return(0,p.A)(this,a).append(t),t.setAttribute("aria-hidden",!0),(0,o.A)(v,v,y).call(v,t,e),t}function w(e,t){const n=v._svgFactory.createElement("clipPath");e.append(n);const r="clip_".concat(t);n.setAttribute("id",r),n.setAttribute("clipPathUnits","objectBoundingBox");const i=v._svgFactory.createElement("use");return n.append(i),i.setAttribute("href","#".concat(t)),i.classList.add("clip"),r}},731:(e,t,n)=>{n.d(t,{AnnotationEditorLayer:()=>Kn});var r=n(292),l=n(310),g=n(830),m=n(976);const v=/\r\n?|\n/g;var y=new WeakMap,b=new WeakMap,w=new WeakMap,A=new WeakMap,_=new WeakMap,C=new WeakMap,x=new WeakMap,E=new WeakMap,S=new WeakMap,D=new WeakMap,k=new WeakSet,T=new WeakSet,O=new WeakSet,I=new WeakSet,P=new WeakSet,M=new WeakSet,R=new WeakSet;class N extends l.AnnotationEditor{static get _keyboardManager(){const e=N.prototype,t=e=>e.isEmpty(),n=g.AnnotationEditorUIManager.TRANSLATE_SMALL,i=g.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new g.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[i,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,i],checker:t}]]))}constructor(e){super((0,s.A)((0,s.A)({},e),{},{name:"freeTextEditor"})),(0,u.A)(this,R),(0,u.A)(this,M),(0,u.A)(this,P),(0,u.A)(this,I),(0,u.A)(this,O),(0,u.A)(this,T),(0,u.A)(this,k),(0,d.A)(this,y,{writable:!0,value:this.editorDivBlur.bind(this)}),(0,d.A)(this,b,{writable:!0,value:this.editorDivFocus.bind(this)}),(0,d.A)(this,w,{writable:!0,value:this.editorDivInput.bind(this)}),(0,d.A)(this,A,{writable:!0,value:this.editorDivKeydown.bind(this)}),(0,d.A)(this,_,{writable:!0,value:this.editorDivPaste.bind(this)}),(0,d.A)(this,C,{writable:!0,value:void 0}),(0,d.A)(this,x,{writable:!0,value:""}),(0,d.A)(this,E,{writable:!0,value:"".concat(this.id,"-editor")}),(0,d.A)(this,S,{writable:!0,value:void 0}),(0,d.A)(this,D,{writable:!0,value:null}),(0,f.A)(this,C,e.color||N._defaultColor||l.AnnotationEditor._defaultLineColor),(0,f.A)(this,S,e.fontSize||N._defaultFontSize)}static initialize(e,t){l.AnnotationEditor.initialize(e,t,{strings:["pdfjs-free-text-default-content"]});const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:N._defaultFontSize=t;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:N._defaultColor=t}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.FREETEXT_SIZE:(0,h.A)(this,k,j).call(this,t);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:(0,h.A)(this,T,F).call(this,t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,N._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,N._defaultColor||l.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,(0,p.A)(this,S)],[r.AnnotationEditorParamsType.FREETEXT_COLOR,(0,p.A)(this,C)]]}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-N._internalPadding*e,-(N._internalPadding+(0,p.A)(this,S))*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",(0,p.A)(this,A)),this.editorDiv.addEventListener("focus",(0,p.A)(this,b)),this.editorDiv.addEventListener("blur",(0,p.A)(this,y)),this.editorDiv.addEventListener("input",(0,p.A)(this,w)),this.editorDiv.addEventListener("paste",(0,p.A)(this,_)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",(0,p.A)(this,E)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",(0,p.A)(this,A)),this.editorDiv.removeEventListener("focus",(0,p.A)(this,b)),this.editorDiv.removeEventListener("blur",(0,p.A)(this,y)),this.editorDiv.removeEventListener("input",(0,p.A)(this,w)),this.editorDiv.removeEventListener("paste",(0,p.A)(this,_)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var e;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!==(e=this._initialOptions)&&void 0!==e&&e.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=(0,p.A)(this,x),t=(0,f.A)(this,x,(0,h.A)(this,O,L).call(this).trimEnd());if(e===t)return;const n=e=>{(0,f.A)(this,x,e),e?((0,h.A)(this,P,U).call(this),this._uiManager.rebuild(this),(0,h.A)(this,I,B).call(this)):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),(0,h.A)(this,I,B).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){N._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",(0,p.A)(this,E)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),l.AnnotationEditor._l10nPromise.get("pdfjs-free-text-default-content").then(e=>{var t;return null===(t=this.editorDiv)||void 0===t?void 0:t.setAttribute("default-content",e)}),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize="calc(".concat((0,p.A)(this,S),"px * var(--scale-factor))"),n.color=(0,p.A)(this,C),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,g.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[n,r]=this.parentDimensions;if(this.annotationElementId){const{position:i}=(0,p.A)(this,D);let[o,a]=this.getInitialTranslation();[o,a]=this.pageTranslationToScreen(o,a);const[s,l]=this.pageDimensions,[c,u]=this.pageTranslation;let d,h;switch(this.rotation){case 0:d=e+(i[0]-c)/s,h=t+this.height-(i[1]-u)/l;break;case 90:d=e+(i[0]-c)/s,h=t-(i[1]-u)/l,[o,a]=[a,-o];break;case 180:d=e-this.width+(i[0]-c)/s,h=t-(i[1]-u)/l,[o,a]=[-o,-a];break;case 270:d=e+(i[0]-c-this.height*l)/s,h=t+(i[1]-u-this.width*s)/l,[o,a]=[-a,o]}this.setAt(d*n,h*r,o,a)}else this.setAt(e*n,t*r,this.width*n,this.height*r);(0,h.A)(this,P,U).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:n}=t;if(1===n.length&&"text/plain"===n[0])return;e.preventDefault();const r=(0,o.A)(N,N,H).call(N,t.getData("text")||"").replaceAll(v,"\n");if(!r)return;const i=window.getSelection();if(!i.rangeCount)return;this.editorDiv.normalize(),i.deleteFromDocument();const a=i.getRangeAt(0);if(!r.includes("\n"))return a.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),void i.collapseToStart();const{startContainer:s,startOffset:l}=a,c=[],u=[];if(s.nodeType===Node.TEXT_NODE){const e=s.parentElement;if(u.push(s.nodeValue.slice(l).replaceAll(v,"")),e!==this.editorDiv){let t=c;for(const n of this.editorDiv.childNodes)n!==e?t.push((0,o.A)(N,N,z).call(N,n)):t=u}c.push(s.nodeValue.slice(0,l).replaceAll(v,""))}else if(s===this.editorDiv){let e=c,t=0;for(const n of this.editorDiv.childNodes)t++===l&&(e=u),e.push((0,o.A)(N,N,z).call(N,n))}(0,f.A)(this,x,"".concat(c.join("\n")).concat(r).concat(u.join("\n"))),(0,h.A)(this,P,U).call(this);const d=new Range;let p=c.reduce((e,t)=>e+t.length,0);for(const{firstChild:o}of this.editorDiv.childNodes)if(o.nodeType===Node.TEXT_NODE){const e=o.nodeValue.length;if(p<=e){d.setStart(o,p),d.setEnd(o,p);break}p-=e}i.removeAllRanges(),i.addRange(d)}get contentDiv(){return this.editorDiv}static deserialize(e,t,n){let i=null;if(e instanceof m.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:t,fontColor:n},rect:o,rotation:a,id:s},textContent:l,textPosition:c,parent:{page:{pageNumber:u}}}=e;if(!l||0===l.length)return null;i=e={annotationType:r.AnnotationEditorType.FREETEXT,color:Array.from(n),fontSize:t,value:l.join("\n"),position:c,pageIndex:u-1,rect:o.slice(0),rotation:a,id:s,deleted:!1}}const a=super.deserialize(e,t,n);return(0,f.A)(a,S,e.fontSize),(0,f.A)(a,C,r.Util.makeHexColor(...e.color)),(0,f.A)(a,x,(0,o.A)(N,N,H).call(N,e.value)),a.annotationElementId=e.id||null,(0,f.A)(a,D,i),a}serialize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const t=N._internalPadding*this.parentScale,n=this.getRect(t,t),i=l.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:(0,p.A)(this,C)),o={annotationType:r.AnnotationEditorType.FREETEXT,color:i,fontSize:(0,p.A)(this,S),value:(0,h.A)(this,M,G).call(this),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?o:this.annotationElementId&&!(0,h.A)(this,R,W).call(this,o)?null:(o.id=this.annotationElementId,o)}renderAnnotationElement(e){const t=super.renderAnnotationElement(e);if(this.deleted)return t;const{style:n}=t;n.fontSize="calc(".concat((0,p.A)(this,S),"px * var(--scale-factor))"),n.color=(0,p.A)(this,C),t.replaceChildren();for(const i of(0,p.A)(this,x).split("\n")){const e=document.createElement("div");e.append(i?document.createTextNode(i):document.createElement("br")),t.append(e)}const r=N._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(r,r)}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}function j(e){const t=e=>{this.editorDiv.style.fontSize="calc(".concat(e,"px * var(--scale-factor))"),this.translate(0,-(e-(0,p.A)(this,S))*this.parentScale),(0,f.A)(this,S,e),(0,h.A)(this,I,B).call(this)},n=(0,p.A)(this,S);this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function F(e){const t=e=>{(0,f.A)(this,C,this.editorDiv.style.color=e)},n=(0,p.A)(this,C);this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function L(){const e=[];this.editorDiv.normalize();for(const t of this.editorDiv.childNodes)e.push((0,o.A)(N,N,z).call(N,t));return e.join("\n")}function B(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,r=t.style.display,i=t.classList.contains("hidden");t.classList.remove("hidden"),t.style.display="hidden",e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r,t.classList.toggle("hidden",i)}this.rotation%180===this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}function z(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(v,"")}function U(){if(this.editorDiv.replaceChildren(),(0,p.A)(this,x))for(const e of(0,p.A)(this,x).split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}function G(){return(0,p.A)(this,x).replaceAll("\xa0"," ")}function H(e){return e.replaceAll(" ","\xa0")}function W(e){const{value:t,fontSize:n,color:r,pageIndex:i}=(0,p.A)(this,D);return this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((e,t)=>e!==r[t])||e.pageIndex!==i}(0,a.A)(N,"_freeTextDefaultContent",""),(0,a.A)(N,"_internalPadding",0),(0,a.A)(N,"_defaultColor",null),(0,a.A)(N,"_defaultFontSize",10),(0,a.A)(N,"_type","freetext"),(0,a.A)(N,"_editorType",r.AnnotationEditorType.FREETEXT);var V=n(61),q=n(259),K=n(419),Y=new WeakMap,X=new WeakMap,Q=new WeakMap,J=new WeakMap,Z=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe=new WeakMap,ae=new WeakMap,se=new WeakMap,le=new WeakMap,ce=new WeakMap,ue=new WeakMap,de=new WeakMap,he=new WeakMap,fe=new WeakSet,pe=new WeakSet,ge=new WeakSet,me=new WeakSet,ve=new WeakSet,ye=new WeakSet,be=new WeakSet,we=new WeakSet,Ae=new WeakSet,_e=new WeakSet,Ce=new WeakSet,xe=new WeakSet;class Ee extends l.AnnotationEditor{static get _keyboardManager(){const e=Ee.prototype;return(0,r.shadow)(this,"_keyboardManager",new g.KeyboardManager([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super((0,s.A)((0,s.A)({},e),{},{name:"highlightEditor"})),(0,u.A)(this,xe),(0,u.A)(this,Ce),(0,u.A)(this,_e),(0,u.A)(this,Ae),(0,u.A)(this,we),(0,u.A)(this,be),(0,u.A)(this,ye),(0,u.A)(this,ve),(0,u.A)(this,me),(0,u.A)(this,ge),(0,u.A)(this,pe),(0,u.A)(this,fe),(0,d.A)(this,Y,{writable:!0,value:null}),(0,d.A)(this,X,{writable:!0,value:0}),(0,d.A)(this,Q,{writable:!0,value:void 0}),(0,d.A)(this,J,{writable:!0,value:null}),(0,d.A)(this,Z,{writable:!0,value:null}),(0,d.A)(this,$,{writable:!0,value:null}),(0,d.A)(this,ee,{writable:!0,value:null}),(0,d.A)(this,te,{writable:!0,value:0}),(0,d.A)(this,ne,{writable:!0,value:null}),(0,d.A)(this,re,{writable:!0,value:null}),(0,d.A)(this,ie,{writable:!0,value:null}),(0,d.A)(this,oe,{writable:!0,value:!1}),(0,d.A)(this,ae,{writable:!0,value:(0,h.A)(this,we,Re).bind(this)}),(0,d.A)(this,se,{writable:!0,value:null}),(0,d.A)(this,le,{writable:!0,value:void 0}),(0,d.A)(this,ce,{writable:!0,value:null}),(0,d.A)(this,ue,{writable:!0,value:""}),(0,d.A)(this,de,{writable:!0,value:void 0}),(0,d.A)(this,he,{writable:!0,value:""}),this.color=e.color||Ee._defaultColor,(0,f.A)(this,de,e.thickness||Ee._defaultThickness),(0,f.A)(this,le,e.opacity||Ee._defaultOpacity),(0,f.A)(this,Q,e.boxes||null),(0,f.A)(this,he,e.methodOfCreation||""),(0,f.A)(this,ue,e.text||""),this._isDraggable=!1,e.highlightId>-1?((0,f.A)(this,oe,!0),(0,h.A)(this,pe,De).call(this,e),(0,h.A)(this,be,Pe).call(this)):((0,f.A)(this,Y,e.anchorNode),(0,f.A)(this,X,e.anchorOffset),(0,f.A)(this,ee,e.focusNode),(0,f.A)(this,te,e.focusOffset),(0,h.A)(this,fe,Se).call(this),(0,h.A)(this,be,Pe).call(this),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:(0,p.A)(this,oe)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:(0,p.A)(this,de),methodOfCreation:(0,p.A)(this,he)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}static initialize(e,t){var n;l.AnnotationEditor.initialize(e,t),Ee._defaultColor||(Ee._defaultColor=(null===(n=t.highlightColors)||void 0===n?void 0:n.values().next().value)||"#fff066")}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:Ee._defaultColor=t;break;case r.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:Ee._defaultThickness=t}}translateInPage(e,t){}get toolbarPosition(){return(0,p.A)(this,se)}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.HIGHLIGHT_COLOR:(0,h.A)(this,ge,ke).call(this,t);break;case r.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:(0,h.A)(this,me,Te).call(this,t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR,Ee._defaultColor],[r.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS,Ee._defaultThickness]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.HIGHLIGHT_COLOR,this.color||Ee._defaultColor],[r.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS,(0,p.A)(this,de)||Ee._defaultThickness],[r.AnnotationEditorParamsType.HIGHLIGHT_FREE,(0,p.A)(this,oe)]]}async addEditToolbar(){const e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&((0,f.A)(this,Z,new q.ColorPicker({editor:this})),e.addColorPicker((0,p.A)(this,Z))),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition((0,h.A)(this,_e,je).call(this))}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,(0,h.A)(this,_e,je).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){(0,h.A)(this,ye,Ie).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&((0,h.A)(this,be,Pe).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;if(this.parent&&!e)(0,h.A)(this,ye,Ie).call(this);else if(e){var n;(0,h.A)(this,be,Pe).call(this,e),t=!this.parent&&(null===(n=this.div)||void 0===n?void 0:n.classList.contains("selectedEditor"))}super.setParent(e),this.show(this._isVisible),t&&this.select()}rotate(e){const{drawLayer:t}=this.parent;let n;(0,p.A)(this,oe)?(e=(e-this.rotation+360)%360,n=(0,o.A)(Ee,Ee,Me).call(Ee,(0,p.A)(this,re).box,e)):n=(0,o.A)(Ee,Ee,Me).call(Ee,this,e),t.rotate((0,p.A)(this,ie),e),t.rotate((0,p.A)(this,ce),e),t.updateBox((0,p.A)(this,ie),n),t.updateBox((0,p.A)(this,ce),(0,o.A)(Ee,Ee,Me).call(Ee,(0,p.A)(this,$).box,e))}render(){if(this.div)return this.div;const e=super.render();(0,p.A)(this,ue)&&(e.setAttribute("aria-label",(0,p.A)(this,ue)),e.setAttribute("role","mark")),(0,p.A)(this,oe)?e.classList.add("free"):this.div.addEventListener("keydown",(0,p.A)(this,ae));const t=(0,f.A)(this,ne,document.createElement("div"));e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=(0,p.A)(this,J);const[n,r]=this.parentDimensions;return this.setDims(this.width*n,this.height*r),(0,g.bindEvents)(this,(0,p.A)(this,ne),["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.parent.drawLayer.addClass((0,p.A)(this,ce),"hovered")}pointerleave(){this.parent.drawLayer.removeClass((0,p.A)(this,ce),"hovered")}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:(0,h.A)(this,Ae,Ne).call(this,!0);break;case 1:case 3:(0,h.A)(this,Ae,Ne).call(this,!1)}}select(){var e,t;super.select(),(0,p.A)(this,ce)&&(null===(e=this.parent)||void 0===e||e.drawLayer.removeClass((0,p.A)(this,ce),"hovered"),null===(t=this.parent)||void 0===t||t.drawLayer.addClass((0,p.A)(this,ce),"selected"))}unselect(){var e;super.unselect(),(0,p.A)(this,ce)&&(null===(e=this.parent)||void 0===e||e.drawLayer.removeClass((0,p.A)(this,ce),"selected"),(0,p.A)(this,oe)||(0,h.A)(this,Ae,Ne).call(this,!1))}get _mustFixPosition(){return!(0,p.A)(this,oe)}show(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(e),this.parent&&(this.parent.drawLayer.show((0,p.A)(this,ie),e),this.parent.drawLayer.show((0,p.A)(this,ce),e))}static startHighlighting(e,t,n){let{target:r,x:i,y:a}=n;const{x:s,y:l,width:c,height:u}=r.getBoundingClientRect(),d=t=>{(0,o.A)(this,Ee,Be).call(this,e,t)},h={capture:!0,passive:!1},f=e=>{e.preventDefault(),e.stopPropagation()},p=t=>{r.removeEventListener("pointermove",d),window.removeEventListener("blur",p),window.removeEventListener("pointerup",p),window.removeEventListener("pointerdown",f,h),window.removeEventListener("contextmenu",K.noContextMenu),(0,o.A)(this,Ee,ze).call(this,e,t)};window.addEventListener("blur",p),window.addEventListener("pointerup",p),window.addEventListener("pointerdown",f,h),window.addEventListener("contextmenu",K.noContextMenu),r.addEventListener("pointermove",d),this._freeHighlight=new V.FreeOutliner({x:i,y:a},[s,l,c,u],e.scale,this._defaultThickness/2,t,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static deserialize(e,t,n){const i=super.deserialize(e,t,n),{rect:[o,a,s,l],color:c,quadPoints:u}=e;i.color=r.Util.makeHexColor(...c),(0,f.A)(i,le,e.opacity);const[d,p]=i.pageDimensions;i.width=(s-o)/d,i.height=(l-a)/p;const g=(0,f.A)(i,Q,[]);for(let r=0;r0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||e)return null;const t=this.getRect(0,0),n=l.AnnotationEditor._colorManager.convert(this.color);return{annotationType:r.AnnotationEditorType.HIGHLIGHT,color:n,opacity:(0,p.A)(this,le),thickness:(0,p.A)(this,de),quadPoints:(0,h.A)(this,Ce,Fe).call(this),outlines:(0,h.A)(this,xe,Le).call(this,t),pageIndex:this.pageIndex,rect:t,rotation:(0,h.A)(this,_e,je).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}function Se(){const e=new V.Outliner((0,p.A)(this,Q),.001);(0,f.A)(this,re,e.getOutlines()),({x:this.x,y:this.y,width:this.width,height:this.height}=(0,p.A)(this,re).box);const t=new V.Outliner((0,p.A)(this,Q),.0025,.001,"ltr"===this._uiManager.direction);(0,f.A)(this,$,t.getOutlines());const{lastPoint:n}=(0,p.A)(this,$).box;(0,f.A)(this,se,[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height])}function De(e){let{highlightOutlines:t,highlightId:n,clipPathId:r}=e;(0,f.A)(this,re,t);if((0,f.A)(this,$,t.getNewOutline((0,p.A)(this,de)/2+1.5,.0025)),n>=0)(0,f.A)(this,ie,n),(0,f.A)(this,J,r),this.parent.drawLayer.finalizeLine(n,t),(0,f.A)(this,ce,this.parent.drawLayer.highlightOutline((0,p.A)(this,$)));else if(this.parent){const e=this.parent.viewport.rotation;this.parent.drawLayer.updateLine((0,p.A)(this,ie),t),this.parent.drawLayer.updateBox((0,p.A)(this,ie),(0,o.A)(Ee,Ee,Me).call(Ee,(0,p.A)(this,re).box,(e-this.rotation+360)%360)),this.parent.drawLayer.updateLine((0,p.A)(this,ce),(0,p.A)(this,$)),this.parent.drawLayer.updateBox((0,p.A)(this,ce),(0,o.A)(Ee,Ee,Me).call(Ee,(0,p.A)(this,$).box,e))}const{x:i,y:a,width:s,height:l}=t.box;switch(this.rotation){case 0:this.x=i,this.y=a,this.width=s,this.height=l;break;case 90:{const[e,t]=this.parentDimensions;this.x=a,this.y=1-i,this.width=s*t/e,this.height=l*e/t;break}case 180:this.x=1-i,this.y=1-a,this.width=s,this.height=l;break;case 270:{const[e,t]=this.parentDimensions;this.x=1-a,this.y=i,this.width=s*t/e,this.height=l*e/t;break}}const{lastPoint:c}=(0,p.A)(this,$).box;(0,f.A)(this,se,[(c[0]-i)/s,(c[1]-a)/l])}function ke(e){const t=e=>{var t,n;this.color=e,null===(t=this.parent)||void 0===t||t.drawLayer.changeColor((0,p.A)(this,ie),e),null===(n=(0,p.A)(this,Z))||void 0===n||n.updateColor(e)},n=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)}function Te(e){const t=(0,p.A)(this,de),n=e=>{(0,f.A)(this,de,e),(0,h.A)(this,ve,Oe).call(this,e)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}function Oe(e){if(!(0,p.A)(this,oe))return;(0,h.A)(this,pe,De).call(this,{highlightOutlines:(0,p.A)(this,re).getNewOutline(e/2)}),this.fixAndSetPosition();const[t,n]=this.parentDimensions;this.setDims(this.width*t,this.height*n)}function Ie(){null!==(0,p.A)(this,ie)&&this.parent&&(this.parent.drawLayer.remove((0,p.A)(this,ie)),(0,f.A)(this,ie,null),this.parent.drawLayer.remove((0,p.A)(this,ce)),(0,f.A)(this,ce,null))}function Pe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===(0,p.A)(this,ie)&&(({id:(0,i.A)(this,ie).value,clipPathId:(0,i.A)(this,J).value}=e.drawLayer.highlight((0,p.A)(this,re),this.color,(0,p.A)(this,le))),(0,f.A)(this,ce,e.drawLayer.highlightOutline((0,p.A)(this,$))),(0,p.A)(this,ne)&&((0,p.A)(this,ne).style.clipPath=(0,p.A)(this,J)))}function Me(e,t){let{x:n,y:r,width:i,height:o}=e;switch(t){case 90:return{x:1-r-o,y:n,width:o,height:i};case 180:return{x:1-n-i,y:1-r-o,width:i,height:o};case 270:return{x:r,y:1-n-i,width:o,height:i}}return{x:n,y:r,width:i,height:o}}function Re(e){Ee._keyboardManager.exec(this,e)}function Ne(e){if(!(0,p.A)(this,Y))return;const t=window.getSelection();e?t.setPosition((0,p.A)(this,Y),(0,p.A)(this,X)):t.setPosition((0,p.A)(this,ee),(0,p.A)(this,te))}function je(){return(0,p.A)(this,oe)?this.rotation:0}function Fe(){if((0,p.A)(this,oe))return null;const[e,t]=this.pageDimensions,n=(0,p.A)(this,Q),r=new Array(8*n.length);let i=0;for(const{x:o,y:a,width:s,height:l}of n){const n=o*e,c=(1-a-l)*t;r[i]=r[i+4]=n,r[i+1]=r[i+3]=c,r[i+2]=r[i+6]=n+s*e,r[i+5]=r[i+7]=c+l*t,i+=8}return r}function Le(e){return(0,p.A)(this,re).serialize(e,(0,h.A)(this,_e,je).call(this))}function Be(e,t){this._freeHighlight.add(t)&&e.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}function ze(e,t){this._freeHighlight.isEmpty()?e.drawLayer.removeFreeHighlight(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}(0,a.A)(Ee,"_defaultColor",null),(0,a.A)(Ee,"_defaultOpacity",1),(0,a.A)(Ee,"_defaultThickness",12),(0,a.A)(Ee,"_l10nPromise",void 0),(0,a.A)(Ee,"_type","highlight"),(0,a.A)(Ee,"_editorType",r.AnnotationEditorType.HIGHLIGHT),(0,a.A)(Ee,"_freeHighlightId",-1),(0,a.A)(Ee,"_freeHighlight",null),(0,a.A)(Ee,"_freeHighlightClipId","");var Ue=new WeakMap,Ge=new WeakMap,He=new WeakMap,We=new WeakMap,Ve=new WeakMap,qe=new WeakMap,Ke=new WeakMap,Ye=new WeakMap,Xe=new WeakMap,Qe=new WeakMap,Je=new WeakMap,Ze=new WeakMap,$e=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakSet,rt=new WeakSet,it=new WeakSet,ot=new WeakSet,at=new WeakSet,st=new WeakSet,lt=new WeakSet,ct=new WeakSet,ut=new WeakSet,dt=new WeakSet,ht=new WeakSet,ft=new WeakSet,pt=new WeakSet,gt=new WeakSet,mt=new WeakSet,vt=new WeakSet,yt=new WeakSet,bt=new WeakSet,wt=new WeakSet,At=new WeakSet,_t=new WeakSet,Ct=new WeakSet,xt=new WeakSet;class Et extends l.AnnotationEditor{constructor(e){super((0,s.A)((0,s.A)({},e),{},{name:"inkEditor"})),(0,u.A)(this,xt),(0,u.A)(this,Ct),(0,u.A)(this,_t),(0,u.A)(this,At),(0,u.A)(this,wt),(0,u.A)(this,bt),(0,u.A)(this,yt),(0,u.A)(this,vt),(0,u.A)(this,mt),(0,u.A)(this,gt),(0,u.A)(this,pt),(0,u.A)(this,ft),(0,u.A)(this,ht),(0,u.A)(this,dt),(0,u.A)(this,ut),(0,u.A)(this,ct),(0,u.A)(this,lt),(0,u.A)(this,st),(0,u.A)(this,at),(0,u.A)(this,ot),(0,u.A)(this,it),(0,u.A)(this,rt),(0,u.A)(this,nt),(0,d.A)(this,Ue,{writable:!0,value:0}),(0,d.A)(this,Ge,{writable:!0,value:0}),(0,d.A)(this,He,{writable:!0,value:this.canvasPointermove.bind(this)}),(0,d.A)(this,We,{writable:!0,value:this.canvasPointerleave.bind(this)}),(0,d.A)(this,Ve,{writable:!0,value:this.canvasPointerup.bind(this)}),(0,d.A)(this,qe,{writable:!0,value:this.canvasPointerdown.bind(this)}),(0,d.A)(this,Ke,{writable:!0,value:null}),(0,d.A)(this,Ye,{writable:!0,value:new Path2D}),(0,d.A)(this,Xe,{writable:!0,value:!1}),(0,d.A)(this,Qe,{writable:!0,value:!1}),(0,d.A)(this,Je,{writable:!0,value:!1}),(0,d.A)(this,Ze,{writable:!0,value:null}),(0,d.A)(this,$e,{writable:!0,value:0}),(0,d.A)(this,et,{writable:!0,value:0}),(0,d.A)(this,tt,{writable:!0,value:null}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(e,t){l.AnnotationEditor.initialize(e,t)}static updateDefaultParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:Et._defaultThickness=t;break;case r.AnnotationEditorParamsType.INK_COLOR:Et._defaultColor=t;break;case r.AnnotationEditorParamsType.INK_OPACITY:Et._defaultOpacity=t/100}}updateParams(e,t){switch(e){case r.AnnotationEditorParamsType.INK_THICKNESS:(0,h.A)(this,nt,St).call(this,t);break;case r.AnnotationEditorParamsType.INK_COLOR:(0,h.A)(this,rt,Dt).call(this,t);break;case r.AnnotationEditorParamsType.INK_OPACITY:(0,h.A)(this,it,kt).call(this,t)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,Et._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,Et._defaultColor||l.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*Et._defaultOpacity)]]}get propertiesToUpdate(){var e;return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||Et._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||Et._defaultColor||l.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(e=this.opacity)&&void 0!==e?e:Et._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||((0,h.A)(this,mt,zt).call(this),(0,h.A)(this,vt,Ut).call(this)),this.isAttachedToDOM||(this.parent.add(this),(0,h.A)(this,yt,Gt).call(this)),(0,h.A)(this,xt,Jt).call(this)))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,(0,p.A)(this,Ke)&&(clearTimeout((0,p.A)(this,Ke)),(0,f.A)(this,Ke,null)),(0,p.A)(this,Ze).disconnect(),(0,f.A)(this,Ze,null),super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,n=this.width*e,r=this.height*t;this.setDimensions(n,r)}enableEditMode(){(0,p.A)(this,Xe)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",(0,p.A)(this,qe)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",(0,p.A)(this,qe)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){(0,p.A)(this,Xe)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),(0,f.A)(this,Xe,!0),this.div.classList.add("disabled"),(0,h.A)(this,xt,Jt).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!(0,p.A)(this,Xe)&&(this.setInForeground(),e.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),(0,h.A)(this,st,It).call(this,e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),(0,h.A)(this,lt,Pt).call(this,e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),(0,h.A)(this,gt,Bt).call(this,e)}canvasPointerleave(e){(0,h.A)(this,gt,Bt).call(this,e)}get isResizable(){return!this.isEmpty()&&(0,p.A)(this,Xe)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[n,r,i,o]=(0,h.A)(this,ot,Tt).call(this);if(this.setAt(n,r,0,0),this.setDims(i,o),(0,h.A)(this,mt,zt).call(this),this.width){const[n,r]=this.parentDimensions;this.setAspectRatio(this.width*n,this.height*r),this.setAt(e*n,t*r,this.width*n,this.height*r),(0,f.A)(this,Je,!0),(0,h.A)(this,yt,Gt).call(this),this.setDims(this.width*n,this.height*r),(0,h.A)(this,pt,Lt).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return(0,h.A)(this,vt,Ut).call(this),this.div}setDimensions(e,t){const n=Math.round(e),r=Math.round(t);if((0,p.A)(this,$e)===n&&(0,p.A)(this,et)===r)return;(0,f.A)(this,$e,n),(0,f.A)(this,et,r),this.canvas.style.visibility="hidden";const[i,o]=this.parentDimensions;this.width=e/i,this.height=t/o,this.fixAndSetPosition(),(0,p.A)(this,Xe)&&(0,h.A)(this,bt,Ht).call(this,e,t),(0,h.A)(this,yt,Gt).call(this),(0,h.A)(this,pt,Lt).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(e,t,n){if(e instanceof m.InkAnnotationElement)return null;const i=super.deserialize(e,t,n);i.thickness=e.thickness,i.color=r.Util.makeHexColor(...e.color),i.opacity=e.opacity;const[a,s]=i.pageDimensions,c=i.width*a,u=i.height*s,d=i.parentScale,p=e.thickness/2;(0,f.A)(i,Xe,!0),(0,f.A)(i,$e,Math.round(c)),(0,f.A)(i,et,Math.round(u));const{paths:g,rect:v,rotation:y}=e;for(let{bezier:r}of g){r=(0,o.A)(Et,Et,Kt).call(Et,r,v,y);const e=[];i.paths.push(e);let t=d*(r[0]-p),n=d*(r[1]-p);for(let i=2,o=r.length;i{this.thickness=e,(0,h.A)(this,xt,Jt).call(this)},n=this.thickness;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function Dt(e){const t=e=>{this.color=e,(0,h.A)(this,pt,Lt).call(this)},n=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function kt(e){const t=e=>{this.opacity=e,(0,h.A)(this,pt,Lt).call(this)};e/=100;const n=this.opacity;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function Tt(){const{parentRotation:e,parentDimensions:[t,n]}=this;switch(e){case 90:return[0,n,n,t];case 180:return[t,n,t,n];case 270:return[t,0,n,t];default:return[0,0,t,n]}}function Ot(){const{ctx:e,color:t,opacity:n,thickness:r,parentScale:i,scaleFactor:o}=this;e.lineWidth=r*i/o,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle="".concat(t).concat((0,g.opacityToHex)(n))}function It(e,t){var n;(this.canvas.addEventListener("contextmenu",K.noContextMenu),this.canvas.addEventListener("pointerleave",(0,p.A)(this,We)),this.canvas.addEventListener("pointermove",(0,p.A)(this,He)),this.canvas.addEventListener("pointerup",(0,p.A)(this,Ve)),this.canvas.removeEventListener("pointerdown",(0,p.A)(this,qe)),this.isEditing=!0,(0,p.A)(this,Je))||((0,f.A)(this,Je,!0),(0,h.A)(this,yt,Gt).call(this),this.thickness||(this.thickness=Et._defaultThickness),this.color||(this.color=Et._defaultColor||l.AnnotationEditor._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=Et._defaultOpacity));this.currentPath.push([e,t]),(0,f.A)(this,Qe,!1),(0,h.A)(this,at,Ot).call(this),(0,f.A)(this,tt,()=>{(0,h.A)(this,dt,Nt).call(this),(0,p.A)(this,tt)&&window.requestAnimationFrame((0,p.A)(this,tt))}),window.requestAnimationFrame((0,p.A)(this,tt))}function Pt(e,t){const[n,r]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===n&&t===r)return;const i=this.currentPath;let o=(0,p.A)(this,Ye);if(i.push([e,t]),(0,f.A)(this,Qe,!0),i.length<=2)return o.moveTo(...i[0]),void o.lineTo(e,t);3===i.length&&((0,f.A)(this,Ye,o=new Path2D),o.moveTo(...i[0])),(0,h.A)(this,ht,jt).call(this,o,...i.at(-3),...i.at(-2),e,t)}function Mt(){if(0===this.currentPath.length)return;const e=this.currentPath.at(-1);(0,p.A)(this,Ye).lineTo(...e)}function Rt(e,t){let n;if((0,f.A)(this,tt,null),e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),(0,h.A)(this,lt,Pt).call(this,e,t),(0,h.A)(this,ct,Mt).call(this),1!==this.currentPath.length)n=(0,h.A)(this,ft,Ft).call(this);else{const r=[e,t];n=[[r,r.slice(),r.slice(),r]]}const r=(0,p.A)(this,Ye),i=this.currentPath;this.currentPath=[],(0,f.A)(this,Ye,new Path2D);this.addCommands({cmd:()=>{this.allRawPaths.push(i),this.paths.push(n),this.bezierPath2D.push(r),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||((0,h.A)(this,mt,zt).call(this),(0,h.A)(this,vt,Ut).call(this)),(0,h.A)(this,xt,Jt).call(this))},mustExec:!0})}function Nt(){if(!(0,p.A)(this,Qe))return;(0,f.A)(this,Qe,!1);const e=Math.ceil(this.thickness*this.parentScale),t=this.currentPath.slice(-3),n=t.map(e=>e[0]),r=t.map(e=>e[1]),{ctx:i}=(Math.min(...n),Math.max(...n),Math.min(...r),Math.max(...r),this);i.save(),i.clearRect(0,0,this.canvas.width,this.canvas.height);for(const o of this.bezierPath2D)i.stroke(o);i.stroke((0,p.A)(this,Ye)),i.restore()}function jt(e,t,n,r,i,o,a){const s=(t+r)/2,l=(n+i)/2,c=(r+o)/2,u=(i+a)/2;e.bezierCurveTo(s+2*(r-s)/3,l+2*(i-l)/3,c+2*(r-c)/3,u+2*(i-u)/3,c,u)}function Ft(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const t=[];let n,[r,i]=e[0];for(n=1;n{(0,f.A)(this,Ke,null),this.canvas.removeEventListener("contextmenu",K.noContextMenu)},10)),(0,h.A)(this,ut,Rt).call(this,e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function zt(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function Ut(){(0,f.A)(this,Ze,new ResizeObserver(e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)})),(0,p.A)(this,Ze).observe(this.div)}function Gt(){if(!(0,p.A)(this,Je))return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),(0,h.A)(this,wt,Wt).call(this)}function Ht(e,t){const n=(0,h.A)(this,Ct,Qt).call(this),r=(e-n)/(0,p.A)(this,Ge),i=(t-n)/(0,p.A)(this,Ue);this.scaleFactor=Math.min(r,i)}function Wt(){const e=(0,h.A)(this,Ct,Qt).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}function Vt(e){const t=new Path2D;for(let n=0,r=e.length;n0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!(0,p.A)(this,Xe))return void(0,h.A)(this,pt,Lt).call(this);const t=(0,h.A)(this,_t,Xt).call(this),n=(0,h.A)(this,Ct,Qt).call(this);(0,f.A)(this,Ge,Math.max(l.AnnotationEditor.MIN_SIZE,t[2]-t[0])),(0,f.A)(this,Ue,Math.max(l.AnnotationEditor.MIN_SIZE,t[3]-t[1]));const r=Math.ceil(n+(0,p.A)(this,Ge)*this.scaleFactor),i=Math.ceil(n+(0,p.A)(this,Ue)*this.scaleFactor),[o,a]=this.parentDimensions;this.width=r/o,this.height=i/a,this.setAspectRatio(r,i);const s=this.translationX,c=this.translationY;this.translationX=-t[0],this.translationY=-t[1],(0,h.A)(this,yt,Gt).call(this),(0,h.A)(this,pt,Lt).call(this),(0,f.A)(this,$e,r),(0,f.A)(this,et,i),this.setDims(r,i);const u=e?n/this.scaleFactor/2:0;this.translate(s-this.translationX-u,c-this.translationY-u)}(0,a.A)(Et,"_defaultColor",null),(0,a.A)(Et,"_defaultOpacity",1),(0,a.A)(Et,"_defaultThickness",1),(0,a.A)(Et,"_type","ink"),(0,a.A)(Et,"_editorType",r.AnnotationEditorType.INK);var Zt=new WeakMap,$t=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,rn=new WeakMap,on=new WeakMap,an=new WeakMap,sn=new WeakMap,ln=new WeakMap,cn=new WeakMap,un=new WeakSet,dn=new WeakSet,hn=new WeakSet,fn=new WeakSet,pn=new WeakSet,gn=new WeakSet,mn=new WeakSet,vn=new WeakSet,yn=new WeakSet;class bn extends l.AnnotationEditor{constructor(e){super((0,s.A)((0,s.A)({},e),{},{name:"stampEditor"})),(0,u.A)(this,yn),(0,u.A)(this,vn),(0,u.A)(this,mn),(0,u.A)(this,gn),(0,u.A)(this,pn),(0,u.A)(this,fn),(0,u.A)(this,hn),(0,u.A)(this,dn),(0,u.A)(this,un),(0,d.A)(this,Zt,{writable:!0,value:null}),(0,d.A)(this,$t,{writable:!0,value:null}),(0,d.A)(this,en,{writable:!0,value:null}),(0,d.A)(this,tn,{writable:!0,value:null}),(0,d.A)(this,nn,{writable:!0,value:null}),(0,d.A)(this,rn,{writable:!0,value:""}),(0,d.A)(this,on,{writable:!0,value:null}),(0,d.A)(this,an,{writable:!0,value:null}),(0,d.A)(this,sn,{writable:!0,value:null}),(0,d.A)(this,ln,{writable:!0,value:!1}),(0,d.A)(this,cn,{writable:!0,value:!1}),(0,f.A)(this,tn,e.bitmapUrl),(0,f.A)(this,nn,e.bitmapFile)}static initialize(e,t){l.AnnotationEditor.initialize(e,t)}static get supportedTypes(){return(0,r.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(e=>"image/".concat(e)))}static get supportedTypesStr(){return(0,r.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(r.AnnotationEditorType.STAMP,{bitmapFile:e.getAsFile()})}remove(){var e,t;(0,p.A)(this,$t)&&((0,f.A)(this,Zt,null),this._uiManager.imageManager.deleteId((0,p.A)(this,$t)),null===(e=(0,p.A)(this,on))||void 0===e||e.remove(),(0,f.A)(this,on,null),null===(t=(0,p.A)(this,an))||void 0===t||t.disconnect(),(0,f.A)(this,an,null),(0,p.A)(this,sn)&&(clearTimeout((0,p.A)(this,sn)),(0,f.A)(this,sn,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&((0,p.A)(this,$t)&&null===(0,p.A)(this,on)&&(0,h.A)(this,hn,_n).call(this),this.isAttachedToDOM||this.parent.add(this))):(0,p.A)(this,$t)&&(0,h.A)(this,hn,_n).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!((0,p.A)(this,en)||(0,p.A)(this,Zt)||(0,p.A)(this,tn)||(0,p.A)(this,nn)||(0,p.A)(this,$t))}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),(0,p.A)(this,Zt)?(0,h.A)(this,fn,Cn).call(this):(0,h.A)(this,hn,_n).call(this),this.width){const[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r)}return this.div}getImageForAltText(){return(0,p.A)(this,on)}static deserialize(e,t,n){if(e instanceof m.StampAnnotationElement)return null;const r=super.deserialize(e,t,n),{rect:i,bitmapUrl:o,bitmapId:a,isSvg:s,accessibilityData:l}=e;a&&n.imageManager.isValidId(a)?(0,f.A)(r,$t,a):(0,f.A)(r,tn,o),(0,f.A)(r,ln,s);const[c,u]=r.pageDimensions;return r.width=(i[2]-i[0])/c,r.height=(i[3]-i[1])/u,l&&(r.altTextData=l),r}serialize(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const n={annotationType:r.AnnotationEditorType.STAMP,bitmapId:(0,p.A)(this,$t),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:(0,p.A)(this,ln),structTreeParentId:this._structTreeParentId};if(e)return n.bitmapUrl=(0,h.A)(this,vn,Dn).call(this,!0),n.accessibilityData=this.altTextData,n;const{decorative:i,altText:o}=this.altTextData;if(!i&&o&&(n.accessibilityData={type:"Figure",alt:o}),null===t)return n;t.stamps||(t.stamps=new Map);const a=(0,p.A)(this,ln)?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(t.stamps.has((0,p.A)(this,$t))){if((0,p.A)(this,ln)){const e=t.stamps.get((0,p.A)(this,$t));a>e.area&&(e.area=a,e.serialized.bitmap.close(),e.serialized.bitmap=(0,h.A)(this,vn,Dn).call(this,!1))}}else t.stamps.set((0,p.A)(this,$t),{area:a,serialized:n}),n.bitmap=(0,h.A)(this,vn,Dn).call(this,!1);return n}}function wn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e?((0,f.A)(this,Zt,e.bitmap),t||((0,f.A)(this,$t,e.id),(0,f.A)(this,ln,e.isSvg)),e.file&&(0,f.A)(this,rn,e.file.name),(0,h.A)(this,fn,Cn).call(this)):this.remove()}function An(){(0,f.A)(this,en,null),this._uiManager.enableWaiting(!1),(0,p.A)(this,on)&&this.div.focus()}function _n(){if((0,p.A)(this,$t))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId((0,p.A)(this,$t)).then(e=>(0,h.A)(this,un,wn).call(this,e,!0)).finally(()=>(0,h.A)(this,dn,An).call(this));if((0,p.A)(this,tn)){const e=(0,p.A)(this,tn);return(0,f.A)(this,tn,null),this._uiManager.enableWaiting(!0),void(0,f.A)(this,en,this._uiManager.imageManager.getFromUrl(e).then(e=>(0,h.A)(this,un,wn).call(this,e)).finally(()=>(0,h.A)(this,dn,An).call(this)))}if((0,p.A)(this,nn)){const e=(0,p.A)(this,nn);return(0,f.A)(this,nn,null),this._uiManager.enableWaiting(!0),void(0,f.A)(this,en,this._uiManager.imageManager.getFromFile(e).then(e=>(0,h.A)(this,un,wn).call(this,e)).finally(()=>(0,h.A)(this,dn,An).call(this)))}const e=document.createElement("input");e.type="file",e.accept=bn.supportedTypesStr,(0,f.A)(this,en,new Promise(t=>{e.addEventListener("change",async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);(0,h.A)(this,un,wn).call(this,t)}else this.remove();t()}),e.addEventListener("cancel",()=>{this.remove(),t()})}).finally(()=>(0,h.A)(this,dn,An).call(this))),e.click()}function Cn(){const{div:e}=this;let{width:t,height:n}=(0,p.A)(this,Zt);const[r,i]=this.pageDimensions,o=.75;if(this.width)t=this.width*r,n=this.height*i;else if(t>o*r||n>o*i){const e=Math.min(o*r/t,o*i/n);t*=e,n*=e}const[a,s]=this.parentDimensions;this.setDims(t*a/r,n*s/i),this._uiManager.enableWaiting(!1);const l=(0,f.A)(this,on,document.createElement("canvas"));e.append(l),e.hidden=!1,(0,h.A)(this,mn,Sn).call(this,t,n),(0,h.A)(this,yn,kn).call(this),(0,p.A)(this,cn)||(this.parent.addUndoableEditor(this),(0,f.A)(this,cn,!0)),this._reportTelemetry({action:"inserted_image"}),(0,p.A)(this,rn)&&l.setAttribute("aria-label",(0,p.A)(this,rn))}function xn(e,t){var n;const[r,i]=this.parentDimensions;this.width=e/r,this.height=t/i,this.setDims(e,t),null!==(n=this._initialOptions)&&void 0!==n&&n.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==(0,p.A)(this,sn)&&clearTimeout((0,p.A)(this,sn));(0,f.A)(this,sn,setTimeout(()=>{(0,f.A)(this,sn,null),(0,h.A)(this,mn,Sn).call(this,e,t)},200))}function En(e,t){const{width:n,height:r}=(0,p.A)(this,Zt);let i=n,o=r,a=(0,p.A)(this,Zt);for(;i>2*e||o>2*t;){const n=i,r=o;i>2*e&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2)),o>2*t&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const s=new OffscreenCanvas(i,o);s.getContext("2d").drawImage(a,0,0,n,r,0,0,i,o),a=s.transferToImageBitmap()}return a}function Sn(e,t){e=Math.ceil(e),t=Math.ceil(t);const n=(0,p.A)(this,on);if(!n||n.width===e&&n.height===t)return;n.width=e,n.height=t;const r=(0,p.A)(this,ln)?(0,p.A)(this,Zt):(0,h.A)(this,gn,En).call(this,e,t);if(this._uiManager.hasMLManager&&!this.hasAltText()){const n=new OffscreenCanvas(e,t);n.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,e,t),n.convertToBlob().then(e=>{const t=new FileReader;t.onload=()=>{const e=t.result;this._uiManager.mlGuess({service:"image-to-text",request:{imageData:e}}).then(e=>{const t=(null===e||void 0===e?void 0:e.output)||"";this.parent&&t&&!this.hasAltText()&&(this.altTextData={altText:t,decorative:!1})})},t.readAsDataURL(e)})}const i=n.getContext("2d");i.filter=this._uiManager.hcmFilter,i.drawImage(r,0,0,r.width,r.height,0,0,e,t)}function Dn(e){if(e){if((0,p.A)(this,ln)){const e=this._uiManager.imageManager.getSvgUrl((0,p.A)(this,$t));if(e)return e}const e=document.createElement("canvas");({width:e.width,height:e.height}=(0,p.A)(this,Zt));return e.getContext("2d").drawImage((0,p.A)(this,Zt),0,0),e.toDataURL()}if((0,p.A)(this,ln)){const[e,t]=this.pageDimensions,n=Math.round(this.width*e*K.PixelsPerInch.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*K.PixelsPerInch.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(n,r);return i.getContext("2d").drawImage((0,p.A)(this,Zt),0,0,(0,p.A)(this,Zt).width,(0,p.A)(this,Zt).height,0,0,n,r),i.transferToImageBitmap()}return structuredClone((0,p.A)(this,Zt))}function kn(){(0,f.A)(this,an,new ResizeObserver(e=>{const t=e[0].contentRect;t.width&&t.height&&(0,h.A)(this,pn,xn).call(this,t.width,t.height)})),(0,p.A)(this,an).observe(this.div)}(0,a.A)(bn,"_type","stamp"),(0,a.A)(bn,"_editorType",r.AnnotationEditorType.STAMP);var Tn=new WeakMap,On=new WeakMap,In=new WeakMap,Pn=new WeakMap,Mn=new WeakMap,Rn=new WeakMap,Nn=new WeakMap,jn=new WeakMap,Fn=new WeakMap,Ln=new WeakMap,Bn=new WeakMap,zn=new WeakMap,Un=new WeakMap,Gn=new WeakSet,Hn=new WeakMap,Wn=new WeakSet,Vn=new WeakSet,qn=new WeakSet;class Kn{constructor(e){let{uiManager:t,pageIndex:n,div:r,accessibilityManager:i,annotationLayer:o,drawLayer:a,textLayer:s,viewport:l,l10n:h}=e;(0,u.A)(this,qn),(0,u.A)(this,Vn),(0,u.A)(this,Wn),(0,d.A)(this,Hn,{get:Xn,set:void 0}),(0,u.A)(this,Gn),(0,d.A)(this,Tn,{writable:!0,value:void 0}),(0,d.A)(this,On,{writable:!0,value:!1}),(0,d.A)(this,In,{writable:!0,value:null}),(0,d.A)(this,Pn,{writable:!0,value:null}),(0,d.A)(this,Mn,{writable:!0,value:null}),(0,d.A)(this,Rn,{writable:!0,value:null}),(0,d.A)(this,Nn,{writable:!0,value:null}),(0,d.A)(this,jn,{writable:!0,value:new Map}),(0,d.A)(this,Fn,{writable:!0,value:!1}),(0,d.A)(this,Ln,{writable:!0,value:!1}),(0,d.A)(this,Bn,{writable:!0,value:!1}),(0,d.A)(this,zn,{writable:!0,value:null}),(0,d.A)(this,Un,{writable:!0,value:void 0});const g=[...(0,c.A)(Kn,Kn,$n).values()];if(!Kn._initialized){Kn._initialized=!0;for(const e of g)e.initialize(h,t)}t.registerEditorTypes(g),(0,f.A)(this,Un,t),this.pageIndex=n,this.div=r,(0,f.A)(this,Tn,i),(0,f.A)(this,In,o),this.viewport=l,(0,f.A)(this,zn,s),this.drawLayer=a,(0,p.A)(this,Un).addLayer(this)}get isEmpty(){return 0===(0,p.A)(this,jn).size}get isInvisible(){return this.isEmpty&&(0,p.A)(this,Un).getMode()===r.AnnotationEditorType.NONE}updateToolbar(e){(0,p.A)(this,Un).updateToolbar(e)}updateMode(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,p.A)(this,Un).getMode();switch((0,h.A)(this,qn,Zn).call(this),e){case r.AnnotationEditorType.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case r.AnnotationEditorType.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case r.AnnotationEditorType.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const n of(0,c.A)(Kn,Kn,$n).values())t.toggle("".concat(n._type,"Editing"),e===n._editorType);this.div.hidden=!1}hasTextLayer(e){var t;return e===(null===(t=(0,p.A)(this,zn))||void 0===t?void 0:t.div)}addInkEditorIfNeeded(e){if((0,p.A)(this,Un).getMode()!==r.AnnotationEditorType.INK)return;if(!e)for(const t of(0,p.A)(this,jn).values())if(t.isEmpty())return void t.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){(0,p.A)(this,Un).setEditingState(e)}addCommands(e){(0,p.A)(this,Un).addCommands(e)}togglePointerEvents(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(){var e;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=(0,p.A)(this,In))||void 0===e||e.div.classList.toggle("disabled",!t)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const n of(0,p.A)(this,jn).values())n.enableEditing(),n.show(!0),n.annotationElementId&&((0,p.A)(this,Un).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));if(!(0,p.A)(this,In))return;const t=(0,p.A)(this,In).getEditableAnnotations();for(const n of t){if(n.hide(),(0,p.A)(this,Un).isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}}disable(){(0,f.A)(this,Bn,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,t=new Map;for(const i of(0,p.A)(this,jn).values()){var n;i.disableEditing(),i.annotationElementId&&(null===i.serialize()?(t.set(i.annotationElementId,i),null===(n=this.getEditableAnnotation(i.annotationElementId))||void 0===n||n.show(),i.remove()):e.set(i.annotationElementId,i))}if((0,p.A)(this,In)){const n=(0,p.A)(this,In).getEditableAnnotations();for(const r of n){const{id:n}=r.data;if((0,p.A)(this,Un).isDeletedAnnotationElement(n))continue;let i=t.get(n);i?(i.resetAnnotationElement(r),i.show(!1),r.show()):(i=e.get(n),i&&((0,p.A)(this,Un).addChangedExistingAnnotation(i),i.renderAnnotationElement(r),i.show(!1)),r.show())}}(0,h.A)(this,qn,Zn).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const i of(0,c.A)(Kn,Kn,$n).values())r.remove("".concat(i._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),(0,f.A)(this,Bn,!1)}getEditableAnnotation(e){var t;return(null===(t=(0,p.A)(this,In))||void 0===t?void 0:t.getEditableAnnotation(e))||null}setActiveEditor(e){(0,p.A)(this,Un).getActive()!==e&&(0,p.A)(this,Un).setActiveEditor(e)}enableTextSelection(){var e;this.div.tabIndex=-1,null!==(e=(0,p.A)(this,zn))&&void 0!==e&&e.div&&!(0,p.A)(this,Rn)&&((0,f.A)(this,Rn,(0,h.A)(this,Gn,Yn).bind(this)),(0,p.A)(this,zn).div.addEventListener("pointerdown",(0,p.A)(this,Rn)),(0,p.A)(this,zn).div.classList.add("highlighting"))}disableTextSelection(){var e;this.div.tabIndex=0,null!==(e=(0,p.A)(this,zn))&&void 0!==e&&e.div&&(0,p.A)(this,Rn)&&((0,p.A)(this,zn).div.removeEventListener("pointerdown",(0,p.A)(this,Rn)),(0,f.A)(this,Rn,null),(0,p.A)(this,zn).div.classList.remove("highlighting"))}enableClick(){(0,p.A)(this,Mn)||((0,f.A)(this,Mn,this.pointerdown.bind(this)),(0,f.A)(this,Pn,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",(0,p.A)(this,Mn)),this.div.addEventListener("pointerup",(0,p.A)(this,Pn)))}disableClick(){(0,p.A)(this,Mn)&&(this.div.removeEventListener("pointerdown",(0,p.A)(this,Mn)),this.div.removeEventListener("pointerup",(0,p.A)(this,Pn)),(0,f.A)(this,Mn,null),(0,f.A)(this,Pn,null))}attach(e){(0,p.A)(this,jn).set(e.id,e);const{annotationElementId:t}=e;t&&(0,p.A)(this,Un).isDeletedAnnotationElement(t)&&(0,p.A)(this,Un).removeDeletedAnnotationElement(e)}detach(e){var t;(0,p.A)(this,jn).delete(e.id),null===(t=(0,p.A)(this,Tn))||void 0===t||t.removePointerInTextLayer(e.contentDiv),!(0,p.A)(this,Bn)&&e.annotationElementId&&(0,p.A)(this,Un).addDeletedAnnotationElement(e)}remove(e){this.detach(e),(0,p.A)(this,Un).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,(0,p.A)(this,Ln)||this.addInkEditorIfNeeded(!1)}changeParent(e){var t;e.parent!==this&&(e.parent&&e.annotationElementId&&((0,p.A)(this,Un).addDeletedAnnotationElement(e.annotationElementId),l.AnnotationEditor.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),null===(t=e.parent)||void 0===t||t.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(e.parent!==this||!e.isAttachedToDOM){if(this.changeParent(e),(0,p.A)(this,Un).addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),(0,p.A)(this,Un).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){var t;if(!e.isAttachedToDOM)return;const{activeElement:n}=document;e.div.contains(n)&&!(0,p.A)(this,Nn)&&(e._focusEventsAllowed=!1,(0,f.A)(this,Nn,setTimeout(()=>{(0,f.A)(this,Nn,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),n.focus())},0))),e._structTreeParentId=null===(t=(0,p.A)(this,Tn))||void 0===t?void 0:t.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return(0,p.A)(this,Un).getId()}canCreateNewEmptyEditor(){var e;return null===(e=(0,p.A)(this,Hn))||void 0===e?void 0:e.canCreateNewEmptyEditor()}pasteEditor(e,t){(0,p.A)(this,Un).updateToolbar(e),(0,p.A)(this,Un).updateMode(e);const{offsetX:n,offsetY:r}=(0,h.A)(this,Vn,Jn).call(this),i=this.getNextId(),o=(0,h.A)(this,Wn,Qn).call(this,(0,s.A)({parent:this,id:i,x:n,y:r,uiManager:(0,p.A)(this,Un),isCentered:!0},t));o&&this.add(o)}deserialize(e){var t,n;return(null===(t=(0,c.A)(Kn,Kn,$n).get(null!==(n=e.annotationType)&&void 0!==n?n:e.annotationEditorType))||void 0===t?void 0:t.deserialize(e,this,(0,p.A)(this,Un)))||null}createAndAddNewEditor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getNextId(),i=(0,h.A)(this,Wn,Qn).call(this,(0,s.A)({parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:(0,p.A)(this,Un),isCentered:t},n));return i&&this.add(i),i}addNewEditor(){this.createAndAddNewEditor((0,h.A)(this,Vn,Jn).call(this),!0)}setSelected(e){(0,p.A)(this,Un).setSelected(e)}toggleSelected(e){(0,p.A)(this,Un).toggleSelected(e)}isSelected(e){return(0,p.A)(this,Un).isSelected(e)}unselect(e){(0,p.A)(this,Un).unselect(e)}pointerup(e){const{isMac:t}=r.FeatureTest.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&(0,p.A)(this,Fn)&&((0,f.A)(this,Fn,!1),(0,p.A)(this,On)?(0,p.A)(this,Un).getMode()!==r.AnnotationEditorType.STAMP?this.createAndAddNewEditor(e,!1):(0,p.A)(this,Un).unselectAll():(0,f.A)(this,On,!0))}pointerdown(e){if((0,p.A)(this,Un).getMode()===r.AnnotationEditorType.HIGHLIGHT&&this.enableTextSelection(),(0,p.A)(this,Fn))return void(0,f.A)(this,Fn,!1);const{isMac:t}=r.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;(0,f.A)(this,Fn,!0);const n=(0,p.A)(this,Un).getActive();(0,f.A)(this,On,!n||n.isEmpty())}findNewParent(e,t,n){const r=(0,p.A)(this,Un).findParent(t,n);return null!==r&&r!==this&&(r.changeParent(e),!0)}destroy(){var e;(null===(e=(0,p.A)(this,Un).getActive())||void 0===e?void 0:e.parent)===this&&((0,p.A)(this,Un).commitOrRemove(),(0,p.A)(this,Un).setActiveEditor(null)),(0,p.A)(this,Nn)&&(clearTimeout((0,p.A)(this,Nn)),(0,f.A)(this,Nn,null));for(const n of(0,p.A)(this,jn).values()){var t;null===(t=(0,p.A)(this,Tn))||void 0===t||t.removePointerInTextLayer(n.contentDiv),n.setParent(null),n.isAttachedToDOM=!1,n.div.remove()}this.div=null,(0,p.A)(this,jn).clear(),(0,p.A)(this,Un).removeLayer(this)}render(e){let{viewport:t}=e;this.viewport=t,(0,K.setLayerDimensions)(this.div,t);for(const n of(0,p.A)(this,Un).getEditors(this.pageIndex))this.add(n),n.rebuild();this.updateMode()}update(e){let{viewport:t}=e;(0,p.A)(this,Un).commitOrRemove(),(0,h.A)(this,qn,Zn).call(this);const n=this.viewport.rotation,r=t.rotation;if(this.viewport=t,(0,K.setLayerDimensions)(this.div,{rotation:r}),n!==r)for(const i of(0,p.A)(this,jn).values())i.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return(0,p.A)(this,Un).viewParameters.realScale}}function Yn(e){if((0,p.A)(this,Un).unselectAll(),e.target===(0,p.A)(this,zn).div){const{isMac:t}=r.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&t)return;(0,p.A)(this,Un).showAllEditors("highlight",!0,!0),(0,p.A)(this,zn).div.classList.add("free"),Ee.startHighlighting(this,"ltr"===(0,p.A)(this,Un).direction,e),(0,p.A)(this,zn).div.addEventListener("pointerup",()=>{(0,p.A)(this,zn).div.classList.remove("free")},{once:!0}),e.preventDefault()}}function Xn(){return(0,c.A)(Kn,Kn,$n).get((0,p.A)(this,Un).getMode())}function Qn(e){const t=(0,p.A)(this,Hn);return t?new t.prototype.constructor(e):null}function Jn(){const{x:e,y:t,width:n,height:r}=this.div.getBoundingClientRect(),i=Math.max(0,e),o=Math.max(0,t),a=(i+Math.min(window.innerWidth,e+n))/2-e,s=(o+Math.min(window.innerHeight,t+r))/2-t,[l,c]=this.viewport.rotation%180===0?[a,s]:[s,a];return{offsetX:l,offsetY:c}}function Zn(){(0,f.A)(this,Ln,!0);for(const e of(0,p.A)(this,jn).values())e.isEmpty()&&e.remove();(0,f.A)(this,Ln,!1)}(0,a.A)(Kn,"_initialized",!1);var $n={writable:!0,value:new Map([N,Et,bn,Ee].map(e=>[e._editorType,e]))}},259:(e,t,n)=>{n.d(t,{ColorPicker:()=>T});var r=n(292),i=n(830),o=n(419),a=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakMap,A=new WeakMap,_=new WeakMap,C=new WeakSet,x=new WeakSet,E=new WeakSet,S=new WeakSet,D=new WeakSet,k=new WeakMap;class T{static get _keyboardManager(){return(0,r.shadow)(this,"_keyboardManager",new i.KeyboardManager([[["Escape","mac+Escape"],T.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],T.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],T.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],T.prototype._moveToPrevious],[["Home","mac+Home"],T.prototype._moveToBeginning],[["End","mac+End"],T.prototype._moveToEnd]]))}constructor(e){var t;let{editor:n=null,uiManager:i=null}=e;(0,d.A)(this,k,{get:N,set:void 0}),(0,u.A)(this,D),(0,u.A)(this,S),(0,u.A)(this,E),(0,u.A)(this,x),(0,u.A)(this,C),(0,d.A)(this,a,{writable:!0,value:(0,h.A)(this,E,P).bind(this)}),(0,d.A)(this,s,{writable:!0,value:(0,h.A)(this,D,R).bind(this)}),(0,d.A)(this,l,{writable:!0,value:null}),(0,d.A)(this,c,{writable:!0,value:null}),(0,d.A)(this,g,{writable:!0,value:void 0}),(0,d.A)(this,m,{writable:!0,value:null}),(0,d.A)(this,v,{writable:!0,value:!1}),(0,d.A)(this,y,{writable:!0,value:!1}),(0,d.A)(this,b,{writable:!0,value:null}),(0,d.A)(this,w,{writable:!0,value:void 0}),(0,d.A)(this,A,{writable:!0,value:null}),(0,d.A)(this,_,{writable:!0,value:void 0}),n?((0,f.A)(this,y,!1),(0,f.A)(this,_,r.AnnotationEditorParamsType.HIGHLIGHT_COLOR),(0,f.A)(this,b,n)):((0,f.A)(this,y,!0),(0,f.A)(this,_,r.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR)),(0,f.A)(this,A,(null===n||void 0===n?void 0:n._uiManager)||i),(0,f.A)(this,w,(0,p.A)(this,A)._eventBus),(0,f.A)(this,g,(null===n||void 0===n?void 0:n.color)||(null===(t=(0,p.A)(this,A))||void 0===t?void 0:t.highlightColors.values().next().value)||"#FFFF98")}renderButton(){const e=(0,f.A)(this,l,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0),e.addEventListener("click",(0,h.A)(this,S,M).bind(this)),e.addEventListener("keydown",(0,p.A)(this,a));const t=(0,f.A)(this,c,document.createElement("span"));return t.className="swatch",t.setAttribute("aria-hidden",!0),t.style.backgroundColor=(0,p.A)(this,g),e.append(t),e}renderMainDropdown(){const e=(0,f.A)(this,m,(0,h.A)(this,C,O).call(this));return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}_colorSelectFromKeyboard(e){if(e.target===(0,p.A)(this,l))return void(0,h.A)(this,S,M).call(this,e);const t=e.target.getAttribute("data-color");t&&(0,h.A)(this,x,I).call(this,t,e)}_moveToNext(e){var t,n;(0,p.A)(this,k)?e.target!==(0,p.A)(this,l)?null===(t=e.target.nextSibling)||void 0===t||t.focus():null===(n=(0,p.A)(this,m).firstChild)||void 0===n||n.focus():(0,h.A)(this,S,M).call(this,e)}_moveToPrevious(e){var t,n;e.target!==(null===(t=(0,p.A)(this,m))||void 0===t?void 0:t.firstChild)&&e.target!==(0,p.A)(this,l)?((0,p.A)(this,k)||(0,h.A)(this,S,M).call(this,e),null===(n=e.target.previousSibling)||void 0===n||n.focus()):(0,p.A)(this,k)&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){var t;(0,p.A)(this,k)?null===(t=(0,p.A)(this,m).firstChild)||void 0===t||t.focus():(0,h.A)(this,S,M).call(this,e)}_moveToEnd(e){var t;(0,p.A)(this,k)?null===(t=(0,p.A)(this,m).lastChild)||void 0===t||t.focus():(0,h.A)(this,S,M).call(this,e)}hideDropdown(){var e;null===(e=(0,p.A)(this,m))||void 0===e||e.classList.add("hidden"),window.removeEventListener("pointerdown",(0,p.A)(this,s))}_hideDropdownFromKeyboard(){var e;(0,p.A)(this,y)||((0,p.A)(this,k)?(this.hideDropdown(),(0,p.A)(this,l).focus({preventScroll:!0,focusVisible:(0,p.A)(this,v)})):null===(e=(0,p.A)(this,b))||void 0===e||e.unselect())}updateColor(e){if((0,p.A)(this,c)&&((0,p.A)(this,c).style.backgroundColor=e),!(0,p.A)(this,m))return;const t=(0,p.A)(this,A).highlightColors.values();for(const n of(0,p.A)(this,m).children)n.setAttribute("aria-selected",t.next().value===e)}destroy(){var e,t;null===(e=(0,p.A)(this,l))||void 0===e||e.remove(),(0,f.A)(this,l,null),(0,f.A)(this,c,null),null===(t=(0,p.A)(this,m))||void 0===t||t.remove(),(0,f.A)(this,m,null)}}function O(){const e=document.createElement("div");e.addEventListener("contextmenu",o.noContextMenu),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[t,n]of(0,p.A)(this,A).highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",n),r.title=t,r.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-".concat(t));const i=document.createElement("span");r.append(i),i.className="swatch",i.style.backgroundColor=n,r.setAttribute("aria-selected",n===(0,p.A)(this,g)),r.addEventListener("click",(0,h.A)(this,x,I).bind(this,n)),e.append(r)}return e.addEventListener("keydown",(0,p.A)(this,a)),e}function I(e,t){t.stopPropagation(),(0,p.A)(this,w).dispatch("switchannotationeditorparams",{source:this,type:(0,p.A)(this,_),value:e})}function P(e){T._keyboardManager.exec(this,e)}function M(e){if((0,p.A)(this,k))return void this.hideDropdown();if((0,f.A)(this,v,0===e.detail),window.addEventListener("pointerdown",(0,p.A)(this,s)),(0,p.A)(this,m))return void(0,p.A)(this,m).classList.remove("hidden");const t=(0,f.A)(this,m,(0,h.A)(this,C,O).call(this));(0,p.A)(this,l).append(t)}function R(e){var t;null!==(t=(0,p.A)(this,m))&&void 0!==t&&t.contains(e.target)||this.hideDropdown()}function N(){return(0,p.A)(this,m)&&!(0,p.A)(this,m).classList.contains("hidden")}},310:(e,t,n)=>{n.d(t,{AnnotationEditor:()=>ie});var r=n(830),i=n(292),s=n(419),l=new WeakMap,c=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakSet;class A{constructor(e){(0,u.A)(this,w),(0,d.A)(this,l,{writable:!0,value:""}),(0,d.A)(this,c,{writable:!0,value:!1}),(0,d.A)(this,g,{writable:!0,value:null}),(0,d.A)(this,m,{writable:!0,value:null}),(0,d.A)(this,v,{writable:!0,value:null}),(0,d.A)(this,y,{writable:!0,value:!1}),(0,d.A)(this,b,{writable:!0,value:null}),(0,f.A)(this,b,e)}static initialize(e){A._l10nPromise||(A._l10nPromise=e)}async render(){const e=(0,f.A)(this,g,document.createElement("button"));e.className="altText";const t=await A._l10nPromise.get("pdfjs-editor-alt-text-button-label");e.textContent=t,e.setAttribute("aria-label",t),e.tabIndex="0",e.addEventListener("contextmenu",s.noContextMenu),e.addEventListener("pointerdown",e=>e.stopPropagation());const n=e=>{e.preventDefault(),(0,p.A)(this,b)._uiManager.editAltText((0,p.A)(this,b))};return e.addEventListener("click",n,{capture:!0}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&((0,f.A)(this,y,!0),n(t))}),await(0,h.A)(this,w,_).call(this),e}finish(){(0,p.A)(this,g)&&((0,p.A)(this,g).focus({focusVisible:(0,p.A)(this,y)}),(0,f.A)(this,y,!1))}isEmpty(){return!(0,p.A)(this,l)&&!(0,p.A)(this,c)}get data(){return{altText:(0,p.A)(this,l),decorative:(0,p.A)(this,c)}}set data(e){let{altText:t,decorative:n}=e;(0,p.A)(this,l)===t&&(0,p.A)(this,c)===n||((0,f.A)(this,l,t),(0,f.A)(this,c,n),(0,h.A)(this,w,_).call(this))}toggle(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,p.A)(this,g)&&(!e&&(0,p.A)(this,v)&&(clearTimeout((0,p.A)(this,v)),(0,f.A)(this,v,null)),(0,p.A)(this,g).disabled=!e)}destroy(){var e;null===(e=(0,p.A)(this,g))||void 0===e||e.remove(),(0,f.A)(this,g,null),(0,f.A)(this,m,null)}}async function _(){const e=(0,p.A)(this,g);if(!e)return;var t;if(!(0,p.A)(this,l)&&!(0,p.A)(this,c))return e.classList.remove("done"),void(null===(t=(0,p.A)(this,m))||void 0===t||t.remove());e.classList.add("done"),A._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(t=>{e.setAttribute("aria-label",t)});let n=(0,p.A)(this,m);if(!n){(0,f.A)(this,m,n=document.createElement("span")),n.className="tooltip",n.setAttribute("role","tooltip");const t=n.id="alt-text-tooltip-".concat((0,p.A)(this,b).id);e.setAttribute("aria-describedby",t);const r=100;e.addEventListener("mouseenter",()=>{(0,f.A)(this,v,setTimeout(()=>{(0,f.A)(this,v,null),(0,p.A)(this,m).classList.add("show"),(0,p.A)(this,b)._reportTelemetry({action:"alt_text_tooltip"})},r))}),e.addEventListener("mouseleave",()=>{var e;(0,p.A)(this,v)&&(clearTimeout((0,p.A)(this,v)),(0,f.A)(this,v,null)),null===(e=(0,p.A)(this,m))||void 0===e||e.classList.remove("show")})}n.innerText=(0,p.A)(this,c)?await A._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):(0,p.A)(this,l),n.parentNode||e.append(n);const r=(0,p.A)(this,b).getImageForAltText();null===r||void 0===r||r.setAttribute("aria-describedby",n.id)}(0,a.A)(A,"_l10nPromise",null);var C=n(362),x=new WeakMap,E=new WeakMap,S=new WeakMap,D=new WeakMap,k=new WeakMap,T=new WeakMap,O=new WeakMap,I=new WeakMap,P=new WeakMap,M=new WeakMap,R=new WeakMap,N=new WeakMap,j=new WeakMap,F=new WeakMap,L=new WeakMap,B=new WeakMap,z=new WeakMap,U=new WeakMap,G=new WeakMap,H=new WeakMap,W=new WeakMap,V=new WeakSet,q=new WeakSet,K=new WeakSet,Y=new WeakSet,X=new WeakSet,Q=new WeakSet,J=new WeakSet,Z=new WeakSet,$=new WeakSet,ee=new WeakSet,te=new WeakSet,ne=new WeakSet,re=new WeakSet;class ie{static get _resizerKeyboardManager(){const e=ie.prototype._resizeWithKeyboard,t=r.AnnotationEditorUIManager.TRANSLATE_SMALL,n=r.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,i.shadow)(this,"_resizerKeyboardManager",new r.KeyboardManager([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],ie.prototype._stopResizingWithKeyboard]]))}constructor(e){(0,u.A)(this,re),(0,u.A)(this,ne),(0,u.A)(this,te),(0,u.A)(this,ee),(0,u.A)(this,$),(0,u.A)(this,Z),(0,u.A)(this,J),(0,u.A)(this,Q),(0,u.A)(this,X),(0,u.A)(this,Y),(0,u.A)(this,K),(0,u.A)(this,q),(0,u.A)(this,V),(0,d.A)(this,x,{writable:!0,value:null}),(0,d.A)(this,E,{writable:!0,value:null}),(0,d.A)(this,S,{writable:!0,value:!1}),(0,d.A)(this,D,{writable:!0,value:!1}),(0,d.A)(this,k,{writable:!0,value:null}),(0,d.A)(this,T,{writable:!0,value:null}),(0,d.A)(this,O,{writable:!0,value:this.focusin.bind(this)}),(0,d.A)(this,I,{writable:!0,value:this.focusout.bind(this)}),(0,d.A)(this,P,{writable:!0,value:null}),(0,d.A)(this,M,{writable:!0,value:""}),(0,d.A)(this,R,{writable:!0,value:!1}),(0,d.A)(this,N,{writable:!0,value:null}),(0,d.A)(this,j,{writable:!0,value:!1}),(0,d.A)(this,F,{writable:!0,value:!1}),(0,d.A)(this,L,{writable:!0,value:!1}),(0,d.A)(this,B,{writable:!0,value:null}),(0,d.A)(this,z,{writable:!0,value:0}),(0,d.A)(this,U,{writable:!0,value:0}),(0,d.A)(this,G,{writable:!0,value:null}),(0,a.A)(this,"_initialOptions",Object.create(null)),(0,a.A)(this,"_isVisible",!0),(0,a.A)(this,"_uiManager",null),(0,a.A)(this,"_focusEventsAllowed",!0),(0,a.A)(this,"_l10nPromise",null),(0,d.A)(this,H,{writable:!0,value:!1}),(0,d.A)(this,W,{writable:!0,value:ie._zIndex++}),this.constructor===ie&&(0,i.unreachable)("Cannot initialize AnnotationEditor."),this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:o,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[o,s];const[l,c]=this.parentDimensions;this.x=e.x/l,this.y=e.y/c,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new be({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t,n){if(ie._l10nPromise||(ie._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map(t=>[t,e.get(t.replaceAll(/([A-Z])/g,e=>"-".concat(e.toLowerCase())))]))),null!==n&&void 0!==n&&n.strings)for(const i of n.strings)ie._l10nPromise.set(i,e.get(i));if(-1!==ie._borderLineWidth)return;const r=getComputedStyle(document.documentElement);ie._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){(0,i.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return(0,p.A)(this,H)}set _isDraggable(e){var t;(0,f.A)(this,H,e),null===(t=this.div)||void 0===t||t.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=(0,p.A)(this,W)}setParent(e){null!==e?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(0,h.A)(this,re,ye).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&((0,p.A)(this,R)?(0,f.A)(this,R,!1):this.parent.setSelected(this))}focusout(e){var t;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const n=e.relatedTarget;null!==n&&void 0!==n&&n.closest("#".concat(this.id))||(e.preventDefault(),null!==(t=this.parent)&&void 0!==t&&t.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){const[i,o]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/o,this.fixAndSetPosition()}translate(e,t){(0,h.A)(this,V,oe).call(this,this.parentDimensions,e,t)}translateInPage(e,t){(0,p.A)(this,N)||(0,f.A)(this,N,[this.x,this.y]),(0,h.A)(this,V,oe).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){(0,p.A)(this,N)||(0,f.A)(this,N,[this.x,this.y]);const[n,r]=this.parentDimensions;if(this.x+=e/n,this.y+=t/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:i,y:o}=this;const[a,s]=this.getBaseTranslation();i+=a,o+=s,this.div.style.left="".concat((100*i).toFixed(2),"%"),this.div.style.top="".concat((100*o).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!(0,p.A)(this,N)&&((0,p.A)(this,N)[0]!==this.x||(0,p.A)(this,N)[1]!==this.y)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:n}=ie,r=n/e,i=n/t;switch(this.rotation){case 90:return[-r,i];case 180:return[r,i];case 270:return[r,-i];default:return[-r,-i]}}get _mustFixPosition(){return!0}fixAndSetPosition(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation;const[t,n]=this.pageDimensions;let{x:r,y:i,width:o,height:a}=this;if(o*=t,a*=n,r*=t,i*=n,this._mustFixPosition)switch(e){case 0:r=Math.max(0,Math.min(t-o,r)),i=Math.max(0,Math.min(n-a,i));break;case 90:r=Math.max(0,Math.min(t-a,r)),i=Math.min(n,Math.max(o,i));break;case 180:r=Math.min(t,Math.max(o,r)),i=Math.min(n,Math.max(a,i));break;case 270:r=Math.min(t,Math.max(a,r)),i=Math.max(0,Math.min(n-o,i))}this.x=r/=t,this.y=i/=n;const[s,l]=this.getBaseTranslation();r+=s,i+=l;const{style:c}=this.div;c.left="".concat((100*r).toFixed(2),"%"),c.top="".concat((100*i).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(e,t){return(0,o.A)(ie,ie,ae).call(ie,e,t,this.parentRotation)}pageTranslationToScreen(e,t){return(0,o.A)(ie,ie,ae).call(ie,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,n]}=this,r=t*e,o=n*e;return i.FeatureTest.isCSSRoundSupported?[Math.round(r),Math.round(o)]:[r,o]}setDims(e,t){const[n,r]=this.parentDimensions;this.div.style.width="".concat((100*e/n).toFixed(2),"%"),(0,p.A)(this,D)||(this.div.style.height="".concat((100*t/r).toFixed(2),"%"))}fixDims(){const{style:e}=this.div,{height:t,width:n}=e,r=n.endsWith("%"),i=!(0,p.A)(this,D)&&t.endsWith("%");if(r&&i)return;const[o,a]=this.parentDimensions;r||(e.width="".concat((100*parseFloat(n)/o).toFixed(2),"%")),(0,p.A)(this,D)||i||(e.height="".concat((100*parseFloat(t)/a).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}altTextFinish(){var e;null===(e=(0,p.A)(this,E))||void 0===e||e.finish()}async addEditToolbar(){return(0,p.A)(this,P)||(0,p.A)(this,F)||((0,f.A)(this,P,new C.EditorToolbar(this)),this.div.append((0,p.A)(this,P).render()),(0,p.A)(this,E)&&(0,p.A)(this,P).addAltTextButton(await(0,p.A)(this,E).render())),(0,p.A)(this,P)}removeEditToolbar(){var e;(0,p.A)(this,P)&&((0,p.A)(this,P).remove(),(0,f.A)(this,P,null),null===(e=(0,p.A)(this,E))||void 0===e||e.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){(0,p.A)(this,E)||(A.initialize(ie._l10nPromise),(0,f.A)(this,E,new A(this)),await this.addEditToolbar())}get altTextData(){var e;return null===(e=(0,p.A)(this,E))||void 0===e?void 0:e.data}set altTextData(e){(0,p.A)(this,E)&&((0,p.A)(this,E).data=e)}hasAltText(){var e;return!(null!==(e=(0,p.A)(this,E))&&void 0!==e&&e.isEmpty())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=(0,p.A)(this,S)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.div.addEventListener("focusin",(0,p.A)(this,O)),this.div.addEventListener("focusout",(0,p.A)(this,I));const[e,t]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*t/e).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*e/t).toFixed(2),"%"));const[n,i]=this.getInitialTranslation();return this.translate(n,i),(0,r.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:t}=i.FeatureTest.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():((0,f.A)(this,R,!0),this._isDraggable?(0,h.A)(this,Z,fe).call(this,e):(0,h.A)(this,J,he).call(this,e))}moveInDOM(){(0,p.A)(this,B)&&clearTimeout((0,p.A)(this,B)),(0,f.A)(this,B,setTimeout(()=>{var e;(0,f.A)(this,B,null),null===(e=this.parent)||void 0===e||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition()}getRect(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const r=this.parentScale,[i,o]=this.pageDimensions,[a,s]=this.pageTranslation,l=e/r,c=t/r,u=this.x*i,d=this.y*o,h=this.width*i,f=this.height*o;switch(n){case 0:return[u+l+a,o-d-c-f+s,u+l+h+a,o-d-c+s];case 90:return[u+c+a,o-d+l+s,u+c+f+a,o-d+l+h+s];case 180:return[u-l-h+a,o-d+c+s,u-l+a,o-d+c+f+s];case 270:return[u-c-f+a,o-d-l-h+s,u-c+a,o-d-l+s];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,r,i,o]=e,a=i-n,s=o-r;switch(this.rotation){case 0:return[n,t-o,a,s];case 90:return[n,t-r,s,a];case 180:return[i,t-r,a,s];case 270:return[i,t-o,s,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){(0,f.A)(this,F,!0)}disableEditMode(){(0,f.A)(this,F,!1)}isInEditMode(){return(0,p.A)(this,F)}shouldGetKeyboardEvents(){return(0,p.A)(this,L)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var e,t;null===(e=this.div)||void 0===e||e.addEventListener("focusin",(0,p.A)(this,O)),null===(t=this.div)||void 0===t||t.addEventListener("focusout",(0,p.A)(this,I))}rotate(e){}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(e,t,n){const r=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});r.rotation=e.rotation;const[i,o]=r.pageDimensions,[a,s,l,c]=r.getRectInCurrentCoords(e.rect,o);return r.x=a/i,r.y=s/o,r.width=l/i,r.height=c/o,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",(0,p.A)(this,O)),this.div.removeEventListener("focusout",(0,p.A)(this,I)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(0,p.A)(this,B)&&(clearTimeout((0,p.A)(this,B)),(0,f.A)(this,B,null)),(0,h.A)(this,re,ye).call(this),this.removeEditToolbar(),(0,p.A)(this,G)){for(const e of(0,p.A)(this,G).values())clearTimeout(e);(0,f.A)(this,G,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&((0,h.A)(this,K,le).call(this),(0,p.A)(this,k).classList.remove("hidden"),(0,r.bindEvents)(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||"Enter"!==e.key)return;this._uiManager.setSelected(this),(0,f.A)(this,T,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const t=(0,p.A)(this,k).children;if(!(0,p.A)(this,x)){(0,f.A)(this,x,Array.from(t));const e=(0,h.A)(this,$,pe).bind(this),n=(0,h.A)(this,ee,ge).bind(this);for(const t of(0,p.A)(this,x)){const r=t.getAttribute("data-resizer-name");t.setAttribute("role","spinbutton"),t.addEventListener("keydown",e),t.addEventListener("blur",n),t.addEventListener("focus",(0,h.A)(this,te,me).bind(this,r)),ie._l10nPromise.get("pdfjs-editor-resizer-label-".concat(r)).then(e=>t.setAttribute("aria-label",e))}}const n=(0,p.A)(this,x)[0];let r=0;for(const o of t){if(o===n)break;r++}const i=(360-this.rotation+this.parentRotation)%360/90*((0,p.A)(this,x).length/4);if(i!==r){if(ir)for(let t=0;tn.setAttribute("aria-label",e))}}(0,h.A)(this,ne,ve).call(this,0),(0,f.A)(this,L,!0),(0,p.A)(this,k).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){(0,p.A)(this,L)&&(0,h.A)(this,Q,de).call(this,(0,p.A)(this,M),{movementX:e,movementY:t})}_stopResizingWithKeyboard(){(0,h.A)(this,re,ye).call(this),this.div.focus()}select(){var e,t;this.makeResizable(),null===(e=this.div)||void 0===e||e.classList.add("selectedEditor"),(0,p.A)(this,P)?null===(t=(0,p.A)(this,P))||void 0===t||t.show():this.addEditToolbar().then(()=>{var e,t;null!==(e=this.div)&&void 0!==e&&e.classList.contains("selectedEditor")&&(null===(t=(0,p.A)(this,P))||void 0===t||t.show())})}unselect(){var e,t,n,r;null===(e=(0,p.A)(this,k))||void 0===e||e.classList.add("hidden"),null===(t=this.div)||void 0===t||t.classList.remove("selectedEditor"),null!==(n=this.div)&&void 0!==n&&n.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null===(r=(0,p.A)(this,P))||void 0===r||r.hide()}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return(0,p.A)(this,j)}set isEditing(e){(0,f.A)(this,j,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){(0,f.A)(this,D,!0);const n=e/t,{style:r}=this.div;r.aspectRatio=n,r.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){(0,p.A)(this,G)||(0,f.A)(this,G,new Map);const{action:t}=e;let n=(0,p.A)(this,G).get(t);return n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(e),(0,p.A)(this,G).delete(t),0===(0,p.A)(this,G).size&&(0,f.A)(this,G,null)},ie._telemetryTimeout),void(0,p.A)(this,G).set(t,n)}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),(0,f.A)(this,S,!1)}disable(){this.div&&(this.div.tabIndex=-1),(0,f.A)(this,S,!0)}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(t){if("CANVAS"===t.nodeName){const e=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.before(t)}}else t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){const{firstChild:t}=e.container;"DIV"===t.nodeName&&t.classList.contains("annotationContent")&&t.remove()}}function oe(e,t,n){let[r,i]=e;[t,n]=this.screenToPageTranslation(t,n),this.x+=t/r,this.y+=n/i,this.fixAndSetPosition()}function ae(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}function se(e){switch(e){case 90:{const[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}function le(){if((0,p.A)(this,k))return;(0,f.A)(this,k,document.createElement("div")),(0,p.A)(this,k).classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"];for(const t of e){const e=document.createElement("div");(0,p.A)(this,k).append(e),e.classList.add("resizer",t),e.setAttribute("data-resizer-name",t),e.addEventListener("pointerdown",(0,h.A)(this,Y,ce).bind(this,t)),e.addEventListener("contextmenu",s.noContextMenu),e.tabIndex=-1}this.div.prepend((0,p.A)(this,k))}function ce(e,t){var n;t.preventDefault();const{isMac:r}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&r)return;null===(n=(0,p.A)(this,E))||void 0===n||n.toggle(!1);const o=(0,h.A)(this,Q,de).bind(this,e),a=this._isDraggable;this._isDraggable=!1;const l={passive:!0,capture:!0};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",o,l),window.addEventListener("contextmenu",s.noContextMenu);const c=this.x,u=this.y,d=this.width,f=this.height,g=this.parent.div.style.cursor,m=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const v=()=>{var e;this.parent.togglePointerEvents(!0),null===(e=(0,p.A)(this,E))||void 0===e||e.toggle(!0),this._isDraggable=a,window.removeEventListener("pointerup",v),window.removeEventListener("blur",v),window.removeEventListener("pointermove",o,l),window.removeEventListener("contextmenu",s.noContextMenu),this.parent.div.style.cursor=g,this.div.style.cursor=m,(0,h.A)(this,X,ue).call(this,c,u,d,f)};window.addEventListener("pointerup",v),window.addEventListener("blur",v)}function ue(e,t,n,r){const i=this.x,o=this.y,a=this.width,s=this.height;i===e&&o===t&&a===n&&s===r||this.addCommands({cmd:()=>{this.width=a,this.height=s,this.x=i,this.y=o;const[e,t]=this.parentDimensions;this.setDims(e*a,t*s),this.fixAndSetPosition()},undo:()=>{this.width=n,this.height=r,this.x=e,this.y=t;const[i,o]=this.parentDimensions;this.setDims(i*n,o*r),this.fixAndSetPosition()},mustExec:!0})}function de(e,t){const[n,r]=this.parentDimensions,i=this.x,o=this.y,a=this.width,s=this.height,l=ie.MIN_SIZE/n,c=ie.MIN_SIZE/r,u=e=>Math.round(1e4*e)/1e4,d=(0,h.A)(this,q,se).call(this,this.rotation),f=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=(0,h.A)(this,q,se).call(this,360-this.rotation);let g,m,v=!1,y=!1;switch(e){case"topLeft":v=!0,g=(e,t)=>[0,0],m=(e,t)=>[e,t];break;case"topMiddle":g=(e,t)=>[e/2,0],m=(e,t)=>[e/2,t];break;case"topRight":v=!0,g=(e,t)=>[e,0],m=(e,t)=>[0,t];break;case"middleRight":y=!0,g=(e,t)=>[e,t/2],m=(e,t)=>[0,t/2];break;case"bottomRight":v=!0,g=(e,t)=>[e,t],m=(e,t)=>[0,0];break;case"bottomMiddle":g=(e,t)=>[e/2,t],m=(e,t)=>[e/2,0];break;case"bottomLeft":v=!0,g=(e,t)=>[0,t],m=(e,t)=>[e,0];break;case"middleLeft":y=!0,g=(e,t)=>[0,t/2],m=(e,t)=>[e,t/2]}const b=g(a,s),w=m(a,s);let A=f(...w);const _=u(i+A[0]),C=u(o+A[1]);let x=1,E=1,[S,D]=this.screenToPageTranslation(t.movementX,t.movementY);var k,T;if([S,D]=(k=S/n,T=D/r,[p[0]*k+p[2]*T,p[1]*k+p[3]*T]),v){const e=Math.hypot(a,s);x=E=Math.max(Math.min(Math.hypot(w[0]-b[0]-S,w[1]-b[1]-D)/e,1/a,1/s),l/a,c/s)}else y?x=Math.max(l,Math.min(1,Math.abs(w[0]-b[0]-S)))/a:E=Math.max(c,Math.min(1,Math.abs(w[1]-b[1]-D)))/s;const O=u(a*x),I=u(s*E);A=f(...m(O,I));const P=_-A[0],M=C-A[1];this.width=O,this.height=I,this.x=P,this.y=M,this.setDims(n*O,r*I),this.fixAndSetPosition()}function he(e){const{isMac:t}=i.FeatureTest.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}function fe(e){const t=this._uiManager.isSelected(this);let n,r;this._uiManager.setUpDragSession(),t&&(this.div.classList.add("moving"),n={passive:!0,capture:!0},(0,f.A)(this,z,e.clientX),(0,f.A)(this,U,e.clientY),r=e=>{const{clientX:t,clientY:n}=e,[r,i]=this.screenToPageTranslation(t-(0,p.A)(this,z),n-(0,p.A)(this,U));(0,f.A)(this,z,t),(0,f.A)(this,U,n),this._uiManager.dragSelectedEditors(r,i)},window.addEventListener("pointermove",r,n));const i=()=>{window.removeEventListener("pointerup",i),window.removeEventListener("blur",i),t&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",r,n)),(0,f.A)(this,R,!1),this._uiManager.endDragSession()||(0,h.A)(this,J,he).call(this,e)};window.addEventListener("pointerup",i),window.addEventListener("blur",i)}function pe(e){ie._resizerKeyboardManager.exec(this,e)}function ge(e){var t;(0,p.A)(this,L)&&(null===(t=e.relatedTarget)||void 0===t?void 0:t.parentNode)!==(0,p.A)(this,k)&&(0,h.A)(this,re,ye).call(this)}function me(e){(0,f.A)(this,M,(0,p.A)(this,L)?e:"")}function ve(e){if((0,p.A)(this,x))for(const t of(0,p.A)(this,x))t.tabIndex=e}function ye(){if((0,f.A)(this,L,!1),(0,h.A)(this,ne,ve).call(this,-1),(0,p.A)(this,T)){const{savedX:e,savedY:t,savedWidth:n,savedHeight:r}=(0,p.A)(this,T);(0,h.A)(this,X,ue).call(this,e,t,n,r),(0,f.A)(this,T,null)}}(0,a.A)(ie,"_borderLineWidth",-1),(0,a.A)(ie,"_colorManager",new r.ColorManager),(0,a.A)(ie,"_zIndex",1),(0,a.A)(ie,"_telemetryTimeout",1e3);class be extends ie{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},61:(e,t,n)=>{n.d(t,{FreeOutliner:()=>G,Outliner:()=>y});var r=n(292),i=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakSet,l=new WeakSet,g=new WeakSet,m=new WeakSet,v=new WeakSet;class y{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(0,u.A)(this,v),(0,u.A)(this,m),(0,u.A)(this,g),(0,u.A)(this,l),(0,u.A)(this,s),(0,d.A)(this,i,{writable:!0,value:void 0}),(0,d.A)(this,o,{writable:!0,value:[]}),(0,d.A)(this,a,{writable:!0,value:[]});let c=1/0,h=-1/0,y=1/0,b=-1/0;const w=10**-4;for(const{x:i,y:a,width:s,height:l}of e){const e=Math.floor((i-t)/w)*w,n=Math.ceil((i+s+t)/w)*w,r=Math.floor((a-t)/w)*w,u=Math.ceil((a+l+t)/w)*w,d=[e,r,u,!0],f=[n,r,u,!1];(0,p.A)(this,o).push(d,f),c=Math.min(c,e),h=Math.max(h,n),y=Math.min(y,r),b=Math.max(b,u)}const A=h-c+2*n,_=b-y+2*n,C=c-n,x=y-n,E=(0,p.A)(this,o).at(r?-1:-2),S=[E[0],E[2]];for(const i of(0,p.A)(this,o)){const[e,t,n]=i;i[0]=(e-C)/A,i[1]=(t-x)/_,i[2]=(n-x)/_}(0,f.A)(this,i,{x:C,y:x,width:A,height:_,lastPoint:S})}getOutlines(){(0,p.A)(this,o).sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);const e=[];for(const t of(0,p.A)(this,o))t[3]?(e.push(...(0,h.A)(this,v,C).call(this,t)),(0,h.A)(this,g,A).call(this,t)):((0,h.A)(this,m,_).call(this,t),e.push(...(0,h.A)(this,v,C).call(this,t)));return(0,h.A)(this,s,b).call(this,e)}}function b(e){const t=[],n=new Set;for(const i of e){const[e,n,r]=i;t.push([e,n,i],[e,r,i])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let i=0,a=t.length;i0;){const e=n.values().next().value;let[t,i,a,s,l]=e;n.delete(e);let c=t,u=i;for(o=[t,a],r.push(o);;){let e;if(n.has(s))e=s;else{if(!n.has(l))break;e=l}n.delete(e),[t,i,a,s,l]=e,c!==t&&(o.push(c,u,t,u===i?i:a),c=t),u=u===i?a:i}o.push(c,u)}return new D(r,(0,p.A)(this,i))}function w(e){const t=(0,p.A)(this,a);let n=0,r=t.length-1;for(;n<=r;){const i=n+r>>1,o=t[i][0];if(o===e)return i;o=0;i--){const[e,r]=(0,p.A)(this,a)[i];if(e!==t)break;if(e===t&&r===n)return void(0,p.A)(this,a).splice(i,1)}}function C(e){const[t,n,r]=e,i=[[t,n,r]],o=(0,h.A)(this,l,w).call(this,r);for(let s=0;s=e)if(s>n)i[r][1]=n;else{if(1===o)return[];i.splice(r,1),r--,o--}else i[r][2]=e,s>n&&i.push([t,n,s])}}return i}class x{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(e,t){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof ne}}var E=new WeakMap,S=new WeakMap;class D extends x{constructor(e,t){super(),(0,d.A)(this,E,{writable:!0,value:void 0}),(0,d.A)(this,S,{writable:!0,value:void 0}),(0,f.A)(this,S,e),(0,f.A)(this,E,t)}toSVGPath(){const e=[];for(const t of(0,p.A)(this,S)){let[n,r]=t;e.push("M".concat(n," ").concat(r));for(let i=2;i5&&void 0!==arguments[5]?arguments[5]:0;(0,u.A)(this,U),(0,d.A)(this,k,{writable:!0,value:void 0}),(0,d.A)(this,T,{writable:!0,value:[]}),(0,d.A)(this,O,{writable:!0,value:void 0}),(0,d.A)(this,I,{writable:!0,value:void 0}),(0,d.A)(this,P,{writable:!0,value:[]}),(0,d.A)(this,M,{writable:!0,value:new Float64Array(18)}),(0,d.A)(this,R,{writable:!0,value:void 0}),(0,d.A)(this,N,{writable:!0,value:void 0}),(0,d.A)(this,j,{writable:!0,value:void 0}),(0,d.A)(this,F,{writable:!0,value:void 0}),(0,d.A)(this,L,{writable:!0,value:void 0}),(0,d.A)(this,B,{writable:!0,value:void 0}),(0,d.A)(this,z,{writable:!0,value:[]}),(0,f.A)(this,k,t),(0,f.A)(this,B,r*n),(0,f.A)(this,I,i),(0,p.A)(this,M).set([NaN,NaN,NaN,NaN,o,a],6),(0,f.A)(this,O,s),(0,f.A)(this,F,(0,c.A)(G,G,W)*n),(0,f.A)(this,j,(0,c.A)(G,G,V)*n),(0,f.A)(this,L,n),(0,p.A)(this,z).push(o,a)}get free(){return!0}isEmpty(){return isNaN((0,p.A)(this,M)[8])}add(e){var t;let{x:n,y:r}=e;(0,f.A)(this,R,n),(0,f.A)(this,N,r);const[i,o,a,s]=(0,p.A)(this,k);let[l,c,u,d]=(0,p.A)(this,M).subarray(8,12);const h=n-u,g=r-d,m=Math.hypot(h,g);if(m<(0,p.A)(this,j))return!1;const v=m-(0,p.A)(this,F),y=v/m,b=y*h,w=y*g;let A=l,_=c;l=u,c=d,u+=b,d+=w,null===(t=(0,p.A)(this,z))||void 0===t||t.push(n,r);const C=b/v,x=-w/v*(0,p.A)(this,B),E=C*(0,p.A)(this,B);if((0,p.A)(this,M).set((0,p.A)(this,M).subarray(2,8),0),(0,p.A)(this,M).set([u+x,d+E],4),(0,p.A)(this,M).set((0,p.A)(this,M).subarray(14,18),12),(0,p.A)(this,M).set([u-x,d-E],16),isNaN((0,p.A)(this,M)[6]))return 0===(0,p.A)(this,P).length&&((0,p.A)(this,M).set([l+x,c+E],2),(0,p.A)(this,P).push(NaN,NaN,NaN,NaN,(l+x-i)/a,(c+E-o)/s),(0,p.A)(this,M).set([l-x,c-E],14),(0,p.A)(this,T).push(NaN,NaN,NaN,NaN,(l-x-i)/a,(c-E-o)/s)),(0,p.A)(this,M).set([A,_,l,c,u,d],6),!this.isEmpty();(0,p.A)(this,M).set([A,_,l,c,u,d],6);return Math.abs(Math.atan2(_-c,A-l)-Math.atan2(w,b))=6;h-=6)isNaN(t[h])?f.push("L".concat(t[h+4]," ").concat(t[h+5])):f.push("C".concat(t[h]," ").concat(t[h+1]," ").concat(t[h+2]," ").concat(t[h+3]," ").concat(t[h+4]," ").concat(t[h+5]));return f.push("L".concat(t[4]," ").concat(t[5]," Z")),f.join(" ")}getOutlines(){var e,t;const n=(0,p.A)(this,P),r=(0,p.A)(this,T),i=(0,p.A)(this,M),o=i.subarray(4,6),a=i.subarray(16,18),[s,l,c,u]=(0,p.A)(this,k),d=new Float64Array((null!==(e=null===(t=(0,p.A)(this,z))||void 0===t?void 0:t.length)&&void 0!==e?e:0)+2);for(let h=0,w=d.length-2;h=6;h-=6)for(let e=0;e<6;e+=2)isNaN(r[h+e])?(y[b]=y[b+1]=NaN,b+=2):(y[b]=r[h+e],y[b+1]=r[h+e+1],b+=2);return y.set([NaN,NaN,NaN,NaN,r[4],r[5]],b),new ne(y,d,(0,p.A)(this,k),(0,p.A)(this,L),(0,p.A)(this,O),(0,p.A)(this,I))}}function H(){const e=(0,p.A)(this,M).subarray(4,6),t=(0,p.A)(this,M).subarray(16,18),[n,r,i,o]=(0,p.A)(this,k);return[((0,p.A)(this,R)+(e[0]-t[0])/2-n)/i,((0,p.A)(this,N)+(e[1]-t[1])/2-r)/o,((0,p.A)(this,R)+(t[0]-e[0])/2-n)/i,((0,p.A)(this,N)+(t[1]-e[1])/2-r)/o]}var W={writable:!0,value:8},V={writable:!0,value:(0,c.A)(G,G,W)+(0,c.A)(G,G,{writable:!0,value:2})},q=new WeakMap,K=new WeakMap,Y=new WeakMap,X=new WeakMap,Q=new WeakMap,J=new WeakMap,Z=new WeakMap,$=new WeakSet,ee=new WeakSet,te=new WeakSet;class ne extends x{constructor(e,t,n,r,i,o){super(),(0,u.A)(this,te),(0,u.A)(this,ee),(0,u.A)(this,$),(0,d.A)(this,q,{writable:!0,value:void 0}),(0,d.A)(this,K,{writable:!0,value:null}),(0,d.A)(this,Y,{writable:!0,value:void 0}),(0,d.A)(this,X,{writable:!0,value:void 0}),(0,d.A)(this,Q,{writable:!0,value:void 0}),(0,d.A)(this,J,{writable:!0,value:void 0}),(0,d.A)(this,Z,{writable:!0,value:void 0}),(0,f.A)(this,Z,e),(0,f.A)(this,Q,t),(0,f.A)(this,q,n),(0,f.A)(this,J,r),(0,f.A)(this,Y,i),(0,f.A)(this,X,o),(0,h.A)(this,te,oe).call(this,o);const{x:a,y:s,width:l,height:c}=(0,p.A)(this,K);for(let u=0,d=e.length;u{n.d(t,{EditorToolbar:()=>b,HighlightToolbar:()=>P});var r=n(419),i=new WeakMap,a=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakSet,g=new WeakSet,m=new WeakSet,v=new WeakSet,y=new WeakMap;class b{constructor(e){(0,d.A)(this,y,{get:E,set:void 0}),(0,u.A)(this,v),(0,u.A)(this,m),(0,u.A)(this,g),(0,u.A)(this,c),(0,d.A)(this,i,{writable:!0,value:null}),(0,d.A)(this,a,{writable:!0,value:null}),(0,d.A)(this,s,{writable:!0,value:void 0}),(0,d.A)(this,l,{writable:!0,value:null}),(0,f.A)(this,s,e)}render(){const e=(0,f.A)(this,i,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",r.noContextMenu),e.addEventListener("pointerdown",(0,o.A)(b,b,w));const t=(0,f.A)(this,l,document.createElement("div"));t.className="buttons",e.append(t);const n=(0,p.A)(this,s).toolbarPosition;if(n){const{style:t}=e,r="ltr"===(0,p.A)(this,s)._uiManager.direction?1-n[0]:n[0];t.insetInlineEnd="".concat(100*r,"%"),t.top="calc(".concat(100*n[1],"% + var(--editor-toolbar-vert-offset))")}return(0,h.A)(this,v,x).call(this),e}hide(){var e;(0,p.A)(this,i).classList.add("hidden"),null===(e=(0,p.A)(this,a))||void 0===e||e.hideDropdown()}show(){(0,p.A)(this,i).classList.remove("hidden")}addAltTextButton(e){(0,h.A)(this,m,C).call(this,e),(0,p.A)(this,l).prepend(e,(0,p.A)(this,y))}addColorPicker(e){(0,f.A)(this,a,e);const t=e.renderButton();(0,h.A)(this,m,C).call(this,t),(0,p.A)(this,l).prepend(t,(0,p.A)(this,y))}remove(){var e;(0,p.A)(this,i).remove(),null===(e=(0,p.A)(this,a))||void 0===e||e.destroy(),(0,f.A)(this,a,null)}}function w(e){e.stopPropagation()}function A(e){(0,p.A)(this,s)._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()}function _(e){(0,p.A)(this,s)._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()}function C(e){e.addEventListener("focusin",(0,h.A)(this,c,A).bind(this),{capture:!0}),e.addEventListener("focusout",(0,h.A)(this,g,_).bind(this),{capture:!0}),e.addEventListener("contextmenu",r.noContextMenu)}function x(){const e=document.createElement("button");e.className="delete",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-editor-remove-".concat((0,p.A)(this,s).editorType,"-button")),(0,h.A)(this,m,C).call(this,e),e.addEventListener("click",e=>{(0,p.A)(this,s)._uiManager.delete()}),(0,p.A)(this,l).append(e)}function E(){const e=document.createElement("div");return e.className="divider",e}var S=new WeakMap,D=new WeakMap,k=new WeakMap,T=new WeakSet,O=new WeakSet,I=new WeakSet;class P{constructor(e){(0,u.A)(this,I),(0,u.A)(this,O),(0,u.A)(this,T),(0,d.A)(this,S,{writable:!0,value:null}),(0,d.A)(this,D,{writable:!0,value:null}),(0,d.A)(this,k,{writable:!0,value:void 0}),(0,f.A)(this,k,e)}show(e,t,n){const[r,i]=(0,h.A)(this,O,R).call(this,t,n),{style:o}=(0,p.A)(this,D)||(0,f.A)(this,D,(0,h.A)(this,T,M).call(this));e.append((0,p.A)(this,D)),o.insetInlineEnd="".concat(100*r,"%"),o.top="calc(".concat(100*i,"% + var(--editor-toolbar-vert-offset))")}hide(){(0,p.A)(this,D).remove()}}function M(){const e=(0,f.A)(this,D,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",r.noContextMenu);const t=(0,f.A)(this,S,document.createElement("div"));return t.className="buttons",e.append(t),(0,h.A)(this,I,N).call(this),e}function R(e,t){let n=0,r=0;for(const i of e){const e=i.y+i.height;if(en?(r=o,n=e):t?o>r&&(r=o):o{(0,p.A)(this,k).highlightSelection("floating_button")}),(0,p.A)(this,S).append(e)}},830:(e,t,n)=>{n.d(t,{AnnotationEditorUIManager:()=>He,ColorManager:()=>O,KeyboardManager:()=>k,bindEvents:()=>s,opacityToHex:()=>l});var r=n(292),i=n(419),o=n(362);function s(e,t,n){for(const r of n)t.addEventListener(r,e[r].bind(e))}function l(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}var c=new WeakMap;class g{constructor(){(0,d.A)(this,c,{writable:!0,value:0})}get id(){var e,t;return"".concat(r.AnnotationEditorPrefix).concat(((0,f.A)(this,c,(e=(0,p.A)(this,c),t=e++,e)),t))}}var m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakSet;class w{constructor(){(0,u.A)(this,b),(0,d.A)(this,m,{writable:!0,value:(0,r.getUuid)()}),(0,d.A)(this,v,{writable:!0,value:0}),(0,d.A)(this,y,{writable:!0,value:null})}static get _isSVGFittingCanvas(){const e=new OffscreenCanvas(1,3).getContext("2d"),t=new Image;t.src='data:image/svg+xml;charset=UTF-8,';const n=t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]));return(0,r.shadow)(this,"_isSVGFittingCanvas",n)}async getFromFile(e){const{lastModified:t,name:n,size:r,type:i}=e;return(0,h.A)(this,b,A).call(this,"".concat(t,"_").concat(n,"_").concat(r,"_").concat(i),e)}async getFromUrl(e){return(0,h.A)(this,b,A).call(this,e,e)}async getFromId(e){(0,p.A)(this,y)||(0,f.A)(this,y,new Map);const t=(0,p.A)(this,y).get(e);return t?t.bitmap?(t.refCounter+=1,t):t.file?this.getFromFile(t.file):this.getFromUrl(t.url):null}getSvgUrl(e){const t=(0,p.A)(this,y).get(e);return null!==t&&void 0!==t&&t.isSvg?t.svgUrl:null}deleteId(e){(0,p.A)(this,y)||(0,f.A)(this,y,new Map);const t=(0,p.A)(this,y).get(e);t&&(t.refCounter-=1,0===t.refCounter&&(t.bitmap=null))}isValidId(e){return e.startsWith("image_".concat((0,p.A)(this,m),"_"))}}async function A(e,t){var n;(0,p.A)(this,y)||(0,f.A)(this,y,new Map);let r=(0,p.A)(this,y).get(e);if(null===r)return null;if(null!==(n=r)&&void 0!==n&&n.bitmap)return r.refCounter+=1,r;try{var o,a;let e;if(r||(r={bitmap:null,id:"image_".concat((0,p.A)(this,m),"_").concat(((0,f.A)(this,v,(o=(0,p.A)(this,v),a=o++,o)),a)),refCounter:0,isSvg:!1}),"string"===typeof t?(r.url=t,e=await(0,i.fetchData)(t,"blob")):e=r.file=t,"image/svg+xml"===e.type){const t=w._isSVGFittingCanvas,n=new FileReader,i=new Image,o=new Promise((e,o)=>{i.onload=()=>{r.bitmap=i,r.isSvg=!0,e()},n.onload=async()=>{const e=r.svgUrl=n.result;i.src=await t?"".concat(e,"#svgView(preserveAspectRatio(none))"):e},i.onerror=n.onerror=o});n.readAsDataURL(e),await o}else r.bitmap=await createImageBitmap(e);r.refCounter=1}catch(s){console.error(s),r=null}return(0,p.A)(this,y).set(e,r),r&&(0,p.A)(this,y).set(r.id,r),r}var _=new WeakMap,C=new WeakMap,x=new WeakMap,E=new WeakMap;class S{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;(0,d.A)(this,_,{writable:!0,value:[]}),(0,d.A)(this,C,{writable:!0,value:!1}),(0,d.A)(this,x,{writable:!0,value:void 0}),(0,d.A)(this,E,{writable:!0,value:-1}),(0,f.A)(this,x,e)}add(e){let{cmd:t,undo:n,post:r,mustExec:i,type:o=NaN,overwriteIfSameType:a=!1,keepUndo:s=!1}=e;if(i&&t(),(0,p.A)(this,C))return;const l={cmd:t,undo:n,post:r,type:o};if(-1===(0,p.A)(this,E))return(0,p.A)(this,_).length>0&&((0,p.A)(this,_).length=0),(0,f.A)(this,E,0),void(0,p.A)(this,_).push(l);if(a&&(0,p.A)(this,_)[(0,p.A)(this,E)].type===o)return s&&(l.undo=(0,p.A)(this,_)[(0,p.A)(this,E)].undo),void((0,p.A)(this,_)[(0,p.A)(this,E)]=l);const c=(0,p.A)(this,E)+1;c===(0,p.A)(this,x)?(0,p.A)(this,_).splice(0,1):((0,f.A)(this,E,c),c<(0,p.A)(this,_).length&&(0,p.A)(this,_).splice(c)),(0,p.A)(this,_).push(l)}undo(){if(-1===(0,p.A)(this,E))return;(0,f.A)(this,C,!0);const{undo:e,post:t}=(0,p.A)(this,_)[(0,p.A)(this,E)];e(),null===t||void 0===t||t(),(0,f.A)(this,C,!1),(0,f.A)(this,E,(0,p.A)(this,E)-1)}redo(){if((0,p.A)(this,E)<(0,p.A)(this,_).length-1){(0,f.A)(this,E,(0,p.A)(this,E)+1),(0,f.A)(this,C,!0);const{cmd:e,post:t}=(0,p.A)(this,_)[(0,p.A)(this,E)];e(),null===t||void 0===t||t(),(0,f.A)(this,C,!1)}}hasSomethingToUndo(){return-1!==(0,p.A)(this,E)}hasSomethingToRedo(){return(0,p.A)(this,E)<(0,p.A)(this,_).length-1}destroy(){(0,f.A)(this,_,null)}}var D=new WeakSet;class k{constructor(e){(0,u.A)(this,D),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=r.FeatureTest.platform;for(const[n,r,i={}]of e)for(const e of n){const n=e.startsWith("mac+");t&&n?(this.callbacks.set(e.slice(4),{callback:r,options:i}),this.allKeys.add(e.split("+").at(-1))):t||n||(this.callbacks.set(e,{callback:r,options:i}),this.allKeys.add(e.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;const n=this.callbacks.get((0,h.A)(this,D,T).call(this,t));if(!n)return;const{callback:r,options:{bubbles:i=!1,args:o=[],checker:a=null}}=n;a&&!a(e,t)||(r.bind(e,...o,t)(),i||(t.stopPropagation(),t.preventDefault()))}}function T(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}class O{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return(0,i.getColorValues)(e),(0,r.shadow)(this,"_colors",e)}convert(e){const t=(0,i.getRGB)(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[n,r]of this._colors)if(r.every((e,n)=>e===t[n]))return O._colorsMapping.get(n);return t}getHexCode(e){const t=this._colors.get(e);return t?r.Util.makeHexColor(...t):e}}(0,a.A)(O,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var I=new WeakMap,P=new WeakMap,M=new WeakMap,R=new WeakMap,N=new WeakMap,j=new WeakMap,F=new WeakMap,L=new WeakMap,B=new WeakMap,z=new WeakMap,U=new WeakMap,G=new WeakMap,H=new WeakMap,W=new WeakMap,V=new WeakMap,q=new WeakMap,K=new WeakMap,Y=new WeakMap,X=new WeakMap,Q=new WeakMap,J=new WeakMap,Z=new WeakMap,$=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,oe=new WeakMap,ae=new WeakMap,se=new WeakMap,le=new WeakMap,ce=new WeakMap,ue=new WeakMap,de=new WeakMap,he=new WeakMap,fe=new WeakMap,pe=new WeakMap,ge=new WeakMap,me=new WeakMap,ve=new WeakMap,ye=new WeakMap,be=new WeakMap,we=new WeakMap,Ae=new WeakMap,_e=new WeakMap,Ce=new WeakSet,xe=new WeakSet,Ee=new WeakSet,Se=new WeakSet,De=new WeakSet,ke=new WeakSet,Te=new WeakSet,Oe=new WeakSet,Ie=new WeakSet,Pe=new WeakSet,Me=new WeakSet,Re=new WeakSet,Ne=new WeakSet,je=new WeakSet,Fe=new WeakSet,Le=new WeakSet,Be=new WeakSet,ze=new WeakMap,Ue=new WeakSet,Ge=new WeakSet;class He{static get _keyboardManager(){const e=He.prototype,t=e=>(0,p.A)(e,Ae).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&e.hasSomethingToControl(),n=(e,t)=>{let{target:n}=t;if(n instanceof HTMLInputElement){const{type:e}=n;return"text"!==e&&"number"!==e}return!0},i=this.TRANSLATE_SMALL,o=this.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new k([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.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"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(e,t)=>{let{target:n}=t;return!(n instanceof HTMLButtonElement)&&(0,p.A)(e,Ae).contains(n)&&!e.isEnterHandled}}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(e,t)=>{let{target:n}=t;return!(n instanceof HTMLButtonElement)&&(0,p.A)(e,Ae).contains(document.activeElement)}}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:t}]]))}constructor(e,t,n,o,a,s,l,c,m){(0,u.A)(this,Ge),(0,u.A)(this,Ue),(0,d.A)(this,ze,{get:st,set:void 0}),(0,u.A)(this,Be),(0,u.A)(this,Le),(0,u.A)(this,Fe),(0,u.A)(this,je),(0,u.A)(this,Ne),(0,u.A)(this,Re),(0,u.A)(this,Me),(0,u.A)(this,Pe),(0,u.A)(this,Ie),(0,u.A)(this,Oe),(0,u.A)(this,Te),(0,u.A)(this,ke),(0,u.A)(this,De),(0,u.A)(this,Se),(0,u.A)(this,Ee),(0,u.A)(this,xe),(0,u.A)(this,Ce),(0,d.A)(this,I,{writable:!0,value:null}),(0,d.A)(this,P,{writable:!0,value:new Map}),(0,d.A)(this,M,{writable:!0,value:new Map}),(0,d.A)(this,R,{writable:!0,value:null}),(0,d.A)(this,N,{writable:!0,value:null}),(0,d.A)(this,j,{writable:!0,value:null}),(0,d.A)(this,F,{writable:!0,value:new S}),(0,d.A)(this,L,{writable:!0,value:0}),(0,d.A)(this,B,{writable:!0,value:new Set}),(0,d.A)(this,z,{writable:!0,value:null}),(0,d.A)(this,U,{writable:!0,value:null}),(0,d.A)(this,G,{writable:!0,value:new Set}),(0,d.A)(this,H,{writable:!0,value:!1}),(0,d.A)(this,W,{writable:!0,value:null}),(0,d.A)(this,V,{writable:!0,value:null}),(0,d.A)(this,q,{writable:!0,value:null}),(0,d.A)(this,K,{writable:!0,value:!1}),(0,d.A)(this,Y,{writable:!0,value:null}),(0,d.A)(this,X,{writable:!0,value:new g}),(0,d.A)(this,Q,{writable:!0,value:!1}),(0,d.A)(this,J,{writable:!0,value:!1}),(0,d.A)(this,Z,{writable:!0,value:null}),(0,d.A)(this,$,{writable:!0,value:null}),(0,d.A)(this,ee,{writable:!0,value:null}),(0,d.A)(this,te,{writable:!0,value:r.AnnotationEditorType.NONE}),(0,d.A)(this,ne,{writable:!0,value:new Set}),(0,d.A)(this,re,{writable:!0,value:null}),(0,d.A)(this,ie,{writable:!0,value:null}),(0,d.A)(this,oe,{writable:!0,value:null}),(0,d.A)(this,ae,{writable:!0,value:this.blur.bind(this)}),(0,d.A)(this,se,{writable:!0,value:this.focus.bind(this)}),(0,d.A)(this,le,{writable:!0,value:this.copy.bind(this)}),(0,d.A)(this,ce,{writable:!0,value:this.cut.bind(this)}),(0,d.A)(this,ue,{writable:!0,value:this.paste.bind(this)}),(0,d.A)(this,de,{writable:!0,value:this.keydown.bind(this)}),(0,d.A)(this,he,{writable:!0,value:this.keyup.bind(this)}),(0,d.A)(this,fe,{writable:!0,value:this.onEditingAction.bind(this)}),(0,d.A)(this,pe,{writable:!0,value:this.onPageChanging.bind(this)}),(0,d.A)(this,ge,{writable:!0,value:this.onScaleChanging.bind(this)}),(0,d.A)(this,me,{writable:!0,value:(0,h.A)(this,Ee,qe).bind(this)}),(0,d.A)(this,ve,{writable:!0,value:this.onRotationChanging.bind(this)}),(0,d.A)(this,ye,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}}),(0,d.A)(this,be,{writable:!0,value:[0,0]}),(0,d.A)(this,we,{writable:!0,value:null}),(0,d.A)(this,Ae,{writable:!0,value:null}),(0,d.A)(this,_e,{writable:!0,value:null}),(0,f.A)(this,Ae,e),(0,f.A)(this,_e,t),(0,f.A)(this,R,n),this._eventBus=o,this._eventBus._on("editingaction",(0,p.A)(this,fe)),this._eventBus._on("pagechanging",(0,p.A)(this,pe)),this._eventBus._on("scalechanging",(0,p.A)(this,ge)),this._eventBus._on("rotationchanging",(0,p.A)(this,ve)),(0,h.A)(this,De,Ye).call(this),(0,h.A)(this,Ie,Ze).call(this),(0,f.A)(this,N,a.annotationStorage),(0,f.A)(this,W,a.filterFactory),(0,f.A)(this,ie,s),(0,f.A)(this,q,l||null),(0,f.A)(this,H,c),(0,f.A)(this,ee,m||null),this.viewParameters={realScale:i.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){var e,t;(0,h.A)(this,Pe,$e).call(this),(0,h.A)(this,Oe,Je).call(this),this._eventBus._off("editingaction",(0,p.A)(this,fe)),this._eventBus._off("pagechanging",(0,p.A)(this,pe)),this._eventBus._off("scalechanging",(0,p.A)(this,ge)),this._eventBus._off("rotationchanging",(0,p.A)(this,ve));for(const n of(0,p.A)(this,M).values())n.destroy();(0,p.A)(this,M).clear(),(0,p.A)(this,P).clear(),(0,p.A)(this,G).clear(),(0,f.A)(this,I,null),(0,p.A)(this,ne).clear(),(0,p.A)(this,F).destroy(),null===(e=(0,p.A)(this,R))||void 0===e||e.destroy(),null===(t=(0,p.A)(this,Y))||void 0===t||t.hide(),(0,f.A)(this,Y,null),(0,p.A)(this,V)&&(clearTimeout((0,p.A)(this,V)),(0,f.A)(this,V,null)),(0,p.A)(this,we)&&(clearTimeout((0,p.A)(this,we)),(0,f.A)(this,we,null)),(0,h.A)(this,ke,Xe).call(this)}async mlGuess(e){var t;return(null===(t=(0,p.A)(this,ee))||void 0===t?void 0:t.guess(e))||null}get hasMLManager(){return!!(0,p.A)(this,ee)}get hcmFilter(){return(0,r.shadow)(this,"hcmFilter",(0,p.A)(this,ie)?(0,p.A)(this,W).addHCMFilter((0,p.A)(this,ie).foreground,(0,p.A)(this,ie).background):"none")}get direction(){return(0,r.shadow)(this,"direction",getComputedStyle((0,p.A)(this,Ae)).direction)}get highlightColors(){return(0,r.shadow)(this,"highlightColors",(0,p.A)(this,q)?new Map((0,p.A)(this,q).split(",").map(e=>e.split("=").map(e=>e.trim()))):null)}get highlightColorNames(){return(0,r.shadow)(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){(0,f.A)(this,$,e)}editAltText(e){var t;null===(t=(0,p.A)(this,R))||void 0===t||t.editAltText(this,e)}onPageChanging(e){let{pageNumber:t}=e;(0,f.A)(this,L,t-1)}focusMainContainer(){(0,p.A)(this,Ae).focus()}findParent(e,t){for(const n of(0,p.A)(this,M).values()){const{x:r,y:i,width:o,height:a}=n.div.getBoundingClientRect();if(e>=r&&e<=r+o&&t>=i&&t<=i+a)return n}return null}disableUserSelect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,p.A)(this,_e).classList.toggle("noUserSelect",e)}addShouldRescale(e){(0,p.A)(this,G).add(e)}removeShouldRescale(e){(0,p.A)(this,G).delete(e)}onScaleChanging(e){let{scale:t}=e;this.commitOrRemove(),this.viewParameters.realScale=t*i.PixelsPerInch.PDF_TO_CSS_UNITS;for(const n of(0,p.A)(this,G))n.onScaleChanging()}onRotationChanging(e){let{pagesRotation:t}=e;this.commitOrRemove(),this.viewParameters.rotation=t}highlightSelection(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=document.getSelection();if(!t||t.isCollapsed)return;const{anchorNode:n,anchorOffset:i,focusNode:o,focusOffset:a}=t,s=t.toString(),l=(0,h.A)(this,Ce,We).call(this,t).closest(".textLayer"),c=this.getSelectionBoxes(l);if(c){t.empty(),(0,p.A)(this,te)===r.AnnotationEditorType.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:r.AnnotationEditorType.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const t of(0,p.A)(this,M).values())if(t.hasTextLayer(l)){t.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:c,anchorNode:n,anchorOffset:i,focusNode:o,focusOffset:a,text:s});break}}}addToAnnotationStorage(e){e.isEmpty()||!(0,p.A)(this,N)||(0,p.A)(this,N).has(e.id)||(0,p.A)(this,N).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,(0,p.A)(this,K)&&((0,f.A)(this,K,!1),(0,h.A)(this,Se,Ke).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of(0,p.A)(this,ne))if(t.div.contains(e)){(0,f.A)(this,Z,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!(0,p.A)(this,Z))return;const[e,t]=(0,p.A)(this,Z);(0,f.A)(this,Z,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),t.focus()}addEditListeners(){(0,h.A)(this,Ie,Ze).call(this),(0,h.A)(this,Me,et).call(this)}removeEditListeners(){(0,h.A)(this,Pe,$e).call(this),(0,h.A)(this,Re,tt).call(this)}copy(e){var t;if(e.preventDefault(),null===(t=(0,p.A)(this,I))||void 0===t||t.commitOrRemove(),!this.hasSelection)return;const n=[];for(const r of(0,p.A)(this,ne)){const e=r.serialize(!0);e&&n.push(e)}0!==n.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(n))}cut(e){this.copy(e),this.delete()}paste(e){e.preventDefault();const{clipboardData:t}=e;for(const r of t.items)for(const e of(0,p.A)(this,U))if(e.isHandlingMimeForPasting(r.type))return void e.paste(r,this.currentLayer);let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(o){return void(0,r.warn)('paste: "'.concat(o.message,'".'))}if(!Array.isArray(n))return;this.unselectAll();const i=this.currentLayer;try{const e=[];for(const o of n){const t=i.deserialize(o);if(!t)return;e.push(t)}const t=()=>{for(const t of e)(0,h.A)(this,Be,at).call(this,t);(0,h.A)(this,Ge,ct).call(this,e)},r=()=>{for(const t of e)t.remove()};this.addCommands({cmd:t,undo:r,mustExec:!0})}catch(o){(0,r.warn)('paste: "'.concat(o.message,'".'))}}keydown(e){this.isShiftKeyDown||"Shift"!==e.key||(this.isShiftKeyDown=!0),(0,p.A)(this,te)===r.AnnotationEditorType.NONE||this.isEditorHandlingKeyboard||He._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&"Shift"===e.key&&(this.isShiftKeyDown=!1,(0,p.A)(this,K)&&((0,f.A)(this,K,!1),(0,h.A)(this,Se,Ke).call(this,"main_toolbar")))}onEditingAction(e){let{name:t}=e;switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu")}}setEditingState(e){e?((0,h.A)(this,Te,Qe).call(this),(0,h.A)(this,Me,et).call(this),(0,h.A)(this,Ne,nt).call(this,{isEditing:(0,p.A)(this,te)!==r.AnnotationEditorType.NONE,isEmpty:(0,h.A)(this,Ue,lt).call(this),hasSomethingToUndo:(0,p.A)(this,F).hasSomethingToUndo(),hasSomethingToRedo:(0,p.A)(this,F).hasSomethingToRedo(),hasSelectedEditor:!1})):((0,h.A)(this,Oe,Je).call(this),(0,h.A)(this,Re,tt).call(this),(0,h.A)(this,Ne,nt).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!(0,p.A)(this,U)){(0,f.A)(this,U,e);for(const e of(0,p.A)(this,U))(0,h.A)(this,je,rt).call(this,e.defaultPropertiesToUpdate)}}getId(){return(0,p.A)(this,X).id}get currentLayer(){return(0,p.A)(this,M).get((0,p.A)(this,L))}getLayer(e){return(0,p.A)(this,M).get(e)}get currentPageIndex(){return(0,p.A)(this,L)}addLayer(e){(0,p.A)(this,M).set(e.pageIndex,e),(0,p.A)(this,Q)?e.enable():e.disable()}removeLayer(e){(0,p.A)(this,M).delete(e.pageIndex)}updateMode(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,p.A)(this,te)!==e){if((0,f.A)(this,te,e),e===r.AnnotationEditorType.NONE)return this.setEditingState(!1),void(0,h.A)(this,Le,ot).call(this);this.setEditingState(!0),(0,h.A)(this,Fe,it).call(this),this.unselectAll();for(const t of(0,p.A)(this,M).values())t.updateMode(e);if(t||!n){if(t)for(const e of(0,p.A)(this,P).values())if(e.annotationElementId===t){this.setSelected(e),e.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==(0,p.A)(this,te)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){var n;if((0,p.A)(this,U)){switch(e){case r.AnnotationEditorParamsType.CREATE:return void this.currentLayer.addNewEditor();case r.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:null===(n=(0,p.A)(this,$))||void 0===n||n.updateColor(t);break;case r.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),((0,p.A)(this,oe)||(0,f.A)(this,oe,new Map)).set(e,t),this.showAllEditors("highlight",t)}for(const n of(0,p.A)(this,ne))n.updateParams(e,t);for(const n of(0,p.A)(this,U))n.updateDefaultParams(e,t)}}showAllEditors(e,t){var n,i;for(const r of(0,p.A)(this,P).values())r.editorType===e&&r.show(t);(null===(n=null===(i=(0,p.A)(this,oe))||void 0===i?void 0:i.get(r.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL))||void 0===n||n)!==t&&(0,h.A)(this,je,rt).call(this,[[r.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if((0,p.A)(this,J)!==e){(0,f.A)(this,J,e);for(const t of(0,p.A)(this,M).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}getEditors(e){const t=[];for(const n of(0,p.A)(this,P).values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return(0,p.A)(this,P).get(e)}addEditor(e){(0,p.A)(this,P).set(e.id,e)}removeEditor(e){var t;(e.div.contains(document.activeElement)&&((0,p.A)(this,V)&&clearTimeout((0,p.A)(this,V)),(0,f.A)(this,V,setTimeout(()=>{this.focusMainContainer(),(0,f.A)(this,V,null)},0))),(0,p.A)(this,P).delete(e.id),this.unselect(e),e.annotationElementId&&(0,p.A)(this,B).has(e.annotationElementId))||(null===(t=(0,p.A)(this,N))||void 0===t||t.remove(e.id))}addDeletedAnnotationElement(e){(0,p.A)(this,B).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return(0,p.A)(this,B).has(e)}removeDeletedAnnotationElement(e){(0,p.A)(this,B).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){(0,p.A)(this,I)!==e&&((0,f.A)(this,I,e),e&&(0,h.A)(this,je,rt).call(this,e.propertiesToUpdate))}updateUI(e){(0,p.A)(this,ze)===e&&(0,h.A)(this,je,rt).call(this,e.propertiesToUpdate)}toggleSelected(e){if((0,p.A)(this,ne).has(e))return(0,p.A)(this,ne).delete(e),e.unselect(),void(0,h.A)(this,Ne,nt).call(this,{hasSelectedEditor:this.hasSelection});(0,p.A)(this,ne).add(e),e.select(),(0,h.A)(this,je,rt).call(this,e.propertiesToUpdate),(0,h.A)(this,Ne,nt).call(this,{hasSelectedEditor:!0})}setSelected(e){for(const t of(0,p.A)(this,ne))t!==e&&t.unselect();(0,p.A)(this,ne).clear(),(0,p.A)(this,ne).add(e),e.select(),(0,h.A)(this,je,rt).call(this,e.propertiesToUpdate),(0,h.A)(this,Ne,nt).call(this,{hasSelectedEditor:!0})}isSelected(e){return(0,p.A)(this,ne).has(e)}get firstSelectedEditor(){return(0,p.A)(this,ne).values().next().value}unselect(e){e.unselect(),(0,p.A)(this,ne).delete(e),(0,h.A)(this,Ne,nt).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==(0,p.A)(this,ne).size}get isEnterHandled(){return 1===(0,p.A)(this,ne).size&&this.firstSelectedEditor.isEnterHandled}undo(){(0,p.A)(this,F).undo(),(0,h.A)(this,Ne,nt).call(this,{hasSomethingToUndo:(0,p.A)(this,F).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:(0,h.A)(this,Ue,lt).call(this)})}redo(){(0,p.A)(this,F).redo(),(0,h.A)(this,Ne,nt).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:(0,p.A)(this,F).hasSomethingToRedo(),isEmpty:(0,h.A)(this,Ue,lt).call(this)})}addCommands(e){(0,p.A)(this,F).add(e),(0,h.A)(this,Ne,nt).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:(0,h.A)(this,Ue,lt).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...(0,p.A)(this,ne)];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)(0,h.A)(this,Be,at).call(this,t)},mustExec:!0})}commitOrRemove(){var e;null===(e=(0,p.A)(this,I))||void 0===e||e.commitOrRemove()}hasSomethingToControl(){return(0,p.A)(this,I)||this.hasSelection}selectAll(){for(const e of(0,p.A)(this,ne))e.commit();(0,h.A)(this,Ge,ct).call(this,(0,p.A)(this,P).values())}unselectAll(){if((!(0,p.A)(this,I)||((0,p.A)(this,I).commitOrRemove(),(0,p.A)(this,te)===r.AnnotationEditorType.NONE))&&this.hasSelection){for(const e of(0,p.A)(this,ne))e.unselect();(0,p.A)(this,ne).clear(),(0,h.A)(this,Ne,nt).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;(0,p.A)(this,be)[0]+=e,(0,p.A)(this,be)[1]+=t;const[n,r]=(0,p.A)(this,be),i=[...(0,p.A)(this,ne)];(0,p.A)(this,we)&&clearTimeout((0,p.A)(this,we)),(0,f.A)(this,we,setTimeout(()=>{(0,f.A)(this,we,null),(0,p.A)(this,be)[0]=(0,p.A)(this,be)[1]=0,this.addCommands({cmd:()=>{for(const e of i)(0,p.A)(this,P).has(e.id)&&e.translateInPage(n,r)},undo:()=>{for(const e of i)(0,p.A)(this,P).has(e.id)&&e.translateInPage(-n,-r)},mustExec:!1})},1e3));for(const o of i)o.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),(0,f.A)(this,z,new Map);for(const e of(0,p.A)(this,ne))(0,p.A)(this,z).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!(0,p.A)(this,z))return!1;this.disableUserSelect(!1);const e=(0,p.A)(this,z);(0,f.A)(this,z,null);let t=!1;for(const[{x:r,y:i,pageIndex:o},a]of e)a.newX=r,a.newY=i,a.newPageIndex=o,t||(t=r!==a.savedX||i!==a.savedY||o!==a.savedPageIndex);if(!t)return!1;const n=(e,t,n,r)=>{if((0,p.A)(this,P).has(e.id)){const i=(0,p.A)(this,M).get(r);i?e._setParentAndPosition(i,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(const[t,{newX:r,newY:i,newPageIndex:o}]of e)n(t,r,i,o)},undo:()=>{for(const[t,{savedX:r,savedY:i,savedPageIndex:o}]of e)n(t,r,i,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if((0,p.A)(this,z))for(const n of(0,p.A)(this,z).keys())n.drag(e,t)}rebuild(e){if(null===e.parent){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return(null===(e=this.getActive())||void 0===e?void 0:e.shouldGetKeyboardEvents())||1===(0,p.A)(this,ne).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return(0,p.A)(this,I)===e}getActive(){return(0,p.A)(this,I)}getMode(){return(0,p.A)(this,te)}get imageManager(){return(0,r.shadow)(this,"imageManager",new w)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let l=0,c=t.rangeCount;l({x:(t-r)/o,y:1-(e+a-n)/i,width:s/o,height:a/i});break;case"180":a=(e,t,a,s)=>({x:1-(e+a-n)/i,y:1-(t+s-r)/o,width:a/i,height:s/o});break;case"270":a=(e,t,a,s)=>({x:1-(t+s-r)/o,y:(e-n)/i,width:s/o,height:a/i});break;default:a=(e,t,a,s)=>({x:(e-n)/i,y:(t-r)/o,width:a/i,height:s/o})}const s=[];for(let l=0,c=t.rangeCount;l{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&(0,h.A)(this,Se,Ke).call(this,"main_toolbar"))};window.addEventListener("pointerup",e),window.addEventListener("blur",e)}}else(0,p.A)(this,re)&&(null===(o=(0,p.A)(this,Y))||void 0===o||o.hide(),(0,f.A)(this,re,null),(0,h.A)(this,Ne,nt).call(this,{hasSelectedText:!1}))}function Ke(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";(0,p.A)(this,te)===r.AnnotationEditorType.HIGHLIGHT?this.highlightSelection(e):(0,p.A)(this,H)&&(0,h.A)(this,xe,Ve).call(this)}function Ye(){document.addEventListener("selectionchange",(0,p.A)(this,me))}function Xe(){document.removeEventListener("selectionchange",(0,p.A)(this,me))}function Qe(){window.addEventListener("focus",(0,p.A)(this,se)),window.addEventListener("blur",(0,p.A)(this,ae))}function Je(){window.removeEventListener("focus",(0,p.A)(this,se)),window.removeEventListener("blur",(0,p.A)(this,ae))}function Ze(){window.addEventListener("keydown",(0,p.A)(this,de)),window.addEventListener("keyup",(0,p.A)(this,he))}function $e(){window.removeEventListener("keydown",(0,p.A)(this,de)),window.removeEventListener("keyup",(0,p.A)(this,he))}function et(){document.addEventListener("copy",(0,p.A)(this,le)),document.addEventListener("cut",(0,p.A)(this,ce)),document.addEventListener("paste",(0,p.A)(this,ue))}function tt(){document.removeEventListener("copy",(0,p.A)(this,le)),document.removeEventListener("cut",(0,p.A)(this,ce)),document.removeEventListener("paste",(0,p.A)(this,ue))}function nt(e){Object.entries(e).some(e=>{let[t,n]=e;return(0,p.A)(this,ye)[t]!==n})&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign((0,p.A)(this,ye),e)}),(0,p.A)(this,te)===r.AnnotationEditorType.HIGHLIGHT&&!1===e.hasSelectedEditor&&(0,h.A)(this,je,rt).call(this,[[r.AnnotationEditorParamsType.HIGHLIGHT_FREE,!0]]))}function rt(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}function it(){if(!(0,p.A)(this,Q)){(0,f.A)(this,Q,!0);for(const e of(0,p.A)(this,M).values())e.enable();for(const e of(0,p.A)(this,P).values())e.enable()}}function ot(){if(this.unselectAll(),(0,p.A)(this,Q)){(0,f.A)(this,Q,!1);for(const e of(0,p.A)(this,M).values())e.disable();for(const e of(0,p.A)(this,P).values())e.disable()}}function at(e){const t=(0,p.A)(this,M).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}function st(){let e=null;for(e of(0,p.A)(this,ne));return e}function lt(){if(0===(0,p.A)(this,P).size)return!0;if(1===(0,p.A)(this,P).size)for(const e of(0,p.A)(this,P).values())return e.isEmpty();return!1}function ct(e){for(const t of(0,p.A)(this,ne))t.unselect();(0,p.A)(this,ne).clear();for(const t of e)t.isEmpty()||((0,p.A)(this,ne).add(t),t.select());(0,h.A)(this,Ne,nt).call(this,{hasSelectedEditor:this.hasSelection})}(0,a.A)(He,"TRANSLATE_SMALL",1),(0,a.A)(He,"TRANSLATE_BIG",10)},94:(e,t,n)=>{n.d(t,{PDFFetchStream:()=>l});var r=n(292),i=n(490);function o(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function a(e){const t=new Headers;for(const n in e){const r=e[n];void 0!==r&&t.append(n,r)}return t}function s(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:((0,r.warn)("getArrayBuffer - unexpected data format: ".concat(e)),new Uint8Array(e).buffer)}class l{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new c(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new u(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class c{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=a(this._stream.httpHeaders);const n=t.url;fetch(n,o(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,n);this._reader=e.body.getReader(),this._headersCapability.resolve();const t=t=>e.headers.get(t),{allowRangeRequests:o,suggestedLength:a}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=a||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._headersCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:s(t),done:!1})}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}class u{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const r=e.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController,this._headers=a(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(t,"-").concat(n-1));const s=r.url;fetch(s,o(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,i.validateResponseStatus)(e.status))throw(0,i.createResponseStatusError)(e.status,s);this._readCapability.resolve(),this._reader=e.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;const{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded}),{value:s(t),done:!1})}cancel(e){var t;null===(t=this._reader)||void 0===t||t.cancel(e),this._abortController.abort()}}},10:(e,t,n)=>{n.d(t,{FontFaceObject:()=>a,FontLoader:()=>o});var r=n(292),i=new WeakMap;class o{constructor(e){let{ownerDocument:t=globalThis.document,styleElement:n=null}=e;(0,d.A)(this,i,{writable:!0,value:new Set}),this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),(0,p.A)(this,i).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(e){let{systemFontInfo:t,_inspectFont:n}=e;if(t&&!(0,p.A)(this,i).has(t.loadedName)){if((0,r.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:e,src:a,style:s}=t,l=new FontFace(e,a,s);this.addNativeFontFace(l);try{await l.load(),(0,p.A)(this,i).add(e),null===n||void 0===n||n(t)}catch(o){(0,r.warn)("Cannot load system font: ".concat(t.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(l)}return}(0,r.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void await this.loadSystemFont(e);if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw(0,r.warn)("Failed to load font '".concat(t.family,"': '").concat(n,"'.")),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{const n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){var e;const t=!(null===(e=this._document)||void 0===e||!e.fonts);return(0,r.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){var e;let t=!1;return(r.isNodeJS||"undefined"!==typeof navigator&&"string"===typeof(null===(e=navigator)||void 0===e?void 0:e.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(e){const{loadingRequests:t}=this,n={done:!1,complete:function(){for((0,r.assert)(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function i(e,t,n,r){return e.substring(0,t)+r+e.substring(t+n)}let o,a;const s=this._document.createElement("canvas");s.width=1,s.height=1;const l=s.getContext("2d");let c=0;const u="lt".concat(Date.now()).concat(this.loadTestFontId++);let d=this._loadTestFont;d=i(d,976,u.length,u);const h=1482184792;let f=n(d,16);for(o=0,a=u.length-3;o30)return(0,r.warn)("Load test font never loaded."),void n();l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(u,()=>{m.remove(),t.complete()})}}class a{constructor(e,t){let{disableFontFace:n=!1,ignoreErrors:r=!1,inspectFont:i=null}=t;this.compiledGlyphs=Object.create(null);for(const o in e)this[o]=e[o];this.disableFontFace=!0===n,this.ignoreErrors=!0===r,this._inspectFont=i}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return null===(e=this._inspectFont)||void 0===e||e.call(this,this),t}createFontFaceRule(){var e;if(!this.data||this.disableFontFace)return null;const t=(0,r.bytesToString)(this.data),n="url(data:".concat(this.mimetype,";base64,").concat(btoa(t),");");let i;if(this.cssFontInfo){let e="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(e+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),i='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(e,"src:").concat(n,"}")}else i='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(n,"}");return null===(e=this._inspectFont)||void 0===e||e.call(this,this,n),i}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let n;try{n=e.get(this.loadedName+"_path_"+t)}catch(o){if(!this.ignoreErrors)throw o;(0,r.warn)('getPathGenerator - ignoring character: "'.concat(o,'".'))}if(!Array.isArray(n)||0===n.length)return this.compiledGlyphs[t]=function(e,t){};const i=[];for(let a=0,s=n.length;an.bezierCurveTo(e,t,r,o,s,l)),a+=6}break;case r.FontRenderOps.MOVE_TO:{const[e,t]=n.slice(a,a+2);i.push(n=>n.moveTo(e,t)),a+=2}break;case r.FontRenderOps.LINE_TO:{const[e,t]=n.slice(a,a+2);i.push(n=>n.lineTo(e,t)),a+=2}break;case r.FontRenderOps.QUADRATIC_CURVE_TO:{const[e,t,r,o]=n.slice(a,a+4);i.push(n=>n.quadraticCurveTo(e,t,r,o)),a+=4}break;case r.FontRenderOps.RESTORE:i.push(e=>e.restore());break;case r.FontRenderOps.SAVE:i.push(e=>e.save());break;case r.FontRenderOps.SCALE:(0,r.assert)(2===i.length,"Scale command is only valid at the third position.");break;case r.FontRenderOps.TRANSFORM:{const[e,t,r,o,s,l]=n.slice(a,a+6);i.push(n=>n.transform(e,t,r,o,s,l)),a+=6}break;case r.FontRenderOps.TRANSLATE:{const[e,t]=n.slice(a,a+2);i.push(n=>n.translate(e,t)),a+=2}}return this.compiledGlyphs[t]=function(e,t){i[0](e),i[1](e),e.scale(t,-t);for(let n=2,r=i.length;n{n.d(t,{Metadata:()=>a});var r=n(292),i=new WeakMap,o=new WeakMap;class a{constructor(e){let{parsedData:t,rawData:n}=e;(0,d.A)(this,i,{writable:!0,value:void 0}),(0,d.A)(this,o,{writable:!0,value:void 0}),(0,f.A)(this,i,t),(0,f.A)(this,o,n)}getRaw(){return(0,p.A)(this,o)}get(e){var t;return null!==(t=(0,p.A)(this,i).get(e))&&void 0!==t?t:null}getAll(){return(0,r.objectFromMap)((0,p.A)(this,i))}has(e){return(0,p.A)(this,i).has(e)}}},457:(e,t,n)=>{n.d(t,{PDFNetworkStream:()=>a});var r=n(292),i=n(490);class o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=e,this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null),this.withCredentials=t.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,n){const r={begin:e,end:t};for(const i in n)r[i]=n[i];return this.request(r)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,n=this.currXhrId++,r=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const i in this.httpHeaders){const e=this.httpHeaders[i];void 0!==e&&t.setRequestHeader(i,e)}return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range","bytes=".concat(e.begin,"-").concat(e.end-1)),r.expectedStatus=206):r.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(n){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){var n;const r=this.pendingRequests[e];r&&(null===(n=r.onProgress)||void 0===n||n.call(r,t))}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==i.readyState)return;if(!(e in this.pendingRequests))return;var o;if(delete this.pendingRequests[e],0===i.status&&this.isHttp)return void(null===(o=n.onError)||void 0===o||o.call(n,i.status));const a=i.status||200;var s;if(!(200===a&&206===n.expectedStatus)&&a!==n.expectedStatus)return void(null===(s=n.onError)||void 0===s||s.call(n,i.status));const l=function(e){const t=e.response;return"string"!==typeof t?t:(0,r.stringToBytes)(t).buffer}(i);if(206===a){const e=i.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);n.onDone({begin:parseInt(t[1],10),chunk:l})}else if(l)n.onDone({begin:0,chunk:l});else{var c;null===(c=n.onError)||void 0===c||c.call(n,i.status)}}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class a{constructor(e){this._source=e,this._manager=new o(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials}),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new l(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class s{constructor(e,t){this._manager=e;const n={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(n),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e),n=e=>t.getResponseHeader(e),{allowRangeRequests:r,suggestedLength:o}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(n),this._isRangeSupported&&this._manager.abortRequest(e),this._headersReceivedCapability.resolve()}_onDone(e){if(e)if(this._requests.length>0){this._requests.shift().resolve({value:e.chunk,done:!1})}else this._cachedChunks.push(e.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var t;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersReceivedCapability.reject(e);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class l{constructor(e,t,n){this._manager=e;const r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,n,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var e;null===(e=this.onClosed)||void 0===e||e.call(this,this)}_onDone(e){const t=e.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0;for(const n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=(0,i.createResponseStatusError)(e,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var t;this.isStreamingSupported||(null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:e.loaded}))}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of 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()}}},490:(e,t,n)=>{n.d(t,{createResponseStatusError:()=>s,extractFilenameFromHeader:()=>a,validateRangeRequestCapabilities:()=>o,validateResponseStatus:()=>l});var r=n(292);var i=n(419);function o(e){let{getResponseHeader:t,isHttp:n,rangeChunkSize:r,disableRange:i}=e;const o={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t("Content-Length"),10);if(!Number.isInteger(a))return o;if(o.suggestedLength=a,a<=2*r)return o;if(i||!n)return o;if("bytes"!==t("Accept-Ranges"))return o;return"identity"!==(t("Content-Encoding")||"identity")||(o.allowRangeRequests=!0),o}function a(e){const t=e("Content-Disposition");if(t){let e=function(e){let t=!0,n=i("filename\\*","i").exec(e);if(n){n=n[1];let e=s(n);return e=unescape(e),e=l(e),e=c(e),a(e)}if(n=function(e){const t=[];let n;const r=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(e));){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[r,i]}const o=[];for(let i=0;i{n.a(e,async(e,r)=>{try{n.d(t,{PDFNodeStream:()=>f});var i=n(292),o=n(490);let s,l,c,u;i.isNodeJS&&(s=await import("fs"),l=await import("http"),c=await import("https"),u=await import("url"));const d=/^file:\/\/\/[a-zA-Z]:\//;function h(e){const t=u.parse(e);return"file:"===t.protocol||t.host?t:/^[a-z]:[/\\]/i.test(e)?u.parse("file:///".concat(e)):(t.host||(t.protocol="file:"),t)}class f{constructor(e){this.source=e,this.url=h(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&e.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new b(this):new v(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=this.isFsUrl?new w(this,e,t):new y(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeRequestReaders.slice(0))n.cancel(e)}}class p{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=t.length,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(t).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class g{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=t.length,null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:this._loaded});return{value:new Uint8Array(t).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function m(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}class v extends p{constructor(e){super(e);const t=t=>{if(404===t.statusCode){const e=new i.MissingPDFException('Missing PDF "'.concat(this._url,'".'));return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const n=e=>this._readableStream.headers[e.toLowerCase()],{allowRangeRequests:r,suggestedLength:a}=(0,o.validateRangeRequestCapabilities)({getResponseHeader:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=a||this._contentLength,this._filename=(0,o.extractFilenameFromHeader)(n)};this._request=null,"http:"===this._url.protocol?this._request=l.request(m(this._url,e.httpHeaders),t):this._request=c.request(m(this._url,e.httpHeaders),t),this._request.on("error",e=>{this._storedError=e,this._headersCapability.reject(e)}),this._request.end()}}class y extends g{constructor(e,t,n){super(e),this._httpHeaders={};for(const i in e.httpHeaders){const t=e.httpHeaders[i];void 0!==t&&(this._httpHeaders[i]=t)}this._httpHeaders.Range="bytes=".concat(t,"-").concat(n-1);const r=e=>{if(404===e.statusCode){const e=new i.MissingPDFException('Missing PDF "'.concat(this._url,'".'));return void(this._storedError=e)}this._setReadableStream(e)};this._request=null,"http:"===this._url.protocol?this._request=l.request(m(this._url,this._httpHeaders),r):this._request=c.request(m(this._url,this._httpHeaders),r),this._request.on("error",e=>{this._storedError=e}),this._request.end()}}class b extends p{constructor(e){super(e);let t=decodeURIComponent(this._url.path);d.test(this._url.href)&&(t=t.replace(/^\//,"")),s.promises.lstat(t).then(e=>{this._contentLength=e.size,this._setReadableStream(s.createReadStream(t)),this._headersCapability.resolve()},e=>{"ENOENT"===e.code&&(e=new i.MissingPDFException('Missing PDF "'.concat(t,'".'))),this._storedError=e,this._headersCapability.reject(e)})}}class w extends g{constructor(e,t,n){super(e);let r=decodeURIComponent(this._url.path);d.test(this._url.href)&&(r=r.replace(/^\//,"")),this._setReadableStream(s.createReadStream(r,{start:t,end:n-1}))}}r()}catch(a){r(a)}},1)},573:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{NodeCMapReaderFactory:()=>h,NodeCanvasFactory:()=>d,NodeFilterFactory:()=>u,NodeStandardFontDataFactory:()=>f});var i=n(583);let e,s,l;if(n(292).isNodeJS){e=await import("fs");try{s=await import("canvas")}catch(o){}try{l=await import("path2d")}catch(a){}}const c=function(t){return e.promises.readFile(t).then(e=>new Uint8Array(e))};class u extends i.BaseFilterFactory{}class d extends i.BaseCanvasFactory{_createCanvas(e,t){return s.createCanvas(e,t)}}class h extends i.BaseCMapReaderFactory{_fetchData(e,t){return c(e).then(e=>({cMapData:e,compressionType:t}))}}class f extends i.BaseStandardFontDataFactory{_fetchData(e){return c(e)}}r()}catch(s){r(s)}},1)},626:(e,t,n)=>{n.d(t,{OptionalContentConfig:()=>A});var r=n(292),i=n(651);const o=Symbol("INTERNAL");var a=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap;class g{constructor(e,t){let{name:n,intent:i,usage:o}=t;(0,d.A)(this,a,{writable:!0,value:!1}),(0,d.A)(this,s,{writable:!0,value:!1}),(0,d.A)(this,l,{writable:!0,value:!1}),(0,d.A)(this,c,{writable:!0,value:!0}),(0,f.A)(this,a,!!(e&r.RenderingIntentFlag.DISPLAY)),(0,f.A)(this,s,!!(e&r.RenderingIntentFlag.PRINT)),this.name=n,this.intent=i,this.usage=o}get visible(){if((0,p.A)(this,l))return(0,p.A)(this,c);if(!(0,p.A)(this,c))return!1;const{print:e,view:t}=this.usage;return(0,p.A)(this,a)?"OFF"!==(null===t||void 0===t?void 0:t.viewState):!(0,p.A)(this,s)||"OFF"!==(null===e||void 0===e?void 0:e.printState)}_setVisible(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e!==o&&(0,r.unreachable)("Internal method `_setVisible` called."),(0,f.A)(this,l,n),(0,f.A)(this,c,t)}}var m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakSet;class A{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.RenderingIntentFlag.DISPLAY;if((0,u.A)(this,w),(0,d.A)(this,m,{writable:!0,value:null}),(0,d.A)(this,v,{writable:!0,value:new Map}),(0,d.A)(this,y,{writable:!0,value:null}),(0,d.A)(this,b,{writable:!0,value:null}),this.renderingIntent=t,this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,(0,f.A)(this,b,e.order);for(const n of e.groups)(0,p.A)(this,v).set(n.id,new g(t,n));if("OFF"===e.baseState)for(const e of(0,p.A)(this,v).values())e._setVisible(o,!1);for(const t of e.on)(0,p.A)(this,v).get(t)._setVisible(o,!0);for(const t of e.off)(0,p.A)(this,v).get(t)._setVisible(o,!1);(0,f.A)(this,y,this.getHash())}}isVisible(e){if(0===(0,p.A)(this,v).size)return!0;if(!e)return(0,r.info)("Optional content group not defined."),!0;if("OCG"===e.type)return(0,p.A)(this,v).has(e.id)?(0,p.A)(this,v).get(e.id).visible:((0,r.warn)("Optional content group not found: ".concat(e.id)),!0);if("OCMD"===e.type){if(e.expression)return(0,h.A)(this,w,_).call(this,e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!(0,p.A)(this,v).has(t))return(0,r.warn)("Optional content group not found: ".concat(t)),!0;if((0,p.A)(this,v).get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!(0,p.A)(this,v).has(t))return(0,r.warn)("Optional content group not found: ".concat(t)),!0;if(!(0,p.A)(this,v).get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!(0,p.A)(this,v).has(t))return(0,r.warn)("Optional content group not found: ".concat(t)),!0;if(!(0,p.A)(this,v).get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!(0,p.A)(this,v).has(t))return(0,r.warn)("Optional content group not found: ".concat(t)),!0;if((0,p.A)(this,v).get(t).visible)return!1}return!0}return(0,r.warn)("Unknown optional content policy ".concat(e.policy,".")),!0}return(0,r.warn)("Unknown group type ".concat(e.type,".")),!0}setVisibility(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=(0,p.A)(this,v).get(e);n?(n._setVisible(o,!!t,!0),(0,f.A)(this,m,null)):(0,r.warn)("Optional content group not found: ".concat(e))}setOCGState(e){let t,{state:n,preserveRB:r}=e;for(const i of n){switch(i){case"ON":case"OFF":case"Toggle":t=i;continue}const e=(0,p.A)(this,v).get(i);if(e)switch(t){case"ON":e._setVisible(o,!0);break;case"OFF":e._setVisible(o,!1);break;case"Toggle":e._setVisible(o,!e.visible)}}(0,f.A)(this,m,null)}get hasInitialVisibility(){return null===(0,p.A)(this,y)||this.getHash()===(0,p.A)(this,y)}getOrder(){return(0,p.A)(this,v).size?(0,p.A)(this,b)?(0,p.A)(this,b).slice():[...(0,p.A)(this,v).keys()]:null}getGroups(){return(0,p.A)(this,v).size>0?(0,r.objectFromMap)((0,p.A)(this,v)):null}getGroup(e){return(0,p.A)(this,v).get(e)||null}getHash(){if(null!==(0,p.A)(this,m))return(0,p.A)(this,m);const e=new i.MurmurHash3_64;for(const[t,n]of(0,p.A)(this,v))e.update("".concat(t,":").concat(n.visible));return(0,f.A)(this,m,e.hexdigest())}}function _(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let i=1;i{n.d(t,{cleanupTextLayer:()=>c,renderTextLayer:()=>f,updateTextLayer:()=>p});var r=n(292),i=n(419);const o=30,a=new Map;let s=null;function l(){if(!s){const e=document.createElement("canvas");e.className="hiddenCanvasElement",document.body.append(e),s=e.getContext("2d",{alpha:!1})}return s}function c(){var e;null===(e=s)||void 0===e||e.canvas.remove(),s=null}function u(e,t,n){const i=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};e._textDivs.push(i);const c=r.Util.transform(e._transform,t.transform);let u=Math.atan2(c[1],c[0]);const d=n[t.fontName];d.vertical&&(u+=Math.PI/2);const h=e._fontInspectorEnabled&&d.fontSubstitution||d.fontFamily,f=Math.hypot(c[2],c[3]),p=f*function(e){const t=a.get(e);if(t)return t;const n=l(),r=n.font;n.canvas.width=n.canvas.height=o,n.font="".concat(o,"px ").concat(e);const i=n.measureText("");let s=i.fontBoundingBoxAscent,c=Math.abs(i.fontBoundingBoxDescent);if(s){const t=s/(s+c);return a.set(e,t),n.canvas.width=n.canvas.height=0,n.font=r,t}n.strokeStyle="red",n.clearRect(0,0,o,o),n.strokeText("g",0,0);let u=n.getImageData(0,0,o,o).data;c=0;for(let a=u.length-1-3;a>=0;a-=4)if(u[a]>0){c=Math.ceil(a/4/o);break}n.clearRect(0,0,o,o),n.strokeText("A",0,o),u=n.getImageData(0,0,o,o).data,s=0;for(let a=0,l=u.length;a0){s=o-Math.floor(a/4/o);break}if(n.canvas.width=n.canvas.height=0,n.font=r,s){const t=s/(s+c);return a.set(e,t),t}return a.set(e,.8),.8}(h);let g,m;0===u?(g=c[4],m=c[5]-p):(g=c[4]+p*Math.sin(u),m=c[5]-p*Math.cos(u));const v="calc(var(--scale-factor)*",y=i.style;e._container===e._rootContainer?(y.left="".concat((100*g/e._pageWidth).toFixed(2),"%"),y.top="".concat((100*m/e._pageHeight).toFixed(2),"%")):(y.left="".concat(v).concat(g.toFixed(2),"px)"),y.top="".concat(v).concat(m.toFixed(2),"px)")),y.fontSize="".concat(v).concat(f.toFixed(2),"px)"),y.fontFamily=h,s.fontSize=f,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,e._fontInspectorEnabled&&(i.dataset.fontName=d.fontSubstitutionLoadedName||t.fontName),0!==u&&(s.angle=u*(180/Math.PI));let b=!1;if(t.str.length>1)b=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(b=!0)}b&&(s.canvasWidth=d.vertical?t.height:t.width),e._textDivProperties.set(i,s),e._isReadableStream&&e._layoutText(i)}function d(e){const{div:t,scale:n,properties:r,ctx:i,prevFontSize:o,prevFontFamily:a}=e,{style:s}=t;let l="";if(0!==r.canvasWidth&&r.hasText){const{fontFamily:c}=s,{canvasWidth:u,fontSize:d}=r;o===d&&a===c||(i.font="".concat(d*n,"px ").concat(c),e.prevFontSize=d,e.prevFontFamily=c);const{width:h}=i.measureText(t.textContent);h>0&&(l="scaleX(".concat(u*n/h,")"))}0!==r.angle&&(l="rotate(".concat(r.angle,"deg) ").concat(l)),l.length>0&&(s.transform=l)}class h{constructor(e){var t;let{textContentSource:n,container:r,viewport:o,textDivs:a,textDivProperties:s,textContentItemsStr:c}=e;this._textContentSource=n,this._isReadableStream=n instanceof ReadableStream,this._container=this._rootContainer=r,this._textDivs=a||[],this._textContentItemsStr=c||[],this._fontInspectorEnabled=!(null===(t=globalThis.FontInspector)||void 0===t||!t.enabled),this._reader=null,this._textDivProperties=s||new WeakMap,this._canceled=!1,this._capability=Promise.withResolvers(),this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:o.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:l()};const{pageWidth:u,pageHeight:d,pageX:h,pageY:f}=o.rawDims;this._transform=[1,0,0,-1,-h,f+d],this._pageWidth=u,this._pageHeight=d,(0,i.setLayerDimensions)(r,o),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}_processItems(e,t){for(const n of e)if(void 0!==n.str)this._textContentItemsStr.push(n.str),u(this,n,t);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==n.id&&this._container.setAttribute("id","".concat(n.id)),e.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(e){const t=this._layoutTextParams.properties=this._textDivProperties.get(e);if(this._layoutTextParams.div=e,d(this._layoutTextParams),t.hasText&&this._container.append(e),t.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this._container.append(e)}}_render(){const{promise:e,resolve:t,reject:n}=Promise.withResolvers();let r=Object.create(null);if(this._isReadableStream){const e=()=>{this._reader.read().then(n=>{let{value:i,done:o}=n;o?t():(Object.assign(r,i.styles),this._processItems(i.items,r),e())},n)};this._reader=this._textContentSource.getReader(),e()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:n}=this._textContentSource;this._processItems(e,n),t()}}e.then(()=>{r=null,function(e){if(e._canceled)return;const t=e._textDivs,n=e._capability;if(t.length>1e5)n.resolve();else{if(!e._isReadableStream)for(const n of t)e._layoutText(n);n.resolve()}}(this)},this._capability.reject)}}function f(e){const t=new h(e);return t._render(),t}function p(e){let{container:t,viewport:n,textDivs:r,textDivProperties:o,mustRotate:a=!0,mustRescale:s=!0}=e;if(a&&(0,i.setLayerDimensions)(t,{rotation:n.rotation}),s){const e=l(),t={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:e};for(const n of r)t.properties=o.get(n),t.div=n,d(t)}}},585:(e,t,n)=>{n.d(t,{PDFDataTransportStream:()=>o});var r=n(292),i=n(419);class o{constructor(e,t){let{disableRange:n=!1,disableStream:i=!1}=t;(0,r.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:o,initialData:a,progressiveDone:s,contentDispositionFilename:l}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=l,(null===a||void 0===a?void 0:a.length)>0){const e=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!i,this._isRangeSupported=!n,this._contentLength=o,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),e.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),e.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData(e){let{begin:t,chunk:n}=e;const i=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(void 0===t)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const e=this._rangeReaders.some(function(e){return e._begin===t&&(e._enqueue(i),!0)});(0,r.assert)(e,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e,t;return null!==(e=null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)&&void 0!==e?e:0}_onProgress(e){var t,n,r,i;void 0===e.total?null===(t=this._rangeReaders[0])||void 0===t||null===(n=t.onProgress)||void 0===n||n.call(t,{loaded:e.loaded}):null===(r=this._fullRequestReader)||void 0===r||null===(i=r.onProgress)||void 0===i||i.call(r,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;null===(e=this._fullRequestReader)||void 0===e||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new a(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new s(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){var t;null===(t=this._fullRequestReader)||void 0===t||t.cancel(e);for(const n of this._rangeReaders.slice(0))n.cancel(e);this._pdfDataRangeTransport.abort()}}class a{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=e,this._done=n||!1,this._filename=(0,i.isPdfFile)(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(const i of this._queuedChunks)this._loaded+=i.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunks.push(e);this._loaded+=e.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class s{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},164:(e,t,n)=>{n.d(t,{GlobalWorkerOptions:()=>r});class r{static get workerPort(){return(0,c.A)(this,r,i)}static set workerPort(e){if(!("undefined"!==typeof Worker&&e instanceof Worker)&&null!==e)throw new Error("Invalid `workerPort` type.");(0,l.A)(this,r,i,e)}static get workerSrc(){return(0,c.A)(this,r,o)}static set workerSrc(e){if("string"!==typeof e)throw new Error("Invalid `workerSrc` type.");(0,l.A)(this,r,o,e)}}var i={writable:!0,value:null},o={writable:!0,value:""}},284:(e,t,n)=>{n.d(t,{XfaLayer:()=>i});var r=n(50);class i{static setupStorage(e,t,n,r,i){const o=r.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==o.value&&(e.textContent=o.value),"print"===i)break;e.addEventListener("input",e=>{r.setValue(t,{value:e.target.value})});break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(o.value===n.attributes.xfaOn?e.setAttribute("checked",!0):o.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===i)break;e.addEventListener("change",e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})})}else{if(null!==o.value&&e.setAttribute("value",o.value),"print"===i)break;e.addEventListener("input",e=>{r.setValue(t,{value:e.target.value})})}break;case"select":if(null!==o.value){e.setAttribute("value",o.value);for(const e of n.children)e.attributes.value===o.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",e=>{const n=e.target.options,i=-1===n.selectedIndex?"":n[n.selectedIndex].value;r.setValue(t,{value:i})})}}static setAttributes(e){let{html:t,element:n,storage:r=null,intent:i,linkService:o}=e;const{attributes:a}=n,s=t instanceof HTMLAnchorElement;"radio"===a.type&&(a.name="".concat(a.name,"-").concat(i));for(const[l,c]of Object.entries(a))if(null!==c&&void 0!==c)switch(l){case"class":c.length&&t.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",c);break;case"style":Object.assign(t.style,c);break;case"textContent":t.textContent=c;break;default:(!s||"href"!==l&&"newWindow"!==l)&&t.setAttribute(l,c)}s&&o.addLinkAttributes(t,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(t,a.dataId,n,r)}static render(e){const t=e.annotationStorage,n=e.linkService,i=e.xfaHtml,o=e.intent||"display",a=document.createElement(i.name);i.attributes&&this.setAttributes({html:a,element:i,intent:o,linkService:n});const s="richText"!==o,l=e.div;if(l.append(a),e.viewport){const t="matrix(".concat(e.viewport.transform.join(","),")");l.style.transform=t}s&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(0===i.children.length){if(i.value){const e=document.createTextNode(i.value);a.append(e),s&&r.XfaText.shouldBuildText(i.name)&&c.push(e)}return{textDivs:c}}const u=[[i,-1,a]];for(;u.length>0;){var d,h;const[e,i,a]=u.at(-1);if(i+1===e.children.length){u.pop();continue}const l=e.children[++u.at(-1)[1]];if(null===l)continue;const{name:f}=l;if("#text"===f){const e=document.createTextNode(l.value);c.push(e),a.append(e);continue}const p=null!==l&&void 0!==l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,f):document.createElement(f);if(a.append(p),l.attributes&&this.setAttributes({html:p,element:l,storage:t,intent:o,linkService:n}),(null===(h=l.children)||void 0===h?void 0:h.length)>0)u.push([l,-1,p]);else if(l.value){const e=document.createTextNode(l.value);s&&r.XfaText.shouldBuildText(f)&&c.push(e),p.append(e)}}for(const r of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))r.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const t="matrix(".concat(e.viewport.transform.join(","),")");e.div.style.transform=t,e.div.hidden=!1}}},50:(e,t,n)=>{n.d(t,{XfaText:()=>r});class r{static textContent(e){const t=[],n={items:t,styles:Object.create(null)};return function e(n){var i;if(!n)return;let o=null;const a=n.name;if("#text"===a)o=n.value;else{if(!r.shouldBuildText(a))return;null!==n&&void 0!==n&&null!==(i=n.attributes)&&void 0!==i&&i.textContent?o=n.attributes.textContent:n.value&&(o=n.value)}if(null!==o&&t.push({str:o}),n.children)for(const t of n.children)e(t)}(e),n}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}},228:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{AbortException:()=>i.AbortException,AnnotationEditorLayer:()=>l.AnnotationEditorLayer,AnnotationEditorParamsType:()=>i.AnnotationEditorParamsType,AnnotationEditorType:()=>i.AnnotationEditorType,AnnotationEditorUIManager:()=>c.AnnotationEditorUIManager,AnnotationLayer:()=>u.AnnotationLayer,AnnotationMode:()=>i.AnnotationMode,CMapCompressionType:()=>i.CMapCompressionType,ColorPicker:()=>d.ColorPicker,DOMSVGFactory:()=>a.DOMSVGFactory,DrawLayer:()=>h.DrawLayer,FeatureTest:()=>i.FeatureTest,GlobalWorkerOptions:()=>f.GlobalWorkerOptions,ImageKind:()=>i.ImageKind,InvalidPDFException:()=>i.InvalidPDFException,MissingPDFException:()=>i.MissingPDFException,OPS:()=>i.OPS,Outliner:()=>p.Outliner,PDFDataRangeTransport:()=>o.PDFDataRangeTransport,PDFDateString:()=>a.PDFDateString,PDFWorker:()=>o.PDFWorker,PasswordResponses:()=>i.PasswordResponses,PermissionFlag:()=>i.PermissionFlag,PixelsPerInch:()=>a.PixelsPerInch,RenderingCancelledException:()=>a.RenderingCancelledException,UnexpectedResponseException:()=>i.UnexpectedResponseException,Util:()=>i.Util,VerbosityLevel:()=>i.VerbosityLevel,XfaLayer:()=>g.XfaLayer,build:()=>o.build,createValidAbsoluteUrl:()=>i.createValidAbsoluteUrl,fetchData:()=>a.fetchData,getDocument:()=>o.getDocument,getFilenameFromUrl:()=>a.getFilenameFromUrl,getPdfFilenameFromUrl:()=>a.getPdfFilenameFromUrl,getXfaPageViewport:()=>a.getXfaPageViewport,isDataScheme:()=>a.isDataScheme,isPdfFile:()=>a.isPdfFile,noContextMenu:()=>a.noContextMenu,normalizeUnicode:()=>i.normalizeUnicode,renderTextLayer:()=>s.renderTextLayer,setLayerDimensions:()=>a.setLayerDimensions,shadow:()=>i.shadow,updateTextLayer:()=>s.updateTextLayer,version:()=>o.version});var i=n(292),o=n(831),a=n(419),s=n(814),l=n(731),c=n(830),u=n(976),d=n(259),h=n(47),f=n(164),p=n(61),g=n(284),m=e([o]);o=(m.then?(await m)():m)[0];r()}catch(v){r(v)}})},178:(e,t,n)=>{n.d(t,{MessageHandler:()=>w});var r=n(292);const i=1,o=2,a=1,s=2,l=3,c=4,d=5,f=6,p=7,g=8;function m(e){switch(e instanceof Error||"object"===typeof e&&null!==e||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new r.AbortException(e.message);case"MissingPDFException":return new r.MissingPDFException(e.message);case"PasswordException":return new r.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new r.UnknownErrorException(e.message,e.details);default:return new r.UnknownErrorException(e.message,e.toString())}}var v=new WeakSet,y=new WeakSet,b=new WeakSet;class w{constructor(e,t,n){(0,u.A)(this,b),(0,u.A)(this,y),(0,u.A)(this,v),this.sourceName=e,this.targetName=t,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),this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream)return void(0,h.A)(this,y,_).call(this,t);if(t.callback){const e=t.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error("Cannot resolve callback ".concat(e));if(delete this.callbackCapabilities[e],t.callback===i)n.resolve(t.data);else{if(t.callback!==o)throw new Error("Unexpected callback case");n.reject(m(t.reason))}return}const r=this.actionHandler[t.action];if(!r)throw new Error("Unknown action from worker: ".concat(t.action));if(t.callbackId){const e=this.sourceName,a=t.sourceName;return void new Promise(function(e){e(r(t.data))}).then(function(r){n.postMessage({sourceName:e,targetName:a,callback:i,callbackId:t.callbackId,data:r})},function(r){n.postMessage({sourceName:e,targetName:a,callback:o,callbackId:t.callbackId,reason:m(r)})})}t.streamId?(0,h.A)(this,v,A).call(this,t):r(t.data)},n.addEventListener("message",this._onComObjOnMessage)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error('There is already an actionName called "'.concat(e,'"'));n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(o){i.reject(o)}return i.promise}sendWithStream(e,t,n,i){const o=this.streamId++,s=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const r=Promise.withResolvers();return this.streamControllers[o]={controller:n,startCall:r,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:s,targetName:l,action:e,streamId:o,data:t,desiredSize:n.desiredSize},i),r.promise},pull:e=>{const t=Promise.withResolvers();return this.streamControllers[o].pullCall=t,c.postMessage({sourceName:s,targetName:l,stream:f,streamId:o,desiredSize:e.desiredSize}),t.promise},cancel:e=>{(0,r.assert)(e instanceof Error,"cancel must have a valid reason");const t=Promise.withResolvers();return this.streamControllers[o].cancelCall=t,this.streamControllers[o].isClosed=!0,c.postMessage({sourceName:s,targetName:l,stream:a,streamId:o,reason:m(e)}),t.promise}},n)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}function A(e){const t=e.streamId,n=this.sourceName,i=e.sourceName,o=this.comObj,a=this,s=this.actionHandler[e.action],u={enqueue(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const s=this.desiredSize;this.desiredSize-=r,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:n,targetName:i,stream:c,streamId:t,chunk:e},a)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:i,stream:l,streamId:t}),delete a.streamSinks[t])},error(e){(0,r.assert)(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:i,stream:d,streamId:t,reason:m(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[t]=u,new Promise(function(t){t(s(e.data,u))}).then(function(){o.postMessage({sourceName:n,targetName:i,stream:g,streamId:t,success:!0})},function(e){o.postMessage({sourceName:n,targetName:i,stream:g,streamId:t,reason:m(e)})})}function _(e){const t=e.streamId,n=this.sourceName,i=e.sourceName,o=this.comObj,u=this.streamControllers[t],v=this.streamSinks[t];switch(e.stream){case g:e.success?u.startCall.resolve():u.startCall.reject(m(e.reason));break;case p:e.success?u.pullCall.resolve():u.pullCall.reject(m(e.reason));break;case f:if(!v){o.postMessage({sourceName:n,targetName:i,stream:p,streamId:t,success:!0});break}v.desiredSize<=0&&e.desiredSize>0&&v.sinkCapability.resolve(),v.desiredSize=e.desiredSize,new Promise(function(e){var t;e(null===(t=v.onPull)||void 0===t?void 0:t.call(v))}).then(function(){o.postMessage({sourceName:n,targetName:i,stream:p,streamId:t,success:!0})},function(e){o.postMessage({sourceName:n,targetName:i,stream:p,streamId:t,reason:m(e)})});break;case c:if((0,r.assert)(u,"enqueue should have stream controller"),u.isClosed)break;u.controller.enqueue(e.chunk);break;case l:if((0,r.assert)(u,"close should have stream controller"),u.isClosed)break;u.isClosed=!0,u.controller.close(),(0,h.A)(this,b,C).call(this,u,t);break;case d:(0,r.assert)(u,"error should have stream controller"),u.controller.error(m(e.reason)),(0,h.A)(this,b,C).call(this,u,t);break;case s:e.success?u.cancelCall.resolve():u.cancelCall.reject(m(e.reason)),(0,h.A)(this,b,C).call(this,u,t);break;case a:if(!v)break;new Promise(function(t){var n;t(null===(n=v.onCancel)||void 0===n?void 0:n.call(v,m(e.reason)))}).then(function(){o.postMessage({sourceName:n,targetName:i,stream:s,streamId:t,success:!0})},function(e){o.postMessage({sourceName:n,targetName:i,stream:s,streamId:t,reason:m(e)})}),v.sinkCapability.reject(m(e.reason)),v.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async function C(e,t){var n,r,i;await Promise.allSettled([null===(n=e.startCall)||void 0===n?void 0:n.promise,null===(r=e.pullCall)||void 0===r?void 0:r.promise,null===(i=e.cancelCall)||void 0===i?void 0:i.promise]),delete this.streamControllers[t]}},651:(e,t,n)=>{n.d(t,{MurmurHash3_64:()=>a});const r=3285377520,i=4294901760,o=65535;class a{constructor(e){this.h1=e?4294967295&e:r,this.h2=e?4294967295&e:r}update(e){let t,n;if("string"===typeof e){t=new Uint8Array(2*e.length),n=0;for(let r=0,i=e.length;r>>8,t[n++]=255&i)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),n=t.byteLength}const r=n>>2,a=n-4*r,s=new Uint32Array(t.buffer,0,r);let l=0,c=0,u=this.h1,d=this.h2;const h=3432918353,f=461845907,p=11601,g=13715;for(let m=0;m>>17,l=l*f&i|l*g&o,u^=l,u=u<<13|u>>>19,u=5*u+3864292196):(c=s[m],c=c*h&i|c*p&o,c=c<<15|c>>>17,c=c*f&i|c*g&o,d^=c,d=d<<13|d>>>19,d=5*d+3864292196);switch(l=0,a){case 3:l^=t[4*r+2]<<16;case 2:l^=t[4*r+1]<<8;case 1:l^=t[4*r],l=l*h&i|l*p&o,l=l<<15|l>>>17,l=l*f&i|l*g&o,1&r?u^=l:d^=l}this.h1=u,this.h2=d}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&i|36045*e&o,t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,e=444984403*e&i|60499*e&o,t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}},292:(e,t,n)=>{n.d(t,{AbortException:()=>B,AnnotationBorderStyleType:()=>y,AnnotationEditorParamsType:()=>f,AnnotationEditorPrefix:()=>d,AnnotationEditorType:()=>h,AnnotationMode:()=>u,AnnotationPrefix:()=>$,AnnotationType:()=>v,BaseException:()=>P,CMapCompressionType:()=>w,FONT_IDENTITY_MATRIX:()=>a,FeatureTest:()=>W,FontRenderOps:()=>ee,FormatError:()=>L,IDENTITY_MATRIX:()=>i,ImageKind:()=>m,InvalidPDFException:()=>N,LINE_FACTOR:()=>l,MAX_IMAGE_SIZE_TO_CACHE:()=>s,MissingPDFException:()=>j,OPS:()=>A,PasswordException:()=>M,PasswordResponses:()=>_,PermissionFlag:()=>p,RenderingIntentFlag:()=>c,TextRenderingMode:()=>g,UnexpectedResponseException:()=>F,UnknownErrorException:()=>R,Util:()=>q,VerbosityLevel:()=>b,assert:()=>T,bytesToString:()=>z,createValidAbsoluteUrl:()=>O,getUuid:()=>Z,getVerbosityLevel:()=>E,info:()=>S,isNodeJS:()=>r,normalizeUnicode:()=>J,objectFromMap:()=>H,setVerbosityLevel:()=>x,shadow:()=>I,string32:()=>G,stringToBytes:()=>U,unreachable:()=>k,warn:()=>D});const r="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),i=[1,0,0,1,0,0],a=[.001,0,0,.001,0,0],s=1e7,l=1.35,c={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},u={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},d="pdfjs_internal_editor_",h={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},p={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},g={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},m={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},v={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,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},y={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},b={ERRORS:0,WARNINGS:1,INFOS:5},w={NONE:0,BINARY:1},A={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},_={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let C=b.WARNINGS;function x(e){Number.isInteger(e)&&(C=e)}function E(){return C}function S(e){C>=b.INFOS&&console.log("Info: ".concat(e))}function D(e){C>=b.WARNINGS&&console.log("Warning: ".concat(e))}function k(e){throw new Error(e)}function T(e,t){e||k(t)}function O(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return null;try{if(n&&"string"===typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);(null===t||void 0===t?void 0:t.length)>=2&&(e="http://".concat(e))}if(n.tryConvertEncoding)try{e=decodeURIComponent(escape(e))}catch(r){}}const i=t?new URL(e,t):new URL(e);if(function(e){switch(null===e||void 0===e?void 0:e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i))return i}catch(i){}return null}function I(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}const P=function(){function e(t,n){this.constructor===e&&k("Cannot initialize BaseException."),this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e}();class M extends P{constructor(e,t){super(e,"PasswordException"),this.code=t}}class R extends P{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class N extends P{constructor(e){super(e,"InvalidPDFException")}}class j extends P{constructor(e){super(e,"MissingPDFException")}}class F extends P{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}}class L extends P{constructor(e){super(e,"FormatError")}}class B extends P{constructor(e){super(e,"AbortException")}}function z(e){"object"===typeof e&&void 0!==(null===e||void 0===e?void 0:e.length)||k("Invalid argument for bytesToString");const t=e.length,n=8192;if(t>24&255,e>>16&255,e>>8&255,255&e)}function H(e){const t=Object.create(null);for(const[n,r]of e)t[n]=r;return t}class W{static get isLittleEndian(){return I(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return I(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(e){return!1}}())}static get isOffscreenCanvasSupported(){return I(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){var e;return"undefined"!==typeof navigator&&"string"===typeof(null===(e=navigator)||void 0===e?void 0:e.platform)?I(this,"platform",{isMac:navigator.platform.includes("Mac")}):I(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var e,t;return I(this,"isCSSRoundSupported",null===(e=globalThis.CSS)||void 0===e||null===(t=e.supports)||void 0===t?void 0:t.call(e,"width: round(1.5px, 1px)"))}}const V=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class q{static makeHexColor(e,t,n){return"#".concat(V[e]).concat(V[t]).concat(V[n])}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=this.applyTransform(e,t),r=this.applyTransform(e.slice(2,4),t),i=this.applyTransform([e[0],e[3]],t),o=this.applyTransform([e[2],e[1]],t);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],o=e[2]*t[1]+e[3]*t[3],a=(n+o)/2,s=Math.sqrt((n+o)**2-4*(n*o-i*r))/2,l=a+s||1,c=a-s||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),o=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>o?null:[n,i,r,o]}static bezierBoundingBox(e,t,n,r,i,a,s,l,c){return c?(c[0]=Math.min(c[0],e,s),c[1]=Math.min(c[1],t,l),c[2]=Math.max(c[2],e,s),c[3]=Math.max(c[3],t,l)):c=[Math.min(e,s),Math.min(t,l),Math.max(e,s),Math.max(t,l)],(0,o.A)(this,q,Y).call(this,e,n,i,s,t,r,a,l,3*(3*(n-i)-e+s),6*(e-2*n+i),3*(n-e),c),(0,o.A)(this,q,Y).call(this,e,n,i,s,t,r,a,l,3*(3*(r-a)-t+l),6*(t-2*r+a),3*(r-t),c),c}}function K(e,t,n,r,i,o,a,s,l,c){if(l<=0||l>=1)return;const u=1-l,d=l*l,h=d*l,f=u*(u*(u*e+3*l*t)+3*d*n)+h*r,p=u*(u*(u*i+3*l*o)+3*d*a)+h*s;c[0]=Math.min(c[0],f),c[1]=Math.min(c[1],p),c[2]=Math.max(c[2],f),c[3]=Math.max(c[3],p)}function Y(e,t,n,r,i,a,s,l,c,u,d,h){if(Math.abs(c)<1e-12)return void(Math.abs(u)>=1e-12&&(0,o.A)(this,q,K).call(this,e,t,n,r,i,a,s,l,-d/u,h));const f=u**2-4*d*c;if(f<0)return;const p=Math.sqrt(f),g=2*c;(0,o.A)(this,q,K).call(this,e,t,n,r,i,a,s,l,(-u+p)/g,h),(0,o.A)(this,q,K).call(this,e,t,n,r,i,a,s,l,(-u-p)/g,h)}let X=null,Q=null;function J(e){return X||(X=/([\xA0\xB5\u037E\u0EB3\u2000-\u200A\u202F\u2126\uFB00-\uFB04\uFB06\uFB20-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBA1\uFBA4-\uFBA9\uFBAE-\uFBB1\uFBD3-\uFBDC\uFBDE-\uFBE7\uFBEA-\uFBF8\uFBFC\uFBFD\uFC00-\uFC5D\uFC64-\uFCF1\uFCF5-\uFD3D\uFD88\uFDF4\uFDFA\uFDFB\uFE71\uFE77\uFE79\uFE7B\uFE7D]+)|(\uFB05+)/g,Q=new Map([["\ufb05","\u017ft"]])),e.replaceAll(X,(e,t,n)=>t?t.normalize("NFKC"):Q.get(n))}function Z(){var e,t;if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.randomUUID))return crypto.randomUUID();const n=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.getRandomValues))crypto.getRandomValues(n);else for(let r=0;r<32;r++)n[r]=Math.floor(255*Math.random());return z(n)}const $="pdfjs_internal_id_",ee={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8}}},m={};function _(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return g[e](n,n.exports,_),n.exports}(()=>{var e="function"===typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",t="function"===typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",n="function"===typeof Symbol?Symbol("webpack error"):"__webpack_error__",r=e=>{e&&e.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};_.a=(i,o,a)=>{var s;a&&((s=[]).d=-1);var l,c,u,d=new Set,h=i.exports,f=new Promise((e,t)=>{u=t,c=e});f[t]=h,f[e]=e=>(s&&e(s),d.forEach(e),f.catch(e=>{})),i.exports=f,o(i=>{var o;l=(i=>i.map(i=>{if(null!==i&&"object"===typeof i){if(i[e])return i;if(i.then){var o=[];o.d=0,i.then(e=>{a[t]=e,r(o)},e=>{a[n]=e,r(o)});var a={};return a[e]=e=>e(o),a}}var s={};return s[e]=e=>{},s[t]=i,s}))(i);var a=()=>l.map(e=>{if(e[n])throw e[n];return e[t]}),c=new Promise(t=>{(o=()=>t(a)).r=0;var n=e=>e!==s&&!d.has(e)&&(d.add(e),e&&!e.d&&(o.r++,e.push(o)));l.map(t=>t[e](n))});return o.r?c:a()},e=>(e?u(f[n]=e):c(h),r(s))),s&&s.d<0&&(s.d=0)}})(),_.d=(e,t)=>{for(var n in t)_.o(t,n)&&!_.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},_.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var v=_(228),y=((v=globalThis.pdfjsLib=await(globalThis.pdfjsLibPromise=v)).AbortException,v.AnnotationEditorLayer,v.AnnotationEditorParamsType,v.AnnotationEditorType,v.AnnotationEditorUIManager,v.AnnotationLayer,v.AnnotationMode,v.CMapCompressionType,v.ColorPicker,v.DOMSVGFactory,v.DrawLayer,v.FeatureTest,v.GlobalWorkerOptions),b=(v.ImageKind,v.InvalidPDFException,v.MissingPDFException,v.OPS,v.Outliner,v.PDFDataRangeTransport,v.PDFDateString,v.PDFWorker,v.PasswordResponses,v.PermissionFlag,v.PixelsPerInch,v.RenderingCancelledException,v.UnexpectedResponseException,v.Util,v.VerbosityLevel,v.XfaLayer,v.build,v.createValidAbsoluteUrl,v.fetchData,v.getDocument),w=(v.getFilenameFromUrl,v.getPdfFilenameFromUrl,v.getXfaPageViewport,v.isDataScheme,v.isPdfFile,v.noContextMenu,v.normalizeUnicode,v.renderTextLayer,v.setLayerDimensions,v.shadow,v.updateTextLayer,v.version);r()}catch(A){r(A)}},1)},2419(e,t,n){"use strict";var r=n(24994),i=n(6305);t.A=void 0;var o=i(n(9950)),a=(0,r(n(53209)).default)(o.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked");t.A=a},2655(e,t,n){"use strict";let r,i,o;n.d(t,{Kx:()=>r,Xt:()=>o,uU:()=>i}),function(e){e.OpenAI="OpenAI",e.CustomLLM="CustomLLM",e.Gemini="Gemini"}(r||(r={})),function(e){e[e.NO=0]="NO",e[e.OVER=1]="OVER",e[e.CENTER=2]="CENTER",e[e.YES=3]="YES"}(i||(i={})),function(e){e.joining_call="joining_call",e.in_waiting_room="in_waiting_room",e.in_call_not_recording="in_call_not_recording",e.in_call_recording="in_call_recording",e.call_ended="call_ended",e.recording_done="recording_done",e.done="done",e.fatal="fatal"}(o||(o={}))},2685(e,t,n){var r=n(82983),i=n(69662),o=n(28240),a=n(20019),s=n(76983),l=n(82777),c=i.process;r({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(e){s(arguments.length,1),a(e);var t=l&&c.domain;o(t?t.bind(e):e)}})},2700(e,t,n){"use strict";function r(){var e=document.createElement("div");e.style.width="99px",e.style.height="99px",e.style.position="absolute",e.style.top="-9999px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}n.d(t,{A:()=>r})},2737(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631),i=r.__importDefault(n(31482)),o=r.__importDefault(n(15888)),a=r.__importStar(n(25594)),s=n(75021),l=n(63543),c=n(70768),u=n(7086),d=n(75998),h=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return d.assertIs(t,"acroComboBox",[[u.PDFAcroComboBox,"PDFAcroComboBox"]]),i.acroField=t,i}return r.__extends(t,e),t.prototype.getOptions=function(){for(var e=this.acroField.getOptions(),t=new Array(e.length),n=0,r=t.length;n1||1===n.length&&t)&&this.enableMultiselect();for(var i=new Array(n.length),o=0,a=n.length;oi})},2946(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,{A:()=>r})},2964(e,t,n){"use strict";n.d(t,{Ay:()=>N});var r=n(9950),i=n(63027),o=n(16714),a=n(13144),s=n(32018),l=n(11647),c=n(18028),u=n(96918),d=n(97226),h=n(77766),f=n(43510),p=n(52816),g=n(80974),m=n(7692),v=n(39884),y=n(28030),b=n(45072),w=n(89945),A=n(41849),_=n(47933),C=n(38870),x=n(39886),E=n(67376),S=n(99221),D=n(44414);const k=(0,g.A)(e=>({popoverContent:{padding:e.spacing(2),maxWidth:360,maxHeight:400,overflowY:"auto"},strategyChip:{marginBottom:e.spacing(1)},overview:{marginBottom:e.spacing(1),whiteSpace:"pre-wrap",wordBreak:"break-word"},fieldRow:{marginBottom:e.spacing(.5)},fieldPath:{fontWeight:600},examples:{color:e.palette.text.secondary,fontSize:"0.75rem",marginLeft:e.spacing(1)},requiredBadge:{color:e.palette.error.main,fontSize:"0.7rem",marginLeft:e.spacing(.5)}}));function T(e){let{guidance:t}=e;const n=k(),r=[...t.fields].sort((e,t)=>e.order-t.order);return(0,D.jsxs)(_.A,{className:n.popoverContent,children:[(0,D.jsx)(l.A,{size:"small",label:t.strategy,className:n.strategyChip}),t.overview?(0,D.jsx)(x.A,{variant:"body2",className:n.overview,children:t.overview}):null,r.map(e=>(0,D.jsxs)(_.A,{className:n.fieldRow,children:[(0,D.jsxs)(x.A,{variant:"caption",display:"block",children:[(0,D.jsxs)("span",{className:n.fieldPath,children:[e.order,".\xa0",e.path.join(" \u2192 ")]}),e.required?(0,D.jsx)("span",{className:n.requiredBadge,children:"(required)"}):null,e.hint?(0,D.jsxs)("span",{children:["\xa0\u2014\xa0",e.hint]}):null]}),e.examples.length>0?(0,D.jsxs)(x.A,{variant:"caption",className:n.examples,display:"block",children:["e.g.\xa0",e.examples.join(", ")]}):null]},"".concat(e.path.join("."),".").concat(e.order)))]})}function O(e){let{value:t}=e;const[n,i]=(0,r.useState)(null),o=(0,r.useCallback)(e=>{e.stopPropagation(),i(e.currentTarget)},[]),a=(0,r.useCallback)(e=>{e.stopPropagation(),i(null)},[]);return t&&(0,S.i)(t)?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(d.A,{size:"small",onClick:o,"aria-label":"view guidance",children:(0,D.jsx)(E.A,{fontSize:"small"})}),(0,D.jsx)(C.Ay,{open:Boolean(n),anchorEl:n,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,D.jsx)(T,{guidance:t})})]}):null}const I=e=>e._id,P=[{Header:(0,D.jsx)(i.A,{id:"templateName"}),accessor:"name",Cell:e=>{let{value:t,row:{original:n}}=e;return(0,D.jsxs)(D.Fragment,{children:[t,n.share&&n.share.public?(0,D.jsxs)(D.Fragment,{children:[" ",(0,D.jsx)(l.A,{size:"small",label:(0,D.jsx)(i.A,{id:"templateIsPublicShort"}),color:"primary"})]}):null]})}},{Header:(0,D.jsx)(i.A,{id:"templateKeywords"}),accessor:"keywords",Cell:e=>{let{value:t}=e;return t.map(e=>(0,D.jsx)(l.A,{size:"small",label:e},e))}},{Header:(0,D.jsx)(i.A,{id:"templateGuidance"}),accessor:"fillGuidance",Cell:O,disableSortBy:!0},{Header:(0,D.jsx)(i.A,{id:"changed"}),accessor:"updatedAt",Cell:b.A},{Header:(0,D.jsx)(i.A,{id:"created"}),accessor:"createdAt",Cell:b.A}],M=(0,g.A)(e=>({closeButton:{position:"absolute",right:e.spacing(1),top:e.spacing(1),color:e.palette.grey[500]},select:{"&:focus":{backgroundColor:"transparent !important"}}})),R=e=>{let{open:t,onClose:n,titleId:l,rowClick:g,resizeType:b,resizeTypeHandler:_}=e;const[C,x]=(0,r.useState)(""),E=M(),{data:S=[],isFetching:k,refetch:T}=(0,w.A)({url:"/templates"}),O=(0,r.useMemo)(()=>{const e=C?new RegExp(C,"i"):/./;return S.filter(t=>{let{name:n,keywords:r}=t;return e.test(n)||r.find(t=>e.test(t))})},[C,S]);return(0,D.jsxs)(c.A,{open:t,onClose:n,maxWidth:"lg",fullWidth:!0,children:[(0,D.jsxs)(u.A,{children:[(0,D.jsx)(i.A,{id:l||"templateTableTitle"}),(0,D.jsx)(d.A,{"aria-label":"close",onClick:n,className:E.closeButton,children:(0,D.jsx)(a.A,{})})]}),(0,D.jsxs)(h.A,{children:[(0,D.jsx)(o.A,{}),(0,D.jsx)(s.A,{onChange:e=>x(e.target.value),value:C}),b&&_?(0,D.jsxs)(m.A,{variant:"outlined",classes:{select:E.select},id:"resizeType",onChange:_,value:b,style:{marginLeft:"10px",borderRadius:"5px",maxHeight:"30px"},children:[(0,D.jsx)(v.A,{value:A.D.autogrow,children:(0,D.jsx)(i.A,{id:"autogrow"})}),(0,D.jsx)(v.A,{value:A.D.autoshrink,children:(0,D.jsx)(i.A,{id:"autoshrink"})})]}):null,(0,D.jsx)(y.A,{columns:P,data:O,rowClick:g,isLoading:k,getRowId:I,refetch:T})]}),(0,D.jsx)(f.A,{children:(0,D.jsx)(p.A,{onClick:n,children:(0,D.jsx)(i.A,{id:"button.close"})})})]})};R.displayName="TemplateInsertDialog";const N=R},2982(e,t,n){"use strict";n.d(t,{A:()=>l});var r=n(65155),i=n(9950),o=n(52394),a=n(42010),s=n(41355);const l=()=>{const{importDatas:e,importRoot:t}=(0,r.zy)().state||{},{importer:n}=(0,s.A)(!1),{root:l,isLoading:c,isWriteable:u}=(0,o.A)(),{error:d}=(0,a.A)(),h=t||l;return(0,i.useEffect)(()=>{if(e&&!c&&u){(async()=>{try{await n.runImport(e,h)}catch(t){d(t.message)}})()}},[n,e,c,u,h,d]),null}},3016(e,t,n){"use strict";n.d(t,{A:()=>d});n(9950);var r=n(39884),i=n(68168),o=n(63027),a=n(62613),s=n(69243),l=n(41355),c=n(44414);const u={body:void 0,crop:void 0,stretch:void 0,fullWidth:void 0},d=e=>{let{handleClose:t}=e;const{selectedNodes:n}=(0,l.A)(),{setImagePosition:d}=(0,a.A)(),h=![...n].find(e=>e.image),f=e=>n=>{n.stopPropagation(),d(e),t&&t()};return(0,c.jsx)(c.Fragment,{children:Object.values(s.cJ).map(e=>(0,c.jsxs)(r.A,{disabled:h,onClick:f(e),children:[u[e]?(0,c.jsx)(i.A,{children:u[e]}):(0,c.jsx)(i.A,{}),(0,c.jsx)(o.A,{id:"toolbarMenu.imagePositions.titles.".concat(e)})]},e))})}},3085(e,t,n){"use strict";n.a(e,async(e,r)=>{try{n.d(t,{A:()=>A});var i=n(9950),o=n(63027),a=n(22579),s=n(69499),l=n(81390),c=n(84580),u=n(81788),d=n(68168),h=n(29206),f=n(4750),p=n(80974),g=n(57474),m=n(20135),v=n(44414),y=e([g]),b=y.then?(await y)():y;g=b[0];const w=(0,p.A)(()=>({nested:{paddingLeft:30}})),A=()=>{const e=w(),[t,n]=(0,i.useState)(!1);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(h.A,{button:!0,onClick:e=>{n(!t),e.stopPropagation()},children:[(0,v.jsx)(d.A,{children:(0,v.jsx)(l.A,{})}),(0,v.jsx)(u.A,{children:(0,v.jsx)(o.A,{id:"settingsVisualizationSubmenu"})}),t?(0,v.jsx)(a.A,{}):(0,v.jsx)(s.A,{})]}),(0,v.jsx)(f.A,{in:t,timeout:"auto",unmountOnExit:!0,children:(0,v.jsxs)(c.A,{component:"div",disablePadding:!0,children:[(0,v.jsx)(m.A,{className:e.nested}),(0,v.jsx)(g.A,{className:e.nested})]})})]})};r()}catch(w){r(w)}})},3101(e){e.exports=Math.sign||function(e){var t=+e;return 0==t||t!=t?t:t<0?-1:1}},3134(e,t,n){"use strict";n.d(t,{A:()=>U});var r=n(9950),i=n(65155),o=n(63027),a=n(80974),s=n(45114),l=n(52394),c=n(30158),u=n(34577),d=n(89379),h=n(80045),f=n(39886),p=n(77882),g=n(32988),m=n(11647),v=n(57297),y=n(87112),b=n(57293),w=n(87830),A=n(53683),_=n(25741),C=n(99141),x=n(10656),E=n(78536),S=n(83696),D=n(44414);const k=["open","onClose"],T=(0,a.A)(e=>({action:{float:"right",background:e.palette.info.light,marginLeft:5},modal:{backgroundColor:e.palette.background.paper,top:"50%",left:"50%",transform:"translate(-50%, -50%)",position:"absolute",maxWidth:"1600px",width:"90%",maxHeight:"100%",overflowY:"scroll",flexGrow:1,zIndex:e.zIndex.appBar+10},topic:{padding:"0.33em"},container:{background:e.palette.grey[300],padding:"1em"},item:{padding:"1.5em"}})),O=e=>{let{children:t}=e;const n=T();return(0,D.jsx)(f.A,{className:n.topic,variant:"h2",children:t})},I=e=>{let{children:t}=e;const n=T();return(0,D.jsx)(g.A,{item:!0,container:!0,className:n.container,children:t})},P=e=>{let{children:t}=e;const n=T();return(0,D.jsx)(g.A,{item:!0,xs:12,md:4,lg:4,spacing:5,children:(0,D.jsx)(p.A,{className:n.item,children:t})})},M=e=>{let{children:t}=e;return(0,D.jsx)(f.A,{gutterBottom:!0,variant:"h5",children:t})},R=e=>{let{children:t}=e;return(0,D.jsx)(f.A,{children:t})},N=e=>{let{children:t}=e;return(0,D.jsx)(g.A,{justifyContent:"flex-start",container:!0,direction:"row",spacing:3,children:t})},j=e=>{let{children:t}=e;const n=T();return(0,D.jsx)(m.A,{className:n.action,label:t})},F=()=>E.cX?"\u2318":"Ctrl",L=e=>{let{open:t,onClose:n}=e,r=(0,h.A)(e,k);const i=T(),{advancedNavigation:o}=(0,S._)();return(0,D.jsx)(C.A,(0,d.A)((0,d.A)({open:t,onClose:n},r),{},{children:(0,D.jsxs)(p.A,{className:i.modal,children:[(0,D.jsxs)(I,{children:[(0,D.jsx)(O,{children:"Navigate"}),(0,D.jsxs)(N,{children:[(0,D.jsxs)(P,{children:[(0,D.jsx)(j,{children:"Space"}),(0,D.jsx)(M,{children:"Zoom to card"}),(0,D.jsx)(R,{children:"Doubleclick."})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(j,{children:"Esc"}),(0,D.jsx)(M,{children:"Zoom out one step"}),(0,D.jsx)(R,{children:"Doubleclick on surrounding card."})]}),(0,D.jsxs)(P,{children:[(0,D.jsxs)(j,{children:[(0,D.jsx)(F,{})," + / -"]}),(0,D.jsx)(M,{children:"Zoom freely"}),(0,D.jsx)(R,{children:"Pinch gesture / scroll gesture (two fingers on touchpad)"})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Look around (scroll / pan)"}),(0,D.jsx)(R,{children:"Drag map. (Scroll gesture, in some browsers.)"})]}),o&&!E.cX&&(0,D.jsxs)(P,{children:[(0,D.jsx)(j,{children:"Shift + Wheel / Scroll"}),(0,D.jsx)(M,{children:"Move the scene"}),(0,D.jsx)(R,{children:"2 wheel mouse or 2 finger touchpad (on some devices)"})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Follow connections"}),(0,D.jsx)(R,{children:"Doubleclick arrows."})]})]})]}),(0,D.jsxs)(I,{children:[(0,D.jsx)(O,{children:"Select"}),(0,D.jsxs)(N,{children:[(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Select multiple cards"}),(0,D.jsxs)(R,{children:["Select / deselect while holding the ",(0,D.jsx)(F,{})," key."]})]}),(0,D.jsxs)(P,{children:[(0,D.jsxs)(j,{children:[(0,D.jsx)(F,{})," A"]}),(0,D.jsx)(M,{children:"Select All sibling cards"})]})]})]}),(0,D.jsxs)(I,{children:[(0,D.jsx)(O,{children:"Edit"}),(0,D.jsxs)(N,{children:[(0,D.jsxs)(P,{children:[(0,D.jsxs)(j,{children:[(0,D.jsx)(F,{})," Enter"]}),(0,D.jsx)(j,{children:"Shift Enter"}),(0,D.jsx)(M,{children:"Create new card"}),(0,D.jsxs)(R,{children:["Activate Add-Mode ",(0,D.jsx)(w.A,{fontSize:"small"})," in Toolbar, select nearby existing cards, then click placeholder to create new child or sibling card."]})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(j,{children:"Alt"}),(0,D.jsx)(M,{children:"Move cards"}),(0,D.jsxs)(R,{children:["Select card, then drag upper area. ",(0,D.jsx)("br",{}),"Alternatively: Toggle move mode with ",(0,D.jsx)(v.A,{fontSize:"small"}),"."]})]}),(0,D.jsxs)(P,{children:[(0,D.jsxs)(j,{children:[(0,D.jsx)(F,{})," D"]}),(0,D.jsx)(M,{children:"Duplicate card"}),(0,D.jsxs)(R,{children:["Select card, then open the menu ",(0,D.jsx)(y.A,{fontSize:"small"}),"in toolbar."]})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(j,{children:"Enter"}),(0,D.jsx)(M,{children:"Edit text"}),(0,D.jsx)(R,{children:"Select card and start typing. Just leave card or press Enter to save Text."})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Change background / border color"}),(0,D.jsx)(R,{children:"Select card, choose color or border from tool bar."})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(j,{children:"Del"}),(0,D.jsx)(j,{children:"Backspace"}),(0,D.jsx)(M,{children:"Delete"}),(0,D.jsxs)(R,{children:["Select card or connection, click ",(0,D.jsx)(b.A,{fontSize:"small"}),"."]})]})]})]}),(0,D.jsxs)(I,{children:[(0,D.jsx)(O,{children:"Sizes"}),(0,D.jsxs)(N,{children:[(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Height / Width"}),(0,D.jsx)(R,{children:"Select card, drag bottom right triangle."})]}),(0,D.jsxs)(P,{children:[(0,D.jsxs)(j,{children:[(0,D.jsx)(F,{})," Shift + / -"]}),(0,D.jsx)(M,{children:"Size of children"}),(0,D.jsxs)(R,{children:["Select parent card, then press Shift + drag triangle. Or click ",(0,D.jsx)(x.A,{fontSize:"small"})," to scale down. (see menu ",(0,D.jsx)(y.A,{fontSize:"small"})," to scale up)."]})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Size of children (continuous)"}),(0,D.jsxs)(R,{children:["Select parent card, then pres",(0,D.jsx)(F,{})," and drag triangle."]})]})]})]}),(0,D.jsxs)(I,{children:[(0,D.jsx)(O,{children:"Connections"}),(0,D.jsxs)(N,{children:[(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Draw new connection"}),(0,D.jsxs)(R,{children:["Select starting card, click ",(0,D.jsx)(A.A,{fontSize:"small"})," in toolbar, then click destination card."]})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Show connections"}),(0,D.jsx)(R,{children:"Select cards \u2013 All in- and outgoing connections are shown."})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Show all connections"}),(0,D.jsxs)(R,{children:["Siehe ",(0,D.jsx)(y.A,{fontSize:"small"})," Men\xfc"]})]})]})," "]}),(0,D.jsxs)(I,{children:[(0,D.jsx)(O,{children:"Maps"}),(0,D.jsxs)(N,{children:[" ",(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Create new map"}),(0,D.jsxs)(R,{children:["Im ",(0,D.jsx)(_.A,{fontSize:"small"})," Men\xfc."]})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Share / unshare map"}),(0,D.jsxs)(R,{children:["Im ",(0,D.jsx)(_.A,{fontSize:"small"})," Men\xfc."]})]}),(0,D.jsxs)(P,{children:[(0,D.jsx)(M,{children:"Delete map"}),(0,D.jsxs)(R,{children:["Im ",(0,D.jsx)(_.A,{fontSize:"small"})," Men\xfc."]})]})]})]})]})}))};var B=n(62613);const z=(0,a.A)({engine:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},engineContainer:{position:"relative",width:"100%",height:"100%",touchAction:"none",zIndex:0}}),U=()=>{const{mapId:e,nodeId:t}=(0,i.g)(),{search:n}=(0,i.zy)(),a=(0,r.useRef)(),{isLoading:d,root:h}=(0,l.A)(),f=(0,s.A)(),p=z(),g=(0,r.useRef)(),m=(0,B.A)(),v=(0,r.useMemo)(()=>new URLSearchParams(n),[n]),{renderNodes:y}=f;(0,r.useEffect)(()=>{const e=e=>(e.preventDefault(),!1),t=g.current;return t&&(t.addEventListener("DOMMouseScroll",e,!1),t.addEventListener("mousewheel",e,!1),t.addEventListener("wheel",e,!1),document.body.style.touchAction="none",document.body.style.overflow="hidden"),()=>{t.removeEventListener("DOMMouseScroll",e),t.removeEventListener("mousewheel",e),t.removeEventListener("wheel",e),setTimeout(()=>document.body.removeAttribute("style"),0)}},[]),(0,r.useEffect)(()=>{const e=a.current;return e?(f.mount(e),()=>f.unmount(e)):()=>{}},[f,e]);const[b,w]=(0,r.useState)(!1);(0,r.useEffect)(()=>{d||!Object.keys(y).length||b||(["x","y","s"].every(e=>v.has(e))||h&&m.goToNode(t||h),w(!0))},[d,m,t,h,e,v,y,b]);const A=(0,u.A)();return(0,r.useEffect)(()=>{const e=a.current,t=e=>{const{ctrlKey:t,metaKey:n,shiftKey:r,key:i}=e;r||n||t||"F1"!==i||(A(L),e.preventDefault(),e.stopPropagation())},n=e=>{e.ctrlKey&&e.preventDefault()};return window.addEventListener("keydown",t),window.addEventListener("wheel",n,{passive:!1}),e.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t),window.removeEventListener("wheel",n,{passive:!1}),e.removeEventListener("keydown",t)}},[A]),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",{ref:g,className:p.engineContainer,children:(0,D.jsx)("div",{className:p.engine,id:"infinityMap".concat(e),ref:a})}),(0,D.jsxs)(c.A,{open:d,children:[(0,D.jsx)(o.A,{id:"mapLoading"})," ..."]})]})}},3209(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(52226),i=n(53662),o=n(89692);class a{constructor(){this.packingData=void 0,this.packingData=new Map}reset(){this.packingData.clear()}async place(e){const t=a.calcIntPackingData(e),{intWidth:n,intHeight:r}=a.packAccordingToPackingData(t);t.totalWidth=n,t.totalHeight=r,this.packingData.set(e.id,t)}static calcIntPackingData(e){const t=[...e.childNodes].sort(i.E),n=t.length,r=Math.ceil(Math.sqrt(n)),a=new Array(r).fill(0),s=new Array(r).fill(0);for(let i=0;i!e.isLeaf())}}const s=a},3221(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631),i=r.__importDefault(n(23910)),o=r.__importDefault(n(52617)),a=r.__importDefault(n(39513)),s=n(19507),l=r.__importDefault(n(73203)),c=r.__importDefault(n(78131)),u=r.__importDefault(n(45324)),d=r.__importDefault(n(10453)),h=r.__importDefault(n(96322)),f=r.__importDefault(n(860)),p=r.__importDefault(n(53182)),g=r.__importDefault(n(45662)),m=r.__importDefault(n(13772)),v=r.__importDefault(n(905)),y=r.__importDefault(n(72234)),b=n(66018),w=n(57763),A=n(75998),_=function(e){function t(t,n,r,i){void 0===n&&(n=1/0),void 0===r&&(r=!1),void 0===i&&(i=!1);var o=e.call(this,f.default.of(t),v.default.create(),i)||this;return o.alreadyParsed=!1,o.parsedObjects=0,o.shouldWaitForTick=function(){return o.parsedObjects+=1,o.parsedObjects%o.objectsPerTick===0},o.objectsPerTick=n,o.throwOnInvalidObject=r,o}return r.__extends(t,e),t.prototype.parseDocument=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t;return r.__generator(this,function(n){switch(n.label){case 0:if(this.alreadyParsed)throw new s.ReparseError("PDFParser","parseDocument");this.alreadyParsed=!0,this.context.header=this.parseHeader(),n.label=1;case 1:return this.bytes.done()?[3,3]:[4,this.parseDocumentSection()];case 2:if(n.sent(),(t=this.bytes.offset())===e)throw new s.StalledParserError(this.bytes.position());return e=t,[3,1];case 3:return this.maybeRecoverRoot(),this.context.lookup(h.default.of(0))&&(console.warn("Removing parsed object: 0 0 R"),this.context.delete(h.default.of(0))),[2,this.context]}})})},t.prototype.maybeRecoverRoot=function(){var e=function(e){return e instanceof l.default&&e.lookup(u.default.of("Type"))===u.default.of("Catalog")};if(!e(this.context.lookup(this.context.trailerInfo.Root)))for(var t=this.context.enumerateIndirectObjects(),n=0,r=t.length;n=y.default.Space&&t<=y.default.Tilde&&(this.matchKeyword(b.Keywords.xref)||this.matchKeyword(b.Keywords.trailer)||this.matchKeyword(b.Keywords.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(e);break}this.bytes.next()}},t.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var e=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(e)}catch(t){this.bytes.next(),this.skipWhitespaceAndComments()}},t.forBytesWithOptions=function(e,n,r,i){return new t(e,n,r,i)},t}(p.default);t.default=_},3226(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631),i=n(7086),o=function(){function e(e,t,n){this.alreadyEmbedded=!1,this.ref=e,this.doc=t,this.embedder=n}return e.prototype.embed=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n,o,a,s,l;return r.__generator(this,function(r){switch(r.label){case 0:return this.alreadyEmbedded?[3,2]:(e=this.doc,t=e.catalog,n=e.context,[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]);case 1:o=r.sent(),t.has(i.PDFName.of("Names"))||t.set(i.PDFName.of("Names"),n.obj({})),(a=t.lookup(i.PDFName.of("Names"),i.PDFDict)).has(i.PDFName.of("JavaScript"))||a.set(i.PDFName.of("JavaScript"),n.obj({})),(s=a.lookup(i.PDFName.of("JavaScript"),i.PDFDict)).has(i.PDFName.of("Names"))||s.set(i.PDFName.of("Names"),n.obj([])),(l=s.lookup(i.PDFName.of("Names"),i.PDFArray)).push(i.PDFHexString.fromText(this.embedder.scriptName)),l.push(o),this.alreadyEmbedded=!0,r.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}();t.default=o},3334(e,t,n){"use strict";function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n(9950)),o=n(24261),a=n(30277);function s(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e,t){for(var n=0;nG,$k:()=>W,A:()=>B,A6:()=>E,BU:()=>f,C0:()=>b,CN:()=>R,CX:()=>H,Cv:()=>_,Df:()=>q,Ec:()=>I,Fl:()=>y,GC:()=>N,H1:()=>C,In:()=>h,Kj:()=>A,NV:()=>v,NX:()=>m,Q9:()=>z,RH:()=>g,SW:()=>s,Tr:()=>V,Wg:()=>l,Y8:()=>u,Yv:()=>w,aw:()=>x,bl:()=>K,bq:()=>S,cR:()=>F,cY:()=>O,dO:()=>c,fg:()=>d,fs:()=>U,iC:()=>P,i_:()=>M,jq:()=>k,mh:()=>L,vn:()=>p,xi:()=>D,yq:()=>j,zH:()=>T});var r=n(89379),i=n(15350),o=n(4424);const a={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=(e,t,n,i)=>{const o=n;o.type="string";const{minimum:s,maximum:l,format:c,patterns:u,contentEncoding:d}=e._zod.bag;var h;("number"===typeof s&&(o.minLength=s),"number"===typeof l&&(o.maxLength=l),c)&&(o.format=null!==(h=a[c])&&void 0!==h?h:c,""===o.format&&delete o.format,"time"===c&&delete o.format);if(d&&(o.contentEncoding=d),u&&u.size>0){const e=[...u];1===e.length?o.pattern=e[0].source:e.length>1&&(o.allOf=[...e.map(e=>(0,r.A)((0,r.A)({},"draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{}),{},{pattern:e.source}))])}},l=(e,t,n,r)=>{const i=n,{minimum:o,maximum:a,format:s,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;"string"===typeof s&&s.includes("int")?i.type="integer":i.type="number","number"===typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),"number"===typeof o&&(i.minimum=o,"number"===typeof u&&"draft-04"!==t.target&&(u>=o?delete i.minimum:delete i.exclusiveMinimum)),"number"===typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c),"number"===typeof a&&(i.maximum=a,"number"===typeof c&&"draft-04"!==t.target&&(c<=a?delete i.maximum:delete i.exclusiveMaximum)),"number"===typeof l&&(i.multipleOf=l)},c=(e,t,n,r)=>{n.type="boolean"},u=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")},d=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema")},h=(e,t,n,r)=>{"openapi-3.0"===t.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},f=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")},p=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Void cannot be represented in JSON Schema")},g=(e,t,n,r)=>{n.not={}},m=(e,t,n,r)=>{},v=(e,t,n,r)=>{},y=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")},b=(e,t,n,r)=>{const i=e._zod.def,a=(0,o.getEnumValues)(i.entries);a.every(e=>"number"===typeof e)&&(n.type="number"),a.every(e=>"string"===typeof e)&&(n.type="string"),n.enum=a},w=(e,t,n,r)=>{const i=e._zod.def,o=[];for(const a of i.values)if(void 0===a){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"===typeof a){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(0===o.length);else if(1===o.length){const e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"===typeof e)&&(n.type="number"),o.every(e=>"string"===typeof e)&&(n.type="string"),o.every(e=>"boolean"===typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o},A=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema")},_=(e,t,n,r)=>{const i=n,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},C=(e,t,n,r)=>{const i=n,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=e._zod.bag;void 0!==a&&(o.minLength=a),void 0!==s&&(o.maxLength=s),l?1===l.length?(o.contentMediaType=l[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=l.map(e=>({contentMediaType:e}))):Object.assign(i,o)},x=(e,t,n,r)=>{n.type="boolean"},E=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")},S=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")},D=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")},k=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Map cannot be represented in JSON Schema")},T=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw new Error("Set cannot be represented in JSON Schema")},O=(e,t,n,o)=>{const a=n,s=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;"number"===typeof l&&(a.minItems=l),"number"===typeof c&&(a.maxItems=c),a.type="array",a.items=(0,i.eh)(s.element,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,"items"]}))},I=(e,t,n,o)=>{var a;const s=n,l=e._zod.def;s.type="object",s.properties={};const c=l.shape;for(const h in c)s.properties[h]=(0,i.eh)(c[h],t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,"properties",h]}));const u=new Set(Object.keys(c)),d=new Set([...u].filter(e=>{const n=l.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));d.size>0&&(s.required=Array.from(d)),"never"===(null===(a=l.catchall)||void 0===a?void 0:a._zod.def.type)?s.additionalProperties=!1:l.catchall?l.catchall&&(s.additionalProperties=(0,i.eh)(l.catchall,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,"additionalProperties"]}))):"output"===t.io&&(s.additionalProperties=!1)},P=(e,t,n,o)=>{const a=e._zod.def,s=!1===a.inclusive,l=a.options.map((e,n)=>(0,i.eh)(e,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,s?"oneOf":"anyOf",n]})));s?n.oneOf=l:n.anyOf=l},M=(e,t,n,o)=>{const a=e._zod.def,s=(0,i.eh)(a.left,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,"allOf",0]})),l=(0,i.eh)(a.right,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,"allOf",1]})),c=e=>"allOf"in e&&1===Object.keys(e).length,u=[...c(s)?s.allOf:[s],...c(l)?l.allOf:[l]];n.allOf=u},R=(e,t,n,o)=>{const a=n,s=e._zod.def;a.type="array";const l="draft-2020-12"===t.target?"prefixItems":"items",c="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",u=s.items.map((e,n)=>(0,i.eh)(e,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,l,n]}))),d=s.rest?(0,i.eh)(s.rest,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,c,..."openapi-3.0"===t.target?[s.items.length]:[]]})):null;"draft-2020-12"===t.target?(a.prefixItems=u,d&&(a.items=d)):"openapi-3.0"===t.target?(a.items={anyOf:u},d&&a.items.anyOf.push(d),a.minItems=u.length,d||(a.maxItems=u.length)):(a.items=u,d&&(a.additionalItems=d));const{minimum:h,maximum:f}=e._zod.bag;"number"===typeof h&&(a.minItems=h),"number"===typeof f&&(a.maxItems=f)},N=(e,t,n,o)=>{const a=n,s=e._zod.def;a.type="object";const l=s.keyType,c=l._zod.bag,u=null===c||void 0===c?void 0:c.patterns;if("loose"===s.mode&&u&&u.size>0){const e=(0,i.eh)(s.valueType,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,"patternProperties","*"]}));a.patternProperties={};for(const t of u)a.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(a.propertyNames=(0,i.eh)(s.keyType,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,"propertyNames"]}))),a.additionalProperties=(0,i.eh)(s.valueType,t,(0,r.A)((0,r.A)({},o),{},{path:[...o.path,"additionalProperties"]}));const d=l._zod.values;if(d){const e=[...d].filter(e=>"string"===typeof e||"number"===typeof e);e.length>0&&(a.required=e)}},j=(e,t,n,r)=>{const o=e._zod.def,a=(0,i.eh)(o.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},F=(e,t,n,r)=>{const o=e._zod.def;(0,i.eh)(o.innerType,t,r);t.seen.get(e).ref=o.innerType},L=(e,t,n,r)=>{const o=e._zod.def;(0,i.eh)(o.innerType,t,r);t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},B=(e,t,n,r)=>{const o=e._zod.def;(0,i.eh)(o.innerType,t,r);t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},z=(e,t,n,r)=>{const o=e._zod.def;(0,i.eh)(o.innerType,t,r);let a;t.seen.get(e).ref=o.innerType;try{a=o.catchValue(void 0)}catch(s){throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},U=(e,t,n,r)=>{const o=e._zod.def,a="input"===t.io?"transform"===o.in._zod.def.type?o.out:o.in:o.out;(0,i.eh)(a,t,r);t.seen.get(e).ref=a},G=(e,t,n,r)=>{const o=e._zod.def;(0,i.eh)(o.innerType,t,r);t.seen.get(e).ref=o.innerType,n.readOnly=!0},H=(e,t,n,r)=>{const o=e._zod.def;(0,i.eh)(o.innerType,t,r);t.seen.get(e).ref=o.innerType},W=(e,t,n,r)=>{const o=e._zod.def;(0,i.eh)(o.innerType,t,r);t.seen.get(e).ref=o.innerType},V=(e,t,n,r)=>{const o=e._zod.innerType;(0,i.eh)(o,t,r);t.seen.get(e).ref=o},q={string:s,number:l,boolean:c,bigint:u,symbol:d,null:h,undefined:f,void:p,never:g,any:m,unknown:v,date:y,enum:b,literal:w,nan:A,template_literal:_,file:C,success:x,custom:E,function:S,transform:D,map:k,set:T,array:O,object:I,union:P,intersection:M,tuple:R,record:N,nullable:j,nonoptional:F,default:L,prefault:B,catch:z,pipe:U,readonly:G,promise:H,optional:W,lazy:V};function K(e,t){if("_idmap"in e){const n=e,o=(0,i.az)((0,r.A)((0,r.A)({},t),{},{processors:q})),a={};for(const e of n._idmap.entries()){const[t,n]=e;(0,i.eh)(n,o)}const s={},l={registry:n,uri:null===t||void 0===t?void 0:t.uri,defs:a};o.external=l;for(const e of n._idmap.entries()){const[t,n]=e;(0,i.Wb)(o,n),s[t]=(0,i.jE)(o,n)}if(Object.keys(a).length>0){const e="draft-2020-12"===o.target?"$defs":"definitions";s.__shared={[e]:a}}return{schemas:s}}const n=(0,i.az)((0,r.A)((0,r.A)({},t),{},{processors:q}));return(0,i.eh)(e,n),(0,i.Wb)(n,e),(0,i.jE)(n,e)}},3513(e,t,n){"use strict";const r=n(38889);e.exports=(e,t)=>new r(e,t).major},3526(e,t,n){"use strict";n.d(t,{A:()=>r});const r=class{constructor(e){this.manager=void 0,this.manager=e}}},3546(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(58168),i=n(80045),o=n(9950),a=n(2803),s=n(33720),l=o.forwardRef(function(e,t){var n=e.classes,s=e.className,l=(0,i.A)(e,["classes","className"]);return o.createElement("div",(0,r.A)({className:(0,a.default)(n.root,s),ref:t},l))});l.muiName="ListItemSecondaryAction";const c=(0,s.A)({root:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"}},{name:"MuiListItemSecondaryAction"})(l)},3582(e,t,n){"use strict";n.d(t,{A:()=>c});var r=n(89379),i=(n(9950),n(45486)),o=n(16159),a=n(70035),s=n(82831),l=n(44414);const c=e=>(0,l.jsxs)(i.A,(0,r.A)((0,r.A)({},e),{},{children:[(0,l.jsx)(o.A,{}),(0,l.jsx)(a.A,{}),(0,l.jsx)(s.A,{})]}))},3655(e){"use strict";e.exports=function(e){e._internalDrag=!0,e.setMode("drag")}},3745(e,t,n){"use strict";n.d(t,{x:()=>u,l:()=>d});var r=n(67158),i=n(18877),o=n(54914),a=n(96598);const s="\n\n# Empty Map \u2014 Intent Detection Mode\nThe map has no content yet. Your job:\n1. IMMEDIATELY call list_templates to discover available forms and visualization structures.\n2. Greet the user warmly. Introduce your two capabilities:\n (a) Fill a form \u2014 structured data collection, question by question.\n If list_templates returned form-style templates, name 2\u20133 examples.\n (b) Visualize a topic \u2014 map out ideas, concepts, or plans as a visual mind-map.\n IMPORTANT: always tell the user that visualization builds in the background\n and they can view the full result by opening the map link on a PC.\n If list_templates returned visualization structures, mention 1\u20132 examples.\n Free-form visualization (their own topic) is always available too.\n3. Listen for the user's choice:\n - Form intent: match to a template name, then call load_template.\n - Visualization with a structure: match to a template name, then call load_template.\n - Free-form visualization: call switch_mode with mode \"template\", then proceed.\n4. Do NOT fill or visualize anything until you know the user's intent.\n5. If the intent is ambiguous, ask one clarifying question using the two options above.",l="\n\n# Empty Map \u2014 Intent Detection Mode\nThe map has no content yet.\n1. Answer the latest turn first. Greetings, acknowledgements, and capability questions never start a catalogue search.\n2. Offer filling a form, all at once or question by question, or visualizing a topic. Say visualization builds in the background and opens from the map link on a PC.\n3. When the person describes the kind of form or template they need, call search_templates with that description. Never use load_template or fill_template to resolve a category, descriptor, misspelling or cross-script name; load only through the id of a record returned by search_templates or list_templates and chosen by the person or selected decisively by the search. When they explicitly ask to see or enumerate templates, call list_templates before speaking names, even when the session brief already supplies the first page. The brief is for resolving a choice by position, not for replacing an explicit enumeration. Speak at most the returned names, then ask which one. Never speak ids, counts, page mechanics, or other attributes.\n4. A choice by position (\"the first template on the list\") refers to that position in the session brief's first-page order; call load_template with that record's id and do not call list_templates first. Free-form visualization uses switch_mode.\n5. Act only after intent is known. A name, a short noun phrase, or a record the person asks to open is a catalogue descriptor: search it before asking which capability they want. Ask one question with the two options only when their words name no catalogue record.",c=(e,t)=>(0,o.I)(e)+(e=>e===a.Of?l:s)(t),u=e=>"# Active Mode\nYou are in ".concat(e," mode.\n\n"),d=e=>{const t=u(e.mode);return"form"===e.mode?t+(e=>{var t,n,r,o;const{enableDesktopTools:a,mapState:s,fillGuidance:l,lastTemplateName:u,mapOutline:d,voiceEngine:h}=e,f=null===(t=s.nodes)||void 0===t?void 0:t[null!==(n=s.root)&&void 0!==n?n:""],p=(null!==(r=null===f||void 0===f||null===(o=f.children)||void 0===o?void 0:o.length)&&void 0!==r?r:0)>0;return f&&p?(0,i.i)({enableDesktopTools:a,mapNodes:s.nodes,mapRootId:s.root,fillGuidance:l,lastTemplateName:u,mapOutline:d}):c(a,h)})(e):t+(e=>{const{enableDesktopTools:t,lastTemplateName:n,mapOutline:i,mapTitle:o}=e;return(0,r.K7)({enableDesktopTools:t,lastTemplateName:n,mapOutline:i,mapTitle:o})})(e)}},3838(e,t,n){var r=n(51804),i=n(14871),o=n(41956)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||void 0==(n=r(a)[o])?t:i(n)}},3942(e,t,n){"use strict";var r=n(69476);e.exports=function(e){var t=e.getSelection();return t.isCollapsed()?null:r(e.getCurrentContent(),t)}},3945(e,t,n){"use strict";n.r(t),n.d(t,{BaseTextureCache:()=>U,CanvasRenderTarget:()=>W,DATA_URI:()=>K,EventEmitter:()=>o.a,ProgramCache:()=>B,TextureCache:()=>z,clearTextureCache:()=>H,correctBlendMode:()=>_,createIndicesForQuads:()=>S,decomposeDataUri:()=>Y,deprecation:()=>L,destroyTextureCache:()=>G,determineCrossOrigin:()=>X,earcut:()=>s.a,getBufferType:()=>D,getResolutionOfUrl:()=>Q,hex2rgb:()=>v,hex2string:()=>y,interleaveTypedArrays:()=>T,isMobile:()=>r.F,isPow2:()=>I,isWebGLSupported:()=>g,log2:()=>P,nextPow2:()=>O,premultiplyBlendMode:()=>A,premultiplyRgba:()=>C,premultiplyTint:()=>x,premultiplyTintToRgba:()=>E,removeItems:()=>M,rgb2hex:()=>w,sayHello:()=>p,sign:()=>R,skipHello:()=>f,string2hex:()=>b,trimCanvas:()=>V,uid:()=>j,url:()=>u});var r=n(34012),i=n(93830),o=n.n(i),a=n(51232),s=n.n(a),l=n(90625),c=n(65689),u={parse:l.qg,format:l.GP,resolve:l.hd};r.W.RETINA_PREFIX=/@([0-9\.]+)x/,r.W.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var d,h=!1;function f(){h=!0}function p(e){var t;if(!h){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var n=["\n %c %c %c PixiJS 6.4.2 - \u2730 "+e+" \u2730 %c %c http://www.pixijs.com/ %c %c \u2665%c\u2665%c\u2665 \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];(t=globalThis.console).log.apply(t,n)}else globalThis.console&&globalThis.console.log("PixiJS 6.4.2 - "+e+" - http://www.pixijs.com/");h=!0}}function g(){return"undefined"===typeof d&&(d=function(){var e={stencil:!0,failIfMajorPerformanceCaveat:r.W.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!globalThis.WebGLRenderingContext)return!1;var t=document.createElement("canvas"),n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),i=!(!n||!n.getContextAttributes().stencil);if(n){var o=n.getExtension("WEBGL_lose_context");o&&o.loseContext()}return n=null,i}catch(a){return!1}}()),d}var m={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function v(e,t){return void 0===t&&(t=[]),t[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t}function y(e){var t=e.toString(16);return"#"+(t="000000".substring(0,6-t.length)+t)}function b(e){return"string"===typeof e&&"#"===(e=m[e.toLowerCase()]||e)[0]&&(e=e.slice(1)),parseInt(e,16)}function w(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)}var A=function(){for(var e=[],t=[],n=0;n<32;n++)e[n]=n,t[n]=n;e[c.B9.NORMAL_NPM]=c.B9.NORMAL,e[c.B9.ADD_NPM]=c.B9.ADD,e[c.B9.SCREEN_NPM]=c.B9.SCREEN,t[c.B9.NORMAL]=c.B9.NORMAL_NPM,t[c.B9.ADD]=c.B9.ADD_NPM,t[c.B9.SCREEN]=c.B9.SCREEN_NPM;var r=[];return r.push(t),r.push(e),r}();function _(e,t){return A[t?1:0][e]}function C(e,t,n,r){return n=n||new Float32Array(4),r||void 0===r?(n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t):(n[0]=e[0],n[1]=e[1],n[2]=e[2]),n[3]=t,n}function x(e,t){if(1===t)return(255*t<<24)+e;if(0===t)return 0;var n=e>>16&255,r=e>>8&255,i=255&e;return(255*t<<24)+((n=n*t+.5|0)<<16)+((r=r*t+.5|0)<<8)+(i=i*t+.5|0)}function E(e,t,n,r){return(n=n||new Float32Array(4))[0]=(e>>16&255)/255,n[1]=(e>>8&255)/255,n[2]=(255&e)/255,(r||void 0===r)&&(n[0]*=t,n[1]*=t,n[2]*=t),n[3]=t,n}function S(e,t){void 0===t&&(t=null);var n=6*e;if((t=t||new Uint16Array(n)).length!==n)throw new Error("Out buffer length is incorrect, got "+t.length+" and expected "+n);for(var r=0,i=0;r>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1}function I(e){return!(e&e-1)&&!!e}function P(e){var t=(e>65535?1:0)<<4,n=((e>>>=t)>255?1:0)<<3;return t|=n,t|=n=((e>>>=n)>15?1:0)<<2,(t|=n=((e>>>=n)>3?1:0)<<1)|(e>>>=n)>>1}function M(e,t,n){var r,i=e.length;if(!(t>=i||0===n)){var o=i-(n=t+n>i?i-t:n);for(r=t;ri});var r=n(89379);class i{constructor(e){this.staticThis=e,this.rules=void 0,this.text="",this.gridOptions=void 0,this.rules=this.staticThis.getRulesTable()}static lex(e){e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n").replace(/^ +$/gm,"");return new this(this).getTokens(e)}static getRulesBase(){if(this.rulesBase)return this.rulesBase;return this.rulesBase={newline:/^\n+/,text:/^[^\n]+/}}static getRulesTable(){return this.rulesTables?this.rulesTables:this.rulesTables=(0,r.A)((0,r.A)({},this.getRulesBase()),{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/})}getTokens(e){let t,n=e;for(;n;){if((t=this.rules.newline.exec(n))&&(n=n.substring(t[0].length),this.text+=t[0]),t=this.rules.nptable.exec(n)){n=n.substring(t[0].length);const e={columnDefs:t[1].replace(/^ *| *\| *$/g,"").split(/ *\| */).map(e=>({field:e})),rowData:[]},r=t[3].replace(/\n$/,"").split("\n");if(e.columnDefs&&e.rowData)for(let t=0;t[e.field,n[t]])))}this.gridOptions=e}if(t=this.rules.table.exec(n)){n=n.substring(t[0].length);const e={columnDefs:t[1].replace(/^ *| *\| *$/g,"").split(/ *\| */).map(e=>({field:e})),rowData:[]},r=t[3].replace(/(?: *\| *)?\n$/,"").split("\n");if(e.columnDefs&&e.rowData)for(let t=0;t[e.field,n[t]])))}this.gridOptions=e}if(t=this.rules.text.exec(n))n=n.substring(t[0].length),this.text+=t[0];else if(n)throw new Error("Infinite loop on byte: ".concat(n.charCodeAt(0),", near text '").concat(n.slice(0,30),"...'"))}return{text:this.text,gridOptions:this.gridOptions}}}i.rulesBase=void 0,i.rulesTables=void 0},4111(e,t,n){"use strict";n.d(t,{A:()=>v});n(9950);var r=n(29206),i=n(81788),o=n(68168),a=n(63027),s=n(67243),l=n.n(s),c=n(41355),u=n(95700),d=n(44414);const h=(0,u.A)((0,d.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,d.jsx)("path",{d:"M9 18.5L17 3M9 18.5C9 19.8807 7.88071 21 6.5 21C5.11929 21 4 19.8807 4 18.5C4 17.1193 5.11929 16 6.5 16C7.88071 16 9 17.1193 9 18.5ZM15 18.5L7 3M15 18.5C15 19.8807 16.1193 21 17.5 21C18.8807 21 20 19.8807 20 18.5C20 17.1193 18.8807 16 17.5 16C16.1193 16 15 17.1193 15 18.5Z",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}));var f=n(67208),p=n(94232),g=n(69298),m=n(62613);const v=e=>{let{handleClose:t}=e;const n=(0,c.A)(),{lastSelectedNode:s,selectedNodes:u}=n,v=(0,m.A)();return(0,d.jsxs)(r.A,{button:!0,onClick:()=>{const e=[...u].pop();if(!e)return;const r=[...e.parentNode.childNodes].filter(e=>e.state.isSelected),i=(0,f.Zt)(r.flatMap(e=>(0,p.Ay)(e,!0)).join("\n"),n.engine.renderNodes),o=JSON.stringify(r.map(e=>v.copyNode(e)));l()(i,{format:"text/plain"}),l()(o,{format:"application/json"}),n.addDispatch(r.map(e=>(0,g.TF)(e))),t&&t()},disabled:!s||s.isRoot,children:[(0,d.jsx)(o.A,{children:(0,d.jsx)(h,{})}),(0,d.jsx)(i.A,{children:(0,d.jsx)(a.A,{id:"editMenu.cut"})})]})}},4132(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631),i=r.__importDefault(n(52617)),o=r.__importDefault(n(39513)),a=r.__importDefault(n(78131)),s=r.__importDefault(n(45324)),l=r.__importDefault(n(92286)),c=r.__importDefault(n(96322)),u=r.__importDefault(n(70259)),d=r.__importDefault(n(70346)),h=r.__importDefault(n(76648)),f=r.__importDefault(n(15244)),p=n(75998),g=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.encodeStreams=r,o.objectsPerStream=i,o}return r.__extends(t,e),t.prototype.computeBufferSize=function(){return r.__awaiter(this,void 0,void 0,function(){var e,t,n,f,g,m,v,y,b,w,A,_,C,x,E,S,D,k,T;return r.__generator(this,function(r){switch(r.label){case 0:e=this.context.largestObjectNumber+1,t=i.default.forVersion(1,7),n=t.sizeInBytes()+2,f=d.default.create(this.createTrailerDict(),this.encodeStreams),g=[],m=[],v=[],y=this.context.enumerateIndirectObjects(),_=0,C=y.length,r.label=1;case 1:return _t)throw new u.ExceededMaxLengthError(e.length,t,this.getName());this.markAsDirty(),this.disableRichFormatting(),e?this.acroField.setValue(f.PDFHexString.fromText(e)):this.acroField.removeValue()},t.prototype.getAlignment=function(){var e=this.acroField.getQuadding();return 0===e?h.TextAlignment.Left:1===e?h.TextAlignment.Center:2===e?h.TextAlignment.Right:h.TextAlignment.Left},t.prototype.setAlignment=function(e){p.assertIsOneOf(e,"alignment",h.TextAlignment),this.markAsDirty(),this.acroField.setQuadding(e)},t.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},t.prototype.setMaxLength=function(e){if(p.assertRangeOrUndefined(e,"maxLength",0,Number.MAX_SAFE_INTEGER),this.markAsDirty(),void 0===e)this.acroField.removeMaxLength();else{var t=this.getText();if(t&&t.length>e)throw new u.InvalidMaxLengthError(t.length,e,this.getName());this.acroField.setMaxLength(e)}},t.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},t.prototype.setImage=function(e){for(var t=this.getAlignment(),n=t===h.TextAlignment.Center?d.ImageAlignment.Center:t===h.TextAlignment.Right?d.ImageAlignment.Right:d.ImageAlignment.Left,r=this.acroField.getWidgets(),i=0,o=r.length;ig(t)&&i.logSelectionStateFailure({anonymizedDom:p(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(r.toJS())});var l=t===e.focusNode;try{e.rangeCount>0&&e.extend&&e.extend(t,n)}catch(u){throw i.logSelectionStateFailure({anonymizedDom:p(t,function(t){var n=[];return t===o&&n.push("active element"),t===e.anchorNode&&n.push("selection anchor node"),t===e.focusNode&&n.push("selection focus node"),n}),extraParams:JSON.stringify({activeElementName:o?o.nodeName:null,nodeIsFocus:t===e.focusNode,nodeWasFocus:l,selectionRangeCount:e.rangeCount,selectionAnchorNodeName:e.anchorNode?e.anchorNode.nodeName:null,selectionAnchorOffset:e.anchorOffset,selectionFocusNodeName:e.focusNode?e.focusNode.nodeName:null,selectionFocusOffset:e.focusOffset,message:u?""+u:null,offset:n},null,2),selectionState:JSON.stringify(r.toJS(),null,2)}),u}}else if(t&&e.rangeCount>0){var c=e.getRangeAt(0);c.setEnd(t,n),e.addRange(c.cloneRange())}}function v(e,t,n,o){var a=l(t).createRange();if(n>g(t)&&(i.logSelectionStateFailure({anonymizedDom:p(t),extraParams:JSON.stringify({offset:n}),selectionState:JSON.stringify(o.toJS())}),r.handleExtensionCausedError()),a.setStart(t,n),d)try{e.addRange(a)}catch(s){0}else e.addRange(a)}e.exports={setDraftEditorSelection:function(e,t,n,r,i){var o=l(t);if(a(o.documentElement,t)){var s=o.defaultView.getSelection(),c=e.getAnchorKey(),u=e.getAnchorOffset(),d=e.getFocusKey(),h=e.getFocusOffset(),f=e.getIsBackward();if(!s.extend&&f){var p=c,g=u;c=d,u=h,d=p,h=g,f=!1}var y=c===n&&r<=u&&i>=u,b=d===n&&r<=h&&i>=h;if(y&&b)return s.removeAllRanges(),v(s,t,u-r,e),void m(s,t,h-r,e);if(f){if(b&&(s.removeAllRanges(),v(s,t,h-r,e)),y){var w=s.focusNode,A=s.focusOffset;s.removeAllRanges(),v(s,t,u-r,e),m(s,w,A,e)}}else y&&(s.removeAllRanges(),v(s,t,u-r,e)),b&&m(s,t,h-r,e)}},addFocusToSelection:m}},4255(e,t,n){"use strict";var r=n(68369);e.exports=function e(t,n){return!(!t||!n)&&(t===n||!r(t)&&(r(n)?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}},4268(e,t,n){"use strict";n.d(t,{A:()=>h});var r=n(9950),i=n(29206),o=n(68168),a=n(81788),s=n(1203),l=n(53542),c=n(44414);const u=e=>{let{folder:t,isSelected:n,onSelect:r,depth:u=0,disabled:d=!1}=e;const h=16+24*u;return(0,c.jsxs)(i.A,{button:!0,onClick:e=>{e.stopPropagation(),d||r(t.folderId)},style:{paddingLeft:h},disabled:d,children:[(0,c.jsx)(o.A,{children:(0,c.jsx)(s.A,{checked:n,disabled:d})}),(0,c.jsx)(o.A,{children:(0,c.jsx)(l.A,{})}),(0,c.jsx)(a.A,{primary:t.name,secondary:t.path})]})},d=e=>{let{folders:t,selectedFolderId:n,onSelect:i,depth:o=0,filterFn:a=()=>!0}=e;return t.filter(a).map(e=>(0,c.jsxs)(r.Fragment,{children:[(0,c.jsx)(u,{folder:e,isSelected:n===e.folderId,onSelect:i,depth:o}),e.children&&e.children.length>0&&(0,c.jsx)(d,{folders:e.children,selectedFolderId:n,onSelect:i,depth:o+1,filterFn:a})]},e.folderId))},h=d},4281(e,t,n){"use strict";n.d(t,{zM:()=>c});var r="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var o=i(function(e,t){(function(){var t;(function(t){e.exports=t})(t={linear:function(e,t,n,r){return n*e/r+t},easeInQuad:function(e,t,n,r){return n*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){return n*(e/=r)*e*e+t},easeOutCubic:function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,r){return n*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,r){return n*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t},easeOutSine:function(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,n,r){return 0===e?t:n*Math.pow(2,10*(e/r-1))+t},easeOutExpo:function(e,t,n,r){return e===r?t+n:n*(1-Math.pow(2,-10*e/r))+t},easeInOutExpo:function(e,t,n,r){return(e/=r/2)<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,n,r){return(e/=r/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,n,r){var i,o,a;return a=1.70158,0===e||(e/=r),(o=0)||(o=.3*r),(i=n)this.updateCoord(e,l,"x");break;case"scaleY":case"skewY":l=t.substr(0,t.length-1),r=e[l].y,i=n,o=n-r,a=e=>this.updateCoord(e,l,"y");break;case"tint":case"blend":const c=Array.isArray(n)?n:[e.tint,n];r=0,i=c.length,o=i,a="tint"===t?e=>this.updateTint(e,c):e=>this.updateBlend(e,c);break;case"shake":r={x:e.x,y:e.y},i=n,a=e=>this.updateShake(e);break;case"position":r={x:e.x,y:e.y},i={x:n.x,y:n.y},o={x:i.x-r.x,y:i.y-r.y},a=e=>this.updatePosition(e);break;case"skew":case"scale":r=e[t].x,i=n,o=n-r,a=e=>this.updatePoint(e,t);break;case"face":r=e.rotation,i=s.shortestAngle(r,Math.atan2(n.y-e.y,n.x-e.x)),o=i-r,a=e=>this.updateOne(e,"rotation");break;default:r=e[t],i=n,o=n-r,a=e=>this.updateOne(e,t)}this.eases.push({element:e,entry:t,update:a,start:r,to:i,delta:o})}static shortestAngle(e,t){const n=2*Math.PI;let r=Math.abs(e-t)%n;r=r>Math.PI?n-r:r;var i;return r*(((t-e+Math.PI)%(i=n)+i)%i-Math.PI>0?1:-1)}remove(e,t){if(0===arguments.length)this.eases=[];else{"string"===typeof t&&(t=[t]);for(let n=0;n>16)+o*(s>>16),u=l*(a>>8&255)+o*(s>>8&255),d=l*(255&a)+o*(255&s);e.element.tint=c<<16|u<<8|d}updateShake(e){function t(e){return Math.floor(Math.random()*e)-Math.floor(e/2)}e.element.x=e.start.x+t(e.to),e.element.y=e.start.y+t(e.to)}complete(e){"shake"===e.entry&&(e.element.x=e.start.x,e.element.y=e.start.y)}reverse(e){if("position"===e.entry){const t=e.to.x,n=e.to.y;e.to.x=e.start.x,e.to.y=e.start.y,e.start.x=t,e.start.y=n,e.delta.x=-e.delta.x,e.delta.y=-e.delta.y}else{const t=e.to;e.to=e.start,e.start=t,e.delta=-e.delta}}repeat(e){switch(e.entry){case"skewX":e.element.skew.x=e.start;break;case"skewY":e.element.skew.y=e.start;break;case"skew":e.element.skew.x=e.start,e.element.skew.y=e.start;break;case"scaleX":e.element.scale.x=e.start;break;case"scaleY":e.element.scale.y=e.start;break;case"scale":e.element.scale.x=e.start,e.element.scale.y=e.start;break;case"position":e.element.x=e.start.x,e.element.y=e.start.y;break;default:e.element[e.entry]=e.start}}update(e){if(0===this.eases.length)return!0;if(this.options.wait){if(this.options.wait-=e,this.options.wait>0)return void this.emit("wait",this);e=-this.options.wait,this.options.wait=0,this.emit("wait-end",this)}this.time+=e;let t=0;this.time>=this.options.duration&&(t=this.time-this.options.duration,this.time=this.options.duration);for(let n=0;n=this.options.duration)if(this.options.reverse)this.eases.forEach(e=>this.reverse(e)),this.time=t,t&&this.eases.forEach(e=>e.update(e)),this.emit("reverse",this),this.options.repeat?!0!==this.options.repeat&&this.options.repeat--:this.options.reverse=!1;else{if(!this.options.repeat)return this.eases.forEach(e=>this.complete(e)),this.emit("complete",this),!0;this.eases.forEach(e=>this.repeat(e)),this.time=t,t&&this.eases.forEach(e=>e.update(e)),!0!==this.options.repeat&&this.options.repeat--,this.emit("repeat",this)}}get count(){return this.eases.length}}const l={duration:1e3,ease:o.easeInOutSine,maxFrame:1e3/60,ticker:null,useRAF:!0};class c extends a{constructor(e){super(),this.options=Object.assign({},l,e),this.easings=[],this.empty=!0,this.options.ticker&&this.options.ticker.add(this.update,this)}destroy(){this.removeAll(),this.options.useTicker?this.ticker.remove(this.update,this):this.options.useRAF&&(cancelAnimationFrame(this.handleRAF),this.handleRAF=null)}add(e,t,n){(n=n||{}).duration="undefined"!==typeof n.duration?n.duration:this.options.duration,n.ease=n.ease||this.options.ease,"string"===typeof n.ease&&(n.ease=o[n.ease]);const r=new s(e,t,n);return this.easings.push(r),this.empty&&this.options.useRAF&&(this.handleRAF=requestAnimationFrame(()=>this.update()),this.lastTime=Date.now()),this.empty=!1,r}target(e,t,n,r){const i=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))/n;return(r=r||{}).duration=i,this.add(e,{x:t.x,y:t.y},r)}face(e,t,n,r){const i=s.shortestAngle(e.rotation,Math.atan2(t.y-e.y,t.x-e.x)),o=Math.abs(i-e.rotation)/n;return(r=r||{}).duration=o,this.add(e,{rotation:i},r)}removeEase(e,t){for(let n=0;nthis.update()):this.handleRAF=null}get count(){return this.easings.length}countRunning(){let e=0;for(let t of this.easings)e+=t.count;return e}set duration(e){this.options.duration=e}get duration(){return this.options.duration}set ease(e){this.options.ease=e}get ease(){return this.options.ease}}c.id=0;let u=new c;c.ease=u},4287(e,t,n){"use strict";n.d(t,{A:()=>lt});var r={};n.r(r),n.d(r,{DragIconWrapper:()=>ze,EdgeAddClick:()=>p,EdgeAddHover:()=>v,EdgeEdit:()=>b,EdgeSelect:()=>A,EdgeZoomTo:()=>C,GhostExpand:()=>E,GhostHighlight:()=>D,GhostMaterialize:()=>R,NodeAddClick:()=>B,NodeAddHover:()=>G,NodeAddResize:()=>q,NodeCheckBoxToggle:()=>Pe,NodeCommentsInboxClick:()=>Y,NodeDecollapse:()=>Q,NodeDownloadFile:()=>$,NodeEditEnd:()=>re,NodeEditHover:()=>oe,NodeEditSelectAll:()=>ne,NodeExpandOrCollapse:()=>Fe,NodeFollowUrl:()=>se,NodeMove:()=>pe,NodeMoveWheel:()=>Ne,NodeResize:()=>be,NodeScaleWheel:()=>_e,NodeSelect:()=>xe,NodeSelectionFrame:()=>Be,NodeTextClick:()=>Se,NodeTextHover:()=>ke,NodeZoomTo:()=>Oe,ResizeIconWrapper:()=>Ue});var i,o=n(60093),a=n(10255),s=n.n(a),l=n(3526);!function(e){e.click="atClick",e.hover="atHover",e.drag="atDrag",e.wheel="atWheel"}(i||(i={}));const c=i;const u=class{getCursor(){return this.cursor}constructor(e){this.isWrapper=!1,this.type=void 0,this.category=void 0,this.manager=void 0,this.cursor=null,this.state=null,this.isChanging=void 0,this.reset=()=>{this.state=null},this.manager=e}};const d=class extends u{constructor(){super(...arguments),this.type=c.click,this.move=()=>{},this.wheel=()=>{}}};var h=n(56976);const f=s()("app:Event:EdgeAddClick");class p extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.state=null,this.down=e=>{const{manager:t}=this,{node:n}=e.target||{};n&&(f("down",n),t.getAddEdges(n),this.state={node:n})},this.up=()=>{const{manager:e,state:t}=this;if(!t)return;const{node:n}=t;if(!n)return;f("up",n);const r=e.getAddEdges(n);e.saveAddEdges(),Array.from(e.selectedNodes).forEach(t=>e.unselectNode(t)),r.forEach(t=>e.selectEdge(t))}}}const g=class extends u{constructor(){super(...arguments),this.type=c.hover,this.up=()=>{},this.down=()=>{},this.wheel=()=>{}}},m=s()("app:Event:EdgeAddHover").extend("FLOOD","::");class v extends g{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.move=e=>{const{manager:t}=this,{node:n}=e.target;n&&(m("move",n),t.getAddEdges(n))},this.reset=()=>{const{manager:e}=this;m("reset"),e.deleteAddEdges()}}}const y=s()("app:Event:EdgeEdit");class b extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.edge,this.down=e=>{const{edge:t}=e.target||{};t&&(y("down",t),this.state={edge:t})},this.up=e=>{const{edge:t}=e.target||{};if(!t)return;y("up",t);const{textField:n}=t,{isSelected:r}=t.state;!n&&r&&t.openTextField(t.title,"selectAll")}}}const w=s()("app:Event:NodeSelect");class A extends d{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.edge,this.cursor="pointer",this.down=e=>{const{edge:t}=e.target||{};t&&(w("down",t),this.state={edge:t})},this.up=e=>{const{manager:t,reset:n}=this,{edge:r}=e.target||{},{control:i}=e;if(!r)return;w("up",r);const{isSelected:o}=r.state;w("select edge",{edge:r,control:i,isSelected:o}),i?o?t.unselectEdge(r):t.selectEdge(r):t.selectSingleEdge(r),n()}}}const _=s()("app:Event:EdgeZoomTo");class C extends d{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.edge,this.down=e=>{const{edge:t}=e.target||{};t&&(_("down",t),this.state={edge:t})},this.up=e=>{const{manager:t}=this,{edge:n}=e.target||{};n&&(_("up",n),t.zoomToEdge(n))}}}const x=s()("app:Event:GhostExpand");class E extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.ghost,this.cursor="pointer",this.down=e=>{const{node:t}=e.target||{};t&&(x("down",t),this.state={node:t})},this.up=e=>{const{manager:t}=this,{node:n}=e.target||{},{node:r}=this.state||{};n&&n===r&&(x("up",n),t.createChildAndSelect(n))}}}var S=n(52226);class D extends g{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.ghost,this.move=e=>{const{highlightedGhost:t}=this.state||{},n=e.target;t&&n!==t&&(this.unhighlight(t),this.state=null),n&&n!==t&&(this.highlight(n),this.state={highlightedGhost:n})},this.reset=()=>{const{unhighlight:e}=this,{highlightedGhost:t}=this.state||{};t&&(e(t),this.state=null)}}highlight(e){e.alpha=1}unhighlight(e){const{alpha:t,alphaFirst:n}=S.A.nodes.ghost;e.alpha=e.firstGhost?n:t}}var k=n(89379),T=n(15811),O=n(69298),I=n(9345);const P=s()("app:Event:GhostMaterialize"),M=P.extend("ERROR*","::");class R extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.ghost,this.cursor="pointer",this.down=e=>{const{candidate:t,node:n}=e.target||{};t&&(this.addNodeIfTemporary(n),P("down",t),this.state={candidate:t})},this.up=e=>{const{manager:t}=this,{candidate:n,node:r}=e.target||{},{candidate:i}=this.state||{};if(!n||!this.sameCandidate(i,n))return;P("up",n);const o=(0,T.r8)();(async()=>{try{await t.createNode((0,k.A)((0,k.A)({},n),{},{borderColor:null===r||void 0===r?void 0:r.borderColor,id:o})),await t.selectSingleNode(o),await t.nodeEdit(o,"","end")}catch(e){M("Could not materialize ghost: ".concat(e.message))}})().then()},this.sameCandidate=(e,t)=>{if(!e||!t)return!1;const n=(e,t)=>!e&&!t||!(!e||!t)&&(0,I.be)(e-t);return n(e.x,t.x)&&n(e.y,t.y)&&n(e.height,t.height)&&n(e.width,t.width)&&e.parent===t.parent},this.addNodeIfTemporary=e=>{if(!e||!e.state.isTemporary)return;const{manager:t}=this;e.state.isTemporary=!1,t.addDispatch((0,O.WQ)(e))}}}var N=n(21781),j=n(55847);const F=s()("app:Event:NodeAddClick"),L=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!e||e.isRoot?t:L(e.parentNode,t+1)};class B extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.down=e=>{const{node:t}=e.target||{};if(!t)return;F("down",t),this.state={node:t};const{manager:n}=this,{control:r}=e,i=n.getAddNode();if(!t||!i||t===i)return;const o=r&&n.mode===j.A.addNode,a=t.elements.childrenContainer.toLocal(e.data.global);t!==i.parentNode&&(i.setParent(t),F("new parent in add node",i,t),n.recollapse(),t.isCollapsed&&n.decollapse(t),i.setCache(!1)),i.move(a.x,a.y,!o),i.redraw()},this.up=()=>{var e;const{manager:t}=this,n=(null===(e=this.state)||void 0===e?void 0:e.node)||{};if(!n)return;F("up",n);const r=t.getAddNode();t.saveAddNode(),t.nodeGrow(r.parentNode),t.saveNodes();const i=new Event("addNode");document.dispatchEvent(i),t.selectSingleNode(r),r.openTextField(r.title,"selectAll"),(0,N.k4)("nodeAdd",{method:"PointerAction",nestingParents:L(n)}),t.setMode(j.A.moveNode)}}}const z=s()("app:Event:NodeAddHover"),U=z.extend("FLOOD","::");class G extends g{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.move=e=>{const{manager:t}=this,{node:n}=e.target,{control:r}=e;U("move",n);const i=t.getAddNode();if(!n||!i||n===i)return;const o=r&&t.mode===j.A.addNode,a=t.getPosition(n,e);n!==i.parentNode&&(i.setParent(n),z("new parent in add node",i,n),t.recollapse(),n.isCollapsed&&t.decollapse(n),i.setCache(!1)),i.move(a.x,a.y,!o)},this.reset=()=>{const{manager:e}=this;e.deleteAddNode()}}}const H=class extends u{constructor(){super(...arguments),this.type=c.drag,this.dragCursor="",this.wheel=()=>{}}},W=s()("app:Event:NodeAddResize"),V=W.extend("FLOOD","::");class q extends H{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.cursor="plus",this.dragCursor="nwse-resize",this.state=null,this.down=e=>{const{manager:t}=this,{node:n}=e.target||{},{addNode:r}=t;if(!n||!r)return;const i=e.data.getLocalPosition(n.elements.childrenContainer);W("down",n,r,i),r.move(i.x,i.y,!0),this.state={startPosition:i}},this.up=()=>{const{manager:e,state:t}=this,{addNode:n}=this.manager;t&&n&&(W("up",t),e.saveAddNode(!0),e.nodeGrow(n.parentNode),e.saveNodes(),e.selectSingleNode(n),n.openTextField("","end"),(0,N.k4)("addedResizedNode",{method:"PointerAction"}),e.setMode(j.A.moveNode))},this.move=e=>{const{manager:t,state:n}=this,{control:r}=e,{addNode:i}=this.manager;if(V("move",n),!n||!i)return;const{startPosition:o}=n,a=r&&t.mode===j.A.addNode;i.setCache(!1);const s=t.getPositionParent(i,e),l=Math.min(s.x,o.x),c=Math.min(s.y,o.y),u=Math.max(s.x-o.x,o.x-s.x),d=Math.max(s.y-o.y,o.y-s.y);i.move(l,c,!a),i.resize(u,d,!a)}}}const K=s()("app:Event:NodeCommentsInboxClick");class Y extends d{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.node,this.down=e=>{const{node:t}=e.target||{};t&&(K("down",t),this.state={node:t})},this.up=e=>{const{node:t}=e.target||{};if(!t)return;K("up",t);const n=document.getElementById("node-comments-opener-button");null===n||void 0===n||n.click(),(0,N.k4)("clickCommentsNotification",{method:"PointerAction"})}}}const X=s()("app:Event:NodeDecollapse");class Q extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.state=null,this.down=e=>{const{node:t}=e.target||{};t&&(X("down",t),this.state={node:t})},this.up=()=>{const{manager:e,state:t}=this;if(!t)return;const{node:n}=t;n&&(X("up",n),n.isCollapsed&&(e.nodeDecollapse(n),e.saveNodes(),(0,N.k4)("decollapseNode",{method:"PointerAction"})))}}}var J=n(69243);const Z=s()("app:Event:NodeDownloadFile");class $ extends d{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.node,this.cursor="pointer",this.down=e=>{const{node:t}=e.target||{};t&&(Z("down",t),this.state={node:t})},this.up=e=>{const{manager:t}=this,{node:n}=e.target||{};if(!n)return;Z("up",n);const{file:r}=n,{mapId:i}=t.engine.store,{protocol:o,host:a}=window.location;r&&((0,N.k4)("downloadFile",{method:"PointerAction"}),window.open("".concat(o,"//").concat(a).concat(J.DN,"/maps/").concat(i,"/files/").concat(r),"_blank"))}}}var ee=n(53050);const te=s()("app:Event:NodeEdit");class ne extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.selection="selectAll",this.state=null,this.down=e=>{const{node:t}=e.target||{};t&&(te("down",t),this.state={node:t,wasEdited:t.state.isEdited})},this.up=e=>{const{type:t}=e.target||{},{selection:n}=this,{node:r,wasEdited:i}=this.state||{};if(!r)return;te("up",r,n);const{isSelected:o}=r.state;!o||i||t===ee.A.text&&(r.isUrl||r.isEmail)||(r.openTextField(void 0,n),(0,N.k4)("editNodeSelect",{method:"PointerAction",selection:n}))}}}class re extends ne{constructor(){super(...arguments),this.selection="end"}}const ie=s()("app:Event:NodeEditHover").extend("FLOOD","::");class oe extends g{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.move=e=>{const{node:t}=e.target;if(ie("move",t),!t)return;const{isSelected:n,isEdited:r}=t.state;!r&&n&&(t.openTextField(),(0,N.k4)("editNodeHover",{method:"PointerAction"}))}}}const ae=s()("app:Event:NodeFollowLink");class se extends d{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.node,this.down=e=>{const{node:t}=e.target||{};t&&(ae("down",t),this.state={node:t})},this.up=e=>{const{node:t}=e.target||{};if(!t)return;ae("up",t);const{title:n,isUrl:r,isEmail:i}=t,{isSelected:o}=t.state;n&&o&&(r&&((0,N.k4)("followLinkUrl",{method:"PointerAction"}),window.open((n.startsWith("http")?"":"http://")+n,"_blank")),i&&((0,N.k4)("followLinkEmail",{method:"PointerAction"}),window.open("mailto:".concat(n))))}}}var le=n(19208);const{outOfBorderThreshold:ce,outOfBorderOffset:ue}=le.Ay.nodes,de=e=>{if(e.parentNode.isRoot)return!1;if(e.x+e.width{const{node:t}=e.target||{};if(!t||t.isRoot)return;he("down",t);const n=t.state.isSelected?new Set([...t.parentNode.childNodes].filter(e=>e.state.isSelected)):new Set([t]),r=new Event("startMoveNode");document.dispatchEvent(r),this.state={dragStart:e.data.getLocalPosition(t.parentNode.elements.childrenContainer),nodesStarts:new Map(Array.from(n).map(e=>[e,{x:e.x,y:e.y}])),node:t,dragNodes:n}},this.turnDragNodes=e=>{const{state:t,manager:n}=this;if(!t)return;const{dragNodes:r,node:i}=t;i&&i.turn(S.A.nodes.dragRotate,e),r&&([...r].filter(e=>e!==i).forEach(e=>{const t={x:Math.round(e.width/2),y:Math.round(e.height/2)};e.container.zIndex=Number.MAX_SAFE_INTEGER,e.turn(S.A.nodes.dragRotate,t)}),r.forEach(e=>{e.container.interactive=!1,e.container.interactiveChildren=!1,e.setState({isMoving:!0})})),t.isTurned=!0,n.engine.scheduleRender()},this.up=()=>{const{manager:e,state:t}=this;if(!t)return;he("up",t);const n=[...t.dragNodes].map(e=>this.getNumberOfNestedChilds(e)).reduce((e,t)=>e+t,0),{dragNodes:r,node:i}=t,o=new Event("endMovingNode");document.dispatchEvent(o),(0,N.u4)({action:"nodeMove",details:{selected:t.dragNodes.size,childNodes:n,nestingParents:this.getNumberOfNestingParents(i)-1}}),e.clearDecollapse(),i.parentNode.isCollapsed&&e.nodeDecollapse(i.parentNode),r.forEach(e=>{de(e),e.setState({isMoving:!1})}),e.addDispatch([...r].map(e=>(0,O.Cy)(e))).then(),e.nodeGrow(i.parentNode),e.saveNodes().then()},this.move=e=>{const{manager:t,state:n,turnDragNodes:r}=this,{node:i}=e.target,{control:o}=e;if(fe("move",i,n),!i||!n)return;const{node:a,dragNodes:s,isMoved:l,isTurned:c}=n;if(c||r(e.data.getLocalPosition(a.container)),s.has(i))return;l?n.startNode&&i!==n.startNode&&!i.isChildOf(n.startNode)&&delete n.startNode:i!==a.parentNode&&(n.startNode=i);const{nodesStarts:u,dragStart:d,startNode:h}=n,f=h?a.parentNode:i;f!==a.parentNode&&(s.forEach(e=>e.setParent(f)),f.setCache(!1),he("new parent in move node",a.id,f.id,n),t.recollapse(),f.isCollapsed&&t.decollapse(f));const p=e.data.getLocalPosition(f.elements.childrenContainer),g=u.get(a);a.move(g.x+p.x-d.x,g.y+p.y-d.y,!o,a.siblingNodes.filter(e=>!s.has(e)));const m=a.x-g.x,v=a.y-g.y;Array.from(s).filter(e=>e!==a).forEach(e=>e.move(u.get(e).x+m,u.get(e).y+v,!o,e.siblingNodes.filter(e=>!s.has(e)||e===a))),n.isMoved=!0},this.reset=()=>{const{state:e}=this;if(!e)return;const{dragNodes:t}=e;he("reset"),t&&t.forEach(e=>{e.turn(0,{x:0,y:0}),e.container.interactive=e.isCached,e.container.interactiveChildren=!0}),this.state=null},this.getNumberOfNestedChilds=e=>e.childNodes.size+[...e.childNodes].map(this.getNumberOfNestedChilds).reduce((e,t)=>e+t,0),this.getNumberOfNestingParents=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.isRoot&&t||(n=e.getNumberOfNestingParents(t.parentNode,n+=1)),n}}}var ge=n(6884);function me(e){const t=e,n=Boolean(e.parentNode),r=Boolean(t.image),i=!t.title,o=Array.isArray(t.children)&&0===t.children.length,a=0===e.childNodes.size;return n&&r&&i&&o&&a}const ve=s()("app:Event:NodeResize"),ye=ve.extend("FLOOD","::");class be extends H{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.dragCursor="nwse-resize",this.state={},this.down=e=>{const{node:t}=e.target||{};if(!t)return;ve("start resize",t),t.setState({isResizing:!0});const n=new Event("startResizeNode");document.dispatchEvent(n);const r=e.data.getLocalPosition(t.parentNode.elements.childrenContainer);t.container.zIndex=Number.MAX_SAFE_INTEGER;const i=r.x>t.x+t.width/2,o=r.y>t.y+t.height/2;this.state={startLength:(0,ge.Bw)(e.data.getLocalPosition(t.container),ge.VT),startScale:t.scale,side:{rightHalf:i,bottomHalf:o},node:t}},this.up=()=>{const{manager:e}=this,{isResizing:t,isScaling:n,node:r,isMoved:i}=this.state||{};if(!r)return;ve("stop resize",r),r.setState({isResizing:!1});const o=new Event("endResizeNode");if(document.dispatchEvent(o),i&&(t||n)){const i=de(r),o=[];if(i&&o.push((0,O.Cy)(r)),t){e.saveNodes();const t=function(e){const t=Array.from(e.childNodes).filter(me);if(0===t.length)return[];const n=[];return t.forEach(t=>{const r=t.width/e.width,i=e.width*r,o=i/(t.width/t.height);t.resize(i,o,!1),n.push((0,O.XR)(t))}),n}(r);o.push(...t)}n&&o.push((0,O.Ue)(r)),e.addDispatch(o),(0,N.k4)("nodeResizeOrScale",{method:"PointerAction",isMovedBack:i,isResizing:t,isScaling:n})}},this.move=e=>{const{manager:t,state:n}=this,{side:r,startLength:i,startScale:o,node:a}=this.state||{},{control:s}=e,{shiftKey:l}=e.data.originalEvent;if(!a||!n)return;if(!r||void 0===i||!o)throw Error("State of NodeResize.move incomplete");n.isMoved=!0;const c=s||l,u=!l;if(ye("move",{isScaling:c,isResizing:u,event:e,shiftKey:l,control:s}),u){ye("resize"),n.isResizing||t.initNodeResize(a);const i=e.data.getLocalPosition(a.parentNode.elements.childrenContainer),o={x:a.x,y:a.y,width:a.width,height:a.height};r.rightHalf?o.width=i.x-a.x:(o.width=a.x-i.x+a.width,o.x=i.x),r.bottomHalf?o.height=i.y-a.y:(o.height=a.y-i.y+a.height,o.y=i.y),t.nodeResize(a,o,!s),n.isResizing=!0}if(c){const t=(0,ge.Bw)(e.data.getLocalPosition(a.container),ge.VT);ye("scale",t/i*o),a.scaling(t/i*o,!s),n.isScaling=!0}}}}const we=class extends u{constructor(){super(...arguments),this.type=c.wheel,this.up=()=>{},this.down=()=>{},this.move=()=>{}}},Ae=s()("app:Event:NodeScaleWheel");class _e extends we{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.wheel=e=>{const{manager:t}=this,{hoverNode:n}=t,{shiftKey:r}=e;if(n){if(Ae("wheel",n),r){var i;null===(i=t.wheelPlugin)||void 0===i||i.pause();const{deltaY:r}=e;r>0?(t.scaleDown(n),(0,N.k4)("nodeScaleWheel",{method:"PointerAction",direction:"down"})):(t.scaleUp(n),(0,N.k4)("nodeScaleWheel",{method:"PointerAction",direction:"up"}))}}else Ae("no hover node")}}}const Ce=s()("app:Event:NodeSelect");class xe extends d{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.node,this.down=e=>{const{node:t}=e.target||{};t&&(Ce("down",t),this.state={node:t})},this.up=e=>{const{manager:t}=this,{node:n}=e.target||{},{control:r}=e;if(!n)return;Ce("up",n);const{isSelected:i}=n.state;r?i?t.unselectNode(n):t.selectNode(n):t.selectSingleNode(n)}}}const Ee=s()("app:Event:NodeTextClick");class Se extends d{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.node,this.down=e=>{const{node:t}=e.target||{};t&&(Ee("down",t),this.state={node:t})},this.up=e=>{const{node:t}=e.target||{};if(!t)return;Ee("up",t);const{title:n,isUrl:r,isEmail:i}=t,{isSelected:o}=t.state;n&&!o&&(r&&((0,N.k4)("followLinkUrl",{method:"PointerAction"}),window.open((n.startsWith("http")?"":"http://")+n,"_blank")),i&&((0,N.k4)("followLinkEmail",{method:"PointerAction"}),window.open("mailto:".concat(n))))}}}const De=s()("app:Event:NodeTextHover").extend("FLOOD","::");class ke extends g{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.node,this.state=null,this.move=e=>{const{node:t}=e.target;var n;(De("move",t),t)?(null===(n=this.state)||void 0===n?void 0:n.node)!==t&&(this.state={node:t}):this.state=null},this.reset=()=>{this.state=null}}getCursor(){var e;return null!==(e=this.state)&&void 0!==e&&e.node?this.state.node.isUrl&&this.state.node.state.isSelected?"pointer":this.manager.store.isWriteable?"text":null:null}}const Te=s()("app:Event:NodeZoomTo");class Oe extends d{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.node,this.down=e=>{const{node:t}=e.target||{};t&&(Te("down",t),this.state={node:t})},this.up=e=>{const{manager:t}=this,{node:n}=e.target||{};n&&(Te("up",n),t.zoomToNode(n),(0,N.k4)("zoomToNode",{method:"PointerAction"}))}}}const Ie=s()("app:Event:NodeCheckBoxToggle");class Pe extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.cursor="pointer",this.down=e=>{const{node:t}=e.target||{};t&&(Ie("down",t),this.state={node:t})},this.up=e=>{const{manager:t}=this,{node:n}=e.target||{};n&&(Ie("up",n),t.toggleCheckbox(n).then(),(0,N.k4)("toggleCheckbox",{method:"PointerAction"}))}}}var Me=n(17857);const Re=s()("app:Event:NodeMoveWheel");class Ne extends we{constructor(){super(...arguments),this.isChanging=!1,this.category=h.A.node,this.wheelTimeout=null,this.wheel=e=>{const{manager:t}=this;if(this.manager.engine.maybeZoomStepEvent(),this.wheelTimeout&&clearTimeout(this.wheelTimeout),!(0,Me.JM)())return t.toggleWheelTrackpadPinch(!1),void t.toggleWheelZoom(!0);if(t.toggleWheelTrackpadPinch(!0),t.toggleWheelZoom(!1),t.setState({isScrolling:!0}),this.wheelTimeout=setTimeout(()=>{t.setState({isScrolling:!1})},100),(e=>{let t=!1;return void 0!==e.deltaY&&(0===e.deltaY&&0===e.deltaMode||e.deltaY%1!==0)&&(t=!0),t})(e)){const n=S.A.wheelTouchpadViewportMoveSpeedFactor;return void t.moveViewport(-e.deltaX*n,-e.deltaY*n)}const n=e.shiftKey;0!==e.deltaY&&n?(Re("horizontal move wheel"),t.moveViewport(-e.deltaY,0)):0!==e.deltaY?(Re("vertical move wheel"),t.moveViewport(0,-e.deltaY)):(t.toggleWheelTrackpadPinch(!1),t.toggleWheelZoom(!0))}}}const je=s()("app:Event:NodeExpand");class Fe extends d{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.cursor="pointer",this.state=null,this.down=e=>{const{node:t}=e.target||{};t&&(je("down",t),this.state={node:t})},this.up=e=>{const{manager:t}=this,{node:n}=e.target||{},{node:r}=this.state||{};n&&n===r&&(je("up",n),n.isCollapsed?t.nodeExpand(n):t.nodeCollapse(n),t.saveNodes())}}}var Le=n(32268);class Be extends H{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.state={},this.down=(e,t)=>{const{node:n}=e.target,{doubleClick:r}=t||{},i=this.manager.engine.root,o=this.manager.engine.renderNodes[i];this.state={node:o};const a=!r&&n&&!n.isRoot,s=this.manager.addNode;if(a||s)return;const l=o.container.toLocal(e.data.global.clone());o.selectionFrameStart=l,o.redraw()},this.up=()=>{const{node:e}=this.state;if(!e)return;const t=e.selectionFrameStart,n=e.selectionFrameEnd;if(e.selectionFrameStart=void 0,e.selectionFrameEnd=void 0,!t||!n)return;const r={x:t.x(0,Le.A)(e.getViewportPosition(),r)),o=i.map(e=>e.id),a=[];i.forEach(e=>{const t=[],n=Array.from(e.childNodes);for(;n.length;){const e=n.pop();t.push(e.id),e.childNodes.size&&n.push(...e.childNodes)}a.push(...t.filter(e=>o.includes(e)))}),i.forEach(e=>{a.includes(e.id)||this.manager.selectNode(e)}),e.redraw()},this.move=e=>{const{node:t}=this.state;if(!t||null===t||void 0===t||!t.selectionFrameStart)return;const n=t.container.toLocal(e.data.global.clone());t.selectionFrameEnd=n,t.redraw()}}}const ze=class extends H{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.cursor="move",this.dragCursor="grabbing",this.state=null,this.down=e=>{const{node:t}=e.target||{};if(!t||!me(t))return;const{parentNode:n}=t;n&&(this.state={iconWrapper:t,dragStart:e.data.getLocalPosition(n.elements.childrenContainer),iconStart:{x:t.x,y:t.y},parentBounds:{width:n.width,height:n.height}})},this.move=e=>{const{state:t}=this;if(!t)return;const{iconWrapper:n,dragStart:r,iconStart:i,parentBounds:o}=t,{parentNode:a}=n;if(!a)return;const s=e.data.getLocalPosition(a.elements.childrenContainer),l=s.x-r.x,c=s.y-r.y;let u=i.x+l,d=i.y+c;u=Math.max(0,Math.min(u,o.width-n.width)),d=Math.max(0,Math.min(d,o.height-n.height)),n.move(u,d,!1),this.manager.engine.scheduleRender()},this.up=()=>{const{state:e,manager:t}=this;if(!e)return;const{iconWrapper:n,iconStart:r}=e;t.addDispatch((0,O.Cy)(n)),this.state=null}}};const Ue=class extends H{constructor(){super(...arguments),this.isChanging=!0,this.category=h.A.node,this.dragCursor="nwse-resize",this.state=null,this.down=e=>{const{node:t}=e.target||{};if(!t||!me(t))return;const{parentNode:n}=t;n&&(this.state={iconWrapper:t,startDimensions:{width:t.width,height:t.height},aspectRatio:t.width/t.height,parentWidth:n.width,resizeStart:e.data.getLocalPosition(t.container)})},this.move=e=>{const{state:t}=this;if(!t)return;const{iconWrapper:n,startDimensions:r,aspectRatio:i,parentWidth:o,resizeStart:a}=t,{iconWrapper:s}=S.A.nodes,l=e.data.getLocalPosition(n.container).x-a.x;let c=r.width+l;const u=o*s.minScaleRatio,d=o*s.maxScaleRatio;c=Math.max(u,Math.min(c,d));const h=c/i;n.resize(c,h,!1),this.manager.engine.scheduleRender()},this.up=()=>{const{state:e,manager:t}=this;if(!e)return;const{iconWrapper:n,startDimensions:r}=e;t.addDispatch((0,O.XR)(n)),this.state=null}}};var Ge;!function(e){e.normal="normal",e.long="long",e.double="double"}(Ge||(Ge={}));const He=Ge;const We=class{constructor(e){this.isWrapper=!0,this.actions=new Set,this.state=null,this.add=e=>{this.actions.add(e)},this.filter=e=>{const{manager:t}=this;return t.store.isWriteable||!e.isChanging},this.delete=e=>{this.actions.delete(e)},this.down=e=>{Array.from(this.actions).filter(this.filter).forEach(t=>t.down(e))},this.up=e=>{Array.from(this.actions).filter(this.filter).forEach(t=>t.up(e))},this.move=e=>{Array.from(this.actions).filter(this.filter).forEach(t=>t.move(e))},this.wheel=e=>{Array.from(this.actions).filter(this.filter).forEach(t=>t.wheel(e))},this.reset=()=>{Array.from(this.actions).filter(this.filter).forEach(e=>e.reset())};const{add:t}=this;if(0===e.length)throw new Error("PointerActionCompination must be initialized with at least one action");e.forEach(t)}get type(){const{actions:e}=this;return e.size>0?Array.from(e)[0].type:""}get category(){const{actions:e}=this;return e.size>0?Array.from(e)[0].category:""}get cursor(){var e;const{actions:t}=this;return(null===(e=Array.from(t).find(e=>e.getCursor()))||void 0===e?void 0:e.getCursor())||""}get dragCursor(){const{actions:e}=this,t=Array.from(e).find(e=>e instanceof H&&e.dragCursor);return t instanceof H?t.dragCursor:""}getCursor(){return this.cursor}get manager(){const{actions:e}=this;return Array.from(e)[0].manager}get isChanging(){const{actions:e}=this;return Boolean(Array.from(e).every(e=>e.isChanging))}},Ve=Object.fromEntries(Object.keys(r).map(e=>[e,e]));var qe;!function(e){e[e.none=0]="none",e[e.left=1]="left",e[e.right=2]="right",e[e.leftRight=3]="leftRight",e[e.middle=4]="middle",e[e.back=8]="back",e[e.forward=16]="forward"}(qe||(qe={}));const Ke=qe;var Ye=n(6936),Xe=n(85705);const Qe=[ee.A.headerHandle,ee.A.text,ee.A.background,ee.A.container],Je=[Ye.A.arrow,Ye.A.line,Ye.A.text],Ze=[{actionName:Ve.NodeCheckBoxToggle,element:[ee.A.checkBox]},{actionName:Ve.NodeCommentsInboxClick,element:[ee.A.commentsInbox]},{actionName:Ve.NodeFollowUrl,element:[ee.A.text]},{actionName:Ve.NodeMove,element:Qe,mode:j.A.moveNode},{actionName:Ve.NodeMove,element:[ee.A.background,ee.A.headerHandle],type:He.long},{actionName:Ve.NodeDecollapse,element:ee.A.resizeHandle},{actionName:Ve.NodeSelect,element:Qe,mode:[j.A.navigate,j.A.moveNode],root:!0},{actionName:Ve.NodeSelect,element:Qe,mode:[j.A.navigate,j.A.moveNode]},{actionName:Ve.NodeZoomTo,element:[ee.A.container,ee.A.background,ee.A.headerHandle,ee.A.text],type:He.double},{actionName:Ve.NodeZoomTo,element:[ee.A.container,ee.A.background,ee.A.headerHandle,ee.A.text],type:He.double,root:!0},{actionName:Ve.NodeResize,element:ee.A.resizeHandle},{actionName:Ve.NodeResize,element:[ee.A.resizeHandle],buttons:Ke.middle},{actionName:Ve.NodeScaleWheel,element:[...Qe,ee.A.resizeHandle],buttons:Ke.none},{actionName:Ve.NodeMoveWheel,element:[ee.A.background]},{actionName:Ve.NodeMoveWheel,element:[ee.A.background],root:!0},{actionName:Ve.NodeDownloadFile,element:[ee.A.downloadHandle]},{actionName:Ve.NodeEditEnd,element:[ee.A.headerHandle,ee.A.text],type:He.normal},{actionName:Ve.NodeEditSelectAll,element:[ee.A.text],type:He.long},{actionName:Ve.NodeTextHover,element:[ee.A.text],buttons:Ke.none},{actionName:Ve.NodeAddResize,element:Qe,mode:j.A.addNode},{actionName:Ve.NodeAddHover,element:Qe,mode:j.A.addNode,buttons:Ke.none},{actionName:Ve.NodeAddClick,element:Qe,mode:j.A.addNode},{actionName:Ve.NodeAddResize,element:Qe,mode:j.A.addNode,root:!0},{actionName:Ve.NodeAddHover,element:Qe,mode:j.A.addNode,buttons:Ke.none,root:!0},{actionName:Ve.NodeAddClick,element:Qe,mode:j.A.addNode,root:!0},{actionName:Ve.GhostMaterialize,element:Xe.A.create},{actionName:Ve.GhostExpand,element:Xe.A.expand,type:He.normal},{actionName:Ve.NodeExpandOrCollapse,element:[ee.A.expandOrCollapse],type:He.normal},{actionName:Ve.EdgeAddClick,element:Qe,mode:j.A.addEdge},{actionName:Ve.EdgeAddHover,element:Qe,mode:j.A.addEdge,buttons:Ke.none},{actionName:Ve.EdgeSelect,element:Je},{actionName:Ve.EdgeZoomTo,element:[Ye.A.line,Ye.A.arrow],type:He.double},{actionName:Ve.EdgeEdit,element:[Ye.A.text],type:He.double},{actionName:Ve.EdgeEdit,element:[Ye.A.text],type:He.long},{actionName:Ve.NodeSelectionFrame,mode:j.A.moveNode,element:Qe,type:He.double},{actionName:Ve.NodeSelectionFrame,mode:j.A.moveNode,element:Qe,type:He.double,root:!0},{actionName:Ve.NodeSelectionFrame,mode:j.A.moveNode,element:Qe,type:He.normal,root:!0},{actionName:Ve.DragIconWrapper,element:[ee.A.background,ee.A.container],mode:[j.A.navigate,j.A.moveNode]},{actionName:Ve.ResizeIconWrapper,element:ee.A.resizeHandle}],$e=(e,t)=>e.flatMap(e=>t.map(t=>[e,t].flat())),et=function(){for(var e=arguments.length,t=new Array(e),n=0;n{const t=Object.fromEntries(Object.entries(r).map(t=>{let[n,r]=t;return[n,new r(e)]}));return tt("created actions",t),t},this.register=e=>{const{bindings:t,actions:n,getAllIndexes:r}=this,{actionName:i}=e,o=n[i];tt("register binding",e,o),r(e).forEach(e=>{nt("register binding index",e);const n=t.get(e);if(n)if(n.isWrapper)n.add(o);else{const r=new We([n,o]);t.set(e,r)}else t.set(e,o)})},this.unregister=e=>{const{bindings:t,getAllIndexes:n}=this;n(e).forEach(e=>{tt("unregistered action",e),t.delete(e)})},this.getAllIndexes=e=>{const{actions:t}=this,{getBindIndex:n}=rt,{actionName:r,buttons:i=Ke.left,mode:o=Object.values(j.A),element:a=ee.A.container,type:s=He.normal,root:l=!1}=e,c=Array.isArray(a)?a:[a],u=Array.isArray(o)?o:[o],d=t[r];return et(c,u).map(e=>{let[t,r]=e;return n(r,t,d.category,i,s,d.type,l)})},this.getAction=(e,t,n)=>{const{bindings:r,getMode:i}=this,{store:o}=this.manager,{getBindIndex:a}=rt,{type:s,category:l,node:c}=e.target||{},{buttons:u=Ke.left}=e.data,d=a(i(e),s,l,u,t,n,Boolean(null===c||void 0===c?void 0:c.isRoot)),h=r.get(d);return h?h.isChanging&&!o.isWriteable?(tt("action would change readonly store"),null):(tt("get action",d,h),h):(nt("no action",d),null)},this.getMode=e=>{const{mode:t}=this.manager,{ctrlKey:n,metaKey:r,altKey:i,shiftKey:o}=e.data.originalEvent,a=n||r;return i&&o&&!a?j.A.addEdge:!i&&o&&a?j.A.addNode:!i||o||a?t:j.A.moveNode},this.getCursor=e=>{var t;const{bindings:n,getMode:r}=this,{getBindIndex:i}=rt,{buttons:o=Ke.left}=e.data,{type:a,category:s,node:l}=e.target||{},u=r(e),d=Boolean(null===l||void 0===l?void 0:l.isRoot),h=[i(u,a,s,Ke.left,He.normal,c.click,d),i(u,a,s,o,He.normal,c.click,d),i(u,a,s,Ke.left,He.normal,c.drag,d),i(u,a,s,o,He.normal,c.drag,d),i(u,a,s,o,He.normal,c.hover,d)].find(e=>{var t;return null===(t=n.get(e))||void 0===t?void 0:t.getCursor()});return h&&(null===(t=n.get(h))||void 0===t?void 0:t.getCursor())||""};const{register:t,createActions:n}=this;tt("initialize",this),this.actions=n(e),Ze.forEach(t)}destroy(){this.actions={},this.bindings=new Map}}rt.getBindIndex=(e,t,n,r,i,o,a)=>"".concat(e,"-").concat(t,"-").concat(n,"-").concat(r,"-").concat(i,"-").concat(o,"-").concat(a?"root":"any");const it=rt,ot=s()("app:Event:PointerEventHandler"),at=ot.extend("FLOOD","::");class st extends o.k_{constructor(e,t,n){var r;super(e),r=this,this.viewport=void 0,this.manager=void 0,this.interactionManager=void 0,this.binder=void 0,this.ongoingClickAction=null,this.ongoingDragAction=null,this.ongoingHoverAction=null,this.ongoingActionPointerId=null,this.ongoingActionButtons=null,this.ongoingActionStartPosition=ge.VT,this.moved=!1,this.hasFirstClick=!1,this.doubleClickRef=null,this.lastMoveTarget=null,this.longClickRef=null,this.eventDOMElement=void 0,this.wheelTrackerEnabled=!0,this.trackNumberOfSelected=0,this._contextMenuHandler=e=>{ot("context menu"),e.preventDefault()},this._resetClickActions=()=>{const{manager:e,ongoingClickAction:t,ongoingDragAction:n}=this;t&&(t.reset(),this.ongoingClickAction=null,e.engine.scheduleRender().then()),n&&(n.reset(),e.setState({isDragged:!1}),this.ongoingDragAction=null,e.engine.scheduleRender().then())},this.down=e=>{const{manager:t,moved:n,ongoingHoverAction:r,hasFirstClick:i,doubleClickRef:o,longClickRef:a,_downActions:s}=this,{ctrlKey:l,metaKey:c}=e.data.originalEvent;e.control=l||c;const u=i&&!n;if(this.trackNumberOfSelected=this.manager.engine.eventManager.selectedNodes.size,t.engine.abortAnimation(),!e.target)return!0;at("pointer down"),t.pointerDown=!0,this.ongoingActionButtons=e.data.buttons,this.ongoingActionPointerId=e.data.pointerId,this.ongoingActionStartPosition=e.data.global.clone(),this.moved=!1,e.target.node&&e.target.node.state.isTemporary&&(e.target.node.state.isTemporary=!1,t.addDispatch((0,O.WQ)(e.target.node))),o&&clearTimeout(o),u?this.hasFirstClick=!1:(this.hasFirstClick=!0,this.doubleClickRef=setTimeout(()=>{ot("abort double click"),this.hasFirstClick=!1},S.A.interaction.doubleClickTimeout)),a&&clearTimeout(a),this.longClickRef=setTimeout(()=>{ot("long click"),this.up(e)},S.A.interaction.longClickLatency);const d=u?He.double:He.normal;return r&&(r.reset(),this.ongoingHoverAction=null,t.engine.scheduleRender().then()),s(e,d),!0},this.openContextMenu=(e,t)=>{const{control:n}=t,{node:r,edge:i}=t.target||{};if(r)n?r.state.isSelected?e.unselectNode(r):e.selectNode(r):e.selectSingleNode(r);else{if(!i)return;n?i.state.isSelected?e.unselectEdge(i):e.selectEdge(i):e.selectSingleEdge(i)}t.data.originalEvent.preventDefault(),e.contextMenuPosition={x:t.data.global.x,y:t.data.global.y},e.fireSubscriptions(),this.trackAction("openNodeToolbar","atClick")},this._downActions=(e,t)=>{const{binder:n,manager:r,setCursor:i,ongoingDragAction:o,ongoingClickAction:a,ongoingHoverAction:s}=this,l=n.getAction(e,t,c.click);"ghost"===(null===l||void 0===l?void 0:l.category)&&setTimeout(()=>{const t=e.target.node;t&&this.trackAction("nodeAdd","atGhostClick",this.numberOfNestingParents(t))},1e3),l&&(ot("down click action",l),l.down(e),a&&a!==l&&a.reset(),t===He.long?(l.up(e),l.reset(),this.ongoingClickAction=null):this.ongoingClickAction=l,r.engine.scheduleRender().then());const u=n.getAction(e,t,c.drag);var d,h,f,p;u&&(u.down(e,{doubleClick:t===He.double}),i(u.dragCursor),o&&o!==u&&o.reset(),r.setState({isDragged:!0}),this.ongoingDragAction=u,null!==(d=this.manager.dragPlugin)&&void 0!==d&&d.paused||null===(h=this.manager.dragPlugin)||void 0===h||h.pause(),null!==(f=this.manager.mouseEdgePlugin)&&void 0!==f&&f.paused&&(null===(p=this.manager.mouseEdgePlugin)||void 0===p||p.resume()),r.engine.scheduleRender().then());s&&(s.reset(),r.engine.scheduleRender().then()),(l||u)&&(e.data.originalEvent.preventDefault&&e.data.originalEvent.preventDefault(),e.data.originalEvent.stopPropagation&&e.data.originalEvent.stopPropagation(),e.stopPropagation&&e.stopPropagation())},this.up=e=>{var t,n,r,i;const{binder:o,manager:a,ongoingClickAction:s,ongoingDragAction:l,ongoingActionPointerId:c,moved:u,longClickRef:d,setCursor:h,_resetClickActions:f}=this,{ctrlKey:p,metaKey:g}=e.data.originalEvent;e.control=p||g;const{button:m}=e.data;return m!==Ke.right||u||this.openContextMenu(a,e),!e.target||(e.data.pointerId!==c||!a.pointerDown||(at("pointer up"),a.pointerDown=!1,this.ongoingActionButtons=null,d&&clearTimeout(d),s&&!u&&(s.up(e),a.engine.scheduleRender().then()),l&&(l.up(e),a.setState({isDragged:!1}),a.engine.scheduleRender().then()),f(),a.saveDecollapsedNode(),a.mode!==j.A.navigate&&a.mode!==j.A.moveNode&&(a.mode=j.A.moveNode),h(o.getCursor(e)),null!==(t=this.manager.dragPlugin)&&void 0!==t&&t.paused&&(null===(n=this.manager.dragPlugin)||void 0===n||n.resume()),null!==(r=this.manager.mouseEdgePlugin)&&void 0!==r&&r.paused||null===(i=this.manager.mouseEdgePlugin)||void 0===i||i.pause(),a.fireSubscriptions(),a.commitDispatches(),!0))},this.move=e=>{const{binder:t,manager:n,ongoingDragAction:r,ongoingHoverAction:i,ongoingActionPointerId:o,ongoingActionStartPosition:a,ongoingActionButtons:s,longClickRef:l,doubleClickRef:u,setCursor:d}=this,{pointerDown:h}=this.manager,{ctrlKey:f,metaKey:p}=e.data.originalEvent;if(e.control=f||p,!e.target)return!0;if(o&&o!==e.data.pointerId)return!0;const{node:g}=e.target;if(this.lastMoveTarget=e.target,g&&g!==n.hoverNode&&(n.setHoverNode(g),n.setNodeCache(g,!1),n.engine.scheduleRender().then()),n.setPointerPosition(e.data.global.clone()),Math.abs(e.data.global.x-a.x){var t,n;const{binder:r,manager:i,lastMoveTarget:o}=this;if(i.engine.scheduleRender().then(),!o)return ot("wheel no target"),!0;const a={data:{originalEvent:e},target:o};at("wheel",e),null!==(t=i.wheelPlugin)&&void 0!==t&&t.paused&&(null===(n=i.wheelPlugin)||void 0===n||n.resume());const s=r.getAction(a,He.normal,c.wheel);return s&&s.wheel(e),this.wheelTrackerEnabled&&(this.trackAction("navZoomFree","wheel"),this.wheelTrackerEnabled=!1,setTimeout(()=>this.wheelTrackerEnabled=!0,1e4)),!0},this.setCursor=e=>{at("set cursor",e),this.viewport.cursor=e},this.numberOfNestingParents=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!e||e.isRoot?t:r.numberOfNestingParents(e.parentNode,t+1)},this.trackAction=(e,t,n)=>{const r={method:t,nestingParents:n};this.trackNumberOfSelected>1&&(r.selected=this.trackNumberOfSelected),(0,N.u4)({action:e,details:r})},ot("initialize",this),this.viewport=e,this.manager=t,this.interactionManager=n,this.binder=new it(t),this.eventDOMElement=this.manager.engine.view,this.eventDOMElement.addEventListener("contextmenu",this._contextMenuHandler)}destroy(){this.eventDOMElement.removeEventListener("contextmenu",this._contextMenuHandler),this.binder.destroy()}}const lt=st},4294(e,t,n){"use strict";e.exports=n.p+"static/media/roboto-latin-300italic.bd5b7a13f2c52b531a2a.woff"},4327(e,t,n){"use strict";var r=n(82983),i=n(20019),o=n(51804),a=n(71515),s=n(123),l=TypeError;r({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=o(this),n=a(t),r=arguments.length<2,c=r?void 0:arguments[1];if(i(e),s(n,function(n){r?(r=!1,c=n):c=e(c,n,n,t)},{IS_ITERATOR:!0}),r)throw l("Reduce of empty set with no initial value");return c}})},4373(e){e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},4382(e,t,n){"use strict";n(77600);e.exports=function(e,t){var n=e.getSelection(),r=e.getCurrentContent(),i=n.getStartKey(),o=n.getStartOffset(),a=i,s=0;if(t>o){var l=r.getKeyBefore(i);if(null==l)a=i;else a=l,s=r.getBlockForKey(l).getText().length}else s=o-t;return n.merge({focusKey:a,focusOffset:s,isBackward:!0})}},4424(e,t,n){"use strict";n.r(t),n.d(t,{BIGINT_FORMAT_RANGES:()=>H,Class:()=>he,NUMBER_FORMAT_RANGES:()=>G,aborted:()=>J,allowsEval:()=>T,assert:()=>l,assertEqual:()=>i,assertIs:()=>a,assertNever:()=>s,assertNotEqual:()=>o,assignProp:()=>b,base64ToUint8Array:()=>ae,base64urlToUint8Array:()=>le,cached:()=>h,captureStackTrace:()=>D,cleanEnum:()=>oe,cleanRegex:()=>p,clone:()=>F,cloneDef:()=>A,createTransparentProxy:()=>B,defineLazy:()=>v,esc:()=>E,escapeRegex:()=>j,extend:()=>q,finalizeIssue:()=>ee,floatSafeRemainder:()=>g,getElementAtPath:()=>_,getEnumValues:()=>c,getLengthableOrigin:()=>ne,getParsedType:()=>M,getSizableOrigin:()=>te,hexToUint8Array:()=>ue,isObject:()=>k,isPlainObject:()=>O,issue:()=>ie,joinValues:()=>u,jsonStringifyReplacer:()=>d,merge:()=>Y,mergeDefs:()=>w,normalizeParams:()=>L,nullish:()=>f,numKeys:()=>P,objectClone:()=>y,omit:()=>V,optionalKeys:()=>U,parsedType:()=>re,partial:()=>X,pick:()=>W,prefixIssues:()=>Z,primitiveTypes:()=>N,promiseAllObject:()=>C,propertyKeyTypes:()=>R,randomString:()=>x,required:()=>Q,safeExtend:()=>K,shallowClone:()=>I,slugify:()=>S,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>se,uint8ArrayToBase64url:()=>ce,uint8ArrayToHex:()=>de,unwrapMessage:()=>$});var r=n(89379);function i(e){return e}function o(e){return e}function a(e){}function s(e){throw new Error("Unexpected value in exhaustive check")}function l(e){}function c(e){const t=Object.values(e).filter(e=>"number"===typeof e);return Object.entries(e).filter(e=>{let[n,r]=e;return-1===t.indexOf(+n)}).map(e=>{let[t,n]=e;return n})}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"|";return e.map(e=>z(e)).join(t)}function d(e,t){return"bigint"===typeof t?t.toString():t}function h(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function f(e){return null===e||void 0===e}function p(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function g(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(0===i&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);null!==e&&void 0!==e&&e[1]&&(i=Number.parseInt(e[1]))}const o=n>i?n:i;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}const m=Symbol("evaluating");function v(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==m)return void 0===r&&(r=m,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function y(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function b(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function w(){const e={};for(var t=arguments.length,n=new Array(t),r=0;rnull===e||void 0===e?void 0:e[t],e):e}function C(e){const t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{const n={};for(let r=0;r0&&void 0!==arguments[0]?arguments[0]:10;const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let r=0;r{var e,t;if("undefined"!==typeof navigator&&null!==(e=navigator)&&void 0!==e&&null!==(t=e.userAgent)&&void 0!==t&&t.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(n){return!1}});function O(e){if(!1===k(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!==typeof t)return!0;const n=t.prototype;return!1!==k(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function I(e){return O(e)?(0,r.A)({},e):Array.isArray(e)?[...e]:e}function P(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const M=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":null===e?"null":e.then&&"function"===typeof e.then&&e.catch&&"function"===typeof e.catch?"promise":"undefined"!==typeof Map&&e instanceof Map?"map":"undefined"!==typeof Set&&e instanceof Set?"set":"undefined"!==typeof Date&&e instanceof Date?"date":"undefined"!==typeof File&&e instanceof File?"file":"object";default:throw new Error("Unknown data type: ".concat(t))}},R=new Set(["string","number","symbol"]),N=new Set(["string","number","bigint","boolean","symbol","undefined"]);function j(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,n){const r=new e._zod.constr(null!==t&&void 0!==t?t:e._zod.def);return(!t||null!==n&&void 0!==n&&n.parent)&&(r._zod.parent=e),r}function L(e){const t=e;if(!t)return{};if("string"===typeof t)return{error:()=>t};if(void 0!==(null===t||void 0===t?void 0:t.message)){if(void 0!==(null===t||void 0===t?void 0:t.error))throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"===typeof t.error?(0,r.A)((0,r.A)({},t),{},{error:()=>t.error}):t}function B(e){let t;return new Proxy({},{get(n,r,i){var o;return null!==(o=t)&&void 0!==o||(t=e()),Reflect.get(t,r,i)},set(n,r,i,o){var a;return null!==(a=t)&&void 0!==a||(t=e()),Reflect.set(t,r,i,o)},has(n,r){var i;return null!==(i=t)&&void 0!==i||(t=e()),Reflect.has(t,r)},deleteProperty(n,r){var i;return null!==(i=t)&&void 0!==i||(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){var r;return null!==(r=t)&&void 0!==r||(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){var i;return null!==(i=t)&&void 0!==i||(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){var o;return null!==(o=t)&&void 0!==o||(t=e()),Reflect.defineProperty(t,r,i)}})}function z(e){return"bigint"===typeof e?e.toString()+"n":"string"===typeof e?'"'.concat(e,'"'):"".concat(e)}function U(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}const G={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},H={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function W(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return F(e,w(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error('Unrecognized key: "'.concat(r,'"'));t[r]&&(e[r]=n.shape[r])}return b(this,"shape",e),e},checks:[]}))}function V(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=w(e._zod.def,{get shape(){const i=(0,r.A)({},e._zod.def.shape);for(const e in t){if(!(e in n.shape))throw new Error('Unrecognized key: "'.concat(e,'"'));t[e]&&delete i[e]}return b(this,"shape",i),i},checks:[]});return F(e,o)}function q(e,t){if(!O(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=w(e._zod.def,{get shape(){const n=(0,r.A)((0,r.A)({},e._zod.def.shape),t);return b(this,"shape",n),n}});return F(e,i)}function K(e,t){if(!O(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=w(e._zod.def,{get shape(){const n=(0,r.A)((0,r.A)({},e._zod.def.shape),t);return b(this,"shape",n),n}});return F(e,n)}function Y(e,t){const n=w(e._zod.def,{get shape(){const n=(0,r.A)((0,r.A)({},e._zod.def.shape),t._zod.def.shape);return b(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return F(e,n)}function X(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=w(t._zod.def,{get shape(){const i=t._zod.def.shape,o=(0,r.A)({},i);if(n)for(const t in n){if(!(t in i))throw new Error('Unrecognized key: "'.concat(t,'"'));n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return b(this,"shape",o),o},checks:[]});return F(t,o)}function Q(e,t,n){const i=w(t._zod.def,{get shape(){const i=t._zod.def.shape,o=(0,r.A)({},i);if(n)for(const t in n){if(!(t in o))throw new Error('Unrecognized key: "'.concat(t,'"'));n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return b(this,"shape",o),o}});return F(t,i)}function J(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!0===e.aborted)return!0;for(let r=t;r{var n,r;return null!==(n=(r=t).path)&&void 0!==n||(r.path=[]),t.path.unshift(e),t})}function $(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.message}function ee(e,t,n){var i;const o=(0,r.A)((0,r.A)({},e),{},{path:null!==(i=e.path)&&void 0!==i?i:[]});if(!e.message){var a,s,l,c,u,d,h,f,p,g;const r=null!==(a=null!==(s=null!==(l=null!==(c=$(null===(u=e.inst)||void 0===u||null===(d=u._zod.def)||void 0===d||null===(h=d.error)||void 0===h?void 0:h.call(d,e)))&&void 0!==c?c:$(null===t||void 0===t||null===(f=t.error)||void 0===f?void 0:f.call(t,e)))&&void 0!==l?l:$(null===(p=n.customError)||void 0===p?void 0:p.call(n,e)))&&void 0!==s?s:$(null===(g=n.localeError)||void 0===g?void 0:g.call(n,e)))&&void 0!==a?a:"Invalid input";o.message=r}return delete o.inst,delete o.continue,null!==t&&void 0!==t&&t.reportInput||delete o.input,o}function te(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ne(e){return Array.isArray(e)?"array":"string"===typeof e?"string":"unknown"}function re(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";const t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}function ie(){for(var e=arguments.length,t=new Array(e),n=0;n{let[t,n]=e;return Number.isNaN(Number.parseInt(t,10))}).map(e=>e[1])}function ae(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;re.toString(16).padStart(2,"0")).join("")}class he{constructor(){}}},4507(e,t,n){"use strict";n.d(t,{A:()=>he});var r=n(9950),i=n(89561),o=n.n(i),a=n(41876),s=n.n(a),l=n(24901),c=n.n(l),u=n(26470),d=n.n(u),h="bodyAttributes",f="htmlAttributes",p="titleAttributes",g={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},m=(Object.keys(g).map(function(e){return g[e]}),"charset"),v="cssText",y="href",b="http-equiv",w="innerHTML",A="itemprop",_="name",C="property",x="rel",E="src",S="target",D={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},k="defaultTitle",T="defer",O="encodeSpecialCharacters",I="onChangeClientState",P="titleTemplate",M=Object.keys(D).reduce(function(e,t){return e[D[t]]=t,e},{}),R=[g.NOSCRIPT,g.SCRIPT,g.STYLE],N="data-react-helmet",j="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F=function(){function e(e,t){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},z=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},U=function(e){var t=q(e,g.TITLE),n=q(e,P);if(n&&t)return n.replace(/%s/g,function(){return Array.isArray(t)?t.join(""):t});var r=q(e,k);return t||r||void 0},G=function(e){return q(e,I)||function(){}},H=function(e,t){return t.filter(function(t){return"undefined"!==typeof t[e]}).map(function(t){return t[e]}).reduce(function(e,t){return L({},e,t)},{})},W=function(e,t){return t.filter(function(e){return"undefined"!==typeof e[g.BASE]}).map(function(e){return e[g.BASE]}).reverse().reduce(function(t,n){if(!t.length)for(var r=Object.keys(n),i=0;i=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},K=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){K(t)},0)}}(),Y=function(e){return clearTimeout(e)},X="undefined"!==typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||K:n.g.requestAnimationFrame||K,Q="undefined"!==typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Y:n.g.cancelAnimationFrame||Y,J=function(e){return console&&"function"===typeof console.warn&&console.warn(e)},Z=null,$=function(e,t){var n=e.baseTag,r=e.bodyAttributes,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,s=e.noscriptTags,l=e.onChangeClientState,c=e.scriptTags,u=e.styleTags,d=e.title,h=e.titleAttributes;ne(g.BODY,r),ne(g.HTML,i),te(d,h);var f={baseTag:re(g.BASE,n),linkTags:re(g.LINK,o),metaTags:re(g.META,a),noscriptTags:re(g.NOSCRIPT,s),scriptTags:re(g.SCRIPT,c),styleTags:re(g.STYLE,u)},p={},m={};Object.keys(f).forEach(function(e){var t=f[e],n=t.newTags,r=t.oldTags;n.length&&(p[e]=n),r.length&&(m[e]=f[e].oldTags)}),t&&t(),l(e,p,m)},ee=function(e){return Array.isArray(e)?e.join(""):e},te=function(e,t){"undefined"!==typeof e&&document.title!==e&&(document.title=ee(e)),ne(g.TITLE,t)},ne=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(N),i=r?r.split(","):[],o=[].concat(i),a=Object.keys(t),s=0;s=0;d--)n.removeAttribute(o[d]);i.length===o.length?n.removeAttribute(N):n.getAttribute(N)!==a.join(",")&&n.setAttribute(N,a.join(","))}},re=function(e,t){var n=document.head||document.querySelector(g.HEAD),r=n.querySelectorAll(e+"["+N+"]"),i=Array.prototype.slice.call(r),o=[],a=void 0;return t&&t.length&&t.forEach(function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===w)n.innerHTML=t.innerHTML;else if(r===v)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var s="undefined"===typeof t[r]?"":t[r];n.setAttribute(r,s)}n.setAttribute(N,"true"),i.some(function(e,t){return a=t,n.isEqualNode(e)})?i.splice(a,1):o.push(n)}),i.forEach(function(e){return e.parentNode.removeChild(e)}),o.forEach(function(e){return n.appendChild(e)}),{oldTags:i,newTags:o}},ie=function(e){return Object.keys(e).reduce(function(t,n){var r="undefined"!==typeof e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r},"")},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce(function(t,n){return t[D[n]||n]=e[n],t},t)},ae=function(e,t,n){switch(e){case g.TITLE:return{toComponent:function(){return function(e,t,n){var i,o=((i={key:t})[N]=!0,i),a=oe(n,o);return[r.createElement(g.TITLE,a,t)]}(0,t.title,t.titleAttributes)},toString:function(){return function(e,t,n,r){var i=ie(n),o=ee(t);return i?"<"+e+" "+N+'="true" '+i+">"+z(o,r)+"":"<"+e+" "+N+'="true">'+z(o,r)+""}(e,t.title,t.titleAttributes,n)}};case h:case f:return{toComponent:function(){return oe(t)},toString:function(){return ie(t)}};default:return{toComponent:function(){return function(e,t){return t.map(function(t,n){var i,o=((i={key:n})[N]=!0,i);return Object.keys(t).forEach(function(e){var n=D[e]||e;if(n===w||n===v){var r=t.innerHTML||t.cssText;o.dangerouslySetInnerHTML={__html:r}}else o[n]=t[e]}),r.createElement(e,o)})}(e,t)},toString:function(){return function(e,t,n){return t.reduce(function(t,r){var i=Object.keys(r).filter(function(e){return!(e===w||e===v)}).reduce(function(e,t){var i="undefined"===typeof r[t]?t:t+'="'+z(r[t],n)+'"';return e?e+" "+i:i},""),o=r.innerHTML||r.cssText||"",a=-1===R.indexOf(e);return t+"<"+e+" "+N+'="true" '+i+(a?"/>":">"+o+"")},"")}(e,t,n)}}}},se=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,s=e.noscriptTags,l=e.scriptTags,c=e.styleTags,u=e.title,d=void 0===u?"":u,p=e.titleAttributes;return{base:ae(g.BASE,t,r),bodyAttributes:ae(h,n,r),htmlAttributes:ae(f,i,r),link:ae(g.LINK,o,r),meta:ae(g.META,a,r),noscript:ae(g.NOSCRIPT,s,r),script:ae(g.SCRIPT,l,r),style:ae(g.STYLE,c,r),title:ae(g.TITLE,{title:d,titleAttributes:p},r)}},le=function(e){var t,n;return n=t=function(t){function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,t.apply(this,arguments))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),n.prototype.shouldComponentUpdate=function(e){return!c()(this.props,e)},n.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case g.SCRIPT:case g.NOSCRIPT:return{innerHTML:t};case g.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},n.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,i=e.newChildProps,o=e.nestedChildren;return L({},r,((t={})[n.type]=[].concat(r[n.type]||[],[L({},i,this.mapNestedChildrenToProps(n,o))]),t))},n.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,i=e.newProps,o=e.newChildProps,a=e.nestedChildren;switch(r.type){case g.TITLE:return L({},i,((t={})[r.type]=a,t.titleAttributes=L({},o),t));case g.BODY:return L({},i,{bodyAttributes:L({},o)});case g.HTML:return L({},i,{htmlAttributes:L({},o)})}return L({},i,((n={})[r.type]=L({},o),n))},n.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=L({},t);return Object.keys(e).forEach(function(t){var r;n=L({},n,((r={})[t]=e[t],r))}),n},n.prototype.warnOnInvalidChildren=function(e,t){return!0},n.prototype.mapChildrenToProps=function(e,t){var n=this,i={};return r.Children.forEach(e,function(e){if(e&&e.props){var r=e.props,o=r.children,a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce(function(t,n){return t[M[n]||n]=e[n],t},t)}(B(r,["children"]));switch(n.warnOnInvalidChildren(e,o),e.type){case g.LINK:case g.META:case g.NOSCRIPT:case g.SCRIPT:case g.STYLE:i=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:i,newChildProps:a,nestedChildren:o});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:a,nestedChildren:o})}}}),t=this.mapArrayTypeChildrenToProps(i,t)},n.prototype.render=function(){var t=this.props,n=t.children,i=B(t,["children"]),o=L({},i);return n&&(o=this.mapChildrenToProps(n,o)),r.createElement(e,o)},F(n,null,[{key:"canUseDOM",set:function(t){e.canUseDOM=t}}]),n}(r.Component),t.propTypes={base:o().object,bodyAttributes:o().object,children:o().oneOfType([o().arrayOf(o().node),o().node]),defaultTitle:o().string,defer:o().bool,encodeSpecialCharacters:o().bool,htmlAttributes:o().object,link:o().arrayOf(o().object),meta:o().arrayOf(o().object),noscript:o().arrayOf(o().object),onChangeClientState:o().func,script:o().arrayOf(o().object),style:o().arrayOf(o().object),title:o().string,titleAttributes:o().object,titleTemplate:o().string},t.defaultProps={defer:!0,encodeSpecialCharacters:!0},t.peek=e.peek,t.rewind=function(){var t=e.rewind();return t||(t=se({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),t},n}(s()(function(e){return{baseTag:W([y,S],e),bodyAttributes:H(h,e),defer:q(e,T),encode:q(e,O),htmlAttributes:H(f,e),linkTags:V(g.LINK,[x,y],e),metaTags:V(g.META,[_,m,b,C,A],e),noscriptTags:V(g.NOSCRIPT,[w],e),onChangeClientState:G(e),scriptTags:V(g.SCRIPT,[E,w],e),styleTags:V(g.STYLE,[v],e),title:U(e),titleAttributes:H(p,e)}},function(e){Z&&Q(Z),e.defer?Z=X(function(){$(e,function(){Z=null})}):($(e),Z=null)},se)(function(){return null}));le.renderStatic=le.rewind;var ce=n(63027),ue=n(44414);const de=e=>{let{title:t}=e;return(0,ue.jsx)(le,{titleTemplate:"%s | HyperClarity",defaultTitle:"HyperClarity",children:(0,ue.jsx)("title",{children:t})})},he=e=>{let{title:t,titleId:n}=e;return n?(0,ue.jsx)(ce.A,{id:n,children:e=>(0,ue.jsx)(de,{title:e})}):(0,ue.jsx)(de,{title:t})}},4516(e,t,n){"use strict";n.d(t,{A:()=>r});const r=(0,n(46666).A)()},4633(e,t,n){var r=n(25172),i=n(16993),o=n(55869),a=n(887),s=n(11791),l=n(4373),c=n(30579);function u(){"use strict";var t=i(),n=t.m(u),d=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))}var f={throw:1,return:2,break:3,continue:3};function p(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,f[e],t)},delegateYield:function(e,i,o){return t.resultName=i,n(r.d,c(e),o)},finish:function(e){return n(r.f,e)}},n=function(e,n,i){r.p=t.prev,r.n=t.next;try{return e(n,i)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=u=function(){return{wrap:function(e,n,r,i){return t.w(p(e),n,r,i&&i.reverse())},isGeneratorFunction:h,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,n,r,i){return(h(t)?a:o)(p(e),t,n,r,i)},keys:l,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=u,e.exports.__esModule=!0,e.exports.default=e.exports},4639(e){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return a(e)?e:K(e)}function r(e){return s(e)?e:Y(e)}function i(e){return l(e)?e:X(e)}function o(e){return a(e)&&!c(e)?e:Q(e)}function a(e){return!(!e||!e[d])}function s(e){return!(!e||!e[h])}function l(e){return!(!e||!e[f])}function c(e){return s(e)||l(e)}function u(e){return!(!e||!e[p])}t(r,n),t(i,n),t(o,n),n.isIterable=a,n.isKeyed=s,n.isIndexed=l,n.isAssociative=c,n.isOrdered=u,n.Keyed=r,n.Indexed=i,n.Set=o;var d="@@__IMMUTABLE_ITERABLE__@@",h="@@__IMMUTABLE_KEYED__@@",f="@@__IMMUTABLE_INDEXED__@@",p="@@__IMMUTABLE_ORDERED__@@",g="delete",m=5,v=1<>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?S(e)+t:t}function k(){return!0}function T(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function O(e,t){return P(e,t,0)}function I(e,t){return P(e,t,t)}function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var M=0,R=1,N=2,j="function"===typeof Symbol&&Symbol.iterator,F="@@iterator",L=j||F;function B(e){this.next=e}function z(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function U(){return{value:void 0,done:!0}}function G(e){return!!V(e)}function H(e){return e&&"function"===typeof e.next}function W(e){var t=V(e);return t&&t.call(e)}function V(e){var t=e&&(j&&e[j]||e[F]);if("function"===typeof t)return t}function q(e){return e&&"number"===typeof e.length}function K(e){return null===e||void 0===e?ae():a(e)?e.toSeq():ce(e)}function Y(e){return null===e||void 0===e?ae().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function X(e){return null===e||void 0===e?ae():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():le(e)}function Q(e){return(null===e||void 0===e?ae():a(e)?s(e)?e.entrySeq():e:le(e)).toSetSeq()}B.prototype.toString=function(){return"[Iterator]"},B.KEYS=M,B.VALUES=R,B.ENTRIES=N,B.prototype.inspect=B.prototype.toSource=function(){return this.toString()},B.prototype[L]=function(){return this},t(K,n),K.of=function(){return K(arguments)},K.prototype.toSeq=function(){return this},K.prototype.toString=function(){return this.__toString("Seq {","}")},K.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},K.prototype.__iterate=function(e,t){return de(this,e,t,!0)},K.prototype.__iterator=function(e,t){return he(this,e,t,!0)},t(Y,K),Y.prototype.toKeyedSeq=function(){return this},t(X,K),X.of=function(){return X(arguments)},X.prototype.toIndexedSeq=function(){return this},X.prototype.toString=function(){return this.__toString("Seq [","]")},X.prototype.__iterate=function(e,t){return de(this,e,t,!1)},X.prototype.__iterator=function(e,t){return he(this,e,t,!1)},t(Q,K),Q.of=function(){return Q(arguments)},Q.prototype.toSetSeq=function(){return this},K.isSeq=oe,K.Keyed=Y,K.Set=Q,K.Indexed=X;var J,Z,$,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function ie(e){this._iterator=e,this._iteratorCache=[]}function oe(e){return!(!e||!e[ee])}function ae(){return J||(J=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():H(e)?new ie(e).fromEntrySeq():G(e)?new re(e).fromEntrySeq():"object"===typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function le(e){var t=ue(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ce(e){var t=ue(e)||"object"===typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function ue(e){return q(e)?new te(e):H(e)?new ie(e):G(e)?new re(e):void 0}function de(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function he(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new B(function(){var e=i[n?o-a:a];return a++>o?U():z(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function fe(e,t){return t?pe(t,e,"",{"":e}):ge(e)}function pe(e,t,n,r){return Array.isArray(t)?e.call(r,n,X(t).map(function(n,r){return pe(e,n,r,t)})):me(t)?e.call(r,n,Y(t).map(function(n,r){return pe(e,n,r,t)})):t}function ge(e){return Array.isArray(e)?X(e).map(ge).toList():me(e)?Y(e).map(ge).toMap():e}function me(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ve(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"===typeof e.valueOf&&"function"===typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!==typeof e.equals||"function"!==typeof t.equals||!e.equals(t))}function ye(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||l(e)!==l(t)||u(e)!==u(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(u(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&ve(i[1],e)&&(n||ve(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"===typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var d=!0,h=t.__iterate(function(t,r){if(n?!e.has(t):i?!ve(t,e.get(r,b)):!ve(e.get(r,b),t))return d=!1,!1});return d&&e.size===h}function be(e,t){if(!(this instanceof be))return new be(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(Z)return Z;Z=this}}function we(e,t){if(!e)throw new Error(t)}function Ae(e,t,n){if(!(this instanceof Ae))return new Ae(e,t,n);if(we(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),tr?U():z(e,i,n[t?r-i++:i++])})},t(ne,Y),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new B(function(){var a=r[t?i-o:o];return o++>i?U():z(e,a,n[a])})},ne.prototype[p]=!0,t(re,X),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=W(this._iterable),r=0;if(H(n))for(var i;!(i=n.next()).done&&!1!==e(i.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=W(this._iterable);if(!H(n))return new B(U);var r=0;return new B(function(){var t=n.next();return t.done?t:z(e,r++,t.value)})},t(ie,X),ie.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,i=this._iteratorCache,o=0;o=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return z(e,i,r[i++])})},t(be,X),be.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},be.prototype.get=function(e,t){return this.has(e)?this._value:t},be.prototype.includes=function(e){return ve(this._value,e)},be.prototype.slice=function(e,t){var n=this.size;return T(e,t,n)?this:new be(this._value,I(t,n)-O(e,n))},be.prototype.reverse=function(){return this},be.prototype.indexOf=function(e){return ve(this._value,e)?0:-1},be.prototype.lastIndexOf=function(e){return ve(this._value,e)?this.size:-1},be.prototype.__iterate=function(e,t){for(var n=0;n1?" by "+this._step:"")+" ]"},Ae.prototype.get=function(e,t){return this.has(e)?this._start+D(this,e)*this._step:t},Ae.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t=0&&nn?U():z(e,o++,a)})},Ae.prototype.equals=function(e){return e instanceof Ae?this._start===e._start&&this._end===e._end&&this._step===e._step:ye(this,e)},t(_e,n),t(Ce,_e),t(xe,_e),t(Ee,_e),_e.Keyed=Ce,_e.Indexed=xe,_e.Set=Ee;var Se="function"===typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function De(e){return e>>>1&1073741824|3221225471&e}function ke(e){if(!1===e||null===e||void 0===e)return 0;if("function"===typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return De(n)}if("string"===t)return e.length>Be?Te(e):Oe(e);if("function"===typeof e.hashCode)return e.hashCode();if("object"===t)return Ie(e);if("function"===typeof e.toString)return Oe(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function Te(e){var t=Ge[e];return void 0===t&&(t=Oe(e),Ue===ze&&(Ue=0,Ge={}),Ue++,Ge[e]=t),t}function Oe(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}var Ne,je="function"===typeof WeakMap;je&&(Ne=new WeakMap);var Fe=0,Le="__immutablehash__";"function"===typeof Symbol&&(Le=Symbol(Le));var Be=16,ze=255,Ue=0,Ge={};function He(e){we(e!==1/0,"Cannot perform this action with an infinite size.")}function We(e){return null===e||void 0===e?it():Ve(e)&&!u(e)?e:it().withMutations(function(t){var n=r(e);He(n.size),n.forEach(function(e,n){return t.set(n,e)})})}function Ve(e){return!(!e||!e[Ke])}t(We,Ce),We.prototype.toString=function(){return this.__toString("Map {","}")},We.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},We.prototype.set=function(e,t){return ot(this,e,t)},We.prototype.setIn=function(e,t){return this.updateIn(e,b,function(){return t})},We.prototype.remove=function(e){return ot(this,e,b)},We.prototype.deleteIn=function(e){return this.updateIn(e,function(){return b})},We.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},We.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=mt(this,_n(e),t,n);return r===b?void 0:r},We.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):it()},We.prototype.merge=function(){return ht(this,void 0,arguments)},We.prototype.mergeWith=function(t){return ht(this,t,e.call(arguments,1))},We.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,it(),function(e){return"function"===typeof e.merge?e.merge.apply(e,n):n[n.length-1]})},We.prototype.mergeDeep=function(){return ht(this,ft,arguments)},We.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return ht(this,pt(t),n)},We.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,it(),function(e){return"function"===typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]})},We.prototype.sort=function(e){return Gt(dn(this,e))},We.prototype.sortBy=function(e,t){return Gt(dn(this,t,e))},We.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},We.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new x)},We.prototype.asImmutable=function(){return this.__ensureOwner()},We.prototype.wasAltered=function(){return this.__altered},We.prototype.__iterator=function(e,t){return new et(this,e,t)},We.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},We.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?rt(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},We.isMap=Ve;var qe,Ke="@@__IMMUTABLE_MAP__@@",Ye=We.prototype;function Xe(e,t){this.ownerID=e,this.entries=t}function Qe(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Je(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Ze(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function $e(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function et(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&nt(e._root)}function tt(e,t){return z(e,t[0],t[1])}function nt(e,t){return{node:e,index:0,__prev:t}}function rt(e,t,n,r){var i=Object.create(Ye);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function it(){return qe||(qe=rt(0))}function ot(e,t,n){var r,i;if(e._root){var o=_(w),a=_(A);if(r=at(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===b?-1:1:0)}else{if(n===b)return e;i=1,r=new Xe(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?rt(i,r):it()}function at(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===b?e:(C(s),C(a),new $e(t,r,[i,o]))}function st(e){return e.constructor===$e||e.constructor===Ze}function lt(e,t,n,r,i){if(e.keyHash===r)return new Ze(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&y,s=(0===n?r:r>>>n)&y;return new Qe(t,1<>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new Je(e,o+1,a)}function ht(e,t,n){for(var i=[],o=0;o>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function yt(e,t,n,r){var i=r?e:E(e);return i[t]=n,i}function bt(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s=At)return ct(e,l,r,i);var h=e&&e===this.ownerID,f=h?l:E(l);return d?s?c===u-1?f.pop():f[c]=f.pop():f[c]=[r,i]:f.push([r,i]),h?(this.entries=f,this):new Xe(e,f)}},Qe.prototype.get=function(e,t,n,r){void 0===t&&(t=ke(n));var i=1<<((0===e?t:t>>>e)&y),o=this.bitmap;return 0===(o&i)?r:this.nodes[vt(o&i-1)].get(e+m,t,n,r)},Qe.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=ke(r));var s=(0===t?n:n>>>t)&y,l=1<=_t)return dt(e,h,c,s,p);if(u&&!p&&2===h.length&&st(h[1^d]))return h[1^d];if(u&&p&&1===h.length&&st(p))return p;var g=e&&e===this.ownerID,v=u?p?c:c^l:c|l,w=u?p?yt(h,d,p,g):wt(h,d,g):bt(h,d,p,g);return g?(this.bitmap=v,this.nodes=w,this):new Qe(e,v,w)},Je.prototype.get=function(e,t,n,r){void 0===t&&(t=ke(n));var i=(0===e?t:t>>>e)&y,o=this.nodes[i];return o?o.get(e+m,t,n,r):r},Je.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=ke(r));var s=(0===t?n:n>>>t)&y,l=i===b,c=this.nodes,u=c[s];if(l&&!u)return this;var d=at(u,e,t+m,n,r,i,o,a);if(d===u)return this;var h=this.count;if(u){if(!d&&--h0&&r=0&&e>>t&y;if(r>=this.array.length)return new kt([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-m,n))===a&&o)return this}if(o&&!i)return this;var s=Ft(this,e);if(!o)for(var l=0;l>>t&y;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((r=o&&o.removeAfter(e,t-m,n))===o&&i===this.array.length-1)return this}var a=Ft(this,e);return a.array.splice(i+1),r&&(a.array[i]=r),a};var Tt,Ot,It={};function Pt(e,t){var n=e._origin,r=e._capacity,i=Ut(r),o=e._tail;return a(e._root,e._level,0);function a(e,t,n){return 0===t?s(e,n):l(e,t,n)}function s(e,a){var s=a===i?o&&o.array:e&&e.array,l=a>n?0:n-a,c=r-a;return c>v&&(c=v),function(){if(l===c)return It;var e=t?--c:l++;return s&&s[e]}}function l(e,i,o){var s,l=e&&e.array,c=o>n?0:n-o>>i,u=1+(r-o>>i);return u>v&&(u=v),function(){for(;;){if(s){var e=s();if(e!==It)return e;s=null}if(c===u)return It;var n=t?--u:c++;s=a(l&&l[n],i-m,o+(n<=e.size||t<0)return e.withMutations(function(e){t<0?Bt(e,t).set(0,n):Bt(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=_(A);return t>=Ut(e._capacity)?r=jt(r,e.__ownerID,0,t,n,o):i=jt(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):Mt(e._origin,e._capacity,e._level,i,r):e}function jt(e,t,n,r,i,o){var a,s=r>>>n&y,l=e&&s0){var c=e&&e.array[s],u=jt(c,t,n-m,r,i,o);return u===c?e:((a=Ft(e,t)).array[s]=u,a)}return l&&e.array[s]===i?e:(C(o),a=Ft(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function Ft(e,t){return t&&e&&t===e.ownerID?e:new kt(e?e.array.slice():[],t)}function Lt(e,t){if(t>=Ut(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&y],r-=m;return n}}function Bt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new x,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var l=e._level,c=e._root,u=0;a+u<0;)c=new kt(c&&c.array.length?[void 0,c]:[],r),u+=1<<(l+=m);u&&(a+=u,i+=u,s+=u,o+=u);for(var d=Ut(o),h=Ut(s);h>=1<d?new kt([],r):f;if(f&&h>d&&am;v-=m){var b=d>>>v&y;g=g.array[b]=Ft(g.array[b],r)}g.array[d>>>m&y]=f}if(s=h)a-=h,s-=h,l=m,c=null,p=p&&p.removeBefore(r,0,a);else if(a>i||h>>l&y;if(w!==h>>>l&y)break;w&&(u+=(1<i&&(c=c.removeBefore(r,l,a-u)),c&&ho&&(o=c.size),a(l)||(c=c.map(function(e){return fe(e)})),r.push(c)}return o>e.size&&(e=e.setSize(o)),gt(e,t,r)}function Ut(e){return e>>m<=v&&a.size>=2*o.size?(r=(i=a.filter(function(e,t){return void 0!==e&&s!==t})).toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(l){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):Wt(r,i)}function Kt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Yt(e){this._iter=e,this.size=e.size}function Xt(e){this._iter=e,this.size=e.size}function Qt(e){this._iter=e,this.size=e.size}function Jt(e){var t=bn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=wn,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===N){var r=e.__iterator(t,n);return new B(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===R?M:R,n)},t}function Zt(e,t,n){var r=bn(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,b);return o===b?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(N,i);return new B(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return z(r,s,t.call(n,a[1],s,e),i)})},r}function $t(e,t){var n=bn(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Jt(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=wn,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function en(e,t,n,r){var i=bn(e);return r&&(i.has=function(r){var i=e.get(r,b);return i!==b&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,b);return o!==b&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,l){if(t.call(n,e,o,l))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(N,o),s=0;return new B(function(){for(;;){var o=a.next();if(o.done)return o;var l=o.value,c=l[0],u=l[1];if(t.call(n,u,c,e))return z(i,r?c:s++,u,o)}})},i}function tn(e,t,n){var r=We().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}function nn(e,t,n){var r=s(e),i=(u(e)?Gt():We()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return(e=e||[]).push(r?[a,o]:o),e})});var o=yn(e);return i.map(function(t){return gn(e,o(t))})}function rn(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n|=0),T(t,n,i))return e;var o=O(t,i),a=I(n,i);if(o!==o||a!==a)return rn(e.toSeq().cacheResult(),t,n,r);var s,l=a-o;l===l&&(s=l<0?0:l);var c=bn(e);return c.size=0===s?s:e.size&&s||void 0,!r&&oe(e)&&s>=0&&(c.get=function(t,n){return(t=D(this,t))>=0&&ts)return U();var e=i.next();return r||t===R?e:z(t,l-1,t===M?void 0:e.value[1],e)})},c}function on(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(N,i),s=!0;return new B(function(){if(!s)return U();var e=a.next();if(e.done)return e;var i=e.value,l=i[0],c=i[1];return t.call(n,c,l,o)?r===N?e:z(r,l,c,e):(s=!1,U())})},r}function an(e,t,n,r){var i=bn(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,l=0;return e.__iterate(function(e,o,c){if(!s||!(s=t.call(n,e,o,c)))return l++,i(e,r?o:l-1,a)}),l},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(N,o),l=!0,c=0;return new B(function(){var e,o,u;do{if((e=s.next()).done)return r||i===R?e:z(i,c++,i===M?void 0:e.value[1],e);var d=e.value;o=d[0],u=d[1],l&&(l=t.call(n,u,o,a))}while(l);return i===N?e:z(i,o,u,e)})},i}function sn(e,t){var n=s(e),i=[e].concat(t).map(function(e){return a(e)?n&&(e=r(e)):e=n?se(e):le(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var o=i[0];if(o===e||n&&s(o)||l(e)&&l(o))return o}var c=new te(i);return n?c=c.toKeyedSeq():l(e)||(c=c.toSetSeq()),(c=c.flatten(!0)).size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),c}function ln(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,i){var o=0,s=!1;function l(e,c){var u=this;e.__iterate(function(e,i){return(!t||c0}function pn(e,t,r){var i=bn(e);return i.size=new te(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(R,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=n(e),W(i?e.reverse():e)}),a=0,s=!1;return new B(function(){var n;return s||(n=o.map(function(e){return e.next()}),s=n.some(function(e){return e.done})),s?U():z(e,a++,t.apply(null,n.map(function(e){return e.value})))})},i}function gn(e,t){return oe(e)?t:e.constructor(t)}function mn(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function vn(e){return He(e.size),S(e)}function yn(e){return s(e)?r:l(e)?i:o}function bn(e){return Object.create((s(e)?Y:l(e)?X:Q).prototype)}function wn(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):K.prototype.cacheResult.call(this)}function An(e,t){return e>t?1:e=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Yn(e,t)},Hn.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;He(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Yn(t,n)},Hn.prototype.pop=function(){return this.slice(1)},Hn.prototype.unshift=function(){return this.push.apply(this,arguments)},Hn.prototype.unshiftAll=function(e){return this.pushAll(e)},Hn.prototype.shift=function(){return this.pop.apply(this,arguments)},Hn.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xn()},Hn.prototype.slice=function(e,t){if(T(e,t,this.size))return this;var n=O(e,this.size);if(I(t,this.size)!==this.size)return xe.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Yn(r,i)},Hn.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Yn(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Hn.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Hn.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new B(function(){if(r){var t=r.value;return r=r.next,z(e,n++,t)}return U()})},Hn.isStack=Wn;var Vn,qn="@@__IMMUTABLE_STACK__@@",Kn=Hn.prototype;function Yn(e,t,n,r){var i=Object.create(Kn);return i.size=e,i._head=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function Xn(){return Vn||(Vn=Yn(0))}function Qn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}Kn[qn]=!0,Kn.withMutations=Ye.withMutations,Kn.asMutable=Ye.asMutable,Kn.asImmutable=Ye.asImmutable,Kn.wasAltered=Ye.wasAltered,n.Iterator=B,Qn(n,{toArray:function(){He(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new Yt(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"===typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"===typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new Kt(this,!0)},toMap:function(){return We(this.toKeyedSeq())},toObject:function(){He(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Gt(this.toKeyedSeq())},toOrderedSet:function(){return Fn(s(this)?this.valueSeq():this)},toSet:function(){return Tn(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Xt(this)},toSeq:function(){return l(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Hn(s(this)?this.valueSeq():this)},toList:function(){return xt(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return gn(this,sn(this,e.call(arguments,0)))},includes:function(e){return this.some(function(t){return ve(t,e)})},entries:function(){return this.__iterator(N)},every:function(e,t){He(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return gn(this,en(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},findEntry:function(e,t){var n;return this.__iterate(function(r,i,o){if(e.call(t,r,i,o))return n=[i,r],!1}),n},findLastEntry:function(e,t){return this.toSeq().reverse().findEntry(e,t)},forEach:function(e,t){return He(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){He(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(M)},map:function(e,t){return gn(this,Zt(this,e,t))},reduce:function(e,t,n){var r,i;return He(this.size),arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return gn(this,$t(this,!0))},slice:function(e,t){return gn(this,rn(this,e,t,!0))},some:function(e,t){return!this.every(tr(e),t)},sort:function(e){return gn(this,dn(this,e))},values:function(){return this.__iterator(R)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return S(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return tn(this,e,t)},equals:function(e){return ye(this,e)},entrySeq:function(){var e=this;if(e._cache)return new te(e._cache);var t=e.toSeq().map(er).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(tr(e),t)},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},first:function(){return this.find(k)},flatMap:function(e,t){return gn(this,cn(this,e,t))},flatten:function(e){return gn(this,ln(this,e,!0))},fromEntrySeq:function(){return new Qt(this)},get:function(e,t){return this.find(function(t,n){return ve(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=_n(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,b):b)===b)return t}return r},groupBy:function(e,t){return nn(this,e,t)},has:function(e){return this.get(e,b)!==b},hasIn:function(e){return this.getIn(e,b)!==b},isSubset:function(e){return e="function"===typeof e.includes?e:n(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return(e="function"===typeof e.isSubset?e:n(e)).isSubset(this)},keySeq:function(){return this.toSeq().map($n).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(e){return hn(this,e)},maxBy:function(e,t){return hn(this,t,e)},min:function(e){return hn(this,e?nr(e):or)},minBy:function(e,t){return hn(this,t?nr(t):or,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return gn(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return gn(this,an(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(tr(e),t)},sortBy:function(e,t){return gn(this,dn(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return gn(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return gn(this,on(this,e,t))},takeUntil:function(e,t){return this.takeWhile(tr(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=ar(this))}});var Jn=n.prototype;Jn[d]=!0,Jn[L]=Jn.values,Jn.__toJS=Jn.toArray,Jn.__toStringMapper=rr,Jn.inspect=Jn.toSource=function(){return this.toString()},Jn.chain=Jn.flatMap,Jn.contains=Jn.includes,function(){try{Object.defineProperty(Jn,"length",{get:function(){if(!n.noLengthWarning){var e;try{throw new Error}catch(t){e=t.stack}if(-1===e.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+e),this.size}}})}catch(e){}}(),Qn(r,{flip:function(){return gn(this,Jt(this))},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLastKey:function(e,t){return this.toSeq().reverse().findKey(e,t)},keyOf:function(e){return this.findKey(function(t){return ve(t,e)})},lastKeyOf:function(e){return this.findLastKey(function(t){return ve(t,e)})},mapEntries:function(e,t){var n=this,r=0;return gn(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return gn(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var Zn=r.prototype;function $n(e,t){return t}function er(e,t){return[t,e]}function tr(e){return function(){return!e.apply(this,arguments)}}function nr(e){return function(){return-e.apply(this,arguments)}}function rr(e){return"string"===typeof e?JSON.stringify(e):e}function ir(){return E(arguments)}function or(e,t){return et?-1:0}function ar(e){if(e.size===1/0)return 0;var t=u(e),n=s(e),r=t?1:0;return sr(e.__iterate(n?t?function(e,t){r=31*r+lr(ke(e),ke(t))|0}:function(e,t){r=r+lr(ke(e),ke(t))|0}:t?function(e){r=31*r+ke(e)|0}:function(e){r=r+ke(e)|0}),r)}function sr(e,t){return t=Se(t,3432918353),t=Se(t<<15|t>>>-15,461845907),t=Se(t<<13|t>>>-13,5),t=Se((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=De((t=Se(t^t>>>13,3266489909))^t>>>16)}function lr(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Zn[h]=!0,Zn[L]=Jn.entries,Zn.__toJS=Jn.toObject,Zn.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+rr(e)},Qn(i,{toKeyedSeq:function(){return new Kt(this,!1)},filter:function(e,t){return gn(this,en(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.toKeyedSeq().keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.toKeyedSeq().reverse().keyOf(e);return void 0===t?-1:t},reverse:function(){return gn(this,$t(this,!1))},slice:function(e,t){return gn(this,rn(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=O(e,e<0?this.count():this.size);var r=this.slice(0,e);return gn(this,1===n?r:r.concat(E(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.toKeyedSeq().findLastKey(e,t);return void 0===n?-1:n},first:function(){return this.get(0)},flatten:function(e){return gn(this,ln(this,e,!1))},get:function(e,t){return(e=D(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=D(this,e))>=0&&(void 0!==this.size?this.size===1/0||er});const r={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}},4719(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(9950),i=n(29206),o=n(81788),a=n(68168),s=n(63027);const l=(0,n(95700).A)((0,r.createElement)("path",{d:"M0.99,19h2.42l1.27-3.58h5.65L11.59,19h2.42L8.75,5h-2.5L0.99,19z M5.41,13.39L7.44,7.6h0.12l2.03,5.79H5.41z M20,11h3v2h-3 v3h-2v-3h-3v-2h3V8h2V11z"}),"TextIncrease");var c=n(9638),u=n(44414);const d=e=>{let{handleClose:t}=e;const{onAddText:n}=(0,c.A)();return(0,u.jsxs)(i.A,{button:!0,onClick:()=>{n(),t&&t()},children:[(0,u.jsx)(a.A,{children:(0,u.jsx)(l,{})}),(0,u.jsx)(o.A,{children:(0,u.jsx)(s.A,{id:"addMenu.textCell"})})]})}},4745(e,t,n){"use strict";n.d(t,{A:()=>u});var r=n(9950),i=n(28379),o=n(63027),a=n(52816),s=n(42010),l=n(44414);const c="CookieNote",u=()=>{const[e,t]=(0,i.A)(c),{enqueueSnackbar:n,closeSnackbar:u}=(0,s.A)(),d=(0,r.useCallback)(()=>{t("seen",{expires:3650}),u(c)},[t,u]);return(0,r.useEffect)(()=>{if(e)d();else{const e={persist:!0,preventDuplicate:!0,key:c,anchorOrigin:{horizontal:"center",vertical:"bottom"},action:[(0,l.jsx)(a.A,{onClick:()=>u(c),children:(0,l.jsx)(o.A,{id:"buttonCancel"})},"close"),(0,l.jsx)(a.A,{onClick:d,id:"cookieAccept",color:"primary",children:(0,l.jsx)(o.A,{id:"buttonOk"})},"ok")]};n((0,l.jsx)(o.A,{id:"cookieNote"}),e)}},[e,t,n,u,d]),null}},4746(e,t,n){"use strict";n(77600);e.exports=function(e,t){var n,r=e.getSelection(),i=r.getStartKey(),o=r.getStartOffset(),a=e.getCurrentContent(),s=i;return t>a.getBlockForKey(i).getText().length-o?(s=a.getKeyAfter(i),n=0):n=o+t,r.merge({focusKey:s,focusOffset:n})}},4750(e,t,n){"use strict";n.d(t,{A:()=>g});var r=n(58168),i=n(5544),o=n(80045),a=n(9950),s=n(2803),l=n(67279),c=n(33720),u=n(53128),d=n(74831),h=n(14602),f=n(539),p=a.forwardRef(function(e,t){var n=e.children,c=e.classes,p=e.className,g=e.collapsedHeight,m=e.collapsedSize,v=void 0===m?"0px":m,y=e.component,b=void 0===y?"div":y,w=e.disableStrictModeCompat,A=void 0!==w&&w,_=e.in,C=e.onEnter,x=e.onEntered,E=e.onEntering,S=e.onExit,D=e.onExited,k=e.onExiting,T=e.style,O=e.timeout,I=void 0===O?u.p0.standard:O,P=e.TransitionComponent,M=void 0===P?l.Ay:P,R=(0,o.A)(e,["children","classes","className","collapsedHeight","collapsedSize","component","disableStrictModeCompat","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),N=(0,h.A)(),j=a.useRef(),F=a.useRef(null),L=a.useRef(),B="number"===typeof(g||v)?"".concat(g||v,"px"):g||v;a.useEffect(function(){return function(){clearTimeout(j.current)}},[]);var z=N.unstable_strictMode&&!A,U=a.useRef(null),G=(0,f.A)(t,z?U:void 0),H=function(e){return function(t,n){if(e){var r=z?[U.current,t]:[t,n],o=(0,i.A)(r,2),a=o[0],s=o[1];void 0===s?e(a):e(a,s)}}},W=H(function(e,t){e.style.height=B,C&&C(e,t)}),V=H(function(e,t){var n=F.current?F.current.clientHeight:0,r=(0,d.c)({style:T,timeout:I},{mode:"enter"}).duration;if("auto"===I){var i=N.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(i,"ms"),L.current=i}else e.style.transitionDuration="string"===typeof r?r:"".concat(r,"ms");e.style.height="".concat(n,"px"),E&&E(e,t)}),q=H(function(e,t){e.style.height="auto",x&&x(e,t)}),K=H(function(e){var t=F.current?F.current.clientHeight:0;e.style.height="".concat(t,"px"),S&&S(e)}),Y=H(D),X=H(function(e){var t=F.current?F.current.clientHeight:0,n=(0,d.c)({style:T,timeout:I},{mode:"exit"}).duration;if("auto"===I){var r=N.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(r,"ms"),L.current=r}else e.style.transitionDuration="string"===typeof n?n:"".concat(n,"ms");e.style.height=B,k&&k(e)});return a.createElement(M,(0,r.A)({in:_,onEnter:W,onEntered:q,onEntering:V,onExit:K,onExited:Y,onExiting:X,addEndListener:function(e,t){var n=z?e:t;"auto"===I&&(j.current=setTimeout(n,L.current||0))},nodeRef:z?U:void 0,timeout:"auto"===I?null:I},R),function(e,t){return a.createElement(b,(0,r.A)({className:(0,s.default)(c.root,c.container,p,{entered:c.entered,exited:!_&&"0px"===B&&c.hidden}[e]),style:(0,r.A)({minHeight:B},T),ref:G},t),a.createElement("div",{className:c.wrapper,ref:F},a.createElement("div",{className:c.wrapperInner},n)))})});p.muiSupportAuto=!0;const g=(0,c.A)(function(e){return{root:{height:0,overflow:"hidden",transition:e.transitions.create("height")},entered:{height:"auto",overflow:"visible"},hidden:{visibility:"hidden"},wrapper:{display:"flex"},wrapperInner:{width:"100%"}}},{name:"MuiCollapse"})(p)},4790(e,t,n){"use strict";n.d(t,{lgM:()=>F,jlt:()=>E.jl,mcf:()=>D.mc,A1g:()=>Wn,bRX:()=>E.bR,tS:()=>E.tS,M_G:()=>E.M_,Y7R:()=>j.Y7,A49:()=>j.A4,TEn:()=>E.TE,kxk:()=>Xn,EYj:()=>or,Z1e:()=>rr,xJt:()=>$n,gPd:()=>j.gP,t9Q:()=>xr,W0u:()=>pn.W,WpD:()=>C});const r=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})};const i=function(e){return new this(function(t,n){if(!e||"undefined"===typeof e.length)return n(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var i=r.length;function o(e,n){if(n&&("object"===typeof n||"function"===typeof n)){var a=n.then;if("function"===typeof a)return void a.call(n,function(t){o(e,t)},function(n){r[e]={status:"rejected",reason:n},0===--i&&t(r)})}r[e]={status:"fulfilled",value:n},0===--i&&t(r)}for(var a=0;a0?1:-1}),Number.isInteger||(Number.isInteger=function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e}),globalThis.ArrayBuffer||(globalThis.ArrayBuffer=Array),globalThis.Float32Array||(globalThis.Float32Array=Array),globalThis.Uint32Array||(globalThis.Uint32Array=Array),globalThis.Uint16Array||(globalThis.Uint16Array=Array),globalThis.Uint8Array||(globalThis.Uint8Array=Array),globalThis.Int32Array||(globalThis.Int32Array=Array);var C=n(3945),x=n(11583),E=n(67871),S=n(39503),D=n(36407),k=function(){function e(){this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0,this.global=new E.bR,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}return Object.defineProperty(e.prototype,"pointerId",{get:function(){return this.identifier},enumerable:!1,configurable:!0}),e.prototype.getLocalPosition=function(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)},e.prototype.copyEvent=function(e){"isPrimary"in e&&e.isPrimary&&(this.isPrimary=!0),this.button="button"in e&&e.button;var t="buttons"in e&&e.buttons;this.buttons=Number.isInteger(t)?t:"which"in e&&e.which,this.width="width"in e&&e.width,this.height="height"in e&&e.height,this.tiltX="tiltX"in e&&e.tiltX,this.tiltY="tiltY"in e&&e.tiltY,this.pointerType="pointerType"in e&&e.pointerType,this.pressure="pressure"in e&&e.pressure,this.rotationAngle="rotationAngle"in e&&e.rotationAngle,this.twist="twist"in e&&e.twist||0,this.tangentialPressure="tangentialPressure"in e&&e.tangentialPressure||0},e.prototype.reset=function(){this.isPrimary=!1},e}(),T=function(e,t){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},T(e,t)};var O=function(){function e(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}return e.prototype.stopPropagation=function(){this.stopped=!0,this.stopPropagationHint=!0,this.stopsPropagatingAt=this.currentTarget},e.prototype.reset=function(){this.stopped=!1,this.stopsPropagatingAt=null,this.stopPropagationHint=!1,this.currentTarget=null,this.target=null},e}(),I=function(){function e(t){this._pointerId=t,this._flags=e.FLAGS.NONE}return e.prototype._doSet=function(e,t){this._flags=t?this._flags|e:this._flags&~e},Object.defineProperty(e.prototype,"pointerId",{get:function(){return this._pointerId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"flags",{get:function(){return this._flags},set:function(e){this._flags=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"none",{get:function(){return this._flags===e.FLAGS.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"over",{get:function(){return 0!==(this._flags&e.FLAGS.OVER)},set:function(t){this._doSet(e.FLAGS.OVER,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rightDown",{get:function(){return 0!==(this._flags&e.FLAGS.RIGHT_DOWN)},set:function(t){this._doSet(e.FLAGS.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"leftDown",{get:function(){return 0!==(this._flags&e.FLAGS.LEFT_DOWN)},set:function(t){this._doSet(e.FLAGS.LEFT_DOWN,t)},enumerable:!1,configurable:!0}),e.FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4}),e}(),P=function(){function e(){this._tempPoint=new E.bR}return e.prototype.recursiveFindHit=function(e,t,n,r,i){if(!t||!t.visible)return!1;var o=e.data.global,a=!1,s=i=t.interactive||i,l=!0;if(t.hitArea?(r&&(t.worldTransform.applyInverse(o,this._tempPoint),t.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?a=!0:(r=!1,l=!1)),s=!1):t._mask&&r&&(t._mask.containsPoint&&t._mask.containsPoint(o)||(r=!1)),l&&t.interactiveChildren&&t.children)for(var c=t.children,u=c.length-1;u>=0;u--){var d=c[u],h=this.recursiveFindHit(e,d,n,r,s);if(h){if(!d.parent)continue;s=!1,h&&(e.target&&(r=!1),a=!0)}}return i&&(r&&!e.target&&!t.hitArea&&t.containsPoint&&t.containsPoint(o)&&(a=!0),t.interactive&&(a&&!e.target&&(e.target=t),n&&n(e,t,!!a))),a},e.prototype.findHit=function(e,t,n,r){this.recursiveFindHit(e,t,n,r,!1)},e}(),M={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(e){e?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};D.q9.mixin(M);var R={target:null,data:{global:null}},N=function(e){function t(t,n){var r=e.call(this)||this;return n=n||{},r.renderer=t,r.autoPreventDefault=void 0===n.autoPreventDefault||n.autoPreventDefault,r.interactionFrequency=n.interactionFrequency||10,r.mouse=new k,r.mouse.identifier=1,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[1]=r.mouse,r.interactionDataPool=[],r.eventData=new O,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.tickerAdded=!1,r.mouseOverRenderer=!("PointerEvent"in globalThis),r.supportsTouchEvents="ontouchstart"in globalThis,r.supportsPointerEvents=!!globalThis.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:"inherit",pointer:"pointer"},r.currentCursorMode=null,r.cursor=null,r.resolution=1,r.delayedEvents=[],r.search=new P,r._tempDisplayObject=new D.dC,r._eventListenerOptions={capture:!0,passive:!1},r._useSystemTicker=void 0===n.useSystemTicker||n.useSystemTicker,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}return function(e,t){function n(){this.constructor=e}T(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),Object.defineProperty(t.prototype,"useSystemTicker",{get:function(){return this._useSystemTicker},set:function(e){this._useSystemTicker=e,e?this.addTickerListener():this.removeTickerListener()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastObjectRendered",{get:function(){return this.renderer._lastObjectRendered||this._tempDisplayObject},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(e,t){return R.target=null,R.data.global=e,t||(t=this.lastObjectRendered),this.processInteractive(R,t,null,!0),R.target},t.prototype.setTargetElement=function(e,t){void 0===t&&(t=1),this.removeTickerListener(),this.removeEvents(),this.interactionDOMElement=e,this.resolution=t,this.addEvents(),this.addTickerListener()},t.prototype.addTickerListener=function(){!this.tickerAdded&&this.interactionDOMElement&&this._useSystemTicker&&(S.Rv.system.add(this.tickerUpdate,this,S.dQ.INTERACTION),this.tickerAdded=!0)},t.prototype.removeTickerListener=function(){this.tickerAdded&&(S.Rv.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)},t.prototype.addEvents=function(){if(!this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none"),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.addEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.addEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.eventsAdded=!0}},t.prototype.removeEvents=function(){if(this.eventsAdded&&this.interactionDOMElement){var e=this.interactionDOMElement.style;globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("pointercancel",this.onPointerCancel,this._eventListenerOptions),globalThis.removeEventListener("pointerup",this.onPointerUp,this._eventListenerOptions)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,this._eventListenerOptions),globalThis.removeEventListener("mouseup",this.onPointerUp,this._eventListenerOptions)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,this._eventListenerOptions),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,this._eventListenerOptions)),this.interactionDOMElement=null,this.eventsAdded=!1}},t.prototype.tickerUpdate=function(e){this._deltaTime+=e,this._deltaTime1&&"undefined"===typeof MSStream};var te,ne,re,ie,oe,ae,se,le,ce,ue,de,he,fe,pe,ge,me,ve,ye,be,we=function(e){var t={userAgent:"",platform:"",maxTouchPoints:0};e||"undefined"===typeof navigator?"string"===typeof e?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0}):t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0};var n=t.userAgent,r=n.split("[FBAN");"undefined"!==typeof r[1]&&(n=r[0]),"undefined"!==typeof(r=n.split("Twitter"))[1]&&(n=r[0]);var i=function(e){return function(t){return t.test(e)}}(n),o={apple:{phone:i(B)&&!i(K),ipod:i(z),tablet:!i(B)&&(i(U)||ee(t))&&!i(K),universal:i(G),device:(i(B)||i(z)||i(U)||i(G)||ee(t))&&!i(K)},amazon:{phone:i(V),tablet:!i(V)&&i(q),device:i(V)||i(q)},android:{phone:!i(K)&&i(V)||!i(K)&&i(H),tablet:!i(K)&&!i(V)&&!i(H)&&(i(q)||i(W)),device:!i(K)&&(i(V)||i(q)||i(H)||i(W))||i(/\bokhttp\b/i)},windows:{phone:i(K),tablet:i(Y),device:i(K)||i(Y)},other:{blackberry:i(X),blackberry10:i(Q),opera:i(J),firefox:i($),chrome:i(Z),device:i(X)||i(Q)||i(J)||i($)||i(Z)},any:!1,phone:!1,tablet:!1};return o.any=o.apple.device||o.android.device||o.windows.device||o.other.device,o.phone=o.apple.phone||o.android.phone||o.windows.phone,o.tablet=o.apple.tablet||o.android.tablet||o.windows.tablet,o}(globalThis.navigator);!function(e){e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2"}(te||(te={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(ne||(ne={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(re||(re={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR"}(ie||(ie={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(oe||(oe={})),function(e){e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(ae||(ae={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(se||(se={})),function(e){e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT"}(le||(le={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(ce||(ce={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(ue||(ue={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(de||(de={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(he||(he={})),function(e){e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(fe||(fe={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT"}(pe||(pe={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(ge||(ge={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(me||(me={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(ve||(ve={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(ye||(ye={})),function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(be||(be={}));var Ae={MIPMAP_TEXTURES:he.POW2,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,FILTER_MULTISAMPLE:ye.NONE,SPRITE_MAX_TEXTURES:function(e){var t=!0;if(we.tablet||we.phone){var n;if(we.apple.device)if(n=navigator.userAgent.match(/OS (\d+)_(\d+)?/))parseInt(n[1],10)<11&&(t=!1);if(we.android.device)if(n=navigator.userAgent.match(/Android\s([0-9.]*)/))parseInt(n[1],10)<7&&(t=!1)}return t?e:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,autoDensity:!1,backgroundColor:0,backgroundAlpha:1,useContextAlpha:!0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:ge.AUTO,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:de.CLAMP,SCALE_MODE:ue.LINEAR,PRECISION_VERTEX:me.HIGH,PRECISION_FRAGMENT:we.apple.device?me.HIGH:me.MEDIUM,CAN_UPLOAD_SAME_BUFFER:!we.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1,SORTABLE_CHILDREN:!1},_e=function(){function e(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}return e.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?E.M_.EMPTY:((e=e||new E.M_(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addPointMatrix=function(e,t){var n=e.a,r=e.b,i=e.c,o=e.d,a=e.tx,s=e.ty,l=n*t.x+i*t.y+a,c=r*t.x+o*t.y+s;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)},e.prototype.addQuad=function(e){var t=this.minX,n=this.minY,r=this.maxX,i=this.maxY,o=e[0],a=e[1];t=or?o:r,i=a>i?a:i,t=(o=e[2])r?o:r,i=a>i?a:i,t=(o=e[4])r?o:r,i=a>i?a:i,t=(o=e[6])r?o:r,i=a>i?a:i,this.minX=t,this.minY=n,this.maxX=r,this.maxY=i},e.prototype.addFrame=function(e,t,n,r,i){this.addFrameMatrix(e.worldTransform,t,n,r,i)},e.prototype.addFrameMatrix=function(e,t,n,r,i){var o=e.a,a=e.b,s=e.c,l=e.d,c=e.tx,u=e.ty,d=this.minX,h=this.minY,f=this.maxX,p=this.maxY,g=o*t+s*n+c,m=a*t+l*n+u;d=gf?g:f,p=m>p?m:p,d=(g=o*r+s*n+c)f?g:f,p=m>p?m:p,d=(g=o*t+s*i+c)f?g:f,p=m>p?m:p,d=(g=o*r+s*i+c)f?g:f,p=m>p?m:p,this.minX=d,this.minY=h,this.maxX=f,this.maxY=p},e.prototype.addVertexData=function(e,t,n){for(var r=this.minX,i=this.minY,o=this.maxX,a=this.maxY,s=t;so?l:o,a=c>a?c:a}this.minX=r,this.minY=i,this.maxX=o,this.maxY=a},e.prototype.addVertices=function(e,t,n,r){this.addVerticesMatrix(e.worldTransform,t,n,r)},e.prototype.addVerticesMatrix=function(e,t,n,r,i,o){void 0===i&&(i=0),void 0===o&&(o=i);for(var a=e.a,s=e.b,l=e.c,c=e.d,u=e.tx,d=e.ty,h=this.minX,f=this.minY,p=this.maxX,g=this.maxY,m=n;mr?e.maxX:r,this.maxY=e.maxY>i?e.maxY:i},e.prototype.addBoundsMask=function(e,t){var n=e.minX>t.minX?e.minX:t.minX,r=e.minY>t.minY?e.minY:t.minY,i=e.maxXl?i:l,this.maxY=o>c?o:c}},e.prototype.addBoundsMatrix=function(e,t){this.addFrameMatrix(t,e.minX,e.minY,e.maxX,e.maxY)},e.prototype.addBoundsArea=function(e,t){var n=e.minX>t.x?e.minX:t.x,r=e.minY>t.y?e.minY:t.y,i=e.maxXl?i:l,this.maxY=o>c?o:c}},e.prototype.pad=function(e,t){void 0===e&&(e=0),void 0===t&&(t=e),this.isEmpty()||(this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t)},e.prototype.addFramePad=function(e,t,n,r,i,o){e-=i,t-=o,n+=i,r+=o,this.minX=this.minXn?this.maxX:n,this.minY=this.minYr?this.maxY:r},e}(),Ce=function(e,t){return Ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Ce(e,t)};function xe(e,t){function n(){this.constructor=e}Ce(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ee,Se,De,ke,Te,Oe,Ie,Pe,Me,Re,Ne,je,Fe,Le,Be,ze,Ue,Ge,He,We=function(e){function t(){var t=e.call(this)||this;return t.tempDisplayObjectParent=null,t.transform=new E.dL,t.alpha=1,t.visible=!0,t.renderable=!0,t.cullable=!1,t.cullArea=null,t.parent=null,t.worldAlpha=1,t._lastSortedIndex=0,t._zIndex=0,t.filterArea=null,t.filters=null,t._enabledFilters=null,t._bounds=new _e,t._localBounds=null,t._boundsID=0,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._maskRefCount=0,t._destroyed=!1,t.isSprite=!1,t.isMask=!1,t}return xe(t,e),t.mixin=function(e){for(var n=Object.keys(e),r=0;r1)for(var r=0;rthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,this.sortDirty=!0,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),this.emit("childAdded",e,this,t),e},t.prototype.swapChildren=function(e,t){if(e!==t){var n=this.getChildIndex(e),r=this.getChildIndex(t);this.children[n]=t,this.children[r]=e,this.onChildrenChange(n=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var n=this.getChildIndex(e);(0,C.removeItems)(this.children,n,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(){for(var e=arguments,t=[],n=0;n1)for(var r=0;r0&&i<=t){n=this.children.splice(r,i);for(var o=0;o1&&this.children.sort(qe),this.sortDirty=!1},t.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var e=0,t=this.children.length;e0&&n.height>0){var r,i;if(this.cullArea?(r=this.cullArea,i=this.worldTransform):this._render!==t.prototype._render&&(r=this.getBounds(!0)),r&&n.intersects(r,i))this._render(e);else if(this.cullArea)return;for(var o=0,a=this.children.length;o0||t.responseType===e.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2===(r/100|0)){if(this.xhrType===e.XHR_RESPONSE_TYPE.TEXT)this.data=n,this.type=e.TYPE.TEXT;else if(this.xhrType===e.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(n),this.type=e.TYPE.JSON}catch(a){return void this.abort("Error trying to parse loaded json: "+a)}else if(this.xhrType===e.XHR_RESPONSE_TYPE.DOCUMENT)try{if(globalThis.DOMParser){var i=new DOMParser;this.data=i.parseFromString(n,"text/xml")}else{var o=document.createElement("div");o.innerHTML=n,this.data=o}this.type=e.TYPE.XML}catch(s){return void this.abort("Error trying to parse loaded xml: "+s)}else this.data=t.response||n;this.complete()}else this.abort("["+t.status+"] "+t.statusText+": "+t.responseURL)},e.prototype._determineCrossOrigin=function(e,t){if(0===e.indexOf("data:"))return"";if(globalThis.origin!==globalThis.location.origin)return"anonymous";t=t||globalThis.location,tt||(tt=document.createElement("a")),tt.href=e;var n=et(tt.href,{strictMode:!0}),r=!n.port&&""===t.port||n.port===t.port,i=n.protocol?n.protocol+":":"";return n.host===t.hostname&&r&&i===t.protocol?"":"anonymous"},e.prototype._determineXhrType=function(){return e._xhrTypeMap[this.extension]||e.XHR_RESPONSE_TYPE.TEXT},e.prototype._determineLoadType=function(){return e._loadTypeMap[this.extension]||e.LOAD_TYPE.XHR},e.prototype._getExtension=function(e){void 0===e&&(e=this.url);var t="";if(this.isDataUrl){var n=e.indexOf("/");t=e.substring(n+1,e.indexOf(";",n))}else{var r=e.indexOf("?"),i=e.indexOf("#"),o=Math.min(r>-1?r:e.length,i>-1?i:e.length);t=(e=e.substring(0,o)).substring(e.lastIndexOf(".")+1)}return t.toLowerCase()},e.prototype._getMimeFromXhrType=function(t){switch(t){case e.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case e.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case e.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case e.XHR_RESPONSE_TYPE.JSON:return"application/json";case e.XHR_RESPONSE_TYPE.DEFAULT:case e.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},e}();function at(){}function st(e){return function(){for(var t=arguments,n=[],r=0;r>2,i[1]=(3&r[0])<<4|r[1]>>4,i[2]=(15&r[1])<<2|r[2]>>6,i[3]=63&r[2],n-(e.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;o0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=33776&&e<=33779)return"s3tc";if(e>=37488&&e<=37497)return"etc";if(e>=35840&&e<=35843)return"pvrtc";if(e>=36196)return"etc1";if(e>=35986&&e<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")},t._createLevelBuffers=function(e,t,n,r,i,o,a){for(var s=new Array(n),l=e.byteOffset,c=o,u=a,d=c+r-1&~(r-1),h=u+i-1&~(i-1),f=d*h*vt[t],p=0;p1?c:d,levelHeight:n>1?u:h,levelBuffer:new Uint8Array(e.buffer,l,f)},l+=f,f=(d=(c=c>>1||1)+r-1&~(r-1))*(h=(u=u>>1||1)+i-1&~(i-1))*vt[t];return s},t}(Ct),Et=function(){function e(){}return e.use=function(t,n){var r=t.data;if(t.type===ot.TYPE.JSON&&r&&r.cacheID&&r.textures){for(var i=r.textures,o=void 0,a=void 0,s=0,l=i.length;s>>=1,A>>>=1}var C=148;for(_=0;_1||0!==o?_:x,levelHeight:f>1||0!==o?C:E,levelBuffer:new Uint8Array(n,T,A)},T+=A}S=(S+=k+4)%4!==0?S+4-S%4:S,A=(x=(_=_>>1||1)+4-1&-4)*(E=(C=C>>1||1)+4-1&-4)*g}return 0!==o?{uncompressed:y.map(function(t){var n=t[0].levelBuffer,r=!1;return o===mt.QE.FLOAT?n=new Float32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4):o===mt.QE.UNSIGNED_INT?(r=!0,n=new Uint32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)):o===mt.QE.INT&&(r=!0,n=new Int32Array(t[0].levelBuffer.buffer,t[0].levelBuffer.byteOffset,t[0].levelBuffer.byteLength/4)),{resource:new j.dZ(n,{width:t[0].levelWidth,height:t[0].levelHeight}),type:o,format:r?e.convertFormatToInteger(a):a}}),kvData:w}:{compressed:y.map(function(e){return new xt(null,{format:s,width:l,height:c,levels:f,levelBuffers:e})}),kvData:w}},e.validate=function(e,t){for(var n=0;nt-i){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}for(var l=0;l16384&&(r=16384),o._properties=[!1,!0,!1,!1,!1],o._maxSize=t,o._batchSize=r,o._buffers=null,o._bufferUpdateIDs=[],o._updateID=0,o.interactiveChildren=!1,o.blendMode=mt.B9.NORMAL,o.autoResize=i,o.roundPixels=!0,o.baseTexture=null,o.setProperties(n),o._tint=0,o.tintRgb=new Float32Array(4),o.tint=16777215,o}cn(t,e),t.prototype.setProperties=function(e){e&&(this._properties[0]="vertices"in e||"scale"in e?!!e.vertices||!!e.scale:this._properties[0],this._properties[1]="position"in e?!!e.position:this._properties[1],this._properties[2]="rotation"in e?!!e.rotation:this._properties[2],this._properties[3]="uvs"in e?!!e.uvs:this._properties[3],this._properties[4]="tint"in e||"alpha"in e?!!e.tint||!!e.alpha:this._properties[4])},t.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},Object.defineProperty(t.prototype,"tint",{get:function(){return this._tint},set:function(e){this._tint=e,(0,C.hex2rgb)(e,this.tintRgb)},enumerable:!1,configurable:!0}),t.prototype.render=function(e){var t=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return t.onChildrenChange(0)})),e.batch.setObjectRenderer(e.plugins.particle),e.plugins.particle.render(this))},t.prototype.onChildrenChange=function(e){for(var t=Math.floor(e/this._batchSize);this._bufferUpdateIDs.lengthn&&!e.autoResize&&(o=n);var a=e._buffers;a||(a=e._buffers=this.generateBuffers(e));var s=t[0]._texture.baseTexture;this.state.blendMode=(0,C.correctBlendMode)(e.blendMode,s.alphaMode),i.state.set(this.state);var l=i.gl,c=e.worldTransform.copyTo(this.tempMatrix);c.prepend(i.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=c.toArray(!0),this.shader.uniforms.uColor=(0,C.premultiplyRgba)(e.tintRgb,e.worldAlpha,this.shader.uniforms.uColor,s.alphaMode),this.shader.uniforms.uSampler=s,this.renderer.shader.bind(this.shader);for(var u=!1,d=0,h=0;dr&&(f=r),h>=a.length&&a.push(this._generateOneMoreBuffer(e));var p=a[h];p.uploadDynamic(t,d,f);var g=e._bufferUpdateIDs[h]||0;(u=u||p._updateID0,c=s.alpha,u=c<1&&l?(0,C.premultiplyTint)(s._tintRGB,c):s._tintRGB+(255*c<<24);r[o]=u,r[o+i]=u,r[o+2*i]=u,r[o+3*i]=u,o+=4*i}},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},t}(j.Pt),pn=n(34012);!function(e){e.MITER="miter",e.BEVEL="bevel",e.ROUND="round"}(un||(un={})),function(e){e.BUTT="butt",e.ROUND="round",e.SQUARE="square"}(dn||(dn={}));var gn={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount:function(e,t){if(void 0===t&&(t=20),!this.adaptive||!e||isNaN(e))return t;var n=Math.ceil(e/this.maxLength);return nthis.maxSegments&&(n=this.maxSegments),n}},mn=function(){function e(){this.color=16777215,this.alpha=1,this.texture=j.gP.WHITE,this.matrix=null,this.visible=!1,this.reset()}return e.prototype.clone=function(){var t=new e;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},e.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=j.gP.WHITE,this.matrix=null,this.visible=!1},e.prototype.destroy=function(){this.texture=null,this.matrix=null},e}(),vn=function(e,t){return vn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},vn(e,t)};function yn(e,t){function n(){this.constructor=e}vn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function bn(e,t){var n,r;void 0===t&&(t=!1);var i=e.length;if(!(i<6)){for(var o=0,a=0,s=e[i-2],l=e[i-1];a0||t&&o<=0){var d=i/2;for(a=d+d%2;a=6){bn(n,!1);for(var a=[],s=0;s=0&&a>=0&&r>=0&&i>=0){var f=Math.ceil(2.3*Math.sqrt(o+a)),p=8*f+(r?4:0)+(i?4:0);if(s.length=p,0!==p){if(0===f)return s.length=8,s[0]=s[6]=t+r,s[1]=s[3]=n+i,s[2]=s[4]=t-r,void(s[5]=s[7]=n-i);var g=0,m=4*f+(r?2:0)+2,v=m,y=p,b=t+(S=r+o),w=t-S,A=n+(D=i);if(s[g++]=b,s[g++]=A,s[--m]=A,s[--m]=w,i){var _=n-D;s[v++]=w,s[v++]=_,s[--y]=_,s[--y]=b}for(var C=1;Cd&&(d+=2*Math.PI);var h=u,f=d-u,p=Math.abs(f),g=Math.sqrt(l*l+c*c),m=1+(15*p*Math.sqrt(g)/Math.PI|0),v=f/m;if(h+=v,s){a.push(e,t),a.push(n,r);for(var y=1,b=h;yy?(z?(h.push(q,K),h.push(A+S*M,_+D*M),h.push(q,K),h.push(A+k*M,_+T*M)):(h.push(A-S*P,_-D*P),h.push(Y,X),h.push(A-k*P,_-T*P),h.push(Y,X)),p+=2):o.join===un.ROUND?z?(h.push(q,K),h.push(A+S*M,_+D*M),p+=Dn(A,_,A+S*M,_+D*M,A+k*M,_+T*M,h,!0)+4,h.push(q,K),h.push(A+k*M,_+T*M)):(h.push(A-S*P,_-D*P),h.push(Y,X),p+=Dn(A,_,A-S*P,_-D*P,A-k*P,_-T*P,h,!1)+4,h.push(A-k*P,_-T*P),h.push(Y,X)):(h.push(q,K),h.push(Y,X)):(h.push(A-S*P,_-D*P),h.push(A+S*M,_+D*M),o.join===un.ROUND?p+=z?Dn(A,_,A+S*M,_+D*M,A+k*M,_+T*M,h,!0)+2:Dn(A,_,A-S*P,_-D*P,A-k*P,_-T*P,h,!1)+2:o.join===un.MITER&&V/v<=y&&(z?(h.push(Y,X),h.push(Y,X)):(h.push(q,K),h.push(q,K)),p+=2),h.push(A-k*P,_-T*P),h.push(A+k*M,_+T*M),p+=2)}}b=r[2*(f-2)],w=r[2*(f-2)+1],A=r[2*(f-1)],S=-(w-(_=r[2*(f-1)+1])),D=b-A,S/=O=Math.sqrt(S*S+D*D),D/=O,S*=m,D*=m,h.push(A-S*P,_-D*P),h.push(A+S*M,_+D*M),l||(o.cap===dn.ROUND?p+=Dn(A-S*(P-M)*.5,_-D*(P-M)*.5,A-S*P,_-D*P,A+S*M,_+D*M,h,!1)+2:o.cap===dn.SQUARE&&(p+=Sn(A,_,S,D,P,M,!1,h)));var J=t.indices,Z=gn.epsilon*gn.epsilon;for(R=g;Ru*s}},e.arc=function(e,t,n,r,i,o,a,s,l){for(var c=a-o,u=gn._segmentsCount(Math.abs(c)*i,40*Math.ceil(Math.abs(c)/E.TO)),d=c/(2*u),h=2*d,f=Math.cos(d),p=Math.sin(d),g=u-1,m=g%1/g,v=0;v<=g;++v){var y=d+o+h*(v+m*v),b=Math.cos(y),w=-Math.sin(y);l.push((f*b+p*w)*i+n,(f*-w+p*b)*i+r)}},e}(),In=function(){function e(){}return e.curveLength=function(e,t,n,r,i,o,a,s){for(var l=0,c=0,u=0,d=0,h=0,f=0,p=0,g=0,m=0,v=0,y=0,b=e,w=t,A=1;A<=10;++A)v=b-(g=(p=(f=(h=1-(c=A/10))*h)*h)*e+3*f*c*n+3*h*(u=c*c)*i+(d=u*c)*a),y=w-(m=p*t+3*f*c*r+3*h*u*o+d*s),b=g,w=m,l+=Math.sqrt(v*v+y*y);return l},e.curveTo=function(t,n,r,i,o,a,s){var l=s[s.length-2],c=s[s.length-1];s.length-=2;var u=gn._segmentsCount(e.curveLength(l,c,t,n,r,i,o,a)),d=0,h=0,f=0,p=0,g=0;s.push(l,c);for(var m=1,v=0;m<=u;++m)f=(h=(d=1-(v=m/u))*d)*d,g=(p=v*v)*v,s.push(f*l+3*h*v*t+3*d*p*r+g*o,f*c+3*h*v*n+3*d*p*i+g*a)},e}(),Pn=function(){function e(){}return e.curveLength=function(e,t,n,r,i,o){var a=e-2*n+i,s=t-2*r+o,l=2*n-2*e,c=2*r-2*t,u=4*(a*a+s*s),d=4*(a*l+s*c),h=l*l+c*c,f=2*Math.sqrt(u+d+h),p=Math.sqrt(u),g=2*u*p,m=2*Math.sqrt(h),v=d/p;return(g*f+p*d*(f-m)+(4*h*u-d*d)*Math.log((2*p+v+f)/(v+m)))/(4*g)},e.curveTo=function(t,n,r,i,o){for(var a=o[o.length-2],s=o[o.length-1],l=gn._segmentsCount(e.curveLength(a,s,t,n,r,i)),c=0,u=0,d=1;d<=l;++d){var h=d/l;c=a+(t-a)*h,u=s+(n-s)*h,o.push(c+(t+(r-t)*h-c)*h,u+(n+(i-n)*h-u)*h)}},e}(),Mn=function(){function e(){this.reset()}return e.prototype.begin=function(e,t,n){this.reset(),this.style=e,this.start=t,this.attribStart=n},e.prototype.end=function(e,t){this.attribSize=t-this.attribStart,this.size=e-this.start},e.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0},e}(),Rn=((Tn={})[E.HY.POLY]=wn,Tn[E.HY.CIRC]=An,Tn[E.HY.ELIP]=An,Tn[E.HY.RECT]=_n,Tn[E.HY.RREC]=En,Tn),Nn=[],jn=[],Fn=function(){function e(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),this.points=[],this.holes=[],this.shape=e,this.lineStyle=n,this.fillStyle=t,this.matrix=r,this.type=e.type}return e.prototype.clone=function(){return new e(this.shape,this.fillStyle,this.lineStyle,this.matrix)},e.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null},e}(),Ln=new E.bR,Bn=new D.cz,zn=function(e){function t(){var t=e.call(this)||this;return t.closePointEps=1e-4,t.boundsPadding=0,t.uvsFloat32=null,t.indicesUint16=null,t.batchable=!1,t.points=[],t.colors=[],t.uvs=[],t.indices=[],t.textureIds=[],t.graphicsData=[],t.drawCalls=[],t.batchDirty=-1,t.batches=[],t.dirty=0,t.cacheDirty=-1,t.clearDirty=0,t.shapeIndex=0,t._bounds=new D.cz,t.boundsDirty=-1,t}return yn(t,e),Object.defineProperty(t.prototype,"bounds",{get:function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},enumerable:!1,configurable:!0}),t.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var e=0;e0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},t.prototype.drawShape=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null);var i=new Fn(e,t,n,r);return this.graphicsData.push(i),this.dirty++,this},t.prototype.drawHole=function(e,t){if(void 0===t&&(t=null),!this.graphicsData.length)return null;var n=new Fn(e,null,null,t),r=this.graphicsData[this.graphicsData.length-1];return n.lineStyle=r.lineStyle,r.holes.push(n),this.dirty++,this},t.prototype.destroy=function(){e.prototype.destroy.call(this);for(var t=0;t0&&(i=(r=this.batches[this.batches.length-1]).style);for(var o=this.shapeIndex;o65535&&e;this.indicesUint16=v?new Uint32Array(this.indices):new Uint16Array(this.indices)}this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},t.prototype._compareStyles=function(e,t){return!(!e||!t)&&(e.texture.baseTexture===t.texture.baseTexture&&(e.color+e.alpha===t.color+t.alpha&&!!e.native===!!t.native))},t.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var e=0,t=this.graphicsData.length;e131070)return!1;for(var e=this.batches,n=0;n0&&((i=jn.pop())||((i=new j.hq).texArray=new j.cc),this.drawCalls.push(i)),i.start=u,i.size=0,i.texArray.count=0,i.type=c),f.touched=1,f._batchEnabled=e,f._batchLocation=o,f.wrapMode=mt.uR.REPEAT,i.texArray.elements[i.texArray.count++]=f,o++)),i.size+=d.size,u+=d.size,s=f._batchLocation,this.addColors(n,h.color,h.alpha,d.attribSize,d.attribStart),this.addTextureIds(r,s,d.attribSize,d.attribStart)}j.t5._globalBatch=e,this.packAttributes()},t.prototype.packAttributes=function(){for(var e=this.points,t=this.uvs,n=this.colors,r=this.textureIds,i=new ArrayBuffer(3*e.length*4),o=new Float32Array(i),a=new Uint32Array(i),s=0,l=0;l>16)+(65280&t)+((255&t)<<16),a=(0,C.premultiplyTint)(o,n);e.length=Math.max(e.length,i+r);for(var s=0;s0&&e.alpha>0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:t},e)):this._lineStyle.reset(),this},t.prototype.startPoly=function(){if(this.currentPath){var e=this.currentPath.points,t=this.currentPath.points.length;t>2&&(this.drawShape(this.currentPath),this.currentPath=new E.tS,this.currentPath.closeStroke=!1,this.currentPath.points.push(e[t-2],e[t-1]))}else this.currentPath=new E.tS,this.currentPath.closeStroke=!1},t.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},t.prototype.moveTo=function(e,t){return this.startPoly(),this.currentPath.points[0]=e,this.currentPath.points[1]=t,this},t.prototype.lineTo=function(e,t){this.currentPath||this.moveTo(0,0);var n=this.currentPath.points,r=n[n.length-2],i=n[n.length-1];return r===e&&i===t||n.push(e,t),this},t.prototype._initCurve=function(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[e,t]):this.moveTo(e,t)},t.prototype.quadraticCurveTo=function(e,t,n,r){this._initCurve();var i=this.currentPath.points;return 0===i.length&&this.moveTo(0,0),Pn.curveTo(e,t,n,r,i),this},t.prototype.bezierCurveTo=function(e,t,n,r,i,o){return this._initCurve(),In.curveTo(e,t,n,r,i,o,this.currentPath.points),this},t.prototype.arcTo=function(e,t,n,r,i){this._initCurve(e,t);var o=this.currentPath.points,a=On.curveTo(e,t,n,r,i,o);if(a){var s=a.cx,l=a.cy,c=a.radius,u=a.startAngle,d=a.endAngle,h=a.anticlockwise;this.arc(s,l,c,u,d,h)}return this},t.prototype.arc=function(e,t,n,r,i,o){if(void 0===o&&(o=!1),r===i)return this;if(!o&&i<=r?i+=E.TO:o&&r<=i&&(r+=E.TO),0===i-r)return this;var a=e+Math.cos(r)*n,s=t+Math.sin(r)*n,l=this._geometry.closePointEps,c=this.currentPath?this.currentPath.points:null;if(c){var u=Math.abs(c[c.length-2]-a),d=Math.abs(c[c.length-1]-s);u0;return t?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:t},e)):this._fillStyle.reset(),this},t.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},t.prototype.drawRect=function(e,t,n,r){return this.drawShape(new E.M_(e,t,n,r))},t.prototype.drawRoundedRect=function(e,t,n,r,i){return this.drawShape(new E.TE(e,t,n,r,i))},t.prototype.drawCircle=function(e,t,n){return this.drawShape(new E.jl(e,t,n))},t.prototype.drawEllipse=function(e,t,n,r){return this.drawShape(new E.Pp(e,t,n,r))},t.prototype.drawPolygon=function(){for(var e,t=arguments,n=[],r=0;r>16&255)/255*i,o.tint[1]=(r>>8&255)/255*i,o.tint[2]=(255&r)/255*i,o.tint[3]=i,e.shader.bind(t),e.geometry.bind(n,t),e.state.set(this.state);for(var s=0,l=a.length;s>16)+(65280&i)+((255&i)<<16)}}},t.prototype.calculateVertices=function(){var e=this.transform._worldID;if(this._transformID!==e){this._transformID=e;for(var t=this.transform.worldTransform,n=t.a,r=t.b,i=t.c,o=t.d,a=t.tx,s=t.ty,l=this._geometry.points,c=this.vertexData,u=0,d=0;d=r&&Kn.x=i&&Kn.y>16)+(65280&e)+((255&e)<<16)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=e||j.gP.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.valid?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))},enumerable:!1,configurable:!0}),t}(D.mc),Qn=function(e,t){return Qn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Qn(e,t)};!function(e){e[e.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",e[e.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL"}(qn||(qn={}));var Jn={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:qn.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},Zn=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],$n=function(){function e(e){this.styleID=0,this.reset(),nr(this,e,e)}return e.prototype.clone=function(){var t={};return nr(t,this,Jn),new e(t)},e.prototype.reset=function(){nr(this,Jn,Jn)},Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(e){this._align!==e&&(this._align=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"breakWords",{get:function(){return this._breakWords},set:function(e){this._breakWords!==e&&(this._breakWords=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadow",{get:function(){return this._dropShadow},set:function(e){this._dropShadow!==e&&(this._dropShadow=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAlpha",{get:function(){return this._dropShadowAlpha},set:function(e){this._dropShadowAlpha!==e&&(this._dropShadowAlpha=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowAngle",{get:function(){return this._dropShadowAngle},set:function(e){this._dropShadowAngle!==e&&(this._dropShadowAngle=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowBlur",{get:function(){return this._dropShadowBlur},set:function(e){this._dropShadowBlur!==e&&(this._dropShadowBlur=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowColor",{get:function(){return this._dropShadowColor},set:function(e){var t=tr(e);this._dropShadowColor!==t&&(this._dropShadowColor=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dropShadowDistance",{get:function(){return this._dropShadowDistance},set:function(e){this._dropShadowDistance!==e&&(this._dropShadowDistance=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fill",{get:function(){return this._fill},set:function(e){var t=tr(e);this._fill!==t&&(this._fill=t,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientType",{get:function(){return this._fillGradientType},set:function(e){this._fillGradientType!==e&&(this._fillGradientType=e,this.styleID++)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fillGradientStops",{get:function(){return this._fillGradientStops},set:function(e){(function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var n=0;n=0;n--){var r=t[n].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&Zn.indexOf(r)<0&&(r='"'+r+'"'),t[n]=r}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+e+" "+t.join(",")},e}();function er(e){return"number"===typeof e?(0,C.hex2string)(e):("string"===typeof e&&0===e.indexOf("0x")&&(e=e.replace("0x","#")),e)}function tr(e){if(Array.isArray(e)){for(var t=0;tp)if(""!==a&&(s+=e.addLine(a),a="",o=0),e.canBreakWords(v,n.breakWords))for(var A=e.wordWrapSplit(v),_=0;_p&&(s+=e.addLine(a),f=!1,a="",o=0),a+=C,o+=D}else{a.length>0&&(s+=e.addLine(a),a="",o=0);var k=m===g.length-1;s+=e.addLine(v,!k),f=!1,a="",o=0}else w+o>p&&(f=!1,s+=e.addLine(a),a="",o=0),(a.length>0||!e.isBreakingSpace(v)||f)&&(a+=v,o+=w)}return s+=e.addLine(a,!1)},e.addLine=function(t,n){return void 0===n&&(n=!0),t=e.trimRight(t),t=n?t+"\n":t},e.getFromCache=function(e,t,n,r){var i=n[e];if("number"!==typeof i){var o=e.length*t;i=r.measureText(e).width+o,n[e]=i}return i},e.collapseSpaces=function(e){return"normal"===e||"pre-line"===e},e.collapseNewlines=function(e){return"normal"===e},e.trimRight=function(t){if("string"!==typeof t)return"";for(var n=t.length-1;n>=0;n--){var r=t[n];if(!e.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},e.isNewline=function(t){return"string"===typeof t&&e._newlines.indexOf(t.charCodeAt(0))>=0},e.isBreakingSpace=function(t,n){return"string"===typeof t&&e._breakingSpaces.indexOf(t.charCodeAt(0))>=0},e.tokenize=function(t){var n=[],r="";if("string"!==typeof t)return n;for(var i=0;is;--h){for(g=0;g0&&p>g&&(m=(g+p)/2);var v=g+f,y=n.lineHeight*(h+1),b=v;h+10},e}();function lr(e,t){var n=!1;if(e&&e._textures&&e._textures.length)for(var r=0;r=0;t--)this.add(e.children[t]);return this},e.prototype.destroy=function(){this.ticking&&S.Rv.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null},e}()),br=(function(){function e(e){this.maxMilliseconds=e,this.frameStart=0}e.prototype.beginFrame=function(){this.frameStart=Date.now()},e.prototype.allowedToUpload=function(){return Date.now()-this.frameStart=r&&Cr.x=i&&Cr.y1?j.Mt.from("#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n",t):j.Mt.from(Er,"#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n",t)},t.prototype.render=function(e){var t=this.renderer,n=this.quad,r=n.vertices;r[0]=r[6]=e._width*-e.anchor.x,r[1]=r[3]=e._height*-e.anchor.y,r[2]=r[4]=e._width*(1-e.anchor.x),r[5]=r[7]=e._height*(1-e.anchor.y);var i=e.uvRespectAnchor?e.anchor.x:0,o=e.uvRespectAnchor?e.anchor.y:0;(r=n.uvs)[0]=r[6]=-i,r[1]=r[3]=-o,r[2]=r[4]=1-i,r[5]=r[7]=1-o,n.invalidate();var a=e._texture,s=a.baseTexture,l=e.tileTransform.localTransform,c=e.uvMatrix,u=s.isPowerOfTwo&&a.frame.width===s.width&&a.frame.height===s.height;u&&(s._glTextures[t.CONTEXT_UID]?u=s.wrapMode!==mt.uR.CLAMP:s.wrapMode===mt.uR.CLAMP&&(s.wrapMode=mt.uR.REPEAT));var d=u?this.simpleShader:this.shader,h=a.width,f=a.height,p=e._width,g=e._height;Sr.set(l.a*h/p,l.b*h/g,l.c*f/p,l.d*f/g,l.tx/p,l.ty/g),Sr.invert(),u?Sr.prepend(c.mapCoord):(d.uniforms.uMapCoord=c.mapCoord.toArray(!0),d.uniforms.uClampFrame=c.uClampFrame,d.uniforms.uClampOffset=c.uClampOffset),d.uniforms.uTransform=Sr.toArray(!0),d.uniforms.uColor=(0,C.premultiplyTintToRgba)(e.tint,e.worldAlpha,d.uniforms.uColor,s.alphaMode),d.uniforms.translationMatrix=e.transform.worldTransform.toArray(!0),d.uniforms.uSampler=a,t.shader.bind(d),t.geometry.bind(n),this.state.blendMode=(0,C.correctBlendMode)(e.blendMode,s.alphaMode),t.state.set(this.state),t.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},t}(j.Pt),kr=function(e,t){return kr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},kr(e,t)};function Tr(e,t){function n(){this.constructor=e}kr(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Or=function(){function e(e,t){this.uvBuffer=e,this.uvMatrix=t,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}return e.prototype.update=function(e){if(e||this._bufferUpdateId!==this.uvBuffer._updateID||this._textureUpdateId!==this.uvMatrix._updateID){this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;var t=this.uvBuffer.data;this.data&&this.data.length===t.length||(this.data=new Float32Array(t.length)),this.uvMatrix.multiplyUvs(t,this.data),this._updateID++}},e}(),Ir=new E.bR,Pr=new E.tS,Mr=function(e){function t(t,n,r,i){void 0===i&&(i=mt._4.TRIANGLES);var o=e.call(this)||this;return o.geometry=t,o.shader=n,o.state=r||j.Uw.for2d(),o.drawMode=i,o.start=0,o.size=0,o.uvs=null,o.indices=null,o.vertexData=new Float32Array(1),o.vertexDirty=-1,o._transformID=-1,o._roundPixels=pn.W.ROUND_PIXELS,o.batchUvs=null,o}return Tr(t,e),Object.defineProperty(t.prototype,"geometry",{get:function(){return this._geometry},set:function(e){this._geometry!==e&&(this._geometry&&(this._geometry.refCount--,0===this._geometry.refCount&&this._geometry.dispose()),this._geometry=e,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"uvBuffer",{get:function(){return this.geometry.buffers[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"verticesBuffer",{get:function(){return this.geometry.buffers[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"material",{get:function(){return this.shader},set:function(e){this.shader=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blendMode",{get:function(){return this.state.blendMode},set:function(e){this.state.blendMode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roundPixels",{get:function(){return this._roundPixels},set:function(e){this._roundPixels!==e&&(this._transformID=-1),this._roundPixels=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tint",{get:function(){return"tint"in this.shader?this.shader.tint:null},set:function(e){this.shader.tint=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"texture",{get:function(){return"texture"in this.shader?this.shader.texture:null},set:function(e){this.shader.texture=e},enumerable:!1,configurable:!0}),t.prototype._render=function(e){var n=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===mt._4.TRIANGLES&&n.length<2*t.BATCHABLE_SIZE?this._renderToBatch(e):this._renderDefault(e)},t.prototype._renderDefault=function(e){var t=this.shader;t.alpha=this.worldAlpha,t.update&&t.update(),e.batch.flush(),t.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),e.shader.bind(t),e.state.set(this.state),e.geometry.bind(this.geometry,t),e.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)},t.prototype._renderToBatch=function(e){var t=this.geometry,n=this.shader;n.uvMatrix&&(n.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=t.indexBuffer.data,this._tintRGB=n._tintRGB,this._texture=n.texture;var r=this.material.pluginName;e.batch.setObjectRenderer(e.plugins[r]),e.plugins[r].render(this)},t.prototype.calculateVertices=function(){var e=this.geometry.buffers[0],t=e.data,n=e._updateID;if(n!==this.vertexDirty||this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID,this.vertexData.length!==t.length&&(this.vertexData=new Float32Array(t.length));for(var r=this.transform.worldTransform,i=r.a,o=r.b,a=r.c,s=r.d,l=r.tx,c=r.ty,u=this.vertexData,d=0;d>16)+(65280&e)+((255&e)<<16),this._colorDirty=!0)},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var e=this.texture.baseTexture;(0,C.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,e.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},t}(j.Mt),Nr=function(e){function t(t,n,r){var i=e.call(this)||this,o=new j.hp(t),a=new j.hp(n,!0),s=new j.hp(r,!0,!0);return i.addAttribute("aVertexPosition",o,2,!1,mt.QE.FLOAT).addAttribute("aTextureCoord",a,2,!1,mt.QE.FLOAT).addIndex(s),i._updateId=-1,i}return Tr(t,e),Object.defineProperty(t.prototype,"vertexDirtyId",{get:function(){return this.buffers[0]._updateID},enumerable:!1,configurable:!0}),t}(j.V2),jr=function(e,t){return jr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},jr(e,t)};var Fr=function(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]},Lr=function(){function e(){}return e.test=function(e){return"string"===typeof e&&0===e.indexOf("info face=")},e.parse=function(e){var t=e.match(/^[a-z]+\s+.+$/gm),n={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(var r in t){var i=t[r].match(/^[a-z]+/gm)[0],o=t[r].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),a={};for(var s in o){var l=o[s].split("="),c=l[0],u=l[1].replace(/"/gm,""),d=parseFloat(u),h=isNaN(d)?u:d;a[c]=h}n[i].push(a)}var f=new Fr;return n.info.forEach(function(e){return f.info.push({face:e.face,size:parseInt(e.size,10)})}),n.common.forEach(function(e){return f.common.push({lineHeight:parseInt(e.lineHeight,10)})}),n.page.forEach(function(e){return f.page.push({id:parseInt(e.id,10),file:e.file})}),n.char.forEach(function(e){return f.char.push({id:parseInt(e.id,10),page:parseInt(e.page,10),x:parseInt(e.x,10),y:parseInt(e.y,10),width:parseInt(e.width,10),height:parseInt(e.height,10),xoffset:parseInt(e.xoffset,10),yoffset:parseInt(e.yoffset,10),xadvance:parseInt(e.xadvance,10)})}),n.kerning.forEach(function(e){return f.kerning.push({first:parseInt(e.first,10),second:parseInt(e.second,10),amount:parseInt(e.amount,10)})}),n.distanceField.forEach(function(e){return f.distanceField.push({distanceRange:parseInt(e.distanceRange,10),fieldType:e.fieldType})}),f},e}(),Br=function(){function e(){}return e.test=function(e){return e instanceof XMLDocument&&e.getElementsByTagName("page").length&&null!==e.getElementsByTagName("info")[0].getAttribute("face")},e.parse=function(e){for(var t=new Fr,n=e.getElementsByTagName("info"),r=e.getElementsByTagName("common"),i=e.getElementsByTagName("page"),o=e.getElementsByTagName("char"),a=e.getElementsByTagName("kerning"),s=e.getElementsByTagName("distanceField"),l=0;l")>-1){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return Br.test(t)}return!1},e.parse=function(e){var t=(new globalThis.DOMParser).parseFromString(e,"text/xml");return Br.parse(t)},e}(),Ur=[Lr,Br,zr];function Gr(e){for(var t=0;t=c-x*s){if(0===y)throw new Error("[BitmapFont] textureHeight "+c+"px is too small for "+d.fontSize+"px fonts");--A,p=null,g=null,m=null,y=0,v=0,b=0}else if(b=Math.max(x+_.fontProperties.descent,b),E*s+v>=h)--A,y+=b*s,y=Math.ceil(y),v=0,b=0;else{Hr(p,g,_,v,y,s,d);var S=Vr(_.text);f.char.push({id:S,page:w.length-1,x:v/s,y:y/s,width:E,height:x,xoffset:0,yoffset:0,xadvance:Math.ceil(C-(d.dropShadow?d.dropShadowDistance:0)-(d.stroke?d.strokeThickness:0))}),v+=(E+2*a)*s,v=Math.ceil(v)}}A=0;for(var D=u.length;A0&&r.x>l&&(++m,(0,C.removeItems)(i,1+p-m,1+b-p),b=p,p=-1,o.push(g),a.push(i.length>0?i[i.length-1].prevSpaces:0),h=Math.max(h,g),f++,r.x=0,r.y+=t.lineHeight,u=null,y=0)}}else o.push(d),a.push(-1),h=Math.max(h,d),++f,++m,r.x=0,r.y+=t.lineHeight,u=null,y=0}var x=s[s.length-1];"\r"!==x&&"\n"!==x&&(/(?:\s)/.test(x)&&(d=g),o.push(d),h=Math.max(h,d),a.push(-1));var S=[];for(b=0;b<=f;b++){var D=0;"right"===this._align?D=h-o[b]:"center"===this._align?D=(h-o[b])/2:"justify"===this._align&&(D=a[b]<0?0:(h-o[b])/a[b]),S.push(D)}var k=i.length,T={},O=[],I=this._activePagesMeshData;for(b=0;b6*B)||Z.vertices.length<2*Mr.BATCHABLE_SIZE)Z.vertices=new Float32Array(8*B),Z.uvs=new Float32Array(8*B),Z.indices=new Uint16Array(6*B);else for(var z=Z.total,U=Z.vertices,G=4*z*2;G 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",n)||this).alpha=1,t}return function(e,t){function n(){this.constructor=e}$r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype._loadMatrix=function(e,t){void 0===t&&(t=!1);var n=e;t&&(this._multiply(n,this.uniforms.m,e),n=this._colorMatrix(n)),this.uniforms.m=n},t.prototype._multiply=function(e,t,n){return e[0]=t[0]*n[0]+t[1]*n[5]+t[2]*n[10]+t[3]*n[15],e[1]=t[0]*n[1]+t[1]*n[6]+t[2]*n[11]+t[3]*n[16],e[2]=t[0]*n[2]+t[1]*n[7]+t[2]*n[12]+t[3]*n[17],e[3]=t[0]*n[3]+t[1]*n[8]+t[2]*n[13]+t[3]*n[18],e[4]=t[0]*n[4]+t[1]*n[9]+t[2]*n[14]+t[3]*n[19]+t[4],e[5]=t[5]*n[0]+t[6]*n[5]+t[7]*n[10]+t[8]*n[15],e[6]=t[5]*n[1]+t[6]*n[6]+t[7]*n[11]+t[8]*n[16],e[7]=t[5]*n[2]+t[6]*n[7]+t[7]*n[12]+t[8]*n[17],e[8]=t[5]*n[3]+t[6]*n[8]+t[7]*n[13]+t[8]*n[18],e[9]=t[5]*n[4]+t[6]*n[9]+t[7]*n[14]+t[8]*n[19]+t[9],e[10]=t[10]*n[0]+t[11]*n[5]+t[12]*n[10]+t[13]*n[15],e[11]=t[10]*n[1]+t[11]*n[6]+t[12]*n[11]+t[13]*n[16],e[12]=t[10]*n[2]+t[11]*n[7]+t[12]*n[12]+t[13]*n[17],e[13]=t[10]*n[3]+t[11]*n[8]+t[12]*n[13]+t[13]*n[18],e[14]=t[10]*n[4]+t[11]*n[9]+t[12]*n[14]+t[13]*n[19]+t[14],e[15]=t[15]*n[0]+t[16]*n[5]+t[17]*n[10]+t[18]*n[15],e[16]=t[15]*n[1]+t[16]*n[6]+t[17]*n[11]+t[18]*n[16],e[17]=t[15]*n[2]+t[16]*n[7]+t[17]*n[12]+t[18]*n[17],e[18]=t[15]*n[3]+t[16]*n[8]+t[17]*n[13]+t[18]*n[18],e[19]=t[15]*n[4]+t[16]*n[9]+t[17]*n[14]+t[18]*n[19]+t[19],e},t.prototype._colorMatrix=function(e){var t=new Float32Array(e);return t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,t},t.prototype.brightness=function(e,t){var n=[e,0,0,0,0,0,e,0,0,0,0,0,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.tint=function(e,t){var n=[(e>>16&255)/255,0,0,0,0,0,(e>>8&255)/255,0,0,0,0,0,(255&e)/255,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.greyscale=function(e,t){var n=[e,e,e,0,0,e,e,e,0,0,e,e,e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.blackAndWhite=function(e){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],e)},t.prototype.hue=function(e,t){e=(e||0)/180*Math.PI;var n=Math.cos(e),r=Math.sin(e),i=1/3,o=(0,Math.sqrt)(i),a=[n+(1-n)*i,i*(1-n)-o*r,i*(1-n)+o*r,0,0,i*(1-n)+o*r,n+i*(1-n),i*(1-n)-o*r,0,0,i*(1-n)-o*r,i*(1-n)+o*r,n+i*(1-n),0,0,0,0,0,1,0];this._loadMatrix(a,t)},t.prototype.contrast=function(e,t){var n=(e||0)+1,r=-.5*(n-1),i=[n,0,0,0,r,0,n,0,0,r,0,0,n,0,r,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.saturate=function(e,t){void 0===e&&(e=0);var n=2*e/3+1,r=-.5*(n-1),i=[n,r,r,0,0,r,n,r,0,0,r,r,n,0,0,0,0,0,1,0];this._loadMatrix(i,t)},t.prototype.desaturate=function(){this.saturate(-1)},t.prototype.negative=function(e){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e)},t.prototype.sepia=function(e){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],e)},t.prototype.technicolor=function(e){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],e)},t.prototype.polaroid=function(e){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],e)},t.prototype.toBGR=function(e){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],e)},t.prototype.kodachrome=function(e){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],e)},t.prototype.browni=function(e){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],e)},t.prototype.vintage=function(e){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],e)},t.prototype.colorTone=function(e,t,n,r,i){var o=((n=n||16770432)>>16&255)/255,a=(n>>8&255)/255,s=(255&n)/255,l=((r=r||3375104)>>16&255)/255,c=(r>>8&255)/255,u=(255&r)/255,d=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,l,c,u,t=t||.15,0,o-l,a-c,s-u,0,0];this._loadMatrix(d,i)},t.prototype.night=function(e,t){var n=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.predator=function(e,t){var n=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(n,t)},t.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},t.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},Object.defineProperty(t.prototype,"matrix",{get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e},enumerable:!1,configurable:!0}),t}(j.dJ);ei.prototype.grayscale=ei.prototype.greyscale;var ti=function(e,t){return ti=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ti(e,t)};!function(e){function t(t,n){var r=this,i=new E.uq;return t.renderable=!1,(r=e.call(this,"attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",{mapSampler:t._texture,filterMatrix:i,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])})||this).maskSprite=t,r.maskMatrix=i,null!==n&&void 0!==n||(n=20),r.scale=new E.bR(n,n),r}(function(e,t){function n(){this.constructor=e}ti(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e),t.prototype.apply=function(e,t,n,r){this.uniforms.filterMatrix=e.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var i=this.maskSprite.worldTransform,o=Math.sqrt(i.a*i.a+i.b*i.b),a=Math.sqrt(i.c*i.c+i.d*i.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=i.a/o,this.uniforms.rotation[1]=i.b/o,this.uniforms.rotation[2]=i.c/a,this.uniforms.rotation[3]=i.d/a),e.applyFilter(this,t,n,r)},Object.defineProperty(t.prototype,"map",{get:function(){return this.uniforms.mapSampler},set:function(e){this.uniforms.mapSampler=e},enumerable:!1,configurable:!0})}(j.dJ);var ni=function(e,t){return ni=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ni(e,t)};!function(e){function t(){return e.call(this,"\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n')||this}(function(e,t){function n(){this.constructor=e}ni(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e)}(j.dJ);var ri=function(e,t){return ri=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ri(e,t)};var ii,oi,ai,si,li,ci,ui,di,hi,fi,pi,gi,mi,vi,yi,bi,wi,Ai,_i;!function(e){function t(t,n){void 0===t&&(t=.5),void 0===n&&(n=Math.random());var r=e.call(this,j.Eo,"precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",{uNoise:0,uSeed:0})||this;return r.noise=t,r.seed=n,r}(function(e,t){function n(){this.constructor=e}ri(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"seed",{get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e},enumerable:!1,configurable:!0})}(j.dJ);!function(e){e[e.WEBGL_LEGACY=0]="WEBGL_LEGACY",e[e.WEBGL=1]="WEBGL",e[e.WEBGL2=2]="WEBGL2"}(ii||(ii={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.WEBGL=1]="WEBGL",e[e.CANVAS=2]="CANVAS"}(oi||(oi={})),function(e){e[e.COLOR=16384]="COLOR",e[e.DEPTH=256]="DEPTH",e[e.STENCIL=1024]="STENCIL"}(ai||(ai={})),function(e){e[e.NORMAL=0]="NORMAL",e[e.ADD=1]="ADD",e[e.MULTIPLY=2]="MULTIPLY",e[e.SCREEN=3]="SCREEN",e[e.OVERLAY=4]="OVERLAY",e[e.DARKEN=5]="DARKEN",e[e.LIGHTEN=6]="LIGHTEN",e[e.COLOR_DODGE=7]="COLOR_DODGE",e[e.COLOR_BURN=8]="COLOR_BURN",e[e.HARD_LIGHT=9]="HARD_LIGHT",e[e.SOFT_LIGHT=10]="SOFT_LIGHT",e[e.DIFFERENCE=11]="DIFFERENCE",e[e.EXCLUSION=12]="EXCLUSION",e[e.HUE=13]="HUE",e[e.SATURATION=14]="SATURATION",e[e.COLOR=15]="COLOR",e[e.LUMINOSITY=16]="LUMINOSITY",e[e.NORMAL_NPM=17]="NORMAL_NPM",e[e.ADD_NPM=18]="ADD_NPM",e[e.SCREEN_NPM=19]="SCREEN_NPM",e[e.NONE=20]="NONE",e[e.SRC_OVER=0]="SRC_OVER",e[e.SRC_IN=21]="SRC_IN",e[e.SRC_OUT=22]="SRC_OUT",e[e.SRC_ATOP=23]="SRC_ATOP",e[e.DST_OVER=24]="DST_OVER",e[e.DST_IN=25]="DST_IN",e[e.DST_OUT=26]="DST_OUT",e[e.DST_ATOP=27]="DST_ATOP",e[e.ERASE=26]="ERASE",e[e.SUBTRACT=28]="SUBTRACT",e[e.XOR=29]="XOR"}(si||(si={})),function(e){e[e.POINTS=0]="POINTS",e[e.LINES=1]="LINES",e[e.LINE_LOOP=2]="LINE_LOOP",e[e.LINE_STRIP=3]="LINE_STRIP",e[e.TRIANGLES=4]="TRIANGLES",e[e.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",e[e.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(li||(li={})),function(e){e[e.RGBA=6408]="RGBA",e[e.RGB=6407]="RGB",e[e.RG=33319]="RG",e[e.RED=6403]="RED",e[e.RGBA_INTEGER=36249]="RGBA_INTEGER",e[e.RGB_INTEGER=36248]="RGB_INTEGER",e[e.RG_INTEGER=33320]="RG_INTEGER",e[e.RED_INTEGER=36244]="RED_INTEGER",e[e.ALPHA=6406]="ALPHA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",e[e.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",e[e.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(ci||(ci={})),function(e){e[e.TEXTURE_2D=3553]="TEXTURE_2D",e[e.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",e[e.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",e[e.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",e[e.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",e[e.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",e[e.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(ui||(ui={})),function(e){e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",e[e.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",e[e.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",e[e.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",e[e.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",e[e.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",e[e.BYTE=5120]="BYTE",e[e.SHORT=5122]="SHORT",e[e.INT=5124]="INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",e[e.HALF_FLOAT=36193]="HALF_FLOAT"}(di||(di={})),function(e){e[e.FLOAT=0]="FLOAT",e[e.INT=1]="INT",e[e.UINT=2]="UINT"}(hi||(hi={})),function(e){e[e.NEAREST=0]="NEAREST",e[e.LINEAR=1]="LINEAR"}(fi||(fi={})),function(e){e[e.CLAMP=33071]="CLAMP",e[e.REPEAT=10497]="REPEAT",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(pi||(pi={})),function(e){e[e.OFF=0]="OFF",e[e.POW2=1]="POW2",e[e.ON=2]="ON",e[e.ON_MANUAL=3]="ON_MANUAL"}(gi||(gi={})),function(e){e[e.NPM=0]="NPM",e[e.UNPACK=1]="UNPACK",e[e.PMA=2]="PMA",e[e.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",e[e.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",e[e.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA",e[e.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA"}(mi||(mi={})),function(e){e[e.NO=0]="NO",e[e.YES=1]="YES",e[e.AUTO=2]="AUTO",e[e.BLEND=0]="BLEND",e[e.CLEAR=1]="CLEAR",e[e.BLIT=2]="BLIT"}(vi||(vi={})),function(e){e[e.AUTO=0]="AUTO",e[e.MANUAL=1]="MANUAL"}(yi||(yi={})),function(e){e.LOW="lowp",e.MEDIUM="mediump",e.HIGH="highp"}(bi||(bi={})),function(e){e[e.NONE=0]="NONE",e[e.SCISSOR=1]="SCISSOR",e[e.STENCIL=2]="STENCIL",e[e.SPRITE=3]="SPRITE"}(wi||(wi={})),function(e){e[e.NONE=0]="NONE",e[e.LOW=2]="LOW",e[e.MEDIUM=4]="MEDIUM",e[e.HIGH=8]="HIGH"}(Ai||(Ai={})),function(e){e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER"}(_i||(_i={}));var Ci=new E.uq;D.q9.prototype._cacheAsBitmap=!1,D.q9.prototype._cacheData=null,D.q9.prototype._cacheAsBitmapResolution=null,D.q9.prototype._cacheAsBitmapMultisample=Ai.NONE;var xi=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.originalContainsPoint=null,this.sprite=null};Object.defineProperties(D.q9.prototype,{cacheAsBitmapResolution:{get:function(){return this._cacheAsBitmapResolution},set:function(e){e!==this._cacheAsBitmapResolution&&(this._cacheAsBitmapResolution=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmapMultisample:{get:function(){return this._cacheAsBitmapMultisample},set:function(e){e!==this._cacheAsBitmapMultisample&&(this._cacheAsBitmapMultisample=e,this.cacheAsBitmap&&(this.cacheAsBitmap=!1,this.cacheAsBitmap=!0))}},cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(e){var t;this._cacheAsBitmap!==e&&(this._cacheAsBitmap=e,e?(this._cacheData||(this._cacheData=new xi),(t=this._cacheData).originalRender=this.render,t.originalRenderCanvas=this.renderCanvas,t.originalUpdateTransform=this.updateTransform,t.originalCalculateBounds=this.calculateBounds,t.originalGetLocalBounds=this.getLocalBounds,t.originalDestroy=this.destroy,t.originalContainsPoint=this.containsPoint,t.originalMask=this._mask,t.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((t=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=t.originalRender,this.renderCanvas=t.originalRenderCanvas,this.calculateBounds=t.originalCalculateBounds,this.getLocalBounds=t.originalGetLocalBounds,this.destroy=t.originalDestroy,this.updateTransform=t.originalUpdateTransform,this.containsPoint=t.originalContainsPoint,this._mask=t.originalMask,this.filterArea=t.originalFilterArea))}}}),D.q9.prototype._renderCached=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(e),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(e))},D.q9.prototype._initCachedDisplayObject=function(e){var t;if(!this._cacheData||!this._cacheData.sprite){var n=this.alpha;this.alpha=1,e.batch.flush();var r=this.getLocalBounds(null,!0).clone();if(this.filters&&this.filters.length){var i=this.filters[0].padding;r.pad(i)}r.ceil(pn.W.RESOLUTION);var o=e.renderTexture.current,a=e.renderTexture.sourceFrame.clone(),s=e.renderTexture.destinationFrame.clone(),l=e.projection.transform,c=j.Y7.create({width:r.width,height:r.height,resolution:this.cacheAsBitmapResolution||e.resolution,multisample:null!==(t=this.cacheAsBitmapMultisample)&&void 0!==t?t:e.multisample}),u="cacheAsBitmap_"+(0,C.uid)();this._cacheData.textureCacheId=u,j.t5.addToCache(c.baseTexture,u),j.gP.addToCache(c,u);var d=this.transform.localTransform.copyTo(Ci).invert().translate(-r.x,-r.y);this.render=this._cacheData.originalRender,e.render(this,{renderTexture:c,clear:!0,transform:d,skipUpdateTransform:!1}),e.framebuffer.blit(),e.projection.transform=l,e.renderTexture.bind(o,a,s),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var h=new Xn(c);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=n,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.enableTempParent(),this.updateTransform(),this.disableTempParent(null)),this.containsPoint=h.containsPoint.bind(h)}},D.q9.prototype._renderCachedCanvas=function(e){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(e),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(e))},D.q9.prototype._initCachedDisplayObjectCanvas=function(e){if(!this._cacheData||!this._cacheData.sprite){var t=this.getLocalBounds(null,!0),n=this.alpha;this.alpha=1;var r=e.context,i=e._projTransform;t.ceil(pn.W.RESOLUTION);var o=j.Y7.create({width:t.width,height:t.height}),a="cacheAsBitmap_"+(0,C.uid)();this._cacheData.textureCacheId=a,j.t5.addToCache(o.baseTexture,a),j.gP.addToCache(o,a);var s=Ci;this.transform.localTransform.copyTo(s),s.invert(),s.tx-=t.x,s.ty-=t.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,{renderTexture:o,clear:!0,transform:s,skipUpdateTransform:!1}),e.context=r,e._projTransform=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null,this.alpha=n;var l=new Xn(o);l.transform.worldTransform=this.transform.worldTransform,l.anchor.x=-t.x/t.width,l.anchor.y=-t.y/t.height,l.alpha=n,l._bounds=this._bounds,this._cacheData.sprite=l,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=l.containsPoint.bind(l)}},D.q9.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._bounds.updateID=this._boundsID},D.q9.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds(null)},D.q9.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,j.t5.removeFromCache(this._cacheData.textureCacheId),j.gP.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},D.q9.prototype._cacheAsBitmapDestroy=function(e){this.cacheAsBitmap=!1,this.destroy(e)},D.q9.prototype.name=null,D.mc.prototype.getChildByName=function(e,t){for(var n=0,r=this.children.length;n0){var h=s.x-e[u].x,f=s.y-e[u].y,p=Math.sqrt(h*h+f*f);s=e[u],a+=p/l}else a=u/(c-1);i[d]=a,i[d+1]=0,i[d+2]=a,i[d+3]=1}var g=0;for(u=0;u0?this.textureScale*this._width/2:this._width/2;r/=u,i/=u,r*=d,i*=d,o[c]=l.x+r,o[c+1]=l.y+i,o[c+2]=l.x-r,o[c+3]=l.y-i,n=l}this.buffers[0].update()}},t.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},t}(Nr),Ti=(function(e){function t(t,n,r){void 0===r&&(r=0);var i=this,o=new ki(t.height,n,r),a=new Rr(t);return r>0&&(t.baseTexture.wrapMode=mt.uR.REPEAT),(i=e.call(this,o,a)||this).autoUpdate=!0,i}Si(t,e),t.prototype._render=function(t){var n=this.geometry;(this.autoUpdate||n._width!==this.shader.texture.height)&&(n._width=this.shader.texture.height,n.update()),e.prototype._render.call(this,t)}}(Mr),function(e){function t(t,n,r){var i=this,o=new Di(t.width,t.height,n,r),a=new Rr(j.gP.WHITE);return(i=e.call(this,o,a)||this).texture=t,i.autoResize=!0,i}return Si(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID;var e=this.geometry,t=this.shader.texture,n=t.width,r=t.height;!this.autoResize||e.width===n&&e.height===r||(e.width=this.shader.texture.width,e.height=this.shader.texture.height,e.build())},Object.defineProperty(t.prototype,"texture",{get:function(){return this.shader.texture},set:function(e){this.shader.texture!==e&&(this.shader.texture=e,this._textureID=-1,e.baseTexture.valid?this.textureUpdated():e.once("update",this.textureUpdated,this))},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),e.prototype._render.call(this,t)},t.prototype.destroy=function(t){this.shader.texture.off("update",this.textureUpdated,this),e.prototype.destroy.call(this,t)},t}(Mr)),Oi=(function(e){function t(t,n,r,i,o){void 0===t&&(t=j.gP.EMPTY);var a=this,s=new Nr(n,r,i);s.getBuffer("aVertexPosition").static=!1;var l=new Rr(t);return(a=e.call(this,s,l,null,o)||this).autoUpdate=!0,a}Si(t,e),Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),e.prototype._render.call(this,t)}}(Mr),function(e){function t(t,n,r,i,o){void 0===n&&(n=10),void 0===r&&(r=10),void 0===i&&(i=10),void 0===o&&(o=10);var a=e.call(this,j.gP.WHITE,4,4)||this;return a._origWidth=t.orig.width,a._origHeight=t.orig.height,a._width=a._origWidth,a._height=a._origHeight,a._leftWidth=n,a._rightWidth=i,a._topHeight=r,a._bottomHeight=o,a.texture=t,a}Si(t,e),t.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},Object.defineProperty(t.prototype,"vertices",{get:function(){return this.geometry.getBuffer("aVertexPosition").data},set:function(e){this.geometry.getBuffer("aVertexPosition").data=e},enumerable:!1,configurable:!0}),t.prototype.updateHorizontalVertices=function(){var e=this.vertices,t=this._getMinScale();e[9]=e[11]=e[13]=e[15]=this._topHeight*t,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*t,e[25]=e[27]=e[29]=e[31]=this._height},t.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._getMinScale();e[2]=e[10]=e[18]=e[26]=this._leftWidth*t,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*t,e[6]=e[14]=e[22]=e[30]=this._width},t.prototype._getMinScale=function(){var e=this._leftWidth+this._rightWidth,t=this._width>e?1:this._width/e,n=this._topHeight+this._bottomHeight,r=this._height>n?1:this._height/n;return Math.min(t,r)},Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"leftWidth",{get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rightWidth",{get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"topHeight",{get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottomHeight",{get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()},enumerable:!1,configurable:!0}),t.prototype._refresh=function(){var e=this.texture,t=this.geometry.buffers[1].data;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var n=1/this._origWidth,r=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=n*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-n*this._rightWidth,t[9]=t[11]=t[13]=t[15]=r*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()}}(Ti),n(52111),function(e,t){return Oi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Oi(e,t)});!function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t[0]instanceof j.gP?t[0]:t[0].texture)||this;return r._textures=null,r._durations=null,r._autoUpdate=n,r._isConnectedToTicker=!1,r.animationSpeed=1,r.loop=!0,r.updateAnchor=!1,r.onComplete=null,r.onFrameChange=null,r.onLoop=null,r._currentTime=0,r._playing=!1,r._previousFrame=null,r.textures=t,r}(function(e,t){function n(){this.constructor=e}Oi(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)})(t,e),t.prototype.stop=function(){this._playing&&(this._playing=!1,this._autoUpdate&&this._isConnectedToTicker&&(S.Rv.shared.remove(this.update,this),this._isConnectedToTicker=!1))},t.prototype.play=function(){this._playing||(this._playing=!0,this._autoUpdate&&!this._isConnectedToTicker&&(S.Rv.shared.add(this.update,this,S.dQ.HIGH),this._isConnectedToTicker=!0))},t.prototype.gotoAndStop=function(e){this.stop();var t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this.updateTexture()},t.prototype.gotoAndPlay=function(e){var t=this.currentFrame;this._currentTime=e,t!==this.currentFrame&&this.updateTexture(),this.play()},t.prototype.update=function(e){if(this._playing){var t=this.animationSpeed*e,n=this.currentFrame;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=t/60*1e3;r<0;)this._currentTime--,r+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*e);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):n!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramen)&&this.onLoop(),this.updateTexture())}},t.prototype.updateTexture=function(){var e=this.currentFrame;this._previousFrame!==e&&(this._previousFrame=e,this._texture=this._textures[e],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame))},t.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},t.fromFrames=function(e){for(var n=[],r=0;ru});n(9950);var r=n(29206),i=n(81788),o=n(68168),a=n(63027),s=n(9638),l=n(70641),c=n(44414);const u=e=>{let{handleClose:t}=e;const{onAddVideo:n}=(0,s.A)();return(0,c.jsxs)(r.A,{button:!0,onClick:()=>{n(),t&&t()},children:[(0,c.jsx)(o.A,{children:(0,c.jsx)(l.A,{})}),(0,c.jsx)(i.A,{children:(0,c.jsx)(a.A,{id:"addMenu.video"})})]})}},4828(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};t.default=n},4859(e,t,n){"use strict";n.d(t,{A:()=>r});const r=n(9950).createContext({})},4955(e,t,n){"use strict";var r=n(24994),i=n(6305);t.A=void 0;var o=i(n(9950)),a=(0,r(n(53209)).default)(o.createElement("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-5 3c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm4 8h-8v-1c0-1.33 2.67-2 4-2s4 .67 4 2v1z"}),"FolderShared");t.A=a},4959(e,t,n){"use strict";n.d(t,{A:()=>k});var r=n(9950),i=n(63027),o=n(22579),a=n(69499),s=n(63010),l=n(54517),c=n(84580),u=n(81788),d=n(68168),h=n(29206),f=n(4750),p=n(80974),g=n(90047),m=n(25367),v=n(68085),y=n(30400),b=n(41324),w=n(43531),A=n(58323),_=n(19001),C=n(41600),x=n(51690),E=n(44414);const S=(0,p.A)(()=>({nested:{paddingLeft:30},nestednested:{paddingLeft:60},nestedCollapse:{paddingLeft:40}})),D=(e,t)=>n=>{e(!t),n.stopPropagation()},k=()=>{const e=S(),[t,n]=(0,r.useState)(!1),p=D(n,t),[k,T]=(0,r.useState)(!1),O=D(T,k);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(h.A,{button:!0,onClick:p,children:[(0,E.jsx)(d.A,{children:(0,E.jsx)(s.A,{})}),(0,E.jsx)(u.A,{children:(0,E.jsx)(i.A,{id:"devModeMenuLabel"})}),t?(0,E.jsx)(o.A,{}):(0,E.jsx)(a.A,{})]}),(0,E.jsx)(f.A,{in:t,timeout:"auto",unmountOnExit:!0,children:(0,E.jsxs)(c.A,{component:"div",disablePadding:!0,children:[(0,E.jsx)(C.A,{className:e.nested}),(0,E.jsx)(g.A,{className:e.nested}),(0,E.jsx)(_.A,{className:e.nested}),(0,E.jsx)(m.A,{className:e.nested}),(0,E.jsx)(A.A,{className:e.nested}),(0,E.jsx)(v.A,{className:e.nested}),(0,E.jsxs)(h.A,{button:!0,className:e.nestedCollapse,onClick:O,children:[(0,E.jsx)(d.A,{children:(0,E.jsx)(l.A,{})}),(0,E.jsx)(u.A,{children:(0,E.jsx)(i.A,{id:"devModeBenchmarkMenuLabel"})}),k?(0,E.jsx)(o.A,{}):(0,E.jsx)(a.A,{})]}),(0,E.jsxs)(f.A,{in:k,timeout:"auto",unmountOnExit:!0,children:[(0,E.jsx)(y.A,{className:e.nestednested}),(0,E.jsx)(w.A,{className:e.nestednested}),(0,E.jsx)(b.A,{className:e.nestednested}),(0,E.jsx)(x.A,{className:e.nestednested})]})]})})]})}},4966(e,t,n){"use strict";n.d(t,{A:()=>u});n(9950);var r=n(80974),i=n(39886),o=n(44929),a=n.n(o),s=n(34229),l=n(44414);const c=(0,r.A)({root:{display:"flex",alignItems:"center",justifyContent:"center",gap:4,fontSize:14}}),u=()=>{const e=c();return(0,l.jsxs)("div",{className:e.root,children:[(0,l.jsx)(i.A,{variant:"body2",component:"span",style:{marginTop:1},children:"build:"}),(0,l.jsx)(s.A,{text:a()})]})}},4967(e,t,n){"use strict";n.d(t,{A_:()=>h});var r=n(2205),i=n(9950),o=n(32018);function a(){return a=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}var l=function(e){var t=e.meta,n=t.submitError,r=t.dirtySinceLastSubmit,i=t.error,o=t.touched,a=t.modified;return!(!(n&&!r||i)||!o&&!a)};var c=["name","type","fieldProps"],u=["name","value","type","onChange","onBlur","onFocus"],d=["input","meta","required","fullWidth","helperText","showError"];function h(e){var t=e.name,n=e.type,o=e.fieldProps,l=s(e,c);return i.createElement(r.D0,a({name:t,type:n,render:function(e){var r=e.input,o=e.meta;return i.createElement(f,a({input:r,meta:o,name:t,type:n},l))}},o))}function f(e){var t=e.input,n=t.name,r=t.value,c=t.type,h=t.onChange,f=t.onBlur,p=t.onFocus,g=s(t,u),m=e.meta,v=e.required,y=e.fullWidth,b=void 0===y||y,w=e.helperText,A=e.showError,_=void 0===A?l:A,C=s(e,d),x=m.error,E=m.submitError,S=_({meta:m});return i.createElement(o.A,a({fullWidth:b,helperText:S?x||E:w,error:S,onChange:h,onBlur:f,onFocus:p,name:n,value:r,type:c,required:v,inputProps:a({required:v},g)},C))}var p,g,m;p=function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(I){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new k(r||[]);return o._invoke=function(e,t,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=u(e,t,n);if("normal"===l.type){if(r=n.done?p:h,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=p,n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(I){return{type:"throw",arg:I}}}e.wrap=c;var d="suspendedStart",h="suspendedYield",f="executing",p="completed",g={};function m(){}function v(){}function y(){}var b={};l(b,o,function(){return this});var w=Object.getPrototypeOf,A=w&&w(w(T([])));A&&A!==n&&r.call(A,o)&&(b=A);var _=y.prototype=m.prototype=Object.create(b);function C(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function x(e,t){function n(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"===typeof d&&r.call(d,"__await")?t.resolve(d.__await).then(function(e){n("next",e,a,s)},function(e){n("throw",e,a,s)}):t.resolve(d).then(function(e){c.value=e,a(c)},function(e){return n("throw",e,a,s)})}s(l.arg)}var i;this._invoke=function(e,r){function o(){return new t(function(t,i){n(e,r,t,i)})}return i=i?i.then(o,o):o()}}function E(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=u(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function T(e){if(e){var n=e[o];if(n)return n.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;D(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:T(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(n){"object"===typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},p(m={path:g,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},m.exports)},5072(e,t,n){var r=n(82983),i=n(72472),o=n(51804),a=n(95096),s=i.has,l=i.toKey,c=function(e,t,n){if(s(e,t,n))return!0;var r=a(t);return null!==r&&c(e,r,n)};r({target:"Reflect",stat:!0},{hasMetadata:function(e,t){var n=arguments.length<3?void 0:l(arguments[2]);return c(e,o(t),n)}})},5114(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;nf});var r=n(80045),i=n(58168),o=n(9950),a=n(2803),s=n(33720),l=n(52521),c=n(37751),u=n(96287),d=n(49739),h=o.forwardRef(function(e,t){var n,s,c=e.align,h=void 0===c?"inherit":c,f=e.classes,p=e.className,g=e.component,m=e.padding,v=e.scope,y=e.size,b=e.sortDirection,w=e.variant,A=(0,r.A)(e,["align","classes","className","component","padding","scope","size","sortDirection","variant"]),_=o.useContext(u.A),C=o.useContext(d.A),x=C&&"head"===C.variant;g?(s=g,n=x?"columnheader":"cell"):s=x?"th":"td";var E=v;!E&&x&&(E="col");var S=m||(_&&_.padding?_.padding:"normal"),D=y||(_&&_.size?_.size:"medium"),k=w||C&&C.variant,T=null;return b&&(T="asc"===b?"ascending":"descending"),o.createElement(s,(0,i.A)({ref:t,className:(0,a.default)(f.root,f[k],p,"inherit"!==h&&f["align".concat((0,l.A)(h))],"normal"!==S&&f["padding".concat((0,l.A)(S))],"medium"!==D&&f["size".concat((0,l.A)(D))],"head"===k&&_&&_.stickyHeader&&f.stickyHeader),"aria-sort":T,role:n,scope:E},A))});const f=(0,s.A)(function(e){return{root:(0,i.A)({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:"1px solid\n ".concat("light"===e.palette.type?(0,c.a)((0,c.X4)(e.palette.divider,1),.88):(0,c.e$)((0,c.X4)(e.palette.divider,1),.68)),textAlign:"left",padding:16}),head:{color:e.palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},body:{color:e.palette.text.primary},footer:{color:e.palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},sizeSmall:{padding:"6px 24px 6px 16px","&:last-child":{paddingRight:16},"&$paddingCheckbox":{width:24,padding:"0 12px 0 16px","&:last-child":{paddingLeft:12,paddingRight:16},"& > *":{padding:0}}},paddingCheckbox:{width:48,padding:"0 0 0 4px","&:last-child":{paddingLeft:0,paddingRight:4}},paddingNone:{padding:0,"&:last-child":{padding:0}},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right",flexDirection:"row-reverse"},alignJustify:{textAlign:"justify"},stickyHeader:{position:"sticky",top:0,left:0,zIndex:2,backgroundColor:e.palette.background.default}}},{name:"MuiTableCell"})(h)},5412(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;na});var r=n(96369);var i=n(27800),o=n(76562);function a(e,t){return(0,r.A)(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||(0,i.A)(e,t)||(0,o.A)()}},5560(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;nie});var r=n(68039),i=n.n(r),o=n(62504),a=n.n(o),s=n(20755),l=n.n(s),c=new URL(n(65042),n.b),u=new URL(n(49776),n.b),d=new URL(n(46994),n.b),h=new URL(n(96816),n.b),f=new URL(n(22348),n.b),p=new URL(n(82522),n.b),g=new URL(n(80176),n.b),m=new URL(n(4294),n.b),v=new URL(n(12023),n.b),y=new URL(n(22839),n.b),b=new URL(n(50571),n.b),w=new URL(n(84723),n.b),A=new URL(n(15206),n.b),_=new URL(n(99692),n.b),C=new URL(n(84166),n.b),x=new URL(n(24876),n.b),E=new URL(n(84752),n.b),S=new URL(n(80678),n.b),D=new URL(n(44308),n.b),k=new URL(n(18578),n.b),T=new URL(n(63194),n.b),O=new URL(n(13224),n.b),I=new URL(n(23594),n.b),P=new URL(n(90232),n.b),M=a()(i()),R=l()(c),N=l()(u),j=l()(d),F=l()(h),L=l()(f),B=l()(p),z=l()(g),U=l()(m),G=l()(v),H=l()(y),W=l()(b),V=l()(w),q=l()(A),K=l()(_),Y=l()(C),X=l()(x),Q=l()(E),J=l()(S),Z=l()(D),$=l()(k),ee=l()(T),te=l()(O),ne=l()(I),re=l()(P);M.push([e.id,"/* roboto-100normal - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 100;\n src:\n local('Roboto Thin '),\n local('Roboto-Thin'),\n url("+R+") format('woff2'), /* Super Modern Browsers */\n url("+N+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-100italic - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: italic;\n font-display: swap;\n font-weight: 100;\n src:\n local('Roboto Thin italic'),\n local('Roboto-Thinitalic'),\n url("+j+") format('woff2'), /* Super Modern Browsers */\n url("+F+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-300normal - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 300;\n src:\n local('Roboto Light '),\n local('Roboto-Light'),\n url("+L+") format('woff2'), /* Super Modern Browsers */\n url("+B+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-300italic - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: italic;\n font-display: swap;\n font-weight: 300;\n src:\n local('Roboto Light italic'),\n local('Roboto-Lightitalic'),\n url("+z+") format('woff2'), /* Super Modern Browsers */\n url("+U+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-400normal - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src:\n local('Roboto Regular '),\n local('Roboto-Regular'),\n url("+G+") format('woff2'), /* Super Modern Browsers */\n url("+H+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-400italic - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: italic;\n font-display: swap;\n font-weight: 400;\n src:\n local('Roboto Regular italic'),\n local('Roboto-Regularitalic'),\n url("+W+") format('woff2'), /* Super Modern Browsers */\n url("+V+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-500normal - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 500;\n src:\n local('Roboto Medium '),\n local('Roboto-Medium'),\n url("+q+") format('woff2'), /* Super Modern Browsers */\n url("+K+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-500italic - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: italic;\n font-display: swap;\n font-weight: 500;\n src:\n local('Roboto Medium italic'),\n local('Roboto-Mediumitalic'),\n url("+Y+") format('woff2'), /* Super Modern Browsers */\n url("+X+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-700normal - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 700;\n src:\n local('Roboto Bold '),\n local('Roboto-Bold'),\n url("+Q+") format('woff2'), /* Super Modern Browsers */\n url("+J+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-700italic - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: italic;\n font-display: swap;\n font-weight: 700;\n src:\n local('Roboto Bold italic'),\n local('Roboto-Bolditalic'),\n url("+Z+") format('woff2'), /* Super Modern Browsers */\n url("+$+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-900normal - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: normal;\n font-display: swap;\n font-weight: 900;\n src:\n local('Roboto Black '),\n local('Roboto-Black'),\n url("+ee+") format('woff2'), /* Super Modern Browsers */\n url("+te+") format('woff'); /* Modern Browsers */\n}\n\n/* roboto-900italic - latin */\n@font-face {\n font-family: 'Roboto';\n font-style: italic;\n font-display: swap;\n font-weight: 900;\n src:\n local('Roboto Black italic'),\n local('Roboto-Blackitalic'),\n url("+ne+") format('woff2'), /* Super Modern Browsers */\n url("+re+") format('woff'); /* Modern Browsers */\n}\n\n",""]),M.locals={};const ie=M},5836(e,t,n){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;const n=(e=e.trim()).indexOf("```");if(-1===n)return t(e);let r=e.substring(n+3);r.startsWith("json\n")?r=r.substring(5):r.startsWith("json")?r=r.substring(4):r.startsWith("\n")&&(r=r.substring(1));const i=r.indexOf("```");let a=r;return-1!==i&&(a=r.substring(0,i)),t(a.trim())}function i(e){try{return JSON.parse(e)}catch(s){}const t=e.trim();if(0===t.length)throw new Error("Unexpected end of JSON input");let n=0;function r(){for(;n=t.length)throw new Error("Unexpected end of input at position ".concat(n));const e=t[n];if("{"===e)return function(){if("{"!==t[n])throw new Error("Expected '{' at position ".concat(n,", got '").concat(t[n],"'"));const e={};if(n+=1,r(),n>=t.length)return e;if("}"===t[n])return n+=1,e;for(;n=t.length)return e;const a=i();if(r(),n>=t.length)return e;if(":"!==t[n])throw new Error("Expected ':' at position ".concat(n,", got '").concat(t[n],"'"));if(n+=1,r(),n>=t.length)return e;if(e[a]=o(),r(),n>=t.length)return e;if("}"===t[n])return n+=1,e;if(","!==t[n])throw new Error("Expected ',' or '}' at position ".concat(n,", got '").concat(t[n],"'"));n+=1}return e}();if("["===e)return function(){if("["!==t[n])throw new Error("Expected '[' at position ".concat(n,", got '").concat(t[n],"'"));const e=[];if(n+=1,r(),n>=t.length)return e;if("]"===t[n])return n+=1,e;for(;n=t.length)return e;if(e.push(o()),r(),n>=t.length)return e;if("]"===t[n])return n+=1,e;if(","!==t[n])throw new Error("Expected ',' or ']' at position ".concat(n,", got '").concat(t[n],"'"));n+=1}return e}();if('"'===e)return i();if("null".startsWith(t.substring(n,n+4)))return n+=Math.min(4,t.length-n),null;if("true".startsWith(t.substring(n,n+4)))return n+=Math.min(4,t.length-n),!0;if("false".startsWith(t.substring(n,n+5)))return n+=Math.min(5,t.length-n),!1;if("-"===e||e>="0"&&e<="9")return function(){const e=n;let r="";if("-"===t[n]&&(r+="-",n+=1),n="0"&&t[n]<="9"))throw new Error("Invalid number at position ".concat(e));if(n="1"&&t[n]<="9")for(;n="0"&&t[n]<="9";)r+=t[n],n+=1;if(n="0"&&t[n]<="9";)r+=t[n],n+=1;if(n="0"&&t[n]<="9";)r+=t[n],n+=1;if("-"===r)return-0;const i=Number.parseFloat(r);if(Number.isNaN(i))throw n=e,new Error("Invalid number '".concat(r,"' at position ").concat(e));return i}();throw new Error("Unexpected character '".concat(e,"' at position ").concat(n))}const a=o();if(r(),nr,d:()=>o})},5837(e,t,n){n(10336)("flat")},5898(e,t,n){"use strict";e.exports=n(78467)},5902(e,t,n){n(82983)({target:"Math",stat:!0,forced:!0},{umulh:function(e,t){var n=65535,r=+e,i=+t,o=r&n,a=i&n,s=r>>>16,l=i>>>16,c=(s*a>>>0)+(o*a>>>16);return s*l+(c>>>16)+((o*l>>>0)+(c&n)>>>16)}})},5955(e,t,n){"use strict";n.d(t,{D:()=>o,W:()=>i});var r=n(52226);const i=e=>{var t;return 2*(null!==(t=e.cellSpacing)&&void 0!==t?t:.5)*r.A.nodes.gridSize},o=e=>{var t;return 2*(null!==(t=e.cellSpacing)&&void 0!==t?t:0)*r.A.nodes.gridSize}},5987(e,t,n){"use strict";var r=n(86356),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw i("Cannot delete property "+r(t)+" of "+r(e))}},6116(e,t,n){"use strict";n.d(t,{A:()=>V});var r=n(37827),i=n(9950),o=n(54408),a=n(93194),s=n(26638),l=n(12033),c=n(37414),u=n(79399);function d(e,t){return Object.keys(e).reduce(function(n,i){return n[i]=(0,r.Cl)({timeZone:t},e[i]),n},{})}function h(e,t){return Object.keys((0,r.Cl)((0,r.Cl)({},e),t)).reduce(function(n,i){return n[i]=(0,r.Cl)((0,r.Cl)({},e[i]||{}),t[i]||{}),n},{})}function f(e,t){if(!t)return e;var n=l.S.formats;return(0,r.Cl)((0,r.Cl)((0,r.Cl)({},n),e),{date:h(d(n.date,t),d(e.date||{},t)),time:h(d(n.time,t),d(e.time||{},t))})}function p(e,t,n,i,o){var a=e.locale,l=e.formats,d=e.messages,h=e.defaultLocale,p=e.defaultFormats,g=e.fallbackOnEmptyString,m=e.onError,v=e.timeZone,y=e.defaultRichTextElements;void 0===n&&(n={id:""});var b=n.id,w=n.defaultMessage;(0,s.V1)(!!b,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var A=String(b),_=d&&Object.prototype.hasOwnProperty.call(d,A)&&d[A];if(Array.isArray(_)&&1===_.length&&_[0].type===u.ZE.literal)return _[0].value;if(!i&&_&&"string"===typeof _&&!y)return _.replace(/'\{(.*?)\}'/gi,"{$1}");if(i=(0,r.Cl)((0,r.Cl)({},y),i||{}),l=f(l,v),p=f(p,v),!_){if(!1===g&&""===_)return _;if((!w||a&&a.toLowerCase()!==h.toLowerCase())&&m(new c.sb(n,a)),w)try{return t.getMessageFormat(w,h,p,o).format(i)}catch(C){return m(new c.Ho('Error formatting default message for: "'.concat(A,'", rendering default message verbatim'),a,n,C)),"string"===typeof w?w:A}return A}try{return t.getMessageFormat(_,a,l,(0,r.Cl)({formatters:t},o||{})).format(i)}catch(C){m(new c.Ho('Error formatting message: "'.concat(A,'", using ').concat(w?"default message":"id"," as fallback."),a,n,C))}if(w)try{return t.getMessageFormat(w,h,p,o).format(i)}catch(C){m(new c.Ho('Error formatting the default message for: "'.concat(A,'", rendering message verbatim'),a,n,C))}return"string"===typeof _?_:"string"===typeof w?w:A}var g=n(42069),m=["localeMatcher","style","currency","currencyDisplay","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem"];function v(e,t,n){var r=e.locale,i=e.formats,o=e.onError;void 0===n&&(n={});var a=n.format,s=a&&(0,g.F3)(i,"number",a,o)||{};return t(r,(0,g.J9)(n,m,s))}function y(e,t,n,r){void 0===r&&(r={});try{return v(e,t,r).format(n)}catch(i){e.onError(new c.Ar(c.lo.FORMAT_ERROR,"Error formatting number.",i))}return String(n)}function b(e,t,n,r){void 0===r&&(r={});try{return v(e,t,r).formatToParts(n)}catch(i){e.onError(new c.Ar(c.lo.FORMAT_ERROR,"Error formatting number.",i))}return[]}var w=n(18138),A=["numeric","style"];function _(e,t,n,r,i){void 0===i&&(i={}),r||(r="second"),Intl.RelativeTimeFormat||e.onError(new w.IF('Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-relativetimeformat"\n',w.O4.MISSING_INTL_API));try{return function(e,t,n){var r=e.locale,i=e.formats,o=e.onError;void 0===n&&(n={});var a=n.format,s=!!a&&(0,g.F3)(i,"relative",a,o)||{};return t(r,(0,g.J9)(n,A,s))}(e,t,i).format(n,r)}catch(o){e.onError(new c.pg("Error formatting relative time.",e.locale,o))}return String(n)}var C=["localeMatcher","formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem"];function x(e,t,n,i){var o=e.locale,a=e.formats,s=e.onError,l=e.timeZone;void 0===i&&(i={});var c=i.format,u=(0,r.Cl)((0,r.Cl)({},l&&{timeZone:l}),c&&(0,g.F3)(a,t,c,s)),d=(0,g.J9)(i,C,u);return"time"!==t||d.hour||d.minute||d.second||d.timeStyle||d.dateStyle||(d=(0,r.Cl)((0,r.Cl)({},d),{hour:"numeric",minute:"numeric"})),n(o,d)}function E(e,t){for(var n=[],r=2;ri});var r=n(50503);class i{createSession(e){return new r.o(e)}}},6224(e,t,n){"use strict";n.d(t,{A:()=>m});var r=n(89379),i=n(80045),o=(n(9950),n(27014)),a=n(80685),s=n(1389),l=n(96931),c=n(3016),u=n(41355),d=n(48536),h=n(21781),f=n(16946),p=n(44414);const g=["verticalMenu","splitButton"],m=e=>{let{verticalMenu:t,splitButton:n}=e,m=(0,i.A)(e,g);const{selectedNodes:v,selectedEdges:y}=(0,u.A)(),{openFileDialog:b,getInputProps:w}=(0,f.A)(),A=![...v].find(e=>{let{isRoot:t}=e;return!t})&&0===y.size||0===v.size,_=()=>{b(),(0,h.k4)("nodeSetImage")};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("input",(0,r.A)((0,r.A)({},w()),{},{accept:"image/*"})),(0,p.jsx)(d.c,(0,r.A)((0,r.A)({Icon:a.A,splitButtonAction:n&&_,splitButton:n},m),{},{disabled:A,children:(0,p.jsxs)(o.A,{children:[t?(0,p.jsx)(s.A,{style:{paddingTop:6,paddingBottom:6},handleOpenFileDialog:_}):null,(0,p.jsx)(l.A,{style:{paddingTop:6,paddingBottom:6}}),(0,p.jsx)(c.A,{})]})}))]})}},6305(e,t,n){var r=n(73738).default;function i(t,n){if("function"==typeof WeakMap)var o=new WeakMap,a=new WeakMap;return(e.exports=i=function(e,t){if(!t&&e&&e.__esModule)return e;var n,i,s={__proto__:null,default:e};if(null===e||"object"!=r(e)&&"function"!=typeof e)return s;if(n=t?a:o){if(n.has(e))return n.get(e);n.set(e,s)}for(var l in e)"default"!==l&&{}.hasOwnProperty.call(e,l)&&((i=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,l))&&(i.get||i.set)?n(s,l,i):s[l]=e[l]);return s},e.exports.__esModule=!0,e.exports.default=e.exports)(t,n)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},6327(e,t,n){"use strict";n.d(t,{A:()=>o});var r=n(92284),i=(n(9950),n(44414));const o=()=>(0,i.jsxs)(i.Fragment,{children:["Copyright \xa9 ",(0,i.jsx)(r.A,{color:"inherit",href:"https://app.hyperclarity.ai/",children:"HyperClarity"})," ",(new Date).getFullYear(),"."]})},6472(e,t,n){"use strict";n.d(t,{A:()=>f});var r=n(89379),i=(n(9950),n(27014)),o=n(67169),a=n(82401),s=n(23155),l=n(48536),c=n(41355),u=n(21781),d=n(16946),h=n(44414);const f=e=>{let t=Object.assign({},e);const{selectedNodes:n,selectedEdges:f}=(0,c.A)(),{openFileDialog:p,getInputProps:g}=(0,d.A)(),m=![...n].find(e=>{let{isRoot:t}=e;return!t})&&0===f.size||0===n.size;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("input",(0,r.A)({},g())),(0,h.jsx)(l.c,(0,r.A)((0,r.A)({Icon:o.A},t),{},{disabled:m,children:(0,h.jsxs)(i.A,{children:[(0,h.jsx)(s.A,{handleOpenFileDialog:()=>{p(),(0,u.k4)("nodeSetImage")}}),(0,h.jsx)(a.A,{})]})}))]})}},6569(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"};t.default=n},6627(e,t,n){"use strict";const r=n(50904),i=n(34513),{ANY:o}=i,a=n(63073),s=n(53343),l=[new i(">=0.0.0-0")],c=[new i(">=0.0.0")],u=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=n.includePrerelease?l:c}if(1===t.length&&t[0].semver===o){if(n.includePrerelease)return!0;t=c}const r=new Set;let i,u,f,p,g,m,v;for(const o of e)">"===o.operator||">="===o.operator?i=d(i,o,n):"<"===o.operator||"<="===o.operator?u=h(u,o,n):r.add(o.semver);if(r.size>1)return null;if(i&&u){if(f=s(i.semver,u.semver,n),f>0)return null;if(0===f&&(">="!==i.operator||"<="!==u.operator))return null}for(const o of r){if(i&&!a(o,String(i),n))return null;if(u&&!a(o,String(u),n))return null;for(const e of t)if(!a(o,String(e),n))return!1;return!0}let y=!(!u||n.includePrerelease||!u.semver.prerelease.length)&&u.semver,b=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;y&&1===y.prerelease.length&&"<"===u.operator&&0===y.prerelease[0]&&(y=!1);for(const o of t){if(v=v||">"===o.operator||">="===o.operator,m=m||"<"===o.operator||"<="===o.operator,i)if(b&&o.semver.prerelease&&o.semver.prerelease.length&&o.semver.major===b.major&&o.semver.minor===b.minor&&o.semver.patch===b.patch&&(b=!1),">"===o.operator||">="===o.operator){if(p=d(i,o,n),p===o&&p!==i)return!1}else if(">="===i.operator&&!a(i.semver,String(o),n))return!1;if(u)if(y&&o.semver.prerelease&&o.semver.prerelease.length&&o.semver.major===y.major&&o.semver.minor===y.minor&&o.semver.patch===y.patch&&(y=!1),"<"===o.operator||"<="===o.operator){if(g=h(u,o,n),g===o&&g!==u)return!1}else if("<="===u.operator&&!a(u.semver,String(o),n))return!1;if(!o.operator&&(u||i)&&0!==f)return!1}return!(i&&m&&!u&&0!==f)&&(!(u&&v&&!i&&0!==f)&&(!b&&!y))},d=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e===t)return!0;e=new r(e,n),t=new r(t,n);let i=!1;e:for(const r of e.set){for(const e of t.set){const t=u(r,e,n);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},6695(e,t,n){"use strict";var r=n(24994),i=n(6305);t.A=void 0;var o=i(n(9950)),a=(0,r(n(53209)).default)(o.createElement("path",{d:"M8 5v14l11-7z"}),"PlayArrow");t.A=a},6884(e,t,n){"use strict";n.d(t,{Bw:()=>o,LV:()=>i,VT:()=>r});const r={x:0,y:0},i={width:0,height:0},o=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)},6901(e,t,n){"use strict";var r=n(24994);t.A=void 0;var i=r(n(94634)),o=n(53308),a=r(n(51240)),s=function(e){var t=(0,o.styled)(e);return function(e,n){return t(e,(0,i.default)({defaultTheme:a.default},n))}};t.A=s},6936(e,t,n){"use strict";var r;n.d(t,{A:()=>i}),function(e){e.container="container",e.text="text",e.line="line",e.arrow="arrow"}(r||(r={}));const i=r},7042(e,t,n){"use strict";var r=n(15554);e.exports=function(e){return!(!e||!e.ownerDocument)&&(r(e)&&"IMG"===e.nodeName)}},7048(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ParseSpeeds=void 0,function(e){e[e.Fastest=1/0]="Fastest",e[e.Fast=1500]="Fast",e[e.Medium=500]="Medium",e[e.Slow=100]="Slow"}(t.ParseSpeeds||(t.ParseSpeeds={}))},7054(e,t,n){"use strict";n.d(t,{e:()=>f});var r=n(10255),i=n.n(r),o=n(29518),a=n(67208),s=n(74747),l=n(64237),c=n(15811),u=n(23755),d=n(14212);const h=i()("app:Command:Scholar").extend("ERROR*","::");class f extends o.e{constructor(e,t,n){super(e,t),this.params=void 0,this.replyScholar=async(e,t,n)=>{const r=n.from?"".concat(e," site:").concat(n.from):e,i=await(0,s.Kk)(r,t,this.manager,n);i&&await this.renderResponseChat(i,t,this.params.removePrevPrompts)},this.params={removePrevPrompts:null===n||void 0===n?void 0:n.removePrevPrompts}}async run(e,t){const n=(0,l.zj)(t),r=(0,l.el)(t),i=(0,l.W6)(t),o=(0,l.ki)(t),s=(0,c.jd)(),f=(0,l.tV)(t);let p="";if(f&&(0,d.A)(f))try{p=new URL(f).host}catch(v){p=f}const g={citations:n,lang:r,maxChunks:i,minYear:o,storageKey:s,from:p},m=(0,a.MV)(e,this.engine.renderNodes);e.startPrompt();try{return!!await this.hasApiKey(t)&&(await this.replyScholar(m,e,g),!0)}catch(y){return h(y),!1}finally{e.stopPrompt(),u.v.deleteData(s)}}}},7074(e,t,n){"use strict";function r(e){return r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!==typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n(9950)),o=n(24261),a=n(30277);function s(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;tv});var r=n(19969),i=n(13994),o=n(10255),a=n.n(o),s=n(69298),l=n(20632);const c=a()("app:TripletNodeFactory");class u{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l._.default();this.manager=void 0,this.similarityFinder=void 0,this.creationConfig=void 0,this.manager=e,this.similarityFinder=t,this.creationConfig=n}findOrCreateChild(e,t,n){const r=this.similarityFinder.findSimilar(t,n);return r||this.createChild(e,t,n)}createChild(e,t,n){const r=this.manager.createChildBatch(e,{title:t,metaTitle:t,scale:this.creationConfig.scale});return r.autoshrink=this.creationConfig.autoshrink,n[t]=r,this.manager.addDispatchBatch((0,s.Wz)(e,r.id)),c("[CREATE] Node=%s id=%s scale=%s autoshrink=%s",t,r.id,this.creationConfig.scale,this.creationConfig.autoshrink),r}}var d=n(15811);class h{constructor(e,t){this.createdEdgeIds=new Set,this.engine=void 0,this.manager=void 0,this.engine=e,this.manager=t}createIfNotExists(e,t,n){if(e.id===t.id)return!1;const r=(0,d.qB)(e.id,t.id);return!this.edgeExists(r)&&(this.manager.addDispatchBatch((0,s.rN)({id:r,start:e.id,end:t.id,title:n})),this.createdEdgeIds.add(r),!0)}edgeExists(e){return!!this.engine.renderEdges[e]||this.createdEdgeIds.has(e)}clearCreatedEdges(){this.createdEdgeIds.clear()}}var f=n(96123),p=n(17110);class g{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.engine=e,this.manager=t,this.nodeFactory=void 0,this.edgeFactory=void 0;const{titleSource:r="title",nodeCreation:i=l._.default()}=n,o=new f.I(new p.T,r);this.nodeFactory=new u(t,o,i),this.edgeFactory=new h(e,t)}visualizeTriplets(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{hierarchical:i,relational:o}=this.categorizeTriplets(t,n);this.createHierarchicalNodes(e,i,r),this.createRelationalEdges(e,o,r),this.manager.commitDispatches(!1)}categorizeTriplets(e,t){const n=[],r=[];return e.forEach(e=>{t[i.i.SIMPLE].includes(e.type)?r.push(e):n.push(e)}),{hierarchical:n,relational:r}}createHierarchicalNodes(e,t,n){t.forEach(t=>{let{head:r,tail:i}=t;const o=this.nodeFactory.findOrCreateChild(e,r,n);this.nodeFactory.findOrCreateChild(o,i,n)})}createRelationalEdges(e,t,n){t.forEach(t=>{let{head:r,tail:i,type:o}=t;const a=this.nodeFactory.findOrCreateChild(e,r,n),s=this.nodeFactory.findOrCreateChild(e,i,n);this.edgeFactory.createIfNotExists(a,s,o)})}}var m=n(70717);class v{constructor(e,t){var n,i;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.engine=e,this.manager=t,this.options=o,this.traversal=void 0,this.visualizationManager=void 0,this.layoutOrchestrator=void 0,this.traversal=new r.e,this.visualizationManager=new g(e,t,{titleSource:o.titleSource,nodeCreation:o.nodeCreation}),this.layoutOrchestrator=new m.X(e,t,null!==(n=null===(i=t.state)||void 0===i?void 0:i.autoNavigation)&&void 0!==n&&n)}async buildFromTriplets(e,t,n){var r;const i=this.traversal.collectDescendantsWithTitles(e,{titleSource:this.options.titleSource});this.visualizationManager.visualizeTriplets(e,t,n,i),await this.layoutOrchestrator.reorganize(e,null!==(r=this.options.layoutStrategy)&&void 0!==r?r:"immediate")}async mergeTripletsIntoExisting(e,t,n){var r;const i=this.traversal.collectDescendantsWithTitles(e,{titleSource:this.options.titleSource});this.visualizationManager.visualizeTriplets(e,t,n,i),await this.layoutOrchestrator.reorganize(e,null!==(r=this.options.layoutStrategy)&&void 0!==r?r:"batch")}}},7362(e,t,n){"use strict";n.d(t,{y:()=>i});var r=n(64467),i=class{constructor(e){var t;(0,r.A)(this,"pageContent",void 0),(0,r.A)(this,"metadata",void 0),(0,r.A)(this,"id",void 0),this.pageContent=void 0!==e.pageContent?e.pageContent.toString():"",this.metadata=null!==(t=e.metadata)&&void 0!==t?t:{},this.id=e.id}}},7424(e,t,n){"use strict";n.d(t,{A:()=>h});n(9950);var r=n(29206),i=n(81788),o=n(68168),a=n(63027),s=n(81390),l=n(34577),c=n(79130),u=n(52394),d=n(44414);const h=e=>{let{handleClose:t}=e;const n=(0,l.A)(),{mapId:h}=(0,u.A)();return(0,d.jsxs)(r.A,{button:!0,onClick:()=>{n(c.A,{mapId:h}),t&&t()},children:[(0,d.jsx)(o.A,{children:(0,d.jsx)(s.A,{})}),(0,d.jsx)(i.A,{children:(0,d.jsx)(a.A,{id:"menuVisibility"})})]})}},7456(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var i=n(63672),o=n(83566),a=n(63075),s=n(4639),l=n(74816),c=n(95186),u=s.Map,d={subtree:!0,characterData:!0,childList:!0,characterDataOldValue:!1,attributes:!1},h=i.isBrowser("IE <= 11"),f=function(){function e(e){var t=this;r(this,"observer",void 0),r(this,"container",void 0),r(this,"mutations",void 0),r(this,"onCharData",void 0),this.container=e,this.mutations=u();var n=a(e);n.MutationObserver&&!h?this.observer=new n.MutationObserver(function(e){return t.registerMutations(e)}):this.onCharData=function(e){e.target instanceof Node||l(!1),t.registerMutation({type:"characterData",target:e.target})}}var t=e.prototype;return t.start=function(){this.observer?this.observer.observe(this.container,d):this.container.addEventListener("DOMCharacterDataModified",this.onCharData)},t.stopAndFlushMutations=function(){var e=this.observer;e?(this.registerMutations(e.takeRecords()),e.disconnect()):this.container.removeEventListener("DOMCharacterDataModified",this.onCharData);var t=this.mutations;return this.mutations=u(),t},t.registerMutations=function(e){for(var t=0;ta});var r=n(64467),i=n(33587),o=n(81880);(0,i.V)({},{Embeddings:()=>a});var a=class{constructor(e){(0,r.A)(this,"caller",void 0),this.caller=new o.g(null!==e&&void 0!==e?e:{})}}},7535(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631),i=r.__importDefault(n(55126)),o=r.__importDefault(n(35411)),a=r.__importDefault(n(60786)),s=r.__importDefault(n(45324)),l=r.__importDefault(n(76235)),c=n(19507),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.Opt=function(){return this.dict.lookupMaybe(s.default.of("Opt"),i.default,o.default,a.default)},t.prototype.setOpt=function(e){this.dict.set(s.default.of("Opt"),this.dict.context.obj(e))},t.prototype.getExportValues=function(){var e=this.Opt();if(e){if(e instanceof i.default||e instanceof o.default)return[e];for(var t=[],n=0,r=e.size();nt.size())throw new c.IndexOutOfBoundsError(e,0,t.size());t.remove(e)}},t.prototype.normalizeExportValues=function(){for(var e,t,n,r,i=null!==(e=this.getExportValues())&&void 0!==e?e:[],a=[],s=this.getWidgets(),l=0,c=s.length;lw});var r=n(89379),i=n(80045),o=(n(9950),n(45486)),a=n(55510),s=n(64479),l=n(8069),c=n(40040),u=n(4111),d=n(22669),h=n(56984),f=n(49806),p=n(86453),g=n(34804),m=n(25014),v=n(37861),y=n(44414);const b=["focusSearchTextField"],w=e=>{let{focusSearchTextField:t}=e,n=(0,i.A)(e,b);return(0,y.jsxs)(o.A,(0,r.A)((0,r.A)({},n),{},{children:[(0,y.jsx)(s.A,{}),(0,y.jsx)(l.A,{}),(0,y.jsx)(a.A,{}),(0,y.jsx)(c.A,{}),(0,y.jsx)(u.A,{}),(0,y.jsx)(d.A,{}),(0,y.jsx)(h.A,{}),(0,y.jsx)(a.A,{}),(0,y.jsx)(f.A,{}),(0,y.jsx)(a.A,{}),(0,y.jsx)(p.A,{}),(0,y.jsx)(g.A,{}),(0,y.jsx)(m.A,{}),(0,y.jsx)(v.A,{focusSearchTextField:t})]}))}},7658(e,t,n){"use strict";function r(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}n.d(t,{A:()=>r})},7692(e,t,n){"use strict";n.d(t,{A:()=>R});var r=n(58168),i=n(80045),o=n(9950),a=n(97101),s=n(5544),l=n(82284),c=n(81282),u=(n(26429),n(2803)),d=n(95673),h=n(52521),f=n(45486),p=n(80534),g=n(539),m=n(58438);function v(e,t){return"object"===(0,l.A)(t)&&null!==t?e===t:String(e)===String(t)}const y=o.forwardRef(function(e,t){var n=e["aria-label"],a=e.autoFocus,l=e.autoWidth,y=e.children,b=e.classes,w=e.className,A=e.defaultValue,_=e.disabled,C=e.displayEmpty,x=e.IconComponent,E=e.inputRef,S=e.labelId,D=e.MenuProps,k=void 0===D?{}:D,T=e.multiple,O=e.name,I=e.onBlur,P=e.onChange,M=e.onClose,R=e.onFocus,N=e.onOpen,j=e.open,F=e.readOnly,L=e.renderValue,B=e.SelectDisplayProps,z=void 0===B?{}:B,U=e.tabIndex,G=(e.type,e.value),H=e.variant,W=void 0===H?"standard":H,V=(0,i.A)(e,["aria-label","autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"]),q=(0,m.A)({controlled:G,default:A,name:"Select"}),K=(0,s.A)(q,2),Y=K[0],X=K[1],Q=o.useRef(null),J=o.useState(null),Z=J[0],$=J[1],ee=o.useRef(null!=j).current,te=o.useState(),ne=te[0],re=te[1],ie=o.useState(!1),oe=ie[0],ae=ie[1],se=(0,g.A)(t,E);o.useImperativeHandle(se,function(){return{focus:function(){Z.focus()},node:Q.current,value:Y}},[Z,Y]),o.useEffect(function(){a&&Z&&Z.focus()},[a,Z]),o.useEffect(function(){if(Z){var e=(0,d.A)(Z).getElementById(S);if(e){var t=function(){getSelection().isCollapsed&&Z.focus()};return e.addEventListener("click",t),function(){e.removeEventListener("click",t)}}}},[S,Z]);var le,ce,ue=function(e,t){e?N&&N(t):M&&M(t),ee||(re(l?null:Z.clientWidth),ae(e))},de=o.Children.toArray(y),he=function(e){return function(t){var n;if(T||ue(!1,t),T){n=Array.isArray(Y)?Y.slice():[];var r=Y.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;e.props.onClick&&e.props.onClick(t),Y!==n&&(X(n),P&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:O}}),P(t,e)))}},fe=null!==Z&&(ee?j:oe);delete V["aria-invalid"];var pe=[],ge=!1;((0,p.lq)({value:Y})||C)&&(L?le=L(Y):ge=!0);var me=de.map(function(e){if(!o.isValidElement(e))return null;var t;if(T){if(!Array.isArray(Y))throw new Error((0,c.A)(2));(t=Y.some(function(t){return v(t,e.props.value)}))&&ge&&pe.push(e.props.children)}else(t=v(Y,e.props.value))&&ge&&(ce=e.props.children);return t&&!0,o.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:he(e),onKeyUp:function(t){" "===t.key&&t.preventDefault(),e.props.onKeyUp&&e.props.onKeyUp(t)},role:"option",selected:t,value:void 0,"data-value":e.props.value})});ge&&(le=T?pe.join(", "):ce);var ve,ye=ne;!l&&ee&&Z&&(ye=Z.clientWidth),ve="undefined"!==typeof U?U:_?null:0;var be=z.id||(O?"mui-component-select-".concat(O):void 0);return o.createElement(o.Fragment,null,o.createElement("div",(0,r.A)({className:(0,u.default)(b.root,b.select,b.selectMenu,b[W],w,_&&b.disabled),ref:$,tabIndex:ve,role:"button","aria-disabled":_?"true":void 0,"aria-expanded":fe?"true":void 0,"aria-haspopup":"listbox","aria-label":n,"aria-labelledby":[S,be].filter(Boolean).join(" ")||void 0,onKeyDown:function(e){if(!F){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),ue(!0,e))}},onMouseDown:_||F?null:function(e){0===e.button&&(e.preventDefault(),Z.focus(),ue(!0,e))},onBlur:function(e){!fe&&I&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:Y,name:O}}),I(e))},onFocus:R},z,{id:be}),function(e){return null==e||"string"===typeof e&&!e.trim()}(le)?o.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):le),o.createElement("input",(0,r.A)({value:Array.isArray(Y)?Y.join(","):Y,name:O,ref:Q,"aria-hidden":!0,onChange:function(e){var t=de.map(function(e){return e.props.value}).indexOf(e.target.value);if(-1!==t){var n=de[t];X(n.props.value),P&&P(e,n)}},tabIndex:-1,className:b.nativeInput,autoFocus:a},V)),o.createElement(x,{className:(0,u.default)(b.icon,b["icon".concat((0,h.A)(W))],fe&&b.iconOpen,_&&b.disabled)}),o.createElement(f.A,(0,r.A)({id:"menu-".concat(O||""),anchorEl:Z,open:fe,onClose:function(e){ue(!1,e)}},k,{MenuListProps:(0,r.A)({"aria-labelledby":S,role:"listbox",disableListWrap:!0},k.MenuListProps),PaperProps:(0,r.A)({},k.PaperProps,{style:(0,r.A)({minWidth:ye},null!=k.PaperProps?k.PaperProps.style:null)})}),me))});var b=n(20401),w=n(87147),A=n(33720);const _=(0,n(32776).A)(o.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");var C=n(57942);const x=o.forwardRef(function(e,t){var n=e.classes,a=e.className,s=e.disabled,l=e.IconComponent,c=e.inputRef,d=e.variant,f=void 0===d?"standard":d,p=(0,i.A)(e,["classes","className","disabled","IconComponent","inputRef","variant"]);return o.createElement(o.Fragment,null,o.createElement("select",(0,r.A)({className:(0,u.default)(n.root,n.select,n[f],a,s&&n.disabled),disabled:s,ref:c||t},p)),e.multiple?null:o.createElement(l,{className:(0,u.default)(n.icon,n["icon".concat((0,h.A)(f))],s&&n.disabled)}))});var E=function(e){return{root:{},select:{"-moz-appearance":"none","-webkit-appearance":"none",userSelect:"none",borderRadius:0,minWidth:16,cursor:"pointer","&:focus":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",borderRadius:0},"&::-ms-expand":{display:"none"},"&$disabled":{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:e.palette.background.paper},"&&":{paddingRight:24}},filled:{"&&":{paddingRight:32}},outlined:{borderRadius:e.shape.borderRadius,"&&":{paddingRight:32}},selectMenu:{height:"auto",minHeight:"1.1876em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},disabled:{},icon:{position:"absolute",right:0,top:"calc(50% - 12px)",pointerEvents:"none",color:e.palette.action.active,"&$disabled":{color:e.palette.action.disabled}},iconOpen:{transform:"rotate(180deg)"},iconFilled:{right:7},iconOutlined:{right:7},nativeInput:{bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%"}}},S=o.createElement(C.A,null),D=o.forwardRef(function(e,t){var n=e.children,a=e.classes,s=e.IconComponent,l=void 0===s?_:s,c=e.input,u=void 0===c?S:c,d=e.inputProps,h=(e.variant,(0,i.A)(e,["children","classes","IconComponent","input","inputProps","variant"])),f=(0,w.A)(),p=(0,b.A)({props:e,muiFormControl:f,states:["variant"]});return o.cloneElement(u,(0,r.A)({inputComponent:x,inputProps:(0,r.A)({children:n,classes:a,IconComponent:l,variant:p.variant,type:void 0},d,u?u.props.inputProps:{}),ref:t},h))});D.muiName="Select";(0,A.A)(E,{name:"MuiNativeSelect"})(D);var k=n(44290),T=n(13913),O=E,I=o.createElement(C.A,null),P=o.createElement(k.A,null),M=o.forwardRef(function e(t,n){var s=t.autoWidth,l=void 0!==s&&s,c=t.children,u=t.classes,d=t.displayEmpty,h=void 0!==d&&d,f=t.IconComponent,p=void 0===f?_:f,g=t.id,m=t.input,v=t.inputProps,A=t.label,C=t.labelId,E=t.labelWidth,S=void 0===E?0:E,D=t.MenuProps,k=t.multiple,O=void 0!==k&&k,M=t.native,R=void 0!==M&&M,N=t.onClose,j=t.onOpen,F=t.open,L=t.renderValue,B=t.SelectDisplayProps,z=t.variant,U=void 0===z?"standard":z,G=(0,i.A)(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","label","labelId","labelWidth","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"]),H=R?x:y,W=(0,w.A)(),V=(0,b.A)({props:t,muiFormControl:W,states:["variant"]}).variant||U,q=m||{standard:I,outlined:o.createElement(T.A,{label:A,labelWidth:S}),filled:P}[V];return o.cloneElement(q,(0,r.A)({inputComponent:H,inputProps:(0,r.A)({children:c,IconComponent:p,variant:V,type:void 0,multiple:O},R?{id:g}:{autoWidth:l,displayEmpty:h,labelId:C,MenuProps:D,onClose:N,onOpen:j,open:F,renderValue:L,SelectDisplayProps:(0,r.A)({id:g},B)},v,{classes:v?(0,a.A)({baseClasses:u,newClasses:v.classes,Component:e}):u},m?m.props.inputProps:{}),ref:n},G))});M.muiName="Select";const R=(0,A.A)(O,{name:"MuiSelect"})(M)},7707(e,t,n){"use strict";var r=n(82983),i=n(41126),o=n(20019),a=n(53922),s=n(77162),l=n(16344),c=n(123),u="No one promise resolved";r({target:"Promise",stat:!0},{any:function(e){var t=this,n=a("AggregateError"),r=s.f(t),d=r.resolve,h=r.reject,f=l(function(){var r=o(t.resolve),a=[],s=0,l=1,f=!1;c(e,function(e){var o=s++,c=!1;l++,i(r,t,e).then(function(e){c||f||(f=!0,d(e))},function(e){c||f||(c=!0,a[o]=e,--l||h(new n(a,u)))})}),--l||h(new n(a,u))});return f.error&&h(f.value),r.promise}})},7710(e,t,n){var r=n(69662),i=n(49680),o=n(54519),a=n(78100),s=n(32509).trim,l=n(53759),c=r.parseInt,u=r.Symbol,d=u&&u.iterator,h=/^[+-]?0x/i,f=o(h.exec),p=8!==c(l+"08")||22!==c(l+"0x16")||d&&!i(function(){c(Object(d))});e.exports=p?function(e,t){var n=s(a(e));return c(n,t>>>0||(f(h,n)?16:10))}:c},7757(e,t,n){"use strict";function r(e){return e}n.d(t,{A:()=>r})},7819(e,t,n){"use strict";var r=n(24994),i=n(6305);t.A=void 0;var o=i(n(9950)),a=(0,r(n(53209)).default)(o.createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}),"InsertPhoto");t.A=a},7910(e,t,n){var r=n(18212),i=n(48743),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},7931(e,t,n){"use strict";n.d(t,{A:()=>d});var r=n(65155),i=n(9950),o=n(63027),a=n(42010),s=n(16706),l=n(21240),c=n(30158),u=n(44414);const d=()=>{var e;const{mapId:t}=(0,r.g)(),[n,d]=(0,i.useState)(!1),{location:h}=(0,r.W6)(),{success:f,error:p}=(0,a.A)(),[g]=(0,s.A)({url:"/maps/".concat(t,"/repair"),onSuccess:()=>{f((0,u.jsx)(o.A,{id:"mapRepairSuccessful"}))},onError:e=>{p((0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(o.A,{id:"mapRepairFailed"}),": ",e.message]}))}});return(0,i.useEffect)(()=>{let e=!0;return(async()=>{await(0,l.A)(11e3),await g(),e&&d(!0)})(),()=>e=!1},[d,g]),!t||n||(null===(e=h.state)||void 0===e?void 0:e.mapId)!==t?(0,u.jsx)(r.rd,{to:"/maps"}):(0,u.jsx)(c.A,{children:(0,u.jsx)(o.A,{id:"mapRepairInProgressMessage"})})}},8046(e,t,n){"use strict";n.d(t,{S:()=>f});var r=n(10255),i=n.n(r),o=n(29518),a=n(74747),s=n(22838),l=n(69243),c=n(64237),u=n(52749),d=n(22995);const h=i()("app:Command:Dalle").extend("ERROR*","::");class f extends o.e{constructor(){super(...arguments),this.createImage=async(e,t,n)=>{if(!await this.hasApiKey())return;const r=await(0,a.mE)(e,t,this.manager,n);if(!r)return;const i=await fetch("".concat(l.DN,"/integration/downloadImage"),{method:"POST",body:JSON.stringify({imageUrl:r})});return await i.blob()},this.insertImageToMap=async(e,t)=>{const n=await(0,s.Se)(e,this.manager.store.mapId),{apiAnswer:r,metadata:i}=n,{_id:o}=r;this.manager.insertImageToMap(t,o,i)}}async run(e,t){e.startPrompt();const n={size:(0,c.lW)(t)};try{const r=await this.createImage((0,c.Ot)((0,u.yk)((0,u.yk)((0,c.pK)(t),d.PU),d.jG)),e,n);return r&&await this.insertImageToMap(r,e),!0}catch(r){return h(r),!1}finally{e.stopPrompt()}}}},8060(e,t,n){"use strict";n.d(t,{E:()=>r});class r{constructor(e){this.mapId=e,this.userBaseline=null}static getInstance(e){const t=r.instances.get(e);if(t)return t;const n=new r(e);return r.instances.set(e,n),n}static clearInstance(e){r.instances.delete(e)}static clearAllInstances(){r.instances.clear()}setUserBaseline(e){this.userBaseline=e}getUserBaseline(){return this.userBaseline}clearUserBaseline(){this.userBaseline=null}getMapId(){return this.mapId}}r.instances=new Map},8069(e,t,n){"use strict";n.d(t,{A:()=>d});n(9950);var r=n(29206),i=n(81788),o=n(68168),a=n(83882),s=n(63027),l=n(21781),c=n(52394),u=n(44414);const d=e=>{let{handleClose:t}=e;const{canRedo:n,redo:d}=(0,c.A)();return(0,u.jsxs)(r.A,{button:!0,disabled:!n,onClick:()=>{d(),(0,l.u4)({action:"redo",details:{method:"toolbar"}}),t&&t()},children:[(0,u.jsx)(o.A,{children:(0,u.jsx)(a.A,{})}),(0,u.jsx)(i.A,{children:(0,u.jsx)(s.A,{id:"editMenu.redo"})})]})}},8072(e,t,n){"use strict";n.a(e,async(e,r)=>{try{n.d(t,{p:()=>l});var i=n(2412),o=e([i]),a=o.then?(await o)():o;async function l(e){const t=(0,i.YE)({url:URL.createObjectURL(e)}),n=await t.promise,{numPages:r}=n;let o="";for(let i=1;i<=r;i+=1){const e=await n.getPage(i);o+=(await e.getTextContent()).items.map(e=>e.str).join(" ")}return o}(i=a[0]).EA.workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(i.rE,"/pdf.worker.mjs"),r()}catch(s){r(s)}})},8195(e,t,n){"use strict";function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}n.d(t,{A:()=>r})},8244(e,t,n){"use strict";function r(e,t){return i(e)&&e.type===t}function i(e){return"object"===typeof e&&null!==e}function o(e){return Array.isArray(e)}function a(e){return"string"===typeof e}function s(e){return"number"===typeof e}function l(e){return e instanceof Uint8Array}function c(e){try{return JSON.parse(e)}catch(t){return}}n.d(t,{MP:()=>r,MS:()=>l,NS:()=>c,V3:()=>o,iD:()=>u,jM:()=>s,nD:()=>i,vQ:()=>a});const u=e=>e()},8249(e,t,n){"use strict";n.d(t,{M:()=>i,h:()=>r});const r=(e,t)=>e.filter(e=>e.length>0).join(t),i=e=>{const t=e.filter(e=>e.text.length>0).map(e=>({name:e.name,chars:e.text.length}));return{sections:t,totalChars:t.reduce((e,t)=>e+t.chars,0)}}},8255(e,t,n){"use strict";n.d(t,{A:()=>d});n(9950);var r=n(29206),i=n(81788),o=n(68168),a=n(89001),s=n(65155),l=n(63027),c=n(52394),u=n(44414);const d=()=>{const e=(0,s.W6)(),t=(0,c.A)(!1);return(0,u.jsxs)(r.A,{button:!0,onClick:()=>{const n=null===t||void 0===t?void 0:t.map,r=null===n||void 0===n?void 0:n.folderId,i=r?"/maps/new?folderId=".concat(r):"/maps/new";e.push(i)},children:[(0,u.jsx)(o.A,{children:(0,u.jsx)(a.A,{})}),(0,u.jsx)(i.A,{children:(0,u.jsx)(l.A,{id:"file.new"})})]})}},8297(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={black:"#000",white:"#fff"};t.default=n},8316(e,t,n){"use strict";n.d(t,{B:()=>o,m:()=>s});n(9950);var r=n(92284),i=n(44414);const o=(a="https://app.hyperclarity.ai/shop/",e=>(0,i.jsx)(r.A,{href:a,children:e}));var a;const s=e=>(0,i.jsx)(r.A,{to:"/maps/feedback",children:e})},8366(e,t,n){"use strict";n.d(t,{Y:()=>h,k:()=>f});var r=n(9950),i=n(10255),o=n.n(i),a=n(28379),s=n(41355),l=n(44414);const c=o()("app:context:devMode"),u="app:*::FLOOD",d="app:*::PERFORMANCE";["app:*,-app:*::FLOOD","app:*::ERROR*"].includes(localStorage.getItem("debug"))&&localStorage.removeItem("debug");const h=(0,r.createContext)(),f=e=>{let{children:t}=e;const[n]=(0,a.A)("debug","app:*::ERROR*"),[i,f]=(0,a.A)("debugLogsActive",!1),[p,g]=(0,a.A)("floodLogsActive",!1),[m,v]=(0,a.A)("performanceLogsActive",!1),[y,b]=(0,a.A)("meetingTranscriptActive",!1);(0,r.useEffect)(()=>{const e=[n,i&&"app:*",p?u:"-".concat(u),m?d:"-".concat(d)].filter(Boolean).join(",");c("setting log level",e),o().enable(e)},[n,i,p,m]);const[w,A]=(0,a.A)("mapStatsVisible",!1),[_,C]=(0,a.A)("fpsCounterVisible",!1),[x,E]=(0,a.A)("systemInformationVisible",!1),{setState:S}=(0,s.A)(!1),[D,k]=(0,a.A)("fpsTickerRun",!1);(0,r.useEffect)(()=>{S({tickerStop:!D})},[D,S]);const[T,O]=(0,a.A)("nodeJumpVisible",!1),[I,P]=(0,a.A)("circleBenchmarkVisible",!1),[M,R]=(0,a.A)("showMetrics",!1),N=(0,r.useMemo)(()=>({debugLogsActive:i,setDebugLogsActive:f,floodLogsActive:p,setFloodLogsActive:g,performanceLogsActive:m,setPerformanceLogsActive:v,mapStatsVisible:w,setMapStatsVisible:A,fpsCounterVisible:_,setFpsCounterVisible:C,systemInformationVisible:x,setSystemInformationVisible:E,fpsTickerRun:D,setFpsTickerRun:k,nodeJumpVisible:T,setNodeJumpVisible:O,circleBenchmarkVisible:I,setCircleBenchmarkVisible:P,showMetrics:M,setShowMetrics:R,meetingTranscriptActive:y,setmMeetingTranscriptActive:b}),[i,f,p,g,m,v,w,A,_,C,x,E,D,k,T,O,I,P,M,R,y,b]);return(0,l.jsx)(h.Provider,{value:N,children:t})}},8434(e,t,n){var r=n(82983),i=Math.hypot,o=Math.abs,a=Math.sqrt;r({target:"Math",stat:!0,arity:2,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(e,t){for(var n,r,i=0,s=0,l=arguments.length,c=0;s0?(r=n/c)*r:n;return c===1/0?1/0:c*a(i)}})},8447(e,t,n){"use strict";n.d(t,{$e:()=>h,Be:()=>u,I$:()=>d,Y2:()=>p,bb:()=>g,kh:()=>m,zm:()=>f});var r=n(37380);const i="Answer the following questions as best you can. You have access to the following tools:",o="Use the following format in your response:\n\nQuestion: the input question you must answer\nThought: you should always think about what to do, ensuring to maintain all relevant details and structure from observations\nAction: the action to take, should be one of [{tool_names}]. Do not translate the name of the action or add your comments to the name\nAction Input: the input to the action\nObservation: the result of the action, containing potentially detailed and structured information\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question, preserving all relevant details and structure from observations without unnecessary consolidation",a="Begin!\n\nQuestion: {input}\nThought:{agent_scratchpad}",s="Final Answer",l=["Observation:"],c="Thought:",u=e=>{switch(e){case r.JA.en:case r.JA.ru:}return i},d=e=>{switch(e){case r.JA.en:case r.JA.ru:}return a},h=e=>{switch(e){case r.JA.en:case r.JA.ru:}return o},f=e=>{switch(e){case r.JA.en:case r.JA.ru:}return s},p=e=>{switch(e){case r.JA.en:case r.JA.ru:}return r.pL},g=e=>{switch(e){case r.JA.en:case r.JA.ru:}return l},m=e=>{switch(e){case r.JA.en:case r.JA.ru:}return c}},8452(e,t,n){"use strict";var r=n(24994),i=n(6305);t.A=void 0;var o=i(n(9950)),a=(0,r(n(53209)).default)(o.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check");t.A=a},8482(e){"use strict";var t="undefined"!==typeof navigator&&navigator.userAgent.indexOf("AppleWebKit")>-1;e.exports=function(e){return(e=e||document).scrollingElement?e.scrollingElement:t||"CSS1Compat"!==e.compatMode?e.body:e.documentElement}},8499(e,t,n){"use strict";var r=n(24994),i=n(6305);t.A=void 0;var o=i(n(9950)),a=(0,r(n(53209)).default)(o.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");t.A=a},8762(e,t,n){"use strict";var r=n(82983),i=n(51804),o=n(44371),a=n(71515),s=n(123);r({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=i(this),n=a(t),r=o(e,arguments.length>1?arguments[1]:void 0);return!s(n,function(e,n){if(!r(e,e,t))return n()},{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},8817(e,t,n){var r=n(82983),i=n(51804),o=n(95905),a=n(77437),s=n(88040),l="Seeded Random",c=l+" Generator",u=s.set,d=s.getterFor(c),h=TypeError,f=a(function(e){u(this,{type:c,seed:e%2147483647})},l,function(){var e=d(this);return{value:(1073741823&(e.seed=(1103515245*e.seed+12345)%2147483647))/1073741823,done:!1}});r({target:"Math",stat:!0,forced:!0},{seededPRNG:function(e){var t=i(e).seed;if(!o(t))throw h('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new f(t)}})},8821(e,t,n){n(73952)("Uint16",function(e){return function(t,n,r){return e(this,t,n,r)}})},8832(e,t,n){"use strict";function r(e,t){return e.lc_error_code=t,e.message="".concat(e.message,"\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/").concat(t,"/\n"),e}n.d(t,{Db:()=>ge,gP:()=>i.z4,LD:()=>be});var i=n(31843);function o(e){if(!e||"object"!==typeof e)return e;let t;return e.constructor.name===i.qA.name&&"message"in e&&"string"===typeof e.message?(t=new Error(e.message),t.name="TimeoutError"):e.constructor.name===i.cH.name&&"message"in e&&"string"===typeof e.message?(t=new Error(e.message),t.name="AbortError"):t="status"in e&&400===e.status&&"message"in e&&"string"===typeof e.message&&e.message.includes("tool_calls")?r(e,"INVALID_TOOL_RESULTS"):"status"in e&&401===e.status?r(e,"MODEL_AUTHENTICATION"):"status"in e&&429===e.status?r(e,"MODEL_RATE_LIMIT"):"status"in e&&404===e.status?r(e,"MODEL_NOT_FOUND"):e,t}var a=n(11570);const s=e=>e();function l(e){return!!e&&(!!/^o\d/.test(null!==e&&void 0!==e?e:"")||!(!e.startsWith("gpt-5")||e.startsWith("gpt-5-chat")))}function c(e){var t,n,r,i,o;const a=null!==(t=null!==(n=null===(r=e.metadata)||void 0===r?void 0:r.filename)&&void 0!==n?n:null===(i=e.metadata)||void 0===i?void 0:i.name)&&void 0!==t?t:null===(o=e.metadata)||void 0===o?void 0:o.title;if(!a)throw new Error("a filename or name or title is needed via meta-data for OpenAI when working with multimodal blocks");return a}function u(e){const t=e._getType();switch(t){case"system":return"system";case"ai":return"assistant";case"human":return"user";case"function":return"function";case"tool":return"tool";case"generic":if(!a.cM.isInstance(e))throw new Error("Invalid generic chat message");return function(e){return"system"!==e.role&&"developer"!==e.role&&"assistant"!==e.role&&"user"!==e.role&&"function"!==e.role&&"tool"!==e.role&&console.warn("Unknown message role: ".concat(e.role)),e.role}(e);default:throw new Error("Unknown message type: ".concat(t))}}var d=n(89379),h=n(45119);function f(e){const{azureOpenAIApiDeploymentName:t,azureOpenAIApiInstanceName:n,azureOpenAIApiKey:r,azureOpenAIBasePath:i,baseURL:o,azureADTokenProvider:a,azureOpenAIEndpoint:s}=e;if((r||a)&&i&&t)return"".concat(i,"/").concat(t);if((r||a)&&s&&t)return"".concat(s,"/openai/deployments/").concat(t);if(r||a){if(!n)throw new Error("azureOpenAIApiInstanceName is required when using azureOpenAIApiKey");if(!t)throw new Error("azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey");return"https://".concat(n,".openai.azure.com/openai/deployments/").concat(t)}return o}function p(e){return"undefined"!==typeof Headers&&null!==e&&"object"===typeof e&&"[object Headers]"===Object.prototype.toString.call(e)}function g(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1.0.0";const r=function(e){const t=s(()=>{if(p(e))return e;if(Array.isArray(e))return new Headers(e);if("object"===typeof e&&null!==e&&"values"in e&&p(e.values))return e.values;if("object"===typeof e&&null!==e){const t=Object.entries(e).filter(e=>{let[,t]=e;return"string"===typeof t}).map(e=>{let[t,n]=e;return[t,n]});return new Headers(t)}return new Headers});return Object.fromEntries(t.entries())}(e),i=function(){let e=(0,h._$)();return"node"!==e&&"deno"!==e||(e="(".concat(e,"/").concat(process.version,"; ").concat(process.platform,"; ").concat(process.arch,")")),e}(),o="langchainjs".concat(t?"-azure":"","-openai");return(0,d.A)((0,d.A)({},r),{},{"User-Agent":r["User-Agent"]?"".concat(o,"/").concat(n," (").concat(i,")").concat(r["User-Agent"]):"".concat(o,"/").concat(n," (").concat(i,")")})}var m=n(64467),v=n(94657),y=n(35130),b=n(96948);function w(e,t){const n=[];for(const[o,a]of Object.entries(null!==(r=e.properties)&&void 0!==r?r:{})){var r,i;a.description&&t<2&&n.push("// ".concat(a.description)),null!==(i=e.required)&&void 0!==i&&i.includes(o)?n.push("".concat(o,": ").concat(A(a,t),",")):n.push("".concat(o,"?: ").concat(A(a,t),","))}return n.map(e=>" ".repeat(t)+e).join("\n")}function A(e,t){if(void 0!==(n=e).anyOf&&Array.isArray(n.anyOf))return e.anyOf.map(e=>A(e,t)).join(" | ");var n;switch(e.type){case"string":return e.enum?e.enum.map(e=>'"'.concat(e,'"')).join(" | "):"string";case"number":case"integer":return e.enum?e.enum.map(e=>"".concat(e)).join(" | "):"number";case"boolean":return"boolean";case"null":return"null";case"object":return["{",w(e,t+2),"}"].join("\n");case"array":return e.items?"".concat(A(e.items,t),"[]"):"any[]";default:return""}}function _(e){return e?"any"===e||"required"===e?"required":"auto"===e?"auto":"none"===e?"none":"string"===typeof e?{type:"function",function:{name:e}}:e:void 0}function C(e){return"type"in e&&"function"!==e.type}function x(e){return"object"===typeof e&&null!==e&&"metadata"in e&&"object"===typeof e.metadata&&null!==e.metadata&&"customTool"in e.metadata&&"object"===typeof e.metadata.customTool&&null!==e.metadata.customTool}function E(e){return"type"in e&&"custom"===e.type&&"custom"in e&&"object"===typeof e.custom&&null!==e.custom}function S(e){if("custom_tool_call"===e.type)return(0,d.A)((0,d.A)({},e),{},{type:"tool_call",call_id:e.id,id:e.call_id,name:e.name,isCustomTool:!0,args:{input:e.input}})}function D(e){if("computer_call"===e.type)return(0,d.A)((0,d.A)({},e),{},{type:"tool_call",call_id:e.id,id:e.call_id,name:"computer_use",isComputerTool:!0,args:{action:e.action}})}function k(e){return{type:"custom",name:e.custom.name,description:e.custom.description,format:(()=>{if(e.custom.format)return"grammar"===e.custom.format.type?{type:"grammar",definition:e.custom.format.grammar.definition,syntax:e.custom.format.grammar.syntax}:"text"===e.custom.format.type?{type:"text"}:void 0})()}}var T=n(85691),O=n(81371);const I=["jsonSchema","functionCalling","jsonMode"];function P(e,t,n){if((0,y.IU)(e))return(0,O.AS)(e,t,n);if((0,y.Pq)(e))return function(e,t){const n=(0,d.A)({},e);return Object.defineProperties(n,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:t,enumerable:!1}}),n}({type:"json_schema",json_schema:(0,d.A)((0,d.A)({},n),{},{name:t,strict:!0,schema:(0,b.PF)(e,{cycles:"ref",reused:"ref",override(e){e.jsonSchema.title=t}})})},t=>(0,T.parse)(e,JSON.parse(t)));throw new Error("Unsupported schema response format")}var M={"gpt-4.1-nano":{maxInputTokens:1047576,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"text-embedding-3-small":{maxInputTokens:8191,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1536,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4":{maxInputTokens:8192,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:8192,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o1-pro":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o-2024-05-13":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:4096,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o-2024-08-06":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4.1-mini":{maxInputTokens:1047576,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o3-deep-research":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-3.5-turbo":{maxInputTokens:16385,imageInputs:!1,audioInputs:!1,pdfInputs:!1,videoInputs:!1,maxOutputTokens:4096,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!1,imageUrlInputs:!1,pdfToolMessage:!1,imageToolMessage:!1,toolChoice:!0},"text-embedding-3-large":{maxInputTokens:8191,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:3072,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4-turbo":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:4096,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o1-preview":{maxInputTokens:128e3,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o3-mini":{maxInputTokens:2e5,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"codex-mini-latest":{maxInputTokens:2e5,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-nano":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-codex":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4.1":{maxInputTokens:1047576,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:32768,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o4-mini":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},o1:{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-mini":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o1-mini":{maxInputTokens:128e3,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:65536,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"text-embedding-ada-002":{maxInputTokens:8192,imageInputs:!1,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1536,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o3-pro":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o-2024-11-20":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},o3:{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"o4-mini-deep-research":{maxInputTokens:2e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:1e5,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-chat-latest":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!1,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-4o-mini":{maxInputTokens:128e3,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:16384,reasoningOutput:!1,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:128e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0},"gpt-5-pro":{maxInputTokens:4e5,imageInputs:!0,audioInputs:!1,pdfInputs:!0,videoInputs:!1,maxOutputTokens:272e3,reasoningOutput:!0,imageOutputs:!1,audioOutputs:!1,videoOutputs:!1,toolCalling:!0,structuredOutput:!0,imageUrlInputs:!0,pdfToolMessage:!0,imageToolMessage:!0,toolChoice:!0}},R=n(46623),N=n(20659),j=n(84573),F=n(33759),L=n(33587),B=n(80045),z=n(5836),U=n(23686),G=n(52295),H=n(47912),W=n(84537);n(47919);const V=["id"];function q(e,t){if(void 0===e.function)return;let n;if(null!==t&&void 0!==t&&t.partial)try{var r;n=(0,z.d)(null!==(r=e.function.arguments)&&void 0!==r?r:"{}")}catch(o){return}else try{n=JSON.parse(e.function.arguments)}catch(a){throw new H.CC(['Function "'.concat(e.function.name,'" arguments:'),"",e.function.arguments,"","are not valid JSON.","Error: ".concat(a.message)].join("\n"))}const i={name:e.function.name,args:n,type:"tool_call"};return null!==t&&void 0!==t&&t.returnId&&(i.id=e.id),i}function K(e){if(void 0===e.id)throw new Error('All OpenAI tool calls must have an "id" field.');return{id:e.id,type:"function",function:{name:e.name,arguments:JSON.stringify(e.args)}}}function Y(e,t){var n,r;return{name:null===(n=e.function)||void 0===n?void 0:n.name,args:null===(r=e.function)||void 0===r?void 0:r.arguments,id:e.id,error:t,type:"invalid_tool_call"}}var X=class extends W.T{static lc_name(){return"JsonOutputToolsParser"}constructor(e){var t;super(e),(0,m.A)(this,"returnId",!1),(0,m.A)(this,"lc_namespace",["langchain","output_parsers","openai_tools"]),(0,m.A)(this,"lc_serializable",!0),this.returnId=null!==(t=null===e||void 0===e?void 0:e.returnId)&&void 0!==t?t:this.returnId}_diff(){throw new Error("Not supported.")}async parse(){throw new Error("Not implemented.")}async parseResult(e){return await this.parsePartialResult(e,!1)}async parsePartialResult(e){var t;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=e[0].message;let i;if((0,U.KX)(r)&&null!==(t=r.tool_calls)&&void 0!==t&&t.length)i=r.tool_calls.map(e=>{const{id:t}=e,n=(0,B.A)(e,V);return this.returnId?(0,d.A)({id:t},n):n});else if(void 0!==r.additional_kwargs.tool_calls){i=JSON.parse(JSON.stringify(r.additional_kwargs.tool_calls)).map(e=>q(e,{returnId:this.returnId,partial:n}))}if(!i)return[];const o=[];for(const a of i)if(void 0!==a){const e={type:a.name,args:a.args,id:a.id};o.push(e)}return o}},Q=class extends X{static lc_name(){return"JsonOutputKeyToolsParser"}constructor(e){var t;super(e),(0,m.A)(this,"lc_namespace",["langchain","output_parsers","openai_tools"]),(0,m.A)(this,"lc_serializable",!0),(0,m.A)(this,"returnId",!1),(0,m.A)(this,"keyName",void 0),(0,m.A)(this,"returnSingle",!1),(0,m.A)(this,"zodSchema",void 0),this.keyName=e.keyName,this.returnSingle=null!==(t=e.returnSingle)&&void 0!==t?t:this.returnSingle,this.zodSchema=e.zodSchema}async _validateResult(e){var t;if(void 0===this.zodSchema)return e;const n=await(0,G.K3)(this.zodSchema,e);if(n.success)return n.data;throw new H.CC('Failed to parse. Text: "'.concat(JSON.stringify(e,null,2),'". Error: ').concat(JSON.stringify(null===(t=n.error)||void 0===t?void 0:t.issues)),JSON.stringify(e,null,2))}async parsePartialResult(e){const t=(await super.parsePartialResult(e)).filter(e=>e.type===this.keyName);let n=t;if(t.length)return this.returnId||(n=t.map(e=>e.args)),this.returnSingle?n[0]:n}async parseResult(e){const t=(await super.parsePartialResult(e,!1)).filter(e=>e.type===this.keyName);let n=t;if(!t.length)return;if(this.returnId||(n=t.map(e=>e.args)),this.returnSingle)return this._validateResult(n[0]);return await Promise.all(n.map(e=>this._validateResult(e)))}};(0,L.V)({},{JsonOutputKeyToolsParser:()=>Q,JsonOutputToolsParser:()=>X,convertLangChainToolCallToOpenAI:()=>K,makeInvalidToolCall:()=>Y,parseToolCall:()=>q});var J=class extends R.xV{_llmType(){return"openai"}static lc_name(){return"ChatOpenAI"}get callKeys(){return[...super.callKeys,"options","function_call","functions","tools","tool_choice","promptIndex","response_format","seed","reasoning","service_tier"]}get lc_secrets(){return{apiKey:"OPENAI_API_KEY",organization:"OPENAI_ORGANIZATION"}}get lc_aliases(){return{apiKey:"openai_api_key",modelName:"model"}}get lc_serializable_keys(){return["configuration","logprobs","topLogprobs","prefixMessages","supportsStrictToolCalling","modalities","audio","temperature","maxTokens","topP","frequencyPenalty","presencePenalty","n","logitBias","user","streaming","streamUsage","model","modelName","modelKwargs","stop","stopSequences","timeout","apiKey","cache","maxConcurrency","maxRetries","verbose","callbacks","tags","metadata","disableStreaming","zdrEnabled","reasoning","promptCacheKey","promptCacheRetention","verbosity"]}getLsParams(e){var t,n;const r=this.invocationParams(e);return{ls_provider:"openai",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:null!==(t=r.temperature)&&void 0!==t?t:void 0,ls_max_tokens:null!==(n=r.max_tokens)&&void 0!==n?n:void 0,ls_stop:e.stop}}_identifyingParams(){return(0,d.A)((0,d.A)({model_name:this.model},this.invocationParams()),this.clientConfig)}identifyingParams(){return this._identifyingParams()}constructor(e){var t,n,r,i,o,a,s,l,c,u,f,p,g,v,y,b,w,A,_,C,x,E;super(null!==e&&void 0!==e?e:{}),(0,m.A)(this,"temperature",void 0),(0,m.A)(this,"topP",void 0),(0,m.A)(this,"frequencyPenalty",void 0),(0,m.A)(this,"presencePenalty",void 0),(0,m.A)(this,"n",void 0),(0,m.A)(this,"logitBias",void 0),(0,m.A)(this,"model","gpt-3.5-turbo"),(0,m.A)(this,"modelKwargs",void 0),(0,m.A)(this,"stop",void 0),(0,m.A)(this,"stopSequences",void 0),(0,m.A)(this,"user",void 0),(0,m.A)(this,"timeout",void 0),(0,m.A)(this,"streaming",!1),(0,m.A)(this,"streamUsage",!0),(0,m.A)(this,"maxTokens",void 0),(0,m.A)(this,"logprobs",void 0),(0,m.A)(this,"topLogprobs",void 0),(0,m.A)(this,"apiKey",void 0),(0,m.A)(this,"organization",void 0),(0,m.A)(this,"__includeRawResponse",void 0),(0,m.A)(this,"client",void 0),(0,m.A)(this,"clientConfig",void 0),(0,m.A)(this,"supportsStrictToolCalling",void 0),(0,m.A)(this,"audio",void 0),(0,m.A)(this,"modalities",void 0),(0,m.A)(this,"reasoning",void 0),(0,m.A)(this,"zdrEnabled",void 0),(0,m.A)(this,"service_tier",void 0),(0,m.A)(this,"promptCacheKey",void 0),(0,m.A)(this,"promptCacheRetention",void 0),(0,m.A)(this,"verbosity",void 0),(0,m.A)(this,"defaultOptions",void 0),(0,m.A)(this,"lc_serializable",!0);const S="string"===typeof(null===e||void 0===e||null===(t=e.configuration)||void 0===t?void 0:t.apiKey)||"function"===typeof(null===e||void 0===e||null===(n=e.configuration)||void 0===n?void 0:n.apiKey)?null===e||void 0===e||null===(r=e.configuration)||void 0===r?void 0:r.apiKey:void 0;this.apiKey=null!==(i=null!==(o=null===e||void 0===e?void 0:e.apiKey)&&void 0!==o?o:S)&&void 0!==i?i:(0,h.Az)("OPENAI_API_KEY"),this.organization=null!==(a=null===e||void 0===e||null===(s=e.configuration)||void 0===s?void 0:s.organization)&&void 0!==a?a:(0,h.Az)("OPENAI_ORGANIZATION"),this.model=null!==(l=null!==(c=null===e||void 0===e?void 0:e.model)&&void 0!==c?c:null===e||void 0===e?void 0:e.modelName)&&void 0!==l?l:this.model,this.modelKwargs=null!==(u=null===e||void 0===e?void 0:e.modelKwargs)&&void 0!==u?u:{},this.timeout=null===e||void 0===e?void 0:e.timeout,this.temperature=null!==(f=null===e||void 0===e?void 0:e.temperature)&&void 0!==f?f:this.temperature,this.topP=null!==(p=null===e||void 0===e?void 0:e.topP)&&void 0!==p?p:this.topP,this.frequencyPenalty=null!==(g=null===e||void 0===e?void 0:e.frequencyPenalty)&&void 0!==g?g:this.frequencyPenalty,this.presencePenalty=null!==(v=null===e||void 0===e?void 0:e.presencePenalty)&&void 0!==v?v:this.presencePenalty,this.logprobs=null===e||void 0===e?void 0:e.logprobs,this.topLogprobs=null===e||void 0===e?void 0:e.topLogprobs,this.n=null!==(y=null===e||void 0===e?void 0:e.n)&&void 0!==y?y:this.n,this.logitBias=null===e||void 0===e?void 0:e.logitBias,this.stop=null!==(b=null===e||void 0===e?void 0:e.stopSequences)&&void 0!==b?b:null===e||void 0===e?void 0:e.stop,this.stopSequences=this.stop,this.user=null===e||void 0===e?void 0:e.user,this.__includeRawResponse=null===e||void 0===e?void 0:e.__includeRawResponse,this.audio=null===e||void 0===e?void 0:e.audio,this.modalities=null===e||void 0===e?void 0:e.modalities,this.reasoning=null===e||void 0===e?void 0:e.reasoning,this.maxTokens=null!==(w=null===e||void 0===e?void 0:e.maxCompletionTokens)&&void 0!==w?w:null===e||void 0===e?void 0:e.maxTokens,this.promptCacheKey=null!==(A=null===e||void 0===e?void 0:e.promptCacheKey)&&void 0!==A?A:this.promptCacheKey,this.promptCacheRetention=null!==(_=null===e||void 0===e?void 0:e.promptCacheRetention)&&void 0!==_?_:this.promptCacheRetention,this.verbosity=null!==(C=null===e||void 0===e?void 0:e.verbosity)&&void 0!==C?C:this.verbosity,this.disableStreaming=!0===(null===e||void 0===e?void 0:e.disableStreaming),this.streaming=!0===(null===e||void 0===e?void 0:e.streaming),this.disableStreaming&&(this.streaming=!1),!1===(null===e||void 0===e?void 0:e.streaming)&&(this.disableStreaming=!0),this.streamUsage=null!==(x=null===e||void 0===e?void 0:e.streamUsage)&&void 0!==x?x:this.streamUsage,this.disableStreaming&&(this.streamUsage=!1),this.clientConfig=(0,d.A)({apiKey:this.apiKey,organization:this.organization,dangerouslyAllowBrowser:!0},null===e||void 0===e?void 0:e.configuration),void 0!==(null===e||void 0===e?void 0:e.supportsStrictToolCalling)&&(this.supportsStrictToolCalling=e.supportsStrictToolCalling),void 0!==(null===e||void 0===e?void 0:e.service_tier)&&(this.service_tier=e.service_tier),this.zdrEnabled=null!==(E=null===e||void 0===e?void 0:e.zdrEnabled)&&void 0!==E&&E}_getReasoningParams(e){if(!l(this.model))return;let t;return void 0!==this.reasoning&&(t=(0,d.A)((0,d.A)({},t),this.reasoning)),void 0!==(null===e||void 0===e?void 0:e.reasoning)&&(t=(0,d.A)((0,d.A)({},t),e.reasoning)),t}_getResponseFormat(e){return e&&"json_schema"===e.type&&e.json_schema.schema&&(0,y.c9)(e.json_schema.schema)?P(e.json_schema.schema,e.json_schema.name,{description:e.json_schema.description}):e}_combineCallOptions(e){return(0,d.A)((0,d.A)({},this.defaultOptions),null!==e&&void 0!==e?e:{})}_getClientOptions(e){if(!this.client){const e=f({baseURL:this.clientConfig.baseURL}),t=(0,d.A)((0,d.A)({},this.clientConfig),{},{baseURL:e,timeout:this.timeout,maxRetries:0});t.baseURL||delete t.baseURL,t.defaultHeaders=g(t.defaultHeaders),this.client=new i.z4(t)}return(0,d.A)((0,d.A)({},this.clientConfig),e)}_convertChatOpenAIToolToCompletionsTool(e,t){return x(e)?function(e){return{type:"custom",custom:{name:e.name,description:e.description,format:(()=>{if(e.format)return"grammar"===e.format.type?{type:"grammar",grammar:{definition:e.format.definition,syntax:e.format.syntax}}:"text"===e.format.type?{type:"text"}:void 0})()}}}(e.metadata.customTool):(0,N.VC)(e)?void 0!==(null===t||void 0===t?void 0:t.strict)?(0,d.A)((0,d.A)({},e),{},{function:(0,d.A)((0,d.A)({},e.function),{},{strict:t.strict})}):e:function(e,t){let n;return n=(0,v.qG)(e)?(0,v.fL)(e):e,void 0!==(null===t||void 0===t?void 0:t.strict)&&(n.function.strict=t.strict),n}(e,t)}bindTools(e,t){let n;return void 0!==(null===t||void 0===t?void 0:t.strict)?n=t.strict:void 0!==this.supportsStrictToolCalling&&(n=this.supportsStrictToolCalling),this.withConfig((0,d.A)({tools:e.map(e=>C(e)||x(e)?e:function(e){return"object"===typeof e&&null!==e&&"extras"in e&&"object"===typeof e.extras&&null!==e.extras&&"providerToolDefinition"in e.extras&&"object"===typeof e.extras.providerToolDefinition&&null!==e.extras.providerToolDefinition}(e)?e.extras.providerToolDefinition:this._convertChatOpenAIToolToCompletionsTool(e,{strict:n}))},t))}async stream(e,t){return super.stream(e,this._combineCallOptions(t))}async invoke(e,t){return super.invoke(e,this._combineCallOptions(t))}_combineLLMOutput(){for(var e=arguments.length,t=new Array(e),n=0;n{var n,r,i;t&&t.tokenUsage&&(e.tokenUsage.completionTokens+=null!==(n=t.tokenUsage.completionTokens)&&void 0!==n?n:0,e.tokenUsage.promptTokens+=null!==(r=t.tokenUsage.promptTokens)&&void 0!==r?r:0,e.tokenUsage.totalTokens+=null!==(i=t.tokenUsage.totalTokens)&&void 0!==i?i:0);return e},{tokenUsage:{completionTokens:0,promptTokens:0,totalTokens:0}})}async getNumTokensFromMessages(e){let t=0,n=0,r=0;"gpt-3.5-turbo-0301"===this.model?(n=4,r=-1):(n=3,r=1);const i=await Promise.all(e.map(async e=>{var i,o,a,s;const[l,c]=await Promise.all([this.getNumTokens(e.content),this.getNumTokens(u(e))]),d=void 0!==e.name?r+await this.getNumTokens(e.name):0;let h=l+n+c+d;const f=e;if("function"===f._getType()&&(h-=2),null!==(i=f.additional_kwargs)&&void 0!==i&&i.function_call&&(h+=3),null!==f&&void 0!==f&&null!==(o=f.additional_kwargs.function_call)&&void 0!==o&&o.name&&(h+=await this.getNumTokens(null===(a=f.additional_kwargs.function_call)||void 0===a?void 0:a.name)),null!==(s=f.additional_kwargs.function_call)&&void 0!==s&&s.arguments)try{var p;h+=await this.getNumTokens(JSON.stringify(JSON.parse(null===(p=f.additional_kwargs.function_call)||void 0===p?void 0:p.arguments)))}catch(m){var g;console.error("Error parsing function arguments",m,JSON.stringify(f.additional_kwargs.function_call)),h+=await this.getNumTokens(null===(g=f.additional_kwargs.function_call)||void 0===g?void 0:g.arguments)}return t+=h,h}));return t+=3,{totalCount:t,countPerMessage:i}}async _getNumTokensFromGenerations(e){return(await Promise.all(e.map(async e=>{var t;return null!==(t=e.message.additional_kwargs)&&void 0!==t&&t.function_call?(await this.getNumTokensFromMessages([e.message])).countPerMessage[0]:await this.getNumTokens(e.message.content)}))).reduce((e,t)=>e+t,0)}async _getEstimatedTokenCountFromPrompt(e,t,n){let r=(await this.getNumTokensFromMessages(e)).totalCount;if(t&&"auto"!==n){const e=function(e){const t=["namespace functions {",""];for(const r of e){var n;r.description&&t.push("// ".concat(r.description)),Object.keys(null!==(n=r.parameters.properties)&&void 0!==n?n:{}).length>0?(t.push("type ".concat(r.name," = (_: {")),t.push(w(r.parameters,0)),t.push("}) => any;")):t.push("type ".concat(r.name," = () => any;")),t.push("")}return t.push("} // namespace functions"),t.join("\n")}(t);r+=await this.getNumTokens(e),r+=9}return t&&e.find(e=>"system"===e._getType())&&(r-=4),"none"===n?r+=1:"object"===typeof n&&(r+=await this.getNumTokens(n.name)+4),r}async moderateContent(e,t){var n;const r=this._getClientOptions(null===t||void 0===t?void 0:t.options),i={input:e,model:null!==(n=null===t||void 0===t?void 0:t.model)&&void 0!==n?n:"omni-moderation-latest"};return this.caller.call(async()=>{try{return await this.client.moderations.create(i,r)}catch(e){throw o(e)}})}get profile(){var e;return null!==(e=M[this.model])&&void 0!==e?e:{}}_getStructuredOutputMethod(e){const t=(0,d.A)({},e);if(this.model.startsWith("gpt-3")||this.model.startsWith("gpt-4-")||"gpt-4"===this.model)"jsonSchema"===t.method&&console.warn('[WARNING]: JSON Schema is not supported for model "'.concat(this.model,'". Falling back to tool calling.'));else if(void 0===(null===t||void 0===t?void 0:t.method))return"jsonSchema";return t.method}withStructuredOutput(e,t){let n,r;const{schema:i,name:o,includeRaw:a}=(0,d.A)((0,d.A)({},t),{},{schema:e});if(void 0!==(null===t||void 0===t?void 0:t.strict)&&"jsonMode"===t.method)throw new Error("Argument `strict` is only supported for `method` = 'function_calling'");const s=function(e,t){if("undefined"!==typeof t&&!I.includes(t))throw new Error("Invalid method: ".concat(t,". Supported methods are: ").concat(I.join(", ")));const n=!e.startsWith("gpt-3")&&!e.startsWith("gpt-4-")&&"gpt-4"!==e;if(n&&!t)return"jsonSchema";if(!n&&"jsonSchema"===t)throw new Error('JSON Schema is not supported for model "'.concat(e,'". Please use a different method, e.g. "functionCalling" or "jsonMode".'));return null!==t&&void 0!==t?t:"functionCalling"}(this.model,null===t||void 0===t?void 0:t.method);if("jsonMode"===s){r=(0,y.c9)(i)?F._6.fromZodSchema(i):new F.hU;const e=(0,b.PF)(i);n=this.withConfig({outputVersion:"v0",response_format:{type:"json_object"},ls_structured_output_format:{kwargs:{method:"json_mode"},schema:(0,d.A)({title:null!==o&&void 0!==o?o:"extract"},e)}})}else if("jsonSchema"===s){const e={name:null!==o&&void 0!==o?o:"extract",description:(0,y.cg)(i),schema:i,strict:null===t||void 0===t?void 0:t.strict},a=(0,b.PF)(e.schema);if(n=this.withConfig({outputVersion:"v0",response_format:{type:"json_schema",json_schema:e},ls_structured_output_format:{kwargs:{method:"json_schema"},schema:(0,d.A)({title:e.name,description:e.description},a)}}),(0,y.c9)(i)){const e=F._6.fromZodSchema(i);r=j.jY.from(t=>"parsed"in t.additional_kwargs?t.additional_kwargs.parsed:e)}else r=new F.hU}else{let e=null!==o&&void 0!==o?o:"extract";if((0,y.c9)(i)){const o=(0,b.PF)(i);n=this.withConfig((0,d.A)({outputVersion:"v0",tools:[{type:"function",function:{name:e,description:o.description,parameters:o}}],tool_choice:{type:"function",function:{name:e}},ls_structured_output_format:{kwargs:{method:"function_calling"},schema:(0,d.A)({title:e},o)}},void 0!==(null===t||void 0===t?void 0:t.strict)?{strict:t.strict}:{})),r=new Q({returnSingle:!0,keyName:e,zodSchema:i})}else{let o;var l,c;if("string"===typeof i.name&&"object"===typeof i.parameters&&null!=i.parameters)o=i,e=i.name;else e=null!==(l=i.title)&&void 0!==l?l:e,o={name:e,description:null!==(c=i.description)&&void 0!==c?c:"",parameters:i};const a=(0,b.PF)(i);n=this.withConfig((0,d.A)({outputVersion:"v0",tools:[{type:"function",function:o}],tool_choice:{type:"function",function:{name:e}},ls_structured_output_format:{kwargs:{method:"function_calling"},schema:(0,d.A)({title:e},a)}},void 0!==(null===t||void 0===t?void 0:t.strict)?{strict:t.strict}:{})),r=new Q({returnSingle:!0,keyName:e})}}if(!a)return n.pipe(r);const u=j.kI.assign({parsed:(e,t)=>r.invoke(e.raw,t)}),h=j.kI.assign({parsed:()=>null}),f=u.withFallbacks({fallbacks:[h]});return j.zZ.from([{raw:n},f])}};const Z={providerName:"ChatOpenAI",fromStandardTextBlock:e=>({type:"text",text:e.text}),fromStandardImageBlock(e){var t;if("url"===e.source_type)return{type:"image_url",image_url:(0,d.A)({url:e.url},null!==(t=e.metadata)&&void 0!==t&&t.detail?{detail:e.metadata.detail}:{})};if("base64"===e.source_type){var n,r;const t="data:".concat(null!==(n=e.mime_type)&&void 0!==n?n:"",";base64,").concat(e.data);return{type:"image_url",image_url:(0,d.A)({url:t},null!==(r=e.metadata)&&void 0!==r&&r.detail?{detail:e.metadata.detail}:{})}}throw new Error("Image content blocks with source_type ".concat(e.source_type," are not supported for ChatOpenAI"))},fromStandardAudioBlock(e){if("url"===e.source_type){const t=(0,a.Q7)({dataUrl:e.url});if(!t)throw new Error("URL audio blocks with source_type ".concat(e.source_type," must be formatted as a data URL for ChatOpenAI"));const r=t.mime_type||e.mime_type||"";let i;try{i=(0,a.Ej)(r)}catch(n){throw new Error("Audio blocks with source_type ".concat(e.source_type," must have mime type of audio/wav or audio/mp3"))}if("audio"!==i.type||"wav"!==i.subtype&&"mp3"!==i.subtype)throw new Error("Audio blocks with source_type ".concat(e.source_type," must have mime type of audio/wav or audio/mp3"));return{type:"input_audio",input_audio:{format:i.subtype,data:t.data}}}if("base64"===e.source_type){let n;try{var t;n=(0,a.Ej)(null!==(t=e.mime_type)&&void 0!==t?t:"")}catch(r){throw new Error("Audio blocks with source_type ".concat(e.source_type," must have mime type of audio/wav or audio/mp3"))}if("audio"!==n.type||"wav"!==n.subtype&&"mp3"!==n.subtype)throw new Error("Audio blocks with source_type ".concat(e.source_type," must have mime type of audio/wav or audio/mp3"));return{type:"input_audio",input_audio:{format:n.subtype,data:e.data}}}throw new Error("Audio content blocks with source_type ".concat(e.source_type," are not supported for ChatOpenAI"))},fromStandardFileBlock(e){if("url"===e.source_type){var t,n;const r=(0,a.Q7)({dataUrl:e.url}),i=c(e);if(!r)throw new Error("URL file blocks with source_type ".concat(e.source_type," must be formatted as a data URL for ChatOpenAI"));return{type:"file",file:(0,d.A)({file_data:e.url},null!==(t=e.metadata)&&void 0!==t&&t.filename||null!==(n=e.metadata)&&void 0!==n&&n.name?{filename:i}:{})}}if("base64"===e.source_type){var r,i,o,s;const t=c(e);return{type:"file",file:(0,d.A)({file_data:"data:".concat(null!==(r=e.mime_type)&&void 0!==r?r:"",";base64,").concat(e.data)},null!==(i=e.metadata)&&void 0!==i&&i.filename||null!==(o=e.metadata)&&void 0!==o&&o.name||null!==(s=e.metadata)&&void 0!==s&&s.title?{filename:t}:{})}}if("id"===e.source_type)return{type:"file",file:{file_id:e.id}};throw new Error("File content blocks with source_type ".concat(e.source_type," are not supported for ChatOpenAI"))}},$=e=>{var t;let{message:n,rawResponse:r,includeRawResponse:i}=e;const o=n.tool_calls;if("assistant"===n.role){var s,l;const e=[],t=[];for(const n of null!==o&&void 0!==o?o:[])try{e.push(q(n,{returnId:!0}))}catch(c){t.push(Y(n,c.message))}const u={function_call:n.function_call,tool_calls:o};void 0!==i&&(u.__raw_response=r);const h=(0,d.A)({model_provider:"openai",model_name:r.model},r.system_fingerprint?{usage:(0,d.A)({},r.usage),system_fingerprint:r.system_fingerprint}:{});n.audio&&(u.audio=n.audio);const f=function(e,t){if(t&&"object"===typeof t&&"images"in t&&Array.isArray(t.images))return[{type:"text",text:e},...t.images.filter(e=>{var t;return"string"===typeof(null===e||void 0===e||null===(t=e.image_url)||void 0===t?void 0:t.url)}).map(e=>({type:"image",url:e.image_url.url}))];return e}(n.content||"",null===(s=r.choices)||void 0===s||null===(l=s[0])||void 0===l?void 0:l.message);return new a.Od({content:f,tool_calls:e,invalid_tool_calls:t,additional_kwargs:u,response_metadata:h,id:r.id})}return new a.cM(n.content||"",null!==(t=n.role)&&void 0!==t?t:"unknown")},ee=e=>{if("image"===e.type){if(e.url)return{type:"image_url",image_url:{url:e.url}};if(e.data)return{type:"image_url",image_url:{url:"data:".concat(e.mimeType,";base64,").concat(e.data)}}}if("audio"===e.type&&e.data){const t=(0,a.iD)(()=>{const[,t]=e.mimeType.split("/");return"wav"===t||"mp3"===t?t:"wav"});return{type:"input_audio",input_audio:{data:e.data.toString(),format:t}}}if("file"===e.type){if(e.data){const t=c(e);return{type:"file",file:{file_data:"data:".concat(e.mimeType,";base64,").concat(e.data),filename:t}}}if(e.fileId)return{type:"file",file:{file_id:e.fileId}}}},te=e=>{let{messages:t,model:n}=e;return t.flatMap(e=>{var t,r;if("output_version"in e.response_metadata&&"v1"===(null===(t=e.response_metadata)||void 0===t?void 0:t.output_version))return(e=>{var t;let{message:n,model:r}=e,i=u(n);return"system"===i&&l(r)&&(i="developer"),"developer"===i?{role:"developer",content:n.contentBlocks.filter(e=>"text"===e.type)}:"system"===i?{role:"system",content:n.contentBlocks.filter(e=>"text"===e.type)}:"assistant"===i?{role:"assistant",content:n.contentBlocks.filter(e=>"text"===e.type)}:"tool"===i&&a.uf.isInstance(n)?{role:"tool",tool_call_id:n.tool_call_id,content:n.contentBlocks.filter(e=>"text"===e.type)}:"function"===i?{role:"function",name:null!==(t=n.name)&&void 0!==t?t:"",content:n.contentBlocks.filter(e=>"text"===e.type).join("")}:{role:"user",content:Array.from(function*(e){for(const t of e){"text"===t.type&&(yield{type:"text",text:t.text});const e=ee(t);e&&(yield e)}}(n.contentBlocks))}})({message:e});let i=u(e);"system"===i&&l(n)&&(i="developer");const o={role:i,content:"string"===typeof e.content?e.content:e.content.map(e=>(0,a.Fz)(e)?(0,a.up)(e,Z):e)};if(null!=e.name&&(o.name=e.name),null!=e.additional_kwargs.function_call&&(o.function_call=e.additional_kwargs.function_call),a.Od.isInstance(e)&&null!==(r=e.tool_calls)&&void 0!==r&&r.length?o.tool_calls=e.tool_calls.map(K):(null!=e.additional_kwargs.tool_calls&&(o.tool_calls=e.additional_kwargs.tool_calls),a.uf.isInstance(e)&&null!=e.tool_call_id&&(o.tool_call_id=e.tool_call_id)),e.additional_kwargs.audio&&"object"===typeof e.additional_kwargs.audio&&"id"in e.additional_kwargs.audio){return[o,{role:"assistant",audio:{id:e.additional_kwargs.audio.id}}]}return o})};var ne=n(56218),re=n(10600),ie=n(19495),oe=n(58828),ae=class extends J{invocationParams(e,t){var n,r,i,o,a;let s;void 0!==(null===e||void 0===e?void 0:e.strict)?s=e.strict:void 0!==this.supportsStrictToolCalling&&(s=this.supportsStrictToolCalling);let c={};void 0!==(null===e||void 0===e?void 0:e.stream_options)?c={stream_options:e.stream_options}:this.streamUsage&&(this.streaming||null!==t&&void 0!==t&&t.streaming)&&(c={stream_options:{include_usage:!0}});const u=(0,d.A)((0,d.A)((0,d.A)((0,d.A)((0,d.A)({model:this.model,temperature:this.temperature,top_p:this.topP,frequency_penalty:this.frequencyPenalty,presence_penalty:this.presencePenalty,logprobs:this.logprobs,top_logprobs:this.topLogprobs,n:this.n,logit_bias:this.logitBias,stop:null!==(n=null===e||void 0===e?void 0:e.stop)&&void 0!==n?n:this.stopSequences,user:this.user,stream:this.streaming,functions:null===e||void 0===e?void 0:e.functions,function_call:null===e||void 0===e?void 0:e.function_call,tools:null!==e&&void 0!==e&&null!==(r=e.tools)&&void 0!==r&&r.length?e.tools.map(e=>this._convertChatOpenAIToolToCompletionsTool(e,{strict:s})):void 0,tool_choice:_(null===e||void 0===e?void 0:e.tool_choice),response_format:this._getResponseFormat(null===e||void 0===e?void 0:e.response_format),seed:null===e||void 0===e?void 0:e.seed},c),{},{parallel_tool_calls:null===e||void 0===e?void 0:e.parallel_tool_calls},this.audio||null!==e&&void 0!==e&&e.audio?{audio:this.audio||(null===e||void 0===e?void 0:e.audio)}:{}),this.modalities||null!==e&&void 0!==e&&e.modalities?{modalities:this.modalities||(null===e||void 0===e?void 0:e.modalities)}:{}),this.modelKwargs),{},{prompt_cache_key:null!==(i=null===e||void 0===e?void 0:e.promptCacheKey)&&void 0!==i?i:this.promptCacheKey,prompt_cache_retention:null!==(o=null===e||void 0===e?void 0:e.promptCacheRetention)&&void 0!==o?o:this.promptCacheRetention,verbosity:null!==(a=null===e||void 0===e?void 0:e.verbosity)&&void 0!==a?a:this.verbosity});void 0!==(null===e||void 0===e?void 0:e.prediction)&&(u.prediction=e.prediction),void 0!==this.service_tier&&(u.service_tier=this.service_tier),void 0!==(null===e||void 0===e?void 0:e.service_tier)&&(u.service_tier=e.service_tier);const h=this._getReasoningParams(e);return void 0!==h&&void 0!==h.effort&&(u.reasoning_effort=h.effort),l(u.model)?u.max_completion_tokens=-1===this.maxTokens?void 0:this.maxTokens:u.max_tokens=-1===this.maxTokens?void 0:this.maxTokens,u}async _generate(e,t,n){const r={},i=this.invocationParams(t),o=te({messages:e,model:this.model});if(i.stream){const i=this._streamResponseChunks(e,t,n),o={};var s,l=!1,c=!1;try{for(var u,h=(0,ie.A)(i);l=!(u=await h.next()).done;l=!1){var f,p;const e=u.value;e.message.response_metadata=(0,d.A)((0,d.A)({},e.generationInfo),e.message.response_metadata);const t=null!==(f=null===(p=e.generationInfo)||void 0===p?void 0:p.completion)&&void 0!==f?f:0;void 0===o[t]?o[t]=e:o[t]=o[t].concat(e)}}catch(C){c=!0,s=C}finally{try{l&&null!=h.return&&await h.return()}finally{if(c)throw s}}const a=Object.entries(o).sort((e,t)=>{let[n]=e,[r]=t;return parseInt(n,10)-parseInt(r,10)}).map(e=>{let[t,n]=e;return n}),{functions:g,function_call:m}=this.invocationParams(t),v=await this._getEstimatedTokenCountFromPrompt(e,g,m),y=await this._getNumTokensFromGenerations(a);return r.input_tokens=v,r.output_tokens=y,r.total_tokens=v+y,{generations:a,llmOutput:{estimatedTokenUsage:{promptTokens:r.input_tokens,completionTokens:r.output_tokens,totalTokens:r.total_tokens}}}}{var g,m,v,y;const e=await this.completionWithRetry((0,d.A)((0,d.A)({},i),{},{stream:!1,messages:o}),(0,d.A)({signal:null===t||void 0===t?void 0:t.signal},null===t||void 0===t?void 0:t.options)),{completion_tokens:n,prompt_tokens:s,total_tokens:l,prompt_tokens_details:c,completion_tokens_details:u}=null!==(g=null===e||void 0===e?void 0:e.usage)&&void 0!==g?g:{};n&&(r.output_tokens=(null!==(m=r.output_tokens)&&void 0!==m?m:0)+n),s&&(r.input_tokens=(null!==(v=r.input_tokens)&&void 0!==v?v:0)+s),l&&(r.total_tokens=(null!==(y=r.total_tokens)&&void 0!==y?y:0)+l),null===(null===c||void 0===c?void 0:c.audio_tokens)&&null===(null===c||void 0===c?void 0:c.cached_tokens)||(r.input_token_details=(0,d.A)((0,d.A)({},null!==(null===c||void 0===c?void 0:c.audio_tokens)&&{audio:null===c||void 0===c?void 0:c.audio_tokens}),null!==(null===c||void 0===c?void 0:c.cached_tokens)&&{cache_read:null===c||void 0===c?void 0:c.cached_tokens})),null===(null===u||void 0===u?void 0:u.audio_tokens)&&null===(null===u||void 0===u?void 0:u.reasoning_tokens)||(r.output_token_details=(0,d.A)((0,d.A)({},null!==(null===u||void 0===u?void 0:u.audio_tokens)&&{audio:null===u||void 0===u?void 0:u.audio_tokens}),null!==(null===u||void 0===u?void 0:u.reasoning_tokens)&&{reasoning:null===u||void 0===u?void 0:u.reasoning_tokens}));const h=[];for(const t of null!==(b=null===e||void 0===e?void 0:e.choices)&&void 0!==b?b:[]){var b,w,A,_;const n={text:null!==(w=null===(A=t.message)||void 0===A?void 0:A.content)&&void 0!==w?w:"",message:this._convertCompletionsMessageToBaseMessage(null!==(_=t.message)&&void 0!==_?_:{role:"assistant"},e)};n.generationInfo=(0,d.A)((0,d.A)({},t.finish_reason?{finish_reason:t.finish_reason}:{}),t.logprobs?{logprobs:t.logprobs}:{}),(0,a.KX)(n.message)&&(n.message.usage_metadata=r),n.message=new a.Od(Object.fromEntries(Object.entries(n.message).filter(e=>{let[t]=e;return!t.startsWith("lc_")}))),h.push(n)}return{generations:h,llmOutput:{tokenUsage:{promptTokens:r.input_tokens,completionTokens:r.output_tokens,totalTokens:r.total_tokens}}}}}_streamResponseChunks(e,t,n){var r=this;return(0,re.A)(function*(){var i;const o=te({messages:e,model:r.model}),s=(0,d.A)((0,d.A)({},r.invocationParams(t,{streaming:!0})),{},{messages:o,stream:!0});let l;const c=yield(0,ne.A)(r.completionWithRetry(s,t));let u;var h,f=!1,p=!1;try{for(var g,m=(0,ie.A)(c);f=!(g=yield(0,ne.A)(m.next())).done;f=!1){var v,y,b,w,A;const e=g.value,i=null===e||void 0===e||null===(v=e.choices)||void 0===v?void 0:v[0];if(e.usage&&(u=e.usage),!i)continue;const{delta:o}=i;if(!o)continue;const a=r._convertCompletionsDeltaToBaseMessageChunk(o,e,l);l=null!==(y=o.role)&&void 0!==y?y:l;const s={prompt:null!==(b=t.promptIndex)&&void 0!==b?b:0,completion:null!==(w=i.index)&&void 0!==w?w:0};if("string"!==typeof a.content){console.log("[WARNING]: Received non-string content from OpenAI. This is currently not supported.");continue}const c=(0,d.A)({},s);null!=i.finish_reason&&(c.finish_reason=i.finish_reason,c.system_fingerprint=e.system_fingerprint,c.model_name=e.model,c.service_tier=e.service_tier),r.logprobs&&(c.logprobs=i.logprobs);const h=new oe.Cf({message:a,text:a.content,generationInfo:c});yield h,yield(0,ne.A)(null===n||void 0===n?void 0:n.handleLLMNewToken(null!==(A=h.text)&&void 0!==A?A:"",s,void 0,void 0,void 0,{chunk:h}))}}catch(O){p=!0,h=O}finally{try{f&&null!=m.return&&(yield(0,ne.A)(m.return()))}finally{if(p)throw h}}if(u){var _,C,x,E,S,D,k,T;const e=(0,d.A)((0,d.A)({},null!==(null===(_=u.prompt_tokens_details)||void 0===_?void 0:_.audio_tokens)&&{audio:null===(C=u.prompt_tokens_details)||void 0===C?void 0:C.audio_tokens}),null!==(null===(x=u.prompt_tokens_details)||void 0===x?void 0:x.cached_tokens)&&{cache_read:null===(E=u.prompt_tokens_details)||void 0===E?void 0:E.cached_tokens}),t=(0,d.A)((0,d.A)({},null!==(null===(S=u.completion_tokens_details)||void 0===S?void 0:S.audio_tokens)&&{audio:null===(D=u.completion_tokens_details)||void 0===D?void 0:D.audio_tokens}),null!==(null===(k=u.completion_tokens_details)||void 0===k?void 0:k.reasoning_tokens)&&{reasoning:null===(T=u.completion_tokens_details)||void 0===T?void 0:T.reasoning_tokens}),n=new oe.Cf({message:new a.H({content:"",response_metadata:{usage:(0,d.A)({},u)},usage_metadata:(0,d.A)((0,d.A)({input_tokens:u.prompt_tokens,output_tokens:u.completion_tokens,total_tokens:u.total_tokens},Object.keys(e).length>0&&{input_token_details:e}),Object.keys(t).length>0&&{output_token_details:t})}),text:""});yield n}if(null!==(i=t.signal)&&void 0!==i&&i.aborted)throw new Error("AbortError")})()}async completionWithRetry(e,t){const n=this._getClientOptions(t),r=e.response_format&&"json_schema"===e.response_format.type;return this.caller.call(async()=>{try{return r&&!e.stream?await this.client.chat.completions.parse(e,n):await this.client.chat.completions.create(e,n)}catch(t){throw o(t)}})}_convertCompletionsDeltaToBaseMessageChunk(e,t,n){return(e=>{var t,n;let{delta:r,rawResponse:i,includeRawResponse:o,defaultRole:s}=e;const l=null!==(t=r.role)&&void 0!==t?t:s,c=null!==(n=r.content)&&void 0!==n?n:"";let u;u=r.function_call?{function_call:r.function_call}:r.tool_calls?{tool_calls:r.tool_calls}:{},o&&(u.__raw_response=i),r.audio&&(u.audio=(0,d.A)((0,d.A)({},r.audio),{},{index:i.choices[0].index}));const h={model_provider:"openai",usage:(0,d.A)({},i.usage)};if("user"===l)return new a.a7({content:c,response_metadata:h});if("assistant"===l){const e=[];if(Array.isArray(r.tool_calls))for(const t of r.tool_calls){var f,p;e.push({name:null===(f=t.function)||void 0===f?void 0:f.name,args:null===(p=t.function)||void 0===p?void 0:p.arguments,id:t.id,index:t.index,type:"tool_call_chunk"})}return new a.H({content:c,tool_call_chunks:e,additional_kwargs:u,id:i.id,response_metadata:h})}return"system"===l?new a.uU({content:c,response_metadata:h}):"developer"===l?new a.uU({content:c,response_metadata:h,additional_kwargs:{__openai_role__:"developer"}}):"function"===l?new a.FK({content:c,additional_kwargs:u,name:r.name,response_metadata:h}):"tool"===l?new a.dr({content:c,additional_kwargs:u,tool_call_id:r.tool_call_id,response_metadata:h}):new a.XU({content:c,role:l,response_metadata:h})})({delta:e,rawResponse:t,includeRawResponse:this.__includeRawResponse,defaultRole:n})}_convertCompletionsMessageToBaseMessage(e,t){return $({message:e,rawResponse:t,includeRawResponse:this.__includeRawResponse})}};const se="__openai_function_call_ids__";function le(e){return"url_citation"===e.type?{type:"citation",source:"url_citation",url:e.url,title:e.title,startIndex:e.start_index,endIndex:e.end_index}:"file_citation"===e.type?{type:"citation",source:"file_citation",title:e.filename,startIndex:e.index,file_id:e.file_id}:"container_file_citation"===e.type?{type:"citation",source:"container_file_citation",title:e.filename,startIndex:e.start_index,endIndex:e.end_index,file_id:e.file_id,container_id:e.container_id}:"file_path"===e.type?{type:"citation",source:"file_path",startIndex:e.index,file_id:e.file_id}:{type:"non_standard",value:e}}const ce=e=>{var t,n,r,i,o,a,s;const l=(0,d.A)({},null!=(null===e||void 0===e||null===(t=e.input_tokens_details)||void 0===t?void 0:t.cached_tokens)&&{cache_read:null===e||void 0===e||null===(n=e.input_tokens_details)||void 0===n?void 0:n.cached_tokens}),c=(0,d.A)({},null!=(null===e||void 0===e||null===(r=e.output_tokens_details)||void 0===r?void 0:r.reasoning_tokens)&&{reasoning:null===e||void 0===e||null===(i=e.output_tokens_details)||void 0===i?void 0:i.reasoning_tokens});return{input_tokens:null!==(o=null===e||void 0===e?void 0:e.input_tokens)&&void 0!==o?o:0,output_tokens:null!==(a=null===e||void 0===e?void 0:e.output_tokens)&&void 0!==a?a:0,total_tokens:null!==(s=null===e||void 0===e?void 0:e.total_tokens)&&void 0!==s?s:0,input_token_details:l,output_token_details:c}},ue=e=>{if(e.error){const t=new Error(e.error.message);throw t.name=e.error.code,t}let t;const n=[],r=[],i=[],o={model_provider:"openai",model:e.model,created_at:e.created_at,id:e.id,incomplete_details:e.incomplete_details,metadata:e.metadata,object:e.object,status:e.status,user:e.user,service_tier:e.service_tier,model_name:e.model},s={};for(const a of e.output)if("message"===a.type)t=a.id,n.push(...a.content.flatMap(e=>"output_text"===e.type?("parsed"in e&&null!=e.parsed&&(s.parsed=e.parsed),{type:"text",text:e.text,annotations:e.annotations.map(le)}):"refusal"===e.type?(s.refusal=e.refusal,[]):e));else if("function_call"===a.type){var l;const e={function:{name:a.name,arguments:a.arguments},id:a.call_id};try{r.push(q(e,{returnId:!0}))}catch(h){let t;"object"===typeof h&&null!=h&&"message"in h&&"string"===typeof h.message&&(t=h.message),i.push(Y(e,t))}null!==(l=s[se])&&void 0!==l||(s[se]={}),a.id&&(s[se][a.call_id]=a.id)}else if("reasoning"===a.type){var c;s.reasoning=a;const e=null===(c=a.summary)||void 0===c?void 0:c.map(e=>e.text).filter(Boolean).join("");e&&n.push({type:"reasoning",reasoning:e})}else if("custom_tool_call"===a.type){const e=S(a);e?r.push(e):i.push(Y(a,"Malformed custom tool call"))}else if("computer_call"===a.type){const e=D(a);e?r.push(e):i.push(Y(a,"Malformed computer call"))}else if("image_generation_call"===a.type){var u;a.result&&n.push({type:"image",mimeType:"image/png",data:a.result,id:a.id,metadata:{status:a.status}}),null!==(u=s.tool_outputs)&&void 0!==u||(s.tool_outputs=[]),s.tool_outputs.push(a)}else{var d;null!==(d=s.tool_outputs)&&void 0!==d||(s.tool_outputs=[]),s.tool_outputs.push(a)}return new a.Od({id:t,content:n,tool_calls:r,invalid_tool_calls:i,usage_metadata:ce(e.usage),additional_kwargs:s,response_metadata:o})},de=e=>{const t=[];let n,r={};const i=[],o={model_provider:"openai"},s={};let l;if("response.output_text.delta"===e.type)t.push({type:"text",text:e.delta,index:e.content_index});else if("response.output_text.annotation.added"===e.type)t.push({type:"text",text:"",annotations:[le(e.annotation)],index:e.content_index});else if("response.output_item.added"===e.type&&"message"===e.item.type)l=e.item.id;else if("response.output_item.added"===e.type&&"function_call"===e.item.type)i.push({type:"tool_call_chunk",name:e.item.name,args:e.item.arguments,id:e.item.call_id,index:e.output_index}),s[se]={[e.item.call_id]:e.item.id};else if("response.output_item.done"===e.type&&"computer_call"===e.item.type)i.push({type:"tool_call_chunk",name:"computer_use",args:JSON.stringify({action:e.item.action}),id:e.item.call_id,index:e.output_index}),s.tool_outputs=[e.item];else if("response.output_item.done"===e.type&&"image_generation_call"===e.item.type)e.item.result&&t.push({type:"image",mimeType:"image/png",data:e.item.result,id:e.item.id,metadata:{status:e.item.status}}),s.tool_outputs=[e.item];else if("response.output_item.done"===e.type&&["web_search_call","file_search_call","code_interpreter_call","mcp_call","mcp_list_tools","mcp_approval_request","custom_tool_call"].includes(e.item.type))s.tool_outputs=[e.item];else if("response.created"===e.type)o.id=e.response.id,o.model_name=e.response.model,o.model=e.response.model;else if("response.completed"===e.type){var c,u,h;const t=ue(e.response);n=ce(e.response.usage),"json_schema"===(null===(c=e.response.text)||void 0===c||null===(u=c.format)||void 0===u?void 0:u.type)&&(null!==(h=s.parsed)&&void 0!==h||(s.parsed=JSON.parse(t.text)));for(const[n,r]of Object.entries(e.response))"id"!==n&&(o[n]=r)}else if("response.function_call_arguments.delta"===e.type||"response.custom_tool_call_input.delta"===e.type)i.push({type:"tool_call_chunk",args:e.delta,index:e.output_index});else if("response.web_search_call.completed"===e.type||"response.file_search_call.completed"===e.type)r={tool_outputs:{id:e.item_id,type:e.type.replace("response.","").replace(".completed",""),status:"completed"}};else if("response.refusal.done"===e.type)s.refusal=e.refusal;else if("response.output_item.added"===e.type&&"item"in e&&"reasoning"===e.item.type){var f;const n=e.item.summary?e.item.summary.map((e,t)=>(0,d.A)((0,d.A)({},e),{},{index:t})):void 0;s.reasoning=(0,d.A)({id:e.item.id,type:e.item.type},n?{summary:n}:{});const r=null===(f=e.item.summary)||void 0===f?void 0:f.map(e=>e.text).filter(Boolean).join("");r&&t.push({type:"reasoning",reasoning:r})}else if("response.reasoning_summary_part.added"===e.type)s.reasoning={type:"reasoning",summary:[(0,d.A)((0,d.A)({},e.part),{},{index:e.summary_index})]},e.part.text&&t.push({type:"reasoning",reasoning:e.part.text});else{if("response.reasoning_summary_text.delta"!==e.type)return e.type,null;s.reasoning={type:"reasoning",summary:[{text:e.delta,type:"summary_text",index:e.summary_index}]},e.delta&&t.push({type:"reasoning",reasoning:e.delta})}return new oe.Cf({text:t.map(e=>e.text).join(""),message:new a.H({id:l,content:t,tool_call_chunks:i,usage_metadata:n,additional_kwargs:s,response_metadata:o}),generationInfo:r})},he=e=>{let{messages:t,zdrEnabled:n,model:r}=e;return t.flatMap(e=>{const t=e.response_metadata;if("v1"===(null===t||void 0===t?void 0:t.output_version))return(e=>{var t;const n=a.Od.isInstance(e)&&"openai"===(null===(t=e.response_metadata)||void 0===t?void 0:t.model_provider);return Array.from(function*(){const t=s(()=>{try{const t=u(e);return"system"===t||"developer"===t||"assistant"===t||"user"===t?t:"assistant"}catch(t){return"assistant"}});let r;const i=new Set,o=new Set,a=new Map,l=new Map;function*h(){if(!r)return;const e=r.content;("string"===typeof e&&e.length>0||Array.isArray(e)&&e.length>0)&&(yield r),r=void 0}const f=e=>{r||(r={type:"message",role:t,content:[]}),"string"===typeof r.content?r.content=r.content.length>0?[{type:"input_text",text:r.content},...e]:[...e]:r.content.push(...e)},p=e=>{if("string"===typeof e)return e;try{return JSON.stringify(null!==e&&void 0!==e?e:{})}catch(t){return"{}"}},g=e=>{const t=s(()=>{var t;const n=null===(t=e.metadata)||void 0===t?void 0:t.detail;return"low"===n||"high"===n||"auto"===n?n:"auto"});if(e.fileId)return{type:"input_image",detail:t,file_id:e.fileId};if(e.url)return{type:"input_image",detail:t,image_url:e.url};if(e.data){var n;const r="string"===typeof e.data?e.data:Buffer.from(e.data).toString("base64"),i=null!==(n=e.mimeType)&&void 0!==n?n:"image/png";return{type:"input_image",detail:t,image_url:"data:".concat(i,";base64,").concat(r)}}},m=e=>{const t=c(e);if(e.fileId&&"string"===typeof t)return(0,d.A)({type:"input_file",file_id:e.fileId},t?{filename:t}:{});if(e.url&&"string"===typeof t)return(0,d.A)({type:"input_file",file_url:e.url},t?{filename:t}:{});if(e.data&&"string"===typeof t){var n;const r="string"===typeof e.data?e.data:Buffer.from(e.data).toString("base64"),i=null!==(n=e.mimeType)&&void 0!==n?n:"application/octet-stream";return(0,d.A)({type:"input_file",file_data:"data:".concat(i,";base64,").concat(r)},t?{filename:t}:{})}},v=e=>{var t;const n=s(()=>{if(Array.isArray(e.summary)){var t;const n=e.summary,r=null!==(t=null===n||void 0===n?void 0:n.map(e=>null===e||void 0===e?void 0:e.text).filter(e=>"string"===typeof e))&&void 0!==t?t:[];if(r.length>0)return r}return e.reasoning?[e.reasoning]:[]}),r=n.length>0?n.map(e=>({type:"summary_text",text:e})):[{type:"summary_text",text:""}],i={type:"reasoning",id:null!==(t=e.id)&&void 0!==t?t:"",summary:r};return e.reasoning&&(i.content=[{type:"reasoning_text",text:e.reasoning}]),i},y=e=>{var t,n;return{type:"function_call",name:null!==(t=e.name)&&void 0!==t?t:"",call_id:null!==(n=e.id)&&void 0!==n?n:"",arguments:p(e.args)}},b=e=>{var t;const n=p(e.output),r="success"===e.status?"completed":"error"===e.status?"incomplete":void 0;return(0,d.A)({type:"function_call_output",call_id:null!==(t=e.toolCallId)&&void 0!==t?t:"",output:n},r?{status:r}:{})};for(const s of e.contentBlocks)if("text"===s.type)f([{type:"input_text",text:s.text}]);else if("invalid_tool_call"===s.type);else if("reasoning"===s.type)yield*h(),yield v(s);else if("tool_call"===s.type){var w;yield*h();const e=null!==(w=s.id)&&void 0!==w?w:"";e&&(i.add(e),a.delete(e)),yield y(s)}else if("tool_call_chunk"===s.type){if(s.id){var A;const e=null!==(A=a.get(s.id))&&void 0!==A?A:{name:s.name,args:[]};s.name&&(e.name=s.name),s.args&&e.args.push(s.args),a.set(s.id,e)}}else if("server_tool_call"===s.type){var _;yield*h();const e=null!==(_=s.id)&&void 0!==_?_:"";e&&(o.add(e),l.delete(e)),yield y(s)}else if("server_tool_call_chunk"===s.type){if(s.id){var C;const e=null!==(C=l.get(s.id))&&void 0!==C?C:{name:s.name,args:[]};s.name&&(e.name=s.name),s.args&&e.args.push(s.args),l.set(s.id,e)}}else if("server_tool_call_result"===s.type)yield*h(),yield b(s);else if("audio"===s.type);else if("file"===s.type){const e=m(s);e&&f([e])}else if("image"===s.type){const e=g(s);e&&f([e])}else if("video"===s.type){const e=m(s);e&&f([e])}else"text-plain"===s.type?s.text&&f([{type:"input_text",text:s.text}]):"non_standard"===s.type&&n&&(yield*h(),yield s.value);yield*h();for(const[e,n]of a){var x;if(!e||i.has(e))continue;const t=n.args.join("");(n.name||t)&&(yield{type:"function_call",call_id:e,name:null!==(x=n.name)&&void 0!==x?x:"",arguments:t})}for(const[e,n]of l){var E;if(!e||o.has(e))continue;const t=n.args.join("");(n.name||t)&&(yield{type:"function_call",call_id:e,name:null!==(E=n.name)&&void 0!==E?E:"",arguments:t})}}())})(e);const i=e.additional_kwargs;let o=u(e);if("system"===o&&l(r)&&(o="developer"),"function"===o)throw new Error("Function messages are not supported in Responses API");if("tool"===o){var h,f;const t=e;if("computer_call_output"===(null===i||void 0===i?void 0:i.type)){return{type:"computer_call_output",output:(()=>{if("string"===typeof t.content)return{type:"input_image",image_url:t.content};if(Array.isArray(t.content)){const e=t.content.find(e=>"input_image"===e.type);if(e)return e;const n=t.content.find(e=>"computer_screenshot"===e.type);if(n)return n;const r=t.content.find(e=>"image_url"===e.type);if(r)return{type:"input_image",image_url:"string"===typeof r.image_url?r.image_url:r.image_url.url}}throw new Error("Invalid computer call output")})(),call_id:t.tool_call_id}}if(null!==(h=t.additional_kwargs)&&void 0!==h&&h.customTool)return{type:"custom_tool_call_output",call_id:t.tool_call_id,output:t.content};const n=Array.isArray(t.content)&&t.content.every(e=>"object"===typeof e&&null!==e&&"type"in e&&("input_file"===e.type||"input_image"===e.type||"input_text"===e.type));return{type:"function_call_output",call_id:t.tool_call_id,id:null!==(f=t.id)&&void 0!==f&&f.startsWith("fc_")?t.id:void 0,output:n?t.content:"string"!==typeof t.content?JSON.stringify(t.content):t.content}}if("assistant"===o){var p,g;if(!n&&null!=(null===t||void 0===t?void 0:t.output)&&Array.isArray(null===t||void 0===t?void 0:t.output)&&(null===t||void 0===t?void 0:t.output.length)>0&&null!==t&&void 0!==t&&t.output.every(e=>"type"in e))return null===t||void 0===t?void 0:t.output;const r=[];if(null!==i&&void 0!==i&&i.reasoning&&!n){const e=(e=>{const t=(e.summary.length>1?e.summary.reduce((e,t)=>{const n=e[e.length-1];return n.index===t.index?n.text+=t.text:e.push(t),e},[(0,d.A)({},e.summary[0])]):e.summary).map(e=>Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return"index"!==t})));return(0,d.A)((0,d.A)({},e),{},{summary:t})})(i.reasoning);r.push(e)}let{content:o}=e;null!==i&&void 0!==i&&i.refusal&&("string"===typeof o&&(o=[{type:"output_text",text:o,annotations:[]}]),o=[...o,{type:"refusal",refusal:i.refusal}]),("string"===typeof o||o.length>0)&&r.push((0,d.A)((0,d.A)({type:"message",role:"assistant"},e.id&&!n&&e.id.startsWith("msg_")?{id:e.id}:{}),{},{content:s(()=>"string"===typeof o?o:o.flatMap(e=>{var t;return"text"===e.type?{type:"output_text",text:e.text,annotations:null!==(t=e.annotations)&&void 0!==t?t:[]}:"output_text"===e.type||"refusal"===e.type?e:[]}))}));const l=null===i||void 0===i?void 0:i[se];a.Od.isInstance(e)&&null!==(p=e.tool_calls)&&void 0!==p&&p.length?r.push(...e.tool_calls.map(e=>{var t,r;return function(e){return"object"===typeof e&&null!==e&&"type"in e&&"tool_call"===e.type&&"isCustomTool"in e&&!0===e.isCustomTool}(e)?{type:"custom_tool_call",id:e.call_id,call_id:null!==(t=e.id)&&void 0!==t?t:"",input:e.args.input,name:e.name}:function(e){return"object"===typeof e&&null!==e&&"type"in e&&"tool_call"===e.type&&"isComputerTool"in e&&!0===e.isComputerTool}(e)?{type:"computer_call",id:e.call_id,call_id:null!==(r=e.id)&&void 0!==r?r:"",action:e.args.action}:(0,d.A)({type:"function_call",name:e.name,arguments:JSON.stringify(e.args),call_id:e.id},n?{}:{id:null===l||void 0===l?void 0:l[e.id]})})):null!==i&&void 0!==i&&i.tool_calls&&r.push(...i.tool_calls.map(e=>(0,d.A)({type:"function_call",name:e.function.name,call_id:e.id,arguments:e.function.arguments},n?{}:{id:null===l||void 0===l?void 0:l[e.id]})));const c=null!==t&&void 0!==t&&null!==(g=t.output)&&void 0!==g&&g.length?null===t||void 0===t?void 0:t.output:i.tool_outputs,u=["computer_call","mcp_call","code_interpreter_call","image_generation_call"];if(null!=c){const e=null===c||void 0===c?void 0:c.filter(e=>u.includes(e.type));e.length>0&&r.push(...e)}return r}if("user"===o||"system"===o||"developer"===o){if("string"===typeof e.content)return{type:"message",role:o,content:e.content};const t=[],n=e.content.flatMap(e=>{if("mcp_approval_response"===e.type&&t.push({type:"mcp_approval_response",approval_request_id:e.approval_request_id,approve:e.approve}),(0,a.Fz)(e))return(0,a.up)(e,Z);if("text"===e.type)return{type:"input_text",text:e.text};if("image_url"===e.type){return{type:"input_image",image_url:s(()=>"string"===typeof e.image_url?e.image_url:"object"===typeof e.image_url&&null!==e.image_url&&"url"in e.image_url?e.image_url.url:void 0),detail:s(()=>"string"===typeof e.image_url?"auto":"object"===typeof e.image_url&&null!==e.image_url&&"detail"in e.image_url?e.image_url.detail:void 0)}}return"input_text"===e.type||"input_image"===e.type||"input_file"===e.type?e:[]});return n.length>0&&t.push({type:"message",role:o,content:n}),t}return console.warn("Unsupported role found when converting to OpenAI Responses API: ".concat(o)),[]})};var fe=class extends J{invocationParams(e){var t,n,r;let i;void 0!==(null===e||void 0===e?void 0:e.strict)&&(i=e.strict),void 0===i&&void 0!==this.supportsStrictToolCalling&&(i=this.supportsStrictToolCalling);const o=(0,d.A)((0,d.A)({model:this.model,temperature:this.temperature,top_p:this.topP,user:this.user,stream:this.streaming,previous_response_id:null===e||void 0===e?void 0:e.previous_response_id,truncation:null===e||void 0===e?void 0:e.truncation,include:null===e||void 0===e?void 0:e.include,tools:null!==e&&void 0!==e&&null!==(t=e.tools)&&void 0!==t&&t.length?this._reduceChatOpenAITools(e.tools,{stream:this.streaming,strict:i}):void 0,tool_choice:(a=null===e||void 0===e?void 0:e.tool_choice,null!=a&&"object"===typeof a&&"type"in a&&"function"!==a.type?null===e||void 0===e?void 0:e.tool_choice:(()=>{const t=_(null===e||void 0===e?void 0:e.tool_choice);if("object"===typeof t&&"type"in t){if("function"===t.type)return{type:"function",name:t.function.name};if("allowed_tools"===t.type)return{type:"allowed_tools",mode:t.allowed_tools.mode,tools:t.allowed_tools.tools};if("custom"===t.type)return{type:"custom",name:t.custom.name}}})()),text:(()=>{if(null!==e&&void 0!==e&&e.text)return e.text;const t=this._getResponseFormat(null===e||void 0===e?void 0:e.response_format);return"json_schema"===(null===t||void 0===t?void 0:t.type)?null!=t.json_schema.schema?{format:{type:"json_schema",schema:t.json_schema.schema,description:t.json_schema.description,name:t.json_schema.name,strict:t.json_schema.strict},verbosity:null===e||void 0===e?void 0:e.verbosity}:void 0:{format:t,verbosity:null===e||void 0===e?void 0:e.verbosity}})(),parallel_tool_calls:null===e||void 0===e?void 0:e.parallel_tool_calls,max_output_tokens:-1===this.maxTokens?void 0:this.maxTokens,prompt_cache_key:null!==(n=null===e||void 0===e?void 0:e.promptCacheKey)&&void 0!==n?n:this.promptCacheKey,prompt_cache_retention:null!==(r=null===e||void 0===e?void 0:e.promptCacheRetention)&&void 0!==r?r:this.promptCacheRetention},this.zdrEnabled?{store:!1}:{}),this.modelKwargs);var a;const s=this._getReasoningParams(e);return void 0!==s&&(o.reasoning=s),o}async _generate(e,t,n){const r=this.invocationParams(t);if(r.stream){var i,o;const r=this._streamResponseChunks(e,t,n);let p;var a,s=!1,l=!1;try{for(var c,u=(0,ie.A)(r);s=!(c=await u.next()).done;s=!1){var h,f;const e=c.value;e.message.response_metadata=(0,d.A)((0,d.A)({},e.generationInfo),e.message.response_metadata),p=null!==(h=null===(f=p)||void 0===f?void 0:f.concat(e))&&void 0!==h?h:e}}catch(g){l=!0,a=g}finally{try{s&&null!=u.return&&await u.return()}finally{if(l)throw a}}return{generations:p?[p]:[],llmOutput:{estimatedTokenUsage:null===(i=p)||void 0===i||null===(o=i.message)||void 0===o?void 0:o.usage_metadata}}}{var p;const n=await this.completionWithRetry((0,d.A)((0,d.A)({input:he({messages:e,zdrEnabled:null!==(p=this.zdrEnabled)&&void 0!==p&&p,model:this.model})},r),{},{stream:!1}),(0,d.A)({signal:null===t||void 0===t?void 0:t.signal},null===t||void 0===t?void 0:t.options));return{generations:[{text:n.output_text,message:ue(n)}],llmOutput:{id:n.id,estimatedTokenUsage:n.usage?{promptTokens:n.usage.input_tokens,completionTokens:n.usage.output_tokens,totalTokens:n.usage.total_tokens}:void 0}}}}_streamResponseChunks(e,t,n){var r=this;return(0,re.A)(function*(){var i;const o=yield(0,ne.A)(r.completionWithRetry((0,d.A)((0,d.A)({},r.invocationParams(t)),{},{input:he({messages:e,zdrEnabled:null!==(i=r.zdrEnabled)&&void 0!==i&&i,model:r.model}),stream:!0}),t));var a,s=!1,l=!1;try{for(var c,u=(0,ie.A)(o);s=!(c=yield(0,ne.A)(u.next())).done;s=!1){var h;const e=c.value,r=de(e);null!=r&&(yield r,yield(0,ne.A)(null===n||void 0===n?void 0:n.handleLLMNewToken(r.text||"",{prompt:null!==(h=t.promptIndex)&&void 0!==h?h:0,completion:0},void 0,void 0,void 0,{chunk:r})))}}catch(f){l=!0,a=f}finally{try{s&&null!=u.return&&(yield(0,ne.A)(u.return()))}finally{if(l)throw a}}})()}async completionWithRetry(e,t){return this.caller.call(async()=>{const n=this._getClientOptions(t);try{var r,i;return"json_schema"!==(null===(r=e.text)||void 0===r||null===(i=r.format)||void 0===i?void 0:i.type)||e.stream?await this.client.responses.create(e,n):await this.client.responses.parse(e,n)}catch(a){throw o(a)}})}_reduceChatOpenAITools(e,t){const n=[];for(const i of e){var r;if(C(i))"image_generation"===i.type&&null!==t&&void 0!==t&&t.stream&&(i.partial_images=1),n.push(i);else if(x(i)){const e=i.metadata.customTool;n.push({type:"custom",name:e.name,description:e.description,format:e.format})}else(0,N.VC)(i)?n.push({type:"function",name:i.function.name,parameters:i.function.parameters,description:i.function.description,strict:null!==(r=null===t||void 0===t?void 0:t.strict)&&void 0!==r?r:null}):E(i)&&n.push(k(i))}return n}},pe=n(88951),ge=class e extends J{get lc_serializable_keys(){return[...super.lc_serializable_keys,"useResponsesApi"]}get callKeys(){return[...super.callKeys,"useResponsesApi"]}constructor(e){var t,n,r;super(e),(0,m.A)(this,"useResponsesApi",!1),(0,m.A)(this,"responses",void 0),(0,m.A)(this,"completions",void 0),this.fields=e,this.useResponsesApi=null!==(t=null===e||void 0===e?void 0:e.useResponsesApi)&&void 0!==t&&t,this.responses=null!==(n=null===e||void 0===e?void 0:e.responses)&&void 0!==n?n:new fe(e),this.completions=null!==(r=null===e||void 0===e?void 0:e.completions)&&void 0!==r?r:new ae(e)}_useResponsesApi(e){var t,n,r,i,o;const a=null===e||void 0===e||null===(t=e.tools)||void 0===t?void 0:t.some(C),s=null!=(null===e||void 0===e?void 0:e.previous_response_id)||null!=(null===e||void 0===e?void 0:e.text)||null!=(null===e||void 0===e?void 0:e.truncation)||null!=(null===e||void 0===e?void 0:e.include)||null!=(null===e||void 0===e||null===(n=e.reasoning)||void 0===n?void 0:n.summary)||null!=(null===(r=this.reasoning)||void 0===r?void 0:r.summary),l=(null===e||void 0===e||null===(i=e.tools)||void 0===i?void 0:i.some(E))||(null===e||void 0===e||null===(o=e.tools)||void 0===o?void 0:o.some(x));return this.useResponsesApi||a||s||l||this.model.includes("gpt-5.2-pro")}getLsParams(e){const t=this._combineCallOptions(e);return this._useResponsesApi(e)?this.responses.getLsParams(t):this.completions.getLsParams(t)}invocationParams(e){const t=this._combineCallOptions(e);return this._useResponsesApi(e)?this.responses.invocationParams(t):this.completions.invocationParams(t)}async _generate(e,t,n){return this._useResponsesApi(t)?this.responses._generate(e,t):this.completions._generate(e,t,n)}_streamResponseChunks(e,t,n){var r=this;return(0,re.A)(function*(){r._useResponsesApi(t)?yield*(0,pe.A)((0,ie.A)(r.responses._streamResponseChunks(e,r._combineCallOptions(t),n)),ne.A):yield*(0,pe.A)((0,ie.A)(r.completions._streamResponseChunks(e,r._combineCallOptions(t),n)),ne.A)})()}withConfig(t){const n=new e(this.fields);return n.defaultOptions=(0,d.A)((0,d.A)({},this.defaultOptions),t),n}},me=n(1890);(0,L.V)({},{chunkArray:()=>ve});const ve=(e,t)=>e.reduce((e,n,r)=>{const i=Math.floor(r/t),o=e[i]||[];return e[i]=o.concat([n]),e},[]);me.PI;var ye=n(7530),be=class extends ye.J{constructor(e){var t,n,r,i,o,a,s,l;const c=(0,d.A)({maxConcurrency:2},e);super(c),(0,m.A)(this,"model","text-embedding-ada-002"),(0,m.A)(this,"modelName",void 0),(0,m.A)(this,"batchSize",512),(0,m.A)(this,"stripNewLines",!0),(0,m.A)(this,"dimensions",void 0),(0,m.A)(this,"timeout",void 0),(0,m.A)(this,"organization",void 0),(0,m.A)(this,"encodingFormat",void 0),(0,m.A)(this,"client",void 0),(0,m.A)(this,"clientConfig",void 0),(0,m.A)(this,"apiKey",void 0);const u=null!==(t=null!==(n=null===c||void 0===c?void 0:c.apiKey)&&void 0!==n?n:null===c||void 0===c?void 0:c.openAIApiKey)&&void 0!==t?t:(0,h.Az)("OPENAI_API_KEY");this.organization=null!==(r=null===c||void 0===c||null===(i=c.configuration)||void 0===i?void 0:i.organization)&&void 0!==r?r:(0,h.Az)("OPENAI_ORGANIZATION"),this.model=null!==(o=null!==(a=null===c||void 0===c?void 0:c.model)&&void 0!==a?a:null===c||void 0===c?void 0:c.modelName)&&void 0!==o?o:this.model,this.modelName=this.model,this.batchSize=null!==(s=null===c||void 0===c?void 0:c.batchSize)&&void 0!==s?s:this.batchSize,this.stripNewLines=null!==(l=null===c||void 0===c?void 0:c.stripNewLines)&&void 0!==l?l:this.stripNewLines,this.timeout=null===c||void 0===c?void 0:c.timeout,this.dimensions=null===c||void 0===c?void 0:c.dimensions,this.encodingFormat=null===c||void 0===c?void 0:c.encodingFormat,this.clientConfig=(0,d.A)({apiKey:u,organization:this.organization,dangerouslyAllowBrowser:!0},null===e||void 0===e?void 0:e.configuration)}async embedDocuments(e){const t=ve(this.stripNewLines?e.map(e=>e.replace(/\n/g," ")):e,this.batchSize),n=t.map(e=>{const t={model:this.model,input:e};return this.dimensions&&(t.dimensions=this.dimensions),this.encodingFormat&&(t.encoding_format=this.encodingFormat),this.embeddingWithRetry(t)}),r=await Promise.all(n),i=[];for(let o=0;o{try{return await this.client.embeddings.create(e,t)}catch(n){throw o(n)}})}};var we,Ae=n(16822);we=class extends Ae.NL{static lc_name(){return"DallEAPIWrapper"}constructor(e){var t,n,r,o,a,s,l,c,u,d;void 0!==(null===e||void 0===e?void 0:e.responseFormat)&&["url","b64_json"].includes(e.responseFormat)&&(e.dallEResponseFormat=e.responseFormat,e.responseFormat="content"),super(e),(0,m.A)(this,"name","dalle_api_wrapper"),(0,m.A)(this,"description","A wrapper around OpenAI DALL-E API. Useful for when you need to generate images from a text description. Input should be an image description."),(0,m.A)(this,"client",void 0),(0,m.A)(this,"model","dall-e-3"),(0,m.A)(this,"style","vivid"),(0,m.A)(this,"quality","standard"),(0,m.A)(this,"n",1),(0,m.A)(this,"size","1024x1024"),(0,m.A)(this,"dallEResponseFormat","url"),(0,m.A)(this,"user",void 0);const f={apiKey:null!==(t=null!==(n=null===e||void 0===e?void 0:e.apiKey)&&void 0!==n?n:null===e||void 0===e?void 0:e.openAIApiKey)&&void 0!==t?t:(0,h.Az)("OPENAI_API_KEY"),organization:null!==(r=null===e||void 0===e?void 0:e.organization)&&void 0!==r?r:(0,h.Az)("OPENAI_ORGANIZATION"),dangerouslyAllowBrowser:!0,baseURL:null===e||void 0===e?void 0:e.baseUrl};this.client=new i.z4(f),this.model=null!==(o=null!==(a=null===e||void 0===e?void 0:e.model)&&void 0!==a?a:null===e||void 0===e?void 0:e.modelName)&&void 0!==o?o:this.model,this.style=null!==(s=null===e||void 0===e?void 0:e.style)&&void 0!==s?s:this.style,this.quality=null!==(l=null===e||void 0===e?void 0:e.quality)&&void 0!==l?l:this.quality,this.n=null!==(c=null===e||void 0===e?void 0:e.n)&&void 0!==c?c:this.n,this.size=null!==(u=null===e||void 0===e?void 0:e.size)&&void 0!==u?u:this.size,this.dallEResponseFormat=null!==(d=null===e||void 0===e?void 0:e.dallEResponseFormat)&&void 0!==d?d:this.dallEResponseFormat,this.user=null===e||void 0===e?void 0:e.user}processMultipleGeneratedUrls(e){return"url"===this.dallEResponseFormat?e.flatMap(e=>{var t,n;return null!==(t=null===(n=e.data)||void 0===n?void 0:n.flatMap(e=>e.url?{type:"image_url",image_url:e.url}:[]).filter(e=>void 0!==e&&"image_url"===e.type&&"string"===typeof e.image_url&&void 0!==e.image_url))&&void 0!==t?t:[]}):e.flatMap(e=>{var t,n;return null!==(t=null===(n=e.data)||void 0===n?void 0:n.flatMap(e=>e.b64_json?{type:"image_url",image_url:{url:e.b64_json}}:[]).filter(e=>void 0!==e&&"image_url"===e.type&&"object"===typeof e.image_url&&"url"in e.image_url&&"string"===typeof e.image_url.url&&void 0!==e.image_url.url))&&void 0!==t?t:[]})}async _call(e){var t,n,r,i;const o={model:this.model,prompt:e,n:1,size:this.size,response_format:this.dallEResponseFormat,style:this.style,quality:this.quality,user:this.user};if(this.n>1){const e=await Promise.all(Array.from({length:this.n}).map(()=>this.client.images.generate(o)));return this.processMultipleGeneratedUrls(e)}const a=await this.client.images.generate(o);let s="";return"url"===this.dallEResponseFormat?[s]=null!==(t=null===(n=a.data)||void 0===n?void 0:n.map(e=>e.url).filter(e=>"undefined"!==e))&&void 0!==t?t:[]:[s]=null!==(r=null===(i=a.data)||void 0===i?void 0:i.map(e=>e.b64_json).filter(e=>"undefined"!==e))&&void 0!==r?r:[],s}},(0,m.A)(we,"toolName","dalle_api_wrapper");var _e=n(63322);const Ce=_e.z.object({type:_e.z.literal("screenshot")}),xe=_e.z.object({type:_e.z.literal("click"),x:_e.z.number(),y:_e.z.number(),button:_e.z.enum(["left","right","wheel","back","forward"]).default("left")}),Ee=_e.z.object({type:_e.z.literal("double_click"),x:_e.z.number(),y:_e.z.number(),button:_e.z.enum(["left","right","wheel","back","forward"]).default("left")}),Se=_e.z.object({type:_e.z.literal("drag"),path:_e.z.array(_e.z.object({x:_e.z.number(),y:_e.z.number()}))}),De=_e.z.object({type:_e.z.literal("keypress"),keys:_e.z.array(_e.z.string())}),ke=_e.z.object({type:_e.z.literal("move"),x:_e.z.number(),y:_e.z.number()}),Te=_e.z.object({type:_e.z.literal("scroll"),x:_e.z.number(),y:_e.z.number(),scroll_x:_e.z.number(),scroll_y:_e.z.number()}),Oe=_e.z.object({type:_e.z.literal("type"),text:_e.z.string()}),Ie=_e.z.object({type:_e.z.literal("wait"),duration:_e.z.number().optional()}),Pe=_e.z.discriminatedUnion("type",[Ce,xe,Ee,Se,De,ke,Te,Oe,Ie]);_e.z.object({action:Pe});const Me=_e.z.object({type:_e.z.literal("exec"),command:_e.z.array(_e.z.string()),env:_e.z.record(_e.z.string(),_e.z.string()).optional(),working_directory:_e.z.string().optional(),timeout_ms:_e.z.number().optional(),user:_e.z.string().optional()});_e.z.discriminatedUnion("type",[Me]);_e.z.object({commands:_e.z.array(_e.z.string()).describe("Array of shell commands to execute"),timeout_ms:_e.z.number().optional().describe("Optional timeout in milliseconds for the commands"),max_output_length:_e.z.number().optional().describe("Optional maximum number of characters to return from each command")});const Re=_e.z.object({type:_e.z.literal("create_file"),path:_e.z.string(),diff:_e.z.string()}),Ne=_e.z.object({type:_e.z.literal("update_file"),path:_e.z.string(),diff:_e.z.string()}),je=_e.z.object({type:_e.z.literal("delete_file"),path:_e.z.string()});_e.z.discriminatedUnion("type",[Re,Ne,je]);n(75177)},8841(e,t,n){"use strict";n.d(t,{A:()=>s});var r=n(9950),i=n(70865),o=n(67603);const a=[{getTarget:e=>e,eventName:"zoom-to-node",createUrl:(e,t)=>{let{node:n}=e;return(0,i.A)((0,o.fi)("/maps/".concat(t.mapId,"/").concat(n.id)),n.title)}}];const s=function(e){let{engine:t}=e;const n=(0,r.useRef)("");return(0,r.useEffect)(()=>{if(window.history){const e=a.map(e=>{let{getTarget:r,eventName:i,createUrl:o}=e;const a=r(t),s=e=>{const r=o(e,t);window.history.pushState({key:Math.random().toString(36).substring(2,10)},"",r),n.current=i};return a.on(i,s),()=>a.off(i,s)});return()=>{e.forEach(e=>e())}}return()=>{}},[t]),null}},8937(e,t,n){"use strict";n.d(t,{Ay:()=>I});var r=n(80045),i=n(64467),o=n(58168),a=n(9950),s=n(2803),l=n(33720),c=n(38640),u=n(52521),d=a.forwardRef(function(e,t){var n=e.classes,i=e.className,l=e.color,c=void 0===l?"default":l,d=e.component,h=void 0===d?"li":d,f=e.disableGutters,p=void 0!==f&&f,g=e.disableSticky,m=void 0!==g&&g,v=e.inset,y=void 0!==v&&v,b=(0,r.A)(e,["classes","className","color","component","disableGutters","disableSticky","inset"]);return a.createElement(h,(0,o.A)({className:(0,s.default)(n.root,i,"default"!==c&&n["color".concat((0,u.A)(c))],y&&n.inset,!m&&n.sticky,!p&&n.gutters),ref:t},b))});const h=(0,l.A)(function(e){return{root:{boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:e.palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},colorPrimary:{color:e.palette.primary.main},colorInherit:{color:"inherit"},gutters:{paddingLeft:16,paddingRight:16},inset:{paddingLeft:72},sticky:{position:"sticky",top:0,zIndex:1,backgroundColor:"inherit"}}},{name:"MuiListSubheader"})(d);var f=n(77882),p=n(97226),g=n(11647),m=n(39197);const v=(0,n(32776).A)(a.createElement("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");var y=n(5544),b=n(13642),w=n(58438),A=n(81097),_=n(2946);function C(e){return"undefined"!==typeof e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function x(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.ignoreAccents,n=void 0===t||t,r=e.ignoreCase,i=void 0===r||r,o=e.limit,a=e.matchFrom,s=void 0===a?"any":a,l=e.stringify,c=e.trim,u=void 0!==c&&c;return function(e,t){var r=t.inputValue,a=t.getOptionLabel,c=u?r.trim():r;i&&(c=c.toLowerCase()),n&&(c=C(c));var d=e.filter(function(e){var t=(l||a)(e);return i&&(t=t.toLowerCase()),n&&(t=C(t)),"start"===s?0===t.indexOf(c):t.indexOf(c)>-1});return"number"===typeof o?d.slice(0,o):d}}();function S(e){var t=e.autoComplete,n=void 0!==t&&t,r=e.autoHighlight,i=void 0!==r&&r,s=e.autoSelect,l=void 0!==s&&s,c=e.blurOnSelect,u=void 0!==c&&c,d=e.clearOnBlur,h=void 0===d?!e.freeSolo:d,f=e.clearOnEscape,p=void 0!==f&&f,g=e.componentName,m=void 0===g?"useAutocomplete":g,v=e.debug,C=void 0!==v&&v,S=e.defaultValue,D=void 0===S?e.multiple?[]:null:S,k=e.disableClearable,T=void 0!==k&&k,O=e.disableCloseOnSelect,I=void 0!==O&&O,P=e.disabledItemsFocusable,M=void 0!==P&&P,R=e.disableListWrap,N=void 0!==R&&R,j=e.filterOptions,F=void 0===j?E:j,L=e.filterSelectedOptions,B=void 0!==L&&L,z=e.freeSolo,U=void 0!==z&&z,G=e.getOptionDisabled,H=e.getOptionLabel,W=void 0===H?function(e){return e}:H,V=e.getOptionSelected,q=void 0===V?function(e,t){return e===t}:V,K=e.groupBy,Y=e.handleHomeEndKeys,X=void 0===Y?!e.freeSolo:Y,Q=e.id,J=e.includeInputInList,Z=void 0!==J&&J,$=e.inputValue,ee=e.multiple,te=void 0!==ee&&ee,ne=e.onChange,re=e.onClose,ie=e.onHighlightChange,oe=e.onInputChange,ae=e.onOpen,se=e.open,le=e.openOnFocus,ce=void 0!==le&&le,ue=e.options,de=e.selectOnFocus,he=void 0===de?!e.freeSolo:de,fe=e.value,pe=(0,b.A)(Q),ge=W;var me=a.useRef(!1),ve=a.useRef(!0),ye=a.useRef(null),be=a.useRef(null),we=a.useState(null),Ae=we[0],_e=we[1],Ce=a.useState(-1),xe=Ce[0],Ee=Ce[1],Se=i?0:-1,De=a.useRef(Se),ke=(0,w.A)({controlled:fe,default:D,name:m}),Te=(0,y.A)(ke,2),Oe=Te[0],Ie=Te[1],Pe=(0,w.A)({controlled:$,default:"",name:m,state:"inputValue"}),Me=(0,y.A)(Pe,2),Re=Me[0],Ne=Me[1],je=a.useState(!1),Fe=je[0],Le=je[1],Be=(0,A.A)(function(e,t){var n;if(te)n="";else if(null==t)n="";else{var r=ge(t);n="string"===typeof r?r:""}Re!==n&&(Ne(n),oe&&oe(e,n,"reset"))});a.useEffect(function(){Be(null,Oe)},[Oe,Be]);var ze=(0,w.A)({controlled:se,default:!1,name:m,state:"open"}),Ue=(0,y.A)(ze,2),Ge=Ue[0],He=Ue[1],We=!te&&null!=Oe&&Re===ge(Oe),Ve=Ge,qe=Ve?F(ue.filter(function(e){return!B||!(te?Oe:[Oe]).some(function(t){return null!==t&&q(e,t)})}),{inputValue:We?"":Re,getOptionLabel:ge}):[],Ke=(0,A.A)(function(e){-1===e?ye.current.focus():Ae.querySelector('[data-tag-index="'.concat(e,'"]')).focus()});a.useEffect(function(){te&&xe>Oe.length-1&&(Ee(-1),Ke(-1))},[Oe,te,xe,Ke]);var Ye=(0,A.A)(function(e){var t=e.event,n=e.index,r=e.reason,i=void 0===r?"auto":r;if(De.current=n,-1===n?ye.current.removeAttribute("aria-activedescendant"):ye.current.setAttribute("aria-activedescendant","".concat(pe,"-option-").concat(n)),ie&&ie(t,-1===n?null:qe[n],i),be.current){var o=be.current.querySelector("[data-focus]");o&&o.removeAttribute("data-focus");var a=be.current.parentElement.querySelector('[role="listbox"]');if(a)if(-1!==n){var s=be.current.querySelector('[data-option-index="'.concat(n,'"]'));if(s&&(s.setAttribute("data-focus","true"),a.scrollHeight>a.clientHeight&&"mouse"!==i)){var l=s,c=a.clientHeight+a.scrollTop,u=l.offsetTop+l.offsetHeight;u>c?a.scrollTop=u-a.clientHeight:l.offsetTop-l.offsetHeight*(K?1.3:0)1?0:e:t>e?t===e+1&&Z?-1:N||Math.abs(r)>1?e:0:t}(),o);if(Ye({index:l,reason:s,event:t}),n&&"reset"!==r)if(-1===l)ye.current.value=Re;else{var c=ge(qe[l]);ye.current.value=c,0===c.toLowerCase().indexOf(Re.toLowerCase())&&Re.length>0&&ye.current.setSelectionRange(Re.length,c.length)}}}),Qe=a.useCallback(function(){if(Ve){var e=te?Oe[0]:Oe;if(0!==qe.length&&null!=e){if(be.current)if(B||null==e)De.current>=qe.length-1?Ye({index:qe.length-1}):Ye({index:De.current});else{var t=qe[De.current];if(te&&t&&-1!==x(Oe,function(e){return q(t,e)}))return;var n=x(qe,function(t){return q(t,e)});-1===n?Xe({diff:"reset"}):Ye({index:n})}}else Xe({diff:"reset"})}},[0===qe.length,!te&&Oe,B,Xe,Ye,Ve,Re,te]),Je=(0,A.A)(function(e){(0,_.A)(be,e),e&&Qe()});a.useEffect(function(){Qe()},[Qe]);var Ze=function(e){Ge||(He(!0),ae&&ae(e))},$e=function(e,t){Ge&&(He(!1),re&&re(e,t))},et=function(e,t,n,r){Oe!==t&&(ne&&ne(e,t,n,r),Ie(t))},tt=a.useRef(!1),nt=function(e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"options",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"select-option",i=t;if(te){var o=x(i=Array.isArray(Oe)?Oe.slice():[],function(e){return q(t,e)});-1===o?i.push(t):"freeSolo"!==n&&(i.splice(o,1),r="remove-option")}Be(e,i),et(e,i,r,{option:t}),I||$e(e,r),(!0===u||"touch"===u&&tt.current||"mouse"===u&&!tt.current)&&ye.current.blur()};var rt=function(e,t){if(te){$e(e,"toggleInput");var n=xe;-1===xe?""===Re&&"previous"===t&&(n=Oe.length-1):((n+="next"===t?1:-1)<0&&(n=0),n===Oe.length&&(n=-1)),n=function(e,t){if(-1===e)return-1;for(var n=e;;){if("next"===t&&n===Oe.length||"previous"===t&&-1===n)return-1;var r=Ae.querySelector('[data-tag-index="'.concat(n,'"]'));if(!r||r.hasAttribute("tabindex")&&!r.disabled&&"true"!==r.getAttribute("aria-disabled"))return n;n+="next"===t?1:-1}}(n,t),Ee(n),Ke(n)}},it=function(e){me.current=!0,Ne(""),oe&&oe(e,"","clear"),et(e,te?[]:null,"clear")},ot=function(e){return function(t){switch(-1!==xe&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(Ee(-1),Ke(-1)),t.key){case"Home":Ve&&X&&(t.preventDefault(),Xe({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":Ve&&X&&(t.preventDefault(),Xe({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),Xe({diff:-5,direction:"previous",reason:"keyboard",event:t}),Ze(t);break;case"PageDown":t.preventDefault(),Xe({diff:5,direction:"next",reason:"keyboard",event:t}),Ze(t);break;case"ArrowDown":t.preventDefault(),Xe({diff:1,direction:"next",reason:"keyboard",event:t}),Ze(t);break;case"ArrowUp":t.preventDefault(),Xe({diff:-1,direction:"previous",reason:"keyboard",event:t}),Ze(t);break;case"ArrowLeft":rt(t,"previous");break;case"ArrowRight":rt(t,"next");break;case"Enter":if(229===t.which)break;if(-1!==De.current&&Ve){var r=qe[De.current],i=!!G&&G(r);if(t.preventDefault(),i)return;nt(t,r,"select-option"),n&&ye.current.setSelectionRange(ye.current.value.length,ye.current.value.length)}else U&&""!==Re&&!1===We&&(te&&t.preventDefault(),nt(t,Re,"create-option","freeSolo"));break;case"Escape":Ve?(t.preventDefault(),t.stopPropagation(),$e(t,"escape")):p&&(""!==Re||te&&Oe.length>0)&&(t.preventDefault(),t.stopPropagation(),it(t));break;case"Backspace":if(te&&""===Re&&Oe.length>0){var o=-1===xe?Oe.length-1:xe,a=Oe.slice();a.splice(o,1),et(t,a,"remove-option",{option:Oe[o]})}}e.onKeyDown&&e.onKeyDown(t)}},at=function(e){Le(!0),ce&&!me.current&&Ze(e)},st=function(e){null===be.current||document.activeElement!==be.current.parentElement?(Le(!1),ve.current=!0,me.current=!1,C&&""!==Re||(l&&-1!==De.current&&Ve?nt(e,qe[De.current],"blur"):l&&U&&""!==Re?nt(e,Re,"blur","freeSolo"):h&&Be(e,Oe),$e(e,"blur"))):ye.current.focus()},lt=function(e){var t=e.target.value;Re!==t&&(Ne(t),oe&&oe(e,t,"input")),""===t?T||te||et(e,null,"clear"):Ze(e)},ct=function(e){Ye({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},ut=function(){tt.current=!0},dt=function(e){var t=Number(e.currentTarget.getAttribute("data-option-index"));nt(e,qe[t],"select-option"),tt.current=!1},ht=function(e){return function(t){var n=Oe.slice();n.splice(e,1),et(t,n,"remove-option",{option:Oe[e]})}},ft=function(e){Ge?$e(e,"toggleInput"):Ze(e)},pt=function(e){e.target.getAttribute("id")!==pe&&e.preventDefault()},gt=function(){ye.current.focus(),he&&ve.current&&ye.current.selectionEnd-ye.current.selectionStart===0&&ye.current.select(),ve.current=!1},mt=function(e){""!==Re&&Ge||ft(e)},vt=U&&Re.length>0;vt=vt||(te?Oe.length>0:null!==Oe);var yt=qe;if(K){new Map;yt=qe.reduce(function(e,t,n){var r=K(t);return e.length>0&&e[e.length-1].group===r?e[e.length-1].options.push(t):e.push({key:n,index:n,group:r,options:[t]}),e},[])}return{getRootProps:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.A)({"aria-owns":Ve?"".concat(pe,"-popup"):null,role:"combobox","aria-expanded":Ve},e,{onKeyDown:ot(e),onMouseDown:pt,onClick:gt})},getInputLabelProps:function(){return{id:"".concat(pe,"-label"),htmlFor:pe}},getInputProps:function(){return{id:pe,value:Re,onBlur:st,onFocus:at,onChange:lt,onMouseDown:mt,"aria-activedescendant":Ve?"":null,"aria-autocomplete":n?"both":"list","aria-controls":Ve?"".concat(pe,"-popup"):null,autoComplete:"off",ref:ye,autoCapitalize:"none",spellCheck:"false"}},getClearProps:function(){return{tabIndex:-1,onClick:it}},getPopupIndicatorProps:function(){return{tabIndex:-1,onClick:ft}},getTagProps:function(e){var t=e.index;return{key:t,"data-tag-index":t,tabIndex:-1,onDelete:ht(t)}},getListboxProps:function(){return{role:"listbox",id:"".concat(pe,"-popup"),"aria-labelledby":"".concat(pe,"-label"),ref:Je,onMouseDown:function(e){e.preventDefault()}}},getOptionProps:function(e){var t=e.index,n=e.option,r=(te?Oe:[Oe]).some(function(e){return null!=e&&q(n,e)}),i=!!G&&G(n);return{key:t,tabIndex:-1,role:"option",id:"".concat(pe,"-option-").concat(t),onMouseOver:ct,onClick:dt,onTouchStart:ut,"data-option-index":t,"aria-disabled":i,"aria-selected":r}},id:pe,inputValue:Re,value:Oe,dirty:vt,popupOpen:Ve,focused:Fe||-1!==xe,anchorEl:Ae,setAnchorEl:_e,focusedTag:xe,groupedOptions:yt}}function D(e){e.anchorEl,e.open;var t=(0,r.A)(e,["anchorEl","open"]);return a.createElement("div",t)}var k=a.createElement(m.A,{fontSize:"small"}),T=a.createElement(v,null),O=a.forwardRef(function(e,t){e.autoComplete,e.autoHighlight,e.autoSelect,e.blurOnSelect;var n,i=e.ChipProps,l=e.classes,u=e.className,d=e.clearOnBlur,m=(void 0===d&&e.freeSolo,e.clearOnEscape,e.clearText),v=void 0===m?"Clear":m,y=e.closeIcon,b=void 0===y?k:y,w=e.closeText,A=void 0===w?"Close":w,_=(e.debug,e.defaultValue),C=(void 0===_&&e.multiple,e.disableClearable),x=void 0!==C&&C,E=(e.disableCloseOnSelect,e.disabled),O=void 0!==E&&E,I=(e.disabledItemsFocusable,e.disableListWrap,e.disablePortal),P=void 0!==I&&I,M=(e.filterOptions,e.filterSelectedOptions,e.forcePopupIcon),R=void 0===M?"auto":M,N=e.freeSolo,j=void 0!==N&&N,F=e.fullWidth,L=void 0!==F&&F,B=e.getLimitTagsText,z=void 0===B?function(e){return"+".concat(e)}:B,U=(e.getOptionDisabled,e.getOptionLabel),G=void 0===U?function(e){return e}:U,H=(e.getOptionSelected,e.groupBy),W=e.handleHomeEndKeys,V=(void 0===W&&e.freeSolo,e.id,e.includeInputInList,e.inputValue,e.limitTags),q=void 0===V?-1:V,K=e.ListboxComponent,Y=void 0===K?"ul":K,X=e.ListboxProps,Q=e.loading,J=void 0!==Q&&Q,Z=e.loadingText,$=void 0===Z?"Loading\u2026":Z,ee=e.multiple,te=void 0!==ee&&ee,ne=e.noOptionsText,re=void 0===ne?"No options":ne,ie=(e.onChange,e.onClose,e.onHighlightChange,e.onInputChange,e.onOpen,e.open,e.openOnFocus,e.openText),oe=void 0===ie?"Open":ie,ae=(e.options,e.PaperComponent),se=void 0===ae?f.A:ae,le=e.PopperComponent,ce=void 0===le?c.A:le,ue=e.popupIcon,de=void 0===ue?T:ue,he=e.renderGroup,fe=e.renderInput,pe=e.renderOption,ge=e.renderTags,me=e.selectOnFocus,ve=(void 0===me&&e.freeSolo,e.size),ye=void 0===ve?"medium":ve,be=(e.value,(0,r.A)(e,["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","classes","className","clearOnBlur","clearOnEscape","clearText","closeIcon","closeText","debug","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","getOptionSelected","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","value"])),we=P?D:ce,Ae=S((0,o.A)({},e,{componentName:"Autocomplete"})),_e=Ae.getRootProps,Ce=Ae.getInputProps,xe=Ae.getInputLabelProps,Ee=Ae.getPopupIndicatorProps,Se=Ae.getClearProps,De=Ae.getTagProps,ke=Ae.getListboxProps,Te=Ae.getOptionProps,Oe=Ae.value,Ie=Ae.dirty,Pe=Ae.id,Me=Ae.popupOpen,Re=Ae.focused,Ne=Ae.focusedTag,je=Ae.anchorEl,Fe=Ae.setAnchorEl,Le=Ae.inputValue,Be=Ae.groupedOptions;if(te&&Oe.length>0){var ze=function(e){return(0,o.A)({className:(0,s.default)(l.tag,"small"===ye&&l.tagSizeSmall),disabled:O},De(e))};n=ge?ge(Oe,ze):Oe.map(function(e,t){return a.createElement(g.A,(0,o.A)({label:G(e),size:ye},ze({index:t}),i))})}if(q>-1&&Array.isArray(n)){var Ue=n.length-q;!Re&&Ue>0&&(n=n.splice(0,q)).push(a.createElement("span",{className:l.tag,key:n.length},z(Ue)))}var Ge=he||function(e){return a.createElement("li",{key:e.key},a.createElement(h,{className:l.groupLabel,component:"div"},e.group),a.createElement("ul",{className:l.groupUl},e.children))},He=pe||G,We=function(e,t){var n=Te({option:e,index:t});return a.createElement("li",(0,o.A)({},n,{className:l.option}),He(e,{selected:n["aria-selected"],inputValue:Le}))},Ve=!x&&!O,qe=(!j||!0===R)&&!1!==R;return a.createElement(a.Fragment,null,a.createElement("div",(0,o.A)({ref:t,className:(0,s.default)(l.root,u,Re&&l.focused,L&&l.fullWidth,Ve&&l.hasClearIcon,qe&&l.hasPopupIcon)},_e(be)),fe({id:Pe,disabled:O,fullWidth:!0,size:"small"===ye?"small":void 0,InputLabelProps:xe(),InputProps:{ref:Fe,className:l.inputRoot,startAdornment:n,endAdornment:a.createElement("div",{className:l.endAdornment},Ve?a.createElement(p.A,(0,o.A)({},Se(),{"aria-label":v,title:v,className:(0,s.default)(l.clearIndicator,Ie&&l.clearIndicatorDirty)}),b):null,qe?a.createElement(p.A,(0,o.A)({},Ee(),{disabled:O,"aria-label":Me?A:oe,title:Me?A:oe,className:(0,s.default)(l.popupIndicator,Me&&l.popupIndicatorOpen)}),de):null)},inputProps:(0,o.A)({className:(0,s.default)(l.input,-1===Ne&&l.inputFocused),disabled:O},Ce())})),Me&&je?a.createElement(we,{className:(0,s.default)(l.popper,P&&l.popperDisablePortal),style:{width:je?je.clientWidth:null},role:"presentation",anchorEl:je,open:!0},a.createElement(se,{className:l.paper},J&&0===Be.length?a.createElement("div",{className:l.loading},$):null,0!==Be.length||j||J?null:a.createElement("div",{className:l.noOptions},re),Be.length>0?a.createElement(Y,(0,o.A)({className:l.listbox},ke(),X),Be.map(function(e,t){return H?Ge({key:e.key,group:e.group,children:e.options.map(function(t,n){return We(t,e.index+n)})}):We(e,t)})):null)):null)});const I=(0,l.A)(function(e){var t;return{root:{"&$focused $clearIndicatorDirty":{visibility:"visible"},"@media (pointer: fine)":{"&:hover $clearIndicatorDirty":{visibility:"visible"}}},fullWidth:{width:"100%"},focused:{},tag:{margin:3,maxWidth:"calc(100% - 6px)"},tagSizeSmall:{margin:2,maxWidth:"calc(100% - 4px)"},hasPopupIcon:{},hasClearIcon:{},inputRoot:{flexWrap:"wrap","$hasPopupIcon &, $hasClearIcon &":{paddingRight:30},"$hasPopupIcon$hasClearIcon &":{paddingRight:56},"& $input":{width:0,minWidth:30},'&[class*="MuiInput-root"]':{paddingBottom:1,"& $input":{padding:4},"& $input:first-child":{padding:"6px 0"}},'&[class*="MuiInput-root"][class*="MuiInput-marginDense"]':{"& $input":{padding:"4px 4px 5px"},"& $input:first-child":{padding:"3px 0 6px"}},'&[class*="MuiOutlinedInput-root"]':{padding:9,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9.5px 4px"},"& $input:first-child":{paddingLeft:6},"& $endAdornment":{right:9}},'&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]':{padding:6,"& $input":{padding:"4.5px 4px"}},'&[class*="MuiFilledInput-root"]':{paddingTop:19,paddingLeft:8,"$hasPopupIcon &, $hasClearIcon &":{paddingRight:39},"$hasPopupIcon$hasClearIcon &":{paddingRight:65},"& $input":{padding:"9px 4px"},"& $endAdornment":{right:9}},'&[class*="MuiFilledInput-root"][class*="MuiFilledInput-marginDense"]':{paddingBottom:1,"& $input":{padding:"4.5px 4px"}}},input:{flexGrow:1,textOverflow:"ellipsis",opacity:0},inputFocused:{opacity:1},endAdornment:{position:"absolute",right:0,top:"calc(50% - 14px)"},clearIndicator:{marginRight:-2,padding:4,visibility:"hidden"},clearIndicatorDirty:{},popupIndicator:{padding:2,marginRight:-2},popupIndicatorOpen:{transform:"rotate(180deg)"},popper:{zIndex:e.zIndex.modal},popperDisablePortal:{position:"absolute"},paper:(0,o.A)({},e.typography.body1,{overflow:"hidden",margin:"4px 0"}),listbox:{listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto"},loading:{color:e.palette.text.secondary,padding:"14px 16px"},noOptions:{color:e.palette.text.secondary,padding:"14px 16px"},option:(t={minHeight:48,display:"flex",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16},(0,i.A)(t,e.breakpoints.up("sm"),{minHeight:"auto"}),(0,i.A)(t,'&[aria-selected="true"]',{backgroundColor:e.palette.action.selected}),(0,i.A)(t,'&[data-focus="true"]',{backgroundColor:e.palette.action.hover}),(0,i.A)(t,"&:active",{backgroundColor:e.palette.action.selected}),(0,i.A)(t,'&[aria-disabled="true"]',{opacity:e.palette.action.disabledOpacity,pointerEvents:"none"}),t),groupLabel:{backgroundColor:e.palette.background.paper,top:-8},groupUl:{padding:0,"& $option":{paddingLeft:24}}}},{name:"MuiAutocomplete"})(O)},8970(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"};t.default=n},8988(e,t,n){"use strict";n.d(t,{w:()=>s});var r=n(64237),i=n(91693),o=n(68280),a=n(22995);function s(e){const{title:t,command:n}=e,{eventManager:s}=e.engine,l=e.storeNode.title,c=t&&i.k.any.test((0,r.pK)((0,r.yk)((0,r.yk)(t,a.jG))));let u=!1,d=n;if(n&&t&&n!==t&&!c&&((0,r.Ot)(n)===l?(d=n.replace(l,t),s.editCommand(e,d),u=!0):n===l&&(d=n.replace((0,r.Ot)(l),t),s.editCommand(e,d),u=!0)),u)return d;const h=t&&(o.$.withAssignmentPrefix().test(t)||o.$.withAssignmentPrefix(a.jG).test(t)),f=n===l&&!t;return(null===t||void 0===t?void 0:t.trim())!==(null===l||void 0===l?void 0:l.trim())&&n!==t&&(c||f||h)&&(d=t,s.editCommand(e,t)),d}},9047(e,t,n){"use strict";n.a(e,async(e,r)=>{try{n.d(t,{A:()=>v});var i=n(9950),o=n(29206),a=n(89288),s=n(63027),l=n(14566),c=n(87872),u=n(28379),d=n(21781),h=n(41355),f=n(73479),p=n(31540),g=n(44414),m=e([f,p]);[f,p]=m.then?(await m)():m;const v=()=>{const{formatMessage:e}=(0,a.A)(),{setState:t}=(0,h.A)(),[n,r]=(0,u.A)(f.fW,(0,p.k)());return(0,i.useEffect)(()=>{void 0!==n&&t({showGhosts:n})},[t,n]),(0,g.jsx)(o.A,{button:!0,onClick:e=>e.stopPropagation(),children:(0,g.jsx)(l.A,{labelPlacement:"end",title:e({id:"toolbarMenu.showGhosts.tooltip"}),control:(0,g.jsx)(c.A,{value:"unnecessary",color:"primary",checked:n,onChange:()=>r(!n),title:e({id:"toolbarMenu.showGhosts.tooltip"}),onClick:()=>(0,d.u4)({action:"toggleCardButtons",details:{showGhosts:!n}})}),label:(0,g.jsx)(s.A,{id:"toolbarMenu.showGhosts.label"})})})};r()}catch(v){r(v)}})},9070(e,t,n){"use strict";const r=n(43998);e.exports=(e,t)=>e.sort((e,n)=>r(n,e,t))},9175(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(50631);r.__exportStar(n(18862),t),r.__exportStar(n(43183),t),r.__exportStar(n(63543),t),r.__exportStar(n(41104),t),r.__exportStar(n(70945),t),r.__exportStar(n(94871),t),r.__exportStar(n(41277),t),r.__exportStar(n(33782),t),r.__exportStar(n(70768),t),r.__exportStar(n(57973),t),r.__exportStar(n(95338),t),r.__exportStar(n(7048),t),r.__exportStar(n(20390),t);var i=n(89852);Object.defineProperty(t,"PDFDocument",{enumerable:!0,get:function(){return i.default}});var o=n(15888);Object.defineProperty(t,"PDFFont",{enumerable:!0,get:function(){return o.default}});var a=n(70956);Object.defineProperty(t,"PDFImage",{enumerable:!0,get:function(){return a.default}});var s=n(31482);Object.defineProperty(t,"PDFPage",{enumerable:!0,get:function(){return s.default}});var l=n(99560);Object.defineProperty(t,"PDFEmbeddedPage",{enumerable:!0,get:function(){return l.default}});var c=n(3226);Object.defineProperty(t,"PDFJavaScript",{enumerable:!0,get:function(){return c.default}})},9282(e,t,n){"use strict";function r(e){return null==e||""===e?null:e}function i(e,t){return void 0===t&&(t=!1),null!=e&&(""!==e||t)}function o(e){return!i(e)}function a(e){return null==e||0===e.length}function s(e){return null!=e&&"function"===typeof e.toString?e.toString():null}function l(e){if(void 0!==e){if(null===e||""===e)return null;if("number"===typeof e)return isNaN(e)?void 0:e;var t=parseInt(e,10);return isNaN(t)?void 0:t}}function c(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"===typeof e?e:/true/i.test(e))}function u(e){if(e instanceof Set||e instanceof Map){var t=[];return e.forEach(function(e){return t.push(e)}),t}return Object.values(e)}n.r(t),n.d(t,{AbstractHeaderCellCtrl:()=>mu,AgAbstractField:()=>zi,AgAbstractLabel:()=>Li,AgCheckbox:()=>eo,AgDialog:()=>qh,AgGroupComponent:()=>Ah,AgInputNumberField:()=>ko,AgInputRange:()=>gh,AgInputTextArea:()=>fh,AgInputTextField:()=>So,AgMenuItemComponent:()=>Bh,AgMenuList:()=>Mh,AgMenuPanel:()=>jh,AgPanel:()=>Gh,AgPickerField:()=>Hi,AgPromise:()=>ri,AgPromiseStatus:()=>Jr,AgRadioButton:()=>no,AgSelect:()=>Xi,AgSlider:()=>yh,AgStackComponentsRegistry:()=>Bt,AgToggleButton:()=>dh,AlignedGridsService:()=>Af,AllCommunityModules:()=>lv,AnimateShowChangeCellRenderer:()=>ya,AnimateSlideCellRenderer:()=>Aa,AnimationFrameService:()=>Dd,AutoScrollService:()=>$s,AutoWidthCalculator:()=>Od,Autowired:()=>K,BarColumnLabelPlacement:()=>Bg,BaseComponentWrapper:()=>Jg,BaseCreator:()=>Vm,BaseGridSerializingSession:()=>qm,Bean:()=>q,BeanStub:()=>Le,Beans:()=>Cl,BodyDropPivotTarget:()=>Kc,BodyDropTarget:()=>$c,CHART_TOOLBAR_ALLOW_LIST:()=>em,CHART_TOOL_PANEL_ALLOW_LIST:()=>$g,CHART_TOOL_PANEL_MENU_OPTIONS:()=>tm,CellComp:()=>Lc,CellCtrl:()=>Rl,CellNavigationService:()=>vf,CellPositionUtils:()=>Yp,CellRangeType:()=>cl,ChangedPath:()=>Jd,CheckboxSelectionComponent:()=>Da,ClientSideRowModelModule:()=>Mm,ClientSideRowModelSteps:()=>ks,ColDefUtil:()=>He,Column:()=>ce,ColumnApi:()=>Tf,ColumnFactory:()=>Ge,ColumnGroup:()=>ct,ColumnKeyCreator:()=>h,ColumnModel:()=>Ot,ColumnUtils:()=>Mt,Component:()=>fi,ComponentUtil:()=>Je,Context:()=>G,CssClassApplier:()=>nu,CssClassManager:()=>ci,CsvCreator:()=>Zm,CsvExportModule:()=>nv,CtrlsService:()=>vg,CustomTooltipFeature:()=>li,DEFAULT_CHART_GROUPS:()=>Zg,DateFilter:()=>mo,DisplayedGroupCreator:()=>jt,Downloader:()=>Km,DragAndDropService:()=>Pa,DragService:()=>Is,DragSourceType:()=>Po,Environment:()=>Tp,EventService:()=>te,Events:()=>We,ExcelFactoryMode:()=>Ia,ExpressionService:()=>jf,FilterManager:()=>Bs,FloatingFilterMapper:()=>Cs,FocusService:()=>Zh,GROUP_AUTO_COLUMN_ID:()=>ft,Grid:()=>Xg,GridApi:()=>Ns,GridBodyComp:()=>Cc,GridBodyCtrl:()=>hl,GridComp:()=>Qf,GridCoreCreator:()=>Qg,GridCtrl:()=>Kf,GridHeaderComp:()=>ud,GridHeaderCtrl:()=>sd,GridOptionsService:()=>zg,GridSerializer:()=>tv,GroupCellRenderer:()=>Va,GroupCellRendererCtrl:()=>Ga,GroupInstanceIdCreator:()=>ut,HeaderCellCtrl:()=>Ru,HeaderFilterCellComp:()=>Ws,HeaderFilterCellCtrl:()=>Eu,HeaderGroupCellCtrl:()=>Hu,HeaderNavigationDirection:()=>du,HeaderNavigationService:()=>id,HeaderPositionUtils:()=>sg,HeaderRowComp:()=>hu,HeaderRowContainerComp:()=>td,HeaderRowContainerCtrl:()=>Zu,HeaderRowCtrl:()=>Ku,HeaderRowType:()=>Wc,HorizontalDirection:()=>Ro,HorizontalResizeService:()=>fd,InfiniteRowModelModule:()=>Wm,KeyCode:()=>zr,LargeTextCellEditor:()=>ca,LayoutCssClasses:()=>Rs,LocaleService:()=>Hg,Logger:()=>Wf,LoggerFactory:()=>Hf,ManagedFocusFeature:()=>Di,ModuleNames:()=>Z,ModuleRegistry:()=>re,MouseEventService:()=>Tc,MoveColumnFeature:()=>Qc,NavigationService:()=>Mc,NumberFilter:()=>No,NumberSequence:()=>ti,Optional:()=>Y,PaginationProxy:()=>ah,PinnedRowModel:()=>Xd,PopupComponent:()=>aa,PopupEditorWrapper:()=>jc,PopupService:()=>af,PositionableFeature:()=>Pi,PostConstruct:()=>W,PreConstruct:()=>H,PreDestroy:()=>V,PropertyKeys:()=>Ke,ProvidedColumnGroup:()=>de,ProvidedFilter:()=>Ni,Qualifier:()=>Q,QuerySelector:()=>pi,RefSelector:()=>gi,ResizeObserverService:()=>xd,RowAnimationCssClasses:()=>Ks,RowContainerComp:()=>Vc,RowContainerCtrl:()=>bc,RowContainerName:()=>Bl,RowContainerType:()=>zl,RowCtrl:()=>Gl,RowHighlightPosition:()=>Ds,RowNode:()=>Ca,RowNodeBlock:()=>$d,RowNodeBlockLoader:()=>rh,RowNodeSorter:()=>pg,RowPositionUtils:()=>Vp,RowRenderer:()=>Gd,RowType:()=>hm,ScalarFilter:()=>co,ScrollVisibleService:()=>Sc,SelectCellEditor:()=>ha,SelectableService:()=>jp,SelectionHandleType:()=>ll,ServerSideTransactionResultStatus:()=>Ad,SetLeftFeature:()=>bu,SimpleFilter:()=>so,SortController:()=>tp,SortIndicatorComp:()=>Zo,StandardMenuFactory:()=>md,StylingService:()=>ch,TabGuardClassNames:()=>Qd,TabGuardComp:()=>Th,TabGuardCtrl:()=>Eh,TabbedLayout:()=>bd,TemplateService:()=>Bf,TextCellEditor:()=>ga,TextFilter:()=>Bo,TextFloatingFilter:()=>Yo,Timer:()=>ii,TouchListener:()=>Xo,UserComponentFactory:()=>Ss,UserComponentRegistry:()=>os,ValueCache:()=>fp,ValueFormatterService:()=>qd,ValueService:()=>Pf,VanillaFrameworkOverrides:()=>hf,VerticalDirection:()=>Mo,VirtualList:()=>cf,XmlFactory:()=>iv,ZipContainer:()=>sv,_:()=>ei,__FORCE_MODULE_DETECTION:()=>nm,getRowContainerTypeForName:()=>gc,simpleHttpRequest:()=>wd});var d=Object.freeze({__proto__:null,makeNull:r,exists:i,missing:o,missingOrEmpty:a,toStringOrNull:s,attrToNumber:l,attrToBoolean:c,attrToString:function(e){if(null!=e&&""!==e)return e},referenceCompare:function(e,t){return null==e&&null==t||(null!=e||null==t)&&((null==e||null!=t)&&e===t)},jsonEquals:function(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)},defaultComparator:function(e,t,n){void 0===n&&(n=!1);var r=null==e,i=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),r&&i)return 0;if(r)return-1;if(i)return 1;function o(e,t){return e>t?1:e=0)){var i=n[e],o=x(i)&&i.constructor===Object;r[e]=o?g(i):i}}),r}}function m(e,t){return e[t]}function v(e,t,n){e[t]=n}function y(e,t,n,r){var i=m(e,n);void 0!==i&&v(t,n,r?r(i):i)}function b(e){var t={};return e.filter(function(e){return null!=e}).forEach(function(e){Object.keys(e).forEach(function(e){return t[e]=null})}),Object.keys(t)}function w(e){if(!e)return[];var t=Object;if("function"===typeof t.values)return t.values(e);var n=[];for(var r in e)e.hasOwnProperty(r)&&e.propertyIsEnumerable(r)&&n.push(e[r]);return n}function A(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1),i(t)&&f(t,function(t,i){var o=e[t];if(o!==i){if(r)if(null==o&&null!=i)"object"===typeof i&&i.constructor===Object&&(o={},e[t]=o);x(i)&&x(o)&&!Array.isArray(o)?A(o,i,n,r):(n||void 0!==i)&&(e[t]=i)}})}function _(e,t,n){if(t&&e){if(!n)return e[t];for(var r=t.split("."),i=e,o=0;o1;)if(null==(i=i[r.shift()]))return n;var o=i[r[0]];return null!=o?o:n},set:function(e,t,n){if(null!=e){var r=t.split("."),i=e;r.forEach(function(e,t){i[e]||(i[e]={}),t0&&window.setTimeout(function(){return e.forEach(function(e){return e()})},t)}function N(e,t){var n;return function(){for(var r=[],i=0;in;(e()||s)&&(t(),a=!0,null!=o&&(window.clearInterval(o),o=null),s&&r&&console.warn(r))};s(),a||(o=window.setInterval(s,10))}function L(e){e&&e()}var B=Object.freeze({__proto__:null,doOnce:D,getFunctionName:k,isFunction:T,executeInAWhile:O,executeNextVMTurn:M,executeAfter:R,debounce:N,throttle:j,waitUntil:F,compose:function(){for(var e=[],t=0;t0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},U=function(){for(var e=[],t=0;t> creating ag-Application Context"),this.createBeans();var n=this.getBeanInstances();this.wireBeans(n),this.logger.log(">> ag-Application Context ready - component is alive")}}return e.prototype.getBeanInstances=function(){return u(this.beanWrappers).map(function(e){return e.beanInstance})},e.prototype.createBean=function(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e},e.prototype.wireBeans=function(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),i(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")},e.prototype.createBeans=function(){var e=this;this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),f(this.beanWrappers,function(t,n){var r;n.bean.__agBeanMetaData&&n.bean.__agBeanMetaData.autowireMethods&&n.bean.__agBeanMetaData.autowireMethods.agConstructor&&(r=n.bean.__agBeanMetaData.autowireMethods.agConstructor);var i=e.getBeansForParameters(r,n.bean.name),o=new(n.bean.bind.apply(n.bean,U([null],i)));n.beanInstance=o});var t=Object.keys(this.beanWrappers).join(", ");this.logger.log("created beans: "+t)},e.prototype.createBeanWrapper=function(e){var t=e.__agBeanMetaData;if(!t){var n=void 0;return n=e.prototype.constructor?k(e.prototype.constructor):""+e,void console.error("Context item "+n+" is not a bean")}var r={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=r},e.prototype.autoWireBeans=function(e){var t=this;e.forEach(function(e){t.forEachMetaDataInHierarchy(e,function(n,r){var i=n.agClassAttributes;i&&i.forEach(function(n){var i=t.lookupBeanInstance(r,n.beanName,n.optional);e[n.attributeName]=i})})})},e.prototype.methodWireBeans=function(e){var t=this;e.forEach(function(e){t.forEachMetaDataInHierarchy(e,function(n,r){f(n.autowireMethods,function(n,i){if("agConstructor"!==n){var o=t.getBeansForParameters(i,r);e[n].apply(e,o)}})})})},e.prototype.forEachMetaDataInHierarchy=function(e,t){for(var n=Object.getPrototypeOf(e);null!=n;){var r=n.constructor;if(r.hasOwnProperty("__agBeanMetaData"))t(r.__agBeanMetaData,this.getBeanName(r));n=Object.getPrototypeOf(n)}},e.prototype.getBeanName=function(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;var t=e.toString();return t.substring(9,t.indexOf("("))},e.prototype.getBeansForParameters=function(e,t){var n=this,r=[];return e&&f(e,function(e,i){var o=n.lookupBeanInstance(t,i);r[Number(e)]=o}),r},e.prototype.lookupBeanInstance=function(e,t,n){if(void 0===n&&(n=!1),"context"===t)return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];var r=this.beanWrappers[t];return r?r.beanInstance:(n||console.error("AG Grid: unable to find bean reference "+t+" while initialising "+e),null)},e.prototype.callLifeCycleMethods=function(e,t){var n=this;e.forEach(function(e){return n.callLifeCycleMethodsOnBean(e,t)})},e.prototype.callLifeCycleMethodsOnBean=function(e,t,n){var r={};this.forEachMetaDataInHierarchy(e,function(e){var i=e[t];i&&i.forEach(function(e){e!=n&&(r[e]=!0)})}),Object.keys(r).forEach(function(t){return e[t]()})},e.prototype.getBean=function(e){return this.lookupBeanInstance("getBean",e,!0)},e.prototype.destroy=function(){if(!this.destroyed){this.logger.log(">> Shutting down ag-Application Context");var e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,this.destroyed=!0,this.logger.log(">> ag-Application Context shut down - component is dead")}},e.prototype.destroyBean=function(e){e&&this.destroyBeans([e])},e.prototype.destroyBeans=function(e){var t=this;return e?(e.forEach(function(e){t.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");var n=e;"function"===typeof n.destroy&&n.destroy()}),[]):[]},e}();function H(e,t,n){var r=J(e.constructor);r.preConstructMethods||(r.preConstructMethods=[]),r.preConstructMethods.push(t)}function W(e,t,n){var r=J(e.constructor);r.postConstructMethods||(r.postConstructMethods=[]),r.postConstructMethods.push(t)}function V(e,t,n){var r=J(e.constructor);r.preDestroyMethods||(r.preDestroyMethods=[]),r.preDestroyMethods.push(t)}function q(e){return function(t){J(t).beanName=e}}function K(e){return function(t,n,r){X(t,e,!1,t,n,null)}}function Y(e){return function(t,n,r){X(t,e,!0,t,n,null)}}function X(e,t,n,r,i,o){if(null!==t)if("number"!==typeof o){var a=J(e.constructor);a.agClassAttributes||(a.agClassAttributes=[]),a.agClassAttributes.push({attributeName:i,beanName:t,optional:n})}else console.error("AG Grid: Autowired should be on an attribute");else console.error("AG Grid: Autowired name should not be null")}function Q(e){return function(t,n,r){var i,o="function"==typeof t?t:t.constructor;if("number"===typeof r){var a=void 0;n?(i=J(o),a=n):(i=J(o),a="agConstructor"),i.autowireMethods||(i.autowireMethods={}),i.autowireMethods[a]||(i.autowireMethods[a]={}),i.autowireMethods[a][r]=e}}}function J(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var Z,$=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},ee=function(e,t){return function(n,r){t(n,r,e)}},te=function(){function e(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}return e.prototype.setBeans=function(e,t,n,r){if(void 0===r&&(r=null),this.frameworkOverrides=n,this.gridOptionsService=t,r){var i=t.useAsyncEvents();this.addGlobalListener(r,i)}},e.prototype.getListeners=function(e,t,n){var r=t?this.allAsyncListeners:this.allSyncListeners,i=r.get(e);return!i&&n&&(i=new Set,r.set(e,i)),i},e.prototype.noRegisteredListenersExist=function(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size},e.prototype.addEventListener=function(e,t,n){void 0===n&&(n=!1),this.getListeners(e,n,!0).add(t)},e.prototype.removeEventListener=function(e,t,n){void 0===n&&(n=!1);var r=this.getListeners(e,n,!1);r&&(r.delete(t),0===r.size&&(n?this.allAsyncListeners:this.allSyncListeners).delete(e))},e.prototype.addGlobalListener=function(e,t){void 0===t&&(t=!1),(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)},e.prototype.removeGlobalListener=function(e,t){void 0===t&&(t=!1),(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)},e.prototype.dispatchEvent=function(e){var t=e;if(this.gridOptionsService){var n=this.gridOptionsService,r=n.api,i=n.columnApi,o=n.context;t.api=r,t.columnApi=i,t.context=o}this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0},e.prototype.dispatchEventOnce=function(e){this.firedEvents[e.type]||this.dispatchEvent(e)},e.prototype.dispatchToListeners=function(e,t){var n=this,r=e.type;if(t&&"event"in e){var i=e.event;i instanceof Event&&(e.eventPath=i.composedPath())}var o=this.getListeners(r,t,!1);o&&function(r){r.forEach(function(r){t?n.dispatchAsync(function(){return r(e)}):r(e)})}(o),(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(function(i){t?n.dispatchAsync(function(){return n.frameworkOverrides.dispatchEvent(r,function(){return i(r,e)},!0)}):n.frameworkOverrides.dispatchEvent(r,function(){return i(r,e)},!0)})},e.prototype.dispatchAsync=function(e){this.asyncFunctionsQueue.push(e),this.scheduled||(window.setTimeout(this.flushAsyncQueue.bind(this),0),this.scheduled=!0)},e.prototype.flushAsyncQueue=function(){this.scheduled=!1;var e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(function(e){return e()})},$([ee(0,Q("loggerFactory")),ee(1,Q("gridOptionsService")),ee(2,Q("frameworkOverrides")),ee(3,Q("globalEventListener"))],e.prototype,"setBeans",null),e=$([q("eventService")],e)}();!function(e){e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue"}(Z||(Z={}));var ne=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},re=function(){function e(){}return e.register=function(t,n){void 0===n&&(n=!0),e.runVersionChecks(t),e.modulesMap[t.moduleName]=t,e.setModuleBased(n)},e.runVersionChecks=function(t){if(e.currentModuleVersion||(e.currentModuleVersion=t.version),t.version?t.version!==e.currentModuleVersion&&console.error("AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '"+t.moduleName+"' is version "+t.version+" but the other modules are version "+this.currentModuleVersion+". Please update all modules to the same version."):console.error("AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '"+t.moduleName+"' is incompatible. Please update all modules to the same version."),t.validate){var n=t.validate();if(!n.isValid){var r=n;console.error("AG Grid: "+r.message)}}},e.setModuleBased=function(t){void 0===e.moduleBased?e.moduleBased=t:e.moduleBased!==t&&D(function(){console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.")},"ModulePackageCheck")},e.setIsBundled=function(){e.isBundled=!0},e.registerModules=function(t,n){void 0===n&&(n=!0),e.setModuleBased(n),t&&t.forEach(function(t){return e.register(t,n)})},e.assertRegistered=function(t,n){var r;if(this.isRegistered(t))return!0;var i,o=n+t;if(e.isBundled)i="AG Grid: unable to use "+n+" as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n