1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-Cuc-5p49.js","assets/index-CUo2Tirx.js","assets/toPropertyKey-CFsua-KE.js","assets/MaintenancePage-CVJEKA5a.js","assets/Refresh-DDMKAR3P.js","assets/Logout-CEpstN-Y.js","assets/MaintenancePage-CsD7pRAw.css","assets/LoginPage-BIGnoOSz.js","assets/recaptcha-wrapper-BK1xbzhu.js","assets/yup-B5Yo-o3E.js","assets/ForceLightThemeWrapper-CkA5k2RC.js","assets/usePageMeta-CZHhmSkN.js","assets/connectorCache-BHNgCWT0.js","assets/Shield-DLRg4mWZ.js","assets/Groups-BUlxH3UV.js","assets/VisibilityOff-DJt8bZfq.js","assets/RegisterPage-DPByorHF.js","assets/TermsAcceptanceModal-WFLwB1WI.js","assets/ForgotPasswordPage-CilBbmhk.js","assets/TermsAcceptancePage-DKLyMAkS.js","assets/SSOCallbackPage-BM9g01v4.js","assets/RegistrationPendingPage-83GsQvIe.js","assets/PrivacyPolicyPage-DqBNl2ts.js","assets/TermsAndConditionsPage-DSt1AQRD.js","assets/ResetPasswordPage-C2ycFvCS.js","assets/ActivateAccountPage-XVGO6d1l.js","assets/SubscriptionPage-DVSyhzXL.js","assets/ConfirmModal-nuLT2pI7.js","assets/PaymentStatusBanner-DMLqI3kZ.js","assets/Error-DOUOnYoR.js","assets/Info-opUjpT7D.js","assets/BuyLicensesModal-CKIXgeEF.js","assets/LicenseManagementCard-BCWY6b7r.js","assets/People-DwJN5SKG.js","assets/Schedule-DBstKEAf.js","assets/useSSOReturn-BMj-wOkI.js","assets/Email-B-EQPCmW.js","assets/Receipt-Bgq_9uGz.js","assets/TableRow-9gjRckDd.js","assets/TableCell-DfxL2RBp.js","assets/SubscriptionPage-B9MxwIGx.css","assets/SignupLandingPage-Dxz9bgyo.js","assets/SignupLandingPage-DkHsU6B2.css","assets/SubmitTicketPage-DITTiX7E.js","assets/supportTicketService-TeXB9_D_.js","assets/HelpCenterPage-BggeF3Nt.js","assets/Search-Wir2dm8g.js","assets/ArrowBack-Bgl0YfgG.js","assets/Day10SurveyPage-C9GJJvdL.js","assets/DocumentRepositoryPage-CRro1Fnf.js","assets/StatusChip-CvbfU57k.js","assets/connectorService-BmY8r5Ol.js","assets/tslib.es6-DlsG3fhb.js","assets/StorageOutlined-BrARtedv.js","assets/FilterAltOff-D_3g5g8i.js","assets/DataGrid-BPOLoVru.js","assets/TablePagination-DONDvv8M.js","assets/Skeleton-C2y_-EDv.js","assets/PendingApprovalsPage-XZ_59b4u.js","assets/mermaid-VLURNSYL-BvLj-jQm.js","assets/AgentsPage-bmYmS_dl.js","assets/Edit-CwOv4mdk.js","assets/HelpOutline-gdgNIZO1.js","assets/SmartToy-Bubj-hnz.js","assets/DeleteOutline-s5_xo1Kj.js","assets/TableChart-CkJ9wfQS.js","assets/mermaid-VLURNSYL-BNKAyNQM.css","assets/AgentSchedulesPage-Dsjh1BCw.js","assets/Stepper-mFa_DSId.js","assets/GroupsPage-CTq7XBnX.js","assets/GroupsPage-BVnRLOh8.js","assets/FolderOpen-DqwxwhLY.js","assets/GroupsPage-l4HjfB4E.css","assets/FavoritesPage-5YgK8u9Y.js","assets/AnalyticsPage-689VsFEm.js","assets/AdminPage-Da89_1h3.js","assets/CartesianChart-BUBd117y.js","assets/string-CFAj4M3K.js","assets/band-CquvqAHh.js","assets/init-Dmth1JHB.js","assets/ordinal-DILIJJjt.js","assets/linear-D46_WQBj.js","assets/defaultLocale-DX6XiGOO.js","assets/time-23G67QG0.js","assets/dialogUtils-DH61ywrr.js","assets/index--At4erA0.js","assets/Link-CNIoTDoB.js","assets/WifiTethering-gtP2JkIg.js","assets/index-DJ4Inw1b.js","assets/Save-KJNvX_VL.js","assets/index-BajrOQdV.js","assets/Cloud-Cg8QhBlh.js","assets/index-DMaFcGef.js","assets/index-9n2ma_x-.js","assets/AdminPage-BWnZ2N2U.css","assets/PlatformAdmin-Ds6RTEus.js","assets/Person-COeQimV8.js","assets/ProfilePage-B7zYNYT9.js","assets/ProfilePage-abaq3AfT.css","assets/BillingSettingsPage-BXumvqbE.js"])))=>i.map(i=>d[i]); 2var Gd=Object.defineProperty;var Cu=Ee=>{throw TypeError(Ee)};var qd=(Ee,Re,Te)=>Re in Ee?Gd(Ee,Re,{enumerable:!0,configurable:!0,writable:!0,value:Te}):Ee[Re]=Te;var Es=(Ee,Re,Te)=>qd(Ee,typeof Re!="symbol"?Re+"":Re,Te),ac=(Ee,Re,Te)=>Re.has(Ee)||Cu("Cannot "+Te);var Pr=(Ee,Re,Te)=>(ac(Ee,Re,"read from private field"),Te?Te.call(Ee):Re.get(Ee)),Pn=(Ee,Re,Te)=>Re.has(Ee)?Cu("Cannot add the same private member more than once"):Re instanceof WeakSet?Re.add(Ee):Re.set(Ee,Te),kn=(Ee,Re,Te,je)=>(ac(Ee,Re,"write to private field"),je?je.call(Ee,Te):Re.set(Ee,Te),Te),vn=(Ee,Re,Te)=>(ac(Ee,Re,"access private method"),Te);var Ka=(Ee,Re,Te,je)=>({set _(Oe){kn(Ee,Re,Oe,Te)},get _(){return Pr(Ee,Re,je)}});import{r as reactExports,l as React$2,g as getDefaultExportFromCjs,j as jsxRuntimeExports,m as getAugmentedNamespace,R as React$3,n as ReactDOM,k as reactDomExports,c as commonjsGlobal,M as Markdown,a as remarkGfm,b as client}from"./index-CUo2Tirx.js";const scriptRel="modulepreload",assetsURL=function(Ee){return"/"+Ee},seen={},__vitePreload=function(Re,Te,je){let Oe=Promise.resolve();if(Te&&Te.length>0){document.getElementsByTagName("link");const De=document.querySelector("meta[property=csp-nonce]"),$e=(De==null?void 0:De.nonce)||(De==null?void 0:De.getAttribute("nonce"));Oe=Promise.allSettled(Te.map(Be=>{if(Be=assetsURL(Be),Be in seen)return;seen[Be]=!0;const Ue=Be.endsWith(".css"),ze=Ue?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${Be}"]${ze}`))return;const We=document.createElement("link");if(We.rel=Ue?"stylesheet":scriptRel,Ue||(We.as="script"),We.crossOrigin="",We.href=Be,$e&&We.setAttribute("nonce",$e),document.head.appendChild(We),Ue)return new Promise((Xe,He)=>{We.addEventListener("load",Xe),We.addEventListener("error",()=>He(new Error(`Unable to preload CSS for ${Be}`)))})}))}function Me(De){const $e=new Event("vite:preloadError",{cancelable:!0});if($e.payload=De,window.dispatchEvent($e),!$e.defaultPrevented)throw De}return Oe.then(De=>{for(const $e of De||[])$e.status==="rejected"&&Me($e.reason);return Re().catch(Me)})};/** 3 * @remix-run/router v1.23.2 4 * 5 * Copyright (c) Remix Software Inc. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE.md file in the root directory of this source tree. 9 * 10 * @license MIT 11 */function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(Ee){for(var Re=1;Re<arguments.length;Re++){var Te=arguments[Re];for(var je in Te)Object.prototype.hasOwnProperty.call(Te,je)&&(Ee[je]=Te[je])}return Ee},_extends$4.apply(this,arguments)}var Action;(function(Ee){Ee.Pop="POP",Ee.Push="PUSH",Ee.Replace="REPLACE"})(Action||(Action={}));const PopStateEventType="popstate";function createBrowserHistory(Ee){Ee===void 0&&(Ee={});function Re(je,Oe){let{pathname:Me,search:De,hash:$e}=je.location;return createLocation("",{pathname:Me,search:De,hash:$e},Oe.state&&Oe.state.usr||null,Oe.state&&Oe.state.key||"default")}function Te(je,Oe){return typeof Oe=="string"?Oe:createPath(Oe)}return getUrlBasedHistory(Re,Te,null,Ee)}function invariant$1(Ee,Re){if(Ee===!1||Ee===null||typeof Ee>"u")throw new Error(Re)}function warning$2(Ee,Re){if(!Ee){typeof console<"u"&&console.warn(Re);try{throw new Error(Re)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(Ee,Re){return{usr:Ee.state,key:Ee.key,idx:Re}}function createLocation(Ee,Re,Te,je){return Te===void 0&&(Te=null),_extends$4({pathname:typeof Ee=="string"?Ee:Ee.pathname,search:"",hash:""},typeof Re=="string"?parsePath(Re):Re,{state:Te,key:Re&&Re.key||je||createKey()})}
vendor: 11,613 bytes, lines 11-20
11function createPath(Ee){let{pathname:Re="/",search:Te="",hash:je=""}=Ee;return Te&&Te!=="?"&&(Re+=Te.charAt(0)==="?"?Te:"?"+Te),je&&je!=="#"&&(Re+=je.charAt(0)==="#"?je:"#"+je),Re}function parsePath(Ee){let Re={};if(Ee){let Te=Ee.indexOf("#");Te>=0&&(Re.hash=Ee.substr(Te),Ee=Ee.substr(0,Te));let je=Ee.indexOf("?");je>=0&&(Re.search=Ee.substr(je),Ee=Ee.substr(0,je)),Ee&&(Re.pathname=Ee)}return Re}function getUrlBasedHistory(Ee,Re,Te,je){je===void 0&&(je={});let{window:Oe=document.defaultView,v5Compat:Me=!1}=je,De=Oe.history,$e=Action.Pop,Be=null,Ue=ze();Ue==null&&(Ue=0,De.replaceState(_extends$4({},De.state,{idx:Ue}),""));function ze(){return(De.state||{idx:null}).idx}function We(){$e=Action.Pop;let Ye=ze(),Ve=Ye==null?null:Ye-Ue;Ue=Ye,Be&&Be({action:$e,location:Ge.location,delta:Ve})}function Xe(Ye,Ve){$e=Action.Push;let Ke=createLocation(Ge.location,Ye,Ve);Ue=ze()+1;let Qe=getHistoryState(Ke,Ue),Ze=Ge.createHref(Ke);try{De.pushState(Qe,"",Ze)}catch(Je){if(Je instanceof DOMException&&Je.name==="DataCloneError")throw Je;Oe.location.assign(Ze)}Me&&Be&&Be({action:$e,location:Ge.location,delta:1})}function He(Ye,Ve){$e=Action.Replace;let Ke=createLocation(Ge.location,Ye,Ve);Ue=ze();let Qe=getHistoryState(Ke,Ue),Ze=Ge.createHref(Ke);De.replaceState(Qe,"",Ze),Me&&Be&&Be({action:$e,location:Ge.location,delta:0})}function qe(Ye){let Ve=Oe.location.origin!=="null"?Oe.location.origin:Oe.location.href,Ke=typeof Ye=="string"?Ye:createPath(Ye);return Ke=Ke.replace(/ $/,"%20"),invariant$1(Ve,"No window.location.(origin|href) available to create URL for href: "+Ke),new URL(Ke,Ve)}let Ge={get action(){return $e},get location(){return Ee(Oe,De)},listen(Ye){if(Be)throw new Error("A history only accepts one active listener");return Oe.addEventListener(PopStateEventType,We),Be=Ye,()=>{Oe.removeEventListener(PopStateEventType,We),Be=null}},createHref(Ye){return Re(Oe,Ye)},createURL:qe,encodeLocation(Ye){let Ve=qe(Ye);return{pathname:Ve.pathname,search:Ve.search,hash:Ve.hash}},push:Xe,replace:He,go(Ye){return De.go(Ye)}};return Ge}var ResultType;(function(Ee){Ee.data="data",Ee.deferred="deferred",Ee.redirect="redirect",Ee.error="error"})(ResultType||(ResultType={}));function matchRoutes(Ee,Re,Te){return Te===void 0&&(Te="/"),matchRoutesImpl(Ee,Re,Te)}function matchRoutesImpl(Ee,Re,Te,je){let Oe=typeof Re=="string"?parsePath(Re):Re,Me=stripBasename(Oe.pathname||"/",Te);if(Me==null)return null;let De=flattenRoutes(Ee);rankRouteBranches(De);let $e=null;for(let Be=0;$e==null&&Be<De.length;++Be){let Ue=decodePath(Me);$e=matchRouteBranch(De[Be],Ue)}return $e}function flattenRoutes(Ee,Re,Te,je){Re===void 0&&(Re=[]),Te===void 0&&(Te=[]),je===void 0&&(je="");let Oe=(Me,De,$e)=>{let Be={relativePath:$e===void 0?Me.path||"":$e,caseSensitive:Me.caseSensitive===!0,childrenIndex:De,route:Me};Be.relativePath.startsWith("/")&&(invariant$1(Be.relativePath.startsWith(je),'Absolute route path "'+Be.relativePath+'" nested under path '+('"'+je+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),Be.relativePath=Be.relativePath.slice(je.length));let Ue=joinPaths([je,Be.relativePath]),ze=Te.concat(Be);Me.children&&Me.children.length>0&&(invariant$1(Me.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+Ue+'".')),flattenRoutes(Me.children,Re,ze,Ue)),!(Me.path==null&&!Me.index)&&Re.push({path:Ue,score:computeScore(Ue,Me.index),routesMeta:ze})};return Ee.forEach((Me,De)=>{var $e;if(Me.path===""||!(($e=Me.path)!=null&&$e.includes("?")))Oe(Me,De);else for(let Be of explodeOptionalSegments(Me.path))Oe(Me,De,Be)}),Re}function explodeOptionalSegments(Ee){let Re=Ee.split("/");if(Re.length===0)return[];let[Te,...je]=Re,Oe=Te.endsWith("?"),Me=Te.replace(/\?$/,"");if(je.length===0)return Oe?[Me,""]:[Me];let De=explodeOptionalSegments(je.join("/")),$e=[];return $e.push(...De.map(Be=>Be===""?Me:[Me,Be].join("/"))),Oe&&$e.push(...De),$e.map(Be=>Ee.startsWith("/")&&Be===""?"/":Be)}function rankRouteBranches(Ee){Ee.sort((Re,Te)=>Re.score!==Te.score?Te.score-Re.score:compareIndexes(Re.routesMeta.map(je=>je.childrenIndex),Te.routesMeta.map(je=>je.childrenIndex)))}const paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=Ee=>Ee==="*";function computeScore(Ee,Re){let Te=Ee.split("/"),je=Te.length;return Te.some(isSplat)&&(je+=splatPenalty),Re&&(je+=indexRouteValue),Te.filter(Oe=>!isSplat(Oe)).reduce((Oe,Me)=>Oe+(paramRe.test(Me)?dynamicSegmentValue:Me===""?emptySegmentValue:staticSegmentValue),je)}function compareIndexes(Ee,Re){return Ee.length===Re.length&&Ee.slice(0,-1).every((je,Oe)=>je===Re[Oe])?Ee[Ee.length-1]-Re[Re.length-1]:0}function matchRouteBranch(Ee,Re,Te){let{routesMeta:je}=Ee,Oe={},Me="/",De=[];for(let $e=0;$e<je.length;++$e){let Be=je[$e],Ue=$e===je.length-1,ze=Me==="/"?Re:Re.slice(Me.length)||"/",We=matchPath({path:Be.relativePath,caseSensitive:Be.caseSensitive,end:Ue},ze),Xe=Be.route;if(!We)return null;Object.assign(Oe,We.params),De.push({params:Oe,pathname:joinPaths([Me,We.pathname]),pathnameBase:normalizePathname(joinPaths([Me,We.pathnameBase])),route:Xe}),We.pathnameBase!=="/"&&(Me=joinPaths([Me,We.pathnameBase]))}return De}function matchPath(Ee,Re){typeof Ee=="string"&&(Ee={path:Ee,caseSensitive:!1,end:!0});let[Te,je]=compilePath(Ee.path,Ee.caseSensitive,Ee.end),Oe=Re.match(Te);if(!Oe)return null;let Me=Oe[0],De=Me.replace(/(.)\/+$/,"$1"),$e=Oe.slice(1);return{params:je.reduce((Ue,ze,We)=>{let{paramName:Xe,isOptional:He}=ze;if(Xe==="*"){let Ge=$e[We]||"";De=Me.slice(0,Me.length-Ge.length).replace(/(.)\/+$/,"$1")}const qe=$e[We];return He&&!qe?Ue[Xe]=void 0:Ue[Xe]=(qe||"").replace(/%2F/g,"/"),Ue},{}),pathname:Me,pathnameBase:De,pattern:Ee}}function compilePath(Ee,Re,Te){Re===void 0&&(Re=!1),Te===void 0&&(Te=!0),warning$2(Ee==="*"||!Ee.endsWith("*")||Ee.endsWith("/*"),'Route path "'+Ee+'" will be treated as if it were '+('"'+Ee.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+Ee.replace(/\*$/,"/*")+'".'));let je=[],Oe="^"+Ee.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(De,$e,Be)=>(je.push({paramName:$e,isOptional:Be!=null}),Be?"/?([^\\/]+)?":"/([^\\/]+)"));return Ee.endsWith("*")?(je.push({paramName:"*"}),Oe+=Ee==="*"||Ee==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):Te?Oe+="\\/*$":Ee!==""&&Ee!=="/"&&(Oe+="(?:(?=\\/|$))"),[new RegExp(Oe,Re?void 0:"i"),je]}function decodePath(Ee){try{return Ee.split("/").map(Re=>decodeURIComponent(Re).replace(/\//g,"%2F")).join("/")}catch(Re){return warning$2(!1,'The URL path "'+Ee+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+Re+").")),Ee}}function stripBasename(Ee,Re){if(Re==="/")return Ee;if(!Ee.toLowerCase().startsWith(Re.toLowerCase()))return null;let Te=Re.endsWith("/")?Re.length-1:Re.length,je=Ee.charAt(Te);return je&&je!=="/"?null:Ee.slice(Te)||"/"}const ABSOLUTE_URL_REGEX$1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,isAbsoluteUrl=Ee=>ABSOLUTE_URL_REGEX$1.test(Ee);function resolvePath$1(Ee,Re){Re===void 0&&(Re="/");let{pathname:Te,search:je="",hash:Oe=""}=typeof Ee=="string"?parsePath(Ee):Ee,Me;if(Te)if(isAbsoluteUrl(Te))Me=Te;else{if(Te.includes("//")){let De=Te;Te=Te.replace(/\/\/+/g,"/"),warning$2(!1,"Pathnames cannot have embedded double slashes - normalizing "+(De+" -> "+Te))}Te.startsWith("/")?Me=resolvePathname(Te.substring(1),"/"):Me=resolvePathname(Te,Re)}else Me=Re;return{pathname:Me,search:normalizeSearch(je),hash:normalizeHash(Oe)}}function resolvePathname(Ee,Re){let Te=Re.replace(/\/+$/,"").split("/");return Ee.split("/").forEach(Oe=>{Oe===".."?Te.length>1&&Te.pop():Oe!=="."&&Te.push(Oe)}),Te.length>1?Te.join("/"):"/"}function getInvalidPathError(Ee,Re,Te,je){return"Cannot include a '"+Ee+"' character in a manually specified "+("`to."+Re+"` field ["+JSON.stringify(je)+"]. Please separate it out to the ")+("`to."+Te+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function getPathContributingMatches(Ee){return Ee.filter((Re,Te)=>Te===0||Re.route.path&&Re.route.path.length>0)}function getResolveToMatches(Ee,Re){let Te=getPathContributingMatches(Ee);return Re?Te.map((je,Oe)=>Oe===Te.length-1?je.pathname:je.pathnameBase):Te.map(je=>je.pathnameBase)}function resolveTo(Ee,Re,Te,je){je===void 0&&(je=!1);let Oe;typeof Ee=="string"?Oe=parsePath(Ee):(Oe=_extends$4({},Ee),invariant$1(!Oe.pathname||!Oe.pathname.includes("?"),getInvalidPathError("?","pathname","search",Oe)),invariant$1(!Oe.pathname||!Oe.pathname.includes("#"),getInvalidPathError("#","pathname","hash",Oe)),invariant$1(!Oe.search||!Oe.search.includes("#"),getInvalidPathError("#","search","hash",Oe)));let Me=Ee===""||Oe.pathname==="",De=Me?"/":Oe.pathname,$e;if(De==null)$e=Te;else{let We=Re.length-1;if(!je&&De.startsWith("..")){let Xe=De.split("/");for(;Xe[0]==="..";)Xe.shift(),We-=1;Oe.pathname=Xe.join("/")}$e=We>=0?Re[We]:"/"}let Be=resolvePath$1(Oe,$e),Ue=De&&De!=="/"&&De.endsWith("/"),ze=(Me||De===".")&&Te.endsWith("/");return!Be.pathname.endsWith("/")&&(Ue||ze)&&(Be.pathname+="/"),Be}const joinPaths=Ee=>Ee.join("/").replace(/\/\/+/g,"/"),normalizePathname=Ee=>Ee.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=Ee=>!Ee||Ee==="?"?"":Ee.startsWith("?")?Ee:"?"+Ee,normalizeHash=Ee=>!Ee||Ee==="#"?"":Ee.startsWith("#")?Ee:"#"+Ee;function isRouteErrorResponse(Ee){return Ee!=null&&typeof Ee.status=="number"&&typeof Ee.statusText=="string"&&typeof Ee.internal=="boolean"&&"data"in Ee}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/** 12 * React Router v6.30.3 13 * 14 * Copyright (c) Remix Software Inc. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE.md file in the root directory of this source tree. 18 * 19 * @license MIT 20 */function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(Ee){for(var Re=1;Re<arguments.length;Re++){var Te=arguments[Re];for(var je in Te)Object.prototype.hasOwnProperty.call(Te,je)&&(Ee[je]=Te[je])}return Ee},_extends$3.apply(this,arguments)}const DataRouterContext=reactExports.createContext(null),DataRouterStateContext=reactExports.createContext(null),NavigationContext=reactExports.createContext(null),LocationContext=reactExports.createContext(null),RouteContext=reactExports.createContext({outlet:null,matches:[],isDataRoute:!1}),RouteErrorContext=reactExports.createContext(null);function useHref(Ee,Re){let{relative:Te}=Re===void 0?{}:Re;useInRouterContext()||invariant$1(!1);let{basename:je,navigator:Oe}=reactExports.useContext(NavigationContext),{hash:Me,pathname:De,search:$e}=useResolvedPath(Ee,{relative:Te}),Be=De;return je!=="/"&&(Be=De==="/"?je:joinPaths([je,De])),Oe.createHref({pathname:Be,search:$e,hash:Me})}function useInRouterContext(){return reactExports.useContext(LocationContext)!=null}function useLocation(){return useInRouterContext()||invariant$1(!1),reactExports.useContext(LocationContext).location}function useIsomorphicLayoutEffect$1(Ee){reactExports.useContext(NavigationContext).static||reactExports.useLayoutEffect(Ee)}function useNavigate(){let{isDataRoute:Ee}=reactExports.useContext(RouteContext);return Ee?useNavigateStable():useNavigateUnstable()}function useNavigateUnstable(){useInRouterContext()||invariant$1(!1);
vendor: 4,537 bytes, line 20
20let Ee=reactExports.useContext(DataRouterContext),{basename:Re,future:Te,navigator:je}=reactExports.useContext(NavigationContext),{matches:Oe}=reactExports.useContext(RouteContext),{pathname:Me}=useLocation(),De=JSON.stringify(getResolveToMatches(Oe,Te.v7_relativeSplatPath)),$e=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{$e.current=!0}),reactExports.useCallback(function(Ue,ze){if(ze===void 0&&(ze={}),!$e.current)return;if(typeof Ue=="number"){je.go(Ue);return}let We=resolveTo(Ue,JSON.parse(De),Me,ze.relative==="path");Ee==null&&Re!=="/"&&(We.pathname=We.pathname==="/"?Re:joinPaths([Re,We.pathname])),(ze.replace?je.replace:je.push)(We,ze.state,ze)},[Re,je,De,Me,Ee])}function useParams(){let{matches:Ee}=reactExports.useContext(RouteContext),Re=Ee[Ee.length-1];return Re?Re.params:{}}function useResolvedPath(Ee,Re){let{relative:Te}=Re===void 0?{}:Re,{future:je}=reactExports.useContext(NavigationContext),{matches:Oe}=reactExports.useContext(RouteContext),{pathname:Me}=useLocation(),De=JSON.stringify(getResolveToMatches(Oe,je.v7_relativeSplatPath));return reactExports.useMemo(()=>resolveTo(Ee,JSON.parse(De),Me,Te==="path"),[Ee,De,Me,Te])}function useRoutes(Ee,Re){return useRoutesImpl(Ee,Re)}function useRoutesImpl(Ee,Re,Te,je){useInRouterContext()||invariant$1(!1);let{navigator:Oe}=reactExports.useContext(NavigationContext),{matches:Me}=reactExports.useContext(RouteContext),De=Me[Me.length-1],$e=De?De.params:{};De&&De.pathname;let Be=De?De.pathnameBase:"/";De&&De.route;let Ue=useLocation(),ze;if(Re){var We;let Ye=typeof Re=="string"?parsePath(Re):Re;Be==="/"||(We=Ye.pathname)!=null&&We.startsWith(Be)||invariant$1(!1),ze=Ye}else ze=Ue;let Xe=ze.pathname||"/",He=Xe;if(Be!=="/"){let Ye=Be.replace(/^\//,"").split("/");He="/"+Xe.replace(/^\//,"").split("/").slice(Ye.length).join("/")}let qe=matchRoutes(Ee,{pathname:He}),Ge=_renderMatches(qe&&qe.map(Ye=>Object.assign({},Ye,{params:Object.assign({},$e,Ye.params),pathname:joinPaths([Be,Oe.encodeLocation?Oe.encodeLocation(Ye.pathname).pathname:Ye.pathname]),pathnameBase:Ye.pathnameBase==="/"?Be:joinPaths([Be,Oe.encodeLocation?Oe.encodeLocation(Ye.pathnameBase).pathname:Ye.pathnameBase])})),Me,Te,je);return Re&&Ge?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$3({pathname:"/",search:"",hash:"",state:null,key:"default"},ze),navigationType:Action.Pop}},Ge):Ge}function DefaultErrorComponent(){let Ee=useRouteError(),Re=isRouteErrorResponse(Ee)?Ee.status+" "+Ee.statusText:Ee instanceof Error?Ee.message:JSON.stringify(Ee),Te=Ee instanceof Error?Ee.stack:null,Oe={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},Re),Te?reactExports.createElement("pre",{style:Oe},Te):null,null)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(Re){super(Re),this.state={location:Re.location,revalidation:Re.revalidation,error:Re.error}}static getDerivedStateFromError(Re){return{error:Re}}static getDerivedStateFromProps(Re,Te){return Te.location!==Re.location||Te.revalidation!=="idle"&&Re.revalidation==="idle"?{error:Re.error,location:Re.location,revalidation:Re.revalidation}:{error:Re.error!==void 0?Re.error:Te.error,location:Te.location,revalidation:Re.revalidation||Te.revalidation}}componentDidCatch(Re,Te){console.error("React Router caught the following error during render",Re,Te)}render(){return this.state.error!==void 0?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(Ee){let{routeContext:Re,match:Te,children:je}=Ee,Oe=reactExports.useContext(DataRouterContext);return Oe&&Oe.static&&Oe.staticContext&&(Te.route.errorElement||Te.route.ErrorBoundary)&&(Oe.staticContext._deepestRenderedBoundaryId=Te.route.id),reactExports.createElement(RouteContext.Provider,{value:Re},je)}function _renderMatches(Ee,Re,Te,je){var Oe;if(Re===void 0&&(Re=[]),Te===void 0&&(Te=null),je===void 0&&(je=null),Ee==null){var Me;if(!Te)return null;if(Te.errors)Ee=Te.matches;else if((Me=je)!=null&&Me.v7_partialHydration&&Re.length===0&&!Te.initialized&&Te.matches.length>0)Ee=Te.matches;else return null}let De=Ee,$e=(Oe=Te)==null?void 0:Oe.errors;
vendor: 4,742 bytes, line 20
20if($e!=null){let ze=De.findIndex(We=>We.route.id&&($e==null?void 0:$e[We.route.id])!==void 0);ze>=0||invariant$1(!1),De=De.slice(0,Math.min(De.length,ze+1))}let Be=!1,Ue=-1;if(Te&&je&&je.v7_partialHydration)for(let ze=0;ze<De.length;ze++){let We=De[ze];if((We.route.HydrateFallback||We.route.hydrateFallbackElement)&&(Ue=ze),We.route.id){let{loaderData:Xe,errors:He}=Te,qe=We.route.loader&&Xe[We.route.id]===void 0&&(!He||He[We.route.id]===void 0);if(We.route.lazy||qe){Be=!0,Ue>=0?De=De.slice(0,Ue+1):De=[De[0]];break}}}return De.reduceRight((ze,We,Xe)=>{let He,qe=!1,Ge=null,Ye=null;Te&&(He=$e&&We.route.id?$e[We.route.id]:void 0,Ge=We.route.errorElement||defaultErrorElement,Be&&(Ue<0&&Xe===0?(warningOnce("route-fallback"),qe=!0,Ye=null):Ue===Xe&&(qe=!0,Ye=We.route.hydrateFallbackElement||null)));let Ve=Re.concat(De.slice(0,Xe+1)),Ke=()=>{let Qe;return He?Qe=Ge:qe?Qe=Ye:We.route.Component?Qe=reactExports.createElement(We.route.Component,null):We.route.element?Qe=We.route.element:Qe=ze,reactExports.createElement(RenderedRoute,{match:We,routeContext:{outlet:ze,matches:Ve,isDataRoute:Te!=null},children:Qe})};return Te&&(We.route.ErrorBoundary||We.route.errorElement||Xe===0)?reactExports.createElement(RenderErrorBoundary,{location:Te.location,revalidation:Te.revalidation,component:Ge,error:He,children:Ke(),routeContext:{outlet:null,matches:Ve,isDataRoute:!0}}):Ke()},null)}var DataRouterHook$1=function(Ee){return Ee.UseBlocker="useBlocker",Ee.UseRevalidator="useRevalidator",Ee.UseNavigateStable="useNavigate",Ee}(DataRouterHook$1||{}),DataRouterStateHook$1=function(Ee){return Ee.UseBlocker="useBlocker",Ee.UseLoaderData="useLoaderData",Ee.UseActionData="useActionData",Ee.UseRouteError="useRouteError",Ee.UseNavigation="useNavigation",Ee.UseRouteLoaderData="useRouteLoaderData",Ee.UseMatches="useMatches",Ee.UseRevalidator="useRevalidator",Ee.UseNavigateStable="useNavigate",Ee.UseRouteId="useRouteId",Ee}(DataRouterStateHook$1||{});function useDataRouterContext(Ee){let Re=reactExports.useContext(DataRouterContext);return Re||invariant$1(!1),Re}function useDataRouterState(Ee){let Re=reactExports.useContext(DataRouterStateContext);return Re||invariant$1(!1),Re}function useRouteContext(Ee){let Re=reactExports.useContext(RouteContext);return Re||invariant$1(!1),Re}function useCurrentRouteId(Ee){let Re=useRouteContext(),Te=Re.matches[Re.matches.length-1];return Te.route.id||invariant$1(!1),Te.route.id}function useRouteError(){var Ee;let Re=reactExports.useContext(RouteErrorContext),Te=useDataRouterState(),je=useCurrentRouteId();return Re!==void 0?Re:(Ee=Te.errors)==null?void 0:Ee[je]}function useNavigateStable(){let{router:Ee}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),Re=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),Te=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{Te.current=!0}),reactExports.useCallback(function(Oe,Me){Me===void 0&&(Me={}),Te.current&&(typeof Oe=="number"?Ee.navigate(Oe):Ee.navigate(Oe,_extends$3({fromRouteId:Re},Me)))},[Ee,Re])}const alreadyWarned$1={};function warningOnce(Ee,Re,Te){alreadyWarned$1[Ee]||(alreadyWarned$1[Ee]=!0)}function logV6DeprecationWarnings(Ee,Re){Ee==null||Ee.v7_startTransition,Ee==null||Ee.v7_relativeSplatPath}function Navigate(Ee){let{to:Re,replace:Te,state:je,relative:Oe}=Ee;useInRouterContext()||invariant$1(!1);let{future:Me,static:De}=reactExports.useContext(NavigationContext),{matches:$e}=reactExports.useContext(RouteContext),{pathname:Be}=useLocation(),Ue=useNavigate(),ze=resolveTo(Re,getResolveToMatches($e,Me.v7_relativeSplatPath),Be,Oe==="path"),We=JSON.stringify(ze);return reactExports.useEffect(()=>Ue(JSON.parse(We),{replace:Te,state:je,relative:Oe}),[Ue,We,Oe,Te,je]),null}function Route(Ee){invariant$1(!1)}function Router(Ee){let{basename:Re="/",children:Te=null,location:je,navigationType:Oe=Action.Pop,navigator:Me,static:De=!1,future:$e}=Ee;useInRouterContext()&&invariant$1(!1);let Be=Re.replace(/^\/*/,"/"),Ue=reactExports.useMemo(()=>({basename:Be,navigator:Me,static:De,future:_extends$3({v7_relativeSplatPath:!1},$e)}),[Be,$e,Me,De]);typeof je=="string"&&(je=parsePath(je));let{pathname:ze="/",search:We="",hash:Xe="",state:He=null,key:qe="default"}=je,Ge=reactExports.useMemo(()=>{let Ye=stripBasename(ze,Be);return Ye==null?null:{location:{pathname:Ye,search:We,hash:Xe,state:He,key:qe},navigationType:Oe}},[Be,ze,We,Xe,He,qe,Oe]);return Ge==null?null:reactExports.createElement(NavigationContext.Provider,{value:Ue},reactExports.createElement(LocationContext.Provider,{children:Te,value:Ge}))}function Routes(Ee){let{children:Re,location:Te}=Ee;return useRoutes(createRoutesFromChildren(Re),Te)}new Promise(()=>{});function createRoutesFromChildren(Ee,Re){Re===void 0&&(Re=[]);let Te=[];
20return reactExports.Children.forEach(Ee,(je,Oe)=>{if(!reactExports.isValidElement(je))return;let Me=[...Re,Oe];if(je.type===reactExports.Fragment){Te.push.apply(Te,createRoutesFromChildren(je.props.children,Me));return}je.type!==Route&&invariant$1(!1),!je.props.index||!je.props.children||invariant$1(!1);let De={id:je.props.id||Me.join("-"),caseSensitive:je.props.caseSensitive,element:je.props.element,Component:je.props.Component,index:je.props.index,path:je.props.path,loader:je.props.loader,action:je.props.action,errorElement:je.props.errorElement,ErrorBoundary:je.props.ErrorBoundary,hasErrorBoundary:je.props.ErrorBoundary!=null||je.props.errorElement!=null,shouldRevalidate:je.props.shouldRevalidate,handle:je.props.handle,lazy:je.props.lazy};je.props.children&&(De.children=createRoutesFromChildren(je.props.children,Me)),Te.push(De)}),Te}/** 21 * React Router DOM v6.30.3 22 * 23 * Copyright (c) Remix Software Inc. 24 * 25 * This source code is licensed under the MIT license found in the 26 * LICENSE.md file in the root directory of this source tree. 27 * 28 * @license MIT 29 */function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(Ee){for(var Re=1;Re<arguments.length;Re++){var Te=arguments[Re];for(var je in Te)Object.prototype.hasOwnProperty.call(Te,je)&&(Ee[je]=Te[je])}return Ee},_extends$2.apply(this,arguments)}function _objectWithoutPropertiesLoose$2(Ee,Re){if(Ee==null)return{};var Te={},je=Object.keys(Ee),Oe,Me;for(Me=0;Me<je.length;Me++)Oe=je[Me],!(Re.indexOf(Oe)>=0)&&(Te[Oe]=Ee[Oe]);return Te}function isModifiedEvent(Ee){return!!(Ee.metaKey||Ee.altKey||Ee.ctrlKey||Ee.shiftKey)}function shouldProcessLinkClick(Ee,Re){return Ee.button===0&&(!Re||Re==="_self")&&!isModifiedEvent(Ee)}function createSearchParams(Ee){return Ee===void 0&&(Ee=""),new URLSearchParams(typeof Ee=="string"||Array.isArray(Ee)||Ee instanceof URLSearchParams?Ee:Object.keys(Ee).reduce((Re,Te)=>{let je=Ee[Te];return Re.concat(Array.isArray(je)?je.map(Oe=>[Te,Oe]):[[Te,je]])},[]))}function getSearchParamsForLocation(Ee,Re){let Te=createSearchParams(Ee);return Re&&Re.forEach((je,Oe)=>{Te.has(Oe)||Re.getAll(Oe).forEach(Me=>{Te.append(Oe,Me)})}),Te}const _excluded$1r=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch{}const START_TRANSITION="startTransition",startTransitionImpl=React$2[START_TRANSITION];function BrowserRouter(Ee){let{basename:Re,children:Te,future:je,window:Oe}=Ee,Me=reactExports.useRef();Me.current==null&&(Me.current=createBrowserHistory({window:Oe,v5Compat:!0}));let De=Me.current,[$e,Be]=reactExports.useState({action:De.action,location:De.location}),{v7_startTransition:Ue}=je||{},ze=reactExports.useCallback(We=>{Ue&&startTransitionImpl?startTransitionImpl(()=>Be(We)):Be(We)},[Be,Ue]);return reactExports.useLayoutEffect(()=>De.listen(ze),[De,ze]),reactExports.useEffect(()=>logV6DeprecationWarnings(je),[je]),reactExports.createElement(Router,{basename:Re,children:Te,location:$e.location,navigationType:$e.action,navigator:De,future:je})}const isBrowser$2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Link$1=reactExports.forwardRef(function(Re,Te){let{onClick:je,relative:Oe,reloadDocument:Me,replace:De,state:$e,target:Be,to:Ue,preventScrollReset:ze,viewTransition:We}=Re,Xe=_objectWithoutPropertiesLoose$2(Re,_excluded$1r),{basename:He}=reactExports.useContext(NavigationContext),qe,Ge=!1;if(typeof Ue=="string"&&ABSOLUTE_URL_REGEX.test(Ue)&&(qe=Ue,isBrowser$2))try{let Qe=new URL(window.location.href),Ze=Ue.startsWith("//")?new URL(Qe.protocol+Ue):new URL(Ue),Je=stripBasename(Ze.pathname,He);Ze.origin===Qe.origin&&Je!=null?Ue=Je+Ze.search+Ze.hash:Ge=!0}catch{}let Ye=useHref(Ue,{relative:Oe}),Ve=useLinkClickHandler(Ue,{replace:De,state:$e,target:Be,preventScrollReset:ze,relative:Oe,viewTransition:We});function Ke(Qe){je&&je(Qe),Qe.defaultPrevented||Ve(Qe)}return reactExports.createElement("a",_extends$2({},Xe,{href:qe||Ye,onClick:Ge||Me?je:Ke,ref:Te,target:Be}))});var DataRouterHook;(function(Ee){Ee.UseScrollRestoration="useScrollRestoration",Ee.
29UseSubmit="useSubmit",Ee.UseSubmitFetcher="useSubmitFetcher",Ee.UseFetcher="useFetcher",Ee.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(Ee){Ee.UseFetcher="useFetcher",Ee.UseFetchers="useFetchers",Ee.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useLinkClickHandler(Ee,Re){let{target:Te,replace:je,state:Oe,preventScrollReset:Me,relative:De,viewTransition:$e}=Re===void 0?{}:Re,Be=useNavigate(),Ue=useLocation(),ze=useResolvedPath(Ee,{relative:De});return reactExports.useCallback(We=>{if(shouldProcessLinkClick(We,Te)){We.preventDefault();let Xe=je!==void 0?je:createPath(Ue)===createPath(ze);Be(Ee,{replace:Xe,state:Oe,preventScrollReset:Me,relative:De,viewTransition:$e})}},[Ue,Be,ze,je,Oe,Te,Ee,Me,De,$e])}function useSearchParams(Ee){let Re=reactExports.useRef(createSearchParams(Ee)),Te=reactExports.useRef(!1),je=useLocation(),Oe=reactExports.useMemo(()=>getSearchParamsForLocation(je.search,Te.current?null:Re.current),[je.search]),Me=useNavigate(),De=reactExports.useCallback(($e,Be)=>{const Ue=createSearchParams(typeof $e=="function"?$e(Oe):$e);Te.current=!0,Me("?"+Ue,Be)},[Me,Oe]);return[Oe,De]}var withSelector={exports:{}},useSyncExternalStoreWithSelector_production={};/** 30 * @license React 31 * use-sync-external-store-with-selector.production.js 32 * 33 * Copyright (c) Meta Platforms, Inc. and affiliates. 34 * 35 * This source code is licensed under the MIT license found in the 36 * LICENSE file in the root directory of this source tree. 37 */var React$1=reactExports;function is$2(Ee,Re){return Ee===Re&&(Ee!==0||1/Ee===1/Re)||Ee!==Ee&&Re!==Re}var objectIs=typeof Object.is=="function"?Object.is:is$2,useSyncExternalStore=React$1.useSyncExternalStore,useRef=React$1.useRef,useEffect=React$1.useEffect,useMemo=React$1.useMemo,useDebugValue=React$1.useDebugValue;useSyncExternalStoreWithSelector_production.useSyncExternalStoreWithSelector=function(Ee,Re,Te,je,Oe){var Me=useRef(null);if(Me.current===null){var De={hasValue:!1,value:null};Me.current=De}else De=Me.current;Me=useMemo(function(){function Be(He){if(!Ue){if(Ue=!0,ze=He,He=je(He),Oe!==void 0&&De.hasValue){var qe=De.value;if(Oe(qe,He))return We=qe}return We=He}if(qe=We,objectIs(ze,He))return qe;var Ge=je(He);return Oe!==void 0&&Oe(qe,Ge)?(ze=He,qe):(ze=He,We=Ge)}var Ue=!1,ze,We,Xe=Te===void 0?null:Te;return[function(){return Be(Re())},Xe===null?void 0:function(){return Be(Xe())}]},[Re,Te,je,Oe]);var $e=useSyncExternalStore(Ee,Me[0],Me[1]);return useEffect(function(){De.hasValue=!0,De.value=$e},[$e]),useDebugValue($e),$e};withSelector.exports=useSyncExternalStoreWithSelector_production;var withSelectorExports=withSelector.exports;function defaultNoopBatch(Ee){Ee()}function createListenerCollection(){let Ee=null,Re=null;return{clear(){Ee=null,Re=null},notify(){defaultNoopBatch(()=>{let Te=Ee;for(;Te;)Te.callback(),Te=Te.next})},get(){const Te=[];let je=Ee;for(;je;)Te.push(je),je=je.next;return Te},subscribe(Te){let je=!0;const Oe=Re={callback:Te,next:null,prev:Re};return Oe.prev?Oe.prev.next=Oe:Ee=Oe,function(){!je||Ee===null||(je=!1,Oe.next?Oe.next.prev=Oe.prev:Re=Oe.prev,Oe.prev?Oe.prev.next=Oe.next:Ee=Oe.next)}}}}var nullListeners={notify(){},get:()=>[]};function createSubscription(Ee,Re){let Te,je=nullListeners,Oe=0,Me=!1;function De(Ge){ze();const Ye=je.subscribe(Ge);let Ve=!1;return()=>{Ve||(Ve=!0,Ye(),We())}}function $e(){je.notify()}function Be(){qe.onStateChange&&qe.onStateChange()}function Ue(){return Me}function ze(){Oe++,Te||(Te=Ee.subscribe(Be),je=createListenerCollection())}function We(){Oe--,Te&&Oe===0&&(Te(),Te=void 0,je.clear(),je=nullListeners)}function Xe(){Me||(Me=!0,ze())}function He(){Me&&(Me=!1,We())}const qe={addNestedSub:De,notifyNestedSubs:$e,handleChangeWrapper:Be,isSubscribed:Ue,trySubscribe:Xe,tryUnsubscribe:He,getListeners:()=>je};return qe}var canUseDOM=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",isDOM=canUseDOM(),isRunningInReactNative=()=>typeof navigator<"u"&&navigator.product==="ReactNative",isReactNative=isRunningInReactNative(),getUseIsomorphicLayoutEffect=()=>isDOM||isReactNative?reactExports.useLayoutEffect:reactExports.useEffect,useIsomorphicLayoutEffect=getUseIsomorphicLayoutEffect();function is$1(Ee,Re){return Ee===Re?Ee!==0||Re!==0||1/Ee===1/Re:Ee!==Ee&&Re!==Re}function shallowEqual(Ee,Re){if(is$1(Ee,Re))return!0;
37if(typeof Ee!="object"||Ee===null||typeof Re!="object"||Re===null)return!1;const Te=Object.keys(Ee),je=Object.keys(Re);if(Te.length!==je.length)return!1;for(let Oe=0;Oe<Te.length;Oe++)if(!Object.prototype.hasOwnProperty.call(Re,Te[Oe])||!is$1(Ee[Te[Oe]],Re[Te[Oe]]))return!1;return!0}var ContextKey=Symbol.for("react-redux-context"),gT=typeof globalThis<"u"?globalThis:{};function getContext(){if(!reactExports.createContext)return{};const Ee=gT[ContextKey]??(gT[ContextKey]=new Map);let Re=Ee.get(reactExports.createContext);return Re||(Re=reactExports.createContext(null),Ee.set(reactExports.createContext,Re)),Re}var ReactReduxContext=getContext();function Provider(Ee){const{children:Re,context:Te,serverState:je,store:Oe}=Ee,Me=reactExports.useMemo(()=>{const Be=createSubscription(Oe);return{store:Oe,subscription:Be,getServerState:je?()=>je:void 0}},[Oe,je]),De=reactExports.useMemo(()=>Oe.getState(),[Oe]);useIsomorphicLayoutEffect(()=>{const{subscription:Be}=Me;return Be.onStateChange=Be.notifyNestedSubs,Be.trySubscribe(),De!==Oe.getState()&&Be.notifyNestedSubs(),()=>{Be.tryUnsubscribe(),Be.onStateChange=void 0}},[Me,De]);const $e=Te||ReactReduxContext;return reactExports.createElement($e.Provider,{value:Me},Re)}var Provider_default=Provider;function createReduxContextHook(Ee=ReactReduxContext){return function(){return reactExports.useContext(Ee)}}var useReduxContext=createReduxContextHook();function createStoreHook(Ee=ReactReduxContext){const Re=Ee===ReactReduxContext?useReduxContext:createReduxContextHook(Ee),Te=()=>{const{store:je}=Re();return je};return Object.assign(Te,{withTypes:()=>Te}),Te}var useStore=createStoreHook();function createDispatchHook(Ee=ReactReduxContext){const Re=Ee===ReactReduxContext?useStore:createStoreHook(Ee),Te=()=>Re().dispatch;return Object.assign(Te,{withTypes:()=>Te}),Te}var useDispatch=createDispatchHook(),refEquality=(Ee,Re)=>Ee===Re;function createSelectorHook(Ee=ReactReduxContext){const Re=Ee===ReactReduxContext?useReduxContext:createReduxContextHook(Ee),Te=(je,Oe={})=>{const{equalityFn:Me=refEquality}=typeof Oe=="function"?{equalityFn:Oe}:Oe,De=Re(),{store:$e,subscription:Be,getServerState:Ue}=De;reactExports.useRef(!0);const ze=reactExports.useCallback({[je.name](Xe){return je(Xe)}}[je.name],[je]),We=withSelectorExports.useSyncExternalStoreWithSelector(Be.addNestedSub,$e.getState,Ue||$e.getState,ze,Me);return reactExports.useDebugValue(We),We};return Object.assign(Te,{withTypes:()=>Te}),Te}var useSelector=createSelectorHook();function _typeof$3(Ee){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$3=function(Te){return typeof Te}:_typeof$3=function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},_typeof$3(Ee)}function _classCallCheck(Ee,Re){if(!(Ee instanceof Re))throw new TypeError("Cannot call a class as a function")}function _defineProperties(Ee,Re){for(var Te=0;Te<Re.length;Te++){var je=Re[Te];je.enumerable=je.enumerable||!1,je.configurable=!0,"value"in je&&(je.writable=!0),Object.defineProperty(Ee,je.key,je)}}function _createClass(Ee,Re,Te){return Re&&_defineProperties(Ee.prototype,Re),Ee}function _possibleConstructorReturn(Ee,Re){return Re&&(_typeof$3(Re)==="object"||typeof Re=="function")?Re:_assertThisInitialized$1(Ee)}function _getPrototypeOf(Ee){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(Te){return Te.__proto__||Object.getPrototypeOf(Te)},_getPrototypeOf(Ee)}function _assertThisInitialized$1(Ee){if(Ee===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ee}function _inherits(Ee,Re){if(typeof Re!="function"&&Re!==null)throw new TypeError("Super expression must either be null or a function");Ee.prototype=Object.create(Re&&Re.prototype,{constructor:{value:Ee,writable:!0,configurable:!0}}),Re&&_setPrototypeOf$1(Ee,Re)}function _setPrototypeOf$1(Ee,Re){return _setPrototypeOf$1=Object.setPrototypeOf||function(je,Oe){return je.__proto__=Oe,je},_setPrototypeOf$1(Ee,Re)}function _defineProperty$3(Ee,Re,Te){return Re in Ee?Object.defineProperty(Ee,Re,{value:Te,enumerable:!0,configurable:!0,writable:!0}):Ee[Re]=Te,Ee}var PersistGate=function(Ee){_inherits(Re,Ee);function Re(){var Te,je;_classCallCheck(this,Re);for(var Oe=arguments.length,Me=new Array(Oe),De=0;De<Oe;De++)Me[De]=arguments[De];return je=_possibleConstructorReturn(this,(Te=_getPrototypeOf(Re)).call.apply(Te,[this].concat(Me))),_defineProperty$3(_assertThisInitialized$1(je),"state",{bootstrapped:!1}),_defineProperty$3(_assertThisInitialized$1(je),"_unsubscribe",void 0),_defineProperty$3(_assertThisInitialized$1(je),"handlePersistorState",function(){var $e=je.props.persistor,Be=$e.getState(),Ue=Be.bootstrapped;Ue&&(je.props.onBeforeLift?Promise.resolve(je.props.onBeforeLift()).finally(function(){return je.setState({bootstrapped:!0})}):je.setState({bootstrapped:!0}),je._unsubscribe&&je._unsubscribe())}),je}
37return _createClass(Re,[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return typeof this.props.children=="function"?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}]),Re}(reactExports.PureComponent);_defineProperty$3(PersistGate,"defaultProps",{children:null,loading:null});function formatProdErrorMessage$1(Ee){return`Minified Redux error #${Ee}; visit https://redux.js.org/Errors?code=${Ee} for the full message or use the non-minified dev environment for full errors. `}var $$observable=typeof Symbol=="function"&&Symbol.observable||"@@observable",symbol_observable_default=$$observable,randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject$3(Ee){if(typeof Ee!="object"||Ee===null)return!1;let Re=Ee;for(;Object.getPrototypeOf(Re)!==null;)Re=Object.getPrototypeOf(Re);return Object.getPrototypeOf(Ee)===Re||Object.getPrototypeOf(Ee)===null}function createStore(Ee,Re,Te){if(typeof Ee!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof Re=="function"&&typeof Te=="function"||typeof Te=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof Re=="function"&&typeof Te>"u"&&(Te=Re,Re=void 0),typeof Te<"u"){if(typeof Te!="function")throw new Error(formatProdErrorMessage$1(1));return Te(createStore)(Ee,Re)}let je=Ee,Oe=Re,Me=new Map,De=Me,$e=0,Be=!1;function Ue(){De===Me&&(De=new Map,Me.forEach((Ye,Ve)=>{De.set(Ve,Ye)}))}function ze(){if(Be)throw new Error(formatProdErrorMessage$1(3));return Oe}function We(Ye){if(typeof Ye!="function")throw new Error(formatProdErrorMessage$1(4));if(Be)throw new Error(formatProdErrorMessage$1(5));let Ve=!0;Ue();const Ke=$e++;return De.set(Ke,Ye),function(){if(Ve){if(Be)throw new Error(formatProdErrorMessage$1(6));Ve=!1,Ue(),De.delete(Ke),Me=null}}}function Xe(Ye){if(!isPlainObject$3(Ye))throw new Error(formatProdErrorMessage$1(7));if(typeof Ye.type>"u")throw new Error(formatProdErrorMessage$1(8));if(typeof Ye.type!="string")throw new Error(formatProdErrorMessage$1(17));if(Be)throw new Error(formatProdErrorMessage$1(9));try{Be=!0,Oe=je(Oe,Ye)}finally{Be=!1}return(Me=De).forEach(Ke=>{Ke()}),Ye}function He(Ye){if(typeof Ye!="function")throw new Error(formatProdErrorMessage$1(10));je=Ye,Xe({type:actionTypes_default.REPLACE})}function qe(){const Ye=We;return{subscribe(Ve){if(typeof Ve!="object"||Ve===null)throw new Error(formatProdErrorMessage$1(11));function Ke(){const Ze=Ve;Ze.next&&Ze.next(ze())}return Ke(),{unsubscribe:Ye(Ke)}},[symbol_observable_default](){return this}}}return Xe({type:actionTypes_default.INIT}),{dispatch:Xe,subscribe:We,getState:ze,replaceReducer:He,[symbol_observable_default]:qe}}function assertReducerShape(Ee){Object.keys(Ee).forEach(Re=>{const Te=Ee[Re];if(typeof Te(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(formatProdErrorMessage$1(12));if(typeof Te(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage$1(13))})}function combineReducers(Ee){const Re=Object.keys(Ee),Te={};for(let Me=0;Me<Re.length;Me++){const De=Re[Me];typeof Ee[De]=="function"&&(Te[De]=Ee[De])}const je=Object.keys(Te);let Oe;try{assertReducerShape(Te)}catch(Me){Oe=Me}return function(De={},$e){if(Oe)throw Oe;let Be=!1;const Ue={};for(let ze=0;ze<je.length;ze++){const We=je[ze],Xe=Te[We],He=De[We],qe=Xe(He,$e);if(typeof qe>"u")throw $e&&$e.type,new Error(formatProdErrorMessage$1(14));Ue[We]=qe,Be=Be||qe!==He}return Be=Be||je.length!==Object.keys(De).length,Be?Ue:De}}function compose$1(...Ee){return Ee.length===0?Re=>Re:Ee.length===1?Ee[0]:Ee.reduce((Re,Te)=>(...je)=>Re(Te(...je)))}function applyMiddleware(...Ee){return Re=>(Te,je)=>{const Oe=Re(Te,je);let Me=()=>{throw new Error(formatProdErrorMessage$1(15))};const De={getState:Oe.getState,dispatch:(Be,...Ue)=>Me(Be,...Ue)},$e=Ee.map(Be=>Be(De));return Me=compose$1(...$e)(Oe.dispatch),{...Oe,dispatch:Me}}}function isAction(Ee){return isPlainObject$3(Ee)&&"type"in Ee&&typeof Ee.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state");function die(Ee,...Re){throw new Error(`[Immer] minified error nr: ${Ee}. Full error at: https://bit.ly/3cXEKWf`)}var O$1=Object,getPrototypeOf$2=O$1.getPrototypeOf,CONSTRUCTOR="constructor",PROTOTYPE="prototype",CONFIGURABLE="configurable",ENUMERABLE="enumerable",WRITABLE="writable",VALUE="value",isDraft=Ee=>!!Ee&&!!Ee[DRAFT_STATE];function isDraftable(Ee){var Re;return Ee?isPlainObject$2(Ee)||isArray$1(Ee)||!!Ee[DRAFTABLE]||!!((Re=Ee[CONSTRUCTOR])!=null&&Re[DRAFTABLE])||isMap(Ee)||isSet(Ee):!1}
vendor: 4,195 bytes, line 37
37var objectCtorString=O$1[PROTOTYPE][CONSTRUCTOR].toString(),cachedCtorStrings=new WeakMap;function isPlainObject$2(Ee){if(!Ee||!isObjectish(Ee))return!1;const Re=getPrototypeOf$2(Ee);if(Re===null||Re===O$1[PROTOTYPE])return!0;const Te=O$1.hasOwnProperty.call(Re,CONSTRUCTOR)&&Re[CONSTRUCTOR];if(Te===Object)return!0;if(!isFunction$2(Te))return!1;let je=cachedCtorStrings.get(Te);return je===void 0&&(je=Function.toString.call(Te),cachedCtorStrings.set(Te,je)),je===objectCtorString}function each(Ee,Re,Te=!0){getArchtype(Ee)===0?(Te?Reflect.ownKeys(Ee):O$1.keys(Ee)).forEach(Oe=>{Re(Oe,Ee[Oe],Ee)}):Ee.forEach((je,Oe)=>Re(Oe,je,Ee))}function getArchtype(Ee){const Re=Ee[DRAFT_STATE];return Re?Re.type_:isArray$1(Ee)?1:isMap(Ee)?2:isSet(Ee)?3:0}var has$1=(Ee,Re,Te=getArchtype(Ee))=>Te===2?Ee.has(Re):O$1[PROTOTYPE].hasOwnProperty.call(Ee,Re),get=(Ee,Re,Te=getArchtype(Ee))=>Te===2?Ee.get(Re):Ee[Re],set=(Ee,Re,Te,je=getArchtype(Ee))=>{je===2?Ee.set(Re,Te):je===3?Ee.add(Te):Ee[Re]=Te};function is(Ee,Re){return Ee===Re?Ee!==0||1/Ee===1/Re:Ee!==Ee&&Re!==Re}var isArray$1=Array.isArray,isMap=Ee=>Ee instanceof Map,isSet=Ee=>Ee instanceof Set,isObjectish=Ee=>typeof Ee=="object",isFunction$2=Ee=>typeof Ee=="function",isBoolean$2=Ee=>typeof Ee=="boolean";function isArrayIndex(Ee){const Re=+Ee;return Number.isInteger(Re)&&String(Re)===Ee}var latest=Ee=>Ee.copy_||Ee.base_,getFinalValue=Ee=>Ee.modified_?Ee.copy_:Ee.base_;function shallowCopy(Ee,Re){if(isMap(Ee))return new Map(Ee);if(isSet(Ee))return new Set(Ee);if(isArray$1(Ee))return Array[PROTOTYPE].slice.call(Ee);const Te=isPlainObject$2(Ee);if(Re===!0||Re==="class_only"&&!Te){const je=O$1.getOwnPropertyDescriptors(Ee);delete je[DRAFT_STATE];let Oe=Reflect.ownKeys(je);for(let Me=0;Me<Oe.length;Me++){const De=Oe[Me],$e=je[De];$e[WRITABLE]===!1&&($e[WRITABLE]=!0,$e[CONFIGURABLE]=!0),($e.get||$e.set)&&(je[De]={[CONFIGURABLE]:!0,[WRITABLE]:!0,[ENUMERABLE]:$e[ENUMERABLE],[VALUE]:Ee[De]})}return O$1.create(getPrototypeOf$2(Ee),je)}else{const je=getPrototypeOf$2(Ee);if(je!==null&&Te)return{...Ee};const Oe=O$1.create(je);return O$1.assign(Oe,Ee)}}function freeze(Ee,Re=!1){return isFrozen(Ee)||isDraft(Ee)||!isDraftable(Ee)||(getArchtype(Ee)>1&&O$1.defineProperties(Ee,{set:dontMutateMethodOverride,add:dontMutateMethodOverride,clear:dontMutateMethodOverride,delete:dontMutateMethodOverride}),O$1.freeze(Ee),Re&&each(Ee,(Te,je)=>{freeze(je,!0)},!1)),Ee}function dontMutateFrozenCollections(){die(2)}var dontMutateMethodOverride={[VALUE]:dontMutateFrozenCollections};function isFrozen(Ee){return Ee===null||!isObjectish(Ee)?!0:O$1.isFrozen(Ee)}var PluginMapSet="MapSet",PluginPatches="Patches",PluginArrayMethods="ArrayMethods",plugins={};function getPlugin(Ee){const Re=plugins[Ee];return Re||die(0,Ee),Re}var isPluginLoaded=Ee=>!!plugins[Ee],currentScope,getCurrentScope=()=>currentScope,createScope=(Ee,Re)=>({drafts_:[],parent_:Ee,immer_:Re,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(PluginMapSet)?getPlugin(PluginMapSet):void 0,arrayMethodsPlugin_:isPluginLoaded(PluginArrayMethods)?getPlugin(PluginArrayMethods):void 0});function usePatchesInScope(Ee,Re){Re&&(Ee.patchPlugin_=getPlugin(PluginPatches),Ee.patches_=[],Ee.inversePatches_=[],Ee.patchListener_=Re)}function revokeScope(Ee){leaveScope(Ee),Ee.drafts_.forEach(revokeDraft),Ee.drafts_=null}function leaveScope(Ee){Ee===currentScope&&(currentScope=Ee.parent_)}var enterScope=Ee=>currentScope=createScope(currentScope,Ee);function revokeDraft(Ee){const Re=Ee[DRAFT_STATE];Re.type_===0||Re.type_===1?Re.revoke_():Re.revoked_=!0}function processResult(Ee,Re){Re.unfinalizedDrafts_=Re.drafts_.length;const Te=Re.drafts_[0];if(Ee!==void 0&&Ee!==Te){Te[DRAFT_STATE].modified_&&(revokeScope(Re),die(4)),isDraftable(Ee)&&(Ee=finalize(Re,Ee));const{patchPlugin_:Oe}=Re;Oe&&Oe.generateReplacementPatches_(Te[DRAFT_STATE].base_,Ee,Re)}else Ee=finalize(Re,Te);return maybeFreeze(Re,Ee,!0),revokeScope(Re),Re.patches_&&Re.patchListener_(Re.patches_,Re.inversePatches_),Ee!==NOTHING?Ee:void 0}function finalize(Ee,Re){if(isFrozen(Re))return Re;const Te=Re[DRAFT_STATE];if(!Te)return handleValue(Re,Ee.handledSet_,Ee);
37if(!isSameScope(Te,Ee))return Re;if(!Te.modified_)return Te.base_;if(!Te.finalized_){const{callbacks_:je}=Te;if(je)for(;je.length>0;)je.pop()(Ee);generatePatchesAndFinalize(Te,Ee)}return Te.copy_}function maybeFreeze(Ee,Re,Te=!1){!Ee.parent_&&Ee.immer_.autoFreeze_&&Ee.canAutoFreeze_&&freeze(Re,Te)}function markStateFinalized(Ee){Ee.finalized_=!0,Ee.scope_.unfinalizedDrafts_--}var isSameScope=(Ee,Re)=>Ee.scope_===Re,EMPTY_LOCATIONS_RESULT=[];function updateDraftInParent(Ee,Re,Te,je){const Oe=latest(Ee),Me=Ee.type_;if(je!==void 0&&get(Oe,je,Me)===Re){set(Oe,je,Te,Me);return}if(!Ee.draftLocations_){const $e=Ee.draftLocations_=new Map;each(Oe,(Be,Ue)=>{if(isDraft(Ue)){const ze=$e.get(Ue)||[];ze.push(Be),$e.set(Ue,ze)}})}const De=Ee.draftLocations_.get(Re)??EMPTY_LOCATIONS_RESULT;for(const $e of De)set(Oe,$e,Te,Me)}function registerChildFinalizationCallback(Ee,Re,Te){Ee.callbacks_.push(function(Oe){var $e;const Me=Re;if(!Me||!isSameScope(Me,Oe))return;($e=Oe.mapSetPlugin_)==null||$e.fixSetContents(Me);const De=getFinalValue(Me);updateDraftInParent(Ee,Me.draft_??Me,De,Te),generatePatchesAndFinalize(Me,Oe)})}function generatePatchesAndFinalize(Ee,Re){var je;if(Ee.modified_&&!Ee.finalized_&&(Ee.type_===3||Ee.type_===1&&Ee.allIndicesReassigned_||(((je=Ee.assigned_)==null?void 0:je.size)??0)>0)){const{patchPlugin_:Oe}=Re;if(Oe){const Me=Oe.getPath(Ee);Me&&Oe.generatePatches_(Ee,Me,Re)}markStateFinalized(Ee)}}function handleCrossReference(Ee,Re,Te){const{scope_:je}=Ee;if(isDraft(Te)){const Oe=Te[DRAFT_STATE];isSameScope(Oe,je)&&Oe.callbacks_.push(function(){prepareCopy(Ee);const De=getFinalValue(Oe);updateDraftInParent(Ee,Te,De,Re)})}else isDraftable(Te)&&Ee.callbacks_.push(function(){const Me=latest(Ee);Ee.type_===3?Me.has(Te)&&handleValue(Te,je.handledSet_,je):get(Me,Re,Ee.type_)===Te&&je.drafts_.length>1&&(Ee.assigned_.get(Re)??!1)===!0&&Ee.copy_&&handleValue(get(Ee.copy_,Re,Ee.type_),je.handledSet_,je)})}function handleValue(Ee,Re,Te){return!Te.immer_.autoFreeze_&&Te.unfinalizedDrafts_<1||isDraft(Ee)||Re.has(Ee)||!isDraftable(Ee)||isFrozen(Ee)||(Re.add(Ee),each(Ee,(je,Oe)=>{if(isDraft(Oe)){const Me=Oe[DRAFT_STATE];if(isSameScope(Me,Te)){const De=getFinalValue(Me);set(Ee,je,De,Ee.type_),markStateFinalized(Me)}}else isDraftable(Oe)&&handleValue(Oe,Re,Te)})),Ee}function createProxyProxy(Ee,Re){const Te=isArray$1(Ee),je={type_:Te?1:0,scope_:Re?Re.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:Re,base_:Ee,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let Oe=je,Me=objectTraps;Te&&(Oe=[je],Me=arrayTraps);const{revoke:De,proxy:$e}=Proxy.revocable(Oe,Me);return je.draft_=$e,je.revoke_=De,[$e,je]}var objectTraps={get(Ee,Re){if(Re===DRAFT_STATE)return Ee;let Te=Ee.scope_.arrayMethodsPlugin_;const je=Ee.type_===1&&typeof Re=="string";if(je&&Te!=null&&Te.isArrayOperationMethod(Re))return Te.createMethodInterceptor(Ee,Re);const Oe=latest(Ee);if(!has$1(Oe,Re,Ee.type_))return readPropFromProto(Ee,Oe,Re);const Me=Oe[Re];if(Ee.finalized_||!isDraftable(Me)||je&&Ee.operationMethod&&(Te!=null&&Te.isMutatingArrayMethod(Ee.operationMethod))&&isArrayIndex(Re))return Me;if(Me===peek$1(Ee.base_,Re)){prepareCopy(Ee);const De=Ee.type_===1?+Re:Re,$e=createProxy(Ee.scope_,Me,Ee,De);return Ee.copy_[De]=$e}return Me},has(Ee,Re){return Re in latest(Ee)},ownKeys(Ee){return Reflect.ownKeys(latest(Ee))},set(Ee,Re,Te){const je=getDescriptorFromProto(latest(Ee),Re);if(je!=null&&je.set)return je.set.call(Ee.draft_,Te),!0;if(!Ee.modified_){const Oe=peek$1(latest(Ee),Re),Me=Oe==null?void 0:Oe[DRAFT_STATE];if(Me&&Me.base_===Te)return Ee.copy_[Re]=Te,Ee.assigned_.set(Re,!1),!0;if(is(Te,Oe)&&(Te!==void 0||has$1(Ee.base_,Re,Ee.type_)))return!0;prepareCopy(Ee),markChanged(Ee)}return Ee.copy_[Re]===Te&&(Te!==void 0||Re in Ee.copy_)||Number.isNaN(Te)&&Number.isNaN(Ee.copy_[Re])||(Ee.copy_[Re]=Te,Ee.assigned_.set(Re,!0),handleCrossReference(Ee,Re,Te)),!0},deleteProperty(Ee,Re){return prepareCopy(Ee),peek$1(Ee.base_,Re)!==void 0||Re in Ee.base_?(Ee.assigned_.set(Re,!1),markChanged(Ee)):Ee.assigned_.delete(Re),Ee.copy_&&delete Ee.copy_[Re],!0},getOwnPropertyDescriptor(Ee,Re){const Te=latest(Ee),je=Reflect.getOwnPropertyDescriptor(Te,Re);return je&&{[WRITABLE]:!0,[CONFIGURABLE]:Ee.type_!==1||Re!=="length",[ENUMERABLE]:je[ENUMERABLE],[VALUE]:Te[Re]}},defineProperty(){die(11)},getPrototypeOf(Ee){return getPrototypeOf$2(Ee.base_)},setPrototypeOf(){die(12)}},arrayTraps={};for(let Ee in objectTraps){let Re=objectTraps[Ee];arrayTraps[Ee]=function(){const Te=arguments;return Te[0]=Te[0][0],Re.apply(this,Te)}}arrayTraps.deleteProperty=function(Ee,Re){return arrayTraps.set.call(this,Ee,Re,void 0)};arrayTraps.set=function(Ee,Re,Te){return objectTraps.set.call(this,Ee[0],Re,Te,Ee[0])};function peek$1(Ee,Re){const Te=Ee[DRAFT_STATE];return(Te?latest(Te):Ee)[Re]}function readPropFromProto(Ee,Re,Te){var Oe;
37const je=getDescriptorFromProto(Re,Te);return je?VALUE in je?je[VALUE]:(Oe=je.get)==null?void 0:Oe.call(Ee.draft_):void 0}function getDescriptorFromProto(Ee,Re){if(!(Re in Ee))return;let Te=getPrototypeOf$2(Ee);for(;Te;){const je=Object.getOwnPropertyDescriptor(Te,Re);if(je)return je;Te=getPrototypeOf$2(Te)}}function markChanged(Ee){Ee.modified_||(Ee.modified_=!0,Ee.parent_&&markChanged(Ee.parent_))}function prepareCopy(Ee){Ee.copy_||(Ee.assigned_=new Map,Ee.copy_=shallowCopy(Ee.base_,Ee.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(Ee){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(Re,Te,je)=>{if(isFunction$2(Re)&&!isFunction$2(Te)){const Me=Te;Te=Re;const De=this;return function(Be=Me,...Ue){return De.produce(Be,ze=>Te.call(this,ze,...Ue))}}isFunction$2(Te)||die(6),je!==void 0&&!isFunction$2(je)&&die(7);let Oe;if(isDraftable(Re)){const Me=enterScope(this),De=createProxy(Me,Re,void 0);let $e=!0;try{Oe=Te(De),$e=!1}finally{$e?revokeScope(Me):leaveScope(Me)}return usePatchesInScope(Me,je),processResult(Oe,Me)}else if(!Re||!isObjectish(Re)){if(Oe=Te(Re),Oe===void 0&&(Oe=Re),Oe===NOTHING&&(Oe=void 0),this.autoFreeze_&&freeze(Oe,!0),je){const Me=[],De=[];getPlugin(PluginPatches).generateReplacementPatches_(Re,Oe,{patches_:Me,inversePatches_:De}),je(Me,De)}return Oe}else die(1,Re)},this.produceWithPatches=(Re,Te)=>{if(isFunction$2(Re))return(De,...$e)=>this.produceWithPatches(De,Be=>Re(Be,...$e));let je,Oe;return[this.produce(Re,Te,(De,$e)=>{je=De,Oe=$e}),je,Oe]},isBoolean$2(Ee==null?void 0:Ee.autoFreeze)&&this.setAutoFreeze(Ee.autoFreeze),isBoolean$2(Ee==null?void 0:Ee.useStrictShallowCopy)&&this.setUseStrictShallowCopy(Ee.useStrictShallowCopy),isBoolean$2(Ee==null?void 0:Ee.useStrictIteration)&&this.setUseStrictIteration(Ee.useStrictIteration)}createDraft(Ee){isDraftable(Ee)||die(8),isDraft(Ee)&&(Ee=current(Ee));const Re=enterScope(this),Te=createProxy(Re,Ee,void 0);return Te[DRAFT_STATE].isManual_=!0,leaveScope(Re),Te}finishDraft(Ee,Re){const Te=Ee&&Ee[DRAFT_STATE];(!Te||!Te.isManual_)&&die(9);const{scope_:je}=Te;return usePatchesInScope(je,Re),processResult(void 0,je)}setAutoFreeze(Ee){this.autoFreeze_=Ee}setUseStrictShallowCopy(Ee){this.useStrictShallowCopy_=Ee}setUseStrictIteration(Ee){this.useStrictIteration_=Ee}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(Ee,Re){let Te;for(Te=Re.length-1;Te>=0;Te--){const Oe=Re[Te];if(Oe.path.length===0&&Oe.op==="replace"){Ee=Oe.value;break}}Te>-1&&(Re=Re.slice(Te+1));const je=getPlugin(PluginPatches).applyPatches_;return isDraft(Ee)?je(Ee,Re):this.produce(Ee,Oe=>je(Oe,Re))}};function createProxy(Ee,Re,Te,je){const[Oe,Me]=isMap(Re)?getPlugin(PluginMapSet).proxyMap_(Re,Te):isSet(Re)?getPlugin(PluginMapSet).proxySet_(Re,Te):createProxyProxy(Re,Te);return((Te==null?void 0:Te.scope_)??getCurrentScope()).drafts_.push(Oe),Me.callbacks_=(Te==null?void 0:Te.callbacks_)??[],Me.key_=je,Te&&je!==void 0?registerChildFinalizationCallback(Te,Me,je):Me.callbacks_.push(function(Be){var ze;(ze=Be.mapSetPlugin_)==null||ze.fixSetContents(Me);const{patchPlugin_:Ue}=Be;Me.modified_&&Ue&&Ue.generatePatches_(Me,[],Be)}),Oe}function current(Ee){return isDraft(Ee)||die(10,Ee),currentImpl(Ee)}function currentImpl(Ee){if(!isDraftable(Ee)||isFrozen(Ee))return Ee;const Re=Ee[DRAFT_STATE];let Te,je=!0;if(Re){if(!Re.modified_)return Re.base_;Re.finalized_=!0,Te=shallowCopy(Ee,Re.scope_.immer_.useStrictShallowCopy_),je=Re.scope_.immer_.shouldUseStrictIteration()}else Te=shallowCopy(Ee,!0);return each(Te,(Oe,Me)=>{set(Te,Oe,currentImpl(Me))},je),Re&&(Re.finalized_=!1),Te}var immer=new Immer2,produce=immer.produce;function createThunkMiddleware(Ee){return({dispatch:Te,getState:je})=>Oe=>Me=>typeof Me=="function"?Me(Te,je,Ee):Oe(Me)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose$1:compose$1.apply(null,arguments)},hasMatchFunction=Ee=>Ee&&typeof Ee.match=="function";function createAction(Ee,Re){function Te(...je){if(Re){let Oe=Re(...je);if(!Oe)throw new Error(formatProdErrorMessage(0));return{type:Ee,payload:Oe.payload,..."meta"in Oe&&{meta:Oe.meta},..."error"in Oe&&{error:Oe.error}}}return{type:Ee,payload:je[0]}}return Te.toString=()=>`${Ee}`,Te.type=Ee,Te.match=je=>isAction(je)&&je.type===Ee,Te}var Tuple=class Za extends Array{constructor(...Re){super(...Re),Object.setPrototypeOf(this,Za.prototype)}static get[Symbol.species](){return Za}concat(...Re){return super.concat.apply(this,Re)}prepend(...Re){return Re.length===1&&Array.isArray(Re[0])?new Za(...Re[0].concat(this)):new Za(...Re.concat(this))}};function freezeDraftable(Ee){return isDraftable(Ee)?produce(Ee,()=>{}):Ee}function getOrInsertComputed(Ee,Re,Te){return Ee.has(Re)?Ee.get(Re):Ee.set(Re,Te(Re)).get(Re)}function isBoolean$1(Ee){return typeof Ee=="boolean"}var buildGetDefaultMiddleware=()=>function(Re){const{thunk:Te=!0,immutableCheck:je=!0,serializableCheck:Oe=!0,actionCreatorCheck:Me=!0}=Re??{};let De=new Tuple;return Te&&(isBoolean$1(Te)?De.push(thunk):De.push(withExtraArgument(Te.extraArgument))),De},SHOULD_AUTOBATCH="RTK_autoBatch",prepareAutoBatched=()=>Ee=>({payload:Ee,meta:{[SHOULD_AUTOBATCH]:!0}}),createQueueWithTimer=Ee=>Re=>{setTimeout(Re,Ee)},autoBatchEnhancer=(Ee={type:"raf"})=>Re=>(...Te)=>{const je=Re(...Te);let Oe=!0,Me=!1,De=!1;const $e=new Set,Be=Ee.type==="tick"?queueMicrotask:Ee.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:createQueueWithTimer(10):Ee.type==="callback"?Ee.queueNotification:createQueueWithTimer(Ee.timeout),Ue=()=>{De=!1,Me&&(Me=!1,$e.forEach(ze=>ze()))};return Object.assign({},je,{subscribe(ze){const We=()=>Oe&&ze(),Xe=je.subscribe(We);return $e.add(ze),()=>{Xe(),$e.delete(ze)}},dispatch(ze){var We;try{return Oe=!((We=ze==null?void 0:ze.meta)!=null&&We[SHOULD_AUTOBATCH]),Me=!Oe,Me&&(De||(De=!0,Be(Ue))),je.dispatch(ze)}finally{Oe=!0}}})},buildGetDefaultEnhancers=Ee=>function(Te){const{autoBatch:je=!0}=Te??{};
37let Oe=new Tuple(Ee);return je&&Oe.push(autoBatchEnhancer(typeof je=="object"?je:void 0)),Oe};function configureStore(Ee){const Re=buildGetDefaultMiddleware(),{reducer:Te=void 0,middleware:je,devTools:Oe=!0,duplicateMiddlewareCheck:Me=!0,preloadedState:De=void 0,enhancers:$e=void 0}=Ee||{};let Be;if(typeof Te=="function")Be=Te;else if(isPlainObject$3(Te))Be=combineReducers(Te);else throw new Error(formatProdErrorMessage(1));let Ue;typeof je=="function"?Ue=je(Re):Ue=Re();let ze=compose$1;Oe&&(ze=composeWithDevTools({trace:!1,...typeof Oe=="object"&&Oe}));const We=applyMiddleware(...Ue),Xe=buildGetDefaultEnhancers(We);let He=typeof $e=="function"?$e(Xe):Xe();const qe=ze(...He);return createStore(Be,De,qe)}function executeReducerBuilderCallback(Ee){const Re={},Te=[];let je;const Oe={addCase(Me,De){const $e=typeof Me=="string"?Me:Me.type;if(!$e)throw new Error(formatProdErrorMessage(28));if($e in Re)throw new Error(formatProdErrorMessage(29));return Re[$e]=De,Oe},addAsyncThunk(Me,De){return De.pending&&(Re[Me.pending.type]=De.pending),De.rejected&&(Re[Me.rejected.type]=De.rejected),De.fulfilled&&(Re[Me.fulfilled.type]=De.fulfilled),De.settled&&Te.push({matcher:Me.settled,reducer:De.settled}),Oe},addMatcher(Me,De){return Te.push({matcher:Me,reducer:De}),Oe},addDefaultCase(Me){return je=Me,Oe}};return Ee(Oe),[Re,Te,je]}function isStateFunction(Ee){return typeof Ee=="function"}function createReducer(Ee,Re){let[Te,je,Oe]=executeReducerBuilderCallback(Re),Me;if(isStateFunction(Ee))Me=()=>freezeDraftable(Ee());else{const $e=freezeDraftable(Ee);Me=()=>$e}function De($e=Me(),Be){let Ue=[Te[Be.type],...je.filter(({matcher:ze})=>ze(Be)).map(({reducer:ze})=>ze)];return Ue.filter(ze=>!!ze).length===0&&(Ue=[Oe]),Ue.reduce((ze,We)=>{if(We)if(isDraft(ze)){const He=We(ze,Be);return He===void 0?ze:He}else{if(isDraftable(ze))return produce(ze,Xe=>We(Xe,Be));{const Xe=We(ze,Be);if(Xe===void 0){if(ze===null)return ze;throw Error("A case reducer on a non-draftable value must not return undefined")}return Xe}}return ze},$e)}return De.getInitialState=Me,De}var matches=(Ee,Re)=>hasMatchFunction(Ee)?Ee.match(Re):Ee(Re);function isAnyOf(...Ee){return Re=>Ee.some(Te=>matches(Te,Re))}var urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",nanoid=(Ee=21)=>{let Re="",Te=Ee;for(;Te--;)Re+=urlAlphabet[Math.random()*64|0];return Re},commonProperties=["name","message","stack","code"],RejectWithValue=class{constructor(Ee,Re){Es(this,"_type");this.payload=Ee,this.meta=Re}},FulfillWithMeta=class{constructor(Ee,Re){Es(this,"_type");this.payload=Ee,this.meta=Re}},miniSerializeError=Ee=>{if(typeof Ee=="object"&&Ee!==null){const Re={};for(const Te of commonProperties)typeof Ee[Te]=="string"&&(Re[Te]=Ee[Te]);return Re}return{message:String(Ee)}},externalAbortMessage="External signal was aborted",createAsyncThunk=(()=>{function Ee(Re,Te,je){const Oe=createAction(Re+"/fulfilled",(Be,Ue,ze,We)=>({payload:Be,meta:{...We||{},arg:ze,requestId:Ue,requestStatus:"fulfilled"}})),Me=createAction(Re+"/pending",(Be,Ue,ze)=>({payload:void 0,meta:{...ze||{},arg:Ue,requestId:Be,requestStatus:"pending"}})),De=createAction(Re+"/rejected",(Be,Ue,ze,We,Xe)=>({payload:We,error:(je&&je.serializeError||miniSerializeError)(Be||"Rejected"),meta:{...Xe||{},arg:ze,requestId:Ue,rejectedWithValue:!!We,requestStatus:"rejected",aborted:(Be==null?void 0:Be.name)==="AbortError",condition:(Be==null?void 0:Be.name)==="ConditionError"}}));function $e(Be,{signal:Ue}={}){return(ze,We,Xe)=>{const He=je!=null&&je.idGenerator?je.idGenerator(Be):nanoid(),qe=new AbortController;let Ge,Ye;function Ve(Qe){Ye=Qe,qe.abort()}Ue&&(Ue.aborted?Ve(externalAbortMessage):Ue.addEventListener("abort",()=>Ve(externalAbortMessage),{once:!0}));const Ke=async function(){var Je,ir;let Qe;try{let rr=(Je=je==null?void 0:je.condition)==null?void 0:Je.call(je,Be,{getState:We,extra:Xe});if(isThenable$1(rr)&&(rr=await rr),rr===!1||qe.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const ar=new Promise((or,pr)=>{Ge=()=>{pr({name:"AbortError",message:Ye||"Aborted"})},qe.signal.addEventListener("abort",Ge,{once:!0})});ze(Me(He,Be,(ir=je==null?void 0:je.getPendingMeta)==null?void 0:ir.call(je,{requestId:He,arg:Be},{getState:We,extra:Xe}))),Qe=await Promise.race([ar,Promise.resolve(Te(Be,{dispatch:ze,getState:We,extra:Xe,requestId:He,signal:qe.signal,abort:Ve,rejectWithValue:(or,pr)=>new RejectWithValue(or,pr),fulfillWithValue:(or,pr)=>new FulfillWithMeta(or,pr)})).then(or=>{if(or instanceof RejectWithValue)throw or;return or instanceof FulfillWithMeta?Oe(or.payload,He,Be,or.meta):Oe(or,He,Be)})])}catch(rr){Qe=rr instanceof RejectWithValue?De(null,He,Be,rr.payload,rr.meta):De(rr,He,Be)}finally{Ge&&qe.signal.removeEventListener("abort",Ge)}return je&&!je.dispatchConditionRejection&&De.match(Qe)&&Qe.meta.condition||ze(Qe),Qe}();return Object.assign(Ke,{abort:Ve,requestId:He,arg:Be,unwrap(){return Ke.then(unwrapResult)}})}}return Object.assign($e,{pending:Me,rejected:De,fulfilled:Oe,settled:isAnyOf(De,Oe),typePrefix:Re})}return Ee.withTypes=()=>Ee,Ee})();function unwrapResult(Ee){if(Ee.meta&&Ee.meta.rejectedWithValue)throw Ee.payload;if(Ee.error)throw Ee.error;return Ee.payload}function isThenable$1(Ee){return Ee!==null&&typeof Ee=="object"&&typeof Ee.then=="function"}var asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType(Ee,Re){return`${Ee}/${Re}`}function buildCreateSlice({creators:Ee}={}){var Te;const Re=(Te=Ee==null?void 0:Ee.asyncThunk)==null?void 0:Te[asyncThunkSymbol];return function(Oe){const{name:Me,reducerPath:De=Me}=Oe;if(!Me)throw new Error(formatProdErrorMessage(11));const $e=(typeof Oe.reducers=="function"?Oe.reducers(buildReducerCreators()):Oe.reducers)||{},Be=Object.keys($e),Ue={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},ze={addCase(Ze,Je){const ir=typeof Ze=="string"?Ze:Ze.type;if(!ir)throw new Error(formatProdErrorMessage(12));if(ir in Ue.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return Ue.sliceCaseReducersByType[ir]=Je,ze},addMatcher(Ze,Je){return Ue.sliceMatchers.push({matcher:Ze,reducer:Je}),ze},exposeAction(Ze,Je){return Ue.actionCreators[Ze]=Je,ze},exposeCaseReducer(Ze,Je){return Ue.sliceCaseReducersByName[Ze]=Je,ze}};Be.forEach(Ze=>{const Je=$e[Ze],ir={reducerName:Ze,type:getType(Me,Ze),createNotation:typeof Oe.reducers=="function"};isAsyncThunkSliceReducerDefinition(Je)?handleThunkCaseReducerDefinition(ir,Je,ze,Re):handleNormalReducerDefinition(ir,Je,ze)});function We(){const[Ze={},Je=[],ir=void 0]=typeof Oe.extraReducers=="function"?executeReducerBuilderCallback(Oe.extraReducers):[Oe.extraReducers],rr={...Ze,...Ue.sliceCaseReducersByType};return createReducer(Oe.initialState,ar=>{for(let or in rr)ar.addCase(or,rr[or]);for(let or of Ue.sliceMatchers)ar.addMatcher(or.matcher,or.reducer);for(let or of Je)ar.addMatcher(or.matcher,or.reducer);ir&&ar.addDefaultCase(ir)})}const Xe=Ze=>Ze,He=new Map,qe=new WeakMap;let Ge;function Ye(Ze,Je){return Ge||(Ge=We()),Ge(Ze,Je)}function Ve(){return Ge||(Ge=We()),Ge.getInitialState()}function Ke(Ze,Je=!1){function ir(ar){let or=ar[Ze];return typeof or>"u"&&Je&&(or=getOrInsertComputed(qe,ir,Ve)),or}function rr(ar=Xe){const or=getOrInsertComputed(He,Je,()=>new WeakMap);return getOrInsertComputed(or,ar,()=>{const pr={};for(const[tr,nr]of Object.entries(Oe.selectors??{}))pr[tr]=wrapSelector(nr,ar,()=>getOrInsertComputed(qe,ar,Ve),Je);return pr})}return{reducerPath:Ze,getSelectors:rr,get selectors(){return rr(ir)},selectSlice:ir}}const Qe={name:Me,reducer:Ye,actions:Ue.actionCreators,caseReducers:Ue.sliceCaseReducersByName,getInitialState:Ve,...Ke(De),injectInto(Ze,{reducerPath:Je,...ir}={}){const rr=Je??De;return Ze.inject({reducerPath:rr,reducer:Ye},ir),{...Qe,...Ke(rr,!0)}}};return Qe}}function wrapSelector(Ee,Re,Te,je){function Oe(Me,...De){let $e=Re(Me);return typeof $e>"u"&&je&&($e=Te()),Ee($e,...De)}return Oe.unwrapped=Ee,Oe}
37var createSlice=buildCreateSlice();function buildReducerCreators(){function Ee(Re,Te){return{_reducerDefinitionType:"asyncThunk",payloadCreator:Re,...Te}}return Ee.withTypes=()=>Ee,{reducer(Re){return Object.assign({[Re.name](...Te){return Re(...Te)}}[Re.name],{_reducerDefinitionType:"reducer"})},preparedReducer(Re,Te){return{_reducerDefinitionType:"reducerWithPrepare",prepare:Re,reducer:Te}},asyncThunk:Ee}}function handleNormalReducerDefinition({type:Ee,reducerName:Re,createNotation:Te},je,Oe){let Me,De;if("reducer"in je){if(Te&&!isCaseReducerWithPrepareDefinition(je))throw new Error(formatProdErrorMessage(17));Me=je.reducer,De=je.prepare}else Me=je;Oe.addCase(Ee,Me).exposeCaseReducer(Re,Me).exposeAction(Re,De?createAction(Ee,De):createAction(Ee))}function isAsyncThunkSliceReducerDefinition(Ee){return Ee._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(Ee){return Ee._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:Ee,reducerName:Re},Te,je,Oe){if(!Oe)throw new Error(formatProdErrorMessage(18));const{payloadCreator:Me,fulfilled:De,pending:$e,rejected:Be,settled:Ue,options:ze}=Te,We=Oe(Ee,Me,ze);je.exposeAction(Re,We),De&&je.addCase(We.fulfilled,De),$e&&je.addCase(We.pending,$e),Be&&je.addCase(We.rejected,Be),Ue&&je.addMatcher(We.settled,Ue),je.exposeCaseReducer(Re,{fulfilled:De||noop$3,pending:$e||noop$3,rejected:Be||noop$3,settled:Ue||noop$3})}function noop$3(){}var task="task",listener="listener",completed="completed",cancelled="cancelled",taskCancelled=`task-${cancelled}`,taskCompleted=`task-${completed}`,listenerCancelled=`${listener}-${cancelled}`,listenerCompleted=`${listener}-${completed}`,TaskAbortError=class{constructor(Ee){Es(this,"name","TaskAbortError");Es(this,"message");this.code=Ee,this.message=`${task} ${cancelled} (reason: ${Ee})`}},assertFunction=(Ee,Re)=>{if(typeof Ee!="function")throw new TypeError(formatProdErrorMessage(32))},noop2=()=>{},catchRejection=(Ee,Re=noop2)=>(Ee.catch(Re),Ee),addAbortSignalListener=(Ee,Re)=>(Ee.addEventListener("abort",Re,{once:!0}),()=>Ee.removeEventListener("abort",Re)),validateActive=Ee=>{if(Ee.aborted)throw new TaskAbortError(Ee.reason)};function raceWithSignal(Ee,Re){let Te=noop2;return new Promise((je,Oe)=>{const Me=()=>Oe(new TaskAbortError(Ee.reason));if(Ee.aborted){Me();return}Te=addAbortSignalListener(Ee,Me),Re.finally(()=>Te()).then(je,Oe)}).finally(()=>{Te=noop2})}var runTask=async(Ee,Re)=>{try{return await Promise.resolve(),{status:"ok",value:await Ee()}}catch(Te){return{status:Te instanceof TaskAbortError?"cancelled":"rejected",error:Te}}finally{Re==null||Re()}},createPause=Ee=>Re=>catchRejection(raceWithSignal(Ee,Re).then(Te=>(validateActive(Ee),Te))),createDelay=Ee=>{const Re=createPause(Ee);return Te=>Re(new Promise(je=>setTimeout(je,Te)))},{assign:assign$2}=Object,INTERNAL_NIL_TOKEN={},alm="listenerMiddleware",createFork=(Ee,Re)=>{const Te=je=>addAbortSignalListener(Ee,()=>je.abort(Ee.reason));return(je,Oe)=>{assertFunction(je);const Me=new AbortController;Te(Me);const De=runTask(async()=>{validateActive(Ee),validateActive(Me.signal);const $e=await je({pause:createPause(Me.signal),delay:createDelay(Me.signal),signal:Me.signal});return validateActive(Me.signal),$e},()=>Me.abort(taskCompleted));return Oe!=null&&Oe.autoJoin&&Re.push(De.catch(noop2)),{result:createPause(Ee)(De),cancel(){Me.abort(taskCancelled)}}}},createTakePattern=(Ee,Re)=>{const Te=async(je,Oe)=>{validateActive(Re);let Me=()=>{};const $e=[new Promise((Be,Ue)=>{let ze=Ee({predicate:je,effect:(We,Xe)=>{Xe.unsubscribe(),Be([We,Xe.getState(),Xe.getOriginalState()])}});Me=()=>{ze(),Ue()}})];Oe!=null&&$e.push(new Promise(Be=>setTimeout(Be,Oe,null)));try{const Be=await raceWithSignal(Re,Promise.race($e));return validateActive(Re),Be}finally{Me()}};return(je,Oe)=>catchRejection(Te(je,Oe))},getListenerEntryPropsFrom=Ee=>{let{type:Re,actionCreator:Te,matcher:je,predicate:Oe,effect:Me}=Ee;if(Re)Oe=createAction(Re).match;else if(Te)Re=Te.type,Oe=Te.match;else if(je)Oe=je;else if(!Oe)throw new Error(formatProdErrorMessage(21));return assertFunction(Me),{predicate:Oe,type:Re,effect:Me}},createListenerEntry=assign$2(Ee=>{const{type:Re,predicate:Te,effect:je}=getListenerEntryPropsFrom(Ee);return{id:nanoid(),effect:je,type:Re,predicate:Te,pending:new Set,unsubscribe:()=>{throw new Error(formatProdErrorMessage(22))}}},{withTypes:()=>createListenerEntry}),findListenerEntry=(Ee,Re)=>{const{type:Te,effect:je,predicate:Oe}=getListenerEntryPropsFrom(Re);return Array.from(Ee.values()).find(Me=>(typeof Te=="string"?Me.type===Te:Me.predicate===Oe)&&Me.effect===je)},cancelActiveListeners=Ee=>{Ee.pending.forEach(Re=>{Re.abort(listenerCancelled)})},createClearListenerMiddleware=(Ee,Re)=>()=>{for(const Te of Re.keys())cancelActiveListeners(Te);Ee.clear()},safelyNotifyError=(Ee,Re,Te)=>{try{Ee(Re,Te)}catch(je){setTimeout(()=>{throw je},0)}},addListener=assign$2(createAction(`${alm}/add`),{withTypes:()=>addListener}),clearAllListeners=createAction(`${alm}/removeAll`),removeListener=assign$2(createAction(`${alm}/remove`),{withTypes:()=>removeListener}),defaultErrorHandler=(...Ee)=>{console.error(`${alm}/error`,...Ee)},createListenerMiddleware=(Ee={})=>{const Re=new Map,Te=new Map,je=He=>{const qe=Te.get(He)??0;Te.set(He,qe+1)},Oe=He=>{const qe=Te.get(He)??1;qe===1?Te.delete(He):Te.set(He,qe-1)},{extra:Me,onError:De=defaultErrorHandler}=Ee;assertFunction(De);const $e=He=>(He.unsubscribe=()=>Re.delete(He.id),Re.set(He.id,He),qe=>{He.unsubscribe(),qe!=null&&qe.cancelActive&&cancelActiveListeners(He)}),Be=He=>{const qe=findListenerEntry(Re,He)??createListenerEntry(He);return $e(qe)};assign$2(Be,{withTypes:()=>Be});const Ue=He=>{const qe=findListenerEntry(Re,He);return qe&&(qe.unsubscribe(),He.cancelActive&&cancelActiveListeners(qe)),!!qe};assign$2(Ue,{withTypes:()=>Ue});const ze=async(He,qe,Ge,Ye)=>
37{const Ve=new AbortController,Ke=createTakePattern(Be,Ve.signal),Qe=[];try{He.pending.add(Ve),je(He),await Promise.resolve(He.effect(qe,assign$2({},Ge,{getOriginalState:Ye,condition:(Ze,Je)=>Ke(Ze,Je).then(Boolean),take:Ke,delay:createDelay(Ve.signal),pause:createPause(Ve.signal),extra:Me,signal:Ve.signal,fork:createFork(Ve.signal,Qe),unsubscribe:He.unsubscribe,subscribe:()=>{Re.set(He.id,He)},cancelActiveListeners:()=>{He.pending.forEach((Ze,Je,ir)=>{Ze!==Ve&&(Ze.abort(listenerCancelled),ir.delete(Ze))})},cancel:()=>{Ve.abort(listenerCancelled),He.pending.delete(Ve)},throwIfCancelled:()=>{validateActive(Ve.signal)}})))}catch(Ze){Ze instanceof TaskAbortError||safelyNotifyError(De,Ze,{raisedBy:"effect"})}finally{await Promise.all(Qe),Ve.abort(listenerCompleted),Oe(He),He.pending.delete(Ve)}},We=createClearListenerMiddleware(Re,Te);return{middleware:He=>qe=>Ge=>{if(!isAction(Ge))return qe(Ge);if(addListener.match(Ge))return Be(Ge.payload);if(clearAllListeners.match(Ge)){We();return}if(removeListener.match(Ge))return Ue(Ge.payload);let Ye=He.getState();const Ve=()=>{if(Ye===INTERNAL_NIL_TOKEN)throw new Error(formatProdErrorMessage(23));return Ye};let Ke;try{if(Ke=qe(Ge),Re.size>0){const Qe=He.getState(),Ze=Array.from(Re.values());for(const Je of Ze){let ir=!1;try{ir=Je.predicate(Ge,Qe,Ye)}catch(rr){ir=!1,safelyNotifyError(De,rr,{raisedBy:"predicate"})}ir&&ze(Je,Ge,He,Ve)}}}finally{Ye=INTERNAL_NIL_TOKEN}return Ke},startListening:Be,stopListening:Ue,clearListeners:We}};function formatProdErrorMessage(Ee){return`Minified Redux Toolkit error #${Ee}; visit https://redux-toolkit.js.org/Errors?code=${Ee} for the full message or use the non-minified dev environment for full errors. `}var KEY_PREFIX="persist:",FLUSH="persist/FLUSH",REHYDRATE="persist/REHYDRATE",PAUSE="persist/PAUSE",PERSIST="persist/PERSIST",PURGE="persist/PURGE",REGISTER="persist/REGISTER",DEFAULT_VERSION=-1;function _typeof$2(Ee){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$2=function(Te){return typeof Te}:_typeof$2=function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},_typeof$2(Ee)}function ownKeys$2(Ee,Re){var Te=Object.keys(Ee);if(Object.getOwnPropertySymbols){var je=Object.getOwnPropertySymbols(Ee);Re&&(je=je.filter(function(Oe){return Object.getOwnPropertyDescriptor(Ee,Oe).enumerable})),Te.push.apply(Te,je)}return Te}function _objectSpread$2(Ee){for(var Re=1;Re<arguments.length;Re++){var Te=arguments[Re]!=null?arguments[Re]:{};Re%2?ownKeys$2(Te,!0).forEach(function(je){_defineProperty$2(Ee,je,Te[je])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ee,Object.getOwnPropertyDescriptors(Te)):ownKeys$2(Te).forEach(function(je){Object.defineProperty(Ee,je,Object.getOwnPropertyDescriptor(Te,je))})}return Ee}function _defineProperty$2(Ee,Re,Te){return Re in Ee?Object.defineProperty(Ee,Re,{value:Te,enumerable:!0,configurable:!0,writable:!0}):Ee[Re]=Te,Ee}function autoMergeLevel1(Ee,Re,Te,je){je.debug;var Oe=_objectSpread$2({},Te);return Ee&&_typeof$2(Ee)==="object"&&Object.keys(Ee).forEach(function(Me){Me!=="_persist"&&Re[Me]===Te[Me]&&(Oe[Me]=Ee[Me])}),Oe}function createPersistoid(Ee){var Re=Ee.blacklist||null,Te=Ee.whitelist||null,je=Ee.transforms||[],Oe=Ee.throttle||0,Me="".concat(Ee.keyPrefix!==void 0?Ee.keyPrefix:KEY_PREFIX).concat(Ee.key),De=Ee.storage,$e;Ee.serialize===!1?$e=function(Je){return Je}:typeof Ee.serialize=="function"?$e=Ee.serialize:$e=defaultSerialize;var Be=Ee.writeFailHandler||null,Ue={},ze={},We=[],Xe=null,He=null,qe=function(Je){Object.keys(Je).forEach(function(ir){Ve(ir)&&Ue[ir]!==Je[ir]&&We.indexOf(ir)===-1&&We.push(ir)}),Object.keys(Ue).forEach(function(ir){Je[ir]===void 0&&Ve(ir)&&We.indexOf(ir)===-1&&Ue[ir]!==void 0&&We.push(ir)}),Xe===null&&(Xe=setInterval(Ge,Oe)),Ue=Je};function Ge(){if(We.length===0){Xe&&clearInterval(Xe),Xe=null;return}var Ze=We.shift(),Je=je.reduce(function(ir,rr){return rr.in(ir,Ze,Ue)},Ue[Ze]);if(Je!==void 0)try{ze[Ze]=$e(Je)}catch(ir){console.error("redux-persist/createPersistoid: error serializing state",ir)}else delete ze[Ze];We.length===0&&Ye()}function Ye(){Object.keys(ze).forEach(function(Ze){Ue[Ze]===void 0&&delete ze[Ze]}),He=De.setItem(Me,$e(ze)).catch(Ke)}function Ve(Ze){return!(Te&&Te.indexOf(Ze)===-1&&Ze!=="_persist"||Re&&Re.indexOf(Ze)!==-1)}function Ke(Ze){Be&&Be(Ze)}var Qe=function(){for(;We.length!==0;)Ge();return He||Promise.resolve()};return{update:qe,flush:Qe}}function defaultSerialize(Ee){return JSON.stringify(Ee)}function getStoredState(Ee){var Re=Ee.transforms||[],Te="".concat(Ee.keyPrefix!==void 0?Ee.keyPrefix:KEY_PREFIX).concat(Ee.key),je=Ee.storage;Ee.debug;var Oe;return Ee.deserialize===!1?Oe=function(De){return De}:typeof Ee.deserialize=="function"?Oe=Ee.deserialize:Oe=defaultDeserialize,je.getItem(Te).then(function(Me){if(Me)try{var De={},$e=Oe(Me);return Object.keys($e).forEach(function(Be){De[Be]=Re.reduceRight(function(Ue,ze){return ze.out(Ue,Be,$e)},Oe($e[Be]))}),De}catch(Be){throw Be}else return})}function defaultDeserialize(Ee){return JSON.parse(Ee)}function purgeStoredState(Ee){var Re=Ee.storage,Te="".concat(Ee.keyPrefix!==void 0?Ee.keyPrefix:KEY_PREFIX).concat(Ee.key);return Re.removeItem(Te,warnIfRemoveError)}function warnIfRemoveError(Ee){}function ownKeys$1(Ee,Re){var Te=Object.keys(Ee);if(Object.getOwnPropertySymbols){var je=Object.getOwnPropertySymbols(Ee);Re&&(je=je.filter(function(Oe){return Object.getOwnPropertyDescriptor(Ee,Oe).enumerable})),Te.push.apply(Te,je)}return Te}function _objectSpread$1(Ee){for(var Re=1;Re<arguments.length;Re++){var Te=arguments[Re]!=null?arguments[Re]:{};
vendor: 4,847 bytes, line 37
37Re%2?ownKeys$1(Te,!0).forEach(function(je){_defineProperty$1(Ee,je,Te[je])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ee,Object.getOwnPropertyDescriptors(Te)):ownKeys$1(Te).forEach(function(je){Object.defineProperty(Ee,je,Object.getOwnPropertyDescriptor(Te,je))})}return Ee}function _defineProperty$1(Ee,Re,Te){return Re in Ee?Object.defineProperty(Ee,Re,{value:Te,enumerable:!0,configurable:!0,writable:!0}):Ee[Re]=Te,Ee}function _objectWithoutProperties(Ee,Re){if(Ee==null)return{};var Te=_objectWithoutPropertiesLoose$1(Ee,Re),je,Oe;if(Object.getOwnPropertySymbols){var Me=Object.getOwnPropertySymbols(Ee);for(Oe=0;Oe<Me.length;Oe++)je=Me[Oe],!(Re.indexOf(je)>=0)&&Object.prototype.propertyIsEnumerable.call(Ee,je)&&(Te[je]=Ee[je])}return Te}function _objectWithoutPropertiesLoose$1(Ee,Re){if(Ee==null)return{};var Te={},je=Object.keys(Ee),Oe,Me;for(Me=0;Me<je.length;Me++)Oe=je[Me],!(Re.indexOf(Oe)>=0)&&(Te[Oe]=Ee[Oe]);return Te}var DEFAULT_TIMEOUT=5e3;function persistReducer(Ee,Re){var Te=Ee.version!==void 0?Ee.version:DEFAULT_VERSION;Ee.debug;var je=Ee.stateReconciler===void 0?autoMergeLevel1:Ee.stateReconciler,Oe=Ee.getStoredState||getStoredState,Me=Ee.timeout!==void 0?Ee.timeout:DEFAULT_TIMEOUT,De=null,$e=!1,Be=!0,Ue=function(We){return We._persist.rehydrated&&De&&!Be&&De.update(We),We};return function(ze,We){var Xe=ze||{},He=Xe._persist,qe=_objectWithoutProperties(Xe,["_persist"]),Ge=qe;if(We.type===PERSIST){var Ye=!1,Ve=function(ar,or){Ye||(We.rehydrate(Ee.key,ar,or),Ye=!0)};if(Me&&setTimeout(function(){!Ye&&Ve(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(Ee.key,'"')))},Me),Be=!1,De||(De=createPersistoid(Ee)),He)return _objectSpread$1({},Re(Ge,We),{_persist:He});if(typeof We.rehydrate!="function"||typeof We.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return We.register(Ee.key),Oe(Ee).then(function(rr){var ar=Ee.migrate||function(or,pr){return Promise.resolve(or)};ar(rr,Te).then(function(or){Ve(or)},function(or){Ve(void 0,or)})},function(rr){Ve(void 0,rr)}),_objectSpread$1({},Re(Ge,We),{_persist:{version:Te,rehydrated:!1}})}else{if(We.type===PURGE)return $e=!0,We.result(purgeStoredState(Ee)),_objectSpread$1({},Re(Ge,We),{_persist:He});if(We.type===FLUSH)return We.result(De&&De.flush()),_objectSpread$1({},Re(Ge,We),{_persist:He});if(We.type===PAUSE)Be=!0;else if(We.type===REHYDRATE){if($e)return _objectSpread$1({},Ge,{_persist:_objectSpread$1({},He,{rehydrated:!0})});if(We.key===Ee.key){var Ke=Re(Ge,We),Qe=We.payload,Ze=je!==!1&&Qe!==void 0?je(Qe,ze,Ke,Ee):Ke,Je=_objectSpread$1({},Ze,{_persist:_objectSpread$1({},He,{rehydrated:!0})});return Ue(Je)}}}if(!He)return Re(ze,We);var ir=Re(Ge,We);return ir===Ge?ze:Ue(_objectSpread$1({},ir,{_persist:He}))}}function _toConsumableArray(Ee){return _arrayWithoutHoles(Ee)||_iterableToArray(Ee)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(Ee){if(Symbol.iterator in Object(Ee)||Object.prototype.toString.call(Ee)==="[object Arguments]")return Array.from(Ee)}function _arrayWithoutHoles(Ee){if(Array.isArray(Ee)){for(var Re=0,Te=new Array(Ee.length);Re<Ee.length;Re++)Te[Re]=Ee[Re];return Te}}function ownKeys(Ee,Re){var Te=Object.keys(Ee);if(Object.getOwnPropertySymbols){var je=Object.getOwnPropertySymbols(Ee);Re&&(je=je.filter(function(Oe){return Object.getOwnPropertyDescriptor(Ee,Oe).enumerable})),Te.push.apply(Te,je)}return Te}function _objectSpread(Ee){for(var Re=1;Re<arguments.length;Re++){var Te=arguments[Re]!=null?arguments[Re]:{};Re%2?ownKeys(Te,!0).forEach(function(je){_defineProperty(Ee,je,Te[je])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ee,Object.getOwnPropertyDescriptors(Te)):ownKeys(Te).forEach(function(je){Object.defineProperty(Ee,je,Object.getOwnPropertyDescriptor(Te,je))})}return Ee}function _defineProperty(Ee,Re,Te){return Re in Ee?Object.defineProperty(Ee,Re,{value:Te,enumerable:!0,configurable:!0,writable:!0}):Ee[Re]=Te,Ee}var initialState$f={registry:[],bootstrapped:!1},persistorReducer=function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:initialState$f,Te=arguments.length>1?arguments[1]:void 0;switch(Te.type){case REGISTER:return _objectSpread({},Re,{registry:[].concat(_toConsumableArray(Re.registry),[Te.key])});case REHYDRATE:var je=Re.registry.indexOf(Te.key),Oe=_toConsumableArray(Re.registry);return Oe.splice(je,1),_objectSpread({},Re,{registry:Oe,bootstrapped:Oe.length===0});default:return Re}};function persistStore(Ee,Re,Te){var je=createStore(persistorReducer,initialState$f,void 0),Oe=function(Be){je.dis
37patch({type:REGISTER,key:Be})},Me=function(Be,Ue,ze){var We={type:REHYDRATE,payload:Ue,err:ze,key:Be};Ee.dispatch(We),je.dispatch(We)},De=_objectSpread({},je,{purge:function(){var Be=[];return Ee.dispatch({type:PURGE,result:function(ze){Be.push(ze)}}),Promise.all(Be)},flush:function(){var Be=[];return Ee.dispatch({type:FLUSH,result:function(ze){Be.push(ze)}}),Promise.all(Be)},pause:function(){Ee.dispatch({type:PAUSE})},persist:function(){Ee.dispatch({type:PERSIST,register:Oe,rehydrate:Me})}});return De.persist(),De}var createWebStorage$1={},getStorage$1={};getStorage$1.__esModule=!0;getStorage$1.default=getStorage;function _typeof$1(Ee){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$1=function(Te){return typeof Te}:_typeof$1=function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},_typeof$1(Ee)}function noop$2(){}var noopStorage={getItem:noop$2,setItem:noop$2,removeItem:noop$2};function hasStorage(Ee){if((typeof self>"u"?"undefined":_typeof$1(self))!=="object"||!(Ee in self))return!1;try{var Re=self[Ee],Te="redux-persist ".concat(Ee," test");Re.setItem(Te,"test"),Re.getItem(Te),Re.removeItem(Te)}catch{return!1}return!0}function getStorage(Ee){var Re="".concat(Ee,"Storage");return hasStorage(Re)?self[Re]:noopStorage}createWebStorage$1.__esModule=!0;createWebStorage$1.default=createWebStorage;var _getStorage=_interopRequireDefault$7(getStorage$1);function _interopRequireDefault$7(Ee){return Ee&&Ee.__esModule?Ee:{default:Ee}}function createWebStorage(Ee){var Re=(0,_getStorage.default)(Ee);return{getItem:function(je){return new Promise(function(Oe,Me){Oe(Re.getItem(je))})},setItem:function(je,Oe){return new Promise(function(Me,De){Me(Re.setItem(je,Oe))})},removeItem:function(je){return new Promise(function(Oe,Me){Oe(Re.removeItem(je))})}}}var default_1$5=void 0,_createWebStorage=_interopRequireDefault$6(createWebStorage$1);function _interopRequireDefault$6(Ee){return Ee&&Ee.__esModule?Ee:{default:Ee}}var _default$1=(0,_createWebStorage.default)("local");default_1$5=_default$1;function bind(Ee,Re){return function(){return Ee.apply(Re,arguments)}}const{toString:toString$1}=Object.prototype,{getPrototypeOf:getPrototypeOf$1}=Object,{iterator,toStringTag}=Symbol,kindOf=(Ee=>Re=>{const Te=toString$1.call(Re);return Ee[Te]||(Ee[Te]=Te.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=Ee=>(Ee=Ee.toLowerCase(),Re=>kindOf(Re)===Ee),typeOfTest=Ee=>Re=>typeof Re===Ee,{isArray}=Array,isUndefined=typeOfTest("undefined");function isBuffer(Ee){return Ee!==null&&!isUndefined(Ee)&&Ee.constructor!==null&&!isUndefined(Ee.constructor)&&isFunction$1(Ee.constructor.isBuffer)&&Ee.constructor.isBuffer(Ee)}const isArrayBuffer$1=kindOfTest("ArrayBuffer");function isArrayBufferView(Ee){let Re;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?Re=ArrayBuffer.isView(Ee):Re=Ee&&Ee.buffer&&isArrayBuffer$1(Ee.buffer),Re}const isString$2=typeOfTest("string"),isFunction$1=typeOfTest("function"),isNumber=typeOfTest("number"),isObject$1=Ee=>Ee!==null&&typeof Ee=="object",isBoolean=Ee=>Ee===!0||Ee===!1,isPlainObject$1=Ee=>{if(kindOf(Ee)!=="object")return!1;const Re=getPrototypeOf$1(Ee);return(Re===null||Re===Object.prototype||Object.getPrototypeOf(Re)===null)&&!(toStringTag in Ee)&&!(iterator in Ee)},isEmptyObject=Ee=>{if(!isObject$1(Ee)||isBuffer(Ee))return!1;try{return Object.keys(Ee).length===0&&Object.getPrototypeOf(Ee)===Object.prototype}catch{return!1}},isDate=kindOfTest("Date"),isFile$1=kindOfTest("File"),isBlob$1=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=Ee=>isObject$1(Ee)&&isFunction$1(Ee.pipe),isFormData=Ee=>{let Re;return Ee&&(typeof FormData=="function"&&Ee instanceof FormData||isFunction$1(Ee.append)&&((Re=kindOf(Ee))==="formdata"||Re==="object"&&isFunction$1(Ee.toString)&&Ee.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),[isReadableStream,isRequest,isResponse,isHeaders]=["ReadableStream","Request","Response","Headers"].map(kindOfTest),trim$1=Ee=>Ee.trim?Ee.trim():Ee.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(Ee,Re,{allOwnKeys:Te=!1}={}){if(Ee===null||typeof Ee>"u")return;let je,Oe;if(typeof Ee!="object"&&(Ee=[Ee]),isArray(Ee))for(je=0,Oe=Ee.length;je<Oe;je++)Re.call(null,Ee[je],je,Ee);else{if(isBuffer(Ee))return;const Me=Te?Object.getOwnPropertyNames(Ee):Object.keys(Ee),De=Me.length;let $e;for(je=0;je<De;je++)$e=Me[je],Re.call(null,Ee[$e],$e,Ee)}}function findKey(Ee,Re){if(isBuffer(Ee))return null;Re=Re.toLowerCase();const Te=Object.keys(Ee);let je=Te.length,Oe;for(;je-- >0;)if(Oe=Te[je],Re===Oe.toLowerCase())return Oe;return null}const _global=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,isContextDefined=Ee=>!isUndefined(Ee)&&Ee!==_global;function merge$1(){const{caseless:Ee,skipUndefined:Re}=isContextDefined(this)&&this||{},Te={},je=(Oe,Me)=>{if(Me==="__proto__"||Me==="constructor"||Me==="prototype")return;const De=Ee&&findKey(Te,Me)||Me;isPlainObject$1(Te[De])&&isPlainObject$1(Oe)?Te[De]=merge$1(Te[De],Oe):isPlainObject$1(Oe)?Te[De]=merge$1({},Oe):isArray(Oe)?Te[De]=Oe.slice():(!Re||!isUndefined(Oe))&&(Te[De]=Oe)};for(let Oe=0,Me=arguments.length;Oe<Me;Oe++)arguments[Oe]&&forEach(arguments[Oe],je);return Te}const extend=(Ee,Re,Te,{allOwnKeys:je}={})=>(forEach(Re,(Oe,Me)=>{Te&&isFunction$1(Oe)?Object.defineProperty(Ee,Me,{value:bind(Oe,Te),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(Ee,Me,{value:Oe,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:je}),Ee),stripBOM=Ee=>(Ee.charCodeAt(0)===65279&&(Ee=Ee.slice(1)),Ee),inherits=(Ee,Re,Te,je)=>{Ee.prototype=Object.create(Re.prototype,je),Object.defineProperty(Ee.prototype,"constructor",{value:Ee,writable:!0,enumerable:!1,
vendor: 10,585 bytes, line 37
37configurable:!0}),Object.defineProperty(Ee,"super",{value:Re.prototype}),Te&&Object.assign(Ee.prototype,Te)},toFlatObject=(Ee,Re,Te,je)=>{let Oe,Me,De;const $e={};if(Re=Re||{},Ee==null)return Re;do{for(Oe=Object.getOwnPropertyNames(Ee),Me=Oe.length;Me-- >0;)De=Oe[Me],(!je||je(De,Ee,Re))&&!$e[De]&&(Re[De]=Ee[De],$e[De]=!0);Ee=Te!==!1&&getPrototypeOf$1(Ee)}while(Ee&&(!Te||Te(Ee,Re))&&Ee!==Object.prototype);return Re},endsWith=(Ee,Re,Te)=>{Ee=String(Ee),(Te===void 0||Te>Ee.length)&&(Te=Ee.length),Te-=Re.length;const je=Ee.indexOf(Re,Te);return je!==-1&&je===Te},toArray=Ee=>{if(!Ee)return null;if(isArray(Ee))return Ee;let Re=Ee.length;if(!isNumber(Re))return null;const Te=new Array(Re);for(;Re-- >0;)Te[Re]=Ee[Re];return Te},isTypedArray$1=(Ee=>Re=>Ee&&Re instanceof Ee)(typeof Uint8Array<"u"&&getPrototypeOf$1(Uint8Array)),forEachEntry=(Ee,Re)=>{const je=(Ee&&Ee[iterator]).call(Ee);let Oe;for(;(Oe=je.next())&&!Oe.done;){const Me=Oe.value;Re.call(Ee,Me[0],Me[1])}},matchAll=(Ee,Re)=>{let Te;const je=[];for(;(Te=Ee.exec(Re))!==null;)je.push(Te);return je},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=Ee=>Ee.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(Te,je,Oe){return je.toUpperCase()+Oe}),hasOwnProperty=(({hasOwnProperty:Ee})=>(Re,Te)=>Ee.call(Re,Te))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(Ee,Re)=>{const Te=Object.getOwnPropertyDescriptors(Ee),je={};forEach(Te,(Oe,Me)=>{let De;(De=Re(Oe,Me,Ee))!==!1&&(je[Me]=De||Oe)}),Object.defineProperties(Ee,je)},freezeMethods=Ee=>{reduceDescriptors(Ee,(Re,Te)=>{if(isFunction$1(Ee)&&["arguments","caller","callee"].indexOf(Te)!==-1)return!1;const je=Ee[Te];if(isFunction$1(je)){if(Re.enumerable=!1,"writable"in Re){Re.writable=!1;return}Re.set||(Re.set=()=>{throw Error("Can not rewrite read-only method '"+Te+"'")})}})},toObjectSet=(Ee,Re)=>{const Te={},je=Oe=>{Oe.forEach(Me=>{Te[Me]=!0})};return isArray(Ee)?je(Ee):je(String(Ee).split(Re)),Te},noop$1=()=>{},toFiniteNumber=(Ee,Re)=>Ee!=null&&Number.isFinite(Ee=+Ee)?Ee:Re;function isSpecCompliantForm(Ee){return!!(Ee&&isFunction$1(Ee.append)&&Ee[toStringTag]==="FormData"&&Ee[iterator])}const toJSONObject=Ee=>{const Re=new Array(10),Te=(je,Oe)=>{if(isObject$1(je)){if(Re.indexOf(je)>=0)return;if(isBuffer(je))return je;if(!("toJSON"in je)){Re[Oe]=je;const Me=isArray(je)?[]:{};return forEach(je,(De,$e)=>{const Be=Te(De,Oe+1);!isUndefined(Be)&&(Me[$e]=Be)}),Re[Oe]=void 0,Me}}return je};return Te(Ee,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=Ee=>Ee&&(isObject$1(Ee)||isFunction$1(Ee))&&isFunction$1(Ee.then)&&isFunction$1(Ee.catch),_setImmediate=((Ee,Re)=>Ee?setImmediate:Re?((Te,je)=>(_global.addEventListener("message",({source:Oe,data:Me})=>{Oe===_global&&Me===Te&&je.length&&je.shift()()},!1),Oe=>{je.push(Oe),_global.postMessage(Te,"*")}))(`axios@${Math.random()}`,[]):Te=>setTimeout(Te))(typeof setImmediate=="function",isFunction$1(_global.postMessage)),asap=typeof queueMicrotask<"u"?queueMicrotask.bind(_global):typeof process<"u"&&process.nextTick||_setImmediate,isIterable=Ee=>Ee!=null&&isFunction$1(Ee[iterator]),utils$2={isArray,isArrayBuffer:isArrayBuffer$1,isBuffer,isFormData,isArrayBufferView,isString:isString$2,isNumber,isBoolean,isObject:isObject$1,isPlainObject:isPlainObject$1,isEmptyObject,isReadableStream,isRequest,isResponse,isHeaders,isUndefined,isDate,isFile:isFile$1,isBlob:isBlob$1,isRegExp,isFunction:isFunction$1,isStream,isURLSearchParams,isTypedArray:isTypedArray$1,isFileList,forEach,merge:merge$1,extend,trim:trim$1,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$1,toFiniteNumber,findKey,global:_global,isContextDefined,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable,setImmediate:_setImmediate,asap,isIterable};let AxiosError$1=class _u extends Error{static from(Re,Te,je,Oe,Me,De){const $e=new _u(Re.message,Te||Re.code,je,Oe,Me);return $e.cause=Re,$e.name=Re.name,De&&Object.assign($e,De),$e}constructor(Re,Te,je,Oe,Me){super(Re),this.name="AxiosError",this.isAxiosError=!0,Te&&(this.code=Te),je&&(this.config=je),Oe&&(this.request=Oe),Me&&(this.response=Me,this.status=Me.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$2.toJSONObject(this.config),code:this.code,status:this.status}}};AxiosError$1.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";AxiosError$1.ERR_BAD_OPTION="ERR_BAD_OPTION";AxiosError$1.ECONNABORTED="ECONNABORTED";AxiosError$1.ETIMEDOUT="ETIMEDOUT";AxiosError$1.ERR_NETWORK="ERR_NETWORK";AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";AxiosError$1.ERR_DEPRECATED="ERR_DEPRECATED";AxiosError$1.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";AxiosError$1.ERR_BAD_REQUEST="ERR_BAD_REQUEST";AxiosError$1.ERR_CANCELED="ERR_CANCELED";AxiosError$1.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";AxiosError$1.ERR_INVALID_URL="ERR_INVALID_URL";const httpAdapter=null;function isVisitable(Ee){return utils$2.isPlainObject(Ee)||utils$2.isArray(Ee)}function removeBrackets(Ee){return utils$2.endsWith(Ee,"[]")?Ee.slice(0,-2):Ee}function renderKey(Ee,Re,Te){return Ee?Ee.concat(Re).map(function(Oe,Me){return Oe=removeBrackets(Oe),!Te&&Me?"["+Oe+"]":Oe}).join(Te?".":""):Re}function isFlatArray(Ee){return utils$2.isArray(Ee)&&!Ee.some(isVisitable)}const predicates=utils$2.toFlatObject(utils$2,{},null,function(Re){return/^is[A-Z]/.test(Re)});function toFormData$1(Ee,Re,Te){if(!utils$2.isObject(Ee))throw new TypeError("target must be an object");Re=Re||new FormData,Te=utils$2.toFlatObject(Te,{metaTokens:!0,dots:!1,indexes:!1},!1,function(Ge,Ye){return!utils$2.isUndefined(Ye[Ge])});const je=Te.metaTokens,Oe=Te.visitor||ze,Me=Te.dots,De=Te.indexes,Be=(Te.Blob||typeof Blob<"u"&&Blob)&&utils$2.isSpecCompliantForm(Re);if(!utils$2.isFunction(Oe))throw new TypeError("visitor must be a function");function Ue(qe){if(qe===null)return"";if(utils$2.isDate(qe))return qe.toISOString();if(utils$2.isBoolean(qe))return qe.toString();if(!Be&&utils$2.isBlob(qe))throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");return utils$2.isArrayBuffer(qe)||utils$2.isTypedArray(qe)?Be&&typeof Blob=="function"?new Blob([qe]):Buffer.from(qe):qe}function ze(qe,Ge,Ye){let Ve=qe;if(qe&&!Ye&&typeof qe=="object"){if(utils$2.endsWith(Ge,"{}"))Ge=je?Ge:Ge.slice(0,-2),qe=JSON.stringify(qe);else if(utils$2.isArray(qe)&&isFlatArray(qe)||(utils$2.isFileList(qe)||utils$2.endsWith(Ge,"[]"))&&(Ve=utils$2.toArray(qe)))return Ge=removeBrackets(Ge),Ve.forEach(function(Qe,Ze){!(utils$2.isUndefined(Qe)||Qe===null)&&Re.append(De===!0?renderKey([Ge],Ze,Me):De===null?Ge:Ge+"[]",Ue(Qe))}),!1}return isVisitable(qe)?!0:(Re.append(renderKey(Ye,Ge,Me),Ue(qe)),!1)}const We=[],Xe=Object.assign(predicates,{defaultVisitor:ze,convertValue:Ue,isVisitable});function He(qe,Ge){if(!utils$2.isUndefined(qe)){if(We.indexOf(qe)!==-1)throw Error("Circular reference detected in "+Ge.join("."));We.push(qe),utils$2.forEach(qe,function(Ve,Ke){(!(utils$2.isUndefined(Ve)||Ve===null)&&Oe.call(Re,Ve,utils$2.isString(Ke)?Ke.trim():Ke,Ge,Xe))===!0&&He(Ve,Ge?Ge.concat(Ke):[Ke])}),We.pop()}}if(!utils$2.isObject(Ee))throw new TypeError("data must be an object");return He(Ee),Re}function encode$2(Ee){const Re={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(Ee).replace(/[!'()~]|%20|%00/g,function(je){return Re[je]})}function AxiosURLSearchParams(Ee,Re){this._pairs=[],Ee&&toFormData$1(Ee,this,Re)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(Re,Te){this._pairs.push([Re,Te])};prototype.toString=function(Re){const Te=Re?function(je){return Re.call(this,je,encode$2)}:encode$2;return this._pairs.map(function(Oe){return Te(Oe[0])+"="+Te(Oe[1])},"").join("&")};function encode$1(Ee){return encodeURIComponent(Ee).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function buildURL(Ee,Re,Te){if(!Re)return Ee;const je=Te&&Te.encode||encode$1,Oe=utils$2.isFunction(Te)?{serialize:Te}:Te,Me=Oe&&Oe.serialize;let De;if(Me?De=Me(Re,Oe):De=utils$2.isURLSearchParams(Re)?Re.toString():new AxiosURLSearchParams(Re,Oe).toString(je),De){const $e=Ee.indexOf("#");$e!==-1&&(Ee=Ee.slice(0,$e)),Ee+=(Ee.indexOf("?")===-1?"?":"&")+De}return Ee}class InterceptorManager{constructor(){this.handlers=[]}use(Re,Te,je){return this.handlers.push({fulfilled:Re,rejected:Te,synchronous:je?je.synchronous:!1,runWhen:je?je.runWhen:null}),this.handlers.length-1}eject(Re){this.handlers[Re]&&(this.handlers[Re]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(Re){utils$2.forEach(this.handlers,function(je){je!==null&&Re(je)})}}const transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",_navigator=typeof navigator=="object"&&navigator||void 0,hasStandardBrowserEnv=hasBrowserEnv&&(!_navigator||["ReactNative","NativeScript","NS"].indexOf(_navigator.product)<0),hasStandardBrowserWebWorkerEnv=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",origin=hasBrowserEnv&&window.location.href||"http://localhost",utils$1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv,navigator:_navigator,origin},Symbol.toStringTag,{value:"Module"})),platform={...utils$1,...platform$1};function toURLEncodedForm(Ee,Re){return toFormData$1(Ee,new platform.classes.URLSearchParams,{visitor:function(Te,je,Oe,Me){return platform.isNode&&utils$2.isBuffer(Te)?(this.append(je,Te.toString("base64")),!1):Me.defaultVisitor.apply(this,arguments)},...Re})}function parsePropPath(Ee){return utils$2.matchAll(/\w+|\[(\w*)]/g,Ee).map(Re=>Re[0]==="[]"?"":Re[1]||Re[0])}function arrayToObject(Ee){const Re={},Te=Object.keys(Ee);let je;const Oe=Te.length;let Me;for(je=0;je<Oe;je++)Me=Te[je],Re[Me]=Ee[Me];return Re}function formDataToJSON(Ee){function Re(Te,je,Oe,Me){let De=Te[Me++];if(De==="__proto__")return!0;const $e=Number.isFinite(+De),Be=Me>=Te.length;
vendor: 4,253 bytes, lines 37-38
37return De=!De&&utils$2.isArray(Oe)?Oe.length:De,Be?(utils$2.hasOwnProp(Oe,De)?Oe[De]=[Oe[De],je]:Oe[De]=je,!$e):((!Oe[De]||!utils$2.isObject(Oe[De]))&&(Oe[De]=[]),Re(Te,je,Oe[De],Me)&&utils$2.isArray(Oe[De])&&(Oe[De]=arrayToObject(Oe[De])),!$e)}if(utils$2.isFormData(Ee)&&utils$2.isFunction(Ee.entries)){const Te={};return utils$2.forEachEntry(Ee,(je,Oe)=>{Re(parsePropPath(je),Oe,Te,0)}),Te}return null}function stringifySafely(Ee,Re,Te){if(utils$2.isString(Ee))try{return(Re||JSON.parse)(Ee),utils$2.trim(Ee)}catch(je){if(je.name!=="SyntaxError")throw je}return(Te||JSON.stringify)(Ee)}const defaults={transitional:transitionalDefaults,adapter:["xhr","http","fetch"],transformRequest:[function(Re,Te){const je=Te.getContentType()||"",Oe=je.indexOf("application/json")>-1,Me=utils$2.isObject(Re);if(Me&&utils$2.isHTMLForm(Re)&&(Re=new FormData(Re)),utils$2.isFormData(Re))return Oe?JSON.stringify(formDataToJSON(Re)):Re;if(utils$2.isArrayBuffer(Re)||utils$2.isBuffer(Re)||utils$2.isStream(Re)||utils$2.isFile(Re)||utils$2.isBlob(Re)||utils$2.isReadableStream(Re))return Re;if(utils$2.isArrayBufferView(Re))return Re.buffer;if(utils$2.isURLSearchParams(Re))return Te.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),Re.toString();let $e;if(Me){if(je.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(Re,this.formSerializer).toString();if(($e=utils$2.isFileList(Re))||je.indexOf("multipart/form-data")>-1){const Be=this.env&&this.env.FormData;return toFormData$1($e?{"files[]":Re}:Re,Be&&new Be,this.formSerializer)}}return Me||Oe?(Te.setContentType("application/json",!1),stringifySafely(Re)):Re}],transformResponse:[function(Re){const Te=this.transitional||defaults.transitional,je=Te&&Te.forcedJSONParsing,Oe=this.responseType==="json";if(utils$2.isResponse(Re)||utils$2.isReadableStream(Re))return Re;if(Re&&utils$2.isString(Re)&&(je&&!this.responseType||Oe)){const De=!(Te&&Te.silentJSONParsing)&&Oe;try{return JSON.parse(Re,this.parseReviver)}catch($e){if(De)throw $e.name==="SyntaxError"?AxiosError$1.from($e,AxiosError$1.ERR_BAD_RESPONSE,this,null,this.response):$e}}return Re}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(Re){return Re>=200&&Re<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$2.forEach(["delete","get","head","post","put","patch"],Ee=>{defaults.headers[Ee]={}});const ignoreDuplicateOf=utils$2.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=Ee=>{const Re={};let Te,je,Oe;return Ee&&Ee.split(` 38`).forEach(function(De){Oe=De.indexOf(":"),Te=De.substring(0,Oe).trim().toLowerCase(),je=De.substring(Oe+1).trim(),!(!Te||Re[Te]&&ignoreDuplicateOf[Te])&&(Te==="set-cookie"?Re[Te]?Re[Te].push(je):Re[Te]=[je]:Re[Te]=Re[Te]?Re[Te]+", "+je:je)}),Re},$internals=Symbol("internals");function normalizeHeader(Ee){return Ee&&String(Ee).trim().toLowerCase()}function normalizeValue(Ee){return Ee===!1||Ee==null?Ee:utils$2.isArray(Ee)?Ee.map(normalizeValue):String(Ee)}function parseTokens(Ee){const Re=Object.create(null),Te=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let je;for(;je=Te.exec(Ee);)Re[je[1]]=je[2];return Re}const isValidHeaderName=Ee=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(Ee.trim());function matchHeaderValue(Ee,Re,Te,je,Oe){if(utils$2.isFunction(je))return je.call(this,Re,Te);if(Oe&&(Re=Te),!!utils$2.isString(Re)){if(utils$2.isString(je))return Re.indexOf(je)!==-1;if(utils$2.isRegExp(je))return je.test(Re)}}function formatHeader(Ee){return Ee.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Re,Te,je)=>Te.toUpperCase()+je)}function buildAccessors(Ee,Re){const Te=utils$2.toCamelCase(" "+Re);["get","set","has"].forEach(je=>{Object.defineProperty(Ee,je+Te,{value:function(Oe,Me,De){return this[je].call(this,Re,Oe,Me,De)},configurable:!0})})}let AxiosHeaders$1=class{constructor(Re){Re&&this.set(Re)}set(Re,Te,je){const Oe=this;function Me($e,Be,Ue){const ze=normalizeHeader(Be);
vendor: 9,212 bytes, lines 38-39
38if(!ze)throw new Error("header name must be a non-empty string");const We=utils$2.findKey(Oe,ze);(!We||Oe[We]===void 0||Ue===!0||Ue===void 0&&Oe[We]!==!1)&&(Oe[We||Be]=normalizeValue($e))}const De=($e,Be)=>utils$2.forEach($e,(Ue,ze)=>Me(Ue,ze,Be));if(utils$2.isPlainObject(Re)||Re instanceof this.constructor)De(Re,Te);else if(utils$2.isString(Re)&&(Re=Re.trim())&&!isValidHeaderName(Re))De(parseHeaders(Re),Te);else if(utils$2.isObject(Re)&&utils$2.isIterable(Re)){let $e={},Be,Ue;for(const ze of Re){if(!utils$2.isArray(ze))throw TypeError("Object iterator must return a key-value pair");$e[Ue=ze[0]]=(Be=$e[Ue])?utils$2.isArray(Be)?[...Be,ze[1]]:[Be,ze[1]]:ze[1]}De($e,Te)}else Re!=null&&Me(Te,Re,je);return this}get(Re,Te){if(Re=normalizeHeader(Re),Re){const je=utils$2.findKey(this,Re);if(je){const Oe=this[je];if(!Te)return Oe;if(Te===!0)return parseTokens(Oe);if(utils$2.isFunction(Te))return Te.call(this,Oe,je);if(utils$2.isRegExp(Te))return Te.exec(Oe);throw new TypeError("parser must be boolean|regexp|function")}}}has(Re,Te){if(Re=normalizeHeader(Re),Re){const je=utils$2.findKey(this,Re);return!!(je&&this[je]!==void 0&&(!Te||matchHeaderValue(this,this[je],je,Te)))}return!1}delete(Re,Te){const je=this;let Oe=!1;function Me(De){if(De=normalizeHeader(De),De){const $e=utils$2.findKey(je,De);$e&&(!Te||matchHeaderValue(je,je[$e],$e,Te))&&(delete je[$e],Oe=!0)}}return utils$2.isArray(Re)?Re.forEach(Me):Me(Re),Oe}clear(Re){const Te=Object.keys(this);let je=Te.length,Oe=!1;for(;je--;){const Me=Te[je];(!Re||matchHeaderValue(this,this[Me],Me,Re,!0))&&(delete this[Me],Oe=!0)}return Oe}normalize(Re){const Te=this,je={};return utils$2.forEach(this,(Oe,Me)=>{const De=utils$2.findKey(je,Me);if(De){Te[De]=normalizeValue(Oe),delete Te[Me];return}const $e=Re?formatHeader(Me):String(Me).trim();$e!==Me&&delete Te[Me],Te[$e]=normalizeValue(Oe),je[$e]=!0}),this}concat(...Re){return this.constructor.concat(this,...Re)}toJSON(Re){const Te=Object.create(null);return utils$2.forEach(this,(je,Oe)=>{je!=null&&je!==!1&&(Te[Oe]=Re&&utils$2.isArray(je)?je.join(", "):je)}),Te}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([Re,Te])=>Re+": "+Te).join(` 39`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(Re){return Re instanceof this?Re:new this(Re)}static concat(Re,...Te){const je=new this(Re);return Te.forEach(Oe=>je.set(Oe)),je}static accessor(Re){const je=(this[$internals]=this[$internals]={accessors:{}}).accessors,Oe=this.prototype;function Me(De){const $e=normalizeHeader(De);je[$e]||(buildAccessors(Oe,De),je[$e]=!0)}return utils$2.isArray(Re)?Re.forEach(Me):Me(Re),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$2.reduceDescriptors(AxiosHeaders$1.prototype,({value:Ee},Re)=>{let Te=Re[0].toUpperCase()+Re.slice(1);return{get:()=>Ee,set(je){this[Te]=je}}});utils$2.freezeMethods(AxiosHeaders$1);function transformData(Ee,Re){const Te=this||defaults,je=Re||Te,Oe=AxiosHeaders$1.from(je.headers);let Me=je.data;return utils$2.forEach(Ee,function($e){Me=$e.call(Te,Me,Oe.normalize(),Re?Re.status:void 0)}),Oe.normalize(),Me}function isCancel$1(Ee){return!!(Ee&&Ee.__CANCEL__)}let CanceledError$1=class extends AxiosError$1{constructor(Re,Te,je){super(Re??"canceled",AxiosError$1.ERR_CANCELED,Te,je),this.name="CanceledError",this.__CANCEL__=!0}};function settle(Ee,Re,Te){const je=Te.config.validateStatus;!Te.status||!je||je(Te.status)?Ee(Te):Re(new AxiosError$1("Request failed with status code "+Te.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(Te.status/100)-4],Te.config,Te.request,Te))}function parseProtocol(Ee){const Re=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Ee);return Re&&Re[1]||""}function speedometer(Ee,Re){Ee=Ee||10;const Te=new Array(Ee),je=new Array(Ee);let Oe=0,Me=0,De;return Re=Re!==void 0?Re:1e3,function(Be){const Ue=Date.now(),ze=je[Me];De||(De=Ue),Te[Oe]=Be,je[Oe]=Ue;let We=Me,Xe=0;for(;We!==Oe;)Xe+=Te[We++],We=We%Ee;if(Oe=(Oe+1)%Ee,Oe===Me&&(Me=(Me+1)%Ee),Ue-De<Re)return;const He=ze&&Ue-ze;return He?Math.round(Xe*1e3/He):void 0}}function throttle(Ee,Re){let Te=0,je=1e3/Re,Oe,Me;const De=(Ue,ze=Date.now())=>{Te=ze,Oe=null,Me&&(clearTimeout(Me),Me=null),Ee(...Ue)};return[(...Ue)=>{const ze=Date.now(),We=ze-Te;We>=je?De(Ue,ze):(Oe=Ue,Me||(Me=setTimeout(()=>{Me=null,De(Oe)},je-We)))},()=>Oe&&De(Oe)]}const progressEventReducer=(Ee,Re,Te=3)=>{let je=0;const Oe=speedometer(50,250);return throttle(Me=>{const De=Me.loaded,$e=Me.lengthComputable?Me.total:void 0,Be=De-je,Ue=Oe(Be),ze=De<=$e;je=De;const We={loaded:De,total:$e,progress:$e?De/$e:void 0,bytes:Be,rate:Ue||void 0,estimated:Ue&&$e&&ze?($e-De)/Ue:void 0,event:Me,lengthComputable:$e!=null,[Re?"download":"upload"]:!0};Ee(We)},Te)},progressEventDecorator=(Ee,Re)=>{const Te=Ee!=null;return[je=>Re[0]({lengthComputable:Te,total:Ee,loaded:je}),Re[1]]},asyncDecorator=Ee=>(...Re)=>utils$2.asap(()=>Ee(...Re)),isURLSameOrigin=platform.hasStandardBrowserEnv?((Ee,Re)=>Te=>(Te=new URL(Te,platform.origin),Ee.protocol===Te.protocol&&Ee.host===Te.host&&(Re||Ee.port===Te.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(Ee,Re,Te,je,Oe,Me,De){if(typeof document>"u")return;const $e=[`${Ee}=${encodeURIComponent(Re)}`];utils$2.isNumber(Te)&&$e.push(`expires=${new Date(Te).toUTCString()}`),utils$2.isString(je)&&$e.push(`path=${je}`),utils$2.isString(Oe)&&$e.push(`domain=${Oe}`),Me===!0&&$e.push("secure"),utils$2.isString(De)&&$e.push(`SameSite=${De}`),document.cookie=$e.join("; ")},read(Ee){if(typeof document>"u")return null;const Re=document.cookie.match(new RegExp("(?:^|; )"+Ee+"=([^;]*)"));return Re?decodeURIComponent(Re[1]):null},remove(Ee){this.write(Ee,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(Ee){return typeof Ee!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(Ee)}function combineURLs(Ee,Re){return Re?Ee.replace(/\/?\/$/,"")+"/"+Re.replace(/^\/+/,""):Ee}function buildFullPath(Ee,Re,Te){let je=!isAbsoluteURL(Re);return Ee&&(je||Te==!1)?combineURLs(Ee,Re):Re}const headersToObject=Ee=>Ee instanceof AxiosHeaders$1?{...Ee}:Ee;function mergeConfig$1(Ee,Re){Re=Re||{};const Te={};function je(Ue,ze,We,Xe){return utils$2.isPlainObject(Ue)&&utils$2.isPlainObject(ze)?utils$2.merge.call({caseless:Xe},Ue,ze):utils$2.isPlainObject(ze)?utils$2.merge({},ze):utils$2.isArray(ze)?ze.slice():ze}function Oe(Ue,ze,We,Xe){if(utils$2.isUndefined(ze)){if(!utils$2.isUndefined(Ue))return je(void 0,Ue,We,Xe)}else return je(Ue,ze,We,Xe)}function Me(Ue,ze){if(!utils$2.isUndefined(ze))return je(void 0,ze)}function De(Ue,ze){if(utils$2.isUndefined(ze)){if(!utils$2.isUndefined(Ue))return je(void 0,Ue)}else return je(void 0,ze)}function $e(Ue,ze,We){if(We in Re)return je(Ue,ze);if(We in Ee)return je(void 0,Ue)}const Be={url:Me,method:Me,data:Me,baseURL:De,transformRequest:De,transformResponse:De,paramsSerializer:De,timeout:De,timeoutMessage:De,withCredentials:De,withXSRFToken:De,adapter:De,responseType:De,xsrfCookieName:De,xsrfHeaderName:De,onUploadProgress:De,onDownloadProgress:De,decompress:De,maxContentLength:De,maxBodyLength:De,beforeRedirect:De,transport:De,httpAgent:De,httpsAgent:De,cancelToken:De,socketPath:De,responseEncoding:De,validateStatus:$e,headers:(Ue,ze,We)=>Oe(headersToObject(Ue),headersToObject(ze),We,!0)};return utils$2.forEach(Object.keys({...Ee,...Re}),function(ze){if(ze==="__proto__"||ze==="constructor"||ze==="prototype")return;const We=utils$2.hasOwnProp(Be,ze)?Be[ze]:Oe,Xe=We(Ee[ze],Re[ze],ze);utils$2.isUndefined(Xe)&&We!==$e||(Te[ze]=Xe)}),Te}const resolveConfig=Ee=>{const Re=mergeConfig$1({},Ee);let{data:Te,withXSRFToken:je,xsrfHeaderName:Oe,xsrfCookieName:Me,headers:De,auth:$e}=Re;if(Re.headers=De=AxiosHeaders$1.from(De),Re.url=buildURL(buildFullPath(Re.baseURL,Re.url,Re.allowAbsoluteUrls),Ee.params,Ee.paramsSerializer),$e&&De.set("Authorization","Basic "+btoa(($e.username||"")+":"+($e.password?unescape(encodeURIComponent($e.password)):""))),utils$2.isFormData(Te)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)De.setContentType(void 0);else if(utils$2.isFunction(Te.getHeaders)){const Be=Te.getHeaders(),Ue=["content-type","content-length"];Object.entries(Be).forEach(([ze,We])=>{Ue.includes(ze.toLowerCase())&&De.set(ze,We)})}}if(platform.hasStandardBrowserEnv&&(je&&utils$2.isFunction(je)&&(je=je(Re)),je||je!==!1&&isURLSameOrigin(Re.url))){const Be=Oe&&Me&&cookies.read(Me);Be&&De.set(Oe,Be)}return Re},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(Ee){return new Promise(function(Te,je){const Oe=resolveConfig(Ee);let Me=Oe.data;const De=AxiosHeaders$1.from(Oe.headers).normalize();let{responseType:$e,onUploadProgress:Be,onDownloadProgress:Ue}=Oe,ze,We,Xe,He,qe;function Ge(){He&&He(),qe&&qe(),Oe.cancelToken&&Oe.cancelToken.unsubscribe(ze),Oe.signal&&Oe.signal.removeEventListener("abort",ze)}let Ye=new XMLHttpRequest;Ye.open(Oe.method.toUpperCase(),Oe.url,!0),Ye.timeout=Oe.timeout;
vendor: 4,349 bytes, line 39
39function Ve(){if(!Ye)return;const Qe=AxiosHeaders$1.from("getAllResponseHeaders"in Ye&&Ye.getAllResponseHeaders()),Je={data:!$e||$e==="text"||$e==="json"?Ye.responseText:Ye.response,status:Ye.status,statusText:Ye.statusText,headers:Qe,config:Ee,request:Ye};settle(function(rr){Te(rr),Ge()},function(rr){je(rr),Ge()},Je),Ye=null}"onloadend"in Ye?Ye.onloadend=Ve:Ye.onreadystatechange=function(){!Ye||Ye.readyState!==4||Ye.status===0&&!(Ye.responseURL&&Ye.responseURL.indexOf("file:")===0)||setTimeout(Ve)},Ye.onabort=function(){Ye&&(je(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,Ee,Ye)),Ye=null)},Ye.onerror=function(Ze){const Je=Ze&&Ze.message?Ze.message:"Network Error",ir=new AxiosError$1(Je,AxiosError$1.ERR_NETWORK,Ee,Ye);ir.event=Ze||null,je(ir),Ye=null},Ye.ontimeout=function(){let Ze=Oe.timeout?"timeout of "+Oe.timeout+"ms exceeded":"timeout exceeded";const Je=Oe.transitional||transitionalDefaults;Oe.timeoutErrorMessage&&(Ze=Oe.timeoutErrorMessage),je(new AxiosError$1(Ze,Je.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,Ee,Ye)),Ye=null},Me===void 0&&De.setContentType(null),"setRequestHeader"in Ye&&utils$2.forEach(De.toJSON(),function(Ze,Je){Ye.setRequestHeader(Je,Ze)}),utils$2.isUndefined(Oe.withCredentials)||(Ye.withCredentials=!!Oe.withCredentials),$e&&$e!=="json"&&(Ye.responseType=Oe.responseType),Ue&&([Xe,qe]=progressEventReducer(Ue,!0),Ye.addEventListener("progress",Xe)),Be&&Ye.upload&&([We,He]=progressEventReducer(Be),Ye.upload.addEventListener("progress",We),Ye.upload.addEventListener("loadend",He)),(Oe.cancelToken||Oe.signal)&&(ze=Qe=>{Ye&&(je(!Qe||Qe.type?new CanceledError$1(null,Ee,Ye):Qe),Ye.abort(),Ye=null)},Oe.cancelToken&&Oe.cancelToken.subscribe(ze),Oe.signal&&(Oe.signal.aborted?ze():Oe.signal.addEventListener("abort",ze)));const Ke=parseProtocol(Oe.url);if(Ke&&platform.protocols.indexOf(Ke)===-1){je(new AxiosError$1("Unsupported protocol "+Ke+":",AxiosError$1.ERR_BAD_REQUEST,Ee));return}Ye.send(Me||null)})},composeSignals=(Ee,Re)=>{const{length:Te}=Ee=Ee?Ee.filter(Boolean):[];if(Re||Te){let je=new AbortController,Oe;const Me=function(Ue){if(!Oe){Oe=!0,$e();const ze=Ue instanceof Error?Ue:this.reason;je.abort(ze instanceof AxiosError$1?ze:new CanceledError$1(ze instanceof Error?ze.message:ze))}};let De=Re&&setTimeout(()=>{De=null,Me(new AxiosError$1(`timeout of ${Re}ms exceeded`,AxiosError$1.ETIMEDOUT))},Re);const $e=()=>{Ee&&(De&&clearTimeout(De),De=null,Ee.forEach(Ue=>{Ue.unsubscribe?Ue.unsubscribe(Me):Ue.removeEventListener("abort",Me)}),Ee=null)};Ee.forEach(Ue=>Ue.addEventListener("abort",Me));const{signal:Be}=je;return Be.unsubscribe=()=>utils$2.asap($e),Be}},streamChunk=function*(Ee,Re){let Te=Ee.byteLength;if(Te<Re){yield Ee;return}let je=0,Oe;for(;je<Te;)Oe=je+Re,yield Ee.slice(je,Oe),je=Oe},readBytes=async function*(Ee,Re){for await(const Te of readStream(Ee))yield*streamChunk(Te,Re)},readStream=async function*(Ee){if(Ee[Symbol.asyncIterator]){yield*Ee;return}const Re=Ee.getReader();try{for(;;){const{done:Te,value:je}=await Re.read();if(Te)break;yield je}}finally{await Re.cancel()}},trackStream=(Ee,Re,Te,je)=>{const Oe=readBytes(Ee,Re);let Me=0,De,$e=Be=>{De||(De=!0,je&&je(Be))};return new ReadableStream({async pull(Be){try{const{done:Ue,value:ze}=await Oe.next();if(Ue){$e(),Be.close();return}let We=ze.byteLength;if(Te){let Xe=Me+=We;Te(Xe)}Be.enqueue(new Uint8Array(ze))}catch(Ue){throw $e(Ue),Ue}},cancel(Be){return $e(Be),Oe.return()}},{highWaterMark:2})},DEFAULT_CHUNK_SIZE=64*1024,{isFunction}=utils$2,globalFetchAPI=(({Request:Ee,Response:Re})=>({Request:Ee,Response:Re}))(utils$2.global),{ReadableStream:ReadableStream$1,TextEncoder:TextEncoder$1}=utils$2.global,test=(Ee,...Re)=>{try{return!!Ee(...Re)}catch{return!1}},factory=Ee=>{Ee=utils$2.merge.call({skipUndefined:!0},globalFetchAPI,Ee);const{fetch:Re,Request:Te,Response:je}=Ee,Oe=Re?isFunction(Re):typeof fetch=="function",Me=isFunction(Te),De=isFunction(je);if(!Oe)return!1;const $e=Oe&&isFunction(ReadableStream$1),Be=Oe&&(typeof TextEncoder$1=="function"?(qe=>Ge=>qe.encode(Ge))(new TextEncoder$1):async qe=>new Uint8Array(await new Te(qe).arrayBuffer())),Ue=Me&&$e&&test(()=>{let qe=!1;const Ge=new Te(platform.origin,{body:new ReadableStream$1,method:"POST",get duplex(){return qe=!0,"half"}}).headers.has("Content-Type");return qe&&!Ge}),ze=De&&$e&&test(()=>
vendor: 5,649 bytes, lines 39-41
39utils$2.isReadableStream(new je("").body)),We={stream:ze&&(qe=>qe.body)};Oe&&["text","arrayBuffer","blob","formData","stream"].forEach(qe=>{!We[qe]&&(We[qe]=(Ge,Ye)=>{let Ve=Ge&&Ge[qe];if(Ve)return Ve.call(Ge);throw new AxiosError$1(`Response type '${qe}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,Ye)})});const Xe=async qe=>{if(qe==null)return 0;if(utils$2.isBlob(qe))return qe.size;if(utils$2.isSpecCompliantForm(qe))return(await new Te(platform.origin,{method:"POST",body:qe}).arrayBuffer()).byteLength;if(utils$2.isArrayBufferView(qe)||utils$2.isArrayBuffer(qe))return qe.byteLength;if(utils$2.isURLSearchParams(qe)&&(qe=qe+""),utils$2.isString(qe))return(await Be(qe)).byteLength},He=async(qe,Ge)=>{const Ye=utils$2.toFiniteNumber(qe.getContentLength());return Ye??Xe(Ge)};return async qe=>{let{url:Ge,method:Ye,data:Ve,signal:Ke,cancelToken:Qe,timeout:Ze,onDownloadProgress:Je,onUploadProgress:ir,responseType:rr,headers:ar,withCredentials:or="same-origin",fetchOptions:pr}=resolveConfig(qe),tr=Re||fetch;rr=rr?(rr+"").toLowerCase():"text";let nr=composeSignals([Ke,Qe&&Qe.toAbortSignal()],Ze),hr=null;const sr=nr&&nr.unsubscribe&&(()=>{nr.unsubscribe()});let xr;try{if(ir&&Ue&&Ye!=="get"&&Ye!=="head"&&(xr=await He(ar,Ve))!==0){let kr=new Te(Ge,{method:"POST",body:Ve,duplex:"half"}),cr;if(utils$2.isFormData(Ve)&&(cr=kr.headers.get("content-type"))&&ar.setContentType(cr),kr.body){const[dr,ur]=progressEventDecorator(xr,progressEventReducer(asyncDecorator(ir)));Ve=trackStream(kr.body,DEFAULT_CHUNK_SIZE,dr,ur)}}utils$2.isString(or)||(or=or?"include":"omit");const Rr=Me&&"credentials"in Te.prototype,br={...pr,signal:nr,method:Ye.toUpperCase(),headers:ar.normalize().toJSON(),body:Ve,duplex:"half",credentials:Rr?or:void 0};hr=Me&&new Te(Ge,br);let wr=await(Me?tr(hr,pr):tr(Ge,br));const vr=ze&&(rr==="stream"||rr==="response");if(ze&&(Je||vr&&sr)){const kr={};["status","statusText","headers"].forEach(gr=>{kr[gr]=wr[gr]});const cr=utils$2.toFiniteNumber(wr.headers.get("content-length")),[dr,ur]=Je&&progressEventDecorator(cr,progressEventReducer(asyncDecorator(Je),!0))||[];wr=new je(trackStream(wr.body,DEFAULT_CHUNK_SIZE,dr,()=>{ur&&ur(),sr&&sr()}),kr)}rr=rr||"text";let Dr=await We[utils$2.findKey(We,rr)||"text"](wr,qe);return!vr&&sr&&sr(),await new Promise((kr,cr)=>{settle(kr,cr,{data:Dr,headers:AxiosHeaders$1.from(wr.headers),status:wr.status,statusText:wr.statusText,config:qe,request:hr})})}catch(Rr){throw sr&&sr(),Rr&&Rr.name==="TypeError"&&/Load failed|fetch/i.test(Rr.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,qe,hr,Rr&&Rr.response),{cause:Rr.cause||Rr}):AxiosError$1.from(Rr,Rr&&Rr.code,qe,hr,Rr&&Rr.response)}}},seedCache=new Map,getFetch=Ee=>{let Re=Ee&&Ee.env||{};const{fetch:Te,Request:je,Response:Oe}=Re,Me=[je,Oe,Te];let De=Me.length,$e=De,Be,Ue,ze=seedCache;for(;$e--;)Be=Me[$e],Ue=ze.get(Be),Ue===void 0&&ze.set(Be,Ue=$e?new Map:factory(Re)),ze=Ue;return Ue};getFetch();const knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:{get:getFetch}};utils$2.forEach(knownAdapters,(Ee,Re)=>{if(Ee){try{Object.defineProperty(Ee,"name",{value:Re})}catch{}Object.defineProperty(Ee,"adapterName",{value:Re})}});const renderReason=Ee=>`- ${Ee}`,isResolvedHandle=Ee=>utils$2.isFunction(Ee)||Ee===null||Ee===!1;function getAdapter$1(Ee,Re){Ee=utils$2.isArray(Ee)?Ee:[Ee];const{length:Te}=Ee;let je,Oe;const Me={};for(let De=0;De<Te;De++){je=Ee[De];let $e;if(Oe=je,!isResolvedHandle(je)&&(Oe=knownAdapters[($e=String(je)).toLowerCase()],Oe===void 0))throw new AxiosError$1(`Unknown adapter '${$e}'`);if(Oe&&(utils$2.isFunction(Oe)||(Oe=Oe.get(Re))))break;Me[$e||"#"+De]=Oe}if(!Oe){const De=Object.entries(Me).map(([Be,Ue])=>`adapter ${Be} `+(Ue===!1?"is not supported by the environment":"is not available in the build"));let $e=Te?De.length>1?`since : 40`+De.map(renderReason).join(` 41`):" "+renderReason(De[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+$e,"ERR_NOT_SUPPORT")}return Oe}const adapters={getAdapter:getAdapter$1,adapters:knownAdapters};function throwIfCancellationRequested(Ee){if(Ee.cancelToken&&Ee.cancelToken.throwIfRequested(),Ee.signal&&Ee.signal.aborted)throw new CanceledError$1(null,Ee)}function dispatchRequest(Ee){return throwIfCancellationRequested(Ee),Ee.headers=AxiosHeaders$1.from(Ee.headers),Ee.data=transformData.call(Ee,Ee.transformRequest),["post","put","patch"].indexOf(Ee.method)!==-1&&Ee.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(Ee.adapter||defaults.adapter,Ee)(Ee).then(function(je){return throwIfCancellationRequested(Ee),je.data=transformData.call(Ee,Ee.transformResponse,je),je.headers=AxiosHeaders$1.from(je.headers),je},function(je){return isCancel$1(je)||(throwIfCancellationRequested(Ee),je&&je.response&&(je.response.data=transformData.call(Ee,Ee.transformResponse,je.response),je.response.headers=AxiosHeaders$1.from(je.response.headers))),Promise.reject(je)})}const VERSION$1="1.13.5",validators$1={};["object","boolean","number","function","string","symbol"].forEach((Ee,Re)=>{validators$1[Ee]=function(je){return typeof je===Ee||"a"+(Re<1?"n ":" ")+Ee}});const deprecatedWarnings={};validators$1.transitional=function(Re,Te,je){function Oe(Me,De){return"[Axios v"+VERSION$1+"] Transitional option '"+Me+"'"+De+(je?". "+je:"")}return(Me,De,$e)=>{if(Re===!1)throw new AxiosError$1(Oe(De," has been removed"+(Te?" in "+Te:"")),AxiosError$1.ERR_DEPRECATED);return Te&&!deprecatedWarnings[De]&&(deprecatedWarnings[De]=!0,console.warn(Oe(De," has been deprecated since v"+Te+" and will be removed in the near future"))),Re?Re(Me,De,$e):!0}
vendor: 4,386 bytes, lines 41-42
41};validators$1.spelling=function(Re){return(Te,je)=>(console.warn(`${je} is likely a misspelling of ${Re}`),!0)};function assertOptions(Ee,Re,Te){if(typeof Ee!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const je=Object.keys(Ee);let Oe=je.length;for(;Oe-- >0;){const Me=je[Oe],De=Re[Me];if(De){const $e=Ee[Me],Be=$e===void 0||De($e,Me,Ee);if(Be!==!0)throw new AxiosError$1("option "+Me+" must be "+Be,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(Te!==!0)throw new AxiosError$1("Unknown option "+Me,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(Re){this.defaults=Re||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(Re,Te){try{return await this._request(Re,Te)}catch(je){if(je instanceof Error){let Oe={};Error.captureStackTrace?Error.captureStackTrace(Oe):Oe=new Error;const Me=Oe.stack?Oe.stack.replace(/^.+\n/,""):"";try{je.stack?Me&&!String(je.stack).endsWith(Me.replace(/^.+\n.+\n/,""))&&(je.stack+=` 42`+Me):je.stack=Me}catch{}}throw je}}_request(Re,Te){typeof Re=="string"?(Te=Te||{},Te.url=Re):Te=Re||{},Te=mergeConfig$1(this.defaults,Te);const{transitional:je,paramsSerializer:Oe,headers:Me}=Te;je!==void 0&&validator.assertOptions(je,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean),legacyInterceptorReqResOrdering:validators.transitional(validators.boolean)},!1),Oe!=null&&(utils$2.isFunction(Oe)?Te.paramsSerializer={serialize:Oe}:validator.assertOptions(Oe,{encode:validators.function,serialize:validators.function},!0)),Te.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?Te.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:Te.allowAbsoluteUrls=!0),validator.assertOptions(Te,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),Te.method=(Te.method||this.defaults.method||"get").toLowerCase();let De=Me&&utils$2.merge(Me.common,Me[Te.method]);Me&&utils$2.forEach(["delete","get","head","post","put","patch","common"],qe=>{delete Me[qe]}),Te.headers=AxiosHeaders$1.concat(De,Me);const $e=[];let Be=!0;this.interceptors.request.forEach(function(Ge){if(typeof Ge.runWhen=="function"&&Ge.runWhen(Te)===!1)return;Be=Be&&Ge.synchronous;const Ye=Te.transitional||transitionalDefaults;Ye&&Ye.legacyInterceptorReqResOrdering?$e.unshift(Ge.fulfilled,Ge.rejected):$e.push(Ge.fulfilled,Ge.rejected)});const Ue=[];this.interceptors.response.forEach(function(Ge){Ue.push(Ge.fulfilled,Ge.rejected)});let ze,We=0,Xe;if(!Be){const qe=[dispatchRequest.bind(this),void 0];for(qe.unshift(...$e),qe.push(...Ue),Xe=qe.length,ze=Promise.resolve(Te);We<Xe;)ze=ze.then(qe[We++],qe[We++]);return ze}Xe=$e.length;let He=Te;for(;We<Xe;){const qe=$e[We++],Ge=$e[We++];try{He=qe(He)}catch(Ye){Ge.call(this,Ye);break}}try{ze=dispatchRequest.call(this,He)}catch(qe){return Promise.reject(qe)}for(We=0,Xe=Ue.length;We<Xe;)ze=ze.then(Ue[We++],Ue[We++]);return ze}getUri(Re){Re=mergeConfig$1(this.defaults,Re);const Te=buildFullPath(Re.baseURL,Re.url,Re.allowAbsoluteUrls);return buildURL(Te,Re.params,Re.paramsSerializer)}};utils$2.forEach(["delete","get","head","options"],function(Re){Axios$1.prototype[Re]=function(Te,je){return this.request(mergeConfig$1(je||{},{method:Re,url:Te,data:(je||{}).data}))}});utils$2.forEach(["post","put","patch"],function(Re){function Te(je){return function(Me,De,$e){return this.request(mergeConfig$1($e||{},{method:Re,headers:je?{"Content-Type":"multipart/form-data"}:{},url:Me,data:De}))}}Axios$1.prototype[Re]=Te(),Axios$1.prototype[Re+"Form"]=Te(!0)});let CancelToken$1=class Au{constructor(Re){if(typeof Re!="function")throw new TypeError("executor must be a function.");let Te;this.promise=new Promise(function(Me){Te=Me});const je=this;this.promise.then(Oe=>{if(!je._listeners)return;let Me=je._listeners.length;for(;Me-- >0;)je._listeners[Me](Oe);je._listeners=null}),this.promise.then=Oe=>{let Me;const De=new Promise($e=>{je.subscribe($e),Me=$e}).then(Oe);return De.cancel=function(){je.unsubscribe(Me)},De},Re(function(Me,De,$e){je.reason||(je.reason=new CanceledError$1(Me,De,$e),Te(je.reason))})}throwIfRequested(){if(this.reason)throw this.reason}
vendor: 11,358 bytes, lines 42-44
42subscribe(Re){if(this.reason){Re(this.reason);return}this._listeners?this._listeners.push(Re):this._listeners=[Re]}unsubscribe(Re){if(!this._listeners)return;const Te=this._listeners.indexOf(Re);Te!==-1&&this._listeners.splice(Te,1)}toAbortSignal(){const Re=new AbortController,Te=je=>{Re.abort(je)};return this.subscribe(Te),Re.signal.unsubscribe=()=>this.unsubscribe(Te),Re.signal}static source(){let Re;return{token:new Au(function(Oe){Re=Oe}),cancel:Re}}};function spread$1(Ee){return function(Te){return Ee.apply(null,Te)}}function isAxiosError$1(Ee){return utils$2.isObject(Ee)&&Ee.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(HttpStatusCode$1).forEach(([Ee,Re])=>{HttpStatusCode$1[Re]=Ee});function createInstance(Ee){const Re=new Axios$1(Ee),Te=bind(Axios$1.prototype.request,Re);return utils$2.extend(Te,Axios$1.prototype,Re,{allOwnKeys:!0}),utils$2.extend(Te,Re,null,{allOwnKeys:!0}),Te.create=function(Oe){return createInstance(mergeConfig$1(Ee,Oe))},Te}const axios=createInstance(defaults);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function(Re){return Promise.all(Re)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=Ee=>formDataToJSON(utils$2.isHTMLForm(Ee)?new FormData(Ee):Ee);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;var e$4=Symbol("cache-parser");function r$5(Ee,Re){(Re==null||Re>Ee.length)&&(Re=Ee.length);for(var Te=0,je=Array(Re);Te<Re;Te++)je[Te]=Ee[Te];return je}function t$3(Ee){return(typeof Ee=="string"||typeof Ee=="number")&&(Ee=Number(Ee))>=0&&Ee<Number.POSITIVE_INFINITY}function a$1(Ee){return Ee===!0||typeof Ee=="number"||typeof Ee=="string"&&Ee!=="false"}var n$3=Number;function o$2(Ee){var Re=Object.defineProperty({},e$4,{enumerable:!1,value:1});if(!Ee||typeof Ee!="string")return Re;var Te=function(Ue){for(var ze,We={},Xe=function(Ge){var Ye=typeof Symbol<"u"&&Ge[Symbol.iterator]||Ge["@@iterator"];if(Ye)return(Ye=Ye.call(Ge)).next.bind(Ye);if(Array.isArray(Ge)||(Ye=function(Ke,Qe){if(Ke){if(typeof Ke=="string")return r$5(Ke,Qe);var Ze={}.toString.call(Ke).slice(8,-1);return Ze==="Object"&&Ke.constructor&&(Ze=Ke.constructor.name),Ze==="Map"||Ze==="Set"?Array.from(Ke):Ze==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ze)?r$5(Ke,Qe):void 0}}(Ge))){Ye&&(Ge=Ye);var Ve=0;return function(){return Ve>=Ge.length?{done:!0}:{done:!1,value:Ge[Ve++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 43In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}(Ue.toLowerCase().replace(/\s+/g,"").split(","));!(ze=Xe()).done;){var He,qe=ze.value.split("=",2);We[qe[0]]=(He=qe[1])==null||He}return We}(Ee),je=Te["max-age"],Oe=Te["max-stale"],Me=Te["min-fresh"],De=Te["s-maxage"],$e=Te["stale-if-error"],Be=Te["stale-while-revalidate"];return a$1(Te.immutable)&&(Re.immutable=!0),t$3(je)&&(Re.maxAge=n$3(je)),t$3(Oe)&&(Re.maxStale=n$3(Oe)),t$3(Me)&&(Re.minFresh=n$3(Me)),a$1(Te["must-revalidate"])&&(Re.mustRevalidate=!0),a$1(Te["must-understand"])&&(Re.mustUnderstand=!0),a$1(Te["no-cache"])&&(Re.noCache=!0),a$1(Te["no-store"])&&(Re.noStore=!0),a$1(Te["no-transform"])&&(Re.noTransform=!0),a$1(Te["only-if-cached"])&&(Re.onlyIfCached=!0),a$1(Te.private)&&(Re.private=!0),a$1(Te["proxy-revalidate"])&&(Re.proxyRevalidate=!0),a$1(Te.public)&&(Re.public=!0),t$3(De)&&(Re.sMaxAge=n$3(De)),t$3($e)&&(Re.staleIfError=n$3($e)),t$3(Be)&&(Re.staleWhileRevalidate=n$3(Be)),Re}var r$4=Symbol();function e$3(){var Ee,Re,Te=new Promise(function(je,Oe){Ee=je,Re=Oe});return Te.resolve=Ee,Te.reject=Re,Te[r$4]=1,Te}function r$3(Ee,Re){(Re==null||Re>Ee.length)&&(Re=Ee.length);for(var Te=0,je=Array(Re);Te<Re;Te++)je[Te]=Ee[Te];return je}function e$2(Ee,Re){var Te=typeof Symbol<"u"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(Te)return(Te=Te.call(Ee)).next.bind(Te);if(Array.isArray(Ee)||(Te=function(Oe,Me){if(Oe){if(typeof Oe=="string")return r$3(Oe,Me);var De={}.toString.call(Oe).slice(8,-1);return De==="Object"&&Oe.constructor&&(De=Oe.constructor.name),De==="Map"||De==="Set"?Array.from(Oe):De==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(De)?r$3(Oe,Me):void 0}}(Ee))||Re){Te&&(Ee=Te);var je=0;return function(){return je>=Ee.length?{done:!0}:{done:!1,value:Ee[je++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 44In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t$2(Ee,Re,Te){if(Ee==="*"||Ee===null)return!1;for(var je,Oe=Object.keys(Re),Me=Object.keys(Te),De=e$2(Ee);!(je=De()).done;){for(var $e,Be=je.value,Ue=void 0,ze=void 0,We=e$2(Oe);!($e=We()).done;){var Xe=$e.value;if(Xe.toLowerCase()===Be){var He;Ue=(He=Re[Xe])==null||(He=He.toString())==null?void 0:He.trim();break}}for(var qe,Ge=e$2(Me);!(qe=Ge()).done;){var Ye=qe.value;if(Ye.toLowerCase()===Be){var Ve;ze=(Ve=Te[Ye])==null||(Ve=Ve.toString())==null?void 0:Ve.trim();break}}if(Ue!=ze)return!1}return!0}var n$2=/^[a-z0-9-]+$/i;function o$1(Ee,Re){if(Re===void 0&&(Re=16),typeof Ee!="string")return null;if(Ee.includes("*"))return"*";for(var Te=new Set,je=0;je<Ee.length;je++){var Oe=Ee[je];if(Oe!==" "&&Oe!==" "&&Oe!==","){for(var Me=je;je<Ee.length&&Ee[je]!==",";)je++;var De=Ee.slice(Me,je).trim().toLowerCase();if(De.length!==0&&n$2.test(De)&&(Te.add(De),Te.size>=Re))break}}return Te.size===0?null:Array.from(Te)}function t$1(Ee,Re){return Ee>Re?1:-1}function r$2(Ee,Re){return t$1(String(Ee[0]),String(Re[0]))}function n$1(Ee,Re){return 33*Ee^Re}function e$1(Ee,Re){var Te=5381;if(typeof Ee=="object"&&Ee!==null){var je=typeof Ee.entries=="function",Oe=Object.keys(Ee).length>0;if(Ee.toString===Object.prototype.toString||Ee.toString===Array.prototype.toString||je&&!Oe){Re||(Re=new WeakSet),Re.add(Ee);var Me=je&&!Oe?Array.from(Ee.entries()):Object.keys(Ee).sort(t$1).map(function(He){return[He,Ee[He]]});je&&!Oe&&Me.sort(r$2);for(var De=0;De<Me.length;De++){var $e=Me[De],Be=$e[1];if(Te=n$1(Te,e$1($e[0],Re)),typeof Be=="object"&&Be!==null&&(Be.toString===Object.prototype.toString||Be.toString===Array.prototype.toString)){if(Re.has(Be))continue;Re.add(Be)}Te=n$1(Te,e$1(Be,Re))}return n$1(Te,e$1(Ee.constructor,Re))}}for(var Ue,ze=typeof Ee,We=0;We<ze.length;We++)Te=n$1(Te,ze.charCodeAt(We));if(Ee instanceof Date)return n$1(Te,Ee.getTime());if(ze==="number")return n$1(Te,function(He){if(Number.isNaN(He))return 2146959360;if(He===1/0)return 2146435072;if(He===-1/0)return 4293918720;if(Math.abs(He)>Number.MAX_SAFE_INTEGER){for(var qe=String(He),Ge=0,Ye=0;Ye<qe.length;Ye++)Ge=n$1(Ge,qe.charCodeAt(Ye));return Ge}return He}(Ee));if(ze==="boolean")return n$1(Te,Ee?1:0);try{Ue=String(Ee)}catch{Ue=Object.prototype.toString.call(Ee)}for(var Xe=0;Xe<Ue.length;Xe++)Te=n$1(Te,Ue.charCodeAt(Xe));return Te}const Header={IfModifiedSince:"if-modified-since",LastModified:"last-modified",IfNoneMatch:"if-none-match",CacheControl:"cache-control",Pragma:"pragma",ETag:"etag",Expires:"expires",Age:"age",XAxiosCacheEtag:"x-axios-cache-etag",XAxiosCacheLastModified:"x-axios-cache-last-modified",XAxiosCacheStaleIfError:"x-axios-cache-stale-if-error",Vary:"vary"},defaultHeaderInterpreter=(Ee,Re)=>{if(!Ee)return"not enough headers";const Te=Ee[Header.CacheControl];if(Te){const Oe=o$2(String(Te));if(Oe.noCache||Oe.noStore||Re==="server"&&Oe.private)return"dont cache";if(Oe.immutable)return{cache:1e3*60*60*24*365};if(Oe.maxAge!==void 0){const Me=Ee[Header.Age];return{cache:Me?(Oe.maxAge-Number(Me))*1e3:Oe.maxAge*1e3,stale:Oe.maxStale!==void 0?Oe.maxStale*1e3:Oe.staleWhileRevalidate!==void 0?Oe.staleWhileRevalidate*1e3:void 0}}}const je=Ee[Header.Expires];if(je){const Oe=Date.parse(String(je))-Date.now();return Oe>=0?{cache:Oe}:"dont cache"}return"not enough headers"};function extractHeaders(Ee,Re){var je;const Te={};for(const Oe of Re)Te[Oe]=(je=Ee.get(Oe))==null?void 0:je.toString();return Te}async function testCachePredicate(Ee,Re){if(typeof Re=="function")return Re(Ee);const{statusCheck:Te,responseMatch:je,containsHeaders:Oe}=Re;if(Te&&!await Te(Ee.status)||je&&!await je(Ee))return!1;if(Oe){for(const[Me,De]of Object.entries(Oe))if(!await De(Ee.headers[Me.toLowerCase()]??Ee.headers[Me]))return!1}return!0}function regexOrStringMatch(Ee,Re){return Ee instanceof RegExp?(Ee.lastIndex=0,Ee.test(Re)):Re.includes(Ee)}function createValidateStatus(Ee){return Ee?Re=>Ee(Re)||Re===304:Re=>Re>=200&&Re<300||Re===304}function isMethodIn(Ee="get",Re=[]){return Ee=Ee.toLowerCase(),Re.some(Te=>Te===Ee)}function updateStaleRequest(Ee,Re){var Me,De,$e;const{etag:Te,modifiedSince:je}=Re.cache,Oe=(De=(Me=Ee.data)==null?void 0:Me.meta)==null?void 0:De.revalidation;if(Te){let Be;Oe!=null&&Oe.etag?Be=Oe.etag:Te===!0?Be=($e=Ee.data)==null?void 0:$e.headers[Header.ETag]:Be=Te,Be&&Re.headers.set(Header.IfNoneMatch,Be)}if(je){let Be;Oe!=null&&Oe.lastModified?Be=Oe.lastModified===!0?new Date(Ee.createdAt).toUTCString():Oe.lastModified:je===!0?Be=Ee.data.headers[Header.LastModified]||new Date(Ee.createdAt).toUTCString():Be=je.toUTCString(),Re.headers.set(Header.IfModifiedSince,Be)}}function createCacheResponse(Ee,Re){return Ee.status===304&&Re?(Ee.cached=!0,Ee.data=Re.data,Ee.status=Re.status,Ee.statusText=Re.statusText,Ee.headers={...Re.headers,...Ee.headers},Re):{data:Ee.data,status:Ee.status,statusText:Ee.statusText,headers:Ee.headers}}function defaultRequestInterceptor(Ee){const Re=async Te=>{var De,$e,Be,Ue,ze,We,Xe,He;if(Te.id=Ee.generateKey(Te,{vary:Te.cache&&Array.isArray(Te.cache.vary)?extractHeaders(Te.headers,Te.cache.vary):void 0}),Te.cache===!1||(Te.cache={...Ee.defaults.cache,...Te.cache},Te.cache.enabled===!1))return Te;
44if(typeof Te.cache.cachePredicate=="object"&&Te.cache.cachePredicate.ignoreUrls&&Te.url){for(const qe of Te.cache.cachePredicate.ignoreUrls)if(regexOrStringMatch(qe,Te.url))return Te}if(typeof Te.cache.cachePredicate=="object"&&Te.cache.cachePredicate.allowUrls&&Te.url){let qe=!1;for(const Ge of Te.cache.cachePredicate.allowUrls)if(regexOrStringMatch(Ge,Te.url)){qe=!0;break}if(!qe)return Te}if(Te.cache.cacheTakeover&&(Te.headers.set(Header.CacheControl,"no-cache, no-store, must-revalidate, max-age=0",!1),Te.headers.set(Header.Pragma,"no-cache",!1),Te.headers.set(Header.Expires,"0",!1)),!isMethodIn(Te.method,Te.cache.methods))return Te;let je=await Ee.storage.get(Te.id,Te);const Oe=Te.cache.override;if(Te.cache.vary!==!1&&(($e=(De=je.data)==null?void 0:De.meta)!=null&&$e.vary)&&je.data.headers[Header.Vary]){const qe=Array.isArray(Te.cache.vary)?Te.cache.vary:o$1(je.data.headers[Header.Vary]);if(qe&&qe!=="*"&&!t$2(qe,(Be=je.data.meta)==null?void 0:Be.vary,Te.headers)){const Ge=extractHeaders(Te.headers,qe),Ye=Ee.generateKey({...Te,id:void 0},{vary:Ge});Te.id!==Ye&&(Te.id=Ye,je=await Ee.storage.get(Ye,Te))}}e:if(je.state==="empty"||je.state==="stale"||je.state==="must-revalidate"||Oe){if(Ee.waiting.has(Te.id)&&!Oe&&(je=await Ee.storage.get(Te.id,Te),je.state!=="empty"&&je.state!=="must-revalidate"))break e;const qe=e$3();return Ee.waiting.set(Te.id,qe),qe.catch(()=>{}),await Ee.storage.set(Te.id,{state:"loading",previous:Oe?je.data?"stale":"empty":je.state,data:je.data,createdAt:Oe&&!je.createdAt?Date.now():je.createdAt},Te),(je.state==="stale"||je.state==="must-revalidate")&&!Oe&&updateStaleRequest(je,{...Te,cache:Te.cache}),Te.validateStatus=createValidateStatus(Te.validateStatus),(je.state==="stale"||je.data&&je.state!=="must-revalidate")&&await((ze=(Ue=Te.cache).hydrate)==null?void 0:ze.call(Ue,je)),Te}let Me;if(je.state==="loading"){const qe=Ee.waiting.get(Te.id);if(!qe)return je.data&&await((Xe=(We=Te.cache).hydrate)==null?void 0:Xe.call(We,je)),Te;try{await qe;const Ge=await Ee.storage.get(Te.id,Te);if(!Ge.data)return Re(Te);if(Te.cache.vary!==!1&&((He=Ge.data.meta)!=null&&He.vary)&&Ge.data.headers[Header.Vary]){const Ye=Array.isArray(Te.cache.vary)?Te.cache.vary:o$1(Ge.data.headers[Header.Vary]);if(Ye&&Ye!=="*"&&!t$2(Ye,Ge.data.meta.vary,Te.headers))return Re(Te)}Me=Ge.data}catch(Ge){throw Ge}}else Me=je.data;return Te.transformResponse=void 0,Te.adapter=function(){return Promise.resolve({config:Te,data:Me.data,headers:Me.headers,status:Me.status,statusText:Me.statusText,cached:!0,stale:je.previous==="stale",id:Te.id})},Te};return{onFulfilled:Re}}async function updateCache(Ee,Re,Te){if(typeof Te=="function")return Te(Re);for(const[je,Oe]of Object.entries(Te)){if(Oe==="delete"){await Ee.remove(je,Re.config);continue}const Me=await Ee.get(je,Re.config);if(Me.state==="loading")continue;const De=await Oe(Me,Re);if(De==="delete"){await Ee.remove(je,Re.config);continue}De!=="ignore"&&await Ee.set(je,De,Re.config)}}function defaultResponseInterceptor(Ee){const Re=(Oe,Me,De)=>{const $e=Ee.waiting.get(Oe);$e&&($e[Me](De),Ee.waiting.delete(Oe))};return{onFulfilled:async Oe=>{if(!(Oe!=null&&Oe.config))throw Oe;Oe.id=Oe.config.id,Oe.cached??(Oe.cached=!1);const Me=Oe.config,De=Me.cache;if(Oe.cached)return Oe;if(!De)return Oe.cached=!1,Oe;if(De.update&&await updateCache(Ee.storage,Oe,De.update),!isMethodIn(Me.method,De.methods))return Oe;const $e=await Ee.storage.get(Oe.id,Me);if($e.state!=="loading")return Ee.waiting.delete(Oe.id),Oe;if(!$e.data&&!await testCachePredicate(Oe,De.cachePredicate))return Re(Oe.id,"resolve"),Oe;for(const Xe of Object.keys(Oe.headers))Xe.startsWith("x-axios-cache")&&delete Oe.headers[Xe];let Be=De.ttl||-1,Ue;if(De.interpretHeader){const Xe=Ee.headerInterpreter(Oe.headers,Ee.location);if(Xe==="dont cache")return Re(Oe.id,"resolve"),Oe;Xe!=="not enough headers"&&(typeof Xe=="number"?Be=Xe:(Be=Xe.cache,Ue=Xe.stale))}typeof Be=="function"&&(Be=await Be(Oe));const ze=createCacheResponse(Oe,$e.data);if(De.etag||De.modifiedSince){if(ze.meta??(ze.meta={}),ze.meta.revalidation={},De.etag){const Xe=De.etag===!0?Oe.headers[Header.ETag]:De.etag;Xe&&(ze.meta.revalidation.etag=Xe)}De.modifiedSince&&(ze.meta.revalidation.lastModified=De.modifiedSince===!0?Oe.headers[Header.LastModified]||!0:De.modifiedSince.toUTCString())}if(De.vary!==!1&&Oe.headers[Header.Vary]){const Xe=Array.isArray(De.vary)?De.vary:o$1(Oe.headers[Header.Vary]);if(Array.isArray(Xe))ze.meta??(ze.meta={}),ze.meta.vary=extractHeaders(Me.headers,Xe);else if(Xe==="*")return await Ee.storage.set(Oe.id,{state:"stale",createdAt:Date.now(),data:ze,ttl:Be},Me),Re(Oe.id,"resolve"),Oe}const We={state:"cached",ttl:Be,staleTtl:Ue,createdAt:Date.now(),data:ze};return await Ee.storage.set(Oe.id,We,Me),Re(Oe.id,"resolve"),Oe},onRejected:async Oe=>{if(!Oe.isAxiosError||!Oe.config)throw Oe;
44const Me=Oe.config,De=Me.id,$e=Me.cache,Be=Oe.response;if(!$e||!De)throw Oe;if(!isMethodIn(Me.method,$e.methods))throw await Ee.storage.remove(De,Me),Re(De,"reject",Oe),Oe;const Ue=await Ee.storage.get(De,Me);if(Ue.state!=="loading"||Ue.previous!=="stale")throw(Oe.code!=="ERR_CANCELED"||Oe.code==="ERR_CANCELED"&&Ue.state!=="cached")&&await Ee.storage.remove(De,Me),Re(De,"reject",Oe),Oe;if($e.staleIfError){const ze=String(Be==null?void 0:Be.headers[Header.CacheControl]),We=ze&&o$2(ze).staleIfError,Xe=typeof $e.staleIfError=="function"?await $e.staleIfError(Be,Ue,Oe):$e.staleIfError===!0&&We?We*1e3:$e.staleIfError;if(Xe===!0||typeof Xe=="number"&&Ue.createdAt+Xe>Date.now()){await Ee.storage.set(De,{state:"stale",createdAt:Date.now(),data:Ue.data},Me);const He=Ee.waiting.get(De);return He&&(He.resolve(),Ee.waiting.delete(De)),{cached:!0,stale:!0,config:Me,id:De,data:Ue.data.data,headers:Ue.data.headers,status:Ue.data.status,statusText:Ue.data.statusText}}}throw await Ee.storage.remove(De,Me),Re(De,"reject",Oe),Oe}}}const isStorage=Ee=>!!Ee&&!!Ee["is-storage"];function migrateRevalidationHeaders(Ee){var je;if((je=Ee.meta)!=null&&je.revalidation)return;const Re=Ee.headers[Header.XAxiosCacheEtag],Te=Ee.headers[Header.XAxiosCacheLastModified];(Re||Te)&&(Ee.meta??(Ee.meta={}),Ee.meta.revalidation={},Re&&(Ee.meta.revalidation.etag=Re),Te&&(Ee.meta.revalidation.lastModified=Te==="use-cache-timestamp"?!0:Te),delete Ee.headers[Header.XAxiosCacheEtag],delete Ee.headers[Header.XAxiosCacheLastModified],delete Ee.headers[Header.XAxiosCacheStaleIfError])}function hasRevalidationMetadata(Ee){var je;migrateRevalidationHeaders(Ee.data);const Re=Ee.data.headers,Te=(je=Ee.data.meta)==null?void 0:je.revalidation;return Header.ETag in Re||Header.LastModified in Re||!!(Te!=null&&Te.etag||Te!=null&&Te.lastModified)}function mustRevalidate(Ee){return String(Ee.data.headers[Header.CacheControl]).includes("must-revalidate")}function canStale(Ee){return hasRevalidationMetadata(Ee)?!0:Ee.state==="cached"&&Ee.staleTtl!==void 0&&Math.abs(Date.now()-(Ee.createdAt+Ee.ttl))<=Ee.staleTtl}function isExpired(Ee){return Ee.ttl!==void 0&&Ee.createdAt+Ee.ttl<=Date.now()}const StateEvictionOrder={empty:0,"must-revalidate":1,stale:2,cached:3,loading:4};function storageEntriesSorter([,Ee],[,Re]){const Te=StateEvictionOrder[Ee.state]-StateEvictionOrder[Re.state];return Te!==0?Te:(Ee.createdAt||0)-(Re.createdAt||0)}function canRemoveStorageEntry(Ee,Re){switch(Ee.state){case"loading":return!1;case"empty":case"must-revalidate":return!0;case"cached":return isExpired(Ee)&&!canStale(Ee);case"stale":return Re!==void 0&&Ee.ttl!==void 0?Date.now()>Ee.createdAt+Ee.ttl+Re:!1}}function buildStorage({set:Ee,find:Re,remove:Te,clear:je}){return{"is-storage":1,set:Ee,remove:Te,clear:je,get:async(Oe,Me)=>{let De=await Re(Oe,Me);if(!De)return{state:"empty"};if(De.state==="empty"||De.state==="loading"||De.state==="must-revalidate")return De;if((De.state==="cached"||De.state==="stale")&&migrateRevalidationHeaders(De.data),De.state==="cached"){if(!isExpired(De))return De;if(!canStale(De))return await Te(Oe,Me),{state:"empty"};if(De={state:"stale",createdAt:De.createdAt,data:De.data,ttl:De.staleTtl!==void 0?De.staleTtl+De.ttl:void 0},await Ee(Oe,De,Me),mustRevalidate(De))return{...De,state:"must-revalidate"}}return!isExpired(De)||hasRevalidationMetadata(De)?De:(await Te(Oe,Me),{state:"empty"})}}}const clone=typeof structuredClone=="function"?structuredClone:Ee=>JSON.parse(JSON.stringify(Ee));function buildMemoryStorage(Ee=!1,Re=300*1e3,Te=1024,je=3600*1e3){function Oe(){return Array.from(Me.data.entries()).sort(storageEntriesSorter)}const Me=buildStorage({set:(De,$e)=>{if(Te&&Me.data.size>=Te&&(Me.cleanup(),Me.data.size>=Te)){for(const[Be]of Oe())if(Me.data.delete(Be),Me.data.size<Te)break}Me.data.set(De,Ee==="double"?clone($e):$e)},remove:De=>{Me.data.delete(De)},find:De=>{const $e=Me.data.get(De);return Ee&&$e!==void 0?clone($e):$e},clear:()=>{Me.data.clear()}});return Me.data=new Map,Me.cleanup=()=>{for(const[De,$e]of Oe())canRemoveStorageEntry($e,je)&&Me.data.delete(De)},Re&&(Me.cleaner=setInterval(Me.cleanup,Re),typeof Me.cleaner=="object"&&"unref"
44in Me.cleaner&&Me.cleaner.unref()),Me}const SLASHES_REGEX=/^\/|\/$/g;function buildKeyGenerator(Ee){return(Re,Te)=>{if(Re.id)return Re.id;const je=Ee(Re,Te);return typeof je=="string"||typeof je=="number"?`${je}`:`${e$1(je)}`}}const defaultKeyGenerator=buildKeyGenerator(({baseURL:Ee,url:Re,method:Te,params:je,data:Oe},Me)=>(Ee!==void 0?Ee=Ee.replace(SLASHES_REGEX,""):Ee="",Re!==void 0?Re=Re.replace(SLASHES_REGEX,""):Re="",Te!==void 0?Te=Te.toLowerCase():Te="get",{url:Ee+(Ee&&Re?"/":"")+Re,params:je,method:Te,data:Oe,...Me}));function setupCache(Ee,Re={}){const Te=Ee;if(Te.defaults.cache)throw new Error("setupCache() should be called only once");if(Te.location=typeof window>"u"?"server":"client",Te.storage=Re.storage||buildMemoryStorage(),!isStorage(Te.storage))throw new Error("Use buildStorage() function");return Te.waiting=Re.waiting||new Map,Te.generateKey=Re.generateKey||defaultKeyGenerator,Te.headerInterpreter=Re.headerInterpreter||defaultHeaderInterpreter,Te.requestInterceptor=Re.requestInterceptor||defaultRequestInterceptor(Te),Te.responseInterceptor=Re.responseInterceptor||defaultResponseInterceptor(Te),Te.debug=Re.debug||function(){},Te.defaults.cache={enabled:Re.enabled??!0,update:Re.update||{},ttl:Re.ttl??1e3*60*5,methods:Re.methods||["get","head"],cachePredicate:Re.cachePredicate||{statusCheck:je
44=>[200,203,300,301,302,404,405,410,414,501].includes(je)},etag:Re.etag??!0,modifiedSince:Re.modifiedSince??Re.etag===!1,interpretHeader:Re.interpretHeader??!0,cacheTakeover:Re.cacheTakeover??!0,staleIfError:Re.staleIfError??!0,override:Re.override??!1,hydrate:Re.hydrate??void 0,vary:Re.vary??!0},Te.interceptors.request.use(Te.requestInterceptor.onFulfilled,Te.requestInterceptor.onRejected),Te.interceptors.response.use(Te.responseInterceptor.onFulfilled,Te.responseInterceptor.onRejected),Te}const denyList=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var isRetryAllowed=Ee=>!denyList.has(Ee&&Ee.code);const isRetryAllowed$1=getDefaultExportFromCjs(isRetryAllowed),namespace="axios-retry";function isNetworkError(Ee){const Re=["ERR_CANCELED","ECONNABORTED"];return Ee.response||!Ee.code||Re.includes(Ee.code)?!1:isRetryAllowed$1(Ee)}const SAFE_HTTP_METHODS=["get","head","options"],IDEMPOTENT_HTTP_METHODS=SAFE_HTTP_METHODS.concat(["put","delete"]);function isRetryableError(Ee){return Ee.code!=="ECONNABORTED"&&(!Ee.response||Ee.response.status===429||Ee.response.status>=500&&Ee.response.status<=599)}function isSafeRequestError(Ee){var Re;return(Re=Ee.config)!=null&&Re.method?isRetryableError(Ee)&&SAFE_HTTP_METHODS.indexOf(Ee.config.method)!==-1:!1}function isIdempotentRequestError(Ee){var Re;return(Re=Ee.config)!=null&&Re.method?isRetryableError(Ee)&&IDEMPOTENT_HTTP_METHODS.indexOf(Ee.config.method)!==-1:!1}function isNetworkOrIdempotentRequestError(Ee){return isNetworkError(Ee)||isIdempotentRequestError(Ee)}function retryAfter(Ee=void 0){var je;const Re=(je=Ee==null?void 0:Ee.response)==null?void 0:je.headers["retry-after"];if(!Re)return 0;let Te=(Number(Re)||0)*1e3;return Te===0&&(Te=(new Date(Re).valueOf()||0)-Date.now()),Math.max(0,Te)}function noDelay(Ee=0,Re=void 0){return Math.max(0,retryAfter(Re))}function exponentialDelay(Ee=0,Re=void 0,Te=100){const je=2**Ee*Te,Oe=Math.max(je,retryAfter(Re)),Me=Oe*.2*Math.random();return Oe+Me}function linearDelay(Ee=100){return(Re=0,Te=void 0)=>{const je=Re*Ee;return Math.max(je,retryAfter(Te))}}const DEFAULT_OPTIONS$1={retries:3,retryCondition:isNetworkOrIdempotentRequestError,retryDelay:noDelay,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function getRequestOptions(Ee,Re){return{...DEFAULT_OPTIONS$1,...Re,...Ee[namespace]}}function setCurrentState(Ee,Re,Te=!1){const je=getRequestOptions(Ee,Re||{});return je.retryCount=je.retryCount||0,(!je.lastRequestTime||Te)&&(je.lastRequestTime=Date.now()),Ee[namespace]=je,je}function fixConfig(Ee,Re){Ee.defaults.agent===Re.agent&&delete Re.agent,Ee.defaults.httpAgent===Re.httpAgent&&delete Re.httpAgent,Ee.defaults.httpsAgent===Re.httpsAgent&&delete Re.httpsAgent}async function shouldRetry(Ee,Re){const{retries:Te,retryCondition:je}=Ee,Oe=(Ee.retryCount||0)<Te&&je(Re);if(typeof Oe=="object")try{return await Oe!==!1}catch{return!1}return Oe}async function handleRetry(Ee,Re,Te,je){var Be;Re.retryCount+=1;const{retryDelay:Oe,shouldResetTimeout:Me,onRetry:De}=Re,$e=Oe(Re.retryCount,Te);if(fixConfig(Ee,je),!Me&&je.timeout&&Re.lastRequestTime){const Ue=Date.now()-Re.lastRequestTime,ze=je.timeout-Ue-$e;if(ze<=0)return Promise.reject(Te);je.timeout=ze}return je.transformRequest=[Ue=>Ue],await De(Re.retryCount,Te,je),(Be=je.signal)!=null&&Be.aborted?Promise.resolve(Ee(je)):new Promise(Ue=>{var Xe;const ze=()=>{clearTimeout(We),Ue(Ee(je))},We=setTimeout(()=>{var He;Ue(Ee(je)),(He=je.signal)!=null&&He.removeEventListener&&je.signal.removeEventListener("abort",ze)},$e);(Xe=je.signal)!=null&&Xe.addEventListener&&je.signal.addEventListener("abort",ze,{once:!0})})}async function handleMaxRetryTimesExceeded(Ee,Re){Ee.retryCount>=Ee.retries&&await Ee.onMaxRetryTimesExceeded(Re,Ee.retryCount)}const axiosRetry=(Ee,Re)=>{const Te=Ee.interceptors.request.use(Oe=>{var Me;return setCurrentState(Oe,Re,!0),(Me=Oe[namespace])!=null&&Me.validateResponse&&(Oe.validateStatus=()=>!1),Oe}),je=Ee.interceptors.response.use(null,async Oe=>{var $e;const{config:Me}=Oe;if(!Me)return Promise.reject(Oe);const De=setCurrentState(Me,Re);return Oe.response&&(($e=De.validateResponse)!=null&&$e.call(De,Oe.response))?Oe.response:await shouldRetry(De,Oe)?handleRetry(Ee,De,Oe,Me):(await handleMaxRetryTimesExceeded(De,Oe),Promise.reject(Oe))});return{requestInterceptorId:Te,responseInterceptorId:je}};axiosRetry.isNetworkError=isNetworkError;axiosRetry.isSafeRequestError=isSafeRequestError;axiosRetry.isIdempotentRequestError=isIdempotentRequestError;axiosRetry.isNetworkOrIdempotentRequestError=isNetworkOrIdempotentRequestError;axiosRetry.exponentialDelay=exponentialDelay;axiosRetry.linearDelay=linearDelay;axiosRetry.isRetryableError=isRetryableError;
44const ENV={development:{API_BASE_URL:"/api",SSO_REDIRECT_URI:"http://localhost:5173/auth/callback",WS_BASE_URL:"wss://192.168.1.2:8001/api",WS_NOTIFICATIONS_BASE_URL:"wss://192.168.1.2:8001",SUPPORT_URL:"/submit-ticket",SUPPORT_API_BASE_URL:"/support-api"},testing:{API_BASE_URL:"https://dev-api.openparser.ai/api",SSO_REDIRECT_URI:"https://dev-api.openparser.ai/auth/callback",WS_BASE_URL:"wss://dev-api.openparser.ai/api",WS_NOTIFICATIONS_BASE_URL:"wss://dev-api.openparser.ai",SUPPORT_URL:"/submit-ticket",SUPPORT_API_BASE_URL:"https://dev-api-support.openparser.ai/api"},production:{API_BASE_URL:"https://api.openparser.ai/api",SSO_REDIRECT_URI:"https://api.openparser.ai/api/auth/callback",WS_BASE_URL:"wss://api.openparser.ai/api",WS_NOTIFICATIONS_BASE_URL:"wss://api.openparser.ai/api",SUPPORT_URL:"/submit-ticket",SUPPORT_API_BASE_URL:"https://staging-api-support.openparser.ai/api"},staging:{API_BASE_URL:"https://api-staging.openparser.ai/api",SSO_REDIRECT_URI:"https://api-staging.openparser.ai/auth/callback",WS_BASE_URL:"wss://api-staging.openparser.ai/api",WS_NOTIFICATIONS_BASE_URL:"wss://api-staging.openparser.ai",SUPPORT_URL:"/submit-ticket",SUPPORT_API_BASE_URL:"https://dev-api-support.openparser.ai/api"}},currentEnv=["production","staging","testing"].includes("production")?"production":"development",parseEnvBoolean=(Ee,Re)=>{if(String(Ee).trim()==="")return Re;const Te=String(Ee).trim().toLowerCase();return["true","1","yes","on"].includes(Te)?!0:["false","0","no","off"].includes(Te)?!1:Re},CAPTCHA_ENABLED_BY_ENV={development:!1,testing:!1,staging:!0,production:!0};parseEnvBoolean("false",CAPTCHA_ENABLED_BY_ENV[currentEnv]??!0);const RECAPTCHA_SITE_KEY="6Lc156IsAAAAAGY_h8UvuJESoEOSBAUUwuLXYPzy",resolveApiBaseUrl=()=>typeof window<"u"&&window.location.hostname==="dev.openparser.ai"?"https://dev-api.openparser.ai/api":ENV[currentEnv].API_BASE_URL,API_BASE_URL=resolveApiBaseUrl();ENV[currentEnv].SSO_REDIRECT_URI;ENV[currentEnv].WS_BASE_URL;ENV[currentEnv].WS_NOTIFICATIONS_BASE_URL;const SUPPORT_URL=ENV[currentEnv].SUPPORT_URL,SUPPORT_API_BASE_URL=ENV[currentEnv].SUPPORT_API_BASE_URL,STORAGE_KEYS={AUTH_TOKEN:"doculens_auth_token",USER_DATA:"doculens_user_data",PERSIST_ROOT:"doculens_persist",LAST_ROUTE:"doculens_last_route"},MB=1024*1024,FILE_UPLOAD={MAX_SIZE_BYTES:50*MB,MAX_SIZE_DISPLAY:"50MB",MAX_SIZE_BYTES_2MB:2*MB,MAX_SIZE_DISPLAY_2MB:"2MB",EXTENSIONS_2MB:[".csv",".tsv",".ods"],MAX_SIZE_BYTES_5MB:5*MB,MAX_SIZE_DISPLAY_5MB:"5MB",EXTENSIONS_5MB:[".html",".md",".txt"],MAX_SIZE_BYTES_12MB:12*MB,MAX_SIZE_DISPLAY_12MB:"12MB",EXTENSIONS_12MB:[".xlsx"],MAX_SIZE_BYTES_20MB:20*MB,MAX_SIZE_DISPLAY_20MB:"20MB",EXTENSIONS_20MB:[".odt",".rtf",".docx",".pptx"],MAX_SIZE_BYTES_PDF:50*MB,MAX_SIZE_DISPLAY_PDF:"50MB",EXTENSIONS_PDF:[".pdf"],ALLOWED_TYPES:["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv","text/tab-separated-values","text/plain","text/html","text/markdown","text/x-markdown","application/rtf","text/rtf","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet"],ALLOWED_EXTENSIONS:[".pdf",".docx",".pptx",".xlsx",".csv",".txt",".html",".htm",".md",".rtf",".odt",".ods"],accept:{"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"],"text/csv":[".csv"],"text/tab-separated-values":[".tsv"],"text/plain":[".txt"],"text/html":[".html",".htm"],"text/markdown":[".md"],"text/x-markdown":[".md"],"application/rtf":[".rtf"],"text/rtf":[".rtf"],"application/vnd.oasis.opendocument.text":[".odt"],"application/vnd.oasis.opendocument.spreadsheet":[".ods"],"application/octet-stream":[".odt",".ods",".md",".rtf"]}},ROLES={USER:0,GROUP_ADMIN:1,TENANT_ADMIN:2,VIEW_ONLY:3},RESTRICTED_GROUP_ADMIN_LABEL="Restricted Group Admin";function formatRestrictedGroupAdminCopy(Ee){return String(Ee||"").replace(/Super Group Admin/gi,RESTRICTED_GROUP_ADMIN_LABEL)}const DOC_STATUS={PENDING:"pending",APPROVED:"approved",PROCESSING:"processing",ACTIVE:"active",REJECTED:"rejected",FAILED:"failed",PROCESSING_FAILED:"processing_failed"},axiosInstance=axios.create({baseURL:API_BASE_URL,timeout:3e4,headers:{"Content-Type":"application/json"}}),cachedAxios=setupCache(axiosInstance,{ttl:5*60*1e3,interpretHeader:!1,methods:["get"],cachePredicate:{statusCheck:Ee=>Ee>=200&&Ee<300}});cachedAxios.interceptors.request.use(Ee=>{if(!(Ee.headers&&(Ee.headers.Authorization||Ee.headers.authorization)||null)){const Te=localStorage.getItem(STORAGE_KEYS.AUTH_TOKEN);Te?Ee.headers.Authorization=`Bearer ${Te}`:console.warn("No token found in localStorage for request:",Ee.url)}return Ee.data instanceof FormData&&delete Ee.headers["Content-Type"],Ee},Ee=>Promise.reject(Ee));cachedAxios.interceptors.response.use(Ee=>Ee,Ee=>{var Re,Te;if(Ee.response){const{status:je,data:Oe}=Ee.response,Me=((Re=Ee==null?void 0:Ee.config)==null?void 0:Re.url)||"";switch(je){case 401:try{localStorage.removeItem(STORAGE_KEYS.AUTH_TOKEN),localStorage.removeItem(STORAGE_KEYS.USER_DATA),STORAGE_KEYS.PERSIST_ROOT&&(localStorage.removeItem(STORAGE_KEYS.PERSIST_ROOT),localStorage.removeItem(`persist:${STORAGE_KEYS.PERSIST_ROOT}`))}catch{}window.location.pathname.includes("/login")||(window.location.href="/login");break;case 403:console.error("Forbidden: You do not have permission to access this resource");break;case 404:Me.includes("/profile/photo")||console.error("Resource not found");break;case 500:case 502:case 503:case 504:console.error("Server error:",(Oe==null?void 0:Oe.message)||"An error occurred on the server");break;default:console.error("API Error:",(Oe==null?void 0:Oe.message)||"An unexpected error occurred")}return Promise.reject({status:je,message:(Oe==null?void 0:Oe.message)||(Oe==null?void 0:Oe.error)||"An error occurred",data:Oe})}else return Ee.request?((((Te=Ee==null?void 0:Ee.config)==null?void 0:Te.url)||"").includes("/profile/photo")||console.error("Network error: No response from server"),Promise.reject({status:0,message:"Network error. Please check your internet connection.",data:null}
44)):(console.error("Error:",Ee.message),Promise.reject({status:0,message:Ee.message||"An unexpected error occurred",data:null}))});axiosRetry(cachedAxios,{retries:1,retryDelay:axiosRetry.exponentialDelay,retryCondition:Ee=>{var Te,je,Oe,Me,De;const Re=((Te=Ee==null?void 0:Ee.config)==null?void 0:Te.url)||"";return Re.includes("/user/tc-status")||Re.includes("/tc-status")||Re.includes("/profile/photo")||((Oe=(je=Ee==null?void 0:Ee.config)==null?void 0:je["axios-retry"])==null?void 0:Oe.retries)===0?!1:axiosRetry.isNetworkOrIdempotentRequestError(Ee)||((Me=Ee.response)==null?void 0:Me.status)>=500&&((De=Ee.response)==null?void 0:De.status)<600}});const FAST_FAIL_REQUEST={timeout:15e3,"axios-retry":{retries:0}},clearApiCache=()=>{cachedAxios.storage&&cachedAxios.storage.clear()},authService={login:async(Ee,Re)=>(await cachedAxios.post("/auth/login",{email:Ee,password:Re})).data,fetchMfaSetup:async Ee=>(await cachedAxios.get("/mfa/setup",{cache:!1,headers:{Authorization:`Bearer ${Ee}`}})).data,verifySetupMfa:async(Ee,Re)=>(await cachedAxios.post("/mfa/verify-setup",{code:Re},{headers:{Authorization:`Bearer ${Ee}`}})).data,verifyMfa:async(Ee,Re)=>(await cachedAxios.post("/mfa/verify",{code:Re},{headers:{Authorization:`Bearer ${Ee}`}})).data,selectTenant:async(Ee,Re)=>(await cachedAxios.post("/auth/select-tenant",{user_id:Re},{headers:{Authorization:`Bearer ${Ee}`}})).data,listMyTenants:async()=>(await cachedAxios.get("/auth/my-tenants",{cache:!1})).data,switchTenant:async Ee=>(await cachedAxios.post("/auth/switch-tenant",{user_id:Ee})).data,register:async Ee=>{const Re={first_name:Ee.firstName,last_name:Ee.lastName,username:Ee.userName||Ee.email,email:Ee.email,password:Ee.password,group_ids:[],isPending:!0,accepted_tc:Ee.acceptedTC||!1};return(await cachedAxios.post("/auth/register",Re)).data},registerCompany:async Ee=>(await cachedAxios.post("/public/tenant-signup",Ee)).data,logout:async()=>(await cachedAxios.post("/auth/logout")).data,googleLogin:async Ee=>(await cachedAxios.post("/auth/google/login",{token:Ee})).data,microsoftLogin:async Ee=>(await cachedAxios.post("/auth/azure/login",{code:Ee})).data,forgotPassword:async Ee=>(await cachedAxios.post("/auth/forgot-password",{email:Ee})).data,resetPassword:async Ee=>(await cachedAxios.post("/auth/reset-password",{data:Ee})).data,getCurrentUser:async(Ee=!1)=>(await cachedAxios.get("/auth/me",{cache:!Ee})).data,fetchProfile:async(Ee=!1)=>(await cachedAxios.get("/profile",{cache:!Ee})).data,getUserPhoto:async(Ee=!1)=>{try{const Re=await cachedAxios.get("/profile/photo",{responseType:"blob",cache:!Ee,timeout:1e4,"axios-retry":{retries:0}});return URL.createObjectURL(Re.data)}catch(Re){if((Re==null?void 0:Re.status)===404)return null;throw Re}},updateUserProfile:async Ee=>(await cachedAxios.put("/profile",Ee)).data,updateProfileDetails:async Ee=>{const Re=new FormData;return Object.entries(Ee||{}).forEach(([je,Oe])=>{const Me=String(Oe??"").trim();Me&&Re.append(je,Me)}),(await cachedAxios.put("/profile",Re)).data},updateEmailNotificationsPreference:async(Ee={})=>{const Re={};return Ee.preferences&&typeof Ee.preferences=="object"&&(Re.email_notification_preferences=Ee.preferences),(await cachedAxios.patch("/auth/me",Re)).data},verifyEmailCode:async(Ee,Re)=>(await cachedAxios.post("/auth/email-verification/verify",{code:Re},{headers:{Authorization:`Bearer ${Ee}`}})).data,validateActivationToken:async({uid:Ee,token:Re})=>(await cachedAxios.post("/auth/invitation/validate",{uid:Ee,token:Re})).data,verifySignupCode:async({uid:Ee,code:Re})=>(await cachedAxios.post("/auth/signup/verify-code",{uid:Ee,code:Re})).data,completeSignup:async({uid:Ee,code:Re,firstName:Te,lastName:je,password:Oe,confirmPassword:Me})=>(await cachedAxios.post("/auth/complete-signup",{uid:Ee,code:Re,first_name:Te,last_name:je,password:Oe,confirm_password:Me})).data,resendActivationEmail:async Ee=>(await cachedAxios.post("/auth/resend-activation",{email:Ee})).data,resendEmailVerificationCode:async Ee=>(await cachedAxios.post("/auth/email-verification/resend",{},{headers:{Authorization:`Bearer ${Ee}`}})).data},getSupportEmail=()=>{var Ee;try{return((Ee=store.getState().maintenance)==null?void 0:Ee.supportEmail)||"[email protected]"}catch{return"[email protected]"}},userService={getTCStatus:async()=>{try{return(await cachedAxios.get("/user/tc-status")).data}catch(Ee){if(Ee.response&&(Ee.response.status===401||Ee.response.status===403)){try{localStorage.removeItem(STORAGE_KEYS.AUTH_TOKEN),localStorage.removeItem(STORAGE_KEYS.USER_DATA),STORAGE_KEYS.PERSIST_ROOT&&(localStorage.removeItem(STORAGE_KEYS.PERSIST_ROOT),localStorage.removeItem(`persist:${STORAGE_KEYS.PERSIST_ROOT}`))}catch{}window.location.href="/login"}throw Ee}},acceptTC:async Ee=>{try{return(await cachedAxios.post("/user/accept-tc",{version:Ee,timestamp:new Date().toISOString(),accepted:!0})).data}catch(Re){if(Re.response&&(Re.response.status===401||Re.response.status===403)){try{localStorage.removeItem(STORAGE_KEYS.AUTH_TOKEN),localStorage.removeItem(STORAGE_KEYS.USER_DATA),STORAGE_KEYS.PERSIST_ROOT&&(localStorage.removeItem(STORAGE_KEYS.PERSIST_ROOT),localStorage.removeItem(`persist:${STORAGE_KEYS.PERSIST_ROOT}`))}catch{}window.location.href="/login"}throw Re}},getLatestTC:async()=>({content:`OpenParser AI 45SaaS Terms and Conditions 46(Master Subscription Agreement) 47 48Provider: Innovatix Technology Partners 49Effective Date: 9/23/2026 50 51These SaaS Terms and Conditions (the "Agreement") govern access to and use of the OpenParser AI service (the "Service") provided by Innovatix Technology Partners ("Provider", "Innovatix", "we", "us"). 52By executing an Order Form, clicking "I agree," or accessing or using the Service, the entity identified on the Order Form ("Customer", "you") agrees to be bound by this Agreement. 53 54Table of Contents 55⢠1. Parties and Acceptance 56⢠2. Definitions 57⢠3. Subscription; Account Administration 58⢠4. Use Restrictions; Acceptable Use 59⢠5. Service; Availability; Changes 60⢠6. Customer Content; Data Rights 61⢠7. AI Features; Outputs; Human Review 62⢠8. Security; Incident Response 63⢠9. Support; Maintenance 64⢠10. Fees; Payment; Taxes 65⢠11. Suspension 66⢠12. Confidentiality 67⢠13. Intellectual Property; Feedback 68⢠14. Third-Party Services; Open Source 69⢠15. Compliance; Export; Sanctions 70⢠16. Term; Renewal; Termination 71⢠17. Warranties; Disclaimers 72⢠18. Indemnification 73⢠19. Limitation of Liability 74⢠20. Dispute Resolution; Governing Law 75⢠21. Changes to the Agreement 76⢠22. Miscellaneous 77⢠Exhibits and Policies 78 791. Parties and Acceptance 80This Agreement is between Provider and Customer. If Customer is accepting on behalf of an organization, Customer represents it has authority to bind that organization and its Authorized Users. 81Order of precedence. If there is a conflict among the Order Form, an amendment, this Agreement, and any Documentation or policies, the following order controls: (1) Order Form, (2) signed amendment, (3) this Agreement, (4) Documentation and policies. 82Electronic acceptance. Customer agrees that electronic acceptance, including click-through acceptance and electronic signatures, is legally binding. 83 842. Definitions 85⢠"Affiliate" means an entity that controls, is controlled by, or is under common control with a party. 86⢠"Authorized Users" means Customer's employees, contractors, and agents who are authorized by Customer to access and use the Service under Customer's subscription. 87⢠"Customer Content" means documents, files, data, prompts/inputs, and other materials submitted to or processed through the Service by or for Customer. 88⢠"Documentation" means Provider's then-current user guides, technical documentation, and policies relating to the Service. 89⢠"Order Form" means an ordering document or online checkout that references this Agreement and identifies the subscription plan, usage limits (if any), fees, and Subscription Term. 90⢠"Outputs" means responses, summaries, extractions, classifications, analytics, recommendations, or other results generated by the Service (including AI-enabled features) from Customer Content and/or inputs. 91⢠"Provider Technology" means the Service, software, models, algorithms, interfaces, configurations, templates, and other technology provided by Provider, excluding Customer Content. 92⢠"Security Incident" means a confirmed unauthorized access to Customer Content in Provider's possession or control. 93⢠"Subscription Term" means the subscription period stated in the Order Form. 94⢠"Usage Data" means telemetry and operational data about use of the Service that does not intentionally include Customer Content and does not identify Customer's documents (e.g., feature usage, performance, reliability, and security signals). 95 963. Subscription; Account Administration 97Subscription. Subject to Customer's compliance with this Agreement and the applicable Order Form, Provider grants Customer a limited, non-exclusive, non-transferable, non-sublicensable right during the Subscription Term to access and use the Service solely for Customer's internal business purposes. 98Authorized Users. Customer may permit Authorized Users to access the Service only for Customer's internal business purposes. Customer is responsible for all activities conducted under its accounts, including acts and omissions of Authorized Users. 99Account security. Customer will maintain the confidentiality of its credentials and will promptly notify Provider of any suspected unauthorized access. Provider may assume that all actions taken using Customer credentials are authorized by Customer. 100Usage limits. The Service may be subject to usage limits (e.g., users, storage, documents, API calls, tokens). Provider may enforce limits via technical controls, rate limits, or feature restrictions. Overage fees, if any, will be described
100in the Order Form or Documentation. 101 1024. Use Restrictions; Acceptable Use 103Customer will not, and will not permit any third party to: 104⢠Reverse engineer, decompile, disassemble, or attempt to derive source code, models, weights, prompts, or underlying ideas of the Service, except to the extent prohibited by law; 105⢠Copy, modify, translate, or create derivative works of Provider Technology, except as expressly permitted by Documentation; 106⢠Circumvent or disable security, usage limits, access controls, or authentication mechanisms; 107⢠Access or use the Service to develop, train, benchmark, or improve a competing product or service, or to extract Outputs in a systematic way to create a substitute dataset; 108⢠Use the Service to transmit malware, conduct phishing, perform unauthorized scanning, or otherwise interfere with the integrity or performance of the Service; 109⢠Use the Service in a manner that violates applicable law, regulation, or third-party rights (including privacy, publicity, and intellectual property rights). 110Acceptable Use Policy. Customer agrees to comply with the Acceptable Use Policy in Exhibit D (or as posted in Documentation). Violation of the AUP is a material breach. 111Restricted and regulated data. Unless expressly permitted in an Order Form or written amendment, Customer will not upload or process Restricted Data (defined in Section 6.5). 112 1135. Service; Availability; Changes 114Service description. The Service provides document ingestion, search, extraction, summarization, Q&A, and related workflows, including AI-enabled features. 115AI-enabled features are delivered using foundation models made available through a managed AI service operated within Provider's cloud environment (the "Managed AI Service"). In the default Service configuration, Customer Content is not transmitted to any foundation model provider's external systems or public APIs. 116Multi-tenancy. The Service may be provided on a multi-tenant basis. Customer's tenant is logically segregated from other tenants using access controls. 117Availability. Provider will use commercially reasonable efforts to make the Service available, except for (a) planned maintenance, (b) emergency maintenance, (c) Customer or third-party network issues, and (d) circumstances outside Provider's reasonable control. 118Changes and discontinuation. Provider may update the Service, including adding, modifying, or removing features. Provider will not materially reduce core functionality during a paid Subscription Term without providing a commercially reasonable alternative, workaround, or remedy. 119Beta/preview features. Beta or preview features are provided "as is," may be modified or discontinued, and are excluded from any warranty or SLA unless expressly stated otherwise. 120 1216. Customer Content; Data Rights 122Ownership. As between the parties, Customer retains all right, title, and interest in Customer Content. Provider retains all right, title, and interest in Provider Technology. 123License to process. Customer grants Provider a limited, worldwide license to host, store, copy, transmit, and process Customer Content solely to provide, maintain, secure, support, and improve the Service (including to prevent abuse and ensure reliability), and as otherwise permitted by this Agreement and the Privacy Policy. 124Customer responsibilities. Customer represents and warrants that it has obtained, and will maintain, all rights, consents, and permissions necessary for Provider to process Customer Content and personal data contained in Customer Content in accordance with this Agreement. 125Data accuracy. Customer is responsible for the completeness, accuracy, quality, and legality of Customer Content, and for how Customer uses Outputs. 1266.1 Data processing roles 127To the extent Customer Content includes personal data subject to data protection laws, Customer is the "controller" or "business" (as applicable) and Provider is the "processor" or "service provider" (as applicable), processing such data only on Customer's documented instructions as described in this Agreement and any Data Processing Addendum ("DPA").
1286.2 Subprocessors 129Provider may use subprocessors (including cloud hosting and analytics providers) to help deliver the Service. AI inference in the default Service configuration is performed through the Managed AI Service; Provider's cloud infrastructure provider acts as Provider's subprocessor for hosting and AI processing. Foundation model providers do not act as subprocessors, do not receive Customer Content, and have no access to the environment in which their models are deployed. Provider will maintain contractual protections with subprocessors consistent with applicable law and the DPA (where applicable), and will maintain a current subprocessor list in the Documentation. 1306.3 Data export 131During the Subscription Term, Customer may export Customer Content using available export features. After termination, Provider will make Customer Content available for export for a limited period described in Section 16.4, after which Provider will delete or de-identify Customer Content in accordance with its retention practices, unless retention is required or permitted by law. 1326.4 Usage Data 133Provider may collect and use Usage Data to provide, secure, and improve the Service, including capacity planning, feature performance, reliability, and abuse prevention. Usage Data does not grant Provider the right to disclose Customer Content to other customers. 1346.5 Restricted Data 135"Restricted Data" means any data subject to special regulatory or contractual requirements, including: (a) payment card data subject to PCI DSS; (b) protected health information regulated by HIPAA; (c) classified, controlled unclassified, or export-controlled government information; (d) biometric identifiers/templates; (e) precise geolocation for tracking individuals; (f) Social Security numbers or government-issued IDs at scale; and (g) any other data requiring safeguards beyond those generally provided by the Service. 136Unless expressly permitted in an Order Form or written amendment, Customer will not upload Restricted Data. If Customer uploads Restricted Data in violation of this section, Customer does so at its own risk and Provider may delete or quarantine the data and/or suspend access as necessary to protect the Service. 137 1387. AI Features; Outputs; Human Review 139AI acknowledgment. Customer acknowledges the Service uses automated and AI/ML techniques to process inputs and generate Outputs. Outputs may be probabilistic, non-deterministic, inaccurate, incomplete, or unsuitable for Customer's purposes. 140Human review required. Customer is solely responsible for human review and independent verification of Outputs before use, especially for regulated, high-stakes, or external-facing purposes (including legal, insurance, financial, medical, employment, or safety decisions). 141No professional advice. Provider does not provide legal, tax, insurance, medical, or other professional advice. Outputs are provided for informational purposes only. 142No uniqueness; third-party rights. Provider does not warrant that Outputs are unique or non-infringing. Customer is responsible for ensuring its use of Outputs complies with law and third-party rights. 1437.1 Training and model improvement 144No training on Customer Content. Provider does not use Customer Content to train, fine-tune, or improve any AI model, except where expressly agreed in a written amendment or Order Form that clearly describes the scope and opt-in terms. Customer Content submitted to the Managed AI Service is not stored or logged by that service, is not used to train any foundation model, and is not shared with or accessible to any foundation model provider. 145Service improvement. Provider may use Usage Data and may use Customer Content in de-identified and/or aggregated form where reasonably practicable to maintain, secure, and improve the Service (e.g., reliability, latency, abuse prevention, and feature performance), provided such use does not intentionally disclose Customer identity or Customer Content to other customers. 146 1477.2 AI Processing Environment 148All AI inference for the default Service configuration occurs within Provider's secured AWS environment using Amazon Bedrock. Customer Content processed by AI-e
148nabled features remains within the AWS network, is encrypted in transit (TLS 1.2+) and at rest (AWS KMS), and is not transmitted to any external AI provider API. This Section applies to the default Service configuration and not to Customer-Managed Models under Section 7.3. 149 1507.3 Customer-Managed Models 151The Service may permit Customer to connect its own model endpoints or API credentials for third-party AI providers ("Customer-Managed Models"). If Customer enables a Customer-Managed Model, Customer Content processed through that model is transmitted to the applicable provider under Customer's own agreement with that provider, and Sections 7.1 and 7.2 do not apply to that data flow. Customer is responsible for its chosen provider's data use, retention, and training practices. 152 1538. Security; Incident Response 154Security measures. Provider will maintain commercially reasonable administrative, technical, and organizational safeguards designed to protect Customer Content against unauthorized access, disclosure, alteration, or destruction. Example security measures are described in Exhibit C (which may be updated from time to time). 155Customer security. Customer is responsible for configuring the Service appropriately, limiting access to Authorized Users, using strong authentication, and securing its own systems and endpoints. 156Security Incident notice. Upon confirming a Security Incident, Provider will notify Customer without undue delay and provide information reasonably necessary for Customer to meet applicable legal obligations. Provider is not responsible for incidents caused by Customer's acts or omissions, compromised Customer credentials, or Customer-controlled systems. 157 1589. Support; Maintenance 159Support. Provider will provide support as described in the applicable Order Form or Documentation. 160Maintenance. Provider may perform maintenance and updates. Provider will use commercially reasonable efforts to provide advance notice of scheduled maintenance when practicable. 161 16210. Fees; Payment; Taxes 163Fees. Customer will pay all fees specified in the applicable Order Form or at the time of subscription sign-up. Except as expressly stated in this Agreement, all fees are non-cancelable and non-refundable. 164Payment terms. Unless otherwise specified in the Order Form, all fees are due and payable in full at the time of subscription sign-up or prior to activation of the services. Provider will not provision or activate access to the services until payment has been received and processed. For any renewal, add-on services, or usage-based charges (if applicable), payment is due in advance unless otherwise agreed in writing. Any amounts not paid when due (where post-billing is expressly approved) may incur a late fee at the lesser of 1.5% per month or the maximum permitted by law, and Provider may recover reasonable collection costs. 165Taxes. Fees exclude all applicable taxes. Customer is responsible for all sales, use, VAT, GST, duties, and similar governmental charges, excluding taxes based on Provider's net income. 166Pricing Changes. Provider reserves the right to modify fees, subscription charges, or pricing structure at any time at its sole discretion. Any changes will apply to new subscriptions and renewal terms, unless otherwise stated in the Order Form. 167 16811. Suspension 169Provider may suspend Customer's access to the Service (in whole or in part): (a) for non-payment of undisputed amounts; (b) if Customer's use violates this Agreement or the AUP; (c) if Customer's use poses a security risk or threatens the integrity of the Service; or (d) to comply with law or a governmental request. 170Provider will use commercially reasonable efforts to provide notice and to limit suspension to the minimum scope and duration necessary. Suspension does not relieve Customer of payment obligations. 171 17212. Confidentiality 173Confidential Information. "Confidential Information" means non-public information disclosed by one party to the other that is designated as confidential or that reasonably should be understood to be confidential. Customer Content is Customer's Confidential Information. Provider Technology is Provider's Confidential Information. 174Protection. The receiving party will protect the disclosing party's Confidential Information using at least reasonable care and will not use or disclose it except as permitted under this Agreement. 175Permitted disclosures. The receiving party may disclose Confidential Information to its employees, contractors, and advisors with a need to know and who are bound by confidentiality obligations at least as protective as this Agreement. 176Exceptions. Confidentiality obligations do not apply to information that (a) is or becomes public through no fault of the receiving party, (b) was independently developed without use of Confidential Information, (c) was rightfully received without restriction, or (d) was approved for release in writing. 177Compelled disclosure. If compelled by law, the receiving party may disclose Confidential Information provided it gives notice where legally permitted and cooperates in seeking protective treatment. 178 17913. Intellectual Property; Feedback 180Provider IP. Provider retains all right, title, and interest in and to Provider Technology, including all intellectual property rights. No rights are granted except as expressly stated. 181Feedback. If Customer provides suggestions or feedback, Provider may use it without restriction or obligation, and without compensation to Customer. 182Trademarks. Each party retains ownership of its trademarks. Customer may not use Provider's marks without prior written consent. 183 18414. Third-Party Services; Open Source 185Third-party services. For clarity, foundation models made available through the Managed AI Service in the default Service configuration operate within Provider's cloud environment and are not "third-party services" for purposes of this Section. Models or endpoints that Customer elects to connect using its own provider account or credentials are third-party services. 186Open-source software. The Service may include open-source components subject to applicable open-source licenses. To the extent an open-source license grants Customer additional rights, those rights apply only to the open-source components and not the Service as a whole. 187 18815. Compliance; Export; Sanctions 189Compliance with law. Each party will comply with applicable laws and regulations. Customer is responsible for ensuring its use of the Service (and Outputs) complies with law and industry requirements. 190Export controls and sanctions. Customer will not use the Service in violation of U.S. export control laws or sanctions, and will not permit access by sanctioned persons or prohibited jurisdictions. 191 19216. Term; Renewal; Termination 193Term. This Agreement begins on the Effective Date and continues until all Order Forms expire or are terminated. 194Renewal. Unless otherwise stated in an Order Form, subscriptions renew automatically for successive terms equal to the prior term, unless either party gives written notice of non-renewal at least [30] days before the end of the then-current term. 195Termination for cause. Either party may terminate an Order Form for material breach if the breaching party fails to cure within 30 days after written notice (10 days for non-payment). Provider may terminate immediately for Customer's unlawful use or repeated AUP violations. 196Effect of termination; data export. Upon termination or expiration, Customer's right to access the Service ends. Upon request, Provider will make Customer Content available for export for a limited period of 30 days, after which Provider will delete or de-identify Customer Content in accordance with Provider's retention practices unless a longer retention is required or permitted by law. 197Survival. Sections that by their nature should survive termination will survive, including Fees owed, Use Restrictions, Confidentiality, IP, Indemnification, Limitation of Liability, and Dispute Resolution. 198 19917. Warranties; Disclaimers 200Authority. Each party represents it has the authority to enter into this Agreement. 201Limited performance warranty. Provider warrants it will provide the Service in a professional and workmanlike manner. Customer's exclusive remedy for breach of this warranty is re-performance of the affected Service, and if re-performance is not commercially reasonable, Provider may terminate the affected Order Form.
202Disclaimer. EXCEPT AS EXPRESSLY STATED, THE SERVICE AND OUTPUTS ARE PROVIDED "AS IS" AND PROVIDER DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. Provider does not warrant that the Service will be uninterrupted or error-free, or that Outputs will be accurate or complete. 203 20418. Indemnification 20518.1 Customer indemnity 206Customer will defend, indemnify, and hold harmless Provider, its Affiliates, and their respective officers, directors, employees, and agents from and against any third-party claims, damages, liabilities, costs, and expenses (including reasonable attorneys' fees) arising out of or related to: (a) Customer Content; (b) Customer's or Authorized Users' misuse of the Service; or (c) Customer's breach of this Agreement or violation of law. 20718.2 Provider IP indemnity 208Provider will defend, indemnify, and hold harmless Customer from third-party claims that the Service (excluding Customer Content and third-party services) infringes a U.S. patent, copyright, or trade secret, and will pay covered damages, provided Customer: (a) promptly notifies Provider; (b) cooperates; and (c) allows Provider to control the defense and settlement. 209If a claim is likely, Provider may: (i) modify the Service so it becomes non-infringing; (ii) replace the Service with a functionally equivalent service; or (iii) terminate the affected Order Form and refund prepaid, unused fees. 21018.3 Exclusions 211Provider has no indemnity obligation to the extent a claim arises from: (a) Customer Content; (b) Customer's instructions, configurations, or combinations with non-Provider products; (c) third-party services; or (d) use not in accordance with this Agreement. 212 21319. Limitation of Liability 214EXCLUSION OF DAMAGES. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NEITHER PARTY WILL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR FOR LOST PROFITS, LOST REVENUE, OR LOSS OF DATA, EVEN IF ADVISED OF THE POSSIBILITY. 215LIABILITY CAP. TO THE MAXIMUM EXTENT PERMITTED BY LAW, EACH PARTY'S TOTAL LIABILITY ARISING OUT OF OR RELATED TO THIS AGREEMENT WILL NOT EXCEED THE AMOUNTS PAID OR PAYABLE BY CUSTOMER TO PROVIDER UNDER THE APPLICABLE ORDER FORM IN THE TWELVE (12) MONTHS BEFORE THE EVENT GIVING RISE TO LIABILITY. 216Carve-outs. The foregoing limitations do not apply to: (a) Customer's payment obligations; (b) Customer's indemnity obligations; or (c) a party's gross negligence or willful misconduct. 217 21820. Dispute Resolution; Governing Law 219Governing law. This Agreement is governed by the laws of the State of New Jersey, excluding its conflict-of-laws rules. 220Venue. The parties agree to exclusive jurisdiction and venue in the state or federal courts located in Somerset, NJ, unless the parties agree to arbitration in an Order Form or amendment. 221Optional arbitration. If arbitration applies, disputes will be resolved by binding arbitration administered by the American Arbitration Association under its Commercial Arbitration Rules in Somerset, NJ. Judgment may be entered in any court of competent jurisdiction. 222Injunctive relief. Either party may seek injunctive or equitable relief for actual or threatened breach of confidentiality, security, or intellectual property rights. 223OPTIONAL: Class action waiver / jury trial waiver. Include if desired and permitted by law: (a) the parties waive any right to a jury trial; and (b) disputes will be brought only in an individual capacity and not as a plaintiff or class member in any purported class action. 224 22521. Changes to the Agreement 226Provider may update this Agreement to reflect changes in law, security, or the Service. Provider will provide reasonable notice (e.g., email or in-app). Continued use after the effective date constitutes acceptance, unless Customer terminates the subscription before the effective date (where permitted). 227 22822. Miscellaneous 229⢠Assignment. Customer may not assign this Agreement without Provider's prior written consent, except to an Affiliate or in connection with a merger, acquisition, or sale of substantially all assets, provided the assignee agrees in writing to be bound. 230⢠Subcontracting. Provider may subcontract performance of the Service provided Provider remains responsible for its obligations under this Agreement. 231⢠Force majeure. Neither party is liable for delays or failures due to circumstances beyond its reasonable control. 232⢠Independent contractors. The parties are independent contractors and no partnership, joint venture, or agency relationship is created. 233⢠Severability; waiver. If any provision is unenforceable, the remainder will remain in effect. Waivers must be in
233writing and are limited to the specific instance. 234⢠Entire agreement. This Agreement, the Order Form(s), and incorporated policies are the entire agreement and supersede prior discussions. 235 236Exhibits and Policies 237The following exhibits are templates or summaries and may be incorporated by reference into an Order Form or made available in Documentation. 238 239Exhibit A - Order Form Template 240⢠Customer legal name, address, and billing contact 241⢠Subscription plan/tier and permitted use 242⢠Usage limits (users, documents, storage, API calls, tokens) and overage terms 243⢠Fees, billing frequency, payment terms 244⢠Subscription Term start and end dates; renewal terms 245⢠Support/SLA tier (if any) 246⢠Security and compliance addenda (if any) 247⢠Data Processing Addendum (if applicable) 248 249Exhibit B - Data Processing Addendum (DPA) - Summary 250⢠Applies where Customer Content includes personal data subject to GDPR/UK GDPR or similar laws. 251⢠Roles: Customer is Controller and Provider is Processor (or business/service provider under applicable U.S. state privacy laws). 252⢠Processing: Provider processes personal data only on documented instructions to provide the Service. 253⢠Subprocessors: Provider may use subprocessors and will maintain appropriate contractual protections; where required, Provider will provide notice of material changes with an objection mechanism. 254⢠International transfers: SCCs and the UK Addendum (where applicable). 255⢠Assistance: Provider will provide reasonable assistance with security inquiries and data subject requests where required by law.
256⢠Deletion: Provider will delete personal data after termination subject to agreed retention and legal requirements. 257⢠Audit: Provider will provide reasonable security information (e.g., audit summaries) subject to confidentiality. 258 259Exhibit C - Security Measures - Summary 260⢠Logical access controls and role-based access 261⢠Tenant isolation controls and tenant-scoped authorization 262⢠Audit logging for key security events 263⢠Encryption in transit (TLS 1.2 or higher) and encryption at rest using a managed key management service; AI inference performed within Provider's cloud environment over private connectivity, so that Customer Content is not exposed to the public internet during AI processing. 264⢠Data utilized within retrieval components (e.g., vector databases) is maintained in a controlled environment with tenant-level isolation and restricted access, consistent with the overall security framework. 265⢠Vulnerability management and patching 266⢠Backups and disaster recovery (as applicable) 267⢠Secure software development lifecycle 268⢠Incident response procedures 269 270Exhibit D - Acceptable Use Policy (AUP) 271Customer and Authorized Users will not use the Service to: 272⢠Violate law or third-party rights, including privacy and intellectual property rights; 273⢠Transmit malware or abusive traffic, or disrupt the Service; 274⢠Perform unauthorized penetration testing, security scanning, or benchmarking; 275⢠Engage in unlawful surveillance or collect personal data without proper notices/consents; 276⢠Create, improve, or benchmark competing products, or systematically extract Outputs to create substitute datasets; 277⢠Upload Restricted Data except as expressly permitted in an Order Form or written amendment. 278 279Exhibit E - Data Privacy & AI Usage Disclosure 280This Exhibit describes how Provider processes Customer Content and personal data in connection with the Service, including AI-enabled features. This Exhibit is incorporated by reference and, where applicable law requires, the parties will enter into Provider's Data Processing Addendum ("DPA"), which will control to the extent it conflicts with this Exhibit. 2811. Roles; Scope. Customer determines the purposes and means of processing Customer Content and any personal data contained therein. To the extent Provider processes personal data on behalf of Customer, Provider acts as a "processor" or "service provider" (as applicable) and processes such personal data only to provide, maintain, secure, and support the Service, and as otherwise permitted under this Agreement, the Privacy Policy, and the DPA (if applicable). 2822. Processing Purposes. Customer Content (including uploaded documents, prompts/inputs, and associated metadata) may be processed to: (a) provide and operate the Service and its features (including search, extraction, summarization, and Q&A); (b) perform customer-requested configurations, workflows, and support; (c) prevent fraud, abuse, and security incidents; (d) perform debugging, reliability, and performance monitoring; and (e) comply with law and enforce this Agreement. 2833. AI Processing Acknowledgment. Customer acknowledges the Service uses artificial intelligence and machine-learning technologies to process Customer Content and generate Outputs. Outputs may be inaccurate, incomplete, non-deterministic, or otherwise unsuitable. Customer is solely responsible for human review and independent verification of Outputs prior to use, particularly for regulated, high-stakes, or external purposes. 2844. AI Processing Environment; Subprocessors. AI-enabled features are provided through a managed AI service operating within Provider's cloud environment. Customer Content and prompts/inputs processed by AI-enabled features remain within that environment and are not transmitted to any external AI provider's systems or APIs in the default Service configuration. Foundation model providers cannot access the deployment accounts in which their models run and do not receive, store, or process Customer Content. Provider's cloud infrastructure provider acts as Provider's subprocessor for hosting and AI processing; Provider will maintain commercially reasonable contractual protections with subprocessors consistent with the DPA (where applicable). 2855. Training; Model Improvement (Default: No Cross-Customer Training). By default, Provider does not use Customer Content to train or fine-tune generalized AI models made available to other customers. Any such use will occur only if expressly agreed in writing. Provider may use Usage Data and may use Customer Content in de-identified or aggregated form where reasonably practicable for maintaining, securing, and improving the Service, provided such use does not intentionally disclose Customer identity or Customer Content to other customers. 2866. No Human Review Obligation. Provider does not guarantee human review of Customer Content or Outputs and has no obligation to monitor, validate, correct, or curate Customer Content or Outputs. 2877. Data Security. Provider implements commercially reasonable safeguards designed to protect Customer Content and personal data. No security measures are infallible; Provider does not guarantee absolute security. Customer is responsible for securely managing credentials and user access within Customer's environment. 2888. Security Incidents. If Provider confirms a Security Incident, Provider will notify Customer without undue delay and provide information reasonably necessary for Customer to meet applicable legal obligations, consistent with Section 8. 2899. Data Retention;
289 Deletion. Customer Content is retained for the duration of the subscription and as reasonably necessary to provide the Service, comply with legal obligations, resolve disputes, or enforce this Agreement. After termination, Provider will delete or de-identify Customer Content in accordance with Provider's retention practices, unless a longer period is required or permitted by law. 29010. Restricted Data. Unless expressly permitted, Customer will not upload Restricted Data, including PCI, PHI, export-controlled, or other highly sensitive data requiring special safeguards. 29111. Customer Responsibilities. Customer is responsible for providing required notices and obtaining consents; ensuring Customer Content is lawfully collected, used, and disclosed; complying with privacy laws; and conducting assessments (e.g., DPIAs) as required for Customer's use of AI features. 29212. International Transfers. The Service is provided from, and Customer Content is processed in, the United States or other region(s) identified in the Order Form or Documentation. AI inference occurs in the region associated with Customer's tenant. If cross-region inference within the same geography is used for capacity or resiliency, it will be described in the Documentation. Where required by applicable law, transfers are addressed through the DPA and applicable transfer mechanisms. 29313. No Waiver; Limitation of Liability. This Exhibit does not modify Provider's disclaimers, limitations of liability, or indemnification obligations elsewhere in this Agreement. 294 295If you have any questions about these Terms and Conditions, please contact us at ${getSupportEmail()}`,version:"2026.4.28"}),getLatestPrivacyPolicy:async()=>({content:`OpenParser AI 296Privacy Policy 297 298Innovatix Technology Partners 299Effective Date: 9/23/2026 300 301Table of Contents 3021. Scope and Key Concepts 3032. Roles: Customer vs. Innovatix 3043. Information We Collect 3054. How We Use Information 3065. How We Share Information 3076. Cookies and Similar Technologies 3087. AI Features and Automated Processing 3098. Data Retention 3109. Security 31110. International Transfers 31211. Your Rights and Choices 31312. Children's Privacy 31413. Changes to This Policy 31514. Contact Us 316Appendix A - Data Privacy & AI Usage Disclosure 317 3181. Scope and Key Concepts 319This Privacy Policy applies to personal information we process in connection with the Service, including when you visit our website, create an account, use the Service, or contact us for support. 320 321"Personal information" (or "personal data") means information that identifies, relates to, describes, is reasonably capable of being associated with, or could reasonably be linked to an individual. Definitions may vary by jurisdiction. 322 323This Policy does not cover third-party websites or services that may be linked from the Service or integrated at your direction. Their privacy practices are governed by their own policies. 324 3252. Roles: Customer vs. Innovatix 326When a business customer uses the Service, Innovatix typically acts as a service provider/processor for Customer Content. The Customer is responsible for determining what information is uploaded, for providing required notices, and for obtaining any required consents. 327 328Innovatix acts as a controller/business for personal information we process for our own purposes, such as account administration, billing, security, product analytics, and marketing (where permitted). 329 330If applicable law requires, Innovatix and the Customer may enter into a Data Processing Addendum ("DPA") to govern our processor/service provider obligations. 331 3323. Information We Collect 333We collect information from (a) you or your organization, (b) your use of the Service, and (c) third parties (e.g., payment processors) as described below. 334 3353.1 Information you provide 336⢠Account and contact information (e.g., name, email address, phone number, organization name, job title). 337⢠Billing and transactional information (e.g., billing contact details, invoices, payment status; payment card data is typically processed by our payment processor and not stored by us except as necessary for billing records).
338⢠Support communications (e.g., messages you send to support, feedback, and related metadata). 339 3403.2 Customer Content processed on behalf of Customers 341The Service allows Customers and Authorized Users to upload documents, files, prompts/inputs, and other content ("Customer Content"). Customer Content may contain personal information, confidential information, or sensitive information. Innovatix processes Customer Content primarily on behalf of and under the instructions of the Customer to provide the Service. 342 3433.3 Information collected automatically 344⢠Usage and log data (e.g., feature usage, timestamps, pages/screens viewed, clicks, error logs). 345⢠Device and network data (e.g., IP address, browser type, device identifiers, operating system, approximate location derived from IP). 346⢠Security signals (e.g., authentication events, suspicious activity indicators, and audit logs). 347 3483.4 Information from third parties 349⢠Payment processors and billing providers (e.g., payment confirmation, billing address, and transaction metadata). 350⢠Identity and authentication providers (if you use single sign-on) (e.g., SSO identifiers). 351⢠Analytics providers (e.g., aggregated usage metrics). 352 3534. How We Use Information 354We use personal information for the following purposes: 355⢠Provide, operate, and maintain the Service, including authenticating users and enabling features such as document processing, search, extraction, summarization, and Q&A. 356⢠Provide customer support, respond to inquiries, and deliver requested configurations and troubleshooting. 357⢠Process transactions, manage subscriptions, send invoices, and administer accounts. 358⢠Monitor, protect, and improve the security and integrity of the Service, including detecting and preventing fraud and abuse. 359⢠Understand service performance and usage trends, and improve features, reliability, and user experience. 360⢠Comply with legal obligations and enforce our agreements and policies. 361⢠Send service-related messages (e.g., security notices, administrative updates). 362⢠Marketing and promotional communications, where permitted by law and subject to your choices (e.g., opt-out). 363 3645. How We Share Information 365We may share personal information in the following circumstances: 366⢠Service providers and subprocessors. We use vendors to host infrastructure, provide analytics, support, billing, and AI-enabled processing. These vendors process data under contractual obligations consistent with this Policy and applicable law. 367⢠At Customer direction. If a Customer enables a third-party integration, we may share information as directed by the Customer or Authorized Users. 368⢠Affiliates. We may share information with our Affiliates for operational, support, and business purposes consistent with this Policy. 369⢠Legal and safety. We may disclose information to comply with law, respond to lawful requests, protect rights and safety, investigate fraud, and enforce our agreements. 370⢠Business transfers. We may share information in connection with a merger, acquisition, financing, reorganization, bankruptcy, or sale of assets. We will take reasonable steps to ensure continued protection of personal information. 371 372We do not knowingly disclose Customer Content to other customers. Customer Content is processed to provide the Service to the Customer that supplied it. 373 3746. Cookies and Similar Technologies 375We may use cookies and similar technologies (such as pixels and local storage) to operate the website and Service, remember preferences, maintain sessions, understand usage, and enhance security. 376 377Your choices. You can control cookies through your browser settings and, where available, in-product cookie preferences. Disabling cookies may affect functionality. 378 379Do Not Track. Some browsers offer a "Do Not Track" feature. There is no consistent industry standard for responding to such signals; we may not respond to them. 380 3817. AI Features and Automated Processing 382The Service includes AI-enabled features that analyze Customer Content and user inputs to generate Outputs (e.g., extractions, summaries, and answers
382). Outputs may be inaccurate, incomplete, non-deterministic, or otherwise unsuitable for your purposes. Customers are responsible for human review and verification before relying on Outputs. 383 384Training and model improvement. By default, we do not use Customer Content to train or fine-tune generalized AI models made available to other customers, unless the Customer explicitly opts in via a written agreement or Order Form. We may use usage telemetry and may use de-identified and/or aggregated data where reasonably practicable to maintain, secure, and improve the Service. 385 3868. Data Retention 387We retain personal information for as long as necessary to provide the Service, comply with legal obligations, resolve disputes, enforce agreements, and for legitimate business purposes. Retention periods vary based on the type of data, the Customer's subscription term, and legal requirements. 388 389Customer Content is generally retained for the duration of the Customer's subscription and then deleted or de-identified in accordance with our retention practices, subject to export windows and legal requirements. 390 3919. Security 392We implement commercially reasonable administrative, technical, and organizational measures designed to protect personal information against unauthorized access, disclosure, alteration, or destruction. However, no security measures are infallible, and we cannot guarantee absolute security. 393 394You are responsible for securing your own accounts and devices, using strong passwords, enabling multi-factor authentication where available, and limiting access to authorized personnel. 395 39610. International Transfers 397We may process and store information in the United States and other countries where we or our service providers operate. Where required by law, we use appropriate safeguards for international transfers, such as Standard Contractual Clauses and the UK Addendum, as applicable and typically documented in a DPA. 398 39911. Your Rights and Choices 40011.1 Account and communications 401⢠Account information. You may update certain account information through the Service or by contacting us. 402⢠Marketing communications. You can opt out of marketing emails by using the unsubscribe link in the email or contacting us. Service-related communications are not optional. 403 40411.2 Data subject rights (EEA/UK and other jurisdictions) 405Depending on your location, you may have rights to access, correct, delete, restrict or object to processing, and to data portability. Where we act as a processor/service provider for Customer Content, requests should be directed to the Customer (the data controller/business). We will assist Customers with such requests as required by law and contractual commitments. 406 407To submit a request regarding information we control, contact us at [email protected]. We may need to verify your identity before fulfilling requests. 408 40911.3 California privacy notice (CCPA/CPRA) 410If you are a California resident, California law may provide you with additional rights regarding your personal information, including the right to know, delete, correct, and opt out of "sale" or "sharing" of personal information (as those terms are defined by law), and the right to limit use and disclosure of sensitive personal information (where applicable). 411 412We do not sell personal information for monetary consideration. Depending on how cookies and advertising technologies are configured, certain disclosures for cross-context behavioral advertising may be considered "sharing" under California law. If we engage in such sharing, we will provide an opt-out mechanism (e.g., a "Do Not Sell or Share My Personal Information" link or cookie preference center) as required. 413 414Authorized agent. You may designate an authorized agent to submit requests on your behalf. We may require proof of authorization and identity verification. 415 416Non-discrimination. We will not discriminate against you for exercising your privacy rights. 417 41812. Children's Privacy 419The Service is not directed to children under 13 (or such higher age as may be required by law). We do not knowingly collect personal information from children. If you believe a child has provided personal information, contact us so we can take appropriate action. 420 42113. Changes to This Policy 422We may update this Policy from time to time. We will post the updated Policy with a new effective date and, if changes are material, provide additional notice (e.g., via email or in-product notice). 423 42414. Contact Us 425Innovatix Technology Partners 426Attn: Privacy 427135 Route 202/206, Suite 9 Bedminster, NJ 07921 428Email: [email protected] 429 430Appendix A - Data Privacy & AI Usage Disclosure 431This Appendix describes how Innovatix Technology Partners (the "Company") processes Customer Content and personal data in connection with the Service, including AI-enabled features. By accessing or using the Service, Customer acknowledges and agrees to the practices described herein and in this Privacy Policy. If Customer or its Authorized Users are located outside the United States or applicable law so requires, the parties will enter into (or are deemed to have entered into) the Company's Data Processing Addendum ("DPA"), which will govern to the extent it conflicts with this Appendix. 432 4331. Roles; Scope. Customer is responsible for determining the purposes and means of processing Customer Content and any personal data contained therein. To the extent the Company processes personal data on behalf of Customer, the Company acts as a "processor" or "service provider" (as applicable) and processes such personal data only to provide, maintain, secure, and support the Service, and as otherwise permitted under this Privacy Policy, the Agreement, and the DPA (if applicable). 434 4352. Processing Purposes. Customer Content (including uploaded documents, prompts/inputs, and associated metadata) may be processed to: (a) provide and operate the Service and its features (including search, extraction, summarization, and Q&A over Customer Content); (b) perform customer-requested configurations, workflows, and support; (c) prevent fraud, abuse, and security incidents; (d) perform debugging, reliability, and performance monitoring; and (e) comply with applicable law and enforce applicable terms. 436 4373. AI Processing Acknowledgment. Customer expressly acknowledges the Service uses artificial intelligence and machine-learning technologies (including automated systems and probabilistic models) to process Customer Content and generate outputs, recommendations, and other results ("Outputs"). Outputs may be inaccurate, incomplete, non-deterministic, or otherwise unsuitable for Customer's purposes. Customer is solely responsible for human review and independent verification of Outputs prior to use, particularly for regulated, high-stakes, or external purposes. 438 4394. Third-Party AI Providers; Subprocessors. To provide AI-enabled features, the Company may transmit limited portions of Customer Content and/or prompts/inputs to third-party service providers (including AI model providers, hosting providers, and analytics providers) acting as subprocessors. Customer authorizes such disclosures and processing to the extent necessary to provide the Service. The Company will maintain commercially reasonable contractual protections with subprocessors consistent with the DPA (where applicable), and may update subprocessors from time to time. Where required by law or the DPA, the Company will provide notice of material subprocessor changes and an opportunity to object. 440 4415. Training; Model Improvement (Default: No Cross-Customer Training). By default, the Company does not use Customer Content to train or fine-tune generalized AI models made available to other customers. Any use of Customer Content for such training will occur only if expressly agreed in a written amendment or Order Form that clearly describes scope and opt-in terms. The Company may, however, use usage data and service telemetry, and may use Customer Content in a de-identified, aggregated, or otherwise non-customer-specific form where reasonably practicable, for purposes of maintaining, securing, and improving the Service (e.g., reliability, latency, abuse prevention, and feature performance), provided that such use does not intentionally disclose Customer identity or Customer Content to other customers. 442 4436. No Human Review Obligation. The Company does not guarantee human review of Customer Content or Outputs and has no obligation to monitor, validate, correct, or curate Customer Content or Outputs. Customer is responsible for establishing appropriate internal review, approval, and governance controls for any use of the Service and Outputs. 444 4457. Data Security. The Company implements commercially reasonable administrative, technical, and organizational safeguards designed to protect Customer Content and personal data against unauthorized access, disclosure, alteration, or destruction. Customer acknowledges that no security measures are infallible and the Company does not guarantee absolute security. Customer is responsible for securely managing credentials, user access, and endpoint security within Customer's environment. 446 4478. Security Incidents. In the event the Company confirms a security incident involving unauthorized access to Customer Content or personal data, the Company will notify Customer without undue delay and provide information reasonably necessary for Customer to meet applicable legal obligations. 448 4499. Data Retention;
449 Deletion. Customer Content is retained for the duration of Customer's subscription and as otherwise reasonably necessary to provide the Service, comply with legal obligations, resolve disputes, or enforce applicable terms. Following termination or expiration, the Company will make Customer Content available for export for a limited period and will thereafter delete or de-identify Customer Content in accordance with the Company's retention practices, unless a longer retention period is required or permitted by law. 450 45110. Restricted and Regulated Data. Unless expressly permitted in an applicable Order Form or written amendment, Customer will not upload to the Service: (a) payment card data subject to PCI DSS; (b) protected health information regulated by HIPAA; (c) classified, controlled unclassified, or export-controlled government information; or (d) other highly sensitive data requiring special safeguards beyond those generally provided by the Service ("Restricted Data"). 452 45311. Customer Responsibilities. Customer is solely responsible for providing required notices and obtaining necessary consents and authorizations; ensuring Customer Content is lawfully collected, used, and disclosed; and complying with applicable privacy, data protection, and sector-specific laws. 454 45512. International Transfers. Customer acknowledges that the Service may be provided from, and Customer Content may be processed in, the United States and other countries. Where required by applicable law, international transfers will be addressed through the DPA and applicable transfer mechanisms. 456 45713. Regulatory Transparency. This disclosure is intended to support transparency obligations under applicable U.S. consumer protection and privacy laws. To the extent the Company processes personal information subject to state privacy laws on behalf of Customer, the Company will process such data as a service provider/processor for the business purposes described in this Appendix and the DPA (if applicable). 458 45914. No Waiver; Limitation of Liability. Nothing in this Appendix modifies or limits the AI disclaimers, restricted use provisions, limitation of liability, or indemnification obligations set forth elsewhere in the parties' agreement.`,version:"2026.4.28"}),getUserPhotoById:async Ee=>{var Re;if(!Ee)return null;try{const Te=await cachedAxios.get(`/users/${Ee}/photo`,{responseType:"blob",cache:!0,timeout:1e4,"axios-retry":{retries:0}});return URL.createObjectURL(Te.data)}catch(Te){if((Te==null?void 0:Te.status)===404||((Re=Te==null?void 0:Te.response)==null?void 0:Re.status)===404)return null;throw Te}},updateTourStatus:async Ee=>(await cachedAxios.put("/auth/me/tour-status",{"tour-status":Ee})).data,getIndustries:async()=>(await cachedAxios.get("/industries")).data.industries},documentService={getDocuments:async(Ee=!1)=>(await cachedAxios.get("/files",{cache:!Ee})).data,getPaginatedDocuments:async(Ee={},Re=!1)=>{const{page:Te=1,limit:je=100,search:Oe="",group_id:Me=null}=Ee;try{const De=new URLSearchParams({page:Te.toString(),page_size:je.toString()});Oe&&De.append("search",Oe),Me&&(Array.isArray(Me)?De.append("group_id",Me.join(",")):De.append("group_id",Me.toString()));const Be=(await cachedAxios.get(`/files/search?${De.toString()}`,{cache:!Re})).data,Ue=Be.files||Be.documents||[],ze=Be.pagination||{},We=ze.total_records||Be.total||0,Xe=ze.page||Be.page||Te,He=ze.page_size||Be.page_size||je,qe=ze.total_pages||Be.total_pages||Math.ceil(We/He),Ge=Xe<qe;return{documents:Ue,total:We,page:Xe,limit:He,hasMore:Ge,totalPages:qe}}catch(De){throw console.error("Error fetching paginated documents:",De),De}},uploadDocument:async(Ee,Re,Te,je={})=>{const Oe=new FormData;if(Oe.append("file",Ee),Oe.append("original_filename",Ee.name),Oe.append("group_id",Re),je.supersedes_file_id){Oe.append("supersedes_file_id",je.supersedes_file_id),Oe.append("confirm_update","true");const De={[Ee.name]:je.supersedes_file_id};Oe.append("updates_json",JSON.stringify(De))}return je.update_reason&&Oe.append("update_reason",je.update_reason),je.keep_both&&Oe.append("keep_both","true"),(await cachedAxios.post("/upload",Oe,{headers:{"Content-Type":"multipart/form-data"},timeout:6e5,onUploadProgress:De=>{if(Te&&De.total){const $e=Math.round(De.loaded*100/De.total);Te($e)}}})).data},uploadMultipleDocuments:async(Ee,Re,Te,je={})=>{const Oe=new FormData;return Ee.forEach(De=>{Oe.append("file",De),Oe.append("original_filename",De.name)}),Oe.append("group_id",Re),je.keep_both&&Oe.append("keep_both","true"),(await cachedAxios.post("/upload",Oe,{headers:{"Content-Type":"multipart/form-data"},timeout:6e5,onUploadProgress:De=>{if(Te&&De.total){const $e=Math.round(De.loaded*100/De.total);Te($e)}}})).data},uploadMultipleDuplicates:async(Ee,Re,Te,je)=>{const Oe=new FormData;return Ee.forEach(De=>{Oe.append("file",De),Oe.append("original_filename",De.name);const $e=Te[De.name];$e&&Oe.append("supersedes_file_id",$e)}),Oe.append("group_id",Re),Oe.append("confirm_update","true"),Oe.append("updates_json",JSON.stringify(Te)),Oe.append("update_reason",je),(await cachedAxios.post("/upload",Oe,{headers:{"Content-Type":"multipart/form-data"},timeout:6e5})).data},deleteDocument:async Ee=>{const Re=Array.isArray(Ee)?Ee:[Ee];return(await cachedAxios.delete("/files",{data:{ids:Re},timeout:3e5})).data},checkDocumentExists:async Ee=>{try{const Re=await documentService.getDocuments(!0);return(Array.isArray(Re)?Re:Re.files||[]).some(Oe=>Oe.id===Ee)}catch(Re){return console.error("Error checking document existence:",Re),
459!0}},viewDocument:async Ee=>(await cachedAxios.get(`/view/${Ee}`,{responseType:"blob",timeout:6e5,cache:!1})).data,downloadDocument:async Ee=>{const Te=(Array.isArray(Ee)?Ee:[Ee]).filter(Oe=>Oe!=null&&Oe!=="").join(",");if(!Te)throw new Error("At least one document ID is required");return(await cachedAxios.get("/files/download",{params:{ids:Te},responseType:"blob",timeout:6e5})).data},getPendingDocuments:async(Ee=!1)=>(await cachedAxios.get("/documents/pending",{cache:!Ee})).data,approveDocument:async Ee=>(await cachedAxios.post(`/documents/${Ee}/approve`)).data,rejectDocument:async(Ee,Re)=>(await cachedAxios.post(`/documents/${Ee}/reject`,{reason:Re})).data,getUploadableGroups:async()=>(await cachedAxios.get("/groups/uploadable")).data,trainDocument:async Ee=>{const Re=Array.isArray(Ee)?Ee:[Ee],Te=localStorage.getItem(STORAGE_KEYS.AUTH_TOKEN),je=new AbortController,Oe=setTimeout(()=>je.abort(),6e5);try{const Me=await fetch(`${API_BASE_URL}/train`,{method:"POST",headers:{"Content-Type":"application/json",...Te&&{Authorization:`Bearer ${Te}`}},body:JSON.stringify({ids:Re}),keepalive:!0,signal:je.signal});if(clearTimeout(Oe),!Me.ok){const De=await Me.json().catch(()=>({}));throw new Error(De.message||De.error||`HTTP ${Me.status}`)}return Me.json()}catch(Me){throw clearTimeout(Oe),Me.name==="AbortError"?new Error("Training request timed out after 10 minutes"):Me}},editDocument:async(Ee,Re)=>(await cachedAxios.put("/edit",{file_id:Ee,...Re})).data,updateDocumentGroup:async(Ee,Re)=>(await cachedAxios.put("/update-document-group",{file_id:Ee,group_id:Re})).data,resolveUpload:async(Ee,Re,Te=null)=>{const je={token:Ee,action:Re};return Re==="keep_both"&&Te&&(je.new_name=Te),(await cachedAxios.post("/upload/resolve",je)).data}},normalizeGroup=Ee=>!Ee||typeof Ee!="object"?Ee:{...Ee,id:Ee.id??Ee.group_id??Ee.GroupID??null,name:Ee.name??Ee.GroupName??"",description:Ee.description??Ee.Description??"",parent_group_id:Ee.parent_group_id??Ee.ParentGroupId??Ee.ParentGroupID??Ee.parentGroupId??Ee.parent_groupId??null,parent_group_name:Ee.parent_group_name??Ee.ParentGroupName??Ee.parentGroupName??null,created_at:Ee.created_at??Ee.CreatedAt??null},normalizeMember=Ee=>{if(!Ee||typeof Ee!="object")return Ee;const Re=!!(Ee.is_admin??Ee.IsAdmin??Ee.role==="admin"),Te=[Ee.first_name??Ee.FirstName,Ee.last_name??Ee.LastName].filter(Boolean).join(" ").trim();return{...Ee,user_id:Ee.user_id??Ee.UserID??null,name:Ee.name??Ee.Name??Te,email:Ee.email??Ee.Email??"",is_admin:Re,role:Re?"admin":"member"}},groupService={getGroups:async(Ee=!1)=>{var je,Oe;const Re=await cachedAxios.get("/groups",{...Ee&&{cache:{enabled:!1}}});let Te=[];return Array.isArray(Re.data)?Te=Re.data:(je=Re.data)!=null&&je.groups&&Array.isArray(Re.data.groups)?Te=Re.data.groups:(Oe=Re.data)!=null&&Oe.data&&Array.isArray(Re.data.data)?Te=Re.data.data:Re.data&&(Te=Array.isArray(Re.data)?Re.data:[]),Te.map(normalizeGroup)},getGroupMembers:async Ee=>{var je,Oe,Me,De;const Re=await cachedAxios.get(`/groups/${Ee}/members`,{cache:!1}),Te=((je=Re.data)==null?void 0:je.members)||((Oe=Re.data)==null?void 0:Oe.data)||[];return{members:Array.isArray(Te)?Te.map(normalizeMember):[],effectiveGroupIds:((Me=Re.data)==null?void 0:Me.effective_group_ids)||[],group:normalizeGroup(((De=Re.data)==null?void 0:De.group)||{})}},createGroup:async Ee=>{var Te;const Re=await cachedAxios.post("/groups",Ee);return{...Re.data,group:normalizeGroup(((Te=Re.data)==null?void 0:Te.group)||Re.data)}},updateGroup:async(Ee,Re)=>{var je;const Te=await cachedAxios.put(`/groups/${Ee}`,Re);return{...Te.data,group:normalizeGroup(((je=Te.data)==null?void 0:je.group)||Te.data)}},deleteGroup:async Ee=>(await cachedAxios.delete(`/groups/${Ee}`)).data,addMemberToGroup:async(Ee,Re,Te=!1)=>(await cachedAxios.post(`/groups/${Ee}/members`,{user_id:Re,is_admin:Te},{cache:!1})).data,addMembers:async(Ee,Re,Te=!1)=>{const je=Array.isArray(Re)?Re:[];for(const Oe of je)await cachedAxios.post(`/groups/${Ee}/members`,{user_id:Oe,is_admin:!!Te},{cache:!1});return groupService.getGroupMembers(Ee)},removeMemberFromGroup:async(Ee,Re)=>(await cachedAxios.delete(`/groups/${Ee}/members/${Re}`)).data,removeMember:async(Ee,Re)=>(await cachedAxios.delete(`/groups/${Ee}/members/${Re}`)).data,updateMemberRole:async(Ee,Re,Te)=>{const je=String(Te).toLowerCase()==="admin";return{...(await cachedAxios.put(`/groups/${Ee}/members/${Re}`,{is_admin:je},{cache:!1})).data,role:je?"admin":"member",is_admin:je}},getGroupStats:async Ee=>(await cachedAxios.get(`/groups/${Ee}/stats`)).data},buildApiUrl=Ee=>
459{if(/^https?:\/\//i.test(Ee))return Ee;const Re=Ee.startsWith("/")?Ee:`/${Ee}`;return API_BASE_URL?/^https?:\/\//i.test(API_BASE_URL)?`${API_BASE_URL.replace(/\/$/,"")}${Re}`:`${API_BASE_URL.replace(/\/$/,"")}${Re}`:Re},getAuthHeaders=()=>{const Ee=localStorage.getItem(STORAGE_KEYS.AUTH_TOKEN);return Ee?{Authorization:`Bearer ${Ee}`}:{}},parseSseFrame=Ee=>{const Re=Ee.trim();if(!Re||Re.startsWith(":"))return null;const Te=Re.split(/\r?\n/);let je="message";const Oe=[];if(Te.forEach($e=>{if($e.startsWith("event:")){je=$e.slice(6).trim()||"message";return}$e.startsWith("data:")&&Oe.push($e.slice(5).trim())}),Oe.length===0)return null;const Me=Oe.join(` 460`);let De;try{De=JSON.parse(Me)}catch($e){throw new Error(`Failed to parse stream event ${je}: ${$e.message}`)}return{event:je,data:De}},getSessions=async(Ee=!1)=>(await cachedAxios.get("/chat/sessions",{...Ee&&{cache:{enabled:!1}},...Ee?FAST_FAIL_REQUEST:{}})).data,createSession$1=async Ee=>(await cachedAxios.post("/chat/create",{title:Ee})).data,getHistory=async(Ee,Re=!1,Te=30,je=0)=>(await cachedAxios.get(`/chat/history/${Ee}`,{params:{limit:Te,offset:je},...Re&&{cache:{enabled:!1}},...Re?FAST_FAIL_REQUEST:{}})).data,getAvailableModels=async(Ee=!1)=>(await cachedAxios.get("/chat/available-models",{...Ee&&{cache:{enabled:!1}}})).data,sendMessage$1=async(Ee,Re,Te=[],je=[],Oe="",Me="strict",De=null,$e="default",Be=null,Ue=null,ze=[],We=[])=>{const Xe={session_id:Ee,message:Re,document_ids:Te,group_ids:je,custom_instructions:Oe,mode:Me,additional_instructions:De,selected_model:$e||"default",web_urls:(ze||[]).slice(0,5),website_ids:coerceWebsiteIds(We),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"};return Be&&Be!==Re&&(Xe.agent_message=Be),Ue&&(Xe.db_connection_id=Ue),(await cachedAxios.post("/chat",Xe)).data},sendMessageStream=async(Ee,Re,Te=[],je=[],Oe="",Me="strict",De=null,$e="default",Be={},Ue=null,ze=null,We=[],Xe=[],He=!1)=>{var rr,ar;const qe={session_id:Ee,message:Re,document_ids:Te,group_ids:je,custom_instructions:Oe,mode:Me,additional_instructions:De,selected_model:$e||"default",stream:!0,web_urls:(We||[]).slice(0,5),website_ids:coerceWebsiteIds(Xe),db_connection_id:ze||null,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"};He&&(qe.is_clarification=!0),Ue&&Ue!==Re&&(qe.agent_message=Ue);const Ge=await fetch(buildApiUrl("/chat/stream"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...getAuthHeaders()},body:JSON.stringify(qe)});if(!Ge.ok){let or="Service Temporarily Unavailable. Please try again shortly.";try{const pr=await Ge.json();or=(pr==null?void 0:pr.error)||(pr==null?void 0:pr.message)||or}catch{}throw new Error(or)}if(!Ge.body){const or=await sendMessage$1(Ee,Re,Te,je,Oe,Me,De,$e,Ue,ze,We,Xe);return(rr=Be.onFinal)==null||rr.call(Be,or),or}const Ye=Ge.body.getReader(),Ve=new TextDecoder;let Ke="",Qe=null,Ze="",Je=null;const ir=or=>{var hr,sr,xr;const pr=parseSseFrame(or);if(!pr)return;const{event:tr,data:nr}=pr;if(tr==="stage"){Je=nr,(hr=Be.onStage)==null||hr.call(Be,nr);return}if(tr==="delta"){const Rr=(nr==null?void 0:nr.delta)||"";Ze+=Rr,(sr=Be.onDelta)==null||sr.call(Be,Rr);return}if(tr==="final"){Qe=nr,(xr=Be.onFinal)==null||xr.call(Be,nr);return}if(tr==="error")throw new Error((nr==null?void 0:nr.error)||(nr==null?void 0:nr.message)||"Service Temporarily Unavailable. Please try again shortly.")};for(;;){const{value:or,done:pr}=await Ye.read();if(pr)break;Ke+=Ve.decode(or,{stream:!0});const tr=Ke.split(/\r?\n\r?\n/);Ke=tr.pop()||"";for(const nr of tr)ir(nr)}if(Ke+=Ve.decode(),Ke.trim()&&ir(Ke),!Qe)if(Ze.trim())Qe={reply:Ze,meta:{session_id:Ee,used_context:!1,sources:[],incomplete_stream:!0,last_stage:Je}},(ar=Be.onFinal)==null||ar.call(Be,Qe);else throw new Error("Chat stream ended before a final response was received.");return Qe},deleteSession$1=async Ee=>(await cachedAxios.delete(`/chat/delete/${Ee}`)).data,renameSession$1=async(Ee,Re)=>(await cachedAxios.put(`/chat/rename/${Ee}`,{title:Re})).data,coerceDocumentIds=Ee=>Array.isArray(Ee)?Ee.map(Re=>{if(Re==null||Re==="")return null;const Te=Number(typeof Re=="string"?Re.trim():Re);return Number.isInteger(Te)?Te:null}).filter(Re=>Re!==null):[],extractSessionDocumentIds$1=Ee=>{var Te,je;const Re=(Ee==null?void 0:Ee.document_ids)??(Ee==null?void 0:Ee.documentIds)??((Te=Ee==null?void 0:Ee.session)==null?void 0:Te.document_ids)??((je=Ee==null?void 0:Ee.session)==null?void 0:je.documentIds);return coerceDocumentIds(Re)},getFileIdFromRecord=Ee=>{const Re=(Ee==null?void 0:Ee.FileID)??(Ee==null?void 0:Ee.fileId)??(Ee==null?void 0:Ee.file_id)??(Ee==null?void 0:Ee.id);if(Re==null||Re==="")return null;const Te=Number(typeof Re=="string"?Re.trim():Re);return Number.isInteger(Te)?Te:null},getFileNameFromRecord=(Ee,Re)=>(Ee==null?void 0:Ee.FileName)||(Ee==null?void 0:Ee.filename)||(Ee==null?void 0:Ee.file_name)||(Ee==null?void 0:Ee.displayFilename)||(Ee==null?void 0:Ee.OriginalFilename)||String(Re),filterExistingDocumentIds$1=async Ee=>{const Re=coerceDocumentIds(Ee);if(Re.length===0)return{ids:[],namesMap:{}}
460;try{const Te=await documentService.getDocuments(!0),je=Array.isArray(Te)?Te:(Te==null?void 0:Te.files)||(Te==null?void 0:Te.documents)||(Te==null?void 0:Te.data)||[],Oe=new Set,Me={};for(const Be of je){const Ue=getFileIdFromRecord(Be);Ue!=null&&(Oe.add(Ue),Me[Ue]=getFileNameFromRecord(Be,Ue))}const De=Re.filter(Be=>Oe.has(Be)),$e={};return De.forEach(Be=>{Me[Be]&&($e[Be]=Me[Be])}),{ids:De,namesMap:$e}}catch{return{ids:Re,namesMap:{}}}},updateSessionDocuments=async(Ee,Re)=>{const Te=coerceDocumentIds(Re);return(await cachedAxios.put(`/chat/session/${Ee}/documents`,{document_ids:Te,documentIds:Te})).data},coerceGroupIds=Ee=>coerceDocumentIds(Ee),extractSessionGroupIds$1=Ee=>{var Te,je;const Re=(Ee==null?void 0:Ee.group_ids)??(Ee==null?void 0:Ee.groupIds)??((Te=Ee==null?void 0:Ee.session)==null?void 0:Te.group_ids)??((je=Ee==null?void 0:Ee.session)==null?void 0:je.groupIds);return coerceGroupIds(Re)},updateSessionGroups=async(Ee,Re)=>{const Te=coerceGroupIds(Re);return(await cachedAxios.put(`/chat/session/${Ee}/groups`,{group_ids:Te,groupIds:Te})).data},coerceWebsiteIds=Ee=>coerceDocumentIds(Ee),extractSessionWebsiteIds$1=Ee=>{var Te,je;const Re=(Ee==null?void 0:Ee.web_sources_ids)??(Ee==null?void 0:Ee.webSourcesIds)??((Te=Ee==null?void 0:Ee.session)==null?void 0:Te.web_sources_ids)??((je=Ee==null?void 0:Ee.session)==null?void 0:je.webSourcesIds);return coerceWebsiteIds(Re)},extractSessionDbConnectionId$1=Ee=>{var je,Oe;const Re=(Ee==null?void 0:Ee.db_connection_id)??(Ee==null?void 0:Ee.dbConnectionId)??((je=Ee==null?void 0:Ee.session)==null?void 0:je.db_connection_id)??((Oe=Ee==null?void 0:Ee.session)==null?void 0:Oe.dbConnectionId)??null;if(Re==null)return null;const Te=Number(typeof Re=="string"?Re.trim():Re);return Number.isInteger(Te)&&Te>0?Te:null},updateSessionWebsites=async(Ee,Re)=>{const Te=coerceWebsiteIds(Re);return(await cachedAxios.put(`/chat/session/${Ee}/websites`,{website_ids:Te,websiteIds:Te})).data},updateSessionDbConnection=async(Ee,Re)=>(await cachedAxios.put(`/chat/session/${Ee}/db-connection`,{dbConnectionId:Re??null,db_connection_id:Re??null})).data,pinSession=async Ee=>(await cachedAxios.put(`/chat/pin/${Ee}`)).data,unpinSession=async Ee=>(await cachedAxios.put(`/chat/unpin/${Ee}`)).data,archiveSession=async Ee=>(await cachedAxios.post("/chat/archive",{session_id:Ee})).data,unarchiveSession=async Ee=>(await cachedAxios.post("/chat/unarchive",{session_id:Ee})).data,clearConversation$1=async Ee=>(await cachedAxios.delete("/chat/clear",{data:{session_id:Ee}})).data,deleteMessage$1=async(Ee,Re)=>(await cachedAxios.delete("/chat/message",{data:{session_id:Ee,message_id:Re}})).data,editMessage$1=async(Ee,Re,Te)=>(await cachedAxios.put("/chat/message",{session_id:Ee,message_id:Re,content:Te})).data,shareSession$1=async(Ee,{userIds:Re=[],groupIds:Te=[],permission:je="view"}={})=>{const Oe=coerceDocumentIds(Re),Me=coerceGroupIds(Te);return(await cachedAxios.post(`/chat/session/${Ee}/share`,{user_ids:Oe,userIds:Oe,group_ids:Me,groupIds:Me,permission:je})).data},getSessionShares=async Ee=>(await cachedAxios.get(`/chat/session/${Ee}/shares`,{cache:{enabled:!1}})).data,revokeSessionShare$1=async(Ee,{userId:Re,groupId:Te}={})=>(await cachedAxios.delete(`/chat/session/${Ee}/share`,{data:{user_id:Re??null,userId:Re??null,group_id:Te??null,groupId:Te??null}})).data,getSharedWithMe=async(Ee=!1)=>(await cachedAxios.get("/chat/shared-with-me",{...Ee&&{cache:{enabled:!1}},...Ee?FAST_FAIL_REQUEST:{}})).data,getShareRecipients=async()=>(await cachedAxios.get("/chat/share/recipients")).data,subscribeChatSessionMessages=(Ee,Re,Te)=>{if(typeof window>"u"||!Ee)return()=>{};let je=null,Oe=null,Me=0,De=!1;const $e=3e4,Be=1e3,Ue=()=>{if(De)return;const ze=localStorage.getItem(STORAGE_KEYS.AUTH_TOKEN);if(!ze)return;const We=buildApiUrl(`/chat/session/${Ee}/stream?access_token=${encodeURIComponent(ze)}`);try{if(je)try{je.close()}catch{}je=new EventSource(We),je.onopen=()=>{Me=0},je.addEventListener("message",Xe=>{try{const He=typeof Xe.data=="string"?JSON.parse(Xe.data):Xe.data;typeof Re=="function"&&Re(He)}catch(He){console.error("Invalid chat session stream data:",He)}}),je.addEventListener("access_revoked",()=>{if(De=!0,je){try{je.close()}catch{}je=null}typeof Te=="function"&&Te()}),je.onerror=()=>{if(je){try{je.close()}catch{}je=null}if(!De){Me++;const Xe=Math.min(Be*Math.pow(2,Me-1),$e);Oe=setTimeout(Ue,Xe)}}}
460catch(Xe){if(console.error("Failed to open chat session stream:",Xe),!De){Me++;const He=Math.min(Be*Math.pow(2,Me-1),$e);Oe=setTimeout(Ue,He)}}};return Ue(),()=>{if(De=!0,Oe&&(clearTimeout(Oe),Oe=null),je){try{je.close()}catch{}je=null}}},chatService={getSessions,createSession:createSession$1,getHistory,getAvailableModels,sendMessage:sendMessage$1,sendMessageStream,deleteSession:deleteSession$1,renameSession:renameSession$1,updateSessionDocuments,updateSessionGroups,updateSessionWebsites,updateSessionDbConnection,coerceDocumentIds,coerceGroupIds,coerceWebsiteIds,extractSessionDocumentIds:extractSessionDocumentIds$1,extractSessionGroupIds:extractSessionGroupIds$1,extractSessionWebsiteIds:extractSessionWebsiteIds$1,extractSessionDbConnectionId:extractSessionDbConnectionId$1,filterExistingDocumentIds:filterExistingDocumentIds$1,pinSession,unpinSession,archiveSession,unarchiveSession,clearConversation:clearConversation$1,deleteMessage:deleteMessage$1,editMessage:editMessage$1,shareSession:shareSession$1,getSessionShares,revokeSessionShare:revokeSessionShare$1,getSharedWithMe,getShareRecipients,subscribeChatSessionMessages},chatService$1=Object.freeze(Object.defineProperty({__proto__:null,archiveSession,clearConversation:clearConversation$1,coerceDocumentIds,coerceGroupIds,coerceWebsiteIds,createSession:createSession$1,default:chatService,deleteMessage:deleteMessage$1,deleteSession:deleteSession$1,editMessage:editMessage$1,extractSessionDbConnectionId:extractSessionDbConnectionId$1,extractSessionDocumentIds:extractSessionDocumentIds$1,extractSessionGroupIds:extractSessionGroupIds$1,extractSessionWebsiteIds:extractSessionWebsiteIds$1,filterExistingDocumentIds:filterExistingDocumentIds$1,getAvailableModels,getHistory,getSessionShares,getSessions,getShareRecipients,getSharedWithMe,pinSession,renameSession:renameSession$1,revokeSessionShare:revokeSessionShare$1,sendMessage:sendMessage$1,sendMessageStream,shareSession:shareSession$1,subscribeChatSessionMessages,unarchiveSession,unpinSession,updateSessionDbConnection,updateSessionDocuments,updateSessionGroups,updateSessionWebsites},Symbol.toStringTag,{value:"Module"})),getSelectedInstructions=async(Ee=!1)=>(await cachedAxios.get("/custom-instructions/selected",{...Ee&&{cache:{enabled:!1}}})).data,selectInstructions=async Ee=>(await cachedAxios.post("/custom-instructions/select",Ee)).data,getPreset=async Ee=>(await cachedAxios.get(`/custom-instructions/preset/${Ee}`)).data,getDefaultPreset=async()=>(await cachedAxios.get("/custom-instructions/preset/default")).data,getLegalPreset=async()=>(await cachedAxios.get("/custom-instructions/preset/legal")).data,getTechnicalPreset=async()=>(await cachedAxios.get("/custom-instructions/preset/technical")).data,getExecutivePreset=async()=>(await cachedAxios.get("/custom-instructions/preset/executive")).data,getResearchPreset=async()=>(await cachedAxios.get("/custom-instructions/preset/research")).data,getQuickPreset=async()=>(await cachedAxios.get("/custom-instructions/preset/quick")).data,getCustomizePreset=async()=>(await cachedAxios.get("/custom-instructions/preset/customize")).data,getAllPresets=async()=>(await Promise.all([getDefaultPreset(),getLegalPreset(),getTechnicalPreset(),getExecutivePreset(),getResearchPreset(),getQuickPreset(),getCustomizePreset()])).map(Re=>({presetKey:Re.presetKey,displayName:Re.displayName,description:Re.description,settings:Re.settings})),getFavorites=async(Ee=!1)=>(await cachedAxios.get("/list/prompt",{...Ee&&{cache:{enabled:!1}}})).data,saveFavorite$1=async(Ee,Re,Te=!1)=>(await cachedAxios.post("/save/prompt",{title:Re,prompt:Ee,is_global:Te})).data,editFavorite=async(Ee,Re,Te)=>(await cachedAxios.put(`/edit/prompt/${Ee}`,{title:Te,prompt:Re})).data,deleteFavorite$1=async Ee=>(await cachedAxios.delete(`/delete/prompt/${Ee}`)).data,bulkDeleteFavorites$1=async Ee=>(await cachedAxios.post("/delete/prompts/bulk",{ids:Ee})).data,superAdminService={getTenants:async()=>(await cachedAxios.get("/superadmin/tenants")).data,createTenant:async Ee=>(await cachedAxios.post("/superadmin/tenants",Ee)).data,assignTenantAdmin:async(Ee,Re)=>(await cachedAxios.post("/superadmin/tenant-admin",{tenant_id:Ee,admin_email:Re})).data,getTenant:async Ee=>(await cachedAxios.get(`/superadmin/tenants/${Ee}`)).data,updateTenant:async(Ee,Re)=>(await cachedAxios.put(`/superadmin/tenants/${Ee}`,Re)).data,suspendTenant:async(Ee,Re)=>(await cachedAxios.post(`/superadmin/tenant/${Ee}/suspend`,{reason:Re})).data,activateTenant:async Ee=>(await cachedAxios.post(`/superadmin/tenant/${Ee}/activate`)).data,deleteTenant:async Ee=>(await cachedAxios.delete(`/superadmin/tenants/${Ee}`,{data:{confirm:"DELETE"}})).data,getTenantSubscription:async Ee=>(await cachedAxios.get(`/superadmin/tenant/${Ee}/subscription`)).data,getHealthOverview:async()=>(await cachedAxios.get("/superadmin/health/overview")).data,getHealthResources:async()=>(await cachedAxios.get("/superadmin/health/resources")).data,getHealthConnectivity:async()=>(await cachedAxios.get("/superadmin/health/connectivity")).data,getHealthPerformance:async()=>(await cachedAxios.get("/superadmin/health/performance")).data,getSubscriptionsOverview:async()=>(await cachedAxios.get("/superadmin/subscriptions/overview")).data,getExecutiveDashboardOverview:async()=>(await cachedAxios.get("/superadmin/executive-dashboard/overview")).data,getSubscriptionPlans:async()=>(await cachedAxios.get("/superadmin/subscriptions/plans")).data,setTenantSubscription:async(Ee,Re)=>(await cachedAxios.post(`/superadmin/tenants/${Ee}/subscription`,Re)).data,getBillingHistory:async(Ee={})=>(await cachedAxios.get("/superadmin/subscriptions/billing-history",{params:Ee})).data,getTenantBillingHistory:async(Ee,Re={})=>(await cachedAxios.get(`/superadmin/tenants/${Ee}/billing-history`,{params:Re})).data,getStorageStats:async()=>(await cachedAxios.get("/superadmin/pipeline/storage-stats")).data,getPipelineDocuments:async(Ee={})=>(await cachedAxios.get("/superadmin/pipeline/documents",{params:Ee})).data,getGeneralSettings:async()=>(await cachedAxios.get("/superadmin/settings/general")).data,updateGeneralSettings:async Ee=>(await cachedAxios.put("/superadmin/settings/general",Ee)).data,getRateLimitSettings:async()=>(await cachedAxios.get("/superadmin/settings/rate-limits")).data,updateRateLimitSettings:async Ee=>(await cachedAxios.put("/superadmin/settings/rate-limits",Ee)).data,getAuditLogs:async(Ee=!1)=>(await cachedAxios.get("/superadmin/audit/logs",{...Ee&&{cache:{enabled:!1}}})).data,getAuditLogDetails:async Ee=>(await cachedAxios.get(`/superadmin/audit/logs/${Ee}`)).data},tenantAdminService={getTenantUsers:async()=>(await cachedAxios.get("/tenants/users")).data,updateUserRole:async(Ee,Re)=>(await cachedAxios.put(`/tenant/users/${Ee}/role`,{role_id:Re})).data,updateUser:async(Ee,Re)=>(await cachedAxios.put(`/tenant/users/${Ee}`,Re)).data,getTenantRequests:async()=>(await cachedAxios.get("/tenant/requests")).data,approveTenantRequest:async Ee=>(await cachedAxios.post(`/tenant/requests/${Ee}/approve`)).data,rejectTenantRequest:async(Ee,Re)=>(await cachedAxios.post(`/tenant/requests/${Ee}/reject`,{reason:Re})).data,getTenantAuditLogs:async(Ee=!1)=>(await cachedAxios.get("/tenant/audit/logs",{...Ee&&{cache:{enabled:!1}}})).data,getTenantAuditLogDetails:async Ee=>(await cachedAxios.get(`/tenant/audit/logs/${Ee}`)).data,getGroupAuditLogs:async(Ee=!1)=>(await cachedAxios.get("/group/audit/logs",{...Ee&&{cache:{enabled:!1}}})).data,getGroupAuditLogDetails:async Ee=>(await cachedAxios.get(`/group/audit/logs/${Ee}`)).data,getTenantModels:async(Ee=!1)=>(await cachedAxios.get("/tenant/models",{...Ee&&{cache:{enabled:!1}}})).data,createTenantModel:async Ee=>(await cachedAxios.post("/tenant/models",Ee)).data,updateTenantModel:async(Ee,Re)=>(await cachedAxios.put(`/tenant/models/${Ee}`,Re)).data,deleteTenantModel:async Ee=>(await cachedAxios.delete(`/tenant/models/${Ee}`)).data,getTenantModelUsage:async(Ee=!1)=>(await cachedAxios.get("/tenant/models/usage",{...Ee&&{cache:{enabled:!1}}})).data,getChatSettings:async()=>(await cachedAxios.get("/tenant/chat-settings",{cache:{enabled:!1}})).data,updateChatSettings:async Ee=>(await cachedAxios.put("/tenant/chat-settings",Ee)).data,getTenantPublicSettings:async()=>(await cachedAxios.get("/tenant/settings",{cache:{enabled:!1}})).data},platformAdminService={getTenants:async(Ee=!1)=>(await cachedAxios.get("/superadmin/tenants",{cache:!Ee})).data,createTenant:async Ee=>(await cachedAxios.post("/superadmin/tenants",Ee,{cache:!1})).data,getTenantById:async(Ee,Re=!1)=>(await cachedAxios.get(`/superadmin/tenants/${Ee}`,{cache:!Re})).data,updateTenant:async(Ee,Re)=>(await cachedAxios.put(`/superadmin/tenants/${Ee}`,Re,{cache:!1})).data,deleteTenant:async(Ee,Re)=>(await cachedAxios.delete(`/superadmin/tenants/${Ee}`,{data:{confirm:"DELETE"},cache:!1})).data,suspendTenant:async(Ee,Re,Te="")=>(await cachedAxios.post(`/superadmin/tenants/${Ee}/suspend`,{admin_id:Re,reason:Te},{cache:!1})).data,activateTenant:async(Ee,Re)=>(await cachedAxios.post(`/superadmin/tenants/${Ee}/activate`,{admin_id:Re},{cache:!1})).data,getSubscriptionsOverview:async(Ee=!1)=>(await cachedAxios.get("/superadmin/subscriptions/overview",{cache:!Ee})).data,getSubscriptionPlans:async(Ee=!1)=>(await cachedAxios.get("/superadmin/subscriptions/plans",{cache:!Ee})).data,assignSubscription:async(Ee,Re)=>(await cachedAxios.post(`/superadmin/tenants/${Ee}/subscription`,Re,{cache:!1})).data,getBillingHistory:async(Ee=!1)=>(await cachedAxios.get("/superadmin/subscriptions/billing-history",{cache:!Ee})).data,getTenantBillingHistory:async Ee=>(await cachedAxios.get(`/superadmin/tenants/${Ee}/billing-history`)).data,downloadBillingHistory:async(Ee={})=>{const Re=new URLSearchParams;Ee.tenant_id&&Re.append("tenant_id",Ee.tenant_id),Ee.status&&Re.append("status",Ee.status),Ee.format&&Re.append("format",Ee.format);const Te=Re.toString(),je=`/superadmin/subscriptions/billing-history/download${Te?`?${Te}`:""}`;return await cachedAxios.get(je,{responseType:"blob",cache:!1})},getStorageStats:async(Ee=!1)=>(await cachedAxios.get("/superadmin/pipeline/storage-stats",{cache:!Ee})).data,getDocumentsStats:async()=>(await cachedAxios.get("/superadmin/pipeline/documents")).data,getHealthOverview:async(Ee=!1)=>(await cachedAxios.get("/superadmin/health/overview",{cache:!Ee})).data,getHealthResources:async(Ee=!1)=>(await cachedAxios.get("/superadmin/health/resources",{cache:!Ee})).data,getHealthConnectivity:async(Ee=!1)=>(await cachedAxios.get("/superadmin/health/connectivity",{cache:!Ee})).data,getHealthPerformance:async(Ee="day",Re=!1)=>(await cachedAxios.get("/superadmin/health/performance",{params:{period:Ee}
460,cache:!Re})).data,getAuditLogs:async(Ee=!1)=>(await cachedAxios.get("/superadmin/audit/logs",{cache:!Ee})).data,getAuditLogById:async Ee=>(await cachedAxios.get(`/superadmin/audit/logs/${Ee}`)).data,getGeneralSettings:async(Ee=!1)=>(await cachedAxios.get("/superadmin/settings/general",{cache:!Ee})).data,updateGeneralSettings:async Ee=>(await cachedAxios.put("/superadmin/settings/general",Ee,{cache:!1})).data,getRateLimits:async()=>(await cachedAxios.get("/superadmin/settings/rate-limits")).data,updateRateLimits:async Ee=>(await cachedAxios.put("/superadmin/settings/rate-limits",Ee,{cache:!1})).data},listNotifications=async(Ee={})=>{var Me;const{unreadOnly:Re,limit:Te,skipCache:je}=Ee,Oe=await cachedAxios.get("/notifications",{params:{...Re?{unread_only:1}:{},...Te!=null?{limit:Te}:{}},cache:!je});return Array.isArray((Me=Oe.data)==null?void 0:Me.notifications)?Oe.data.notifications:[]},getUnreadCount=async()=>{var Re;const Ee=await cachedAxios.get("/notifications/unread-count");return typeof((Re=Ee.data)==null?void 0:Re.unread)=="number"?Ee.data.unread:0},markNotificationsRead=async Ee=>{const Re={};return Array.isArray(Ee==null?void 0:Ee.ids)&&Ee.ids.length>0?Re.ids=Ee.ids:Ee!=null&&Ee.all&&(Re.all=!0),(await cachedAxios.post("/notifications/mark-read",Re)).data},createNotification=async Ee=>(await cachedAxios.post("/notifications",Ee)).data,deleteNotification=async Ee=>(await cachedAxios.delete("/notifications/delete",{data:{notification_id:Ee}})).data,subscribeUnreadCount=Ee=>{if(typeof window>"u")return()=>{};let Re=null,Te=null,je=0,Oe=!1;const Me=3e4,De=1e3,$e=()=>{if(Oe)return;const Be=localStorage.getItem(STORAGE_KEYS.AUTH_TOKEN);if(!Be){console.warn("No auth token found, skipping SSE connection");return}const Ue=`${API_BASE_URL}/notifications/unread/stream?access_token=${encodeURIComponent(Be)}`;try{if(Re)try{Re.close()}catch{}Re=new EventSource(Ue),Re.onopen=()=>{je=0},Re.addEventListener("unread_count",ze=>{try{const We=typeof ze.data=="string"?JSON.parse(ze.data):ze.data;typeof(We==null?void 0:We.unread_count)=="number"&&typeof Ee=="function"&&Ee(We.unread_count)}catch(We){console.error("Invalid unread-count SSE data:",We)}}),Re.onerror=ze=>{if(console.error("â Notifications SSE error, will attempt reconnect...",ze),Re){try{Re.close()}catch{}Re=null}if(!Oe){je++;const We=Math.min(De*Math.pow(2,je-1),Me);Te=setTimeout(()=>{$e()},We)}}}catch(ze){if(console.error("Failed to open notifications SSE stream:",ze),!Oe){je++;const We=Math.min(De*Math.pow(2,je-1),Me);Te=setTimeout(()=>{$e()},We)}}};return $e(),()=>{if(Oe=!0,Te&&(clearTimeout(Te),Te=null),Re){try{Re.close()}catch{}Re=null}}},notificationService={listNotifications,getUnreadCount,markNotificationsRead,createNotification,deleteNotification,subscribeUnreadCount},SGA_ONE_PER_GROUP_ERROR="Only one Restricted Group Admin is allowed per group.",superGroupAdminService={getState:async()=>(await cachedAxios.get("/tenant/super-group-admin",{cache:!1})).data,validateAssign:async(Ee,Re=null)=>(await cachedAxios.post("/tenant/super-group-admin/validate",{group_ids:Ee,user_id:Re},{cache:!1})).data,assign:async(Ee,Re)=>(await cachedAxios.post("/tenant/super-group-admin/assign",{user_id:Ee,group_ids:Re})).data,unassign:async(Ee,Re=0)=>(await cachedAxios.post("/tenant/super-group-admin/unassign",{user_id:Ee,revert_role:Re})).data},login=createAsyncThunk("auth/login",async({email:Ee,password:Re},{rejectWithValue:Te})=>{try{const je=await authService.login(Ee,Re);return je.mfa_required?{mfa_required:!0,temp_token:je.temp_token}:je.tenant_selection_required?{tenant_selection_required:!0,select_token:je.select_token,tenants:je.tenants}:je.needs_email_verification?{needs_email_verification:!0,temp_token:je.temp_token}:(je.token&&localStorage.setItem(STORAGE_KEYS.AUTH_TOKEN,je.token),clearApiCache(),je)}catch(je){return Te(je.message||"Login failed")}}),register=createAsyncThunk("auth/register",async(Ee,{rejectWithValue:Re})=>{try{const Te=await authService.register(Ee),je=Te.token||Te.access_token||Te.access_token_jwt;return je?(localStorage.setItem(STORAGE_KEYS.AUTH_TOKEN,je),clearApiCache(),{...Te,token:je}):(console.warn("Registration response received but no token found. Response:",Te),Te)}catch(Te){return console.error("Registration error:",Te),Re(Te.message||"Registration failed")}}),googleLogin=createAsyncThunk("auth/googleLogin",async(Ee,{rejectWithValue:Re})=>{try{const Te=await authService.googleLogin(Ee);return Te.token&&localStorage.setItem(STORAGE_KEYS.AUTH_TOKEN,Te.token),clearApiCache(),Te}catch(Te){return Re(Te.message||"Google login failed")}}),microsoftLogin=createAsyncThunk("auth/microsoftLogin",async(Ee,{rejectWithValue:Re})=>{try{const Te=await authService.microsoftLogin(Ee);return Te.token&&localStorage.setItem(STORAGE_KEYS.AUTH_TOKEN,Te.token),clearApiCache(),Te}catch(Te){return Re(Te.message||"Microsoft login failed")}}),logout=createAsyncThunk("auth/logout",async(Ee,{rejectWithValue:Re})=>{try{await authService.logout(),clearApiCache(),localStorage.removeItem(STORAGE_KEYS.AUTH_TOKEN),localStorage.removeItem(STORAGE_KEYS.USER_DATA);try{const Oe=localStorage.getItem("persist:doculens_persist");if(Oe){const Me=JSON.parse(Oe),De={loginAttempts:Me.loginAttempts||"{}",_persist:Me._persist||{version:-1,rehydrated:!0}};localStorage.setItem("persist:doculens_persist",JSON.stringify(De))}}catch(Oe){console.error("Error clearing persisted state:",Oe),localStorage.removeItem("persist:doculens_persist")}const Te=sessionStorage.getItem("logout_message");sessionStorage.removeItem("active_user_id"),sessionStorage.clear(),Te&&sessionStorage.setItem("logout_message",Te);const je=[];for(let Oe=0;Oe<localStorage.length;Oe++){const Me=localStorage.key(Oe);Me&&(Me.startsWith("persist:")||Me.startsWith("doculens_"))&&Me!=="persist:doculens_persist"&&je.push(Me)}return je.forEach(Oe=>localStorage.removeItem(Oe)),null}catch{clearApiCache(),localStorage.removeItem(STORAGE_KEYS.AUTH_TOKEN),localStorage.removeItem(STORAGE_KEYS.USER_DATA);try{const Me=localStorage.getItem("persist:doculens_persist");if(Me){const De=JSON.parse(Me),$e={loginAttempts:De.loginAttempts||"{}",_persist:De._persist||{version:-1,rehydrated:!0}};localStorage.setItem("persist:doculens_persist",JSON.stringify($e))}}catch(Me){console.error("Error clearing persisted state:",Me),localStorage.removeItem("persist:doculens_persist")}const je=sessionStorage.getItem("logout_message");sessionStorage.removeItem("active_user_id"),sessionStorage.clear(),je&&sessionStorage.setItem("logout_message",je);const Oe=[];for(let Me=0;Me<localStorage.length;Me++){const De=localStorage.key(Me);De&&(De.startsWith("persist:")||De.startsWith("doculens_"))&&De!=="persist:doculens_persist"&&Oe.push(De)}return Oe.forEach(Me=>localStorage.removeItem(Me)),null}}),forgotPassword=createAsyncThunk("auth/forgotPassword",async(Ee,{rejectWithValue:Re})=>{try{return await authService.forgotPassword(Ee)}catch(Te){return Re(Te.message||"Failed to send reset email")}});createAsyncThunk("auth/resetPassword",async(Ee,{rejectWithValue:Re})=>{try{return await authService.resetPassword(Ee)}catch(Te){return Re(Te.message||"Failed to reset password")}});const switchTenant=createAsyncThunk("auth/switchTenant",async(Ee,{rejectWithValue:Re})=>{try{const Te=await authService.switchTenant(Ee);return Te.token&&localStorage.setItem(STORAGE_KEYS.AUTH_TOKEN,Te.token),clearApiCache(),Te}catch(Te){return Re(Te.message||"Failed to switch tenant")}}),fetchMyTenants=createAsyncThunk("auth/fetchMyTenants",async(Ee,{rejectWithValue:Re})=>{try{return await authService.listMyTenants()}catch(Te){return Re(Te.message||"Failed to fetch tenants")}}),getCurrentUser=createAsyncThunk("auth/getCurrentUser",async(Ee=!1,{rejectWithValue:Re})=>{try{return await authService.getCurrentUser(Ee)}catch(Te){return Re(Te.message||"Failed to fetch user data")}}),fetchProfile=createAsyncThunk("auth/fetchProfile",async(Ee=!1,{rejectWithValue:Re})=>{try{return await authService.fetchProfile(Ee)}catch(Te){return Re(Te.message||"Failed to fetch profile data")}}),updateUserProfile$1=createAsyncThunk("auth/updateUserProfile",async(Ee,{rejectWithValue:Re})=>{try{return await authService.updateUserProfile(Ee)}catch(Te){return Re(Te.message||"Failed to update profile")}}),updateProfileDetails=createAsyncThunk("auth/updateProfileDetails",async(Ee,{rejectWithValue:Re})=>{try{return await authService.updateProfileDetails(Ee)}catch(Te){return Re(Te.message||"Failed to update profile details")}}),updateEmailNotificationsPreference=createAsyncThunk("auth/updateEmailNotificationsPreference",async(Ee,{rejectWithValue:Re})=>{try{return await authService.updateEmailNotificationsPreference(Ee)}catch(Te){return Re(Te.message||"Failed to update email notification preference")}}),getUserPhoto=createAsyncThunk("auth/getUserPhoto",async(Ee=!1,{rejectWithValue:Re})=>{try{return await authService.getUserPhoto(Ee)}catch(Te){return Re(Te.message||"Failed to fetch user data")}}),registerCompany=createAsyncThunk("auth/registerCompany",async(Ee,{rejectWithValue:Re})=>{try{return await authService.registerCompany(Ee)}catch(Te){return Re(Te.message||"Company registration failed")}}),initialState$e={user:null,token:localStorage.getItem(STORAGE_KEYS.AUTH_TOKEN)||null,isAuthenticated:!!localStorage.getItem(STORAGE_KEYS.AUTH_TOKEN),loading:!1,error:null,forgotPasswordSuccess:!1,registrationPending:!1,registrationMessage:null,companyRegistration:null,userFetched:!1,photoError:!1,loginLoading:!1,mfaRequired:!1,mfaTempToken:null,tenants:[],tenantsLoading:!1,tenantsFetched:!1,tenantsError:null},authSlice=createSlice({name:"auth",initialState:initialState$e,reducers:{clearError:Ee=>{Ee.error=null},clearForgotPasswordSuccess:Ee=>{Ee.forgotPasswordSuccess=!1},clearRegistrationPending:Ee=>{Ee.registrationPending=!1,Ee.registrationMessage=null,Ee.user=null},setCredentials:(Ee,Re)=>{Ee.user=Re.payload.user,Ee.token=Re.payload.token,Ee.isAuthenticated=!0},updateTourStatus:(Ee,Re)=>{Ee.user&&(Ee.user.tour_status=Re.payload)}},extraReducers:Ee=>{Ee.addCase(login.pending,Re=>{Re.loginLoading=!0,Re.error=null}).addCase(login.fulfilled,(Re,Te)=>{if(Re.loginLoading=!1,Re.error=null,Te.payload&&Te.payload.mfa_required){Re.isAuthenticated=!1,Re.user=null,Re.token=null,Re.mfaRequired=!0,Re.mfaTempToken=Te.payload.temp_token;return}if(Te.payload&&Te.payload.tenant_selection_required){Re.isAuthenticated=!1,Re.user=null,Re.token=null;return}if(Te.payload&&Te.payload.needs_email_verification){Re.isAuthenticated=!1,Re.user=null,Re.token=null;return}Re.isAuthenticated=!0,Re.user=Te.payload.user,Re.token=Te.payload.token,Re.mfaRequired=!1,Re.mfaTempToken=null,Re.photoError=!1}
460).addCase(login.rejected,(Re,Te)=>{Re.loginLoading=!1,Re.isAuthenticated=!1,Re.user=null,Re.token=null,Re.error=Te.payload}).addCase(register.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(register.fulfilled,(Re,Te)=>{Re.loading=!1;const je=!!Te.payload.token;Re.isAuthenticated=je,Re.user=Te.payload.user||Te.payload,Re.token=Te.payload.token||null,Re.error=null,!je&&Te.payload.message?(Re.registrationPending=!0,Re.registrationMessage=Te.payload.message):(Re.registrationPending=!1,Re.registrationMessage=null)}).addCase(register.rejected,(Re,Te)=>{Re.loading=!1,Re.isAuthenticated=!1,Re.user=null,Re.token=null,Re.error=Te.payload}).addCase(googleLogin.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(googleLogin.fulfilled,(Re,Te)=>{Re.loading=!1,Re.isAuthenticated=!0,Re.user=Te.payload.user,Re.token=Te.payload.token,Re.error=null}).addCase(googleLogin.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(microsoftLogin.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(microsoftLogin.fulfilled,(Re,Te)=>{Re.loading=!1,Re.isAuthenticated=!0,Re.user=Te.payload.user,Re.token=Te.payload.token,Re.error=null}
460).addCase(microsoftLogin.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(switchTenant.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(switchTenant.fulfilled,(Re,Te)=>{var je;Re.loading=!1,Re.error=null,(je=Te.payload)!=null&&je.token&&(Re.isAuthenticated=!0,Re.user=Te.payload.user,Re.token=Te.payload.token,Re.userFetched=!1,Re.photoError=!1,Re.tenantsFetched=!1)}).addCase(switchTenant.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchMyTenants.pending,Re=>{Re.tenantsLoading=!0,Re.tenantsError=null}).addCase(fetchMyTenants.fulfilled,(Re,Te)=>{var je;Re.tenantsLoading=!1,Re.tenantsFetched=!0,Re.tenants=((je=Te.payload)==null?void 0:je.tenants)||[]}).addCase(fetchMyTenants.rejected,(Re,Te)=>{Re.tenantsLoading=!1,Re.tenantsFetched=!0,Re.tenantsError=Te.payload}).addCase(logout.fulfilled,Re=>({...initialState$e,token:null,isAuthenticated:!1,user:null})).addCase(forgotPassword.pending,Re=>{Re.loading=!0,Re.error=null,Re.forgotPasswordSuccess=!1}).addCase(forgotPassword.fulfilled,Re=>{Re.loading=!1,Re.forgotPasswordSuccess=!0,Re.error=null}
460).addCase(forgotPassword.rejected,(Re,Te)=>{Re.loading=!1,Re.forgotPasswordSuccess=!1,Re.error=Te.payload}).addCase(getCurrentUser.pending,Re=>{Re.loading=!0}).addCase(getCurrentUser.fulfilled,(Re,Te)=>{var je,Oe,Me,De,$e,Be,Ue,ze;Re.loading=!1,Re.user={...(je=Te.payload)==null?void 0:je.user,groups:((Oe=Te.payload)==null?void 0:Oe.groups)??((De=(Me=Te.payload)==null?void 0:Me.user)==null?void 0:De.groups)??(($e=Re.user)==null?void 0:$e.groups),is_payment:(Be=Te.payload)==null?void 0:Be.is_payment,trial_expired:(Ue=Te.payload)==null?void 0:Ue.trial_expired,tour_status:(ze=Te.payload)==null?void 0:ze.tour_status},Re.isAuthenticated=!0,Re.userFetched=!0}).addCase(getCurrentUser.rejected,Re=>{Re.loading=!1,Re.userFetched=!0}).addCase(fetchProfile.pending,Re=>{Re.error=null}).addCase(fetchProfile.fulfilled,(Re,Te)=>{if(Re.loading=!1,Te.payload){const je=Te.payload.user??Te.payload;Re.user={...Re.user,...je}}}).addCase(fetchProfile.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(registerCompany.pending,Re=>{Re.loading=!0,Re.error=null,Re.companyRegistration=null}).addCase(registerCompany.fulfilled,(Re,Te)=>{Re.loading=!1,Re.companyRegistration=Te.payload,Re.error=null}
460).addCase(registerCompany.rejected,(Re,Te)=>{Re.loading=!1,Re.companyRegistration=null,Re.error=Te.payload}).addCase(updateUserProfile$1.pending,Re=>{Re.error=null}).addCase(updateUserProfile$1.fulfilled,(Re,Te)=>{if(Te.payload){const je=Te.payload.user??Te.payload;Re.user={...Re.user,...je}}Re.error=null}).addCase(updateUserProfile$1.rejected,(Re,Te)=>{Re.error=Te.payload}).addCase(updateProfileDetails.pending,Re=>{Re.error=null}).addCase(updateProfileDetails.fulfilled,(Re,Te)=>{if(Te.payload){const je=Te.payload.user??Te.payload;Re.user={...Re.user,...je}}Re.error=null}).addCase(updateProfileDetails.rejected,(Re,Te)=>{Re.error=Te.payload}).addCase(updateEmailNotificationsPreference.pending,Re=>{Re.error=null}).addCase(updateEmailNotificationsPreference.fulfilled,(Re,Te)=>{Te.payload&&Te.payload.user&&(Re.user={...Re.user,...Te.payload.user}),Re.error=null}).addCase(updateEmailNotificationsPreference.rejected,(Re,Te)=>{Re.error=Te.payload}).addCase(getUserPhoto.pending,Re=>{Re.error=null}).addCase(getUserPhoto.fulfilled,(Re,Te)=>{Te.payload&&Re.user?(Re.user={...Re.user,photo_url:Te.payload},Re.photoError=!1):Re.photoError=!0}).addCase(getUserPhoto.rejected,Re=>{Re.photoError=!0})}}),{clearError:clearError$b,clearForgotPasswordSuccess,clearRegistrationPending,setCredentials,updateTourStatus}=authSlice.actions,authReducer=authSlice.reducer,fetchTCStatus=createAsyncThunk("user/fetchTCStatus",async(Ee,{rejectWithValue:Re})=>{try{return await userService.getTCStatus()}catch(Te){return Re(Te.message||"Failed to fetch T&C status")}}),acceptTermsAndConditions=createAsyncThunk("user/acceptTC",async(Ee,{rejectWithValue:Re})=>{try{return{...await userService.acceptTC(Ee),version:Ee}}catch(Te){return Re(Te.message||"Failed to accept T&C")}}),fetchLatestTC=createAsyncThunk("user/fetchLatestTC",async(Ee,{rejectWithValue:Re})=>{try{return await userService.getLatestTC()}catch(Te){return Re(Te.message||"Failed to fetch T&C")}}),updateUserProfile=createAsyncThunk("user/updateProfile",async(Ee,{rejectWithValue:Re})=>{try{return await userService.updateProfile(Ee)}catch(Te){return Re(Te.message||"Failed to update profile")}}),changePassword$1=createAsyncThunk("user/changePassword",async({currentPassword:Ee,newPassword:Re},{rejectWithValue:Te})=>{try{return await userService.changePassword(Ee,Re)}catch(je){return Te(je.message||"Failed to change password")}}),initialState$d={tcAccepted:!1,tcVersion:null,tcContent:null,latestTCVersion:null,tcLoaded:!1,loading:!1,error:null,updateSuccess:!1},userSlice=createSlice({name:"user",initialState:initialState$d,reducers:{clearError:Ee=>{Ee.error=null},clearUpdateSuccess:Ee=>{Ee.updateSuccess=!1}},extraReducers:Ee=>{Ee.addCase(fetchTCStatus.pending,Re=>{Re.loading=!0,Re.error=null,Re.tcLoaded=!1}).addCase(fetchTCStatus.fulfilled,(Re,Te)=>{Re.loading=!1;const je=Te.payload.tcAccepted??Te.payload.accepted??Te.payload.tc_accepted??!1,Oe=Te.payload.tcVersion??Te.payload.version??Te.payload.tc_version??null;Re.tcAccepted=!!je,Re.tcVersion=Oe,Re.tcLoaded=!0}).addCase(fetchTCStatus.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload,Re.tcLoaded=!0}).addCase(acceptTermsAndConditions.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(acceptTermsAndConditions.fulfilled,(Re,Te)=>{Re.loading=!1,Re.tcAccepted=!0,Re.tcVersion=Te.payload.version,Re.tcLoaded=!0}
460).addCase(acceptTermsAndConditions.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchLatestTC.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchLatestTC.fulfilled,(Re,Te)=>{Re.loading=!1,Re.tcContent=Te.payload.content,Re.latestTCVersion=Te.payload.version}).addCase(fetchLatestTC.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(updateUserProfile.pending,Re=>{Re.loading=!0,Re.error=null,Re.updateSuccess=!1}).addCase(updateUserProfile.fulfilled,Re=>{Re.loading=!1,Re.updateSuccess=!0}).addCase(updateUserProfile.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload,Re.updateSuccess=!1}).addCase(changePassword$1.pending,Re=>{Re.loading=!0,Re.error=null,Re.updateSuccess=!1}).addCase(changePassword$1.fulfilled,Re=>{Re.loading=!1,Re.updateSuccess=!0}).addCase(changePassword$1.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload,Re.updateSuccess=!1})}}),{clearError:clearError$a,clearUpdateSuccess}=userSlice.actions,userReducer=userSlice.reducer,fetchDocuments=createAsyncThunk("documents/fetchDocuments",async(Ee=!1,{rejectWithValue:Re})=>{var Te;try{const je=await documentService.getDocuments(Ee),Oe=Array.isArray(je)?je:(je==null?void 0:je.files)||(je==null?void 0:je.documents)||(je==null?void 0:je.data)||[],Me=(Te=je==null?void 0:je.storage_used)==null?void 0:Te.kb,De=Me?Me*1024:null;return{documents:Array.isArray(Oe)?Oe:[],storageUsed:De}}catch(je){return Re(je.message||"Failed to fetch documents")}}),uploadDocument=createAsyncThunk("documents/uploadDocument",async({file:Ee,group_id:Re,onProgress:Te},{rejectWithValue:je})=>{var Oe,Me,De,$e,Be,Ue,ze,We;try{const Xe=await documentService.uploadDocument(Ee,Re,Te);return Array.isArray(Xe==null?void 0:Xe.files)?Xe.files[0]:Xe}catch(Xe){if(Xe.status===409||(Oe=Xe.message)!=null&&Oe.includes("409")||(Me=Xe.message)!=null&&Me.toLowerCase().includes("duplicate")){let He=null;return($e=(De=Xe.data)==null?void 0:De.existing_file)!=null&&$e.id?He=Xe.data.existing_file.id:(Be=Xe.data)!=null&&Be.existing_file_id?He=Xe.data.existing_file_id:(Ue=Xe.data)!=null&&Ue.file_id?He=Xe.data.file_id:(ze=Xe.data)!=null&&ze.id&&(He=Xe.data.id),je({status:Xe.status||409,message:Xe.message||"File already exists",data:Xe.data,existing_file:(We=Xe.data)==null?void 0:We.existing_file,existingFileId:He})}return je(Xe.message||"Failed to upload document")}}),trainDocuments=createAsyncThunk("documents/trainDocuments",async(Ee,{rejectWithValue:Re,dispatch:Te})=>{try{const je=await documentService.trainDocument(Ee);return await Te(fetchDocuments(!0)),je}catch(je){return Re(je.message||"Failed to train documents")}}),deleteDocument=createAsyncThunk("documents/deleteDocument",async(Ee,{rejectWithValue:Re})=>{var je,Oe;const Te=Array.isArray(Ee)?Ee:[Ee];try{const Me=await documentService.deleteDocument(Ee),De=Array.isArray(Me==null?void 0:Me.delete_results)?Me.delete_results:[];return{requestedIds:Te,deleteResults:De}}catch(Me){return Re(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.error)||Me.message||"Failed to delete document")}}),fetchPendingDocuments=createAsyncThunk("documents/fetchPendingDocuments",async(Ee=!1,{rejectWithValue:Re})=>{try{return await documentService.getPendingDocuments(Ee)}catch(Te){return Re(Te.message||"Failed to fetch pending documents")}}),approveDocument=createAsyncThunk("documents/approveDocument",async(Ee,{rejectWithValue:Re})=>{try{const Te=await documentService.approveDocument(Ee);return{fileId:Ee,...Te}}catch(Te){return Re(Te.message||"Failed to approve document")}}),rejectDocument=createAsyncThunk("documents/rejectDocument",async({fileId:Ee,reason:Re},{rejectWithValue:Te})=>{try{const je=await documentService.rejectDocument(Ee,Re);return{fileId:Ee,...je}}catch(je){return Te(je.message||"Failed to reject document")}}),initialState$c={documents:[],pendingDocuments:[],selectedDocuments:[],loading:!1,uploading:!1,uploadProgress:0,error:null,filters:{search:"",status:[],groupId:[]},sortModel:[],documentsFetched:!1,storageUsed:null},documentsSlice=createSlice({name:"documents",initialState:initialState$c,reducers:{clearError:Ee=>{Ee.error=null},setFilters:(Ee,Re)=>{Ee.filters={...Ee.filters,...Re.payload}},clearFilters:Ee=>{Ee.filters={search:"",status:[],groupId:[]}},setSortModel:(Ee,Re)=>{Ee.sortModel=Re.payload},setSelectedDocuments:(Ee,Re)=>{Ee.selectedDocuments=Re.payload},clearUploadProgress:Ee=>{Ee.uploadProgress=0,Ee.uploading=!1},uploadProgress:(Ee,Re)=>{const Te=Re.payload;typeof Te=="number"&&Te>=0&&Te<=100&&(Ee.uploadProgress=Te)},updateDocumentStatus:(Ee,Re)=>{const{docId:Te,status:je,processingStatus:Oe,message:Me,updatedAt:De}=Re.payload,$e=String(Te),Be=ze=>{const We=ze.FileID??ze.id??ze.Id;return We!==void 0&&String(We)===$e};if(je==="DELETED"){Ee.documents=Ee.documents.filter(ze=>!Be(ze)),Ee.pendingDocuments&&Array.isArray(Ee.pendingDocuments)&&(Ee.pendingDocuments=Ee.pendingDocuments.filter(ze=>!Be(ze)));return}const Ue=Ee.documents.findIndex(Be);if(Ue!==-1&&(Ee.documents[Ue].Status=je,Ee.documents[Ue].status=je,Oe!==void 0&&(Ee.documents[Ue].processing_status=Oe,Ee.documents[Ue].processingStatus=Oe),Me!==void 0&&(Ee.documents[Ue].message=Me),De!==void 0&&(Ee.documents[Ue].updated_at=De,Ee.documents[Ue].updatedAt=De)),Ee.pendingDocuments&&Array.isArray(Ee.pendingDocuments)){const ze=Ee.pendingDocuments.findIndex(Be);ze!==-1&&(Ee.pendingDocuments[ze].Status=je,Ee.pendingDocuments[ze].status=je,Oe!==void 0&&(Ee.pendingDocuments[ze].processing_status=Oe,Ee.pendingDocuments[ze].processingStatus=Oe),Me!==void 0&&(Ee.pendingDocuments[ze].message=Me),De!==void 0&&(Ee.pendingDocuments[ze].updated_at=De,Ee.pendingDocuments[ze].updatedAt=De))}}},extraReducers:Ee=>{Ee.addCase(fetchDocuments.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchDocuments.fulfilled,(Re,Te)=>{var Me,De;Re.loading=!1;let je;Array.isArray(Te.payload)?je=Te.payload:(je=((Me=Te.payload)==null?void 0:Me.documents)||[],Re.storageUsed=((De=Te.payload)==null?void 0:De.storageUsed)||null);const Oe=new Map;
460Re.documents.forEach($e=>{const Be=String($e.FileID??$e.id??$e.Id??"");Be&&Oe.set(Be,$e)}),Re.documents=je.map($e=>{const Be=String($e.FileID??$e.id??$e.Id??""),Ue=Be?Oe.get(Be):null;if(Ue){const ze=($e.status||$e.Status||"").toLowerCase(),We=(Ue.status||Ue.Status||"").toLowerCase();if(ze==="processing"&&We==="processing"){const Xe=Ue.processing_status??Ue.processingStatus,He=$e.processing_status??$e.processingStatus,qe=He==null||He==="None"||He===0||He==="0";if(Xe!=null&&Xe!=="None"&&Xe!==0&&Xe!=="0"&&qe)return{...$e,processing_status:Xe,processingStatus:Xe}}}return $e}),Re.error=null,Re.documentsFetched=!0}).addCase(fetchDocuments.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload,Re.documentsFetched=!0}).addCase(uploadDocument.pending,Re=>{Re.uploading=!0,Re.uploadProgress=0,Re.error=null}).addCase(uploadDocument.fulfilled,(Re,Te)=>{Re.uploading=!1,Re.uploadProgress=100,Re.documents.unshift(Te.payload),Re.error=null}).addCase(uploadDocument.rejected,(Re,Te)=>{var je;Re.uploading=!1,Re.uploadProgress=0,Re.error=typeof Te.payload=="string"?Te.payload:((je=Te.payload)==null?void 0:je.message)||"Failed to upload document"}).addCase(trainDocuments.pending,Re=>{Re.loading=!0}).addCase(trainDocuments.fulfilled,Re=>{Re.loading=!1}).addCase(trainDocuments.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(deleteDocument.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(deleteDocument.fulfilled,(Re,Te)=>{Re.loading=!1;const{requestedIds:je=[],deleteResults:Oe=[]}=Te.payload||{},Me=new Map(Oe.map($e=>[Number($e.id),$e])),De=je.map(Number).filter($e=>{var Be;return(Be=Me.get($e))==null?void 0:Be.db_deleted});Re.documents=Re.documents.filter($e=>!De.includes(Number($e.FileID))&&!De.includes(Number($e.id))),Re.error=null}).addCase(deleteDocument.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchPendingDocuments.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchPendingDocuments.fulfilled,(Re,Te)=>{Re.loading=!1,Re.pendingDocuments=Te.payload,Re.error=null}).addCase(fetchPendingDocuments.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(approveDocument.fulfilled,(Re,Te)=>{Array.isArray(Re.pendingDocuments)&&(Re.pendingDocuments=Re.pendingDocuments.filter(Oe=>Oe.FileID!==Te.payload.fileId));const je=Re.documents.findIndex(Oe=>Oe.FileID===Te.payload.fileId);je!==-1&&(Re.documents[je].Status="approved")}).addCase(approveDocument.rejected,(Re,Te)=>{Re.error=Te.payload}).addCase(rejectDocument.fulfilled,(Re,Te)=>{Array.isArray(Re.pendingDocuments)&&(Re.pendingDocuments=Re.pendingDocuments.filter(Oe=>Oe.FileID!==Te.payload.fileId));const je=Re.documents.findIndex(Oe=>Oe.FileID===Te.payload.fileId);je!==-1&&(Re.documents[je].Status="rejected")}).addCase(rejectDocument.rejected,(Re,Te)=>{Re.error=Te.payload})}}),{clearError:clearError$9,setFilters,setSortModel,clearFilters:clearFilters$2,setSelectedDocuments,clearUploadProgress,updateDocumentStatus}=documentsSlice.actions,selectFilteredDocuments=Ee=>{var De,$e,Be;const{documents:Re,filters:Te}=Ee.documents,je=(De=Ee.auth)==null?void 0:De.user,Oe=(($e=Ee.groups)==null?void 0:$e.groups)||[];let Me=[...Re];if(je){const ze=(je.role??je.RoleID??((Be=je.department)==null?void 0:Be.id))===2,We=!!(je!=null&&je.is_l1_admin);if(!ze&&!We){let Xe=je.groups||je.Groups||[];Xe.length===0&&Oe.length>0&&(Xe=Oe);const He=Xe.map(qe=>{const Ge=qe.group_id||qe.GroupID||qe.id;return Ge?Number(Ge):null}).filter(qe=>qe!==null);He.length>0?Me=Me.filter(qe=>{const Ge=qe.GroupID||qe.groupId||qe.group_id,Ye=Ge?Number(Ge):null;return Ye&&He.includes(Ye)}):Me=[]}}if(Te.search){const Ue=Te.search.toLowerCase();Me=Me.filter(ze=>{var We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze;return((We=ze.FileName)==null?void 0:We.toLowerCase().includes(Ue))||((Xe=ze.OriginalFilename)==null?void 0:Xe.toLowerCase().includes(Ue))||((He=ze.displayFilename)==null?void 0:He.toLowerCase().includes(Ue))||((qe=ze.filename)==null?void 0:qe.toLowerCase().includes(Ue))||((Ge=ze.Filename)==null?void 0:Ge.toLowerCase().includes(Ue))||((Ye=ze.fileName)==null?void 0:Ye.toLowerCase().includes(Ue))||((Ve=ze.GroupName)==null?void 0:Ve.toLowerCase().includes(Ue))||((Ke=ze.groupName)==null?void 0:Ke.toLowerCase().includes(Ue))||((Qe=ze.Group)==null?void 0:Qe.toLowerCase().includes(Ue))||((Ze=ze.group)==null?void 0:Ze.toLowerCase().includes(Ue))})}return Te.status&&Te.status.length>0&&(Me=Me.filter(Ue=>{const ze=(Ue.status||Ue.Status||"").toLowerCase();return Te.status.some(We=>We.toLowerCase()===ze)})),Te.groupId&&Te.groupId.length>0&&(Me=Me.filter(Ue=>{const ze=Ue.GroupID||Ue.groupId||Ue.group_id;return Te.groupId.some(We=>ze===parseInt(We))})),Me.sort((Ue,ze)=>{const We=new Date(Ue.uploaded_at||Ue.UploadedAt||Ue.uploadedAt||Ue.created_at||Ue.CreatedAt||0);return new Date(ze.uploaded_at||ze.UploadedAt||ze.uploadedAt||ze.created_at||ze.CreatedAt||0)-We}),Me},documentsReducer=documentsSlice.reducer,getGroupId$1=Ee=>(Ee==null?void 0:Ee.id)??(Ee==null?void 0:Ee.group_id)??(Ee==null?void 0:Ee.GroupID),fetchGroups=createAsyncThunk("groups/fetchGroups",async(Ee=!1,{rejectWithValue:Re})=>{try{const Te=await groupService.getGroups(Ee);return Array.isArray(Te)?Te:[]}catch(Te){return console.error("Failed to fetch groups:",Te),Re(Te.message||"Failed to fetch groups")}}),fetchGroupMembers=createAsyncThunk("groups/fetchGroupMembers",async(Ee,{rejectWithValue:Re})=>{try{const Te=await groupService.getGroupMembers(Ee);return{groupId:Ee,members:(Te==null?void 0:Te.members)||[],effectiveGroupIds:(Te==null?void 0:Te.effectiveGroupIds)||[]}}catch(Te){return Re(Te.message||"Failed to fetch group members")}}),createGroup=createAsyncThunk("groups/createGroup",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{const Oe=await groupService.createGroup(Ee);return Oe.group||Oe}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to create group")}}),updateGroup=createAsyncThunk("groups/updateGroup",async({groupId:Ee,updates:Re},{rejectWithValue:Te})=>{var je,Oe;try{const Me=await groupService.updateGroup(Ee,Re);return Me.group||Me}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to update group")}}),deleteGroup=createAsyncThunk("groups/deleteGroup",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await groupService.deleteGroup(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to delete group")}}),addGroupMembers=createAsyncThunk("groups/addGroupMembers",async({groupId:Ee,userIds:Re,isAdmin:Te=!1},{rejectWithValue:je})=>{var Oe,Me;try{await groupService.addMembers(Ee,Re,Te);const De=await groupService.getGroupMembers(Ee),$e=Array.isArray(De)?De:(De==null?void 0:De.members)||(De==null?void 0:De.data)||[];return{groupId:Ee,members:$e}}catch(De){return je(((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.message)||"Failed to add members")}}),removeGroupMember=createAsyncThunk("groups/removeGroupMember",async({groupId:Ee,userId:Re},{rejectWithValue:Te})=>{var je,Oe;try{const Me=await groupService.removeMember(Ee,Re);return{groupId:Ee,userId:Re,...Me||{}}}catch(Me){return Te(Me.message||((je=Me.data)==null?void 0:je.error)||((Oe=Me.data)==null?void 0:Oe.message)||"Failed to remove member")}}),updateMemberRole=createAsyncThunk("groups/updateMemberRole",async({groupId:Ee,userId:Re,role:Te},{rejectWithValue:je})=>{var Oe,Me;try{return await groupService.updateMemberRole(Ee,Re,Te),{groupId:Ee,userId:Re,role:Te}}catch(De){return je(((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.message)||"Failed to update member role")}}),initialState$b={groups:[],groupMembers:{},selectedGroup:null,loading:!1,actionLoading:!1,error:null,searchQuery:""},groupsSlice=createSlice({name:"groups",initialState:initialState$b,reducers:{clearError:Ee=>{Ee.error=null},setSelectedGroup:(Ee,Re)=>{Ee.selectedGroup=Re.payload},clearSelectedGroup:Ee=>{Ee.selectedGroup=null},setSearchQuery:(Ee,Re)=>{Ee.searchQuery=Re.payload},clearSearchQuery:Ee=>{Ee.searchQuery=""},resetGroupsState:()=>initialState$b},extraReducers:Ee=>{Ee.addCase(fetchGroups.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchGroups.fulfilled,(Re,Te)=>{Re.loading=!1,Re.groups=Array.isArray(Te.payload)?Te.payload:[],Re.error=null}
460).addCase(fetchGroups.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchGroupMembers.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchGroupMembers.fulfilled,(Re,Te)=>{Re.loading=!1;const Oe=(Te.payload.members||[]).map(Me=>({...Me,role:Me.is_admin||Me.isAdmin?"admin":"member"}));Re.groupMembers[Te.payload.groupId]=Oe,Re.error=null}).addCase(fetchGroupMembers.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(createGroup.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(createGroup.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.groups.push(Te.payload)}).addCase(createGroup.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(updateGroup.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(updateGroup.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=getGroupId$1(Te.payload),Oe=Re.groups.findIndex(Me=>getGroupId$1(Me)===je);Oe!==-1&&(Re.groups[Oe]=Te.payload),getGroupId$1(Re.selectedGroup)===je&&(Re.selectedGroup=Te.payload)}).addCase(updateGroup.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(deleteGroup.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(deleteGroup.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.groups=Re.groups.filter(je=>getGroupId$1(je)!==Te.payload),getGroupId$1(Re.selectedGroup)===Te.payload&&(Re.selectedGroup=null),delete Re.groupMembers[Te.payload]}
460).addCase(deleteGroup.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(addGroupMembers.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(addGroupMembers.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Te.payload.members||[];Re.groupMembers[Te.payload.groupId]=je.map(Oe=>({...Oe,role:Oe.is_admin||Oe.isAdmin?"admin":"member"}))}).addCase(addGroupMembers.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(removeGroupMember.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(removeGroupMember.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.groupMembers[Te.payload.groupId];je&&(Re.groupMembers[Te.payload.groupId]=je.filter(Oe=>Oe.user_id!==Te.payload.userId&&Oe.UserID!==Te.payload.userId))}).addCase(removeGroupMember.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(updateMemberRole.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(updateMemberRole.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.groupMembers[Te.payload.groupId];if(je){const Oe=je.find(Me=>Me.user_id===Te.payload.userId||Me.UserID===Te.payload.userId);Oe&&(Oe.role=Te.payload.role,Oe.is_admin=Te.payload.role==="admin",Oe.isAdmin=Te.payload.role==="admin")}}).addCase(updateMemberRole.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload})}}),{clearError:clearError$8,setSelectedGroup,clearSelectedGroup,setSearchQuery:setSearchQuery$3,resetGroupsState,clearSearchQuery:clearSearchQuery$1}=groupsSlice.actions,selectAllGroups=Ee=>Ee.groups.groups,selectGroupsLoading=Ee=>Ee.groups.loading,selectGroupsActionLoading=Ee=>Ee.groups.actionLoading,selectGroupsError=Ee=>Ee.groups.error,selectSelectedGroup=Ee=>Ee.groups.selectedGroup,selectGroupMembers=Ee=>Re=>Re.groups.groupMembers[Ee]||[],selectSearchQuery$2=Ee=>Ee.groups.searchQuery,selectFilteredGroups=Ee=>{const{groups:Re,searchQuery:Te}=Ee.groups;if(!Te.trim())return Re;const je=Te.toLowerCase();return Re.filter(Oe=>{var Me,De,$e;return((Me=Oe.name)==null?void 0:Me.toLowerCase().includes(je))||((De=Oe.GroupName)==null?void 0:De.toLowerCase().includes(je))||(($e=Oe.description)==null?void 0:$e.toLowerCase().includes(je))})},groupsReducer=groupsSlice.reducer,{extractSessionDocumentIds,extractSessionGroupIds,extractSessionWebsiteIds,extractSessionDbConnectionId,filterExistingDocumentIds}=chatService$1,getStreamingErrorLabel=Ee=>{const Re=String(Ee).toLowerCase();return/(anthropic|gemini|openai|configured model|api key|api base|rate limit|quota)/.test(Re)?"Model request failed":"Response interrupted"},fetchSessions=createAsyncThunk("chat/fetchSessions",async(Ee=!1,{rejectWithValue:Re})=>{var Te,je;try{return(await getSessions(Ee)).sessions||[]}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch sessions")}}),createSession=createAsyncThunk("chat/createSession",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await createSession$1(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to create session")}}),fetchHistory=createAsyncThunk("chat/fetchHistory",async({sessionId:Ee,forceRefresh:Re=!1,limit:Te=30},{rejectWithValue:je})=>{var Oe,Me;try{const De=await getHistory(Ee,Re,Te,0),$e=(De.messages||[]).map(We=>{var He;const Xe={id:We.id||We.ID||We.message_id,role:We.role||We.Role||(We.is_user?"user":"assistant"),content:We.content||We.Content||We.message||We.Message||We.reply||We.Reply||"",timestamp:We.timestamp||We.Timestamp||We.created_at||We.CreatedAt||new Date().toISOString(),feedback:We.feedback||null,meta:We.meta||null};return We.sources&&Array.isArray(We.sources)&&We.sources.length>0?Xe.sources=We.sources:(He=We.meta)!=null&&He.sources&&Array.isArray(We.meta.sources)&&We.meta.sources.length>0&&(Xe.sources=We.meta.sources),Xe}),Be=extractSessionDocumentIds(De),{ids:Ue,namesMap:ze}=await filterExistingDocumentIds(Be);return{sessionId:Ee,messages:$e,documentIds:Ue,documentNames:ze,groupIds:extractSessionGroupIds(De),websiteIds:extractSessionWebsiteIds(De),dbConnectionId:extractSessionDbConnectionId(De),hasMore:De.hasMore!==void 0?De.hasMore:$e.length>=Te,totalCount:De.total||$e.length}}catch(De){return je(((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.message)||"Failed to fetch history")}}),fetchAvailableModels=createAsyncThunk("chat/fetchAvailableModels",async(Ee=!1,{rejectWithValue:Re})=>{var Te,je;try{return(await getAvailableModels(Ee)).models||[]}catch(Oe){return Re(Oe.message||((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch available models")}}),fetchOlderMessages=createAsyncThunk("chat/fetchOlderMessages",async({sessionId:Ee,offset:Re,limit:Te=30},{rejectWithValue:je})=>{var Oe,Me;try{const De=await getHistory(Ee,!0,Te,Re),$e=(De.messages||[]).map(Be=>{var ze;const Ue={id:Be.id||Be.ID||Be.message_id,role:Be.role||Be.Role||(Be.is_user?"user":"assistant"),content:Be.content||Be.Content||Be.message||Be.Message||Be.reply||Be.Reply||"",timestamp:Be.timestamp||Be.Timestamp||Be.created_at||Be.CreatedAt||new Date().toISOString(),feedback:Be.feedback||null,meta:Be.meta||null};return Be.sources&&Array.isArray(Be.sources)&&Be.sources.length>0?Ue.sources=Be.sources:(ze=Be.meta)!=null&&ze.sources&&Array.isArray(Be.meta.sources)&&Be.meta.sources.length>0&&(Ue.sources=Be.meta.sources),Ue});return{sessionId:Ee,messages:$e,hasMore:De.hasMore!==void 0?De.hasMore:$e.length>=Te}}catch(De){return je(((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.message)||"Failed to fetch older messages")}}),sendMessage=createAsyncThunk("chat/sendMessage",async({sessionId:Ee,message:Re,agentMessage:Te,selectedDocuments:je,selectedGroups:Oe,customInstru
460ctions:Me,mode:De,additional_instructions:$e,selectedModel:Be,dbConnectionId:Ue,webUrls:ze,websiteIds:We,isClarification:Xe},{rejectWithValue:He,dispatch:qe,requestId:Ge})=>{var Ve,Ke,Qe;const Ye=`assistant-stream-${Ge}`;try{const Ze=await sendMessageStream(Ee,Re,je||[],Oe||[],Me,De,$e,Be||"default",{onStage:rr=>{qe(updateStreamingStage({id:Ye,...rr}))},onDelta:rr=>{qe(appendStreamingMessageDelta({id:Ye,delta:rr}))}},Te||null,Ue||null,ze||[],We||[],Xe||!1),Je=((Ve=Ze.meta)==null?void 0:Ve.sources)||[];return{assistantMessage:{id:Ze.message_id||Ye,role:"assistant",content:Ze.reply||Ze.response||Ze.message||"",timestamp:new Date().toISOString(),sources:Je.length>0?Je:void 0,meta:Ze.meta||{},streaming:!1},sessionId:Ee}}catch(Ze){return He(Ze.message||((Qe=(Ke=Ze.response)==null?void 0:Ke.data)==null?void 0:Qe.message)||"Service Temporarily Unavailable. Please try again shortly.")}}),deleteSession=createAsyncThunk("chat/deleteSession",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await deleteSession$1(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to delete session")}}),renameSession=createAsyncThunk("chat/renameSession",async({sessionId:Ee,newName:Re},{rejectWithValue:Te})=>{var je,Oe,Me;try{const De=await renameSession$1(Ee,Re);return{sessionId:Ee,newName:((je=De.session)==null?void 0:je.name)||Re}}catch(De){return Te(((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.message)||"Failed to rename session")}}),togglePinSession=createAsyncThunk("chat/togglePinSession",async({sessionId:Ee,isPinned:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await(Re?unpinSession:pinSession)(Ee),{sessionId:Ee,isPinned:!Re}}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to pin/unpin session")}}),toggleArchiveSession=createAsyncThunk("chat/toggleArchiveSession",async({sessionId:Ee,isArchived:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await(Re?unarchiveSession:archiveSession)(Ee),{sessionId:Ee,isArchived:!Re}}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to archive/unarchive session")}}),clearConversation=createAsyncThunk("chat/clearConversation",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await clearConversation$1(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to clear conversation")}}),deleteMessage=createAsyncThunk("chat/deleteMessage",async({sessionId:Ee,messageId:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await deleteMessage$1(Ee,Re),Re}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to delete message")}}),editMessage=createAsyncThunk("chat/editMessage",async({sessionId:Ee,messageId:Re,newContent:Te},{rejectWithValue:je})=>{var Oe,Me;try{return await editMessage$1(Ee,Re,Te),{messageId:Re,newContent:Te}}catch(De){return je(((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.message)||"Failed to edit message")}}),fetchSharedSessions=createAsyncThunk("chat/fetchSharedSessions",async(Ee=!1,{rejectWithValue:Re})=>{var Te,je;try{return(await getSharedWithMe(Ee)).sessions||[]}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.error)||"Failed to fetch shared chats")}}),shareSession=createAsyncThunk("chat/shareSession",async({sessionId:Ee,userIds:Re,groupIds:Te,permission:je},{rejectWithValue:Oe})=>{var Me,De;try{const $e=await shareSession$1(Ee,{userIds:Re,groupIds:Te,permission:je});return{sessionId:Ee,shares:$e.shares||[],warnings:$e.warnings||[]}}catch($e){return Oe(((De=(Me=$e.response)==null?void 0:Me.data)==null?void 0:De.error)||"Failed to share chat session")}}),fetchSessionShares=createAsyncThunk("chat/fetchSessionShares",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{const Oe=await getSessionShares(Ee);return{sessionId:Ee,shares:Oe.shares||[]}}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.error)||"Failed to list chat session shares")}}),revokeSessionShare=createAsyncThunk("chat/revokeSessionShare",async({sessionId:Ee,userId:Re,groupId:Te},{rejectWithValue:je})=>{var Oe,Me;try{return await revokeSessionShare$1(Ee,{userId:Re,groupId:Te}),{sessionId:Ee,userId:Re,groupId:Te}}catch(De){return je(((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.error)||"Failed to revoke chat session share")}}),fetchShareRecipients=createAsyncThunk("chat/fetchShareRecipients",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{const Oe=await getShareRecipients();return{users:Oe.users||[],groups:Oe.groups||[]}}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.error)||"Failed to load share recipients")}}),initialState$a={sessions:[],currentSessionId:null,messages:[],loading:!1,creatingSession:!1,sendingMessage:!1,streaming:!1,error:null,availableModels:[{id:"default",source:"default",label:"Default",available:!0}],modelsLoading:!1,sessionSearch:"",hasMoreMessages:!0,isLoadingMore:!1,messagesLimit:30,sessionDocumentIds:[],sessionDocumentNames:{},sessionGroupIds:[],sessionWebsiteIds:[],sessionDbConnectionId:null,
460sharedSessions:[],sharedSessionsLoading:!1,sessionShares:{},sessionSharesLoading:!1,shareRecipients:{users:[],groups:[]},shareRecipientsLoading:!1,sharingInProgress:!1},chatSlice=createSlice({name:"chat",initialState:initialState$a,reducers:{setCurrentSession:(Ee,Re)=>{Ee.currentSessionId=Re.payload,Ee.messages=[],Ee.sessionDocumentIds=[],Ee.sessionDocumentNames={},Ee.sessionGroupIds=[],Ee.sessionWebsiteIds=[],Ee.sessionDbConnectionId=null},setSessionDocumentIds:(Ee,Re)=>{Ee.sessionDocumentIds=Array.isArray(Re.payload)?Re.payload:[]},setSessionDocumentNames:(Ee,Re)=>{Ee.sessionDocumentNames=Re.payload&&typeof Re.payload=="object"?Re.payload:{}},setSessionGroupIds:(Ee,Re)=>{Ee.sessionGroupIds=Array.isArray(Re.payload)?Re.payload:[]},setSessionWebsiteIds:(Ee,Re)=>{Ee.sessionWebsiteIds=Array.isArray(Re.payload)?Re.payload:[]},setSessionDbConnectionId:(Ee,Re)=>{Ee.sessionDbConnectionId=Re.payload??null},clearMessages:Ee=>{Ee.messages=[]},setSessionSearch:(Ee,Re)=>{Ee.sessionSearch=Re.payload},clearError:Ee=>{Ee.error=null},injectMessage:(Ee,Re)=>{Ee.messages.push(Re.payload)},updateStreamingStage:(Ee,Re)=>{const Te=Ee.messages.find(De=>De.id===Re.payload.id);if(!Te)return;const je={stage:Re.payload.stage,label:Re.payload.label,detail:Re.payload.detail||"",status:"active"},Oe=Array.isArray(Te.streamingStages)?Te.streamingStages:[];Te.streamingStages=Oe.map(De=>({...De,status:De.stage===je.stage?"active":"completed"}));const Me=Te.streamingStages.findIndex(De=>De.stage===je.stage);Me>=0?Te.streamingStages[Me]={...Te.streamingStages[Me],...je}:Te.streamingStages.push(je),Te.currentStage=je,Te.streaming=!0},appendStreamingMessageDelta:(Ee,Re)=>{const Te=Ee.messages.find(je=>je.id===Re.payload.id);Te&&(Te.content=`${Te.content||""}${Re.payload.delta||""}`,Te.streaming=!0)},addStreamingMessage:(Ee,Re)=>{const Te=Ee.messages.findIndex(je=>je.id===Re.payload.id);Te>=0?Ee.messages[Te]=Re.payload:Ee.messages.push(Re.payload)},receiveSharedChatMessage:(Ee,Re)=>{const Te=Re.payload||{},je=Te.session_id;if(Ee.currentSessionId==null||String(je)!==String(Ee.currentSessionId))return;const Oe=Te.message_id;Ee.messages.some(De=>String(De.id)===String(Oe))||Ee.messages.push({id:Oe,role:Te.role||"assistant",content:Te.content||"",sources:Array.isArray(Te.sources)?Te.sources:void 0,timestamp:Te.created_at||new Date().toISOString(),meta:Te.meta||null,senderUserId:Te.sender_user_id??null})}},extraReducers:Ee=>{Ee.addCase(fetchSessions.pending,Re=>{Re.error=null}).addCase(fetchSessions.fulfilled,(Re,Te)=>{Re.sessions=Te.payload.map(Oe=>({session_id:Oe.id||Oe.session_id,name:Oe.name||Oe.title||"Untitled Chat",pinned:!!(Oe.is_pinned||Oe.pinned),archived:!!(Oe.is_archived||Oe.archived),updated_at:Oe.last_message_at||Oe.updated_at||Oe.updatedAt||null,web_sources_ids:Oe.web_sources_ids??Oe.webSourcesIds??[]}));const je=new Set(Te.payload.map(Oe=>Oe.id||Oe.session_id));Re.currentSessionId&&!je.has(Re.currentSessionId)&&(Re.currentSessionId=null,Re.messages=[],Re.sessionDocumentIds=[],Re.sessionDocumentNames={},Re.sessionGroupIds=[],Re.sessionWebsiteIds=[],Re.sessionDbConnectionId=null),!Re.currentSessionId&&Te.payload.length>0&&(Re.currentSessionId=Te.payload[0].id||Te.payload[0].session_id)}
460).addCase(fetchSessions.rejected,(Re,Te)=>{Re.error=Te.payload}).addCase(createSession.pending,Re=>{Re.creatingSession=!0,Re.error=null}).addCase(createSession.fulfilled,(Re,Te)=>{Re.creatingSession=!1;const je={session_id:Te.payload.id||Te.payload.session_id,name:Te.payload.name||Te.payload.title||"Untitled Chat",pinned:!!(Te.payload.is_pinned||Te.payload.pinned),archived:!!Te.payload.archived,updated_at:Te.payload.updated_at||Te.payload.updatedAt||null,web_sources_ids:Te.payload.web_sources_ids??Te.payload.webSourcesIds??[]};Re.sessions.unshift(je),Re.currentSessionId=je.session_id,Re.messages=[],Re.sessionDocumentIds=[],Re.sessionDocumentNames={},Re.sessionGroupIds=[],Re.sessionWebsiteIds=[],Re.sessionDbConnectionId=null}).addCase(createSession.rejected,(Re,Te)=>{Re.creatingSession=!1,Re.error=Te.payload}).addCase(fetchHistory.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchHistory.fulfilled,(Re,Te)=>{if(Re.loading=!1,Re.currentSessionId===Te.payload.sessionId&&(Re.sendingMessage||Re.streaming)){const Oe=Te.payload.messages,Me=Oe.length>0?Oe[Oe.length-1]:null,De=Re.messages.filter($e=>!(!($e!=null&&$e.pending||$e!=null&&$e.streaming)||$e.role==="user"&&$e.pending&&Me&&Me.role==="user"&&(Me.content||"").trim()===($e.content||"").trim()));Re.messages=[...Te.payload.messages,...De]}else Re.messages=Te.payload.messages;Re.currentSessionId=Te.payload.sessionId,Re.hasMoreMessages=Te.payload.hasMore,Re.sessionDocumentIds=Te.payload.documentIds??[],Re.sessionDocumentNames=Te.payload.documentNames??{},Re.sessionGroupIds=Te.payload.groupIds??[],Re.sessionWebsiteIds=Te.payload.websiteIds??[],Re.sessionDbConnectionId=Te.payload.dbConnectionId??null}).addCase(fetchHistory.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchAvailableModels.pending,Re=>{Re.modelsLoading=!0}).addCase(fetchAvailableModels.fulfilled,(Re,Te)=>{Re.modelsLoading=!1;const je=Array.isArray(Te.payload)&&Te.payload.length>0?Te.payload:[],Oe=je.some(Me=>Me.id==="default");Re.availableModels=Oe?je:[{id:"default",source:"default",label:"Default",available:!0},...je]}).addCase(fetchAvailableModels.rejected,Re=>{Re.modelsLoading=!1,Re.availableModels=[{id:"default",source:"default",label:"Default",available:!0}]}).addCase(fetchOlderMessages.pending,Re=>{Re.isLoadingMore=!0,Re.error=null}).addCase(fetchOlderMessages.fulfilled,(Re,Te)=>{Re.isLoadingMore=!1;const je=new Set(Re.messages.map(Me=>Me.id)),Oe=Te.payload.messages.filter(Me=>!je.has(Me.id));Re.messages=[...Oe,...Re.messages],Re.hasMoreMessages=Te.payload.hasMore&&Oe.length>0}).addCase(fetchOlderMessages.rejected,(Re,Te)=>{Re.isLoadingMore=!1,Re.error=Te.payload}).addCase(sendMessage.pending,(Re,Te)=>{const je={id:Date.now().toString(),role:"user",content:Te.meta.arg.message,timestamp:new Date().toISOString(),pending:!0,requestId:Te.meta.requestId,...Te.meta.arg.attachedScope?{attachedScope:Te.meta.arg.attachedScope}:{}},Oe={id:`assistant-stream-${Te.meta.requestId}`,role:"assistant",content:"",timestamp:new Date().toISOString(),streaming:!0,pending:!0,requestId:Te.meta.requestId,currentStage:{stage:"preparing",label:"Preparing request",detail:"Sending your message to the server",status:"active"},streamingStages:[{stage:"preparing",label:"Preparing request",detail:"Sending your message to the server",status:"active"}]};Re.messages.push(je),Re.messages.push(Oe),Re.sendingMessage=!0,Re.streaming=!0,Re.error=null}).addCase(sendMessage.fulfilled,(Re,Te)=>{var De;Re.sendingMessage=!1,Re.streaming=!1;const je=`assistant-stream-${Te.meta.requestId}`,Oe=(De=Te.payload)==null?void 0:De.assistantMessage,Me=Re.messages.findIndex($e=>$e.id===je);if(Oe&&Me>=0){const $e=Re.messages[Me],Be=Array.isArray($e.streamingStages)?$e.streamingStages.map(Ue=>({...Ue,status:"completed"})):[];Re.messages=Re.messages.map(Ue=>(Ue==null?void 0:Ue.requestId)===Te.meta.requestId?{...Ue,pending:!1}:Ue),Re.messages[Me]={...$e,...Oe,content:Oe.content,sources:Oe.sources,meta:Oe.meta,streaming:!1,pending:!1,requestId:Te.meta.requestId,currentStage:{stage:"complete",label:"Response ready",detail:"Completed",status:"completed"},streamingStages:[...Be,{stage:"complete",label:"Response ready",detail
460:"Completed",status:"completed"}]}}else Oe&&(Re.messages=Re.messages.map($e=>($e==null?void 0:$e.requestId)===Te.meta.requestId?{...$e,pending:!1}:$e),Re.messages.push(Oe))}).addCase(sendMessage.rejected,(Re,Te)=>{Re.sendingMessage=!1,Re.streaming=!1,Re.messages=Re.messages.map(je=>{if((je==null?void 0:je.requestId)!==Te.meta.requestId)return je;if(je.role==="user")return{...je,pending:!1};if(je.role==="assistant"){const Oe=Te.payload||"The stream ended before the answer was finalized.",Me=getStreamingErrorLabel(Oe);return{...je,pending:!1,streaming:!1,currentStage:{stage:"error",label:Me,detail:Oe,status:"error"},streamingStages:[...Array.isArray(je.streamingStages)?je.streamingStages.map(De=>({...De,status:"completed"})):[],{stage:"error",label:Me,detail:Oe,status:"error"}],content:je.content||""}}return je}),Re.error=Te.payload}).addCase(deleteSession.fulfilled,(Re,Te)=>{var je;Re.sessions=Re.sessions.filter(Oe=>Oe.session_id!==Te.payload),Re.currentSessionId===Te.payload&&(Re.currentSessionId=((je=Re.sessions[0])==null?void 0:je.session_id)||null,Re.messages=[])}).addCase(renameSession.fulfilled,(Re,Te)=>{const je=Re.sessions.find(Oe=>Oe.session_id===Te.payload.sessionId);je&&(je.name=Te.payload.newName)}).addCase(togglePinSession.fulfilled,(Re,Te)=>{const je=Re.sessions.find(Oe=>Oe.session_id===Te.payload.sessionId);je&&(je.pinned=Te.payload.isPinned)}).addCase(toggleArchiveSession.fulfilled,(Re,Te)=>{const je=Re.sessions.find(Oe=>Oe.session_id===Te.payload.sessionId);je&&(je.archived=Te.payload.isArchived)}).addCase(clearConversation.fulfilled,(Re,Te)=>{Re.currentSessionId===Te.payload&&(Re.messages=[])}).addCase(deleteMessage.fulfilled,(Re,Te)=>{Re.messages=Re.messages.filter(je=>je.id!==Te.payload)}).addCase(editMessage.fulfilled,(Re,Te)=>{const je=Re.messages.find(Oe=>Oe.id===Te.payload.messageId);je&&(je.content=Te.payload.newContent,je.edited=!0)}).addCase(fetchSharedSessions.pending,Re=>{Re.sharedSessionsLoading=!0}).addCase(fetchSharedSessions.fulfilled,(Re,Te)=>{Re.sharedSessionsLoading=!1,Re.sharedSessions=Te.payload.map(je=>({...je,name:je.name||je.title||"Untitled Chat"}))}
460).addCase(fetchSharedSessions.rejected,(Re,Te)=>{Re.sharedSessionsLoading=!1,Re.error=Te.payload}).addCase(shareSession.pending,Re=>{Re.sharingInProgress=!0,Re.error=null}).addCase(shareSession.fulfilled,(Re,Te)=>{Re.sharingInProgress=!1,Re.sessionShares[Te.payload.sessionId]=Te.payload.shares}).addCase(shareSession.rejected,(Re,Te)=>{Re.sharingInProgress=!1,Re.error=Te.payload}).addCase(fetchSessionShares.pending,Re=>{Re.sessionSharesLoading=!0}).addCase(fetchSessionShares.fulfilled,(Re,Te)=>{Re.sessionSharesLoading=!1,Re.sessionShares[Te.payload.sessionId]=Te.payload.shares}).addCase(fetchSessionShares.rejected,(Re,Te)=>{Re.sessionSharesLoading=!1,Re.error=Te.payload}).addCase(revokeSessionShare.fulfilled,(Re,Te)=>{const{sessionId:je,userId:Oe,groupId:Me}=Te.payload,De=Re.sessionShares[je];Array.isArray(De)&&(Re.sessionShares[je]=De.filter($e=>Oe!=null?!($e.grantee_type==="user"&&String($e.grantee_id)===String(Oe)):Me!=null?!($e.grantee_type==="group"&&String($e.grantee_id)===String(Me)):!0))}).addCase(fetchShareRecipients.pending,Re=>{Re.shareRecipientsLoading=!0}).addCase(fetchShareRecipients.fulfilled,(Re,Te)=>{Re.shareRecipientsLoading=!1,Re.shareRecipients=Te.payload}).addCase(fetchShareRecipients.rejected,(Re,Te)=>{Re.shareRecipientsLoading=!1,Re.error=Te.payload})}}),{setCurrentSession,setSessionDocumentIds,setSessionDocumentNames,setSessionGroupIds,setSessionWebsiteIds,setSessionDbConnectionId,clearMessages,setSessionSearch,clearError:clearError$7,injectMessage,updateStreamingStage,appendStreamingMessageDelta,addStreamingMessage,receiveSharedChatMessage}=chatSlice.actions,selectSessions=Ee=>Ee.chat.sessions,selectCurrentSessionId=Ee=>Ee.chat.currentSessionId,selectSessionDocumentIds=Ee=>Ee.chat.sessionDocumentIds,selectSessionDocumentNames=Ee=>Ee.chat.sessionDocumentNames,selectSessionGroupIds=Ee=>Ee.chat.sessionGroupIds,selectSessionWebsiteIds=Ee=>Ee.chat.sessionWebsiteIds,selectSessionDbConnectionId=Ee=>Ee.chat.sessionDbConnectionId,selectMessages=Ee=>Ee.chat.messages,selectChatLoading=Ee=>Ee.chat.loading,selectCreatingSession=Ee=>Ee.chat.creatingSession,selectSendingMessage=Ee=>Ee.chat.sendingMessage,selectChatError=Ee=>Ee.chat.error,selectHasMoreMessages=Ee=>Ee.chat.hasMoreMessages,selectIsLoadingMore=Ee=>Ee.chat.isLoadingMore,selectMessagesLimit=Ee=>Ee.chat.messagesLimit,selectAvailableModels=Ee=>Ee.chat.availableModels,selectModelsLoading=Ee=>Ee.chat.modelsLoading,selectSharedSessions=Ee=>Ee.chat.sharedSessions,selectSessionShares=Ee=>Re=>Re.chat.sessionShares[Ee]||[],selectShareRecipients=Ee=>Ee.chat.shareRecipients,selectShareRecipientsLoading=Ee=>Ee.chat.shareRecipientsLoading,selectSharingInProgress=Ee=>Ee.chat.sharingInProgress,selectCurrentSessionAccess=Ee=>{const{currentSessionId:Re,sharedSessions:Te,sessions:je}=Ee.chat;if(Re==null)return null;const Oe=Te.find(De=>String(De.id)===String(Re));return Oe?Oe.access||"view":je.find(De=>String(De.session_id)===String(Re))?"owner":null},selectIsCurrentSessionReadOnly=Ee=>selectCurrentSessionAccess(Ee)==="view",chatReducer=chatSlice.reducer,saveStrictMode=createAsyncThunk("customInstructions/saveStrictMode",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return(await cachedAxios.put("/user/strict-mode",{strictMode:Ee})).data}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to save strict mode")}}),saveIndustry=createAsyncThunk("customInstructions/saveIndustry",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return(await cachedAxios.put("/user/industry",{industry:Ee})).data}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.error)||"Failed to save industry")}}),fetchIndustries=createAsyncThunk("customInstructions/fetchIndustries",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await userService.getIndustries()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.error)||"Failed to fetch industries")}}),fetchInstructions=createAsyncThunk("customInstructions/fetch",async(Ee=!1,{rejectWithValue:Re})=>{var Te,je;try{return await getSelectedInstructions(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch instructions")}}
460),fetchAllPresets=createAsyncThunk("customInstructions/fetchPresets",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await getAllPresets()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch presets")}}),fetchPreset=createAsyncThunk("customInstructions/fetchPreset",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await getPreset(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch preset")}}),saveInstructions=createAsyncThunk("customInstructions/save",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{const Oe=await getPreset(Ee);return{selected:Oe.settings,presetKey:Oe.presetKey}}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to save instructions")}}),saveAllChatSettings=createAsyncThunk("customInstructions/saveAllSettings",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return(await cachedAxios.post("/analytics/custom-instructions",{instructions:Ee})).data}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to save settings")}}),submitCustomInstructionsSelection=createAsyncThunk("customInstructions/select",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await selectInstructions(Ee)||Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to save instructions")}}),initialState$9={selectedInstructions:null,activePresetKey:null,availablePresets:[],currentPresetData:null,customSettings:null,strictModeValue:null,industryValue:null,industryOptions:[],industriesLoaded:!1,loading:!1,error:null},customInstructionsSlice=createSlice({name:"customInstructions",initialState:initialState$9,reducers:{setActivePreset:(Ee,Re)=>{Ee.activePresetKey=Re.payload},clearInstructions:Ee=>{Ee.selectedInstructions=null,Ee.activePresetKey=null,Ee.currentPresetData=null},clearError:Ee=>{Ee.error=null}},extraReducers:Ee=>{Ee.addCase(fetchInstructions.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchInstructions.fulfilled,(Re,Te)=>{var De;Re.loading=!1,Re.selectedInstructions=Te.payload.selected,Re.customSettings=Te.payload.customSettings||null,Te.payload.strictModeValue!==void 0&&(Re.strictModeValue=Te.payload.strictModeValue),Te.payload.industryValue!==void 0&&(Re.industryValue=Te.payload.industryValue);const je=Te.payload.presetKey,Oe=(De=Te.payload.selected)==null?void 0:De.preset_name;let Me=je||null;(je==="custom"||Oe==="Customize")&&(Me="customize"),Re.activePresetKey=Me}
460).addCase(fetchInstructions.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchAllPresets.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchAllPresets.fulfilled,(Re,Te)=>{Re.loading=!1,Re.availablePresets=Te.payload}).addCase(fetchAllPresets.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchPreset.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchPreset.fulfilled,(Re,Te)=>{Re.loading=!1,Re.currentPresetData=Te.payload}).addCase(fetchPreset.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(saveInstructions.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(saveInstructions.fulfilled,(Re,Te)=>{Re.loading=!1,Re.selectedInstructions={preset_name:Te.payload.presetKey,...Te.payload.selected},Re.activePresetKey=Te.payload.presetKey}).addCase(saveInstructions.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(saveAllChatSettings.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(saveAllChatSettings.fulfilled,(Re,Te)=>{Re.loading=!1,Re.selectedInstructions={...Re.selectedInstructions,...Te.payload}}).addCase(saveAllChatSettings.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(submitCustomInstructionsSelection.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(submitCustomInstructionsSelection.fulfilled,(Re,Te)=>{Re.loading=!1;const je=Te.payload||{};je.selected&&je.presetKey?(Re.selectedInstructions=je.selected,Re.activePresetKey=je.presetKey,je.presetKey==="custom"&&(Re.customSettings=je.selected)):(Re.selectedInstructions={preset_name:je.preset_name,...je},Re.activePresetKey=je.presetKey||Re.activePresetKey)}
460).addCase(submitCustomInstructionsSelection.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(saveStrictMode.fulfilled,(Re,Te)=>{Re.strictModeValue=Te.payload.strictMode}).addCase(saveIndustry.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(saveIndustry.fulfilled,(Re,Te)=>{Re.loading=!1,Re.industryValue=Te.payload.industry}).addCase(saveIndustry.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchIndustries.fulfilled,(Re,Te)=>{Re.industryOptions=Te.payload||[],Re.industriesLoaded=!0}).addCase(fetchIndustries.rejected,(Re,Te)=>{Re.industriesLoaded=!1,Re.error=Te.payload})}}),{setActivePreset,clearInstructions,clearError:clearError$6}=customInstructionsSlice.actions,selectSelectedInstructions=Ee=>Ee.customInstructions.selectedInstructions,selectActivePresetKey=Ee=>Ee.customInstructions.activePresetKey,selectAvailablePresets=Ee=>Ee.customInstructions.availablePresets,selectCurrentPresetData=Ee=>Ee.customInstructions.currentPresetData,selectInstructionsLoading=Ee=>Ee.customInstructions.loading,selectInstructionsError=Ee=>Ee.customInstructions.error,selectCustomSettings=Ee=>Ee.customInstructions.customSettings,selectStrictModeValue=Ee=>Ee.customInstructions.strictModeValue,selectIndustryValue=Ee=>Ee.customInstructions.industryValue,selectIndustryOptions=Ee=>Ee.customInstructions.industryOptions,selectIndustriesLoaded=Ee=>Ee.customInstructions.industriesLoaded,selectCustomInstructions=Ee=>Ee.customInstructions.selectedInstructions,customInstructionsReducer=customInstructionsSlice.reducer,fetchFavorites=createAsyncThunk("favorites/fetch",async(Ee=!1,{rejectWithValue:Re})=>{var Te,je;try{const Oe=await getFavorites(Ee);return Oe.favorites||Oe.prompts||[]}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.error)||Oe.message||"Failed to fetch favorites")}}),saveFavorite=createAsyncThunk("favorites/save",async({prompt:Ee,name:Re,is_global:Te},{rejectWithValue:je})=>{var Oe,Me;try{const De=await saveFavorite$1(Ee,Re,Te);return De.favorite||De.prompt||{prompt:Ee,title:Re,id:Date.now().toString()}}catch(De){return je(((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.error)||De.message||"Failed to save favorite")}}),deleteFavorite=createAsyncThunk("favorites/delete",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await deleteFavorite$1(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.error)||Oe.message||"Failed to delete favorite")}}),bulkDeleteFavorites=createAsyncThunk("favorites/bulkDelete",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await bulkDeleteFavorites$1(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.error)||Oe.message||"Failed to delete favorites")}}),initialState$8={favorites:[],loading:!1,error:null,searchQuery:""},favoritesSlice=createSlice({name:"favorites",initialState:initialState$8,reducers:{setSearchQuery:(Ee,Re)=>{Ee.searchQuery=Re.payload},clearSearchQuery:Ee=>{Ee.searchQuery=""},clearError:Ee=>{Ee.error=null}},extraReducers:Ee=>{Ee.addCase(fetchFavorites.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchFavorites.fulfilled,(Re,Te)=>{Re.loading=!1,Re.favorites=Te.payload}).addCase(fetchFavorites.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(deleteFavorite.pending,Re=>{Re.error=null}).addCase(deleteFavorite.rejected,(Re,Te)=>{Re.error=Te.payload}).addCase(bulkDeleteFavorites.pending,Re=>{Re.error=null}).addCase(bulkDeleteFavorites.rejected,(Re,Te)=>{Re.error=Te.payload})}}),{setSearchQuery:setSearchQuery$2,clearError:clearError$5,clearSearchQuery}=favoritesSlice.actions,selectFavorites=Ee=>Ee.favorites.favorites,selectFavoritesLoading=Ee=>Ee.favorites.loading,selectFavoritesError=Ee=>Ee.favorites.error,selectSearchQuery$1=Ee=>Ee.favorites.searchQuery,selectFilteredFavorites=Ee=>{const{favorites:Re,searchQuery:Te}=Ee.favorites;if(!Te.trim())return Re;const je=Te.toLowerCase();return Re.filter(Oe=>(Oe.title||Oe.name||"").toLowerCase().includes(je)||(Oe.prompt||"").toLowerCase().includes(je))},favoritesReducer=favoritesSlice.reducer,getUsers=async()=>{var De,$e;const[Ee,Re]=await Promise.all([cachedAxios.get("/tenants/users",{cache:!1}),cachedAxios.get("/groups",{cache:!1})]),Te=Array.isArray(Re.data)?Re.data:((De=Re.data)==null?void 0:De.groups)||(($e=Re.data)==null?void 0:$e.data)||[],je={};Te.forEach(Be=>{const Ue=Be.id||Be.group_id||Be.GroupID;je[Ue]=Be.description||Be.Description||""});const Oe=Ee.data;return{users:(Oe.users||[]).map(Be=>({user_id:Be.id,name:`${Be.first_name||Be.FirstName||""} ${Be.last_name||Be.LastName||""}`.trim(),first_name:Be.first_name||Be.FirstName||"",last_name:Be.last_name||Be.LastName||"",email:Be.email||Be.Email||"",username:Be.username||Be.UserName||"",role:Be.role,is_super_group_admin:Be.is_super_group_admin===!0,is_deleted:Be.status===3,is_pending:Be.status===2,is_register:Be.status===4,is_invite_cancelled:Be.status===5,is_invite_expired:Be.status===6,is_suspended:Be.status===0||Be.is_suspended===!0,created_at:Be.created_at,last_login:Be.last_login,tenant_id:Be.tenant_id??null,groups:(Be.memberships||[]).map(Ue=>({group_id:Ue.group_id,GroupID:Ue.group_id,name:Ue.group_name,GroupName:Ue.group_name,is_admin:Ue.is_admin,isAdmin:Ue.is_admin,description:je[Ue.group_id]||""}))})),tenant_id:Oe.tenant_id??null,tenant_name:Oe.tenant_name??"",main_tenant:Oe.main_tenant||null}},getUsersFromGroups=async Ee=>{var Re,Te;if(!Ee||Ee.length===0)return{users:[]};try{const je=await cachedAxios.get("/groups",{cache:!1}),Oe=Array.isArray(je.data)?je.data:((Re=je.data)==null?void 0:Re.groups)||((Te=je.data)==null?void 0:Te.data)||[],Me={};Oe.forEach(ze=>{const We=ze.id||ze.group_id||ze.GroupID;Me[We]=ze.description||ze.Description||""});const De=Oe.filter(ze=>{const We=ze.id||ze.group_id||ze.GroupID;return Ee.includes(We)}),$e=await Promise.all(De.map(async ze=>{try{const We=ze.id||ze.group_id||ze.GroupID,Xe=await groupService.getGroupMembers(We),He=Array.isArray(Xe)?Xe:Array.isArray(Xe==null?void 0:Xe.members)?Xe.members:Array.isArray(Xe==null?void 0:Xe.data)?Xe.data:[];return{groupId:We,groupName:ze.name||ze.GroupName,members:He}}
460catch{return{groupId:ze.id,groupName:ze.name||ze.GroupName,members:[]}}})),Be=new Map;return $e.forEach(({groupId:ze,groupName:We,members:Xe})=>{Xe.forEach(He=>{const qe=He.user_id||He.UserID||He.id;if(!qe)return;if(!Be.has(qe)){let Ye=0;He.role!==void 0&&He.role!==null?Ye=Number(He.role):He.is_admin&&(Ye=1),Be.set(qe,{user_id:qe,name:He.name||`${He.first_name||He.FirstName||""} ${He.last_name||He.LastName||""}`.trim(),first_name:He.first_name||He.FirstName||"",last_name:He.last_name||He.LastName||"",email:He.email||He.Email,username:He.username||He.UserName||"",role:Ye,is_super_group_admin:He.is_super_group_admin===!0||He.is_super_group_admin===1,is_deleted:He.is_deleted||He.status===3||!1,is_pending:He.is_pending||He.status===2||!1,is_invite_cancelled:He.is_invite_cancelled||He.status===5||!1,is_invite_expired:He.is_invite_expired||He.status===6||!1,is_suspended:He.is_suspended||He.status===0||!1,created_at:He.created_at,last_login:He.last_login,groups:[]})}const Ge=Be.get(qe);if((He.is_super_group_admin===!0||He.is_super_group_admin===1)&&(Ge.is_super_group_admin=!0),Ge.groups.push({group_id:ze,GroupID:ze,name:We,GroupName:We,is_admin:He.is_admin||!1,isAdmin:He.is_admin||!1,description:Me[ze]||""}),He.role!==void 0&&He.role!==null){const Ye=Number(He.role);Ye>Ge.role&&(Ge.role=Ye)}else He.is_admin&&Ge.role===0&&(Ge.role=1)})}),{users:Array.from(Be.values())}}catch{return{users:[]}}},generatePassword=()=>{const Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Re="abcdefghijklmnopqrstuvwxyz",Te="0123456789",je="!@#$%^&*-_=+<>?",Oe=Ee+Re+Te+je,Me=Be=>{try{if(typeof crypto<"u"&&crypto.getRandomValues){const Ue=new Uint32Array(1);return crypto.getRandomValues(Ue),Ue[0]%Be}}catch(Ue){console.warn("crypto.getRandomValues failed, using Math.random fallback:",Ue)}return Math.floor(Math.random()*Be)};let De="";De+=Ee.charAt(Me(Ee.length)),De+=Re.charAt(Me(Re.length)),De+=Te.charAt(Me(Te.length)),De+=je.charAt(Me(je.length)),De+=je.charAt(Me(je.length));for(let Be=De.length;Be<12;Be++)De+=Oe.charAt(Me(Oe.length));const $e=De.split("");for(let Be=$e.length-1;Be>0;Be--){const Ue=Me(Be+1);[$e[Be],$e[Ue]]=[$e[Ue],$e[Be]]}return $e.join("")},inviteUser$1=async Ee=>{const Re=generatePassword(),Te={first_name:Ee.first_name||"",last_name:Ee.last_name||"",email:Ee.email,password:Re,role:Ee.role!==void 0?Ee.role:0,group_ids:Ee.group_ids||[],isPending:!1};Ee.super_group_admin&&(Te.super_group_admin=!0);const je=await cachedAxios.post("/tenant/add-user",Te);return{message:je.data.message||"User created successfully",user:{email:Te.email,first_name:Te.first_name,last_name:Te.last_name,username:Te.username,name:`${Te.first_name} ${Te.last_name}`.trim(),role:Te.role,groups:[],...je.data.user||je.data}}},resendInvite$1=async(Ee,Re)=>{const Te={user_id:Ee,new_password:Re};return(await cachedAxios.post("/tenant/resend-invite",Te)).data},cancelInvite$1=async Ee=>(await cachedAxios.post("/tenant/cancel-invite",{user_id:Ee})).data,updateUser$1=async(Ee,Re,Te=!1)=>{const je=Te?`/admin/users/${Ee}`:`/tenant/users/${Ee}`;return(await cachedAxios.put(je,Re)).data},changeUserRole$1=async(Ee,Re)=>(await cachedAxios.put(`/tenant/users/${Ee}/role`,{role:Re})).data,lockUser$1=async Ee=>(await cachedAxios.post(`/admin/users/${Ee}/lock`)).data,unlockUser$1=async Ee=>(await cachedAxios.post(`/admin/users/${Ee}/unlock`)).data,deleteUser$1=async Ee=>(await cachedAxios.delete(`/admin/users/${Ee}`)).data,restoreUser$1=async Ee=>(await cachedAxios.post(`/admin/users/${Ee}/restore`)).data,getUserRequests=async(Ee=!1)=>(await cachedAxios.get("/tenant/requests",{cache:!Ee})).data,approveUserRequest$1=async(Ee,Re,Te=[])=>(await cachedAxios.post(`/tenant/requests/${Ee}/approve`,{role:Re,groups:Te})).data,rejectUserRequest$1=async(Ee,Re="")=>(await cachedAxios.post(`/tenant/requests/${Ee}/reject`,{reason:Re})).data,assignUserToGroups=async(Ee,Re)=>(await cachedAxios.post(`/admin/users/${Ee}/groups`,{group_ids:Re})).data,removeUserFromGroup=async(Ee,Re)=>(await cachedAxios.delete(`/admin/users/${Ee}/groups/${Re}`)).data,getUserActivity=async(Ee,Re=50)=>(await cachedAxios.get(`/admin/users/${Ee}/activity`,{params:{limit:Re}})).data,suspendUser$1=async(Ee,Re)=>(await cachedAxios.post(`/tenant/users/${Ee}/suspend`,{reason:Re})).data,activateUser$1=async Ee=>(await cachedAxios.post(`/tenant/users/${Ee}/activate`)).data,userManagementService={getUsers,getUsersFromGroups,inviteUser:inviteUser$1,cancelInvite:cancelInvite$1,resendInvite:resendInvite$1,updateUser:updateUser$1,changeUserRole:changeUserRole$1,lockUser:lockUser$1,unlockUser:unlockUser$1,deleteUser:deleteUser$1,restoreUser:restoreUser$1,getUserRequests,approveUserRequest:approveUserRequest$1,rejectUserRequest:rejectUserRequest$1,assignUserToGroups,removeUserFromGroup,getUserActivity,suspendUser:suspendUser$1,activateUser:activateUser$1},fetchUsers=createAsyncThunk("userManagement/fetchUsers",async({isGroupAdmin:Ee=!1,groupIds:Re=[]}={},{rejectWithValue:Te})=>{var je,Oe;try{let Me;return Ee&&Re.length>0?Me=await userManagementService.getUsersFromGroups(Re):Me=await userManagementService.getUsers(),{users:Me.users||[],tenantMeta:{tenant_id:Me.tenant_id??null,tenant_name:Me.tenant_name??"",main_tenant:Me.main_tenant||null}}}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to fetch users")}}),inviteUser=createAsyncThunk("userManagement/inviteUser",async(Ee,{rejectWithValue:Re})=>{var Te,je,Oe,Me;try{return await userManagementService.inviteUser(Ee)}catch(De){return Re(De.message||((Te=De.data)==null?void 0:Te.error)||((je
460=De.data)==null?void 0:je.message)||((Me=(Oe=De.response)==null?void 0:Oe.data)==null?void 0:Me.error)||"Failed to invite user")}}),updateUser=createAsyncThunk("userManagement/updateUser",async({userId:Ee,updates:Re,isGroupAdmin:Te=!1},{rejectWithValue:je})=>{var Oe,Me;try{const De=await userManagementService.updateUser(Ee,Re,Te);return De.user||{user_id:De.user_id||Ee,...Re}}catch(De){return je((De==null?void 0:De.message)||((Oe=De==null?void 0:De.data)==null?void 0:Oe.error)||((Me=De==null?void 0:De.data)==null?void 0:Me.message)||"Failed to update user")}}),changeUserRole=createAsyncThunk("userManagement/changeUserRole",async({userId:Ee,role:Re},{rejectWithValue:Te})=>{var je,Oe;try{const Me=await userManagementService.changeUserRole(Ee,Re);return{userId:Ee,role:Me.role}}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to change user role")}}),lockUser=createAsyncThunk("userManagement/lockUser",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await userManagementService.lockUser(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to lock user")}}),unlockUser=createAsyncThunk("userManagement/unlockUser",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await userManagementService.unlockUser(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to unlock user")}}),deleteUser=createAsyncThunk("userManagement/deleteUser",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await userManagementService.deleteUser(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to delete user")}}),restoreUser=createAsyncThunk("userManagement/restoreUser",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await userManagementService.restoreUser(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to restore user")}}),suspendUser=createAsyncThunk("userManagement/suspendUser",async({userId:Ee,reason:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await userManagementService.suspendUser(Ee,Re),Ee}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||Me.message||"Failed to suspend user")}}),activateUser=createAsyncThunk("userManagement/activateUser",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await userManagementService.activateUser(Ee),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||Oe.message||"Failed to activate user")}}),cancelInvite=createAsyncThunk("userManagement/cancelInvite",async({userId:Ee},{rejectWithValue:Re})=>{var Te,je;try{const Oe=await userManagementService.cancelInvite(Ee);return{userId:Ee,message:Oe.message}}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||Oe.message||"Failed to cancel invite")}}),resendInvite=createAsyncThunk("userManagement/resendInvite",async({userId:Ee,newPassword:Re},{rejectWithValue:Te})=>{var je,Oe;try{const Me=await userManagementService.resendInvite(Ee,Re);return{userId:Ee,message:Me.message}}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||Me.message||"Failed to resend invite")}}),fetchUserRequests=createAsyncThunk("userManagement/fetchUserRequests",async(Ee=!1,{rejectWithValue:Re})=>{var Te,je;try{return(await userManagementService.getUserRequests(Ee)).requests||[]}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch user requests")}}),approveUserRequest=createAsyncThunk("userManagement/approveUserRequest",async({requestId:Ee,role:Re,groups:Te},{rejectWithValue:je})=>{var Oe,Me;try{const De=await userManagementService.approveUserRequest(Ee,Re,Te);return{requestId:Ee,user:De.user}}catch(De){return je(((Oe=De==null?void 0:De.data)==null?void 0:Oe.message)||((Me=De==null?void 0:De.data)==null?void 0:Me.error)||De.message||"Failed to approve request")}}),rejectUserRequest=createAsyncThunk("userManagement/rejectUserRequest",async({requestId:Ee,reason:Re},{rejectWithValue:Te})=>{var je,Oe;
460try{return await userManagementService.rejectUserRequest(Ee,Re),Ee}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to reject request")}}),initialState$7={users:[],tenantMeta:{tenant_id:null,tenant_name:"",main_tenant:null},userRequests:[],selectedUser:null,loading:!1,requestsLoading:!1,actionLoading:!1,error:null,searchQuery:"",roleFilter:[],statusFilter:"all"},userManagementSlice=createSlice({name:"userManagement",initialState:initialState$7,reducers:{setSearchQuery:(Ee,Re)=>{Ee.searchQuery=Re.payload},setRoleFilter:(Ee,Re)=>{Ee.roleFilter=Re.payload},setStatusFilter:(Ee,Re)=>{Ee.statusFilter=Re.payload},setSelectedUser:(Ee,Re)=>{Ee.selectedUser=Re.payload},clearError:Ee=>{Ee.error=null},clearFilters:Ee=>{Ee.searchQuery="",Ee.roleFilter=[],Ee.statusFilter="all"},clearSelectedUser:Ee=>{Ee.selectedUser=null}},extraReducers:Ee=>{Ee.addCase(fetchUsers.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchUsers.fulfilled,(Re,Te)=>{Re.loading=!1,Re.users=Te.payload.users||[],Re.tenantMeta=Te.payload.tenantMeta||initialState$7.tenantMeta}).addCase(fetchUsers.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(inviteUser.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(inviteUser.fulfilled,(Re,Te)=>{Re.actionLoading=!1}).addCase(inviteUser.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(updateUser.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(updateUser.fulfilled,(Re,Te)=>{var Oe;Re.actionLoading=!1;const je=Re.users.findIndex(Me=>Me.user_id===Te.payload.user_id);je!==-1&&(Re.users[je]=Te.payload),((Oe=Re.selectedUser)==null?void 0:Oe.user_id)===Te.payload.user_id&&(Re.selectedUser=Te.payload)}).addCase(updateUser.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(changeUserRole.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(changeUserRole.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.users.find(Oe=>Oe.user_id===Te.payload.userId);je&&(je.role=Te.payload.role)}).addCase(changeUserRole.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(lockUser.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(lockUser.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.users.find(Oe=>Oe.user_id===Te.payload);je&&(je.is_locked=!0)}).addCase(lockUser.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(unlockUser.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(unlockUser.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.users.find(Oe=>Oe.user_id===Te.payload);je&&(je.is_locked=!1)}).addCase(unlockUser.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(deleteUser.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(deleteUser.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.users.find(Oe=>Oe.user_id===Te.payload);je&&(je.is_deleted=!0)}).addCase(deleteUser.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(restoreUser.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(restoreUser.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.users.find(Oe=>Oe.user_id===Te.payload);je&&(je.is_deleted=!1)}).addCase(restoreUser.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(suspendUser.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(suspendUser.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.users.find(Oe=>Oe.user_id===Te.payload);je&&(je.status=0,je.is_suspended=!0)}).addCase(suspendUser.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(activateUser.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(activateUser.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.users.find(Oe=>Oe.user_id===Te.payload);je&&(je.status=1,je.is_suspended=!1)}).addCase(activateUser.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(resendInvite.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(resendInvite.fulfilled,(Re,Te)=>{Re.actionLoading=!1;const je=Re.users.find(Oe=>Oe.user_id===Te.payload.userId);je&&(je.is_pending=!0,je.is_register=!1)}
460).addCase(resendInvite.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(cancelInvite.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(cancelInvite.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.users=Re.users.filter(je=>je.user_id!==Te.payload.userId)}).addCase(cancelInvite.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(fetchUserRequests.pending,Re=>{Re.requestsLoading=!0,Re.error=null}).addCase(fetchUserRequests.fulfilled,(Re,Te)=>{Re.requestsLoading=!1,Re.userRequests=Te.payload}).addCase(fetchUserRequests.rejected,(Re,Te)=>{Re.requestsLoading=!1,Re.error=Te.payload}).addCase(approveUserRequest.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(approveUserRequest.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.userRequests=Re.userRequests.filter(je=>je.request_id!==Te.payload.requestId),Te.payload.user&&Re.users.push(Te.payload.user)}).addCase(approveUserRequest.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(rejectUserRequest.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(rejectUserRequest.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.userRequests=Re.userRequests.filter(je=>je.request_id!==Te.payload)}).addCase(rejectUserRequest.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload})}}),{setSearchQuery:setSearchQuery$1,setRoleFilter,setStatusFilter:setStatusFilter$1,setSelectedUser,clearError:clearError$4,clearFilters:clearFilters$1,clearSelectedUser}=userManagementSlice.actions,selectUsers=Ee=>Ee.userManagement.users,selectTenantMeta=Ee=>Ee.userManagement.tenantMeta,selectUserRequests=Ee=>Ee.userManagement.userRequests,selectSelectedUser=Ee=>Ee.userManagement.selectedUser,selectLoading=Ee=>Ee.userManagement.loading,selectRequestsLoading=Ee=>Ee.userManagement.requestsLoading,selectActionLoading=Ee=>Ee.userManagement.actionLoading,selectError=Ee=>Ee.userManagement.error,selectSearchQuery=Ee=>Ee.userManagement.searchQuery,selectRoleFilter=Ee=>Ee.userManagement.roleFilter,selectStatusFilter=Ee=>Ee.userManagement.statusFilter,selectFilteredUsers=Ee=>{var $e,Be;const{users:Re,searchQuery:Te,roleFilter:je,statusFilter:Oe,tenantMeta:Me}=Ee.userManagement;($e=Ee.auth)==null||$e.user;let De=Re;if(Te.trim()){const Ue=Te.toLowerCase();De=De.filter(ze=>{var We,Xe,He;return((We=ze.name)==null?void 0:We.toLowerCase().includes(Ue))||((Xe=ze.email)==null?void 0:Xe.toLowerCase().includes(Ue))||((He=ze.username)==null?void 0:He.toLowerCase().includes(Ue))})}if(je&&je.length>0){const Ue=Number(((Be=Me==null?void 0:Me.main_tenant)==null?void 0:Be.user_id)||0),ze=je.includes("super_admin"),We=je.includes("restricted_group_admin"),Xe=je.f
460ilter(He=>He!=="super_admin"&&He!=="restricted_group_admin").map(He=>Number(He));De=De.filter(He=>{const qe=Number(He.user_id||He.id||He.UserID||0),Ge=Number(He.role),Ye=Ue>0&&qe===Ue,Ve=(He==null?void 0:He.is_super_group_admin)===!0||(He==null?void 0:He.is_super_group_admin)===1,Ke=ze&&Ue>0&&qe===Ue,Qe=We&&Ve&&!Ye,Ze=!Ye&&Xe.some(Je=>Je===2?Ge===2&&!Ve:Ge===Je);return Ke||Qe||Ze})}return Oe==="active"?De=De.filter(Ue=>!Ue.is_locked&&!Ue.is_deleted&&!Ue.is_suspended&&!Ue.is_pending):Oe==="pending"?De=De.filter(Ue=>Ue.is_pending):Oe==="locked"?De=De.filter(Ue=>Ue.is_locked):Oe==="deleted"?De=De.filter(Ue=>Ue.is_deleted):Oe==="suspended"&&(De=De.filter(Ue=>Ue.is_suspended)),[...De].sort((Ue,ze)=>{const We=Number(Ue.user_id||Ue.id||Ue.UserID||0);return Number(ze.user_id||ze.id||ze.UserID||0)-We})},userManagementReducer=userManagementSlice.reducer,initialState$6={},gridSettingsSlice=createSlice({name:"gridSettings",initialState:initialState$6,reducers:{setGridSettings:(Ee,Re)=>{const{pageKey:Te,settings:je}=Re.payload;Ee[Te]={...Ee[Te],...je}},resetGridSettings:(Ee,Re)=>{const{pageKey:Te}=Re.payload;delete Ee[Te]}}}),{setGridSettings,resetGridSettings}=gridSettingsSlice.actions,gridSettingsReducer=gridSettingsSlice.reducer,subscriptionService={getBillingHistory:async()=>(await subscriptionService.getLicensePool(!0)).purchase_history||[],getSubscription:async(Ee=!1)=>{const Re=await cachedAxios.get("/tenant/subscription",{...Ee&&{cache:{enabled:!1}}});return Re.data.current_subscription&&Re.data.current_subscription.plan&&(Re.data.current_subscription.original_plan=Re.data.current_subscription.plan),Re.data.current_subscription&&Re.data.current_subscription.plan&&Re.data.current_subscription.plan.toUpperCase()==="FREE"&&(Re.data.current_subscription.plan="BUSINESS"),Re.data},upgradePlan:async Ee=>(await cachedAxios.post("/tenant/subscription/upgrade",{plan:Ee})).data,upgradeSubscription:async({tenant_id:Ee,plan_id:Re,quantity:Te,billingCycle:je})=>{const Oe={tenant_id:Ee,plan_id:Re};return Te!=null&&(Oe.quantity=Te),je&&(Oe.billingCycle=je),(await cachedAxios.put("/tenant/subscription/upgrade",Oe)).data},getAvailablePlans:async()=>(await cachedAxios.get("/subscription/plans")).data,createCheckoutSession:async({plan:Ee,tenant_id:Re,billing_email:Te,success_url:je,cancel_url:Oe,billing_history_id:Me})=>{const De={};return Ee&&(De.plan=Ee),Re&&(De.tenant_id=Re),Te&&(De.billing_email=Te),je&&(De.success_url=je),Oe&&(De.cancel_url=Oe),Me&&(De.billing_history_id=Me),(await cachedAxios.post("/tenant/subscription/checkout",De)).data},confirmPayment:async({session_id:Ee,tenant_id:Re,plan:Te,signup:je,quantity:Oe})=>{const Me={session_id:Ee};return Re&&(Me.tenant_id=Re),Te&&(Me.plan=Te),typeof je<"u"&&(Me.signup=je),typeof Oe<"u"&&(Me.license_qty=parseInt(Oe,10)),(await cachedAxios.post("/tenant/subscription/confirm",Me)).data},listPlans:async()=>(await cachedAxios.get("/subscription/plans")).data,getTenantSubscription:async()=>(await cachedAxios.get("/tenant/subscription")).data,getLicensePool:async(Ee=!1)=>{var Te,je;const Re=await cachedAxios.get("/tenant/license-pool",{...Ee&&{cache:{enabled:!1}}});return(Te=Re.data)!=null&&Te.subscription&&(Re.data.subscription.original_plan=Re.data.subscription.plan,((je=Re.data.subscription.plan)==null?void 0:je.toUpperCase())==="ENTERPRISE"&&Re.data.subscription.is_payment===!0&&(Re.data.subscription.plan="SAAS")),Re.data},purchaseLicenses:async({quantity:Ee})=>(await cachedAxios.put("/tenant/licenses/purchase",{quantity:Ee})).data,confirmLicensePurchase:async({session_id:Ee})=>(await cachedAxios.post("/tenant/licenses/confirm-purchase",{session_id:Ee})).data,downgradeLicenses:async({quantity:Ee})=>(await cachedAxios.put("/tenant/licenses/downgrade",{quantity:Ee})).data,cancelSubscription:async(Ee={})=>(await cachedAxios.post("/tenant/subscription/cancel",Ee)).data,updateAutoRenewal:async({tenant_id:Ee,auto_renew:Re})=>(await cachedAxios.put("/tenant/subscription/auto-renew",{tenant_id:Ee,auto_renew:Re})).data,changeBillingCycle:async({tenant_id:Ee,billing_cycle:Re})=>(await cachedAxios.put("/tenant/subscription/billing-cycle",{tenant_id:Ee,billing_cycle:Re}
460)).data,cancelBillingCycleChange:async({tenant_id:Ee})=>(await cachedAxios.delete("/tenant/subscription/billing-cycle",{data:{tenant_id:Ee}})).data,submitOnPremisesRequest:async({name:Ee,email:Re,company:Te,message:je})=>(await cachedAxios.post("/public/onprem-request",{name:Ee,email:Re,company:Te,message:je})).data},fetchSubscription=createAsyncThunk("subscription/fetchSubscription",async(Ee=!1,{rejectWithValue:Re})=>{var Te,je;try{return await subscriptionService.getSubscription(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch subscription")}}),fetchUsageStats=createAsyncThunk("subscription/fetchUsageStats",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await subscriptionService.getUsageStats()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch usage statistics")}}),fetchBillingHistory$1=createAsyncThunk("subscription/fetchBillingHistory",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await subscriptionService.getBillingHistory()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch billing history")}}),upgradePlan=createAsyncThunk("subscription/upgradePlan",async({planId:Ee,paymentMethodId:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await subscriptionService.upgradePlan(Ee,Re)}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to upgrade plan")}}),upgradeSubscription=createAsyncThunk("subscription/upgradeSubscription",async({tenant_id:Ee,plan_id:Re,quantity:Te,billingCycle:je},{rejectWithValue:Oe})=>{var Me,De;try{return await subscriptionService.upgradeSubscription({tenant_id:Ee,plan_id:Re,quantity:Te,billingCycle:je})}catch($e){return Oe(((De=(Me=$e.response)==null?void 0:Me.data)==null?void 0:De.message)||"Failed to upgrade subscription")}}),downgradePlan=createAsyncThunk("subscription/downgradePlan",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await subscriptionService.downgradePlan(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to downgrade plan")}}),cancelSubscription=createAsyncThunk("subscription/cancelSubscription",async({reason:Ee,feedback:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await subscriptionService.cancelSubscription(Ee,Re)}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to cancel subscription")}}),downloadInvoice=createAsyncThunk("subscription/downloadInvoice",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{const Oe=await subscriptionService.downloadInvoice(Ee),Me=window.URL.createObjectURL(Oe),De=document.createElement("a");return De.href=Me,De.download=`invoice-${Ee}.pdf`,document.body.appendChild(De),De.click(),document.body.removeChild(De),window.URL.revokeObjectURL(Me),Ee}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to download invoice")}}),fetchAvailablePlans=createAsyncThunk("subscription/fetchAvailablePlans",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await subscriptionService.getAvailablePlans()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch available plans")}}),createCheckoutSession=createAsyncThunk("subscription/createCheckoutSession",async({plan:Ee,tenant_id:Re,quantity:Te,billing_cycle:je,billing_history_id:Oe,billing_email:Me},{rejectWithValue:De})=>{var $e,Be;try{return await subscriptionService.createCheckoutSession({plan:Ee,tenant_id:Re,quantity:Te,billing_cycle:je,billing_history_id:Oe,billing_email:Me})}catch(Ue){return De(((Be=($e=Ue.response)==null?void 0:$e.data)==null?void 0:Be.message)||"Failed to create checkout session")}}),confirmPayment=createAsyncThunk("subscription/confirmPayment",async({session_id:Ee,tenant_id:Re,plan:Te,signup:je,quantity:Oe},{rejectWithValue:Me})=>{var De,$e;try{return await subscriptionService.confirmPayment({session_id:Ee,tenant_id:Re,plan:Te,signup:je,quantity:Oe})}catch(Be){console.log("Full error object:",Be);const Ue={message:(Be==null?void 0:Be.message)||(($e=(De=Be.response)==null?void 0:De.data)==null?void 0:$e.message)||"Failed to confirm payment",status:Be==null?void 0:Be.status,data:Be==null?void 0:Be.data};return Me(Ue)}}),fetchLicensePool=createAsyncThunk("subscription/fetchLicensePool",async(Ee=!1,{rejectWithValue:Re})=>{var Te,je;try{return await subscriptionService.getLicensePool(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch license pool")}}),purchaseLicenses=createAsyncThunk("subscription/purchaseLicenses",async({quantity:Ee},{rejectWithValue:Re})=>{var Te,je;try{return await subscriptionService.purchaseLicenses({quantity:Ee})}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to purchase licenses")}}),confirmLicensePurchase=createAsyncThunk("subscription/confirmLicensePurchase",async({session_id:Ee},{rejectWithValue:Re})=>{var Te,je;try{return await subscriptionService.confirmLicensePurchase({session_id:Ee})}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to confirm license purchase")}}),initialState$5={subscription:null,usage:null,billingHistory:[],plans:[],licensePool:null,loading:!1,actionLoading:!1,error:null,checkoutSession:null,licenseCheckoutSession:null,pendingSignupData:null,purchaseSourcePage:null},subscriptionSlice=createSlice({name:"subscription",initialState:initialState$5,reducers:{clearError:Ee=>{Ee.error=null},setPendingSignupData:(Ee,Re)=>{Ee.pendingSignupData=Re.payload}
460,clearPendingSignupData:Ee=>{Ee.pendingSignupData=null},setPurchaseSourcePage:(Ee,Re)=>{Ee.purchaseSourcePage=Re.payload},clearPurchaseSourcePage:Ee=>{Ee.purchaseSourcePage=null}},extraReducers:Ee=>{Ee.addCase(fetchSubscription.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchSubscription.fulfilled,(Re,Te)=>{Re.loading=!1,Re.subscription=Te.payload,Re.plans=Te.payload.tiers||[]}).addCase(fetchSubscription.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchUsageStats.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchUsageStats.fulfilled,(Re,Te)=>{Re.loading=!1,Re.usage=Te.payload}).addCase(fetchUsageStats.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchBillingHistory$1.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchBillingHistory$1.fulfilled,(Re,Te)=>{Re.loading=!1,Re.billingHistory=Te.payload}).addCase(fetchBillingHistory$1.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(upgradePlan.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(upgradePlan.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.subscription=Te.payload}
460).addCase(upgradePlan.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(downgradePlan.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(downgradePlan.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.subscription=Te.payload}).addCase(downgradePlan.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(cancelSubscription.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(cancelSubscription.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.subscription=Te.payload}).addCase(cancelSubscription.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(downloadInvoice.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(downloadInvoice.fulfilled,Re=>{Re.actionLoading=!1}).addCase(downloadInvoice.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(fetchAvailablePlans.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchAvailablePlans.fulfilled,(Re,Te)=>{Re.loading=!1,Re.plans=Te.payload||[]}).addCase(fetchAvailablePlans.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(createCheckoutSession.pending,Re=>{Re.actionLoading=!0,Re.error=null,Re.checkoutSession=null}).addCase(createCheckoutSession.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.checkoutSession=Te.payload}
460).addCase(createCheckoutSession.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(confirmPayment.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(confirmPayment.fulfilled,Re=>{Re.actionLoading=!1,Re.checkoutSession=null,Re.pendingSignupData=null}).addCase(confirmPayment.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(fetchLicensePool.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchLicensePool.fulfilled,(Re,Te)=>{Re.loading=!1,Re.licensePool=Te.payload}).addCase(fetchLicensePool.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(purchaseLicenses.pending,Re=>{Re.actionLoading=!0,Re.error=null,Re.licenseCheckoutSession=null}).addCase(purchaseLicenses.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.licenseCheckoutSession=Te.payload}).addCase(purchaseLicenses.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(confirmLicensePurchase.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(confirmLicensePurchase.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Te.payload.subscription&&(Re.licensePool={...Re.licensePool,licenses:Te.payload.subscription.licenses}),Re.licenseCheckoutSession=null}).addCase(confirmLicensePurchase.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload})}}),{clearError:clearError$3,setPendingSignupData,clearPendingSignupData,setPurchaseSourcePage,clearPurchaseSourcePage}=subscriptionSlice.actions,selectSubscription=Ee=>Ee.subscription.subscription,selectUsage=Ee=>Ee.subscription.usage,selectBillingHistory=Ee=>Ee.subscription.billingHistory,selectPlans=Ee=>Ee.subscription.plans,selectLicensePool=Ee=>Ee.subscription.licensePool,selectPendingSignupData=Ee=>Ee.subscription.pendingSignupData,selectPurchaseSourcePage=Ee=>Ee.subscription.purchaseSourcePage,selectSubscriptionLoading=Ee=>Ee.subscription.loading,selectSubscriptionActionLoading=Ee=>Ee.subscription.actionLoading,selectSubscriptionError=Ee=>Ee.subscription.error,subscriptionReducer=subscriptionSlice.reducer,fetchTenants$1=createAsyncThunk("superAdmin/fetchTenants",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await superAdminService.getTenants()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch tenants")}}),createTenant$1=createAsyncThunk("superAdmin/createTenant",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await superAdminService.createTenant(Ee)}catch(Oe){const Me=((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to create tenant";return Re(Me==="adminEmail already exists"?"Email already registered":Me)}}),assignTenantAdmin=createAsyncThunk("superAdmin/assignTenantAdmin",async({tenantId:Ee,adminEmail:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await superAdminService.assignTenantAdmin(Ee,Re)}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to assign tenant admin")}}),updateTenant$1=createAsyncThunk("superAdmin/updateTenant",async({tenantId:Ee,updates:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await superAdminService.updateTenant(Ee,Re)}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to update tenant")}}),suspendTenant$1=createAsyncThunk("superAdmin/suspendTenant",async({tenantId:Ee,reason:Re},{rejectWithValue:Te})=>{var je,Oe;try{return await superAdminService.suspendTenant(Ee,Re)}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to suspend tenant")}}),activateTenant$1=createAsyncThunk("superAdmin/activateTenant",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await superAdminService.activateTenant(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to activate tenant")}}),deleteTenant$1=createAsyncThunk("superAdmin/deleteTenant",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{const Oe=await superAdminService.deleteTenant(Ee);return{tenantId:Ee}}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to delete tenant")}}),fetchTenantStats=createAsyncThunk("superAdmin/fetchTenantStats",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await superAdminService.getTenantStats(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch tenant stats")}}),fetchTenantSubscription=createAsyncThunk("superAdmin/fetchTenantSubscription",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await superAdminService.getTenantSubscription(Ee)}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch tenant subscription")}}),initialState$4={tenants:[],selectedTenant:null,tenantStats:null,tenantSubscription:null,loading:!1,actionLoading:!1,error:null,searchQuery:"",planFilter:"all",statusFilter:"all"},superAdminSlice=createSlice({name:"superAdmin",initialState:initialState$4,reducers:{setSearchQuery:(Ee,Re)=>{Ee.searchQuery=Re.payload},setPlanFilter:(Ee,Re)=>{Ee.planFilter=Re.payload},setStatusFilter:(Ee,Re)=>{Ee.statusFilter=Re.payload},setSelectedTenant:(Ee,Re)=>{Ee.selectedTenant=Re.payload},clearSelectedTenant:Ee=>{Ee.selectedTenant=null,Ee.tenantStats=null,Ee.tenantSubscription=null},clearError:Ee=>{Ee.error=null},clearFilters:Ee=>{Ee.searchQuery="",Ee.planFilter="all",Ee.statusFilter="all"}},extraReducers:Ee=>{Ee.addCase(fetchTenants$1.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchTenants$1.fulfilled,(Re,Te)=>{Re.loading=!1,Re.tenants=Te.payload}
460).addCase(fetchTenants$1.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(createTenant$1.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(createTenant$1.fulfilled,(Re,Te)=>{Re.actionLoading=!1,Re.tenants.push(Te.payload)}).addCase(createTenant$1.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(assignTenantAdmin.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(assignTenantAdmin.fulfilled,(Re,Te)=>{var Oe;Re.actionLoading=!1;const je=Re.tenants.findIndex(Me=>(Me.tenant_id||Me.id)===Te.payload.tenant_id);je!==-1&&(Re.tenants[je]=Te.payload),((Oe=Re.selectedTenant)==null?void 0:Oe.tenant_id)===Te.payload.tenant_id&&(Re.selectedTenant=Te.payload)}).addCase(assignTenantAdmin.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(updateTenant$1.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(updateTenant$1.fulfilled,(Re,Te)=>{var Oe,Me;Re.actionLoading=!1;const je=Re.tenants.findIndex(De=>(De.tenant_id||De.id)===(Te.payload.tenant_id||Te.payload.id));je!==-1&&(Re.tenants[je]=Te.payload),(((Oe=Re.selectedTenant)==null?void 0:Oe.tenant_id)||((Me=Re.selectedTenant)==null?void 0:Me.id))===(Te.payload.tenant_id||Te.payload.id)&&(Re.selectedTenant=Te.payload)}).addCase(updateTenant$1.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(suspendTenant$1.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(suspendTenant$1.fulfilled,(Re,Te)=>{var Oe,Me;Re.actionLoading=!1;const je=Re.tenants.findIndex(De=>(De.tenant_id||De.id)===(Te.payload.tenant_id||Te.payload.id));je!==-1&&(Re.tenants[je]=Te.payload),(((Oe=Re.selectedTenant)==null?void 0:Oe.tenant_id)||((Me=Re.selectedTenant)==null?void 0:Me.id))===(Te.payload.tenant_id||Te.payload.id)&&(Re.selectedTenant=Te.payload)}).addCase(suspendTenant$1.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(activateTenant$1.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(activateTenant$1.fulfilled,(Re,Te)=>{var Oe,Me;Re.actionLoading=!1;const je=Re.tenants.findIndex(De=>(De.tenant_id||De.id)===(Te.payload.tenant_id||Te.payload.id));je!==-1&&(Re.tenants[je]=Te.payload),(((Oe=Re.selectedTenant)==null?void 0:Oe.tenant_id)||((Me=Re.selectedTenant)==null?void 0:Me.id))===(Te.payload.tenant_id||Te.payload.id)&&(Re.selectedTenant=Te.payload)}).addCase(activateTenant$1.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(deleteTenant$1.pending,Re=>{Re.actionLoading=!0,Re.error=null}).addCase(deleteTenant$1.fulfilled,(Re,Te)=>{var je,Oe;Re.actionLoading=!1,Re.tenants=Re.tenants.filter(Me=>(Me.tenant_id||Me.id)!==Te.payload.tenantId),(((je=Re.selectedTenant)==null?void 0:je.tenant_id)||((Oe=Re.selectedTenant)==null?void 0:Oe.id))===Te.payload.tenantId&&(Re.selectedTenant=null,Re.tenantStats=null,Re.tenantSubscription=null)}).addCase(deleteTenant$1.rejected,(Re,Te)=>{Re.actionLoading=!1,Re.error=Te.payload}).addCase(fetchTenantStats.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchTenantStats.fulfilled,(Re,Te)=>{Re.loading=!1,Re.tenantStats=Te.payload}).addCase(fetchTenantStats.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchTenantSubscription.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchTenantSubscription.fulfilled,(Re,Te)=>{Re.loading=!1,Re.tenantSubscription=Te.payload}
460).addCase(fetchTenantSubscription.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload})}}),{setSearchQuery,setPlanFilter,setStatusFilter,setSelectedTenant:setSelectedTenant$1,clearSelectedTenant:clearSelectedTenant$1,clearError:clearError$2,clearFilters}=superAdminSlice.actions,superAdminReducer=superAdminSlice.reducer,systemHealthService={getSystemHealth:async()=>(await cachedAxios.get("/superadmin/health/system")).data,getPipelineStatus:async()=>(await cachedAxios.get("/superadmin/health/pipeline")).data,getErrorLogs:async(Ee=100,Re="all")=>{const Te={limit:Ee};return Re!=="all"&&(Te.severity=Re),(await cachedAxios.get("/superadmin/health/errors",{params:Te})).data},getWorkerStatus:async()=>(await cachedAxios.get("/superadmin/health/workers")).data,getDatabaseHealth:async()=>(await cachedAxios.get("/superadmin/health/database")).data,getStorageHealth:async()=>(await cachedAxios.get("/superadmin/health/storage")).data,getApiMetrics:async()=>(await cachedAxios.get("/superadmin/health/api-metrics")).data},fetchSystemHealth=createAsyncThunk("systemHealth/fetchSystemHealth",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await systemHealthService.getSystemHealth()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch system health")}}),fetchPipelineStatus=createAsyncThunk("systemHealth/fetchPipelineStatus",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await systemHealthService.getPipelineStatus()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch pipeline status")}}),fetchErrorLogs=createAsyncThunk("systemHealth/fetchErrorLogs",async({limit:Ee=100,severity:Re="all"}={},{rejectWithValue:Te})=>{var je,Oe;try{return await systemHealthService.getErrorLogs(Ee,Re)}catch(Me){return Te(((Oe=(je=Me.response)==null?void 0:je.data)==null?void 0:Oe.message)||"Failed to fetch error logs")}}),fetchWorkerStatus=createAsyncThunk("systemHealth/fetchWorkerStatus",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await systemHealthService.getWorkerStatus()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch worker status")}}),fetchDatabaseHealth=createAsyncThunk("systemHealth/fetchDatabaseHealth",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await systemHealthService.getDatabaseHealth()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch database health")}}),fetchStorageHealth=createAsyncThunk("systemHealth/fetchStorageHealth",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await systemHealthService.getStorageHealth()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch storage health")}}),fetchApiMetrics=createAsyncThunk("systemHealth/fetchApiMetrics",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await systemHealthService.getApiMetrics()}catch(Oe){return Re(((je=(Te=Oe.response)==null?void 0:Te.data)==null?void 0:je.message)||"Failed to fetch API metrics")}}),initialState$3={systemHealth:null,pipelineStatus:null,errorLogs:[],workerStatus:null,databaseHealth:null,storageHealth:null,apiMetrics:null,loading:!1,error:null,lastRefresh:null},systemHealthSlice=createSlice({name:"systemHealth",initialState:initialState$3,reducers:{clearError:Ee=>{Ee.error=null},setLastRefresh:Ee=>{Ee.lastRefresh=new Date().toISOString()}},extraReducers:Ee=>{Ee.addCase(fetchSystemHealth.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchSystemHealth.fulfilled,(Re,Te)=>{Re.loading=!1,Re.systemHealth=Te.payload,Re.lastRefresh=new Date().toISOString()}
460).addCase(fetchSystemHealth.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchPipelineStatus.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchPipelineStatus.fulfilled,(Re,Te)=>{Re.loading=!1,Re.pipelineStatus=Te.payload}).addCase(fetchPipelineStatus.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchErrorLogs.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchErrorLogs.fulfilled,(Re,Te)=>{Re.loading=!1,Re.errorLogs=Te.payload}).addCase(fetchErrorLogs.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchWorkerStatus.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchWorkerStatus.fulfilled,(Re,Te)=>{Re.loading=!1,Re.workerStatus=Te.payload}).addCase(fetchWorkerStatus.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchDatabaseHealth.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchDatabaseHealth.fulfilled,(Re,Te)=>{Re.loading=!1,Re.databaseHealth=Te.payload}).addCase(fetchDatabaseHealth.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchStorageHealth.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchStorageHealth.fulfilled,(Re,Te)=>{Re.loading=!1,Re.storageHealth=Te.payload}
460).addCase(fetchStorageHealth.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchApiMetrics.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchApiMetrics.fulfilled,(Re,Te)=>{Re.loading=!1,Re.apiMetrics=Te.payload}).addCase(fetchApiMetrics.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload})}}),{clearError:clearError$1,setLastRefresh}=systemHealthSlice.actions,systemHealthReducer=systemHealthSlice.reducer,fetchTenants=createAsyncThunk("platformAdmin/fetchTenants",async(Ee=!1,{rejectWithValue:Re})=>{try{return await platformAdminService.getTenants(Ee)}catch(Te){return Re(Te.message||"Failed to fetch tenants")}}),createTenant=createAsyncThunk("platformAdmin/createTenant",async(Ee,{rejectWithValue:Re})=>{var Te,je;try{return await platformAdminService.createTenant(Ee)}catch(Oe){console.error("Create Tenant Error:",Oe);let Me="Failed to create tenant";return typeof Oe=="string"?Me=Oe:Oe!=null&&Oe.message?Me=Oe.message:(Te=Oe==null?void 0:Oe.data)!=null&&Te.error?Me=Oe.data.error:(je=Oe==null?void 0:Oe.data)!=null&&je.message&&(Me=Oe.data.message),Re(Me==="adminEmail already exists"?"Email already registered":Me)}}),updateTenant=createAsyncThunk("platformAdmin/updateTenant",async({tenantId:Ee,tenantData:Re},{rejectWithValue:Te})=>{try{return await platformAdminService.updateTenant(Ee,Re)}catch(je){return Te(je.message||"Failed to update tenant")}}),deleteTenant=createAsyncThunk("platformAdmin/deleteTenant",async({tenantId:Ee,adminId:Re},{rejectWithValue:Te})=>{try{return{...await platformAdminService.deleteTenant(Ee,Re),tenantId:Ee}}catch(je){return Te(je.message||"Failed to delete tenant")}}),suspendTenant=createAsyncThunk("platformAdmin/suspendTenant",async({tenantId:Ee,adminId:Re,reason:Te},{rejectWithValue:je})=>{try{return{...await platformAdminService.suspendTenant(Ee,Re,Te),tenantId:Ee}}catch(Oe){return je(Oe.message||"Failed to suspend tenant")}}),activateTenant=createAsyncThunk("platformAdmin/activateTenant",async({tenantId:Ee,adminId:Re},{rejectWithValue:Te})=>{try{return{...await platformAdminService.activateTenant(Ee,Re),tenantId:Ee}}catch(je){return Te(je.message||"Failed to activate tenant")}}),fetchSubscriptionsOverview=createAsyncThunk("platformAdmin/fetchSubscriptionsOverview",async(Ee,{rejectWithValue:Re})=>{try{return await platformAdminService.getSubscriptionsOverview(Ee)}catch(Te){return Re(Te.message||"Failed to fetch subscriptions")}}),fetchSubscriptionPlans=createAsyncThunk("platformAdmin/fetchSubscriptionPlans",async(Ee=!1,{rejectWithValue:Re})=>{try{return await platformAdminService.getSubscriptionPlans(Ee)}catch(Te){return Re(Te.message||"Failed to fetch subscription plans")}}),assignSubscription=createAsyncThunk("platformAdmin/assignSubscription",async({tenantId:Ee,subscriptionData:Re},{rejectWithValue:Te})=>{try{return await platformAdminService.assignSubscription(Ee,Re)}catch(je){return Te(je.message||"Failed to assign subscription")}}),fetchBillingHistory=createAsyncThunk("platformAdmin/fetchBillingHistory",async(Ee,{rejectWithValue:Re})=>{try{return await platformAdminService.getBillingHistory()}catch(Te){return Re(Te.message||"Failed to fetch billing history")}}),fetchHealthOverview=createAsyncThunk("platformAdmin/fetchHealthOverview",async(Ee=!1,{rejectWithValue:Re})=>{try{return await platformAdminService.getHealthOverview(Ee)}catch(Te){return Re(Te.message||"Failed to fetch health overview")}}),fetchHealthResources=createAsyncThunk("platformAdmin/fetchHealthResources",async(Ee=!1,{rejectWithValue:Re})=>{try{return await platformAdminService.getHealthResources(Ee)}catch(Te){return Re(Te.message||"Failed to fetch health resources")}}),fetchHealthConnectivity=createAsyncThunk("platformAdmin/fetchHealthConnectivity",async(Ee=!1,{rejectWithValue:Re})=>{try{return await platformAdminService.getHealthConnectivity(Ee)}catch(Te){return Re(Te.message||"Failed to fetch connectivity status")}}),fetchHealthPerformance=createAsyncThunk("platformAdmin/fetchHealthPerformance",async({period:Ee="day",skipCache:Re=!1}={},{rejectWithValue:Te})=>{try{return await platformAdminService.getHealthPerformance(Ee,Re)}catch(je){return Te(je.message||"Failed to fetch performance metrics")}}),fetchStorageStats=createAsyncThunk("platformAdmin/fetchStorageStats",async(Ee=!1,{rejectWithValue:Re})=>{try{return await platformAdminService.getStorageStats(Ee)}catch(Te){return Re(Te.message||"Failed to fetch storage stats")}}),fetchAuditLogs=createAsyncThunk("platformAdmin/fetchAuditLogs",async(Ee=!1,{rejectWithValue:Re})=>{try{return await platformAdminService.getAuditLogs(Ee)}catch(Te){return Re(Te.message||"Failed to fetch audit logs")}}),fetchAuditLogById=createAsyncThunk("platformAdmin/fetchAuditLogById",async(Ee,{rejectWithValue:Re})=>{try{return await platformAdminService.getAuditLogById(Ee)}catch(Te){return Re(Te.message||"Failed to fetch audit log details")}}),fetchGeneralSettings=createAsyncThunk("platformAdmin/fetchGeneralSettings",async(Ee,{rejectWithValue:Re})=>{try{return await platformAdminService.getGeneralSettings(Ee)}catch(Te){return Re(Te.message||"Failed to fetch general settings")}}),updateGeneralSettings=createAsyncThunk("platformAdmin/updateGeneralSettings",async(Ee,{rejectWithValue:Re})=>{try{return await platformAdminService.updateGeneralSettings(Ee)}catch(Te){return Re(Te.message||"Failed to update general settings")}}),fetchRateLimits=createAsyncThunk("platformAdmin/fetchRateLimits",async(Ee,{rejectWithValue:Re})=>{try{return await platformAdminService.getRateLimits()}catch(Te){return Re(Te.message||"Failed to fetch rate limits")}}),updateRateLimits=createAsyncThunk("platformAdmin/updateRateLimits",async(Ee,{rejectWithValue:Re})=>{try{return await platformAdminService.updateRateLimits(Ee)}catch(Te){return Re(Te.message||"Failed to update rate limits")}}),initialState$2={tenants:[],tenantsStats:null,selectedTenant:null,subscriptions:[],subscriptionsStats:null,subscriptionPlans:[],billingHistory:[],healthOverview:null,healthResources:null,healthConnectivity:null,healthPerformance:null,storageStats:null,auditLogs:[],selectedAuditLog:null,generalSettings:null,rateLimits:null,loading:!1,tenantsLoading:!1,subscriptionsLoading:!1,healthLoading:!1,auditLogsLoading:!1,settingsLoading:!1,error:null,tenantsError:null,subscriptionsError:null,healthError:null,auditLogsError:null,settingsError:null},platformAdminSlice=createSlice({name:"platformAdmin",initialState:initialState$2,reducers:{clearError:Ee=>{Ee.error=null,Ee.tenantsError=null,Ee.subscriptionsError=null,Ee.healthError=null,Ee.auditLogsError=null,Ee.settingsError=null},setSelectedTenant:(Ee,Re)=>{Ee.selectedTenant=Re.payload},clearSelectedTenant:Ee=>{Ee.selectedTenant=null},setSelectedAuditLog:(Ee,Re)=>{Ee.selectedAuditLog=Re.payload},clearSelectedAuditLog:Ee=>{Ee.selectedAuditLog=null}},extraReducers:Ee=>{Ee.addCase(fetchTenants.pending,Re=>{Re.tenantsLoading=!0,Re.tenantsError=null}).addCase(fetchTenants.fulfilled,(Re,Te)=>{Re.tenantsLoading=!1;const je=Te.payload.tenants;let Oe=[];Array.isArray(je)?Oe=je:je&&typeof je=="object"&&(Oe=Object.values(je)),Re.tenants=Oe.filter(Me=>{const De=Me.subscriptionPlanCode||Me.subscription;return!(De&&De.toUpperCase()==="ENTERPRISE")}),Re.tenantsStats=Te.payload.stats||null}
460).addCase(fetchTenants.rejected,(Re,Te)=>{Re.tenantsLoading=!1,Re.tenantsError=Te.payload}).addCase(createTenant.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(createTenant.fulfilled,(Re,Te)=>{Re.loading=!1,Te.payload.tenant&&Re.tenants.push(Te.payload.tenant)}).addCase(createTenant.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(updateTenant.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(updateTenant.fulfilled,(Re,Te)=>{if(Re.loading=!1,Te.payload.tenant){const je=Re.tenants.findIndex(Oe=>Oe.id===Te.payload.tenant.id);je!==-1&&(Re.tenants[je]=Te.payload.tenant)}}).addCase(updateTenant.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(deleteTenant.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(deleteTenant.fulfilled,(Re,Te)=>{Re.loading=!1,Re.tenants=Re.tenants.filter(je=>je.id!==Te.payload.tenantId)}).addCase(deleteTenant.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(suspendTenant.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(suspendTenant.fulfilled,(Re,Te)=>{Re.loading=!1;const je=Re.tenants.find(Oe=>Oe.id===Te.payload.tenantId);je&&(je.status="Suspended")}).addCase(suspendTenant.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(activateTenant.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(activateTenant.fulfilled,(Re,Te)=>{Re.loading=!1;const je=Re.tenants.find(Oe=>Oe.id===Te.payload.tenantId);je&&(je.status="Active")}).addCase(activateTenant.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchSubscriptionsOverview.pending,Re=>{Re.subscriptionsLoading=!0,Re.subscriptionsError=null}).addCase(fetchSubscriptionsOverview.fulfilled,(Re,Te)=>{Re.subscriptionsLoading=!1,Re.subscriptions=Te.payload.subscriptions||[],Re.subscriptionsStats=Te.payload.stats||null}).addCase(fetchSubscriptionsOverview.rejected,(Re,Te)=>{Re.subscriptionsLoading=!1,Re.subscriptionsError=Te.payload}).addCase(fetchSubscriptionPlans.pending,Re=>{Re.subscriptionsLoading=!0,Re.subscriptionsError=null}).addCase(fetchSubscriptionPlans.fulfilled,(Re,Te)=>{Re.subscriptionsLoading=!1,Re.subscriptionPlans=Te.payload.plans||[]}
460).addCase(fetchSubscriptionPlans.rejected,(Re,Te)=>{Re.subscriptionsLoading=!1,Re.subscriptionsError=Te.payload}).addCase(assignSubscription.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(assignSubscription.fulfilled,Re=>{Re.loading=!1}).addCase(assignSubscription.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchBillingHistory.pending,Re=>{Re.subscriptionsLoading=!0,Re.subscriptionsError=null}).addCase(fetchBillingHistory.fulfilled,(Re,Te)=>{Re.subscriptionsLoading=!1;const je=Te.payload;Array.isArray(je)?Re.billingHistory=je:je!=null&&je.billingRecords&&Array.isArray(je.billingRecords)?Re.billingHistory=je.billingRecords:je!=null&&je.records&&Array.isArray(je.records)?Re.billingHistory=je.records:je!=null&&je.data&&Array.isArray(je.data)?Re.billingHistory=je.data:Re.billingHistory=[]}).addCase(fetchBillingHistory.rejected,(Re,Te)=>{Re.subscriptionsLoading=!1,Re.subscriptionsError=Te.payload}).addCase(fetchHealthOverview.pending,Re=>{Re.healthLoading=!0,Re.healthError=null}).addCase(fetchHealthOverview.fulfilled,(Re,Te)=>{Re.healthLoading=!1,Re.healthOverview=Te.payload}).addCase(fetchHealthOverview.rejected,(Re,Te)=>{Re.healthLoading=!1,Re.healthError=Te.payload}).addCase(fetchHealthResources.pending,Re=>{Re.healthLoading=!0,Re.healthError=null}).addCase(fetchHealthResources.fulfilled,(Re,Te)=>{Re.healthLoading=!1,Re.healthResources=Te.payload}).addCase(fetchHealthResources.rejected,(Re,Te)=>{Re.healthLoading=!1,Re.healthError=Te.payload}).addCase(fetchHealthConnectivity.pending,Re=>{Re.healthLoading=!0,Re.healthError=null}).addCase(fetchHealthConnectivity.fulfilled,(Re,Te)=>{Re.healthLoading=!1,Re.healthConnectivity=Te.payload}).addCase(fetchHealthConnectivity.rejected,(Re,Te)=>{Re.healthLoading=!1,Re.healthError=Te.payload}).addCase(fetchHealthPerformance.pending,Re=>{Re.healthLoading=!0,Re.healthError=null}).addCase(fetchHealthPerformance.fulfilled,(Re,Te)=>{Re.healthLoading=!1,Re.healthPerformance=Te.payload}).addCase(fetchHealthPerformance.rejected,(Re,Te)=>{Re.healthLoading=!1,Re.healthError=Te.payload}).addCase(fetchStorageStats.pending,Re=>{Re.healthLoading=!0,Re.healthError=null}).addCase(fetchStorageStats.fulfilled,(Re,Te)=>{Re.healthLoading=!1,Re.storageStats=Te.payload}).addCase(fetchStorageStats.rejected,(Re,Te)=>{Re.healthLoading=!1,Re.healthError=Te.payload}).addCase(fetchAuditLogs.pending,Re=>{Re.auditLogsLoading=!0,Re.auditLogsError=null}).addCase(fetchAuditLogs.fulfilled,(Re,Te)=>{Re.auditLogsLoading=!1,Re.auditLogs=Te.payload}).addCase(fetchAuditLogs.rejected,(Re,Te)=>{Re.auditLogsLoading=!1,Re.auditLogsError=Te.payload}).addCase(fetchAuditLogById.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchAuditLogById.fulfilled,(Re,Te)=>{Re.loading=!1,Re.selectedAuditLog=Te.payload}).addCase(fetchAuditLogById.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchGeneralSettings.pending,Re=>{Re.settingsLoading=!0,Re.settingsError=null}).addCase(fetchGeneralSettings.fulfilled,(Re,Te)=>{Re.settingsLoading=!1,Re.generalSettings=Te.payload}).addCase(fetchGeneralSettings.rejected,(Re,Te)=>{Re.settingsLoading=!1,Re.settingsError=Te.payload}).addCase(updateGeneralSettings.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(updateGeneralSettings.fulfilled,(Re,Te)=>{Re.loading=!1,Re.generalSettings=Te.payload.settings||Te.payload}).addCase(updateGeneralSettings.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(fetchRateLimits.pending,Re=>{Re.settingsLoading=!0,Re.settingsError=null}).addCase(fetchRateLimits.fulfilled,(Re,Te)=>{Re.settingsLoading=!1,Re.rateLimits=Te.payload}).addCase(fetchRateLimits.rejected,(Re,Te)=>{Re.settingsLoading=!1,Re.settingsError=Te.payload}).addCase(updateRateLimits.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(updateRateLimits.fulfilled,(Re,Te)=>{Re.loading=!1,Re.rateLimits=Te.payload.rateLimits||Te.payload}).addCase(updateRateLimits.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload})}}),{clearError,setSelectedTenant,clearSelectedTenant,setSelectedAuditLog,clearSelectedAuditLog}=platformAdminSlice.actions,platformAdminReducer=platformAdminSlice.reducer,CORPORATE_EMAIL_REQUIRED_MSG="Please use your corporate email address to register";let cachedBlockedDomains=null;const extractDomain=Ee=>{if(!Ee||typeof Ee!="string")return null;const Re=Ee.trim().toLowerCase().split("@");return Re.length!==2||!Re[1]?null:Re[1]},normalizeDomainList=Ee=>[...new Set((Array.isArray(Ee)?Ee:[]).map(Re=>
460String(Re||"").trim().toLowerCase().replace(/^@+/,"")).filter(Boolean))],setBlockedEmailDomains=Ee=>{if(Array.isArray(Ee)){cachedBlockedDomains=normalizeDomainList(Ee);return}cachedBlockedDomains=[]},getBlockedEmailDomains=()=>cachedBlockedDomains==null?[]:[...cachedBlockedDomains],validateCorporateEmail=(Ee,Re)=>{if(!Ee||!String(Ee).trim())return{isValid:!1,error:"Email address is required"};const Te=String(Ee).trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Te))return{isValid:!1,error:"Invalid email address"};const je=extractDomain(Te);return je?(Array.isArray(Re)?normalizeDomainList(Re):getBlockedEmailDomains()).includes(je)?{isValid:!1,error:CORPORATE_EMAIL_REQUIRED_MSG}:{isValid:!0,error:null}:{isValid:!1,error:"Invalid email address"}},validateSSOEmail=(Ee,Re)=>validateCorporateEmail(Ee,Re),maintenanceService={checkMaintenanceStatus:async()=>{try{const Re=(await cachedAxios.get("/public/settings/general",{})).data.settings||{},Te=Array.isArray(Re.blockedEmailDomains)?Re.blockedEmailDomains:[];return setBlockedEmailDomains(Te),{maintenanceMode:Re.maintenanceMode||!1,allowNewSignups:Re.allowNewSignups||!1,captchaEnabled:!!(Re.captchaEnabled??Re.captcha_enabled),allowedFileTypes:Re.allowedFileTypes||FILE_UPLOAD.ALLOWED_EXTENSIONS,maxFileSize:Re.maxFileSize||52428800,supportEmail:Re.supportEmail||"",blockedEmailDomains:Te,blockedEmailDomainsLoaded:Array.isArray(Re.blockedEmailDomains)}}catch(Ee){return console.error("Failed to check maintenance status:",Ee),setBlockedEmailDomains([]),{maintenanceMode:!1,allowNewSignups:!0,captchaEnabled:!1,allowedFileTypes:FILE_UPLOAD.ALLOWED_EXTENSIONS,maxFileSize:52428800,blockedEmailDomains:[],blockedEmailDomainsLoaded:!1}}}},fetchMaintenanceStatus=createAsyncThunk("maintenance/fetchStatus",async(Ee,{rejectWithValue:Re})=>{try{return await maintenanceService.checkMaintenanceStatus()}catch(Te){return Re(Te.message)}}),maintenanceSlice=createSlice({name:"maintenance",initialState:{loading:!1,maintenanceMode:!1,allowNewSignups:!0,captchaEnabled:!1,allowedFileTypes:FILE_UPLOAD.ALLOWED_EXTENSIONS,maxFileSize:52428800,supportEmail:"",blockedEmailDomains:[],blockedEmailDomainsLoaded:!1,error:null},reducers:{},extraReducers:Ee=>{Ee.addCase(fetchMaintenanceStatus.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchMaintenanceStatus.fulfilled,(Re,Te)=>{Re.loading=!1,Re.maintenanceMode=Te.payload.maintenanceMode,Re.allowNewSignups=Te.payload.allowNewSignups,Re.captchaEnabled=Te.payload.captchaEnabled??!1,Re.allowedFileTypes=Te.payload.allowedFileTypes,Re.maxFileSize=Te.payload.maxFileSize,Re.supportEmail=Te.payload.supportEmail||"",Re.blockedEmailDomains=Array.isArray(Te.payload.blockedEmailDomains)?Te.payload.blockedEmailDomains:[],Re.blockedEmailDomainsLoaded=!!Te.payload.blockedEmailDomainsLoaded,setBlockedEmailDomains(Re.blockedEmailDomains)}).addCase(fetchMaintenanceStatus.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload,Re.maintenanceMode=!1,Re.allowNewSignups=!0,Re.captchaEnabled=!1,Re.allowedFileTypes=FILE_UPLOAD.ALLOWED_EXTENSIONS,Re.maxFileSize=52428800,Re.blockedEmailDomains=[],Re.blockedEmailDomainsLoaded=!1,setBlockedEmailDomains([])})}}),selectCaptchaEnabled=Ee=>{var Re;return!!((Re=Ee.maintenance)!=null&&Re.captchaEnabled)},selectBlockedEmailDomains=Ee=>{var Re;return Array.isArray((Re=Ee.maintenance)==null?void 0:Re.blockedEmailDomains)?Ee.maintenance.blockedEmailDomains:[]},maintenanceReducer=maintenanceSlice.reducer,platformPlansService={getAllPlans:async(Ee=!1)=>(await cachedAxios.get("/superadmin/plans",{...Ee&&{cache:{enabled:!1}}})).data,updatePlan:async(Ee,Re)=>(await cachedAxios.put(`/superadmin/plans/${Ee}`,Re)).data},fetchAllPlans=createAsyncThunk("platformPlans/fetchAllPlans",async(Ee,{rejectWithValue:Re})=>{var Te;try{return await platformPlansService.getAllPlans(Ee)}catch(je){const Oe=(je==null?void 0:je.message)||((Te=je==null?void 0:je.data)==null?void 0:Te.error)||"Failed to fetch plans";return Re(Oe)}}),updatePlan=createAsyncThunk("platformPlans/updatePlan",async({planId:Ee,planData:Re},{rejectWithValue:Te})=>{var je;try{const Oe=Ee==="SAAS"?"SaaS":Ee,Me={...Re,id:Oe};return await platformPlansService.updatePlan(Oe,Me)}
460catch(Oe){const Me=(Oe==null?void 0:Oe.message)||((je=Oe==null?void 0:Oe.data)==null?void 0:je.error)||"Failed to update plan";return Te(Me)}}),platformPlansSlice=createSlice({name:"platformPlans",initialState:{plans:{},loading:!1,error:null,updateStatus:null},reducers:{clearUpdateStatus(Ee){Ee.updateStatus=null}},extraReducers:Ee=>{Ee.addCase(fetchAllPlans.pending,Re=>{Re.loading=!0,Re.error=null}).addCase(fetchAllPlans.fulfilled,(Re,Te)=>{Re.loading=!1;const je=Array.isArray(Te.payload)?Te.payload:Te.payload.plans||[];Re.plans=je.reduce((Oe,Me)=>(Me.id&&(Oe[Me.id]=Me),Oe),{})}).addCase(fetchAllPlans.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload}).addCase(updatePlan.pending,Re=>{Re.loading=!0,Re.error=null,Re.updateStatus=null}).addCase(updatePlan.fulfilled,(Re,Te)=>{Re.loading=!1,Te.payload&&Te.payload.plan&&Te.payload.plan.id&&(Re.plans[Te.payload.plan.id]=Te.payload.plan),Re.updateStatus="success"}).addCase(updatePlan.rejected,(Re,Te)=>{Re.loading=!1,Re.error=Te.payload,Re.updateStatus="error"})}}),{clearUpdateStatus}=platformPlansSlice.actions,platformPlansReducer=platformPlansSlice.reducer,MAX_ATTEMPTS=5,LOCKOUT_DURATION_MS=5*60*1e3,loginAttemptsSlice=createSlice({name:"loginAttempts",initialState:{attempts:{}},reducers:{recordFailedAttempt:(Ee,Re)=>{const Te=Re.payload.toLowerCase();Ee.attempts[Te]||(Ee.attempts[Te]={count:0,lockedUntil:null}),Ee.attempts[Te].count+=1,Ee.attempts[Te].count>=MAX_ATTEMPTS&&(Ee.attempts[Te].lockedUntil=Date.now()+LOCKOUT_DURATION_MS)},clearAttempts:(Ee,Re)=>{const Te=Re.payload.toLowerCase();delete Ee.attempts[Te]},checkLockExpiry:(Ee,Re)=>{var je;const Te=Re.payload.toLowerCase();(je=Ee.attempts[Te])!=null&&je.lockedUntil&&Date.now()>=Ee.attempts[Te].lockedUntil&&delete Ee.attempts[Te]}}}),{recordFailedAttempt,clearAttempts,checkLockExpiry}=loginAttemptsSlice.actions,loginAttemptsReducer=loginAttemptsSlice.reducer,selectLoginAttempts=(Ee,Re)=>Re?Ee.loginAttempts.attempts[Re.toLowerCase()]||{count:0,lockedUntil:null}:{count:0,lockedUntil:null},formatLockoutTime=Ee=>{const Re=Math.ceil(Ee/1e3),Te=Math.floor(Re/60),je=Re%60;return Te>0?`${Te} minute${Te!==1?"s":""} ${je} second${je!==1?"s":""}`:`${je} second${je!==1?"s":""}`},initialState$1={darkMode:!1},themeSlice=createSlice({name:"theme",initialState:initialState$1,reducers:{toggleDarkMode:Ee=>{Ee.darkMode=!Ee.darkMode},setDarkMode:(Ee,Re)=>{Ee.darkMode=Re.payload}}}),{toggleDarkMode,setDarkMode}=themeSlice.actions,themeReducer=themeSlice.reducer,changePasswordService={changePassword:async({current_password:Ee,new_password:Re,confirm_password:Te})=>(await cachedAxios.post("/auth/change-password",{current_password:Ee,new_password:Re,confirm_password:Te})).data},changePassword=createAsyncThunk("auth/changePassword",async(Ee,{rejectWithValue:Re})=>{var Te,je,Oe;try{return await changePasswordService.changePassword(Ee)}catch(Me){return Me&&(Me.message||Me.data)?Re({error:((Te=Me.data)==null?void 0:Te.error)||Me.message||"Change password failed",violations:((je=Me.data)==null?void 0:je.violations)||[],password_policy:((Oe=Me.data)==null?void 0:Oe.password_policy)||null}):Re({error:"Change password failed"})}}),initialState={changing:!1,changeSuccess:!1,changeError:null,violations:[],passwordPolicy:null},changePasswordSlice=createSlice({name:"changePassword",initialState,reducers:{clearChangePasswordState:Ee=>{Ee.changing=!1,Ee.changeSuccess=!1,Ee.changeError=null,Ee.violations=[],Ee.passwordPolicy=null}},extraReducers:Ee=>{Ee.addCase(changePassword.pending,Re=>{Re.changing=!0,Re.changeSuccess=!1,Re.changeError=null,Re.violations=[],Re.passwordPolicy=null}).addCase(changePassword.fulfilled,(Re,Te)=>{Re.changing=!1,Re.changeSuccess=!0,Re.changeError=null,Re.violations=[],Re.passwordPolicy=null}
460).addCase(changePassword.rejected,(Re,Te)=>{var je,Oe,Me;Re.changing=!1,Re.changeSuccess=!1,Re.changeError=((je=Te.payload)==null?void 0:je.error)||"Change password failed",Re.violations=((Oe=Te.payload)==null?void 0:Oe.violations)||[],Re.passwordPolicy=((Me=Te.payload)==null?void 0:Me.password_policy)||null})}}),{clearChangePasswordState}=changePasswordSlice.actions,changePasswordReducer=changePasswordSlice.reducer,persistConfig={key:"doculens_persist",storage:default_1$5,whitelist:["auth","gridSettings","loginAttempts","theme","subscription"]},appReducer=combineReducers({auth:authReducer,user:userReducer,documents:documentsReducer,groups:groupsReducer,chat:chatReducer,customInstructions:customInstructionsReducer,favorites:favoritesReducer,userManagement:userManagementReducer,subscription:subscriptionReducer,superAdmin:superAdminReducer,systemHealth:systemHealthReducer,platformAdmin:platformAdminReducer,maintenance:maintenanceReducer,platformPlans:platformPlansReducer,gridSettings:gridSettingsReducer,loginAttempts:loginAttemptsReducer,theme:themeReducer,changePassword:changePasswordReducer}),AUTH_SESSION_RESET_ACTIONS=new Set(["auth/login/fulfilled","auth/register/fulfilled","auth/googleLogin/fulfilled","auth/microsoftLogin/fulfilled","auth/switchTenant/fulfilled"]),shouldResetAppSession=Ee=>{var Re,Te;return AUTH_SESSION_RESET_ACTIONS.has(Ee.type)&&!((Re=Ee.payload)!=null&&Re.mfa_required)&&!((Te=Ee.payload)!=null&&Te.tenant_selection_required)},rootReducer=(Ee,Re)=>{if(Re.type==="auth/logout/fulfilled"){const Te=Ee==null?void 0:Ee.loginAttempts;return appReducer({loginAttempts:Te},Re)}if(shouldResetAppSession(Re)){const Te={loginAttempts:Ee==null?void 0:Ee.loginAttempts,theme:Ee==null?void 0:Ee.theme,gridSettings:Ee==null?void 0:Ee.gridSettings},je=appReducer(void 0,{type:"@@INIT"});return appReducer({...je,...Te},Re)}return appReducer(Ee,Re)},persistedReducer=persistReducer(persistConfig,rootReducer),store=configureStore({reducer:persistedReducer,middleware:Ee=>Ee({serializableCheck:{ignoredActions:["persist/PERSIST","persist/REHYDRATE"]},immutableCheck:!1})});typeof window<"u"&&(window.store=store);const persistor=persistStore(store);function formatMuiErrorMessage$1(Ee){let Re="https://mui.com/production-error/?code="+Ee;for(let Te=1;Te<arguments.length;Te+=1)Re+="&args[]="+encodeURIComponent(arguments[Te]);return"Minified MUI error #"+Ee+"; visit "+Re+" for the full message."}const formatMuiErrorMessage=Object.freeze(Object.defineProperty({__proto__:null,default:formatMuiErrorMessage$1},Symbol.toStringTag,{value:"Module"})),THEME_ID="$$material";function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(Ee){for(var Re=1;Re<arguments.length;Re++){var Te=arguments[Re];for(var je in Te)({}).hasOwnProperty.call(Te,je)&&(Ee[je]=Te[je])}return Ee},_extends$1.apply(null,arguments)}function _objectWithoutPropertiesLoose(Ee,Re){if(Ee==null)return{};var Te={};for(var je in Ee)if({}.hasOwnProperty.call(Ee,je)){if(Re.indexOf(je)!==-1)continue;Te[je]=Ee[je]}return Te}function sheetForTag(Ee){if(Ee.sheet)return Ee.sheet;for(var Re=0;Re<document.styleSheets.length;Re++)if(document.styleSheets[Re].ownerNode===Ee)return document.styleSheets[Re]}function createStyleElement(Ee){var Re=document.createElement("style");return Re.setAttribute("data-emotion",Ee.key),Ee.nonce!==void 0&&Re.setAttribute("nonce",Ee.nonce),Re.appendChild(document.createTextNode("")),Re.setAttribute("data-s",""),Re}var StyleSheet=function(){function Ee(Te){var je=this;this._insertTag=function(Oe){var Me;je.tags.length===0?je.insertionPoint?Me=je.insertionPoint.nextSibling:je.prepend?Me=je.container.firstChild:Me=je.before:Me=je.tags[je.tags.length-1].nextSibling,je.container.insertBefore(Oe,Me),je.tags.push(Oe)},this.isSpeedy=Te.speedy===void 0?!0:Te.speedy,this.tags=[],this.ctr=0,this.nonce=Te.nonce,this.key=Te.key,this.container=Te.container,this.prepend=Te.prepend,this.insertionPoint=Te.insertionPoint,this.before=null}var Re=Ee.prototype;return Re.hydrate=function(je){je.forEach(this._insertTag)},Re.insert=function(je){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(createStyleElement(this));var Oe=this.tags[this.tags.length-1];if(this.isSpeedy){var Me=sheetForTag(Oe);try{Me.insertRule(je,Me.cssRules.length)}catch{}}else Oe.appendChild(document.createTextNode(je));this.ctr++}
vendor: 4,414 bytes, line 460
460,Re.flush=function(){this.tags.forEach(function(je){var Oe;return(Oe=je.parentNode)==null?void 0:Oe.removeChild(je)}),this.tags=[],this.ctr=0},Ee}(),MS="-ms-",MOZ="-moz-",WEBKIT="-webkit-",COMMENT$1="comm",RULESET="rule",DECLARATION="decl",IMPORT="@import",KEYFRAMES="@keyframes",LAYER="@layer",abs=Math.abs,from=String.fromCharCode,assign$1=Object.assign;function hash$2(Ee,Re){return charat(Ee,0)^45?(((Re<<2^charat(Ee,0))<<2^charat(Ee,1))<<2^charat(Ee,2))<<2^charat(Ee,3):0}function trim(Ee){return Ee.trim()}function match(Ee,Re){return(Ee=Re.exec(Ee))?Ee[0]:Ee}function replace(Ee,Re,Te){return Ee.replace(Re,Te)}function indexof(Ee,Re){return Ee.indexOf(Re)}function charat(Ee,Re){return Ee.charCodeAt(Re)|0}function substr(Ee,Re,Te){return Ee.slice(Re,Te)}function strlen(Ee){return Ee.length}function sizeof(Ee){return Ee.length}function append(Ee,Re){return Re.push(Ee),Ee}function combine(Ee,Re){return Ee.map(Re).join("")}var line=1,column=1,length=0,position=0,character=0,characters="";function node(Ee,Re,Te,je,Oe,Me,De){return{value:Ee,root:Re,parent:Te,type:je,props:Oe,children:Me,line,column,length:De,return:""}}function copy(Ee,Re){return assign$1(node("",null,null,"",null,null,0),Ee,{length:-Ee.length},Re)}function char(){return character}function prev(){return character=position>0?charat(characters,--position):0,column--,character===10&&(column=1,line--),character}function next(){return character=position<length?charat(characters,position++):0,column++,character===10&&(column=1,line++),character}function peek(){return charat(characters,position)}function caret(){return position}function slice(Ee,Re){return substr(characters,Ee,Re)}function token(Ee){switch(Ee){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function alloc(Ee){return line=column=1,length=strlen(characters=Ee),position=0,[]}function dealloc(Ee){return characters="",Ee}function delimit(Ee){return trim(slice(position-1,delimiter(Ee===91?Ee+2:Ee===40?Ee+1:Ee)))}function whitespace(Ee){for(;(character=peek())&&character<33;)next();return token(Ee)>2||token(character)>3?"":" "}function escaping(Ee,Re){for(;--Re&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(Ee,caret()+(Re<6&&peek()==32&&next()==32))}function delimiter(Ee){for(;next();)switch(character){case Ee:return position;case 34:case 39:Ee!==34&&Ee!==39&&delimiter(character);break;case 40:Ee===41&&delimiter(Ee);break;case 92:next();break}return position}function commenter(Ee,Re){for(;next()&&Ee+character!==57;)if(Ee+character===84&&peek()===47)break;return"/*"+slice(Re,position-1)+"*"+from(Ee===47?Ee:next())}function identifier(Ee){for(;!token(peek());)next();return slice(Ee,position)}function compile(Ee){return dealloc(parse("",null,null,null,[""],Ee=alloc(Ee),0,[0],Ee))}function parse(Ee,Re,Te,je,Oe,Me,De,$e,Be){for(var Ue=0,ze=0,We=De,Xe=0,He=0,qe=0,Ge=1,Ye=1,Ve=1,Ke=0,Qe="",Ze=Oe,Je=Me,ir=je,rr=Qe;Ye;)switch(qe=Ke,Ke=next()){case 40:if(qe!=108&&charat(rr,We-1)==58){indexof(rr+=replace(delimit(Ke),"&","&\f"),"&\f")!=-1&&(Ve=-1);break}case 34:case 39:case 91:rr+=delimit(Ke);break;case 9:case 10:case 13:case 32:rr+=whitespace(qe);break;case 92:rr+=escaping(caret()-1,7);continue;case 47:switch(peek()){case 42:case 47:append(comment(commenter(next(),caret()),Re,Te),Be);break;default:rr+="/"}break;case 123*Ge:$e[Ue++]=strlen(rr)*Ve;case 125*Ge:case 59:case 0:switch(Ke){case 0:case 125:Ye=0;case 59+ze:Ve==-1&&(rr=replace(rr,/\f/g,"")),He>0&&strlen(rr)-We&&append(He>32?declaration(rr+";",je,Te,We-1):declaration(replace(rr," ","")+";",je,Te,We-2),Be);break;case 59:rr+=";";default:if(append(ir=ruleset(rr,Re,Te,Ue,ze,Oe,$e,Qe,Ze=[],Je=[],We),Me),Ke===123)if(ze===0)parse(rr,Re,ir,ir,Ze,Me,We,$e,Je);else switch(Xe===99&&charat(rr,3)===110?100:Xe){case 100:case 108:case 109:case 115:parse(Ee,ir,ir,je&&append(ruleset(Ee,ir,ir,0,0,Oe,$e,Qe,Oe,Ze=[],We),Je),Oe,Je,We,$e,je?Ze:Je);break;default:parse(rr,ir,ir,ir,[""],Je,0,$e,Je)}}Ue=ze=He=0,Ge=Ve=1,Qe=rr="",We=De;break;case 58:We=1+strlen(rr),He=qe;default:if(Ge<1){if(Ke==123)--Ge;else if(Ke==125&&Ge++==0&&prev()==125)continue}switch(rr+=from(Ke),Ke*Ge){case 38:Ve=ze>0?1:(rr+="\f",-1);break;case 44:$e[Ue++]=(strlen(rr)-1)*Ve,Ve=1;break;
vendor: 14,041 bytes, lines 460-467
460case 64:peek()===45&&(rr+=delimit(next())),Xe=peek(),ze=We=strlen(Qe=rr+=identifier(caret())),Ke++;break;case 45:qe===45&&strlen(rr)==2&&(Ge=0)}}return Me}function ruleset(Ee,Re,Te,je,Oe,Me,De,$e,Be,Ue,ze){for(var We=Oe-1,Xe=Oe===0?Me:[""],He=sizeof(Xe),qe=0,Ge=0,Ye=0;qe<je;++qe)for(var Ve=0,Ke=substr(Ee,We+1,We=abs(Ge=De[qe])),Qe=Ee;Ve<He;++Ve)(Qe=trim(Ge>0?Xe[Ve]+" "+Ke:replace(Ke,/&\f/g,Xe[Ve])))&&(Be[Ye++]=Qe);return node(Ee,Re,Te,Oe===0?RULESET:$e,Be,Ue,ze)}function comment(Ee,Re,Te){return node(Ee,Re,Te,COMMENT$1,from(char()),substr(Ee,2,-2),0)}function declaration(Ee,Re,Te,je){return node(Ee,Re,Te,DECLARATION,substr(Ee,0,je),substr(Ee,je+1,-1),je)}function serialize(Ee,Re){for(var Te="",je=sizeof(Ee),Oe=0;Oe<je;Oe++)Te+=Re(Ee[Oe],Oe,Ee,Re)||"";return Te}function stringify(Ee,Re,Te,je){switch(Ee.type){case LAYER:if(Ee.children.length)break;case IMPORT:case DECLARATION:return Ee.return=Ee.return||Ee.value;case COMMENT$1:return"";case KEYFRAMES:return Ee.return=Ee.value+"{"+serialize(Ee.children,je)+"}";case RULESET:Ee.value=Ee.props.join(",")}return strlen(Te=serialize(Ee.children,je))?Ee.return=Ee.value+"{"+Te+"}":""}function middleware(Ee){var Re=sizeof(Ee);return function(Te,je,Oe,Me){for(var De="",$e=0;$e<Re;$e++)De+=Ee[$e](Te,je,Oe,Me)||"";return De}}function rulesheet(Ee){return function(Re){Re.root||(Re=Re.return)&&Ee(Re)}}function memoize$1(Ee){var Re=Object.create(null);return function(Te){return Re[Te]===void 0&&(Re[Te]=Ee(Te)),Re[Te]}}var identifierWithPointTracking=function(Re,Te,je){for(var Oe=0,Me=0;Oe=Me,Me=peek(),Oe===38&&Me===12&&(Te[je]=1),!token(Me);)next();return slice(Re,position)},toRules=function(Re,Te){var je=-1,Oe=44;do switch(token(Oe)){case 0:Oe===38&&peek()===12&&(Te[je]=1),Re[je]+=identifierWithPointTracking(position-1,Te,je);break;case 2:Re[je]+=delimit(Oe);break;case 4:if(Oe===44){Re[++je]=peek()===58?"&\f":"",Te[je]=Re[je].length;break}default:Re[je]+=from(Oe)}while(Oe=next());return Re},getRules=function(Re,Te){return dealloc(toRules(alloc(Re),Te))},fixedElements=new WeakMap,compat=function(Re){if(!(Re.type!=="rule"||!Re.parent||Re.length<1)){for(var Te=Re.value,je=Re.parent,Oe=Re.column===je.column&&Re.line===je.line;je.type!=="rule";)if(je=je.parent,!je)return;if(!(Re.props.length===1&&Te.charCodeAt(0)!==58&&!fixedElements.get(je))&&!Oe){fixedElements.set(Re,!0);for(var Me=[],De=getRules(Te,Me),$e=je.props,Be=0,Ue=0;Be<De.length;Be++)for(var ze=0;ze<$e.length;ze++,Ue++)Re.props[Ue]=Me[Be]?De[Be].replace(/&\f/g,$e[ze]):$e[ze]+" "+De[Be]}}},removeLabel=function(Re){if(Re.type==="decl"){var Te=Re.value;Te.charCodeAt(0)===108&&Te.charCodeAt(2)===98&&(Re.return="",Re.value="")}};function prefix$1(Ee,Re){switch(hash$2(Ee,Re)){case 5103:return WEBKIT+"print-"+Ee+Ee;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return WEBKIT+Ee+Ee;case 5349:case 4246:case 4810:case 6968:case 2756:return WEBKIT+Ee+MOZ+Ee+MS+Ee+Ee;case 6828:case 4268:return WEBKIT+Ee+MS+Ee+Ee;case 6165:return WEBKIT+Ee+MS+"flex-"+Ee+Ee;case 5187:return WEBKIT+Ee+replace(Ee,/(\w+).+(:[^]+)/,WEBKIT+"box-$1$2"+MS+"flex-$1$2")+Ee;case 5443:return WEBKIT+Ee+MS+"flex-item-"+replace(Ee,/flex-|-self/,"")+Ee;case 4675:return WEBKIT+Ee+MS+"flex-line-pack"+replace(Ee,/align-content|flex-|-self/,"")+Ee;case 5548:return WEBKIT+Ee+MS+replace(Ee,"shrink","negative")+Ee;case 5292:return WEBKIT+Ee+MS+replace(Ee,"basis","preferred-size")+Ee;case 6060:return WEBKIT+"box-"+replace(Ee,"-grow","")+WEBKIT+Ee+MS+replace(Ee,"grow","positive")+Ee;case 4554:return WEBKIT+replace(Ee,/([^-])(transform)/g,"$1"+WEBKIT+"$2")+Ee;case 6187:return replace(replace(replace(Ee,/(zoom-|grab)/,WEBKIT+"$1"),/(image-set)/,WEBKIT+"$1"),Ee,"")+Ee;case 5495:case 3959:return replace(Ee,/(image-set\([^]*)/,WEBKIT+"$1$`$1");case 4968:return replace(replace(Ee,/(.+:)(flex-)?(.*)/,WEBKIT+"box-pack:$3"+MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+WEBKIT+Ee+Ee;case 4095:case 3583:case 4068:case 2532:return replace(Ee,/(.+)-inline(.+)/,WEBKIT+"$1$2")+Ee;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(strlen(Ee)-1-Re>6)switch(charat(Ee,Re+1)){case 109:if(charat(Ee,Re+4)!==45)break;case 102:return replace(Ee,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(Ee,Re+3)==108?"$3":"$2-$3"))+Ee;case 115:return~indexof(Ee,"stretch")?prefix$1(replace(Ee,"stretch","fill-available"),Re)+Ee:Ee}break;case 4949:if(charat(Ee,Re+1)!==115)break;case 6444:switch(charat(Ee,strlen(Ee)-3-(~indexof(Ee,"!important")&&10))){case 107:return replace(Ee,":",":"+WEBKIT)+Ee;case 101:return replace(Ee,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(Ee,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+Ee}break;case 5936:switch(charat(Ee,Re+11)){case 114:return WEBKIT+Ee+MS+replace(Ee,/[svh]\w+-[tblr]{2}/,"tb")+Ee;case 108:return WEBKIT+Ee+MS+replace(Ee,/[svh]\w+-[tblr]{2}/,"tb-rl")+Ee;case 45:return WEBKIT+Ee+MS+replace(Ee,/[svh]\w+-[tblr]{2}/,"lr")+Ee}return WEBKIT+Ee+MS+Ee+Ee}return Ee}var prefixer=function(Re,Te,je,Oe){if(Re.length>-1&&!Re.return)switch(Re.type){case DECLARATION:Re.return=prefix$1(Re.value,Re.length);break;case KEYFRAMES:return serialize([copy(Re,{value:replace(Re.value,"@","@"+WEBKIT)})],Oe);case RULESET:if(Re.length)return combine(Re.props,function(Me){switch(match(Me,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy(Re,{props:[replace(Me,/:(read-\w+)/,":"+MOZ+"$1")]})],Oe);case"::placeholder":return serialize([copy(Re,{props:[replace(Me,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(Re,{props:[replace(Me,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(Re,{props:[replace(Me,/:(plac\w+)/,MS+"input-$1")]})],Oe)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(Re){var Te=Re.key;if(Te==="css"){var je=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(je,function(Ge){var Ye=Ge.getAttribute("data-emotion");Ye.indexOf(" ")!==-1&&(document.head.appendChild(Ge),Ge.setAttribute("data-s",""))})}var Oe=Re.stylisPlugins||defaultStylisPlugins,Me={},De,$e=[];De=Re.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+Te+' "]'),function(Ge){for(var Ye=Ge.getAttribute("data-emotion").split(" "),Ve=1;Ve<Ye.length;Ve++)Me[Ye[Ve]]=!0;$e.push(Ge)});var Be,Ue=[compat,removeLabel];{var ze,We=[stringify,rulesheet(function(Ge){ze.insert(Ge)})],Xe=middleware(Ue.concat(Oe,We)),He=function(Ye){return serialize(compile(Ye),Xe)};Be=function(Ye,Ve,Ke,Qe){ze=Ke,He(Ye?Ye+"{"+Ve.styles+"}":Ve.styles),Qe&&(qe.inserted[Ve.name]=!0)}}var qe={key:Te,sheet:new StyleSheet({key:Te,container:De,nonce:Re.nonce,speedy:Re.speedy,prepend:Re.prepend,insertionPoint:Re.insertionPoint}),nonce:Re.nonce,inserted:Me,registered:{},insert:Be};return qe.sheet.hydrate($e),qe},reactIs$2={exports:{}},reactIs_production_min={};/** @license React v16.13.1 461 * react-is.production.min.js 462 * 463 * Copyright (c) Facebook, Inc. and its affiliates. 464 * 465 * This source code is licensed under the MIT license found in the 466 * LICENSE file in the root directory of this source tree. 467 */var b$1=typeof Symbol=="function"&&Symbol.for,c$1=b$1?Symbol.for("react.element"):60103,d$1=b$1?Symbol.for("react.portal"):60106,e=b$1?Symbol.for("react.fragment"):60107,f$1=b$1?Symbol.for("react.strict_mode"):60108,g$1=b$1?Symbol.for("react.profiler"):60114,h$1=b$1?Symbol.for("react.provider"):60109,k$1=b$1?Symbol.for("react.context"):60110,l$1=b$1?Symbol.for("react.async_mode"):60111,m$1=b$1?Symbol.for("react.concurrent_mode"):60111,n=b$1?Symbol.for("react.forward_ref"):60112,p$1=b$1?Symbol.for("react.suspense"):60113,q$1=b$1?Symbol.for("react.suspense_list"):60120,r$1=b$1?Symbol.for("react.memo"):60115,t=b$1?Symbol.for("react.lazy"):60116,v$1=b$1?Symbol.for("react.block"):60121,w$1=b$1?Symbol.for("react.fundamental"):60117,x$2=b$1?Symbol.for("react.responder"):60118,y$1=b$1?Symbol.for("react.scope"):60119;function z$1(Ee){if(typeof Ee=="object"&&Ee!==null){var Re=Ee.$$typeof;switch(Re){case c$1:switch(Ee=Ee.type,Ee){case l$1:case m$1:case e:case g$1:case f$1:case p$1:return Ee;default:switch(Ee=Ee&&Ee.$$typeof,Ee){case k$1:case n:case t:case r$1:case h$1:return Ee;default:return Re}}case d$1:return Re}}}function A$1(Ee){return z$1(Ee)===m$1}reactIs_production_min.AsyncMode=l$1;reactIs_production_min.ConcurrentMode=m$1;reactIs_production_min.ContextConsumer=k$1;reactIs_production_min.ContextProvider=h$1;reactIs_production_min.Element=c$1;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r$1;reactIs_production_min.Portal=d$1;reactIs_production_min.Profiler=g$1;reactIs_production_min.StrictMode=f$1;reactIs_production_min.Suspense=p$1;reactIs_production_min.isAsyncMode=function(Ee){return A$1(Ee)||z$1(Ee)===l$1};reactIs_production_min.isConcurrentMode=A$1;reactIs_production_min.isContextConsumer=function(Ee){return z$1(Ee)===k$1};reactIs_production_min.isContextProvider=function(Ee){return z$1(Ee)===h$1};reactIs_production_min.isElement=function(Ee){return typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===c$1};reactIs_production_min.isForwardRef=function(Ee){return z$1(Ee)===n};reactIs_production_min.isFragment=function(Ee){return z$1(Ee)===e};reactIs_production_min.isLazy=function(Ee){return z$1(Ee)===t};reactIs_production_min.isMemo=function(Ee){return z$1(Ee)===r$1};reactIs_production_min.isPortal=function(Ee){return z$1(Ee)===d$1};reactIs_production_min.isProfiler=function(Ee){return z$1(Ee)===g$1};reactIs_production_min.isStrictMode=function(Ee){return z$1(Ee)===f$1};reactIs_production_min.isSuspense=function(Ee){return z$1(Ee)===p$1};reactIs_production_min.isValidElementType=function(Ee){return typeof Ee=="string"||typeof Ee=="function"||Ee===e||Ee===m$1||Ee===g$1||Ee===f$1||Ee===p$1||Ee===q$1||typeof Ee=="object"&&Ee!==null&&(Ee.$$typeof===t||Ee.$$typeof===r$1||Ee.$$typeof===h$1||Ee.$$typeof===k$1||Ee.$$typeof===n||Ee.$$typeof===w$1||Ee.$$typeof===x$2||Ee.$$typeof===y$1||Ee.$$typeof===v$1)};reactIs_production_min.typeOf=z$1;reactIs$2.exports=reactIs_production_min;var reactIsExports$1=reactIs$2.exports,reactIs$1=reactIsExports$1,REACT_STATICS={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},KNOWN_STATICS={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},FORWARD_REF_STATICS={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},MEMO_STATICS={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},TYPE_STATICS={};TYPE_STATICS[reactIs$1.ForwardRef]=FORWARD_REF_STATICS;TYPE_STATICS[reactIs$1.Memo]=MEMO_STATICS;function getStatics(Ee){return reactIs$1.isMemo(Ee)?MEMO_STATICS:TYPE_STATICS[Ee.$$typeof]||REACT_STATICS}var defineProperty=Object.defineProperty,getOwnPropertyNames=Object.getOwnPropertyNames,getOwnPropertySymbols=Object.getOwnPropertySymbols,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,getPrototypeOf=Object.getPrototypeOf,objectPrototype=Object.prototype;function hoistNonReactStatics(Ee,Re,Te){if(typeof Re!="string"){if(objectPrototype){var je=getPrototypeOf(Re);je&&je!==objectPrototype&&hoistNonReactStatics(Ee,je,Te)}var Oe=getOwnPropertyNames(Re);getOwnPropertySymbols&&(Oe=Oe.concat(getOwnPropertySymbols(Re)));for(var Me=getStatics(Ee),De=getStatics(Re),$e=0;$e<Oe.length;++$e){var Be=Oe[$e];if(!KNOWN_STATICS[Be]&&!(Te&&Te[Be])&&!(De&&De[Be])&&!(Me&&Me[Be])){var Ue=getOwnPropertyDescriptor(Re,Be);try{defineProperty(Ee,Be,Ue)}catch{}}}}return Ee}var hoistNonReactStatics_cjs=hoistNonReactStatics;const hoistStatics=getDefaultExportFromCjs(hoistNonReactStatics_cjs);var isBrowser$1=!0;function getRegisteredStyles(Ee,Re,Te){var je="";return Te.split(" ").forEach(function(Oe){Ee[Oe]!==void 0?Re.push(Ee[Oe]+";"):Oe&&(je+=Oe+" ")}),je}var registerStyles=function(Re,Te,je){var Oe=Re.key+"-"+Te.name;(je===!1||isBrowser$1===!1)&&Re.registered[Oe]===void 0&&(Re.registered[Oe]=Te.styles)},insertStyles=function(Re,Te,je){registerStyles(Re,Te,je);var Oe=Re.key+"-"+Te.name;if(Re.inserted[Te.name]===void 0){var Me=Te;do Re.insert(Te===Me?"."+Oe:"",Me,Re.sheet,!0),Me=Me.next;while(Me!==void 0)}};function murmur2(Ee){for(var Re=0,Te,je=0,Oe=Ee.length;Oe>=4;++je,Oe-=4)Te=Ee.charCodeAt(je)&255|(Ee.charCodeAt(++je)&255)<<8|(Ee.charCodeAt(++je)&255)<<16|(Ee.charCodeAt(++je)&255)<<24,Te=(Te&65535)*1540483477+((Te>>>16)*59797<<16),Te^=Te>>>24,Re=(Te&65535)*1540483477+((Te>>>16)*59797<<16)^(Re&65535)*1540483477+((Re>>>16)*59797<<16);switch(Oe){case 3:Re^=(Ee.charCodeAt(je+2)&255)<<16;case 2:Re^=(Ee.charCodeAt(je+1)&255)<<8;case 1:Re^=Ee.charCodeAt(je)&255,Re=(Re&65535)*1540483477+((Re>>>16)*59797<<16)}return Re^=Re>>>13,Re=(Re&65535)*1540483477+((Re>>>16)*59797<<16),((Re^Re>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(Re){return Re.charCodeAt(1)===45},isProcessableValue=function(Re){return Re!=null&&typeof Re!="boolean"},processStyleName=memoize$1(function(Ee){return isCustomProperty(Ee)?Ee:Ee.replace(hyphenateRegex,"
467-$&").toLowerCase()}),processStyleValue=function(Re,Te){switch(Re){case"animation":case"animationName":if(typeof Te=="string")return Te.replace(animationRegex,function(je,Oe,Me){return cursor={name:Oe,styles:Me,next:cursor},Oe})}return unitlessKeys[Re]!==1&&!isCustomProperty(Re)&&typeof Te=="number"&&Te!==0?Te+"px":Te};function handleInterpolation(Ee,Re,Te){if(Te==null)return"";var je=Te;if(je.__emotion_styles!==void 0)return je;switch(typeof Te){case"boolean":return"";case"object":{var Oe=Te;if(Oe.anim===1)return cursor={name:Oe.name,styles:Oe.styles,next:cursor},Oe.name;var Me=Te;if(Me.styles!==void 0){var De=Me.next;if(De!==void 0)for(;De!==void 0;)cursor={name:De.name,styles:De.styles,next:cursor},De=De.next;var $e=Me.styles+";";return $e}return createStringFromObject(Ee,Re,Te)}case"function":{if(Ee!==void 0){var Be=cursor,Ue=Te(Ee);return cursor=Be,handleInterpolation(Ee,Re,Ue)}break}}var ze=Te;if(Re==null)return ze;var We=Re[ze];return We!==void 0?We:ze}function createStringFromObject(Ee,Re,Te){var je="";if(Array.isArray(Te))for(var Oe=0;Oe<Te.length;Oe++)je+=handleInterpolation(Ee,Re,Te[Oe])+";";else for(var Me in Te){var De=Te[Me];if(typeof De!="object"){var $e=De;Re!=null&&Re[$e]!==void 0?je+=Me+"{"+Re[$e]+"}":isProcessableValue($e)&&(je+=processStyleName(Me)+":"+processStyleValue(Me,$e)+";")}else if(Array.isArray(De)&&typeof De[0]=="string"&&(Re==null||Re[De[0]]===void 0))for(var Be=0;Be<De.length;Be++)isProcessableValue(De[Be])&&(je+=processStyleName(Me)+":"+processStyleValue(Me,De[Be])+";");else{var Ue=handleInterpolation(Ee,Re,De);switch(Me){case"animation":case"animationName":{je+=processStyleName(Me)+":"+Ue+";";break}default:je+=Me+"{"+Ue+"}"}}}return je}var labelPattern=/label:\s*([^\s;{]+)\s*(;|$)/g,cursor;function serializeStyles(Ee,Re,Te){if(Ee.length===1&&typeof Ee[0]=="object"&&Ee[0]!==null&&Ee[0].styles!==void 0)return Ee[0];var je=!0,Oe="";cursor=void 0;var Me=Ee[0];if(Me==null||Me.raw===void 0)je=!1,Oe+=handleInterpolation(Te,Re,Me);else{var De=Me;Oe+=De[0]}for(var $e=1;$e<Ee.length;$e++)if(Oe+=handleInterpolation(Te,Re,Ee[$e]),je){var Be=Me;Oe+=Be[$e]}labelPattern.lastIndex=0;for(var Ue="",ze;(ze=labelPattern.exec(Oe))!==null;)Ue+="-"+ze[1];var We=murmur2(Oe)+Ue;return{name:We,styles:Oe,next:cursor}}var syncFallback=function(Re){return Re()},useInsertionEffect=React$2.useInsertionEffect?React$2.useInsertionEffect:!1,useInsertionEffectAlwaysWithSyncFallback=useInsertionEffect||syncFallback,useInsertionEffectWithLayoutFallback=useInsertionEffect||reactExports.useLayoutEffect,EmotionCacheContext=reactExports.createContext(typeof HTMLElement<"u"?createCache({key:"css"}):null),CacheProvider=EmotionCacheContext.Provider,withEmotionCache=function(Re){return reactExports.forwardRef(function(Te,je){var Oe=reactExports.useContext(EmotionCacheContext);return Re(Te,Oe,je)})},ThemeContext$2=reactExports.createContext({}),hasOwn={}.hasOwnProperty,typePropName="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",createEmotionProps=function(Re,Te){var je={};for(var Oe in Te)hasOwn.call(Te,Oe)&&(je[Oe]=Te[Oe]);return je[typePropName]=Re,je},Insertion$1=function(Re){var Te=Re.cache,je=Re.serialized,Oe=Re.isStringTag;return registerStyles(Te,je,Oe),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(Te,je,Oe)}),null},Emotion=withEmotionCache(function(Ee,Re,Te){var je=Ee.css;typeof je=="string"&&Re.registered[je]!==void 0&&(je=Re.registered[je]);var Oe=Ee[typePropName],Me=[je],De="";typeof Ee.className=="string"?De=getRegisteredStyles(Re.registered,Me,Ee.className):Ee.className!=null&&(De=Ee.className+" ");var $e=serializeStyles(Me,void 0,reactExports.useContext(ThemeContext$2));De+=Re.key+"-"+$e.name;var Be={};for(var Ue in Ee)hasOwn.call(Ee,Ue)&&Ue!=="css"&&Ue!==typePropName&&(Be[Ue]=Ee[Ue]);return Be.className=De,Te&&(Be.ref=Te),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Insertion$1,{cache:Re,serialized:$e,isStringTag:typeof Oe=="string"}),reactExports.createElement(Oe,Be))}),Emotion$1=Emotion,_extends={exports:{}},hasRequired_extends;function require_extends(){return hasRequired_extends||(hasRequired_extends=1,function(Ee){function Re(){return Ee.exports=Re=Object.assign?Object.assign.bind():function(Te){for(var je=1;
vendor: 8,647 bytes, line 467
467je<arguments.length;je++){var Oe=arguments[je];for(var Me in Oe)({}).hasOwnProperty.call(Oe,Me)&&(Te[Me]=Oe[Me])}return Te},Ee.exports.__esModule=!0,Ee.exports.default=Ee.exports,Re.apply(null,arguments)}Ee.exports=Re,Ee.exports.__esModule=!0,Ee.exports.default=Ee.exports}(_extends)),_extends.exports}require_extends();var jsx=function(Re,Te){var je=arguments;if(Te==null||!hasOwn.call(Te,"css"))return reactExports.createElement.apply(void 0,je);var Oe=je.length,Me=new Array(Oe);Me[0]=Emotion$1,Me[1]=createEmotionProps(Re,Te);for(var De=2;De<Oe;De++)Me[De]=je[De];return reactExports.createElement.apply(null,Me)};(function(Ee){var Re;Re||(Re=Ee.JSX||(Ee.JSX={}))})(jsx||(jsx={}));var Global=withEmotionCache(function(Ee,Re){var Te=Ee.styles,je=serializeStyles([Te],void 0,reactExports.useContext(ThemeContext$2)),Oe=reactExports.useRef();return useInsertionEffectWithLayoutFallback(function(){var Me=Re.key+"-global",De=new Re.sheet.constructor({key:Me,nonce:Re.sheet.nonce,container:Re.sheet.container,speedy:Re.sheet.isSpeedy}),$e=!1,Be=document.querySelector('style[data-emotion="'+Me+" "+je.name+'"]');return Re.sheet.tags.length&&(De.before=Re.sheet.tags[0]),Be!==null&&($e=!0,Be.setAttribute("data-emotion",Me),De.hydrate([Be])),Oe.current=[De,$e],function(){De.flush()}},[Re]),useInsertionEffectWithLayoutFallback(function(){var Me=Oe.current,De=Me[0],$e=Me[1];if($e){Me[1]=!1;return}if(je.next!==void 0&&insertStyles(Re,je.next,!0),De.tags.length){var Be=De.tags[De.tags.length-1].nextElementSibling;De.before=Be,De.flush()}Re.insert("",je,De,!1)},[Re,je.name]),null});function css(){for(var Ee=arguments.length,Re=new Array(Ee),Te=0;Te<Ee;Te++)Re[Te]=arguments[Te];return serializeStyles(Re)}function keyframes(){var Ee=css.apply(void 0,arguments),Re="animation-"+Ee.name;return{name:Re,styles:"@keyframes "+Re+"{"+Ee.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize$1(function(Ee){return reactPropsRegex.test(Ee)||Ee.charCodeAt(0)===111&&Ee.charCodeAt(1)===110&&Ee.charCodeAt(2)<91}),testOmitPropsOnStringTag=isPropValid,testOmitPropsOnComponent=function(Re){return Re!=="theme"},getDefaultShouldForwardProp=function(Re){return typeof Re=="string"&&Re.charCodeAt(0)>96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(Re,Te,je){var Oe;if(Te){var Me=Te.shouldForwardProp;Oe=Re.__emotion_forwardProp&&Me?function(De){return Re.__emotion_forwardProp(De)&&Me(De)}:Me}return typeof Oe!="function"&&je&&(Oe=Re.__emotion_forwardProp),Oe},Insertion=function(Re){var Te=Re.cache,je=Re.serialized,Oe=Re.isStringTag;return registerStyles(Te,je,Oe),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(Te,je,Oe)}),null},createStyled$3=function Ee(Re,Te){var je=Re.__emotion_real===Re,Oe=je&&Re.__emotion_base||Re,Me,De;Te!==void 0&&(Me=Te.label,De=Te.target);var $e=composeShouldForwardProps(Re,Te,je),Be=$e||getDefaultShouldForwardProp(Oe),Ue=!Be("as");return function(){var ze=arguments,We=je&&Re.__emotion_styles!==void 0?Re.__emotion_styles.slice(0):[];if(Me!==void 0&&We.push("label:"+Me+";"),ze[0]==null||ze[0].raw===void 0)We.push.apply(We,ze);else{var Xe=ze[0];We.push(Xe[0]);for(var He=ze.length,qe=1;qe<He;qe++)We.push(ze[qe],Xe[qe])}var Ge=withEmotionCache(function(Ye,Ve,Ke){var Qe=Ue&&Ye.as||Oe,Ze="",Je=[],ir=Ye;if(Ye.theme==null){ir={};for(var rr in Ye)ir[rr]=Ye[rr];ir.theme=reactExports.useContext(ThemeContext$2)}typeof Ye.className=="string"?Ze=getRegisteredStyles(Ve.registered,Je,Ye.className):Ye.className!=null&&(Ze=Ye.className+" ");var ar=serializeStyles(We.concat(Je),Ve.registered,ir);Ze+=Ve.key+"-"+ar.name,De!==void 0&&(Ze+=" "+De);var or=Ue&&$e===void 0?getDefaultShouldForwardProp(Qe):Be,pr={};for(var tr in Ye)Ue&&tr==="as"||or(tr)&&(pr[tr]=Ye[tr]);return pr.className=Ze,Ke&&(pr.ref=Ke),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(Insertion,{cache:Ve,serialized:ar,isStringTag:typeof Qe=="string"}),reactExports.createElement(Qe,pr))});return Ge.displayName=Me!==void 0?Me:"Styled("+(typeof Oe=="string"?Oe:Oe.displayName||Oe.name||"Component")+")",Ge.defaultProps=Re.defaultProps,Ge.__emotion_real=Ge,Ge.__emotion_base=Oe,Ge.__emotion_styles=We,Ge.__emotion_forwardProp=$e,Object.defineProperty(Ge,"toString",{value:function(){return"."+De}}),Ge.withComponent=function(Ye,Ve){var Ke=Ee(Ye,_extends$1({},Te,Ve,{shouldForwardProp:composeShouldForwardProps(Ge,Ve,!0)}));return Ke.apply(void 0,We)}
467,Ge}},tags=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],styled$3=createStyled$3.bind(null);tags.forEach(function(Ee){styled$3[Ee]=styled$3(Ee)});var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function Ee(je,Oe,Me,De,$e,Be){if(Be!==ReactPropTypesSecret){var Ue=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw Ue.name="Invariant Violation",Ue}}Ee.isRequired=Ee;function Re(){return Ee}var Te={array:Ee,bigint:Ee,bool:Ee,func:Ee,number:Ee,object:Ee,string:Ee,symbol:Ee,any:Ee,arrayOf:Re,element:Ee,elementType:Ee,instanceOf:Re,node:Ee,objectOf:Re,oneOf:Re,oneOfType:Re,shape:Re,exact:Re,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return Te.PropTypes=Te,Te};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function getCache(Ee,Re){const Te=createCache({key:"css",prepend:Ee});if(Re){const je=Te.insert;Te.insert=(...Oe)=>(Oe[1].styles.match(/^@layer\s+[^{]*$/)||(Oe[1].styles=`@layer mui {${Oe[1].styles}}`),je(...Oe))}return Te}const cacheMap=new Map;function StyledEngineProvider(Ee){const{injectFirst:Re,enableCssLayer:Te,children:je}=Ee,Oe=reactExports.useMemo(()=>{const Me=`${Re}-${Te}`;if(typeof document=="object"&&cacheMap.has(Me))return cacheMap.get(Me);const De=getCache(Re,Te);return cacheMap.set(Me,De),De},[Re,Te]);return Re||Te?jsxRuntimeExports.jsx(CacheProvider,{value:Oe,children:je}):je}function isEmpty$4(Ee){return Ee==null||Object.keys(Ee).length===0}function GlobalStyles$2(Ee){const{styles:Re,defaultTheme:Te={}}=Ee,je=typeof Re=="function"?Oe=>Re(isEmpty$4(Oe)?Te:Oe):Re;return jsxRuntimeExports.jsx(Global,{styles:je})}function styled$2(Ee,Re){return styled$3(Ee,Re)}const internal_processStyles=(Ee,Re)=>{Array.isArray(Ee.__emotion_styles)&&(Ee.__emotion_styles=Re(Ee.__emotion_styles))},wrapper=[];function internal_serializeStyles(Ee){return wrapper[0]=Ee,serializeStyles(wrapper)}const styledEngine=Object.freeze(Object.defineProperty({__proto__:null,GlobalStyles:GlobalStyles$2,StyledEngineProvider,ThemeContext:ThemeContext$2,css,default:styled$2,internal_processStyles,internal_serializeStyles,keyframes},Symbol.toStringTag,{value:"Module"}));function isPlainObject(Ee){if(typeof Ee!="object"||Ee===null)return!1;const Re=Object.getPrototypeOf(Ee);return(Re===null||Re===Object.prototype||Object.getPrototypeOf(Re)===null)&&!(Symbol.toStringTag in Ee)&&!(Symbol.iterator in Ee)}function deepClone(Ee){if(reactExports.isValidElement(Ee)||!isPlainObject(Ee))return Ee;const Re={};return Object.keys(Ee).forEach(Te=>{Re[Te]=deepClone(Ee[Te])}),Re}function deepmerge$1(Ee,Re,Te={clone:!0}){const je=Te.clone?_extends$1({},Ee):Ee;return isPlainObject(Ee)&&isPlainObject(Re)&&Object.keys(Re).forEach(Oe=>{reactExports.isValidElement(Re[Oe])?je[Oe]=Re[Oe]:isPlainObject(Re[Oe])&&Object.prototype.hasOwnProperty.call(Ee,Oe)&&isPlainObject(Ee[Oe])?je[Oe]=deepmerge$1(Ee[Oe],Re[Oe],Te):Te.clone?je[Oe]=isPlainObject(Re[Oe])?deepClone(Re[Oe]):Re[Oe]:je[Oe]=Re[Oe]}),je}const deepmerge=Object.freeze(Object.defineProperty({__proto__:null,default:deepmerge$1,isPlainObject},Symbol.toStringTag,{value:"Module"}
467)),_excluded$1q=["values","unit","step"],sortBreakpointsValues=Ee=>{const Re=Object.keys(Ee).map(Te=>({key:Te,val:Ee[Te]}))||[];return Re.sort((Te,je)=>Te.val-je.val),Re.reduce((Te,je)=>_extends$1({},Te,{[je.key]:je.val}),{})};function createBreakpoints(Ee){const{values:Re={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:Te="px",step:je=5}=Ee,Oe=_objectWithoutPropertiesLoose(Ee,_excluded$1q),Me=sortBreakpointsValues(Re),De=Object.keys(Me);function $e(Xe){return`@media (min-width:${typeof Re[Xe]=="number"?Re[Xe]:Xe}${Te})`}function Be(Xe){return`@media (max-width:${(typeof Re[Xe]=="number"?Re[Xe]:Xe)-je/100}${Te})`}function Ue(Xe,He){const qe=De.indexOf(He);return`@media (min-width:${typeof Re[Xe]=="number"?Re[Xe]:Xe}${Te}) and (max-width:${(qe!==-1&&typeof Re[De[qe]]=="number"?Re[De[qe]]:He)-je/100}${Te})`}function ze(Xe){return De.indexOf(Xe)+1<De.length?Ue(Xe,De[De.indexOf(Xe)+1]):$e(Xe)}function We(Xe){const He=De.indexOf(Xe);return He===0?$e(De[1]):He===De.length-1?Be(De[He]):Ue(Xe,De[De.indexOf(Xe)+1]).replace("@media","@media not all and")}return _extends$1({keys:De,values:Me,up:$e,down:Be,between:Ue,only:ze,not:We,unit:Te},Oe)}const shape={borderRadius:4};function merge(Ee,Re){return Re?deepmerge$1(Ee,Re,{clone:!1}):Ee}const values$2={xs:0,sm:600,md:900,lg:1200,xl:1536},defaultBreakpoints={keys:["xs","sm","md","lg","xl"],up:Ee=>`@media (min-width:${values$2[Ee]}px)`};function handleBreakpoints(Ee,Re,Te){const je=Ee.theme||{};if(Array.isArray(Re)){const Me=je.breakpoints||defaultBreakpoints;return Re.reduce((De,$e,Be)=>(De[Me.up(Me.keys[Be])]=Te(Re[Be]),De),{})}if(typeof Re=="object"){const Me=je.breakpoints||defaultBreakpoints;return Object.keys(Re).reduce((De,$e)=>{if(Object.keys(Me.values||values$2).indexOf($e)!==-1){const Be=Me.up($e);De[Be]=Te(Re[$e],$e)}else{const Be=$e;De[Be]=Re[Be]}return De},{})}return Te(Re)}function createEmptyBreakpointObject(Ee={}){var Re;return((Re=Ee.keys)==null?void 0:Re.reduce((je,Oe)=>{const Me=Ee.up(Oe);return je[Me]={},je},{}))||{}}function removeUnusedBreakpoints(Ee,Re){return Ee.reduce((Te,je)=>{const Oe=Te[je];return(!Oe||Object.keys(Oe).length===0)&&delete Te[je],Te},Re)}function mergeBreakpointsInOrder(Ee,...Re){const Te=createEmptyBreakpointObject(Ee),je=[Te,...Re].reduce((Oe,Me)=>deepmerge$1(Oe,Me),{});return removeUnusedBreakpoints(Object.keys(Te),je)}function computeBreakpointsBase(Ee,Re){if(typeof Ee!="object")return{};const Te={},je=Object.keys(Re);return Array.isArray(Ee)?je.forEach((Oe,Me)=>{Me<Ee.length&&(Te[Oe]=!0)}):je.forEach(Oe=>{Ee[Oe]!=null&&(Te[Oe]=!0)}),Te}function resolveBreakpointValues({values:Ee,breakpoints:Re,base:Te}){const je=Te||computeBreakpointsBase(Ee,Re),Oe=Object.keys(je);if(Oe.length===0)return Ee;let Me;return Oe.reduce((De,$e,Be)=>(Array.isArray(Ee)?(De[$e]=Ee[Be]!=null?Ee[Be]:Ee[Me],Me=Be):typeof Ee=="object"?(De[$e]=Ee[$e]!=null?Ee[$e]:Ee[Me],Me=$e):De[$e]=Ee,De),{})}function capitalize$1(Ee){if(typeof Ee!="string")throw new Error(formatMuiErrorMessage$1(7));return Ee.charAt(0).toUpperCase()+Ee.slice(1)}const capitalize=Object.freeze(Object.defineProperty({__proto__:null,default:capitalize$1},Symbol.toStringTag,{value:"Module"}));function getPath(Ee,Re,Te=!0){if(!Re||typeof Re!="string")return null;if(Ee&&Ee.vars&&Te){const je=`vars.${Re}`.split(".").reduce((Oe,Me)=>Oe&&Oe[Me]?Oe[Me]:null,Ee);if(je!=null)return je}return Re.split(".").reduce((je,Oe)=>je&&je[Oe]!=null?je[Oe]:null,Ee)}function getStyleValue$1(Ee,Re,Te,je=Te){let Oe;return typeof Ee=="function"?Oe=Ee(Te):Array.isArray(Ee)?Oe=Ee[Te]||je:Oe=getPath(Ee,Te)||je,Re&&(Oe=Re(Oe,je,Ee)),Oe}function style$2(Ee){const{prop:Re,cssProperty:Te=Ee.prop,themeKey:je,transform:Oe}=Ee,Me=De=>{if(De[Re]==null)return null;const $e=De[Re],Be=De.theme,Ue=getPath(Be,je)||{};return handleBreakpoints(De,$e,We=>{let Xe=getStyleValue$1(Ue,Oe,We);return We===Xe&&typeof We=="string"&&(Xe=getStyleValue$1(Ue,Oe,`${Re}${We==="default"?"":capitalize$1(We)}`,We)),Te===!1?Xe:{[Te]:Xe}})};return Me.propTypes={},Me.filterProps=[Re],Me}function memoize(Ee){const Re={};return Te=>(Re[Te]===void 0&&(Re[Te]=Ee(Te)),Re[Te])}const properties={m:"margin",p:"padding"},directions={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},aliases={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},getCssProperties=memoize(Ee=>{if(Ee.length>2)if(aliases[Ee])Ee=aliases[Ee];else return[Ee];const[Re,Te]=Ee.split(""),je=properties[Re],Oe=directions[Te]||"";return Array.isArray(Oe)?Oe.map(Me=>je+Me):[je+Oe]}),marginKeys=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],paddingKeys=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...marginKeys,...paddingKeys];function createUnaryUnit(Ee,Re,Te,je){var Oe;const Me=(Oe=getPath(Ee,Re,!1))!=null?Oe:Te;return typeof Me=="number"?De=>typeof De=="string"?De:Me*De:Array.isArray(Me)?De=>typeof De=="string"?De:Me[De]:typeof Me=="function"?Me:()=>{}}function createUnarySpacing(Ee){return createUnaryUnit(Ee,"spacing",8)}function getValue(Ee,Re){if(typeof Re=="string"||Re==null)return Re;const Te=Math.abs(Re),je=Ee(Te);return Re>=0?je:typeof je=="number"?-je:`-${je}`}function getStyleFromPropValue(Ee,Re){return Te=>Ee.reduce((je,Oe)=>(je[Oe]=getValue(Re,Te),je),{})}
467function resolveCssProperty(Ee,Re,Te,je){if(Re.indexOf(Te)===-1)return null;const Oe=getCssProperties(Te),Me=getStyleFromPropValue(Oe,je),De=Ee[Te];return handleBreakpoints(Ee,De,Me)}function style$1(Ee,Re){const Te=createUnarySpacing(Ee.theme);return Object.keys(Ee).map(je=>resolveCssProperty(Ee,Re,je,Te)).reduce(merge,{})}function margin(Ee){return style$1(Ee,marginKeys)}margin.propTypes={};margin.filterProps=marginKeys;function padding(Ee){return style$1(Ee,paddingKeys)}padding.propTypes={};padding.filterProps=paddingKeys;function createSpacing(Ee=8){if(Ee.mui)return Ee;const Re=createUnarySpacing({spacing:Ee}),Te=(...je)=>(je.length===0?[1]:je).map(Me=>{const De=Re(Me);return typeof De=="number"?`${De}px`:De}).join(" ");return Te.mui=!0,Te}function compose(...Ee){const Re=Ee.reduce((je,Oe)=>(Oe.filterProps.forEach(Me=>{je[Me]=Oe}),je),{}),Te=je=>Object.keys(je).reduce((Oe,Me)=>Re[Me]?merge(Oe,Re[Me](je)):Oe,{});return Te.propTypes={},Te.filterProps=Ee.reduce((je,Oe)=>je.concat(Oe.filterProps),[]),Te}function borderTransform(Ee){return typeof Ee!="number"?Ee:`${Ee}px solid`}function createBorderStyle(Ee,Re){return style$2({prop:Ee,themeKey:"borders",transform:Re})}const border=createBorderStyle("border",borderTransform),borderTop=createBorderStyle("borderTop",borderTransform),borderRight=createBorderStyle("borderRight",borderTransform),borderBottom=createBorderStyle("borderBottom",borderTransform),borderLeft=createBorderStyle("borderLeft",borderTransform),borderColor=createBorderStyle("borderColor"),borderTopColor=createBorderStyle("borderTopColor"),borderRightColor=createBorderStyle("borderRightColor"),borderBottomColor=createBorderStyle("borderBottomColor"),borderLeftColor=createBorderStyle("borderLeftColor"),outline=createBorderStyle("outline",borderTransform),outlineColor=createBorderStyle("outlineColor"),borderRadius=Ee=>{if(Ee.borderRadius!==void 0&&Ee.borderRadius!==null){const Re=createUnaryUnit(Ee.theme,"shape.borderRadius",4),Te=je=>({borderRadius:getValue(Re,je)});return handleBreakpoints(Ee,Ee.borderRadius,Te)}return null};borderRadius.propTypes={};borderRadius.filterProps=["borderRadius"];compose(border,borderTop,borderRight,borderBottom,borderLeft,borderColor,borderTopColor,borderRightColor,borderBottomColor,borderLeftColor,borderRadius,outline,outlineColor);const gap=Ee=>{if(Ee.gap!==void 0&&Ee.gap!==null){const Re=createUnaryUnit(Ee.theme,"spacing",8),Te=je=>({gap:getValue(Re,je)});return handleBreakpoints(Ee,Ee.gap,Te)}return null};gap.propTypes={};gap.filterProps=["gap"];const columnGap=Ee=>{if(Ee.columnGap!==void 0&&Ee.columnGap!==null){const Re=createUnaryUnit(Ee.theme,"spacing",8),Te=je=>({columnGap:getValue(Re,je)});return handleBreakpoints(Ee,Ee.columnGap,Te)}return null};columnGap.propTypes={};columnGap.filterProps=["columnGap"];const rowGap=Ee=>{if(Ee.rowGap!==void 0&&Ee.rowGap!==null){const Re=createUnaryUnit(Ee.theme,"spacing",8),Te=je=>({rowGap:getValue(Re,je)});return handleBreakpoints(Ee,Ee.rowGap,Te)}return null};rowGap.propTypes={};rowGap.filterProps=["rowGap"];const gridColumn=style$2({prop:"gridColumn"}),gridRow=style$2({prop:"gridRow"}),gridAutoFlow=style$2({prop:"gridAutoFlow"}),gridAutoColumns=style$2({prop:"gridAutoColumns"}),gridAutoRows=style$2({prop:"gridAutoRows"}),gridTemplateColumns=style$2({prop:"gridTemplateColumns"}),gridTemplateRows=style$2({prop:"gridTemplateRows"}),gridTemplateAreas=style$2({prop:"gridTemplateAreas"}),gridArea=style$2({prop:"gridArea"});compose(gap,columnGap,rowGap,gridColumn,gridRow,gridAutoFlow,gridAutoColumns,gridAutoRows,gridTemplateColumns,gridTemplateRows,gridTemplateAreas,gridArea);function paletteTransform(Ee,Re){return Re==="grey"?Re:Ee}const color=style$2({prop:"color",themeKey:"palette",transform:paletteTransform}),bgcolor=style$2({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:paletteTransform}),backgroundColor=style$2({prop:"backgroundColor",themeKey:"palette",transform:paletteTransform});compose(color,bgcolor,backgroundColor);function sizingTransform(Ee){return Ee<=1&&Ee!==0?`${Ee*100}%`:Ee}const width=style$2({prop:"width",transform:sizingTransform}),maxWidth=Ee=>{if(Ee.maxWidth!==void 0&&Ee.maxWidth!==null){const Re=Te=>{var je,Oe;const Me=((je=Ee.theme)==null||(je=je.breakpoints)==null||(je=je.values)==null?void 0:je[Te])||values$2[Te];return Me?((Oe=Ee.theme)==null||(Oe=Oe.breakpoints)==null?void 0:Oe.unit)!=="px"?{maxWidth:`${Me}${Ee.theme.breakpoints.unit}`}:{maxWidth:Me}:{maxWidth:sizingTransform(Te)}};return handleBreakpoints(Ee,Ee.maxWidth,Re)}return null};maxWidth.filterProps=["maxWidth"];const minWidth=style$2({prop:"minWidth",transform:sizingTransform}),height=style$2({prop:"height",transform:sizingTransform}),maxHeight=style$2({prop:"maxHeight",transform:sizingTransform}),minHeight=style$2({prop:"minHeight",transform:sizingTransform});style$2({prop:"size",cssProperty:"width",transform:sizingTransform});style$2({prop:"size",cssProperty:"height",transform:sizingTransform});const boxSizing=style$2({prop:"boxSizing"});compose(width,maxWidth,minWidth,height,maxHeight,minHeight,boxSizing);const defaultSxConfig={border:{themeKey:"borders",transform:borderTransform},borderTop:{themeKey:"borders",transform:borderTransform},borderRight:{themeKey:"borders",transform:borderTransform},borderBottom:{themeKey:"borders",transform:borderTransform},borderLeft:{themeKey:"borders",transform:borderTransform},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:borderTransform},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:borderRadius},color:{themeKey:"palette",transform:paletteTransform},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:paletteTransform},backgroundColor:{themeKey:"palette",transform:paletteTransform},p:{style:padding},pt:{style:padding},pr:{style:padding},pb:{style:padding},pl:{style:padding},px:{style:padding},py:{style:padding},padding:{style:padding},paddingTop:{style:padding},paddingRight:{style:padding}
467,paddingBottom:{style:padding},paddingLeft:{style:padding},paddingX:{style:padding},paddingY:{style:padding},paddingInline:{style:padding},paddingInlineStart:{style:padding},paddingInlineEnd:{style:padding},paddingBlock:{style:padding},paddingBlockStart:{style:padding},paddingBlockEnd:{style:padding},m:{style:margin},mt:{style:margin},mr:{style:margin},mb:{style:margin},ml:{style:margin},mx:{style:margin},my:{style:margin},margin:{style:margin},marginTop:{style:margin},marginRight:{style:margin},marginBottom:{style:margin},marginLeft:{style:margin},marginX:{style:margin},marginY:{style:margin},marginInline:{style:margin},marginInlineStart:{style:margin},marginInlineEnd:{style:margin},marginBlock:{style:margin},marginBlockStart:{style:margin},marginBlockEnd:{style:margin},displayPrint:{cssProperty:!1,transform:Ee=>({"@media print":{display:Ee}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:gap},rowGap:{style:rowGap},columnGap:{style:columnGap},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sizingTransform},maxWidth:{style:maxWidth},minWidth:{transform:sizingTransform},height:{transform:sizingTransform},maxHeight:{transform:sizingTransform},minHeight:{transform:sizingTransform},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function objectsHaveSameKeys(...Ee){const Re=Ee.reduce((je,Oe)=>je.concat(Object.keys(Oe)),[]),Te=new Set(Re);return Ee.every(je=>Te.size===Object.keys(je).length)}function callIfFn(Ee,Re){return typeof Ee=="function"?Ee(Re):Ee}function unstable_createStyleFunctionSx(){function Ee(Te,je,Oe,Me){const De={[Te]:je,theme:Oe},$e=Me[Te];if(!$e)return{[Te]:je};const{cssProperty:Be=Te,themeKey:Ue,transform:ze,style:We}=$e;if(je==null)return null;if(Ue==="typography"&&je==="inherit")return{[Te]:je};const Xe=getPath(Oe,Ue)||{};return We?We(De):handleBreakpoints(De,je,qe=>{let Ge=getStyleValue$1(Xe,ze,qe);return qe===Ge&&typeof qe=="string"&&(Ge=getStyleValue$1(Xe,ze,`${Te}${qe==="default"?"":capitalize$1(qe)}`,qe)),Be===!1?Ge:{[Be]:Ge}})}function Re(Te){var je;const{sx:Oe,theme:Me={},nested:De}=Te||{};if(!Oe)return null;const $e=(je=Me.unstable_sxConfig)!=null?je:defaultSxConfig;function Be(Ue){let ze=Ue;if(typeof Ue=="function")ze=Ue(Me);else if(typeof Ue!="object")return Ue;if(!ze)return null;const We=createEmptyBreakpointObject(Me.breakpoints),Xe=Object.keys(We);let He=We;return Object.keys(ze).forEach(qe=>{const Ge=callIfFn(ze[qe],Me);if(Ge!=null)if(typeof Ge=="object")if($e[qe])He=merge(He,Ee(qe,Ge,Me,$e));else{const Ye=handleBreakpoints({theme:Me},Ge,Ve=>({[qe]:Ve}));objectsHaveSameKeys(Ye,Ge)?He[qe]=Re({sx:Ge,theme:Me,nested:!0}):He=merge(He,Ye)}else He=merge(He,Ee(qe,Ge,Me,$e))}),!De&&Me.modularCssLayers?{"@layer sx":removeUnusedBreakpoints(Xe,He)}:removeUnusedBreakpoints(Xe,He)}return Array.isArray(Oe)?Oe.map(Be):Be(Oe)}return Re}const styleFunctionSx$1=unstable_createStyleFunctionSx();styleFunctionSx$1.filterProps=["sx"];function applyStyles$2(Ee,Re){const Te=this;return Te.vars&&typeof Te.getColorSchemeSelector=="function"?{[Te.getColorSchemeSelector(Ee).replace(/(\[[^\]]+\])/,"*:where($1)")]:Re}:Te.palette.mode===Ee?Re:{}}const _excluded$1p=["breakpoints","palette","spacing","shape"];function createTheme$2(Ee={},...Re){const{breakpoints:Te={},palette:je={},spacing:Oe,shape:Me={}}=Ee,De=_objectWithoutPropertiesLoose(Ee,_excluded$1p),$e=createBreakpoints(Te),Be=createSpacing(Oe);let Ue=deepmerge$1({breakpoints:$e,direction:"ltr",components:{},palette:_extends$1({mode:"light"},je),spacing:Be,shape:_extends$1({},shape,Me)},De);return Ue.applyStyles=applyStyles$2,Ue=Re.reduce((ze,We)=>deepmerge$1(ze,We),Ue),Ue.unstable_sxConfig=_extends$1({},defaultSxConfig,De==null?void 0:De.unstable_sxConfig),Ue.unstable_sx=function(We){return styleFunctionSx$1({sx:We,theme:this})},Ue}const createTheme$1=Object.freeze(Object.defineProperty({__proto__:null,default:createTheme$2,private_createBreakpoints:createBreakpoints,unstable_applyStyles:applyStyles$2},Symbol.toStringTag,{value:"Module"}));function isObjectEmpty$2(Ee){return Object.keys(Ee).length===0}function useTheme$4(Ee=null){const Re=reactExports.useContext(ThemeContext$2);return!Re||isObjectEmpty$2(Re)?Ee:Re}const systemDefaultTheme$2=createTheme$2();function useTheme$3(Ee=systemDefaultTheme$2){return useTheme$4(Ee)}function wrapGlobalLayer(Ee){const Re=internal_serializeStyles(Ee);return Ee!==Re&&Re.styles?(Re.styles.match(/^@layer\s+[^{]*$/)||(Re.styles=`@layer global{${Re.styles}}`),Re):Ee}function GlobalStyles$1({styles:Ee,themeId:Re,defaultTheme:Te={}}){const je=useTheme$3(Te),Oe=Re&&je[Re]||je;let Me=typeof Ee=="function"?Ee(Oe):Ee;return Oe.modularCssLayers&&(Array.isArray(Me)?Me=Me.map(De=>wrapGlobalLayer(typeof De=="function"?De(Oe):De)):Me=wrapGlobalLayer(Me)),jsxRuntimeExports.jsx(GlobalStyles$2,{styles:Me})}
467const _excluded$1o=["sx"],splitProps=Ee=>{var Re,Te;const je={systemProps:{},otherProps:{}},Oe=(Re=Ee==null||(Te=Ee.theme)==null?void 0:Te.unstable_sxConfig)!=null?Re:defaultSxConfig;return Object.keys(Ee).forEach(Me=>{Oe[Me]?je.systemProps[Me]=Ee[Me]:je.otherProps[Me]=Ee[Me]}),je};function extendSxProp(Ee){const{sx:Re}=Ee,Te=_objectWithoutPropertiesLoose(Ee,_excluded$1o),{systemProps:je,otherProps:Oe}=splitProps(Te);let Me;return Array.isArray(Re)?Me=[je,...Re]:typeof Re=="function"?Me=(...De)=>{const $e=Re(...De);return isPlainObject($e)?_extends$1({},je,$e):je}:Me=_extends$1({},je,Re),_extends$1({},Oe,{sx:Me})}const styleFunctionSx=Object.freeze(Object.defineProperty({__proto__:null,default:styleFunctionSx$1,extendSxProp,unstable_createStyleFunctionSx,unstable_defaultSxConfig:defaultSxConfig},Symbol.toStringTag,{value:"Module"})),defaultGenerator=Ee=>Ee,createClassNameGenerator=()=>{let Ee=defaultGenerator;return{configure(Re){Ee=Re},generate(Re){return Ee(Re)},reset(){Ee=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator();function r(Ee){var Re,Te,je="";if(typeof Ee=="string"||typeof Ee=="number")je+=Ee;else if(typeof Ee=="object")if(Array.isArray(Ee)){var Oe=Ee.length;for(Re=0;Re<Oe;Re++)Ee[Re]&&(Te=r(Ee[Re]))&&(je&&(je+=" "),je+=Te)}else for(Te in Ee)Ee[Te]&&(je&&(je+=" "),je+=Te);return je}function clsx(){for(var Ee,Re,Te=0,je="",Oe=arguments.length;Te<Oe;Te++)(Ee=arguments[Te])&&(Re=r(Ee))&&(je&&(je+=" "),je+=Re);return je}const _excluded$1n=["className","component"];function createBox(Ee={}){const{themeId:Re,defaultTheme:Te,defaultClassName:je="MuiBox-root",generateClassName:Oe}=Ee,Me=styled$2("div",{shouldForwardProp:$e=>$e!=="theme"&&$e!=="sx"&&$e!=="as"})(styleFunctionSx$1);return reactExports.forwardRef(function(Be,Ue){const ze=useTheme$3(Te),We=extendSxProp(Be),{className:Xe,component:He="div"}=We,qe=_objectWithoutPropertiesLoose(We,_excluded$1n);return jsxRuntimeExports.jsx(Me,_extends$1({as:He,ref:Ue,className:clsx(Xe,Oe?Oe(je):je),theme:Re&&ze[Re]||ze},qe))})}const globalStateClasses={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function generateUtilityClass(Ee,Re,Te="Mui"){const je=globalStateClasses[Re];return je?`${Te}-${je}`:`${ClassNameGenerator.generate(Ee)}-${Re}`}function generateUtilityClasses(Ee,Re,Te="Mui"){const je={};return Re.forEach(Oe=>{je[Oe]=generateUtilityClass(Ee,Oe,Te)}),je}var reactIs={exports:{}},reactIs_production={};/** 468 * @license React 469 * react-is.production.js 470 * 471 * Copyright (c) Meta Platforms, Inc. and affiliates. 472 * 473 * This source code is licensed under the MIT license found in the 474 * LICENSE file in the root directory of this source tree. 475 */var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_CONSUMER_TYPE=Symbol.for("react.consumer"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE=Symbol.for("react.lazy"),REACT_VIEW_TRANSITION_TYPE=Symbol.for("react.view_transition"),REACT_CLIENT_REFERENCE=Symbol.for("react.client.reference");function typeOf(Ee){if(typeof Ee=="object"&&Ee!==null){var Re=Ee.$$typeof;switch(Re){case REACT_ELEMENT_TYPE:switch(Ee=Ee.type,Ee){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:case REACT_VIEW_TRANSITION_TYPE:return Ee;default:switch(Ee=Ee&&Ee.$$typeof,Ee){case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:return Ee;case REACT_CONSUMER_TYPE:return Ee;default:return Re}}case REACT_PORTAL_TYPE:return Re}}}reactIs_production.ContextConsumer=REACT_CONSUMER_TYPE;reactIs_production.ContextProvider=REACT_CONTEXT_TYPE;reactIs_production.Element=REACT_ELEMENT_TYPE;reactIs_production.ForwardRef=REACT_FORWARD_REF_TYPE;reactIs_production.Fragment=REACT_FRAGMENT_TYPE;reactIs_production.Lazy=REACT_LAZY_TYPE;reactIs_production.Memo=REACT_MEMO_TYPE;reactIs_production.Portal=REACT_PORTAL_TYPE;reactIs_production.Profiler=REACT_PROFILER_TYPE;reactIs_production.StrictMode=REACT_STRICT_MODE_TYPE;reactIs_production.Suspense=REACT_SUSPENSE_TYPE;reactIs_production.SuspenseList=REACT_SUSPENSE_LIST_TYPE;reactIs_production.isContextConsumer=function(Ee){return typeOf(Ee)===REACT_CONSUMER_TYPE};reactIs_production.isContextProvider=function(Ee){return typeOf(Ee)===REACT_CONTEXT_TYPE};reactIs_production.isElement=function(Ee){return typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===REACT_ELEMENT_TYPE};reactIs_production.isForwardRef=function(Ee){return typeOf(Ee)===REACT_FORWARD_REF_TYPE};reactIs_production.isFragment=function(Ee){return typeOf(Ee)===REACT_FRAGMENT_TYPE};reactIs_production.isLazy=function(Ee){return typeOf(Ee)===REACT_LAZY_TYPE};reactIs_production.isMemo=function(Ee){return typeOf(Ee)===REACT_MEMO_TYPE};reactIs_production.isPortal=function(Ee){return typeOf(Ee)===REACT_PORTAL_TYPE};reactIs_production.isProfiler=function(Ee){return typeOf(Ee)===REACT_PROFILER_TYPE};reactIs_production.isStrictMode=function(Ee){return typeOf(Ee)===REACT_STRICT_MODE_TYPE};reactIs_production.isSuspense=function(Ee){return typeOf(Ee)===REACT_SUSPENSE_TYPE};reactIs_production.isSuspenseList=function(Ee){return typeOf(Ee)===REACT_SUSPENSE_LIST_TYPE};reactIs_production.isValidElementType=function(Ee){return typeof Ee=="string"||typeof Ee=="function"||Ee===REACT_FRAGMENT_TYPE||Ee===REACT_PROFILER_TYPE||Ee===REACT_STRICT_MODE_TYPE||Ee===REACT_SUSPENSE_TYPE||Ee===REACT_SUSPENSE_LIST_TYPE||typeof Ee=="object"&&Ee!==null&&(Ee.$$typeof===REACT_LAZY_TYPE||Ee.$$typeof===REACT_MEMO_TYPE||Ee.$$typeof===REACT_CONTEXT_TYPE||Ee.$$typeof===REACT_CONSUMER_TYPE||Ee.$$typeof===REACT_FORWARD_REF_TYPE||Ee.$$typeof===REACT_CLIENT_REFERENCE||Ee.getModuleId!==void 0)};reactIs_production.typeOf=typeOf;reactIs.exports=reactIs_production;var reactIsExports=reactIs.exports;const fnNameMatchRegex=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function getFunctionName(Ee){const Re=`${Ee}`.match(fnNameMatchRegex);return Re&&Re[1]||""}
475function getFunctionComponentName(Ee,Re=""){return Ee.displayName||Ee.name||getFunctionName(Ee)||Re}function getWrappedName(Ee,Re,Te){const je=getFunctionComponentName(Re);return Ee.displayName||(je!==""?`${Te}(${je})`:Te)}function getDisplayName$1(Ee){if(Ee!=null){if(typeof Ee=="string")return Ee;if(typeof Ee=="function")return getFunctionComponentName(Ee,"Component");if(typeof Ee=="object")switch(Ee.$$typeof){case reactIsExports.ForwardRef:return getWrappedName(Ee,Ee.render,"ForwardRef");case reactIsExports.Memo:return getWrappedName(Ee,Ee.type,"memo");default:return}}}const getDisplayName=Object.freeze(Object.defineProperty({__proto__:null,default:getDisplayName$1,getFunctionName},Symbol.toStringTag,{value:"Module"})),_excluded$1m=["ownerState"],_excluded2$b=["variants"],_excluded3$4=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function isEmpty$3(Ee){return Object.keys(Ee).length===0}function isStringTag$1(Ee){return typeof Ee=="string"&&Ee.charCodeAt(0)>96}function shouldForwardProp$1(Ee){return Ee!=="ownerState"&&Ee!=="theme"&&Ee!=="sx"&&Ee!=="as"}function shallowLayer$1(Ee,Re){return Re&&Ee&&typeof Ee=="object"&&Ee.styles&&!Ee.styles.startsWith("@layer")&&(Ee.styles=`@layer ${Re}{${String(Ee.styles)}}`),Ee}const systemDefaultTheme$1=createTheme$2(),lowercaseFirstLetter$1=Ee=>Ee&&Ee.charAt(0).toLowerCase()+Ee.slice(1);function resolveTheme$1({defaultTheme:Ee,theme:Re,themeId:Te}){return isEmpty$3(Re)?Ee:Re[Te]||Re}function defaultOverridesResolver$1(Ee){return Ee?(Re,Te)=>Te[Ee]:null}function processStyleArg$1(Ee,Re,Te){let{ownerState:je}=Re,Oe=_objectWithoutPropertiesLoose(Re,_excluded$1m);const Me=typeof Ee=="function"?Ee(_extends$1({ownerState:je},Oe)):Ee;if(Array.isArray(Me))return Me.flatMap(De=>processStyleArg$1(De,_extends$1({ownerState:je},Oe),Te));if(Me&&typeof Me=="object"&&Array.isArray(Me.variants)){const{variants:De=[]}=Me;let Be=_objectWithoutPropertiesLoose(Me,_excluded2$b);return De.forEach(Ue=>{let ze=!0;if(typeof Ue.props=="function"?ze=Ue.props(_extends$1({ownerState:je},Oe,je)):Object.keys(Ue.props).forEach(We=>{(je==null?void 0:je[We])!==Ue.props[We]&&Oe[We]!==Ue.props[We]&&(ze=!1)}),ze){Array.isArray(Be)||(Be=[Be]);const We=typeof Ue.style=="function"?Ue.style(_extends$1({ownerState:je},Oe,je)):Ue.style;Be.push(Te?shallowLayer$1(internal_serializeStyles(We),Te):We)}}),Be}return Te?shallowLayer$1(internal_serializeStyles(Me),Te):Me}function createStyled$2(Ee={}){const{themeId:Re,defaultTheme:Te=systemDefaultTheme$1,rootShouldForwardProp:je=shouldForwardProp$1,slotShouldForwardProp:Oe=shouldForwardProp$1}=Ee,Me=De=>styleFunctionSx$1(_extends$1({},De,{theme:resolveTheme$1(_extends$1({},De,{defaultTheme:Te,themeId:Re}))}));return Me.__mui_systemSx=!0,(De,$e={})=>{internal_processStyles(De,ir=>ir.filter(rr=>!(rr!=null&&rr.__mui_systemSx)));const{name:Be,slot:Ue,skipVariantsResolver:ze,skipSx:We,overridesResolver:Xe=defaultOverridesResolver$1(lowercaseFirstLetter$1(Ue))}=$e,He=_objectWithoutPropertiesLoose($e,_excluded3$4),qe=Be&&Be.startsWith("Mui")||Ue?"components":"custom",Ge=ze!==void 0?ze:Ue&&Ue!=="Root"&&Ue!=="root"||!1,Ye=We||!1;let Ve,Ke=shouldForwardProp$1;Ue==="Root"||Ue==="root"?Ke=je:Ue?Ke=Oe:isStringTag$1(De)&&(Ke=void 0);const Qe=styled$2(De,_extends$1({shouldForwardProp:Ke,label:Ve},He)),Ze=ir=>typeof ir=="function"&&ir.__emotion_real!==ir||isPlainObject(ir)?rr=>{const ar=resolveTheme$1({theme:rr.theme,defaultTheme:Te,themeId:Re});return processStyleArg$1(ir,_extends$1({},rr,{theme:ar}),ar.modularCssLayers?qe:void 0)}:ir,Je=(ir,...rr)=>{let ar=Ze(ir);const or=rr?rr.map(Ze):[];Be&&Xe&&or.push(nr=>{const hr=resolveTheme$1(_extends$1({},nr,{defaultTheme:Te,themeId:Re}));if(!hr.components||!hr.components[Be]||!hr.components[Be].styleOverrides)return null;const sr=hr.components[Be].styleOverrides,xr={};return Object.entries(sr).forEach(([Rr,br])=>{xr[Rr]=processStyleArg$1(br,_extends$1({},nr,{theme:hr}),hr.modularCssLayers?"theme":void 0)}),Xe(nr,xr)}),Be&&!Ge&&or.push(nr=>{var hr;const sr=resolveTheme$1(_extends$1({},nr,{defaultTheme:Te,themeId:Re})),xr=sr==null||(hr=sr.components)==null||(hr=hr[Be])==null?void 0:hr.variants;return processStyleArg$1({variants:xr},_extends$1({},nr,{theme:sr}),sr.modularCssLayers?"theme":void 0)}),Ye||or.push(Me);const pr=or.length-rr.length;if(Array.isArray(ir)&&pr>0){const nr=new Array(pr).fill("");ar=[...ir,...nr],ar.raw=[...ir.raw,...nr]}const tr=Qe(ar,...or);return De.muiName&&(tr.muiName=De.muiName),tr};return Qe.withConfig&&(Je.withConfig=Qe.withConfig),Je}}const styled$1=createStyled$2();function resolveProps(Ee,Re){const Te=_extends$1({},Re);return Object.keys(Ee).forEach(je=>{if(je.toString().match(/^(components|slots)$/))Te[je]=_extends$1({},Ee[je],Te[je]);else if(je.toString().match(/^(componentsProps|slotProps)$/)){const Oe=Ee[je]||{},Me=Re[je];Te[je]={},!Me||!Object.keys(Me)?Te[je]=Oe:!Oe||!Object.keys(Oe)?Te[je]=Me:(Te[je]=_extends$1({},Me),Object.keys(Oe).forEach(De=>{Te[je][De]=resolveProps(Oe[De],Me[De])}))}else Te[je]===void 0&&(Te[je]=Ee[je])}),Te}function getThemeProps$1(Ee){const{theme:Re,name:Te,props:je}=Ee;return!Re||!Re.components||!Re.components[Te]||!Re.components[Te].defaultProps?je:resolveProps(Re.components[Te].defaultProps,je)}function useThemeProps({props:Ee,name:Re,defaultTheme:Te,themeId:je}){let Oe=useTheme$3(Te);return je&&(Oe=Oe[je]||Oe),getThemeProps$1({theme:Oe,name:Re,props:Ee})}const useEnhancedEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function useMediaQueryOld(Ee,Re,Te,je,Oe){const[Me,De]=reactExports.useState(()=>Oe&&Te?Te(Ee).matches:je?je(Ee).matches:Re);return useEnhancedEffect(()=>{let $e=!0;if(!Te)return;const Be=Te(Ee),Ue=()=>{$e&&De(Be.matches)};return Ue(),Be.addListener(Ue),()=>{$e=!1,Be.removeListener(Ue)}},[Ee,Te]),Me}const maybeReactUseSyncExternalStore=reactExports.useSyncExternalStore;
475function useMediaQueryNew(Ee,Re,Te,je,Oe){const Me=reactExports.useCallback(()=>Re,[Re]),De=reactExports.useMemo(()=>{if(Oe&&Te)return()=>Te(Ee).matches;if(je!==null){const{matches:ze}=je(Ee);return()=>ze}return Me},[Me,Ee,je,Oe,Te]),[$e,Be]=reactExports.useMemo(()=>{if(Te===null)return[Me,()=>()=>{}];const ze=Te(Ee);return[()=>ze.matches,We=>(ze.addListener(We),()=>{ze.removeListener(We)})]},[Me,Te,Ee]);return maybeReactUseSyncExternalStore(Be,$e,De)}function useMediaQuery(Ee,Re={}){const Te=useTheme$4(),je=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:Oe=!1,matchMedia:Me=je?window.matchMedia:null,ssrMatchMedia:De=null,noSsr:$e=!1}=getThemeProps$1({name:"MuiUseMediaQuery",props:Re,theme:Te});let Be=typeof Ee=="function"?Ee(Te):Ee;return Be=Be.replace(/^@media( ?)/m,""),(maybeReactUseSyncExternalStore!==void 0?useMediaQueryNew:useMediaQueryOld)(Be,Oe,Me,De,$e)}function clamp$2(Ee,Re=Number.MIN_SAFE_INTEGER,Te=Number.MAX_SAFE_INTEGER){return Math.max(Re,Math.min(Ee,Te))}const clamp$1=Object.freeze(Object.defineProperty({__proto__:null,default:clamp$2},Symbol.toStringTag,{value:"Module"}));function clampWrapper$1(Ee,Re=0,Te=1){return clamp$2(Ee,Re,Te)}function hexToRgb$1(Ee){Ee=Ee.slice(1);const Re=new RegExp(`.{1,${Ee.length>=6?2:1}}`,"g");let Te=Ee.match(Re);return Te&&Te[0].length===1&&(Te=Te.map(je=>je+je)),Te?`rgb${Te.length===4?"a":""}(${Te.map((je,Oe)=>Oe<3?parseInt(je,16):Math.round(parseInt(je,16)/255*1e3)/1e3).join(", ")})`:""}function decomposeColor$1(Ee){if(Ee.type)return Ee;if(Ee.charAt(0)==="#")return decomposeColor$1(hexToRgb$1(Ee));const Re=Ee.indexOf("("),Te=Ee.substring(0,Re);if(["rgb","rgba","hsl","hsla","color"].indexOf(Te)===-1)throw new Error(formatMuiErrorMessage$1(9,Ee));let je=Ee.substring(Re+1,Ee.length-1),Oe;if(Te==="color"){if(je=je.split(" "),Oe=je.shift(),je.length===4&&je[3].charAt(0)==="/"&&(je[3]=je[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(Oe)===-1)throw new Error(formatMuiErrorMessage$1(10,Oe))}else je=je.split(",");return je=je.map(Me=>parseFloat(Me)),{type:Te,values:je,colorSpace:Oe}}function recomposeColor$1(Ee){const{type:Re,colorSpace:Te}=Ee;let{values:je}=Ee;return Re.indexOf("rgb")!==-1?je=je.map((Oe,Me)=>Me<3?parseInt(Oe,10):Oe):Re.indexOf("hsl")!==-1&&(je[1]=`${je[1]}%`,je[2]=`${je[2]}%`),Re.indexOf("color")!==-1?je=`${Te} ${je.join(" ")}`:je=`${je.join(", ")}`,`${Re}(${je})`}function alpha$1(Ee,Re){return Ee=decomposeColor$1(Ee),Re=clampWrapper$1(Re),(Ee.type==="rgb"||Ee.type==="hsl")&&(Ee.type+="a"),Ee.type==="color"?Ee.values[3]=`/${Re}`:Ee.values[3]=Re,recomposeColor$1(Ee)}function darken$1(Ee,Re){if(Ee=decomposeColor$1(Ee),Re=clampWrapper$1(Re),Ee.type.indexOf("hsl")!==-1)Ee.values[2]*=1-Re;else if(Ee.type.indexOf("rgb")!==-1||Ee.type.indexOf("color")!==-1)for(let Te=0;Te<3;Te+=1)Ee.values[Te]*=1-Re;return recomposeColor$1(Ee)}function lighten$1(Ee,Re){if(Ee=decomposeColor$1(Ee),Re=clampWrapper$1(Re),Ee.type.indexOf("hsl")!==-1)Ee.values[2]+=(100-Ee.values[2])*Re;else if(Ee.type.indexOf("rgb")!==-1)for(let Te=0;Te<3;Te+=1)Ee.values[Te]+=(255-Ee.values[Te])*Re;else if(Ee.type.indexOf("color")!==-1)for(let Te=0;Te<3;Te+=1)Ee.values[Te]+=(1-Ee.values[Te])*Re;return recomposeColor$1(Ee)}function createChainedFunction(...Ee){return Ee.reduce((Re,Te)=>Te==null?Re:function(...Oe){Re.apply(this,Oe),Te.apply(this,Oe)},()=>{})}function debounce$1(Ee,Re=166){let Te;function je(...Oe){const Me=()=>{Ee.apply(this,Oe)};clearTimeout(Te),Te=setTimeout(Me,Re)}return je.clear=()=>{clearTimeout(Te)},je}function deprecatedPropType(Ee,Re){return()=>null}function isMuiElement(Ee,Re){var Te,je;return reactExports.isValidElement(Ee)&&Re.indexOf((Te=Ee.type.muiName)!=null?Te:(je=Ee.type)==null||(je=je._payload)==null||(je=je.value)==null?void 0:je.muiName)!==-1}function ownerDocument(Ee){return Ee&&Ee.ownerDocument||document}function ownerWindow(Ee){return ownerDocument(Ee).defaultView||window}function requirePropFactory(Ee,Re){return()=>null}function setRef(Ee,Re){typeof Ee=="function"?Ee(Re):Ee&&(Ee.current=Re)}let globalId=0;function useGlobalId(Ee){const[Re,Te]=reactExports.useState(Ee),je=Ee||Re;return reactExports.useEffect(()=>
475{Re==null&&(globalId+=1,Te(`mui-${globalId}`))},[Re]),je}const maybeReactUseId=React$2.useId;function useId(Ee){if(maybeReactUseId!==void 0){const Re=maybeReactUseId();return Ee??Re}return useGlobalId(Ee)}function unsupportedProp(Ee,Re,Te,je,Oe){return null}function useControlled({controlled:Ee,default:Re,name:Te,state:je="value"}){const{current:Oe}=reactExports.useRef(Ee!==void 0),[Me,De]=reactExports.useState(Re),$e=Oe?Ee:Me,Be=reactExports.useCallback(Ue=>{Oe||De(Ue)},[]);return[$e,Be]}function useEventCallback(Ee){const Re=reactExports.useRef(Ee);return useEnhancedEffect(()=>{Re.current=Ee}),reactExports.useRef((...Te)=>(0,Re.current)(...Te)).current}function useForkRef(...Ee){return reactExports.useMemo(()=>Ee.every(Re=>Re==null)?null:Re=>{Ee.forEach(Te=>{setRef(Te,Re)})},Ee)}const UNINITIALIZED={};function useLazyRef(Ee,Re){const Te=reactExports.useRef(UNINITIALIZED);return Te.current===UNINITIALIZED&&(Te.current=Ee(Re)),Te}const EMPTY=[];function useOnMount(Ee){reactExports.useEffect(Ee,EMPTY)}class Timeout{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Timeout}start(Re,Te){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,Te()},Re)}}function useTimeout(){const Ee=useLazyRef(Timeout.create).current;return useOnMount(Ee.disposeEffect),Ee}let hadKeyboardEvent=!0,hadFocusVisibleRecently=!1;const hadFocusVisibleRecentlyTimeout=new Timeout,inputTypesWhitelist={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function focusTriggersKeyboardModality(Ee){const{type:Re,tagName:Te}=Ee;return!!(Te==="INPUT"&&inputTypesWhitelist[Re]&&!Ee.readOnly||Te==="TEXTAREA"&&!Ee.readOnly||Ee.isContentEditable)}function handleKeyDown(Ee){Ee.metaKey||Ee.altKey||Ee.ctrlKey||(hadKeyboardEvent=!0)}function handlePointerDown(){hadKeyboardEvent=!1}function handleVisibilityChange(){this.visibilityState==="hidden"&&hadFocusVisibleRecently&&(hadKeyboardEvent=!0)}function prepare(Ee){Ee.addEventListener("keydown",handleKeyDown,!0),Ee.addEventListener("mousedown",handlePointerDown,!0),Ee.addEventListener("pointerdown",handlePointerDown,!0),Ee.addEventListener("touchstart",handlePointerDown,!0),Ee.addEventListener("visibilitychange",handleVisibilityChange,!0)}function isFocusVisible(Ee){const{target:Re}=Ee;try{return Re.matches(":focus-visible")}catch{}return hadKeyboardEvent||focusTriggersKeyboardModality(Re)}function useIsFocusVisible(){const Ee=reactExports.useCallback(Oe=>{Oe!=null&&prepare(Oe.ownerDocument)},[]),Re=reactExports.useRef(!1);function Te(){return Re.current?(hadFocusVisibleRecently=!0,hadFocusVisibleRecentlyTimeout.start(100,()=>{hadFocusVisibleRecently=!1}),Re.current=!1,!0):!1}function je(Oe){return isFocusVisible(Oe)?(Re.current=!0,!0):!1}return{isFocusVisibleRef:Re,onFocus:je,onBlur:Te,ref:Ee}}function getScrollbarSize(Ee){const Re=Ee.documentElement.clientWidth;return Math.abs(window.innerWidth-Re)}let cachedType;function detectScrollType(){if(cachedType)return cachedType;const Ee=document.createElement("div"),Re=document.createElement("div");return Re.style.width="10px",Re.style.height="1px",Ee.appendChild(Re),Ee.dir="rtl",Ee.style.fontSize="14px",Ee.style.width="4px",Ee.style.height="1px",Ee.style.position="absolute",Ee.style.top="-1000px",Ee.style.overflow="scroll",document.body.appendChild(Ee),cachedType="reverse",Ee.scrollLeft>0?cachedType="default":(Ee.scrollLeft=1,Ee.scrollLeft===0&&(cachedType="negative")),document.body.removeChild(Ee),cachedType}function getNormalizedScrollLeft(Ee,Re){const Te=Ee.scrollLeft;if(Re!=="rtl")return Te;switch(detectScrollType()){case"negative":return Ee.scrollWidth-Ee.clientWidth+Te;case"reverse":return Ee.scrollWidth-Ee.clientWidth-Te;default:return Te}}const usePreviousProps=Ee=>{const Re=reactExports.useRef({});return reactExports.useEffect(()=>{Re.current=Ee}),Re.current};function getValidReactChildren(Ee){return reactExports.Children.toArray(Ee).filter(Re=>reactExports.isValidElement(Re))}const visuallyHidden={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function composeClasses(Ee,Re,Te=void 0){const je={};return Object.keys(Ee).forEach(Oe=>{je[Oe]=Ee[Oe].reduce((Me,De)=>{if(De){const $e=Re(De);$e!==""&&Me.push($e),Te&&Te[De]&&Me.push(Te[De])}return Me},[]).join(" ")}),je}function isHostComponent(Ee){return typeof Ee=="string"}function appendOwnerState(Ee,Re,Te){return Ee===void 0||isHostComponent(Ee)?Re:_extends$1({},Re,{ownerState:_extends$1({},Re.ownerState,Te)})}function extractEventHandlers(Ee,Re=[]){if(Ee===void 0)return{};const Te={};return Object.keys(Ee).filter(je=>je.match(/^on[A-Z]/)&&typeof Ee[je]=="function"&&!Re.includes(je)).forEac
475h(je=>{Te[je]=Ee[je]}),Te}function omitEventHandlers(Ee){if(Ee===void 0)return{};const Re={};return Object.keys(Ee).filter(Te=>!(Te.match(/^on[A-Z]/)&&typeof Ee[Te]=="function")).forEach(Te=>{Re[Te]=Ee[Te]}),Re}function mergeSlotProps(Ee){const{getSlotProps:Re,additionalProps:Te,externalSlotProps:je,externalForwardedProps:Oe,className:Me}=Ee;if(!Re){const He=clsx(Te==null?void 0:Te.className,Me,Oe==null?void 0:Oe.className,je==null?void 0:je.className),qe=_extends$1({},Te==null?void 0:Te.style,Oe==null?void 0:Oe.style,je==null?void 0:je.style),Ge=_extends$1({},Te,Oe,je);return He.length>0&&(Ge.className=He),Object.keys(qe).length>0&&(Ge.style=qe),{props:Ge,internalRef:void 0}}const De=extractEventHandlers(_extends$1({},Oe,je)),$e=omitEventHandlers(je),Be=omitEventHandlers(Oe),Ue=Re(De),ze=clsx(Ue==null?void 0:Ue.className,Te==null?void 0:Te.className,Me,Oe==null?void 0:Oe.className,je==null?void 0:je.className),We=_extends$1({},Ue==null?void 0:Ue.style,Te==null?void 0:Te.style,Oe==null?void 0:Oe.style,je==null?void 0:je.style),Xe=_extends$1({},Ue,Te,Be,$e);return ze.length>0&&(Xe.className=ze),Object.keys(We).length>0&&(Xe.style=We),{props:Xe,internalRef:Ue.ref}}function resolveComponentProps(Ee,Re,Te){return typeof Ee=="function"?Ee(Re,Te):Ee}const _excluded$1l=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function useSlotProps(Ee){var Re;const{elementType:Te,externalSlotProps:je,ownerState:Oe,skipResolvingSlotProps:Me=!1}=Ee,De=_objectWithoutPropertiesLoose(Ee,_excluded$1l),$e=Me?{}:resolveComponentProps(je,Oe),{props:Be,internalRef:Ue}=mergeSlotProps(_extends$1({},De,{externalSlotProps:$e})),ze=useForkRef(Ue,$e==null?void 0:$e.ref,(Re=Ee.additionalProps)==null?void 0:Re.ref);return appendOwnerState(Te,_extends$1({},Be,{ref:ze}),Oe)}function getReactElementRef(Ee){if(parseInt(reactExports.version,10)>=19){var Re;return(Ee==null||(Re=Ee.props)==null?void 0:Re.ref)||null}return(Ee==null?void 0:Ee.ref)||null}const ThemeContext$1=reactExports.createContext(null);function useTheme$2(){return reactExports.useContext(ThemeContext$1)}const hasSymbol=typeof Symbol=="function"&&Symbol.for,nested=hasSymbol?Symbol.for("mui.nested"):"__THEME_NESTED__";function mergeOuterLocalTheme(Ee,Re){return typeof Re=="function"?Re(Ee):_extends$1({},Ee,Re)}function ThemeProvider$3(Ee){const{children:Re,theme:Te}=Ee,je=useTheme$2(),Oe=reactExports.useMemo(()=>{const Me=je===null?Te:mergeOuterLocalTheme(je,Te);return Me!=null&&(Me[nested]=je!==null),Me},[Te,je]);return jsxRuntimeExports.jsx(ThemeContext$1.Provider,{value:Oe,children:Re})}const _excluded$1k=["value"],RtlContext=reactExports.createContext();function RtlProvider(Ee){let{value:Re}=Ee,Te=_objectWithoutPropertiesLoose(Ee,_excluded$1k);return jsxRuntimeExports.jsx(RtlContext.Provider,_extends$1({value:Re??!0},Te))}const useRtl=()=>{const Ee=reactExports.useContext(RtlContext);return Ee??!1},PropsContext=reactExports.createContext(void 0);function DefaultPropsProvider({value:Ee,children:Re}){return jsxRuntimeExports.jsx(PropsContext.Provider,{value:Ee,children:Re})}function getThemeProps(Ee){const{theme:Re,name:Te,props:je}=Ee;if(!Re||!Re.components||!Re.components[Te])return je;const Oe=Re.components[Te];return Oe.defaultProps?resolveProps(Oe.defaultProps,je):!Oe.styleOverrides&&!Oe.variants?resolveProps(Oe,je):je}function useDefaultProps$1({props:Ee,name:Re}){const Te=reactExports.useContext(PropsContext);return getThemeProps({props:Ee,name:Re,theme:{components:Te}})}function useLayerOrder(Ee){const Re=useTheme$4(),Te=useId()||"",{modularCssLayers:je}=Ee;let Oe="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!je||Re!==null?Oe="":typeof je=="string"?Oe=je.replace(/mui(?!\.)/g,Oe):Oe=`@layer ${Oe};`,useEnhancedEffect(()=>{const Me=document.querySelector("head");if(!Me)return;const De=Me.firstChild;if(Oe){var $e;if(De&&($e=De.hasAttribute)!=null&&$e.call(De,"data-mui-layer-order")&&De.getAttribute("data-mui-layer-order")===Te)return;const Ue=document.createElement("style");Ue.setAttribute("data-mui-layer-order",Te),Ue.textContent=Oe,Me.prepend(Ue)}else{var Be;(Be=Me.querySelector(`style[data-mui-layer-order="${Te}"]`))==null||Be.remove()}},[Oe,Te]),Oe?jsxRuntimeExports.jsx(GlobalStyles$1,{styles:Oe}):null}const EMPTY_THEME={};function useThemeScoping(Ee,Re,Te,je=!1){return reactExports.useMemo(()=>{const Oe=Ee&&Re[Ee]||Re;if(typeof Te=="function"){const Me=Te(Oe),De=Ee?_extends$1({},Re,{[Ee]:Me}):Me;return je?()=>De:De}return Ee?_extends$1({},Re,{[Ee]:Te}):_extends$1({},Re,Te)},[Ee,Re,Te,je])}function ThemeProvider$2(Ee){const{children:Re,theme:Te,themeId:je}=Ee,Oe=useTheme$4(EMPTY_THEME),Me=useTheme$2()||EMPTY_THEME,De=useThemeScoping(je,Oe,Te),$e=useThemeScoping(je,Me,Te,!0),Be=De.direction==="rtl",Ue=useLayerOrder(De);return jsxRuntimeExports.jsx(ThemeProvider$3,{theme:$e,children:jsxRuntimeExports.jsx(ThemeContext$2.Provider,{value:De,children:jsxRuntimeExports.jsx(RtlProvider,{value:Be,children:jsxRuntimeExports.jsxs(DefaultPropsProvider,{value:De==null?void 0:De.components,children:[Ue,Re]})})})})}function _typeof(Ee){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Re){return typeof Re}:function(Re){return Re&&typeof Symbol=="function"&&Re.constructor===Symbol&&Re!==Symbol.prototype?"symbol":typeof Re},_typeof(Ee)}const _excluded$1j=["className","component","disableGutters","fixed","maxWidth","classes"],defaultTheme$3=createTheme$2(),defaultCreateStyledComponent$1=styled$1("div",{name:"MuiContainer",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[`maxWidth${capitalize$1(String(Te.maxWidth))}
475`],Te.fixed&&Re.fixed,Te.disableGutters&&Re.disableGutters]}}),useThemePropsDefault$1=Ee=>useThemeProps({props:Ee,name:"MuiContainer",defaultTheme:defaultTheme$3}),useUtilityClasses$12=(Ee,Re)=>{const Te=Be=>generateUtilityClass(Re,Be),{classes:je,fixed:Oe,disableGutters:Me,maxWidth:De}=Ee,$e={root:["root",De&&`maxWidth${capitalize$1(String(De))}`,Oe&&"fixed",Me&&"disableGutters"]};return composeClasses($e,Te,je)};function createContainer(Ee={}){const{createStyledComponent:Re=defaultCreateStyledComponent$1,useThemeProps:Te=useThemePropsDefault$1,componentName:je="MuiContainer"}=Ee,Oe=Re(({theme:De,ownerState:$e})=>_extends$1({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!$e.disableGutters&&{paddingLeft:De.spacing(2),paddingRight:De.spacing(2),[De.breakpoints.up("sm")]:{paddingLeft:De.spacing(3),paddingRight:De.spacing(3)}}),({theme:De,ownerState:$e})=>$e.fixed&&Object.keys(De.breakpoints.values).reduce((Be,Ue)=>{const ze=Ue,We=De.breakpoints.values[ze];return We!==0&&(Be[De.breakpoints.up(ze)]={maxWidth:`${We}${De.breakpoints.unit}`}),Be},{}),({theme:De,ownerState:$e})=>_extends$1({},$e.maxWidth==="xs"&&{[De.breakpoints.up("xs")]:{maxWidth:Math.max(De.breakpoints.values.xs,444)}},$e.maxWidth&&$e.maxWidth!=="xs"&&{[De.breakpoints.up($e.maxWidth)]:{maxWidth:`${De.breakpoints.values[$e.maxWidth]}${De.breakpoints.unit}`}}));return reactExports.forwardRef(function($e,Be){const Ue=Te($e),{className:ze,component:We="div",disableGutters:Xe=!1,fixed:He=!1,maxWidth:qe="lg"}=Ue,Ge=_objectWithoutPropertiesLoose(Ue,_excluded$1j),Ye=_extends$1({},Ue,{component:We,disableGutters:Xe,fixed:He,maxWidth:qe}),Ve=useUtilityClasses$12(Ye,je);return jsxRuntimeExports.jsx(Oe,_extends$1({as:We,ownerState:Ye,className:clsx(Ve.root,ze),ref:Be},Ge))})}const _excluded$1i=["component","direction","spacing","divider","children","className","useFlexGap"],defaultTheme$2=createTheme$2(),defaultCreateStyledComponent=styled$1("div",{name:"MuiStack",slot:"Root",overridesResolver:(Ee,Re)=>Re.root});function useThemePropsDefault(Ee){return useThemeProps({props:Ee,name:"MuiStack",defaultTheme:defaultTheme$2})}function joinChildren(Ee,Re){const Te=reactExports.Children.toArray(Ee).filter(Boolean);return Te.reduce((je,Oe,Me)=>(je.push(Oe),Me<Te.length-1&&je.push(reactExports.cloneElement(Re,{key:`separator-${Me}`})),je),[])}const getSideFromDirection=Ee=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[Ee],style=({ownerState:Ee,theme:Re})=>{let Te=_extends$1({display:"flex",flexDirection:"column"},handleBreakpoints({theme:Re},resolveBreakpointValues({values:Ee.direction,breakpoints:Re.breakpoints.values}),je=>({flexDirection:je})));if(Ee.spacing){const je=createUnarySpacing(Re),Oe=Object.keys(Re.breakpoints.values).reduce((Be,Ue)=>((typeof Ee.spacing=="object"&&Ee.spacing[Ue]!=null||typeof Ee.direction=="object"&&Ee.direction[Ue]!=null)&&(Be[Ue]=!0),Be),{}),Me=resolveBreakpointValues({values:Ee.direction,base:Oe}),De=resolveBreakpointValues({values:Ee.spacing,base:Oe});typeof Me=="object"&&Object.keys(Me).forEach((Be,Ue,ze)=>{if(!Me[Be]){const Xe=Ue>0?Me[ze[Ue-1]]:"column";Me[Be]=Xe}}),Te=deepmerge$1(Te,handleBreakpoints({theme:Re},De,(Be,Ue)=>Ee.useFlexGap?{gap:getValue(je,Be)}:{"& > :not(style):not(style)":{margin:0},"& >
475 :not(style) ~ :not(style)":{[`margin${getSideFromDirection(Ue?Me[Ue]:Ee.direction)}`]:getValue(je,Be)}}))}return Te=mergeBreakpointsInOrder(Re.breakpoints,Te),Te};function createStack(Ee={}){const{createStyledComponent:Re=defaultCreateStyledComponent,useThemeProps:Te=useThemePropsDefault,componentName:je="MuiStack"}=Ee,Oe=()=>composeClasses({root:["root"]},Be=>generateUtilityClass(je,Be),{}),Me=Re(style);return reactExports.forwardRef(function(Be,Ue){const ze=Te(Be),We=extendSxProp(ze),{component:Xe="div",direction:He="column",spacing:qe=0,divider:Ge,children:Ye,className:Ve,useFlexGap:Ke=!1}=We,Qe=_objectWithoutPropertiesLoose(We,_excluded$1i),Ze={direction:He,spacing:qe,useFlexGap:Ke},Je=Oe();return jsxRuntimeExports.jsx(Me,_extends$1({as:Xe,ownerState:Ze,ref:Ue,className:clsx(Je.root,Ve)},Qe,{children:Ge?joinChildren(Ye,Ge):Ye}))})}function createMixins(Ee,Re){return _extends$1({toolbar:{minHeight:56,[Ee.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[Ee.up("sm")]:{minHeight:64}}},Re)}var colorManipulator={},interopRequireDefault={exports:{}};(function(Ee){function Re(Te){return Te&&Te.__esModule?Te:{default:Te}}Ee.exports=Re,Ee.exports.__esModule=!0,Ee.exports.default=Ee.exports})(interopRequireDefault);var interopRequireDefaultExports=interopRequireDefault.exports;const require$$1$1=getAugmentedNamespace(formatMuiErrorMessage),require$$2=getAugmentedNamespace(clamp$1);var _interopRequireDefault$5=interopRequireDefaultExports;Object.defineProperty(colorManipulator,"__esModule",{value:!0});var alpha_1=colorManipulator.alpha=alpha;colorManipulator.blend=blend;colorManipulator.colorChannel=void 0;var darken_1=colorManipulator.darken=darken;colorManipulator.decomposeColor=decomposeColor;var emphasize_1=colorManipulator.emphasize=emphasize,getContrastRatio_1=colorManipulator.getContrastRatio=getContrastRatio;colorManipulator.getLuminance=getLuminance;colorManipulator.hexToRgb=hexToRgb;colorManipulator.hslToRgb=hslToRgb;var lighten_1=colorManipulator.lighten=lighten;colorManipulator.private_safeAlpha=private_safeAlpha;colorManipulator.private_safeColorChannel=void 0;colorManipulator.private_safeDarken=private_safeDarken;colorManipulator.private_safeEmphasize=private_safeEmphasize;colorManipulator.private_safeLighten=private_safeLighten;colorManipulator.recomposeColor=recomposeColor;colorManipulator.rgbToHex=rgbToHex;var _formatMuiErrorMessage2=_interopRequireDefault$5(require$$1$1),_clamp=_interopRequireDefault$5(require$$2);function clampWrapper(Ee,Re=0,Te=1){return(0,_clamp.default)(Ee,Re,Te)}function hexToRgb(Ee){Ee=Ee.slice(1);const Re=new RegExp(`.{1,${Ee.length>=6?2:1}}`,"g");let Te=Ee.match(Re);return Te&&Te[0].length===1&&(Te=Te.map(je=>je+je)),Te?`rgb${Te.length===4?"a":""}(${Te.map((je,Oe)=>Oe<3?parseInt(je,16):Math.round(parseInt(je,16)/255*1e3)/1e3).join(", ")})`:""}function intToHex(Ee){const Re=Ee.toString(16);return Re.length===1?`0${Re}`:Re}function decomposeColor(Ee){if(Ee.type)return Ee;if(Ee.charAt(0)==="#")return decomposeColor(hexToRgb(Ee));const Re=Ee.indexOf("("),Te=Ee.substring(0,Re);if(["rgb","rgba","hsl","hsla","color"].indexOf(Te)===-1)throw new Error((0,_formatMuiErrorMessage2.default)(9,Ee));let je=Ee.substring(Re+1,Ee.length-1),Oe;if(Te==="color"){if(je=je.split(" "),Oe=je.shift(),je.length===4&&je[3].charAt(0)==="/"&&(je[3]=je[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(Oe)===-1)throw new Error((0,_formatMuiErrorMessage2.default)(10,Oe))}else je=je.split(",");return je=je.map(Me=>parseFloat(Me)),{type:Te,values:je,colorSpace:Oe}}const colorChannel=Ee=>{const Re=decomposeColor(Ee);return Re.values.slice(0,3).map((Te,je)=>Re.type.indexOf("hsl")!==-1&&je!==0?`${Te}%`:Te).join(" ")};colorManipulator.colorChannel=colorChannel;const private_safeColorChannel=(Ee,Re)=>{try{return colorChannel(Ee)}catch{return Ee}};colorManipulator.private_safeColorChannel=private_safeColorChannel;function recomposeColor(Ee){const{type:Re,colorSpace:Te}=Ee;let{values:je}=Ee;return Re.indexOf("rgb")!==-1?je=je.map((Oe,Me)=>Me<3?parseInt(Oe,10):Oe):Re.indexOf("hsl")!==-1&&(je[1]=`${je[1]}%`,je[2]=`${je[2]}%`),Re.indexOf("color")!==-1?je=`${Te} ${je.join(" ")}`:je=`${je.join(", ")}`,`${Re}(${je})`}function rgbToHex(Ee){if(Ee.indexOf("#")===0)return Ee;const{values:Re}=decomposeColor(Ee);return`#${Re.map((Te,je)=>intToHex(je===3?Math.round(255*Te):Te)).join("")}`}function hslToRgb(Ee){Ee=decomposeColor(Ee);const{values:Re}=Ee,Te=Re[0],je=Re[1]/100,Oe=Re[2]/100,Me=je*Math.min(Oe,1-Oe),De=(Ue,ze=(Ue+Te/30)%12)=>Oe-Me*Math.max(Math.min(ze-3,9-ze,1),-1);let $e="rgb";const Be=[Math.round(De(0)*255),Math.round(De(8)*255),Math.round(De(4)*255
vendor: 5,015 bytes, line 475
475)];return Ee.type==="hsla"&&($e+="a",Be.push(Re[3])),recomposeColor({type:$e,values:Be})}function getLuminance(Ee){Ee=decomposeColor(Ee);let Re=Ee.type==="hsl"||Ee.type==="hsla"?decomposeColor(hslToRgb(Ee)).values:Ee.values;return Re=Re.map(Te=>(Ee.type!=="color"&&(Te/=255),Te<=.03928?Te/12.92:((Te+.055)/1.055)**2.4)),Number((.2126*Re[0]+.7152*Re[1]+.0722*Re[2]).toFixed(3))}function getContrastRatio(Ee,Re){const Te=getLuminance(Ee),je=getLuminance(Re);return(Math.max(Te,je)+.05)/(Math.min(Te,je)+.05)}function alpha(Ee,Re){return Ee=decomposeColor(Ee),Re=clampWrapper(Re),(Ee.type==="rgb"||Ee.type==="hsl")&&(Ee.type+="a"),Ee.type==="color"?Ee.values[3]=`/${Re}`:Ee.values[3]=Re,recomposeColor(Ee)}function private_safeAlpha(Ee,Re,Te){try{return alpha(Ee,Re)}catch{return Ee}}function darken(Ee,Re){if(Ee=decomposeColor(Ee),Re=clampWrapper(Re),Ee.type.indexOf("hsl")!==-1)Ee.values[2]*=1-Re;else if(Ee.type.indexOf("rgb")!==-1||Ee.type.indexOf("color")!==-1)for(let Te=0;Te<3;Te+=1)Ee.values[Te]*=1-Re;return recomposeColor(Ee)}function private_safeDarken(Ee,Re,Te){try{return darken(Ee,Re)}catch{return Ee}}function lighten(Ee,Re){if(Ee=decomposeColor(Ee),Re=clampWrapper(Re),Ee.type.indexOf("hsl")!==-1)Ee.values[2]+=(100-Ee.values[2])*Re;else if(Ee.type.indexOf("rgb")!==-1)for(let Te=0;Te<3;Te+=1)Ee.values[Te]+=(255-Ee.values[Te])*Re;else if(Ee.type.indexOf("color")!==-1)for(let Te=0;Te<3;Te+=1)Ee.values[Te]+=(1-Ee.values[Te])*Re;return recomposeColor(Ee)}function private_safeLighten(Ee,Re,Te){try{return lighten(Ee,Re)}catch{return Ee}}function emphasize(Ee,Re=.15){return getLuminance(Ee)>.5?darken(Ee,Re):lighten(Ee,Re)}function private_safeEmphasize(Ee,Re,Te){try{return emphasize(Ee,Re)}catch{return Ee}}function blend(Ee,Re,Te,je=1){const Oe=(Be,Ue)=>Math.round((Be**(1/je)*(1-Te)+Ue**(1/je)*Te)**je),Me=decomposeColor(Ee),De=decomposeColor(Re),$e=[Oe(Me.values[0],De.values[0]),Oe(Me.values[1],De.values[1]),Oe(Me.values[2],De.values[2])];return recomposeColor({type:"rgb",values:$e})}const common$1={black:"#000",white:"#fff"},grey={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},purple={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},red={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},orange={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},blue={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},lightBlue={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},green={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},_excluded$1h=["mode","contrastThreshold","tonalOffset"],light={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:common$1.white,default:common$1.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},dark={text:{primary:common$1.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:common$1.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function addLightOrDark(Ee,Re,Te,je){const Oe=je.light||je,Me=je.dark||je*1.5;Ee[Re]||(Ee.hasOwnProperty(Te)?Ee[Re]=Ee[Te]:Re==="light"?Ee.light=lighten_1(Ee.main,Oe):Re==="dark"&&(Ee.dark=darken_1(Ee.main,Me)))}function getDefaultPrimary(Ee="light"){return Ee==="dark"?{main:blue[200],light:blue[50],dark:blue[400]}:{main:blue[700],light:blue[400],dark:blue[800]}}function getDefaultSecondary(Ee="light"){return Ee==="dark"?{main:purple[200],light:purple[50],dark:purple[400]}:{main:purple[500],light:purple[300],dark:purple[700]}}function getDefaultError(Ee="light"){return Ee==="dark"?{main:red[500],light:red[300],dark:red[700]}:{main:red[700],light:red[400],dark:red[800]}}function getDefaultInfo(Ee="light"){return Ee==="dark"?{main:lightBlue[400],light:lightBlue[300],dark:lightBlue[700]}:{main:lightBlue[700],light:lightBlue[500],dark:lightBlue[900]}}function getDefaultSuccess(Ee="light"){return Ee==="dark"?{main:green[400],light:green[300],dark:green[700]}:{main:green[800],light:green[500],dark:green[900]}}function getDefaultWarning(Ee="light"){return Ee==="dark"?{main:orange[400],light:orange[300],dark:orange[700]}:{main:"#ed6c02",light:orange[500],dark:orange[900]}}
475function createPalette(Ee){const{mode:Re="light",contrastThreshold:Te=3,tonalOffset:je=.2}=Ee,Oe=_objectWithoutPropertiesLoose(Ee,_excluded$1h),Me=Ee.primary||getDefaultPrimary(Re),De=Ee.secondary||getDefaultSecondary(Re),$e=Ee.error||getDefaultError(Re),Be=Ee.info||getDefaultInfo(Re),Ue=Ee.success||getDefaultSuccess(Re),ze=Ee.warning||getDefaultWarning(Re);function We(Ge){return getContrastRatio_1(Ge,dark.text.primary)>=Te?dark.text.primary:light.text.primary}const Xe=({color:Ge,name:Ye,mainShade:Ve=500,lightShade:Ke=300,darkShade:Qe=700})=>{if(Ge=_extends$1({},Ge),!Ge.main&&Ge[Ve]&&(Ge.main=Ge[Ve]),!Ge.hasOwnProperty("main"))throw new Error(formatMuiErrorMessage$1(11,Ye?` (${Ye})`:"",Ve));if(typeof Ge.main!="string")throw new Error(formatMuiErrorMessage$1(12,Ye?` (${Ye})`:"",JSON.stringify(Ge.main)));return addLightOrDark(Ge,"light",Ke,je),addLightOrDark(Ge,"dark",Qe,je),Ge.contrastText||(Ge.contrastText=We(Ge.main)),Ge},He={dark,light};return deepmerge$1(_extends$1({common:_extends$1({},common$1),mode:Re,primary:Xe({color:Me,name:"primary"}),secondary:Xe({color:De,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:Xe({color:$e,name:"error"}),warning:Xe({color:ze,name:"warning"}),info:Xe({color:Be,name:"info"}),success:Xe({color:Ue,name:"success"}),grey,contrastThreshold:Te,getContrastText:We,augmentColor:Xe,tonalOffset:je},He[Re]),Oe)}const _excluded$1g=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function round$2(Ee){return Math.round(Ee*1e5)/1e5}const caseAllCaps={textTransform:"uppercase"},defaultFontFamily='"Roboto", "Helvetica", "Arial", sans-serif';function createTypography(Ee,Re){const Te=typeof Re=="function"?Re(Ee):Re,{fontFamily:je=defaultFontFamily,fontSize:Oe=14,fontWeightLight:Me=300,fontWeightRegular:De=400,fontWeightMedium:$e=500,fontWeightBold:Be=700,htmlFontSize:Ue=16,allVariants:ze,pxToRem:We}=Te,Xe=_objectWithoutPropertiesLoose(Te,_excluded$1g),He=Oe/14,qe=We||(Ve=>`${Ve/Ue*He}rem`),Ge=(Ve,Ke,Qe,Ze,Je)=>_extends$1({fontFamily:je,fontWeight:Ve,fontSize:qe(Ke),lineHeight:Qe},je===defaultFontFamily?{letterSpacing:`${round$2(Ze/Ke)}em`}:{},Je,ze),Ye={h1:Ge(Me,96,1.167,-1.5),h2:Ge(Me,60,1.2,-.5),h3:Ge(De,48,1.167,0),h4:Ge(De,34,1.235,.25),h5:Ge(De,24,1.334,0),h6:Ge($e,20,1.6,.15),subtitle1:Ge(De,16,1.75,.15),subtitle2:Ge($e,14,1.57,.1),body1:Ge(De,16,1.5,.15),body2:Ge(De,14,1.43,.15),button:Ge($e,14,1.75,.4,caseAllCaps),caption:Ge(De,12,1.66,.4),overline:Ge(De,12,2.66,1,caseAllCaps),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return deepmerge$1(_extends$1({htmlFontSize:Ue,pxToRem:qe,fontFamily:je,fontSize:Oe,fontWeightLight:Me,fontWeightRegular:De,fontWeightMedium:$e,fontWeightBold:Be},Ye),Xe,{clone:!1})}const shadowKeyUmbraOpacity=.2,shadowKeyPenumbraOpacity=.14,shadowAmbientShadowOpacity=.12;function createShadow(...Ee){return[`${Ee[0]}px ${Ee[1]}px ${Ee[2]}px ${Ee[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`,`${Ee[4]}px ${Ee[5]}px ${Ee[6]}px ${Ee[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`,`${Ee[8]}px ${Ee[9]}px ${Ee[10]}px ${Ee[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",")}const shadows=["none",createShadow(0,2,1,-1,0,1,1,0,0,1,3,0),createShadow(0,3,1,-2,0,2,2,0,0,1,5,0),createShadow(0,3,3,-2,0,3,4,0,0,1,8,0),createShadow(0,2,4,-1,0,4,5,0,0,1,10,0),createShadow(0,3,5,-1,0,5,8,0,0,1,14,0),createShadow(0,3,5,-1,0,6,10,0,0,1,18,0),createShadow(0,4,5,-2,0,7,10,1,0,2,16,1),createShadow(0,5,5,-3,0,8,10,1,0,3,14,2),createShadow(0,5,6,-3,0,9,12,1,0,3,16,2),createShadow(0,6,6,-3,0,10,14,1,0,4,18,3),createShadow(0,6,7,-4,0,11,15,1,0,4,20,3),createShadow(0,7,8,-4,0,12,17,2,0,5,22,4),createShadow(0,7,8,-4,0,13,19,2,0,5,24,4),createShadow(0,7,9,-4,0,14,21,2,0,5,26,4),createShadow(0,8,9,-5,0,15,22,2,0,6,28,5),createShadow(0,8,10,-5,0,16,24,2,0,6,30,5),createShadow(0,8,11,-5,0,17,26,2,0,6,32,5),createShadow(0,9,11,-5,0,18,28,2,0,7,34,6),createShadow(0,9,12,-6,0,19,29,2,0,7,36,6),createShadow(0,10,13,-6,0,20,31,3,0,8,38,7),createShadow(0,10,13,-6,0,21,33,3,0,8,40,7),createShadow(0,10,14,-6,0,22,35,3,0,8,42,7),createShadow(0,11,14,-7,0,23,36,3,0,9,44,8),createShadow(0,11,15,-7,0,24,38,3,0,9,46,8)],_excluded$1f=["duration","easing","delay"],easing={easeInOut:"cub
475ic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function formatMs(Ee){return`${Math.round(Ee)}ms`}function getAutoHeightDuration(Ee){if(!Ee)return 0;const Re=Ee/36;return Math.round((4+15*Re**.25+Re/5)*10)}function createTransitions(Ee){const Re=_extends$1({},easing,Ee.easing),Te=_extends$1({},duration,Ee.duration);return _extends$1({getAutoHeightDuration,create:(Oe=["all"],Me={})=>{const{duration:De=Te.standard,easing:$e=Re.easeInOut,delay:Be=0}=Me;return _objectWithoutPropertiesLoose(Me,_excluded$1f),(Array.isArray(Oe)?Oe:[Oe]).map(Ue=>`${Ue} ${typeof De=="string"?De:formatMs(De)} ${$e} ${typeof Be=="string"?Be:formatMs(Be)}`).join(",")}},Ee,{easing:Re,duration:Te})}const zIndex={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},_excluded$1e=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function createTheme(Ee={},...Re){const{mixins:Te={},palette:je={},transitions:Oe={},typography:Me={}}=Ee,De=_objectWithoutPropertiesLoose(Ee,_excluded$1e);if(Ee.vars&&Ee.generateCssVars===void 0)throw new Error(formatMuiErrorMessage$1(18));const $e=createPalette(je),Be=createTheme$2(Ee);let Ue=deepmerge$1(Be,{mixins:createMixins(Be.breakpoints,Te),palette:$e,shadows:shadows.slice(),typography:createTypography($e,Me),transitions:createTransitions(Oe),zIndex:_extends$1({},zIndex)});return Ue=deepmerge$1(Ue,De),Ue=Re.reduce((ze,We)=>deepmerge$1(ze,We),Ue),Ue.unstable_sxConfig=_extends$1({},defaultSxConfig,De==null?void 0:De.unstable_sxConfig),Ue.unstable_sx=function(We){return styleFunctionSx$1({sx:We,theme:this})},Ue}const defaultTheme$1=createTheme();function useTheme$1(){const Ee=useTheme$3(defaultTheme$1);return Ee[THEME_ID]||Ee}var createStyled$1={},objectWithoutPropertiesLoose={exports:{}},hasRequiredObjectWithoutPropertiesLoose;function requireObjectWithoutPropertiesLoose(){return hasRequiredObjectWithoutPropertiesLoose||(hasRequiredObjectWithoutPropertiesLoose=1,function(Ee){function Re(Te,je){if(Te==null)return{};var Oe={};for(var Me in Te)if({}.hasOwnProperty.call(Te,Me)){if(je.indexOf(Me)!==-1)continue;Oe[Me]=Te[Me]}return Oe}Ee.exports=Re,Ee.exports.__esModule=!0,Ee.exports.default=Ee.exports}(objectWithoutPropertiesLoose)),objectWithoutPropertiesLoose.exports}const require$$1=getAugmentedNamespace(styledEngine),require$$4=getAugmentedNamespace(deepmerge),require$$5$1=getAugmentedNamespace(capitalize),require$$6=getAugmentedNamespace(getDisplayName),require$$7=getAugmentedNamespace(createTheme$1),require$$8=getAugmentedNamespace(styleFunctionSx);var _interopRequireDefault$4=interopRequireDefaultExports;Object.defineProperty(createStyled$1,"__esModule",{value:!0});var _default=createStyled$1.default=createStyled;createStyled$1.shouldForwardProp=shouldForwardProp;createStyled$1.systemDefaultTheme=void 0;var _extends2=_interopRequireDefault$4(require_extends()),_objectWithoutPropertiesLoose2=_interopRequireDefault$4(requireObjectWithoutPropertiesLoose()),_styledEngine$1=_interopRequireWildcard$1(require$$1),_deepmerge=require$$4;_interopRequireDefault$4(require$$5$1);_interopRequireDefault$4(require$$6);var _createTheme=_interopRequireDefault$4(require$$7),_styleFunctionSx=_interopRequireDefault$4(require$$8);const _excluded$1d=["ownerState"],_excluded2$a=["variants"],_excluded3$3=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function _getRequireWildcardCache$1(Ee){if(typeof WeakMap!="function")return null;var Re=new WeakMap,Te=new WeakMap;return(_getRequireWildcardCache$1=function(je){return je?Te:Re})(Ee)}function _interopRequireWildcard$1(Ee,Re){if(Ee&&Ee.__esModule)return Ee;if(Ee===null||typeof Ee!="object"&&typeof Ee!="function")return{default:Ee};var Te=_getRequireWildcardCache$1(Re);if(Te&&Te.has(Ee))return Te.get(Ee);var je={__proto__:null},Oe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Me in Ee)if(Me!=="default"&&Object.prototype.hasOwnProperty.call(Ee,Me)){var De=Oe?Object.getOwnPropertyDescriptor(Ee,Me):null;De&&(De.get||De.set)?Object.defineProperty(je,Me,De):je[Me]=Ee[Me]}return je.default=Ee,Te&&Te.set(Ee,je),je}function isEmpty$2(Ee){return Object.keys(Ee).length===0}function isStringTag(Ee){return typeof Ee=="string"&&Ee.charCodeAt(0)>96}function shouldForwardProp(Ee){return Ee!=="ownerState"&&Ee!=="theme"&&Ee!=="sx"&&Ee!=="as"}function shallowLayer(Ee,Re){return Re&&Ee&&typeof Ee=="object"&&Ee.styles&&
475!Ee.styles.startsWith("@layer")&&(Ee.styles=`@layer ${Re}{${String(Ee.styles)}}`),Ee}const systemDefaultTheme=createStyled$1.systemDefaultTheme=(0,_createTheme.default)(),lowercaseFirstLetter=Ee=>Ee&&Ee.charAt(0).toLowerCase()+Ee.slice(1);function resolveTheme({defaultTheme:Ee,theme:Re,themeId:Te}){return isEmpty$2(Re)?Ee:Re[Te]||Re}function defaultOverridesResolver(Ee){return Ee?(Re,Te)=>Te[Ee]:null}function processStyleArg(Ee,Re,Te){let{ownerState:je}=Re,Oe=(0,_objectWithoutPropertiesLoose2.default)(Re,_excluded$1d);const Me=typeof Ee=="function"?Ee((0,_extends2.default)({ownerState:je},Oe)):Ee;if(Array.isArray(Me))return Me.flatMap(De=>processStyleArg(De,(0,_extends2.default)({ownerState:je},Oe),Te));if(Me&&typeof Me=="object"&&Array.isArray(Me.variants)){const{variants:De=[]}=Me;let Be=(0,_objectWithoutPropertiesLoose2.default)(Me,_excluded2$a);return De.forEach(Ue=>{let ze=!0;if(typeof Ue.props=="function"?ze=Ue.props((0,_extends2.default)({ownerState:je},Oe,je)):Object.keys(Ue.props).forEach(We=>{(je==null?void 0:je[We])!==Ue.props[We]&&Oe[We]!==Ue.props[We]&&(ze=!1)}),ze){Array.isArray(Be)||(Be=[Be]);const We=typeof Ue.style=="function"?Ue.style((0,_extends2.default)({ownerState:je},Oe,je)):Ue.style;Be.push(Te?shallowLayer((0,_styledEngine$1.internal_serializeStyles)(We),Te):We)}}),Be}return Te?shallowLayer((0,_styledEngine$1.internal_serializeStyles)(Me),Te):Me}function createStyled(Ee={}){const{themeId:Re,defaultTheme:Te=systemDefaultTheme,rootShouldForwardProp:je=shouldForwardProp,slotShouldForwardProp:Oe=shouldForwardProp}=Ee,Me=De=>(0,_styleFunctionSx.default)((0,_extends2.default)({},De,{theme:resolveTheme((0,_extends2.default)({},De,{defaultTheme:Te,themeId:Re}))}));return Me.__mui_systemSx=!0,(De,$e={})=>{(0,_styledEngine$1.internal_processStyles)(De,ir=>ir.filter(rr=>!(rr!=null&&rr.__mui_systemSx)));const{name:Be,slot:Ue,skipVariantsResolver:ze,skipSx:We,overridesResolver:Xe=defaultOverridesResolver(lowercaseFirstLetter(Ue))}=$e,He=(0,_objectWithoutPropertiesLoose2.default)($e,_excluded3$3),qe=Be&&Be.startsWith("Mui")||Ue?"components":"custom",Ge=ze!==void 0?ze:Ue&&Ue!=="Root"&&Ue!=="root"||!1,Ye=We||!1;let Ve,Ke=shouldForwardProp;Ue==="Root"||Ue==="root"?Ke=je:Ue?Ke=Oe:isStringTag(De)&&(Ke=void 0);const Qe=(0,_styledEngine$1.default)(De,(0,_extends2.default)({shouldForwardProp:Ke,label:Ve},He)),Ze=ir=>typeof ir=="function"&&ir.__emotion_real!==ir||(0,_deepmerge.isPlainObject)(ir)?rr=>{const ar=resolveTheme({theme:rr.theme,defaultTheme:Te,themeId:Re});return processStyleArg(ir,(0,_extends2.default)({},rr,{theme:ar}),ar.modularCssLayers?qe:void 0)}:ir,Je=(ir,...rr)=>{let ar=Ze(ir);const or=rr?rr.map(Ze):[];Be&&Xe&&or.push(nr=>{const hr=resolveTheme((0,_extends2.default)({},nr,{defaultTheme:Te,themeId:Re}));if(!hr.components||!hr.components[Be]||!hr.components[Be].styleOverrides)return null;const sr=hr.components[Be].styleOverrides,xr={};return Object.entries(sr).forEach(([Rr,br])=>{xr[Rr]=processStyleArg(br,(0,_extends2.default)({},nr,{theme:hr}),hr.modularCssLayers?"theme":void 0)}),Xe(nr,xr)}),Be&&!Ge&&or.push(nr=>{var hr;const sr=resolveTheme((0,_extends2.default)({},nr,{defaultTheme:Te,themeId:Re})),xr=sr==null||(hr=sr.components)==null||(hr=hr[Be])==null?void 0:hr.variants;return processStyleArg({variants:xr},(0,_extends2.default)({},nr,{theme:sr}),sr.modularCssLayers?"theme":void 0)}),Ye||or.push(Me);const pr=or.length-rr.length;if(Array.isArray(ir)&&pr>0){const nr=new Array(pr).fill("");ar=[...ir,...nr],ar.raw=[...ir.raw,...nr]}const tr=Qe(ar,...or);return De.muiName&&(tr.muiName=De.muiName),tr};return Qe.withConfig&&(Je.withConfig=Qe.withConfig),Je}}function slotShouldForwardProp(Ee){return Ee!=="ownerState"&&Ee!=="theme"&&Ee!=="sx"&&Ee!=="as"}const rootShouldForwardProp=Ee=>slotShouldForwardProp(Ee)&&Ee!=="classes",styled=_default({themeId:THEME_ID,defaultTheme:defaultTheme$1,rootShouldForwardProp}),_excluded$1c=["theme"];function ThemeProvider$1(Ee){let{theme:Re}=Ee,Te=_objectWithoutPropertiesLoose(Ee,_excluded$1c);const je=Re[THEME_ID];let Oe=je||Re;return typeof Re!="function"&&(je&&!je.vars?Oe=_extends$1({},je,{vars:null}):Re&&!Re.vars&&(Oe=_extends$1({},Re,{vars:null}))),jsxRuntimeExports.jsx(ThemeProvider$2,_extends$1({},Te,{themeId:je?THEME_ID:void 0,theme:Oe}))}const getOverlayAlpha=Ee=>{let Re;return Ee<1?Re=5.11916*Ee**2:Re=4.5*Math.log(Ee+1)+2,(Re/100).toFixed(2)};function useDefaultProps(Ee){return useDefaultProps$1(Ee)}function getSvgIconUtilityClass(Ee){return generateUtilityClass("MuiSvgIcon",Ee)}generateUtilityClasses("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _excluded$1b=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],useUtilityClasses$11=Ee=>{const{color:Re,fontSize:Te,classes:je}=Ee,Oe={root:["root",Re!=="inherit"&&`color${capitalize$1(Re)}`,`fontSize${capitalize$1(Te)}`]};return composeClasses(Oe,getSvgIconUtilityClass,je)},SvgIconRoot=styled("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.color!=="inherit"&&Re[`color${capitalize$1(Te.color)}`],Re[`fontSize${capitalize$1(Te.fontSize)}`]]}})(({theme:Ee,ownerState:Re})=>{var Te,je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:Re.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(Te=Ee.transitions)==null||(je=Te.create)==null?void 0:je.call(Te,"fill",{duration:(Oe=Ee.transitions)==null||(Oe=Oe.duration)==null?void 0:Oe.shorter}),fontSize:{inherit:"inherit",small:((Me=Ee.typography)==null||(De=Me.pxToRem)==null?void 0:De.call(Me,20))||"1.25rem",medium:(($e=Ee.typography)==null||(Be=$e.pxToRem)==null?void 0:Be.call($e,24))||"1.5rem",large:((Ue=Ee.typography)==null||(ze=Ue.pxToRem)==null?void 0:ze.call(Ue,35))||"2.1875rem"}[Re.fontSize],color:(We=(Xe=(Ee.vars||Ee).palette)==null||(Xe=Xe[Re.color])==null?void 0:Xe.main)!=null?We:{action:(He=(Ee.vars||Ee).palette)==null||(He=He.action)==null?void 0:He.active,disabled:(qe=(Ee.vars||Ee).palette)==null||(qe=qe.action)==null?void 0:qe.disabled,inherit:void 0}[Re.color]}}),SvgIcon=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiSvgIcon"}),{children:Oe,className:Me,color:De="inherit",component:$e="svg",fontSize:Be="medium",htmlColor:Ue,inheritViewBox:ze=!1,titleAccess:We,viewBox:Xe="0 0 24 24"}=je,He=_objectWithoutPropertiesLoose(je,_excluded$1b),qe=reactExports.isValidElement(Oe)&&Oe.type==="svg",Ge=_extends$1({},je,{color:De,component:$e,fontSize:Be,instanceFontSize:Re.fontSize,inheritViewBox:ze,viewBox:Xe,hasSvgAsChild:qe}),Ye={};ze||(Ye.viewBox=Xe);const Ve=useUtilityClasses$11(Ge);return jsxRuntimeExports.jsxs(SvgIconRoot,_extends$1({as:$e,className:clsx(Ve.root,Me),focusable:"false",color:Ue,"aria-hidden":We?void 0:!0,role:We?"img":void 0,ref:Te},Ye,He,qe&&Oe.props,{ownerState:Ge,children:[qe?Oe.props.children:Oe,We?jsxRuntimeExports.jsx("title",{children:We}):null]}))});SvgIcon.muiName="SvgIcon";function createSvgIcon$1(Ee,Re){function Te(je,Oe){return jsxRuntimeExports.jsx(SvgIcon,_extends$1({"data-testid":`${Re}Icon`,ref:Oe},je,{children:Ee}))}return Te.muiName=SvgIcon.muiName,reactExports.memo(reactExports.forwardRef(Te))}const unstable_ClassNameGenerator={configure:Ee=>{ClassNameGenerator.configure(Ee)}},utils=Object.freeze(Object.defineProperty({__proto__:null,capitalize:capitalize$1,createChainedFunction,createSvgIcon:createSvgIcon$1,debounce:debounce$1,deprecatedPropType,isMuiElement,ownerDocument,ownerWindow,requirePropFactory,setRef,unstable_ClassNameGenerator,unstable_useEnhancedEffect:useEnhancedEffect,unstable_useId:useId,unsupportedProp,useControlled,useEventCallback,useForkRef,useIsFocusVisible},Symbol.toStringTag,{value:"Module"}));function _setPrototypeOf(Ee,Re){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Te,je){return Te.__proto__=je,Te},_setPrototypeOf(Ee,Re)}function _inheritsLoose(Ee,Re){Ee.prototype=Object.create(Re.prototype),Ee.prototype.constructor=Ee,_setPrototypeOf(Ee,Re)}const config={disabled:!1},TransitionGroupContext=React$3.createContext(null);var forceReflow=function(Re){return Re.scrollTop},UNMOUNTED="unmounted",EXITED="exited",ENTERING="entering",ENTERED="entered",EXITING="exiting",Transition=function(Ee){_inheritsLoose(Re,Ee);function Re(je,Oe){var Me;Me=Ee.call(this,je,Oe)||this;var De=Oe,$e=De&&!De.isMounting?je.enter:je.appear,Be;return Me.appearStatus=null,je.in?$e?(Be=EXITED,Me.appearStatus=ENTERING):Be=ENTERED:je.unmountOnExit||je.mountOnEnter?Be=UNMOUNTED:Be=EXITED,Me.state={status:Be},Me.nextCallback=null,Me}Re.getDerivedStateFromProps=function(Oe,Me){var De=Oe.in;return De&&Me.status===UNMOUNTED?{status:EXITED}:null};var Te=Re.prototype;return Te.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},Te.componentDidUpdate=function(Oe){var Me=null;if(Oe!==this.props){var De=this.state.status;this.props.in?De!==ENTERING&&De!==ENTERED&&(Me=ENTERING):(De===ENTERING||De===ENTERED)&&(Me=EXITING)}this.updateStatus(!1,Me)},Te.componentWillUnmount=function(){this.cancelNextCallback()},Te.getTimeouts=function(){var Oe=this.props.timeout,Me,De,$e;return Me=De=$e=Oe,Oe!=null&&typeof Oe!="number"&&(Me=Oe.exit,De=Oe.enter,$e=Oe.appear!==void 0?Oe.appear:De),{exit:Me,enter:De,appear:$e}},Te.updateStatus=function(Oe,Me){if(Oe===void 0&&(Oe=!1),Me!==null)if(this.cancelNextCallback(),Me===ENTERING){if(this.props.unmountOnExit||this.props.mountOnEnter){var De=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this);De&&forceReflow(De)}this.performEnter(Oe)}else this.performExit();else this.props.unmountOnExit&&this.state.status===EXITED&&this.setState({status:UNMOUNTED})},Te.performEnter=function(Oe){var Me=this,De=this.props.enter,$e=this.context?this.context.
vendor: 4,304 bytes, line 475
475isMounting:Oe,Be=this.props.nodeRef?[$e]:[ReactDOM.findDOMNode(this),$e],Ue=Be[0],ze=Be[1],We=this.getTimeouts(),Xe=$e?We.appear:We.enter;if(!Oe&&!De||config.disabled){this.safeSetState({status:ENTERED},function(){Me.props.onEntered(Ue)});return}this.props.onEnter(Ue,ze),this.safeSetState({status:ENTERING},function(){Me.props.onEntering(Ue,ze),Me.onTransitionEnd(Xe,function(){Me.safeSetState({status:ENTERED},function(){Me.props.onEntered(Ue,ze)})})})},Te.performExit=function(){var Oe=this,Me=this.props.exit,De=this.getTimeouts(),$e=this.props.nodeRef?void 0:ReactDOM.findDOMNode(this);if(!Me||config.disabled){this.safeSetState({status:EXITED},function(){Oe.props.onExited($e)});return}this.props.onExit($e),this.safeSetState({status:EXITING},function(){Oe.props.onExiting($e),Oe.onTransitionEnd(De.exit,function(){Oe.safeSetState({status:EXITED},function(){Oe.props.onExited($e)})})})},Te.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},Te.safeSetState=function(Oe,Me){Me=this.setNextCallback(Me),this.setState(Oe,Me)},Te.setNextCallback=function(Oe){var Me=this,De=!0;return this.nextCallback=function($e){De&&(De=!1,Me.nextCallback=null,Oe($e))},this.nextCallback.cancel=function(){De=!1},this.nextCallback},Te.onTransitionEnd=function(Oe,Me){this.setNextCallback(Me);var De=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this),$e=Oe==null&&!this.props.addEndListener;if(!De||$e){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var Be=this.props.nodeRef?[this.nextCallback]:[De,this.nextCallback],Ue=Be[0],ze=Be[1];this.props.addEndListener(Ue,ze)}Oe!=null&&setTimeout(this.nextCallback,Oe)},Te.render=function(){var Oe=this.state.status;if(Oe===UNMOUNTED)return null;var Me=this.props,De=Me.children;Me.in,Me.mountOnEnter,Me.unmountOnExit,Me.appear,Me.enter,Me.exit,Me.timeout,Me.addEndListener,Me.onEnter,Me.onEntering,Me.onEntered,Me.onExit,Me.onExiting,Me.onExited,Me.nodeRef;var $e=_objectWithoutPropertiesLoose(Me,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return React$3.createElement(TransitionGroupContext.Provider,{value:null},typeof De=="function"?De(Oe,$e):React$3.cloneElement(React$3.Children.only(De),$e))},Re}(React$3.Component);Transition.contextType=TransitionGroupContext;Transition.propTypes={};function noop(){}Transition.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop,onEntering:noop,onEntered:noop,onExit:noop,onExiting:noop,onExited:noop};Transition.UNMOUNTED=UNMOUNTED;Transition.EXITED=EXITED;Transition.ENTERING=ENTERING;Transition.ENTERED=ENTERED;Transition.EXITING=EXITING;function _assertThisInitialized(Ee){if(Ee===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ee}function getChildMapping(Ee,Re){var Te=function(Me){return Re&&reactExports.isValidElement(Me)?Re(Me):Me},je=Object.create(null);return Ee&&reactExports.Children.map(Ee,function(Oe){return Oe}).forEach(function(Oe){je[Oe.key]=Te(Oe)}),je}function mergeChildMappings(Ee,Re){Ee=Ee||{},Re=Re||{};function Te(ze){return ze in Re?Re[ze]:Ee[ze]}var je=Object.create(null),Oe=[];for(var Me in Ee)Me in Re?Oe.length&&(je[Me]=Oe,Oe=[]):Oe.push(Me);var De,$e={};for(var Be in Re){if(je[Be])for(De=0;De<je[Be].length;De++){var Ue=je[Be][De];$e[je[Be][De]]=Te(Ue)}$e[Be]=Te(Be)}for(De=0;De<Oe.length;De++)$e[Oe[De]]=Te(Oe[De]);return $e}function getProp(Ee,Re,Te){return Te[Re]!=null?Te[Re]:Ee.props[Re]}function getInitialChildMapping(Ee,Re){return getChildMapping(Ee.children,function(Te){return reactExports.cloneElement(Te,{onExited:Re.bind(null,Te),in:!0,appear:getProp(Te,"appear",Ee),enter:getProp(Te,"enter",Ee),exit:getProp(Te,"exit",Ee)})})}function getNextChildMapping(Ee,Re,Te){var je=getChildMapping(Ee.children),Oe=mergeChildMappings(Re,je);return Object.keys(Oe).forEach(function(Me){var De=Oe[Me];if(reactExports.isValidElement(De)){var $e=Me in Re,Be=Me in je,Ue=Re[Me],ze=reactExports.isValidElement(Ue)&&!Ue.props.in;Be&&(!$e||ze)?Oe[Me]=reactExports.cloneElement(De,{onExited:Te.bind(null,De),in:!0,exit:getProp(De,"exit",Ee),enter:getProp(De,"enter",Ee)}
vendor: 20,327 bytes, lines 475-548
475):!Be&&$e&&!ze?Oe[Me]=reactExports.cloneElement(De,{in:!1}):Be&&$e&&reactExports.isValidElement(Ue)&&(Oe[Me]=reactExports.cloneElement(De,{onExited:Te.bind(null,De),in:Ue.props.in,exit:getProp(De,"exit",Ee),enter:getProp(De,"enter",Ee)}))}}),Oe}var values$1=Object.values||function(Ee){return Object.keys(Ee).map(function(Re){return Ee[Re]})},defaultProps={component:"div",childFactory:function(Re){return Re}},TransitionGroup=function(Ee){_inheritsLoose(Re,Ee);function Re(je,Oe){var Me;Me=Ee.call(this,je,Oe)||this;var De=Me.handleExited.bind(_assertThisInitialized(Me));return Me.state={contextValue:{isMounting:!0},handleExited:De,firstRender:!0},Me}var Te=Re.prototype;return Te.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},Te.componentWillUnmount=function(){this.mounted=!1},Re.getDerivedStateFromProps=function(Oe,Me){var De=Me.children,$e=Me.handleExited,Be=Me.firstRender;return{children:Be?getInitialChildMapping(Oe,$e):getNextChildMapping(Oe,De,$e),firstRender:!1}},Te.handleExited=function(Oe,Me){var De=getChildMapping(this.props.children);Oe.key in De||(Oe.props.onExited&&Oe.props.onExited(Me),this.mounted&&this.setState(function($e){var Be=_extends$1({},$e.children);return delete Be[Oe.key],{children:Be}}))},Te.render=function(){var Oe=this.props,Me=Oe.component,De=Oe.childFactory,$e=_objectWithoutPropertiesLoose(Oe,["component","childFactory"]),Be=this.state.contextValue,Ue=values$1(this.state.children).map(De);return delete $e.appear,delete $e.enter,delete $e.exit,Me===null?React$3.createElement(TransitionGroupContext.Provider,{value:Be},Ue):React$3.createElement(TransitionGroupContext.Provider,{value:Be},React$3.createElement(Me,$e,Ue))},Re}(React$3.Component);TransitionGroup.propTypes={};TransitionGroup.defaultProps=defaultProps;const reflow=Ee=>Ee.scrollTop;function getTransitionProps(Ee,Re){var Te,je;const{timeout:Oe,easing:Me,style:De={}}=Ee;return{duration:(Te=De.transitionDuration)!=null?Te:typeof Oe=="number"?Oe:Oe[Re.mode]||0,easing:(je=De.transitionTimingFunction)!=null?je:typeof Me=="object"?Me[Re.mode]:Me,delay:De.transitionDelay}}function getCollapseUtilityClass(Ee){return generateUtilityClass("MuiCollapse",Ee)}generateUtilityClasses("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const _excluded$1a=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],useUtilityClasses$10=Ee=>{const{orientation:Re,classes:Te}=Ee,je={root:["root",`${Re}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${Re}`],wrapperInner:["wrapperInner",`${Re}`]};return composeClasses(je,getCollapseUtilityClass,Te)},CollapseRoot=styled("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[Te.orientation],Te.state==="entered"&&Re.entered,Te.state==="exited"&&!Te.in&&Te.collapsedSize==="0px"&&Re.hidden]}})(({theme:Ee,ownerState:Re})=>_extends$1({height:0,overflow:"hidden",transition:Ee.transitions.create("height")},Re.orientation==="horizontal"&&{height:"auto",width:0,transition:Ee.transitions.create("width")},Re.state==="entered"&&_extends$1({height:"auto",overflow:"visible"},Re.orientation==="horizontal"&&{width:"auto"}),Re.state==="exited"&&!Re.in&&Re.collapsedSize==="0px"&&{visibility:"hidden"})),CollapseWrapper=styled("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(Ee,Re)=>Re.wrapper})(({ownerState:Ee})=>_extends$1({display:"flex",width:"100%"},Ee.orientation==="horizontal"&&{width:"auto",height:"100%"})),CollapseWrapperInner=styled("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(Ee,Re)=>Re.wrapperInner})(({ownerState:Ee})=>_extends$1({width:"100%"},Ee.orientation==="horizontal"&&{width:"auto",height:"100%"})),Collapse=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiCollapse"}),{addEndListener:Oe,children:Me,className:De,collapsedSize:$e="0px",component:Be,easing:Ue,in:ze,onEnter:We,onEntered:Xe,onEntering:He,onExit:qe,onExited:Ge,onExiting:Ye,orientation:Ve="vertical",style:Ke,timeout:Qe=duration.standard,TransitionComponent:Ze=Transition}=je,Je=_objectWithoutPropertiesLoose(je,_excluded$1a),ir=_extends$1({},je,{orientation:Ve,collapsedSize:$e}),rr=useUtilityClasses$10(ir),ar=useTheme$1(),or=useTimeout(),pr=reactExports.useRef(null),tr=reactExports.useRef(),nr=typeof $e=="number"?`${$e}px`:$e,hr=Ve==="horizontal",sr=hr?"width":"height",xr=reactExports.useRef(null),Rr=useForkRef(Te,xr),br=_r=>Ir=>{if(_r){const Ar=xr.current;Ir===void 0?_r(Ar):_r(Ar,Ir)}},wr=()=>pr.current?pr.current[hr?"clientWidth":"clientHeight"]:0,vr=br((_r,Ir)=>{pr.current&&hr&&(pr.current.style.position="absolute"),_r.style[sr]=nr,We&&We(_r,Ir)}),Dr=br((_r,Ir)=>{const Ar=wr();pr.current&&hr&&(pr.current.style.position="");const{duration:Tr,easing:Nr}=getTransitionProps({style:Ke,timeout:Qe,easing:Ue},{mode:"enter"});if(Qe==="auto"){const Br=ar.transitions.getAutoHeightDuration(Ar);_r.style.transitionDuration=`${Br}ms`,tr.current=Br}else _r.style.transitionDuration=typeof Tr=="string"?Tr:`${Tr}ms`;_r.style[sr]=`${Ar}px`,_r.style.transitionTimingFunction=Nr,He&&He(_r,Ir)}),kr=br((_r,Ir)=>{_r.style[sr]="auto",Xe&&Xe(_r,Ir)}),cr=br(_r=>{_r.style[sr]=`${wr()}px`,qe&&qe(_r)}),dr=br(Ge),ur=br(_r=>{const Ir=wr(),{duration:Ar,easing:Tr}=getTransitionProps({style:Ke,timeout:Qe,easing:Ue},{mode:"exit"});if(Qe==="auto"){const Nr=ar.transitions.getAutoHeightDuration(Ir);_r.style.transitionDuration=`${Nr}ms`,tr.current=Nr}else _r.style.transitionDuration=typeof Ar=="string"?Ar:`${Ar}ms`;_r.style[sr]=nr,_r.style.transitionTimingFunction=Tr,Ye&&Ye(_r)}),gr=_r=>{Qe==="auto"&&or.start(tr.current||0,_r),Oe&&Oe(xr.current,_r)};return jsxRuntimeExports.jsx(Ze,_extends$1({in:ze,onEnter:vr,onEntered:kr,onEntering:Dr,onExit:cr,onExited:dr,onExiting:ur,addEndListener:gr,nodeRef:xr,timeout:Qe==="auto"?null:Qe},Je,{children:(_r,Ir)=>jsxRuntimeExports.jsx(CollapseRoot,_extends$1({as:Be,className:clsx(rr.root,De,{entered:rr.entered,exited:!ze&&nr==="0px"&&rr.hidden}[_r]),style:_extends$1({[hr?"minWidth":"minHeight"]:nr},Ke),ref:Rr},Ir,{ownerState:_extends$1({},ir,{state:_r}),children:jsxRuntimeExports.jsx(CollapseWrapper,{ownerState:_extends$1({},ir,{state:_r}),className:rr.wrapper,ref:pr,children:jsxRuntimeExports.jsx(CollapseWrapperInner,{ownerState:_extends$1({},ir,{state:_r}),className:rr.wrapperInner,children:Me})})}))}))});Collapse.muiSupportAuto=!0;function getPaperUtilityClass(Ee){return generateUtilityClass("MuiPaper",Ee)}generateUtilityClasses("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const _excluded$19=["className","component","elevation","square","variant"],useUtilityClasses$$=Ee=>{const{square:Re,elevation:Te,variant:je,classes:Oe}=Ee,Me={root:["root",je,!Re&&"rounded",je==="elevation"&&`elevation${Te}`]};return composeClasses(Me,getPaperUtilityClass,Oe)},PaperRoot=styled("div",{name:"MuiPaper",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[Te.variant],!Te.square&&Re.rounded,Te.variant==="elevation"&&Re[`elevation${Te.elevation}`]]}})(({theme:Ee,ownerState:Re})=>{var Te;return _extends$1({backgroundColor:(Ee.vars||Ee).palette.background.paper,color:(Ee.vars||Ee).palette.text.primary,transition:Ee.transitions.create("box-shadow")},!Re.square&&{borderRadius:Ee.shape.borderRadius},Re.variant==="outlined"&&{border:`1px solid ${(Ee.vars||Ee).palette.divider}`},Re.variant==="elevation"&&_extends$1({boxShadow:(Ee.vars||Ee).shadows[Re.elevation]},!Ee.vars&&Ee.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${alpha_1("#fff",getOverlayAlpha(Re.elevation))}, ${alpha_1("#fff",getOverlayAlpha(Re.elevation))})`},Ee.vars&&{backgroundImage:(Te=Ee.vars.overlays)==null?void 0:Te[Re.elevation]}))}),Paper=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiPaper"}),{className:Oe,component:Me="div",elevation:De=1,square:$e=!1,variant:Be="elevation"}=je,Ue=_objectWithoutPropertiesLoose(je,_excluded$19),ze=_extends$1({},je,{component:Me,elevation:De,square:$e,variant:Be}),We=useUtilityClasses$$(ze);return jsxRuntimeExports.jsx(PaperRoot,_extends$1({as:Me,ownerState:ze,className:clsx(We.root,Oe),ref:Te},Ue))}),_excluded$18=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],_excluded2$9=["component","slots","slotProps"],_excluded3$2=["component"];function useSlot(Ee,Re){const{className:Te,elementType:je,ownerState:Oe,externalForwardedProps:Me,getSlotOwnerState:De,internalForwardedProps:$e}=Re,Be=_objectWithoutPropertiesLoose(Re,_excluded$18),{component:Ue,slots:ze={[Ee]:void 0},slotProps:We={[Ee]:void 0}}=Me,Xe=_objectWithoutPropertiesLoose(Me,_excluded2$9),He=ze[Ee]||je,qe=resolveComponentProps(We[Ee],Oe),Ge=mergeSlotProps(_extends$1({className:Te},Be,{externalForwardedProps:Ee==="root"?Xe:void 0,externalSlotProps:qe})),{props:{component:Ye},internalRef:Ve}=Ge,Ke=_objectWithoutPropertiesLoose(Ge.props,_excluded3$2),Qe=useForkRef(Ve,qe==null?void 0:qe.ref,Re.ref),Ze=De?De(Ke):{},Je=_extends$1({},Oe,Ze),ir=Ee==="root"?Ye||Ue:Ye,rr=appendOwnerState(He,_extends$1({},Ee==="root"&&!Ue&&!ze[Ee]&&$e,Ee!=="root"&&!ze[Ee]&&$e,Ke,ir&&{as:ir},{ref:Qe}),Je);return Object.keys(Ze).forEach(ar=>{delete rr[ar]}),[He,rr]}function Ripple(Ee){const{className:Re,classes:Te,pulsate:je=!1,rippleX:Oe,rippleY:Me,rippleSize:De,in:$e,onExited:Be,timeout:Ue}=Ee,[ze,We]=reactExports.useState(!1),Xe=clsx(Re,Te.ripple,Te.rippleVisible,je&&Te.ripplePulsate),He={width:De,height:De,top:-(De/2)+Me,left:-(De/2)+Oe},qe=clsx(Te.child,ze&&Te.childLeaving,je&&Te.childPulsate);return!$e&&!ze&&We(!0),reactExports.useEffect(()=>{if(!$e&&Be!=null){const Ge=setTimeout(Be,Ue);return()=>{clearTimeout(Ge)}}},[Be,$e,Ue]),jsxRuntimeExports.jsx("span",{className:Xe,style:He,children:jsxRuntimeExports.jsx("span",{className:qe})})}const touchRippleClasses=generateUtilityClasses("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),_excluded$17=["center","classes","className"];let _$3=Ee=>Ee,_t$2,_t2$2,_t3$2,_t4$2;const DURATION=550,DELAY_RIPPLE=80,enterKeyframe=keyframes(_t$2||(_t$2=_$3` 476 0% { 477 transform: scale(0); 478 opacity: 0.1; 479 } 480 481 100% { 482 transform: scale(1); 483 opacity: 0.3; 484 } 485`)),exitKeyframe=keyframes(_t2$2||(_t2$2=_$3` 486 0% { 487 opacity: 1; 488 } 489 490 100% { 491 opacity: 0; 492 } 493`)),pulsateKeyframe=keyframes(_t3$2||(_t3$2=_$3` 494 0% { 495 transform: scale(1); 496 } 497 498 50% { 499 transform: scale(0.92); 500 } 501 502 100% { 503 transform: scale(1); 504 } 505`)),TouchRippleRoot=styled("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),TouchRippleRipple=styled(Ripple,{name:"MuiTouchRipple",slot:"Ripple"})(_t4$2||(_t4$2=_$3` 506 opacity: 0; 507 position: absolute; 508 509 &.${0} { 510 opacity: 0.3; 511 transform: scale(1); 512 animation-name: ${0}; 513 animation-duration: ${0}ms; 514 animation-timing-function: ${0}; 515 } 516 517 &.${0} { 518 animation-duration: ${0}ms; 519 } 520 521 & .${0} { 522 opacity: 1; 523 display: block; 524 width: 100%; 525 height: 100%; 526 border-radius: 50%; 527 background-color: currentColor; 528 } 529 530 & .${0} { 531 opacity: 0; 532 animation-name: ${0}; 533 animation-duration: ${0}ms; 534 animation-timing-function: ${0}; 535 } 536 537 & .${0} { 538 position: absolute; 539 /* @noflip */ 540 left: 0px; 541 top: 0; 542 animation-name: ${0}; 543 animation-duration: 2500ms; 544 animation-timing-function: ${0}; 545 animation-iteration-count: infinite; 546 animation-delay: 200ms; 547 } 548`),touchRippleClasses.rippleVisible,enterKeyframe,DURATION,({theme:Ee})=>Ee.transitions.easing.easeInOut,touchRippleClasses.ripplePulsate,({theme:Ee})=>Ee.transitions.duration.shorter,touchRippleClasses.child,touchRippleClasses.childLeaving,exitKeyframe,DURATION,({theme:Ee})=>Ee.transitions.easing.easeInOut,touchRippleClasses.childPulsate,pulsateKeyframe,({theme:Ee})=>Ee.transitions.easing.easeInOut),TouchRipple=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiTouchRipple"}),{center:Oe=!1,classes:Me={},className:De}=je,$e=_objectWithoutPropertiesLoose(je,_excluded$17),[Be,Ue]=reactExports.useState([]),ze=reactExports.useRef(0),We=reactExports.useRef(null);reactExports.useEffect(()=>{We.current&&(We.current(),We.current=null)},[Be]);const Xe=reactExports.useRef(!1),He=useTimeout(),qe=reactExports.useRef(null),Ge=reactExports.useRef(null),Ye=reactExports.useCallback(Ze=>{const{pulsate:Je,rippleX:ir,rippleY:rr,rippleSize:ar,cb:or}=Ze;Ue(pr=>[...pr,jsxRuntimeExports.jsx(TouchRippleRipple,{classes:{ripple:clsx(Me.ripple,touchRippleClasses.ripple),rippleVisible:clsx(Me.rippleVisible,touchRippleClasses.rippleVisible),ripplePulsate:clsx(Me.ripplePulsate,touchRippleClasses.ripplePulsate),child:clsx(Me.child,touchRippleClasses.child),childLeaving:clsx(Me.childLeaving,touchRippleClasses.childLeaving),childPulsate:clsx(Me.childPulsate,touchRippleClasses.childPulsate)},timeout:DURATION,pulsate:Je,rippleX:ir,rippleY:rr,rippleSize:ar},ze.current)]),ze.current+=1,We.current=or},[Me]),Ve=reactExports.useCallback((Ze={},Je={},ir=()=>{})=>{const{pulsate:rr=!1,center:ar=Oe||Je.pulsate,fakeElement:or=!1}=Je;if((Ze==null?void 0:Ze.type)==="mousedown"&&Xe.current){Xe.current=!1;return}(Ze==null?void 0:Ze.type)==="touchstart"&&(Xe.current=!0);const pr=or?null:Ge.current,tr=pr?pr.getBoundingClientRect():{width:0,height:0,left:0,top:0};let nr,hr,sr;if(ar||Ze===void 0||Ze.clientX===0&&Ze.clientY===0||!Ze.clientX&&!Ze.touches)nr=Math.round(tr.width/2),hr=Math.round(tr.height/2);else{const{clientX:xr,clientY:Rr}=Ze.touches&&Ze.touches.length>0?Ze.touches[0]:Ze;nr=Math.round(xr-tr.left),hr=Math.round(Rr-tr.top)}if(ar)sr=Math.sqrt((2*tr.width**2+tr.height**2)/3),sr%2===0&&(sr+=1);else{const xr=Math.max(Math.abs((pr?pr.clientWidth:0)-nr),nr)*2+2,Rr=Math.max(Math.abs((pr?pr.clientHeight:0)-hr),hr)*2+2;sr=Math.sqrt(xr**2+Rr**2)}Ze!=null&&Ze.touches?qe.current===null&&(qe.current=()=>{Ye({pulsate:rr,rippleX:nr,rippleY:hr,rippleSize:sr,cb:ir})},He.start(DELAY_RIPPLE,()=>{qe.current&&(qe.current(),qe.current=null)})):Ye({pulsate:rr,rippleX:nr,rippleY:hr,rippleSize:sr,cb:ir})},[Oe,Ye,He]),Ke=reactExports.useCallback(()=>{Ve({},{pulsate:!0})},[Ve]),Qe=reactExports.useCallback((Ze,Je)=>{if(He.clear(),(Ze==null?void 0:Ze.type)==="touchend"&&qe.current){qe.current(),qe.current=null,He.start(0,()=>{Qe(Ze,Je)});return}qe.current=null,Ue(ir=>ir.length>0?ir.slice(1):ir),We.current=Je},[He]);return reactExports.useImperativeHandle(Te,()=>({pulsate:Ke,start:Ve,stop:Qe}),[Ke,Ve,Qe]),jsxRuntimeExports.jsx(TouchRippleRoot,_extends$1({className:clsx(touchRippleClasses.root,Me.root,De),ref:Ge},$e,{children:jsxRuntimeExports.jsx(TransitionGroup,{component:null,exit:!0,children:Be})}))});function getButtonBaseUtilityClass(Ee){return generateUtilityClass("MuiButtonBase",Ee)}const buttonBaseClasses=generateUtilityClasses("MuiButtonBase",["root","disabled","focusVisible"]),_excluded$16=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],useUtilityClasses$_=Ee=>{const{disabled:Re,focusVisible:Te,focusVisibleClassName:je,classes:Oe}=Ee,De=composeClasses({root:["root",Re&&"disabled",Te&&"focusVisible"]},getButtonBaseUtilityClass,Oe);return Te&&je&&(De.root+=` ${je}`),De},ButtonBaseRoot=styled("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${buttonBaseClasses.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ButtonBase=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiButtonBase"}),{action:Oe,centerRipple:Me=!1,children:De,className:$e,component:Be="button",disabled:Ue=!1,disableRipple:ze=!1,disableTouchRipple:We=!1,focusRipple:Xe=!1,LinkComponent:He="a",onBlur:qe,onClick:Ge,onContextMenu:Ye,onDragLeave:Ve,onFocus:Ke,onFocusVisible:Qe,onKeyDown:Ze,onKeyUp:Je,onMouseDown:ir,onMouseLeave:rr,onMouseUp:ar,onTouchEnd:or,onTouchMove:pr,onTouchStart:tr,tabIndex:nr=0,TouchRippleProps:hr,touchRippleRef:sr,type:xr}=je,Rr=_objectWithoutPropertiesLoose(je,_excluded$16),br=reactExports.useRef(null),wr=reactExports.useRef(null),vr=useForkRef(wr,sr),{isFocusVisibleRef:Dr,onFocus:kr,onBlur:cr,ref:dr}=useIsFocusVisible(),[ur,gr]=reactExports.useState(!1);Ue&&ur&&gr(!1),reactExports.useImperativeHandle(Oe,()=>({focusVisible:()=>{gr(!0),br.current.focus()}}),[]);const[_r,Ir]=reactExports.useState(!1);reactExports.useEffect(()=>{Ir(!0)},[]);const Ar=_r&&!ze&&!Ue;reactExports.useEffect(()=>{ur&&Xe&&!ze&&_r&&wr.current.pulsate()},[ze,Xe,ur,_r]);function Tr(Qr,wn,gn=We){return useEventCallback(In=>(wn&&wn(In),!gn&&wr.current&&wr.current[Qr](In),!0))}const Nr=Tr("start",ir),Br=Tr("stop",Ye),Hr=Tr("stop",Ve),Vr=Tr("stop",ar),mr=Tr("stop",Qr=>{ur&&Qr.preventDefault(),rr&&rr(Qr)}),Sr=Tr("start",tr),Lr=Tr("stop",or),jr=Tr("stop",pr),fr=Tr("stop",Qr=>{cr(Qr),Dr.current===!1&&gr(!1),qe&&qe(Qr)},!1),Cr=useEventCallback(Qr=>{br.current||(br.current=Qr.currentTarget),kr(Qr),Dr.current===!0&&(gr(!0),Qe&&Qe(Qr)),Ke&&Ke(Qr)}),Mr=()=>{const Qr=br.current;return Be&&Be!=="button"&&!(Qr.tagName==="A"&&Qr.href)},$r=reactExports.useRef(!1),Fr=useEventCallback(Qr=>{Xe&&!$r.current&&ur&&wr.current&&Qr.key===" "&&($r.current=!0,wr.current.stop(Qr,()=>{wr.current.start(Qr)})),Qr.target===Qr.currentTarget&&Mr()&&Qr.key===" "&&Qr.preventDefault(),Ze&&Ze(Qr),Qr.target===Qr.currentTarget&&Mr()&&Qr.key==="Enter"&&!Ue&&(Qr.preventDefault(),Ge&&Ge(Qr))}),Kr=useEventCallback(Qr=>{Xe&&Qr.key===" "&&wr.current&&ur&&!Qr.defaultPrevented&&($r.current=!1,wr.current.stop(Qr,()=>{wr.current.pulsate(Qr)})),Je&&Je(Qr),Ge&&Qr.target===Qr.currentTarget&&Mr()&&Qr.key===" "&&!Qr.defaultPrevented&&Ge(Qr)});let an=Be;an==="button"&&(Rr.href||Rr.to)&&(an=He);const Wr={};an==="button"?(Wr.type=xr===void 0?"button":xr,Wr.disabled=Ue):(!Rr.href&&!Rr.to&&(Wr.role="button"),Ue&&(Wr["aria-disabled"]=Ue));const hn=useForkRef(Te,dr,br),cn=_extends$1({},je,{centerRipple:Me,component:Be,disabled:Ue,disableRipple:ze,disableTouchRipple:We,focusRipple:Xe,tabIndex:nr,focusVisible:ur}),tn=useUtilityClasses$_(cn);return jsxRuntimeExports.jsxs(ButtonBaseRoot,_extends$1({as:an,className:clsx(tn.root,$e),ownerState:cn,onBlur:fr,onClick:Ge,onContextMenu:Br,onFocus:Cr,onKeyDown:Fr,onKeyUp:Kr,onMouseDown:Nr,onMouseLeave:mr,onMouseUp:Vr,onDragLeave:Hr,onTouchEnd:Lr,onTouchMove:jr,onTouchStart:Sr,ref:hn,tabIndex:Ue?-1:nr,type:xr},Wr,Rr,{children:[De,Ar?jsxRuntimeExports.jsx(TouchRipple,_extends$1({ref:vr,center:Me},hr)):null]}))});function getAlertUtilityClass(Ee){return generateUtilityClass("MuiAlert",Ee)}const alertClasses=generateUtilityClasses("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function getIconButtonUtilityClass(Ee){return generateUtilityClass("MuiIconButton",Ee)}
548const iconButtonClasses=generateUtilityClasses("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),_excluded$15=["edge","children","className","color","disabled","disableFocusRipple","size"],useUtilityClasses$Z=Ee=>{const{classes:Re,disabled:Te,color:je,edge:Oe,size:Me}=Ee,De={root:["root",Te&&"disabled",je!=="default"&&`color${capitalize$1(je)}`,Oe&&`edge${capitalize$1(Oe)}`,`size${capitalize$1(Me)}`]};return composeClasses(De,getIconButtonUtilityClass,Re)},IconButtonRoot=styled(ButtonBase,{name:"MuiIconButton",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.color!=="default"&&Re[`color${capitalize$1(Te.color)}`],Te.edge&&Re[`edge${capitalize$1(Te.edge)}`],Re[`size${capitalize$1(Te.size)}`]]}})(({theme:Ee,ownerState:Re})=>_extends$1({textAlign:"center",flex:"0 0 auto",fontSize:Ee.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(Ee.vars||Ee).palette.action.active,transition:Ee.transitions.create("background-color",{duration:Ee.transitions.duration.shortest})},!Re.disableRipple&&{"&:hover":{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.action.activeChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Ee.palette.action.active,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},Re.edge==="start"&&{marginLeft:Re.size==="small"?-3:-12},Re.edge==="end"&&{marginRight:Re.size==="small"?-3:-12}),({theme:Ee,ownerState:Re})=>{var Te;const je=(Te=(Ee.vars||Ee).palette)==null?void 0:Te[Re.color];return _extends$1({},Re.color==="inherit"&&{color:"inherit"},Re.color!=="inherit"&&Re.color!=="default"&&_extends$1({color:je==null?void 0:je.main},!Re.disableRipple&&{"&:hover":_extends$1({},je&&{backgroundColor:Ee.vars?`rgba(${je.mainChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(je.main,Ee.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),Re.size==="small"&&{padding:5,fontSize:Ee.typography.pxToRem(18)},Re.size==="large"&&{padding:12,fontSize:Ee.typography.pxToRem(28)},{[`&.${iconButtonClasses.disabled}`]:{backgroundColor:"transparent",color:(Ee.vars||Ee).palette.action.disabled}})}),IconButton=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiIconButton"}),{edge:Oe=!1,children:Me,className:De,color:$e="default",disabled:Be=!1,disableFocusRipple:Ue=!1,size:ze="medium"}=je,We=_objectWithoutPropertiesLoose(je,_excluded$15),Xe=_extends$1({},je,{edge:Oe,color:$e,disabled:Be,disableFocusRipple:Ue,size:ze}),He=useUtilityClasses$Z(Xe);return jsxRuntimeExports.jsx(IconButtonRoot,_extends$1({className:clsx(He.root,De),centerRipple:!0,focusRipple:!Ue,disabled:Be,ref:Te},We,{ownerState:Xe,children:Me}))}),SuccessOutlinedIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),ReportProblemOutlinedIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),ErrorOutlineIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),InfoOutlinedIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),ClearIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),_excluded$14=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","
548slots","variant"],useUtilityClasses$Y=Ee=>{const{variant:Re,color:Te,severity:je,classes:Oe}=Ee,Me={root:["root",`color${capitalize$1(Te||je)}`,`${Re}${capitalize$1(Te||je)}`,`${Re}`],icon:["icon"],message:["message"],action:["action"]};return composeClasses(Me,getAlertUtilityClass,Oe)},AlertRoot=styled(Paper,{name:"MuiAlert",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[Te.variant],Re[`${Te.variant}${capitalize$1(Te.color||Te.severity)}`]]}})(({theme:Ee})=>{const Re=Ee.palette.mode==="light"?darken_1:lighten_1,Te=Ee.palette.mode==="light"?lighten_1:darken_1;return _extends$1({},Ee.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(Ee.palette).filter(([,je])=>je.main&&je.light).map(([je])=>({props:{colorSeverity:je,variant:"standard"},style:{color:Ee.vars?Ee.vars.palette.Alert[`${je}Color`]:Re(Ee.palette[je].light,.6),backgroundColor:Ee.vars?Ee.vars.palette.Alert[`${je}StandardBg`]:Te(Ee.palette[je].light,.9),[`& .${alertClasses.icon}`]:Ee.vars?{color:Ee.vars.palette.Alert[`${je}IconColor`]}:{color:Ee.palette[je].main}}})),...Object.entries(Ee.palette).filter(([,je])=>je.main&&je.light).map(([je])=>({props:{colorSeverity:je,variant:"outlined"},style:{color:Ee.vars?Ee.vars.palette.Alert[`${je}Color`]:Re(Ee.palette[je].light,.6),border:`1px solid ${(Ee.vars||Ee).palette[je].light}`,[`& .${alertClasses.icon}`]:Ee.vars?{color:Ee.vars.palette.Alert[`${je}IconColor`]}:{color:Ee.palette[je].main}}})),...Object.entries(Ee.palette).filter(([,je])=>je.main&&je.dark).map(([je])=>({props:{colorSeverity:je,variant:"filled"},style:_extends$1({fontWeight:Ee.typography.fontWeightMedium},Ee.vars?{color:Ee.vars.palette.Alert[`${je}FilledColor`],backgroundColor:Ee.vars.palette.Alert[`${je}FilledBg`]}:{backgroundColor:Ee.palette.mode==="dark"?Ee.palette[je].dark:Ee.palette[je].main,color:Ee.palette.getContrastText(Ee.palette[je].main)})}))]})}),AlertIcon=styled("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(Ee,Re)=>Re.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),AlertMessage=styled("div",{name:"MuiAlert",slot:"Message",overridesResolver:(Ee,Re)=>Re.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),AlertAction=styled("div",{name:"MuiAlert",slot:"Action",overridesResolver:(Ee,Re)=>Re.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),defaultIconMapping={success:jsxRuntimeExports.jsx(SuccessOutlinedIcon,{fontSize:"inherit"}),warning:jsxRuntimeExports.jsx(ReportProblemOutlinedIcon,{fontSize:"inherit"}),error:jsxRuntimeExports.jsx(ErrorOutlineIcon,{fontSize:"inherit"}),info:jsxRuntimeExports.jsx(InfoOutlinedIcon,{fontSize:"inherit"})},Alert=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiAlert"}),{action:Oe,children:Me,className:De,closeText:$e="Close",color:Be,components:Ue={},componentsProps:ze={},icon:We,iconMapping:Xe=defaultIconMapping,onClose:He,role:qe="alert",severity:Ge="success",slotProps:Ye={},slots:Ve={},variant:Ke="standard"}=je,Qe=_objectWithoutPropertiesLoose(je,_excluded$14),Ze=_extends$1({},je,{color:Be,severity:Ge,variant:Ke,colorSeverity:Be||Ge}),Je=useUtilityClasses$Y(Ze),ir={slots:_extends$1({closeButton:Ue.CloseButton,closeIcon:Ue.CloseIcon},Ve),slotProps:_extends$1({},ze,Ye)},[rr,ar]=useSlot("closeButton",{elementType:IconButton,externalForwardedProps:ir,ownerState:Ze}),[or,pr]=useSlot("closeIcon",{elementType:ClearIcon,externalForwardedProps:ir,ownerState:Ze});return jsxRuntimeExports.jsxs(AlertRoot,_extends$1({role:qe,elevation:0,ownerState:Ze,className:clsx(Je.root,De),ref:Te},Qe,{children:[We!==!1?jsxRuntimeExports.jsx(AlertIcon,{ownerState:Ze,className:Je.icon,children:We||Xe[Ge]||defaultIconMapping[Ge]}):null,jsxRuntimeExports.jsx(AlertMessage,{ownerState:Ze,className:Je.message,children:Me}),Oe!=null?jsxRuntimeExports.jsx(AlertAction,{ownerState:Ze,className:Je.action,children:Oe}):null,Oe==null&&He?jsxRuntimeExports.jsx(AlertAction,{ownerState:Ze,className:Je.action,children:jsxRuntimeExports.jsx(rr,_extends$1({size:"small","aria-label":$e,title:$e,color:"inherit",onClick:He},ar,{children:jsxRuntimeExports.jsx(or,_extends$1({fontSize:"small"},pr))}))}):null]}))});function getTypographyUtilityClass(Ee){return generateUtilityClass("MuiTypography",Ee)}generateUtilityClasses("MuiTypography",["root","h1","h2","h3","h4","h5","h6","
548subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const _excluded$13=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],useUtilityClasses$X=Ee=>{const{align:Re,gutterBottom:Te,noWrap:je,paragraph:Oe,variant:Me,classes:De}=Ee,$e={root:["root",Me,Ee.align!=="inherit"&&`align${capitalize$1(Re)}`,Te&&"gutterBottom",je&&"noWrap",Oe&&"paragraph"]};return composeClasses($e,getTypographyUtilityClass,De)},TypographyRoot=styled("span",{name:"MuiTypography",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.variant&&Re[Te.variant],Te.align!=="inherit"&&Re[`align${capitalize$1(Te.align)}`],Te.noWrap&&Re.noWrap,Te.gutterBottom&&Re.gutterBottom,Te.paragraph&&Re.paragraph]}})(({theme:Ee,ownerState:Re})=>_extends$1({margin:0},Re.variant==="inherit"&&{font:"inherit"},Re.variant!=="inherit"&&Ee.typography[Re.variant],Re.align!=="inherit"&&{textAlign:Re.align},Re.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Re.gutterBottom&&{marginBottom:"0.35em"},Re.paragraph&&{marginBottom:16})),defaultVariantMapping={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},colorTransformations$1={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},transformDeprecatedColors$1=Ee=>colorTransformations$1[Ee]||Ee,Typography=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiTypography"}),Oe=transformDeprecatedColors$1(je.color),Me=extendSxProp(_extends$1({},je,{color:Oe})),{align:De="inherit",className:$e,component:Be,gutterBottom:Ue=!1,noWrap:ze=!1,paragraph:We=!1,variant:Xe="body1",variantMapping:He=defaultVariantMapping}=Me,qe=_objectWithoutPropertiesLoose(Me,_excluded$13),Ge=_extends$1({},Me,{align:De,color:Oe,className:$e,component:Be,gutterBottom:Ue,noWrap:ze,paragraph:We,variant:Xe,variantMapping:He}),Ye=Be||(We?"p":He[Xe]||defaultVariantMapping[Xe])||"span",Ve=useUtilityClasses$X(Ge);return jsxRuntimeExports.jsx(TypographyRoot,_extends$1({as:Ye,ref:Te,ownerState:Ge,className:clsx(Ve.root,$e)},qe))});function stripDiacritics(Ee){return typeof Ee.normalize<"u"?Ee.normalize("NFD").replace(/[\u0300-\u036f]/g,""):Ee}function createFilterOptions(Ee={}){const{ignoreAccents:Re=!0,ignoreCase:Te=!0,limit:je,matchFrom:Oe="any",stringify:Me,trim:De=!1}=Ee;return($e,{inputValue:Be,getOptionLabel:Ue})=>{let ze=De?Be.trim():Be;Te&&(ze=ze.toLowerCase()),Re&&(ze=stripDiacritics(ze));const We=ze?$e.filter(Xe=>{let He=(Me||Ue)(Xe);return Te&&(He=He.toLowerCase()),Re&&(He=stripDiacritics(He)),Oe==="start"?He.indexOf(ze)===0:He.indexOf(ze)>-1}):$e;return typeof je=="number"?We.slice(0,je):We}}function findIndex(Ee,Re){for(let Te=0;Te<Ee.length;Te+=1)if(Re(Ee[Te]))return Te;return-1}const defaultFilterOptions=createFilterOptions(),pageSize=5,defaultIsActiveElementInListbox=Ee=>{var Re;return Ee.current!==null&&((Re=Ee.current.parentElement)==null?void 0:Re.contains(document.activeElement))},MULTIPLE_DEFAULT_VALUE=[];function useAutocomplete(Ee){const{unstable_isActiveElementInListbox:Re=defaultIsActiveElementInListbox,unstable_classNamePrefix:Te="Mui",autoComplete:je=!1,autoHighlight:Oe=!1,autoSelect:Me=!1,blurOnSelect:De=!1,clearOnBlur:$e=!Ee.freeSolo,clearOnEscape:Be=!1,componentName:Ue="useAutocomplete",defaultValue:ze=Ee.multiple?MULTIPLE_DEFAULT_VALUE:null,disableClearable:We=!1,disableCloseOnSelect:Xe=!1,disabled:He,disabledItemsFocusable:qe=!1,disableListWrap:Ge=!1,filterOptions:Ye=defaultFilterOptions,filterSelectedOptions:Ve=!1,freeSolo:Ke=!1,getOptionDisabled:Qe,getOptionKey:Ze,getOptionLabel:Je=Sn=>{var mn;return(mn=Sn.label)!=null?mn:Sn},groupBy:ir,handleHomeEndKeys:rr=!Ee.freeSolo,id:ar,includeInputInList:or=!1,inputValue:pr,isOptionEqualToValue:tr=(Sn,mn)=>Sn===mn,multiple:nr=!1,onChange:hr,onClose:sr,onHighlightChange:xr,onInputChange:Rr,onOpen:br,open:wr,openOnFocus:vr=!1,options:Dr,readOnly:kr=!1,selectOnFocus:cr=!Ee.freeSolo,value:dr}=Ee,ur=useId(ar);let gr=Je;gr=Sn=>{const mn=Je(Sn);
vendor: 12,520 bytes, line 548
548return typeof mn!="string"?String(mn):mn};const _r=reactExports.useRef(!1),Ir=reactExports.useRef(!0),Ar=reactExports.useRef(null),Tr=reactExports.useRef(null),[Nr,Br]=reactExports.useState(null),[Hr,Vr]=reactExports.useState(-1),mr=Oe?0:-1,Sr=reactExports.useRef(mr),[Lr,jr]=useControlled({controlled:dr,default:ze,name:Ue}),[fr,Cr]=useControlled({controlled:pr,default:"",name:Ue,state:"inputValue"}),[Mr,$r]=reactExports.useState(!1),Fr=reactExports.useCallback((Sn,mn)=>{if(!(nr?Lr.length<mn.length:mn!==null)&&!$e)return;let os;if(nr)os="";else if(mn==null)os="";else{const ls=gr(mn);os=typeof ls=="string"?ls:""}fr!==os&&(Cr(os),Rr&&Rr(Sn,os,"reset"))},[gr,fr,nr,Rr,Cr,$e,Lr]),[Kr,an]=useControlled({controlled:wr,default:!1,name:Ue,state:"open"}),[Wr,hn]=reactExports.useState(!0),cn=!nr&&Lr!=null&&fr===gr(Lr),tn=Kr&&!kr,Qr=tn?Ye(Dr.filter(Sn=>!(Ve&&(nr?Lr:[Lr]).some(mn=>mn!==null&&tr(Sn,mn)))),{inputValue:cn&&Wr?"":fr,getOptionLabel:gr}):[],wn=usePreviousProps({filteredOptions:Qr,value:Lr,inputValue:fr});reactExports.useEffect(()=>{const Sn=Lr!==wn.value;Mr&&!Sn||Ke&&!Sn||Fr(null,Lr)},[Lr,Fr,Mr,wn.value,Ke]);const gn=Kr&&Qr.length>0&&!kr,In=useEventCallback(Sn=>{Sn===-1?Ar.current.focus():Nr.querySelector(`[data-tag-index="${Sn}"]`).focus()});reactExports.useEffect(()=>{nr&&Hr>Lr.length-1&&(Vr(-1),In(-1))},[Lr,nr,Hr,In]);function yn(Sn,mn){if(!Tr.current||Sn<0||Sn>=Qr.length)return-1;let zn=Sn;for(;;){const os=Tr.current.querySelector(`[data-option-index="${zn}"]`),ls=qe?!1:!os||os.disabled||os.getAttribute("aria-disabled")==="true";if(os&&os.hasAttribute("tabindex")&&!ls)return zn;if(mn==="next"?zn=(zn+1)%Qr.length:zn=(zn-1+Qr.length)%Qr.length,zn===Sn)return-1}}const Mn=useEventCallback(({event:Sn,index:mn,reason:zn="auto"})=>{if(Sr.current=mn,mn===-1?Ar.current.removeAttribute("aria-activedescendant"):Ar.current.setAttribute("aria-activedescendant",`${ur}-option-${mn}`),xr&&xr(Sn,mn===-1?null:Qr[mn],zn),!Tr.current)return;const os=Tr.current.querySelector(`[role="option"].${Te}-focused`);os&&(os.classList.remove(`${Te}-focused`),os.classList.remove(`${Te}-focusVisible`));let ls=Tr.current;if(Tr.current.getAttribute("role")!=="listbox"&&(ls=Tr.current.parentElement.querySelector('[role="listbox"]')),!ls)return;if(mn===-1){ls.scrollTop=0;return}const hs=Tr.current.querySelector(`[data-option-index="${mn}"]`);if(hs&&(hs.classList.add(`${Te}-focused`),zn==="keyboard"&&hs.classList.add(`${Te}-focusVisible`),ls.scrollHeight>ls.clientHeight&&zn!=="mouse"&&zn!=="touch")){const Cs=hs,Ds=ls.clientHeight+ls.scrollTop,ho=Cs.offsetTop+Cs.offsetHeight;ho>Ds?ls.scrollTop=ho-ls.clientHeight:Cs.offsetTop-Cs.offsetHeight*(ir?1.3:0)<ls.scrollTop&&(ls.scrollTop=Cs.offsetTop-Cs.offsetHeight*(ir?1.3:0))}}),on=useEventCallback(({event:Sn,diff:mn,direction:zn="next",reason:os="auto"})=>{if(!tn)return;const hs=yn((()=>{const Cs=Qr.length-1;if(mn==="reset")return mr;if(mn==="start")return 0;if(mn==="end")return Cs;const Ds=Sr.current+mn;return Ds<0?Ds===-1&&or?-1:Ge&&Sr.current!==-1||Math.abs(mn)>1?0:Cs:Ds>Cs?Ds===Cs+1&&or?-1:Ge||Math.abs(mn)>1?Cs:0:Ds})(),zn);if(Mn({index:hs,reason:os,event:Sn}),je&&mn!=="reset")if(hs===-1)Ar.current.value=fr;else{const Cs=gr(Qr[hs]);Ar.current.value=Cs,Cs.toLowerCase().indexOf(fr.toLowerCase())===0&&fr.length>0&&Ar.current.setSelectionRange(fr.length,Cs.length)}}),Yr=()=>{const Sn=(mn,zn)=>{const os=mn?gr(mn):"",ls=zn?gr(zn):"";return os===ls};if(Sr.current!==-1&&wn.filteredOptions&&wn.filteredOptions.length!==Qr.length&&wn.inputValue===fr&&(nr?Lr.length===wn.value.length&&wn.value.every((mn,zn)=>gr(Lr[zn])===gr(mn)):Sn(wn.value,Lr))){const mn=wn.filteredOptions[Sr.current];if(mn)return findIndex(Qr,zn=>gr(zn)===gr(mn))}return-1},sn=reactExports.useCallback(()=>{if(!tn)return;const Sn=Yr();if(Sn!==-1){Sr.current=Sn;return}const mn=nr?Lr[0]:Lr;if(Qr.length===0||mn==null){on({diff:"reset"});return}if(Tr.current){if(mn!=null){const zn=Qr[Sr.current];if(nr&&zn&&findIndex(Lr,ls=>tr(zn,ls))!==-1)return;const os=findIndex(Qr,ls=>tr(ls,mn));os===-1?on({diff:"reset"}):Mn({index:os});return}if(Sr.current>=Qr.length-1){Mn({index:Qr.length-1});return}Mn({index:Sr.current})}},[Qr.length,nr?!1:Lr,Ve,on,Mn,tn,fr,nr]),On=useEventCallback(Sn=>{setRef(Tr,Sn),Sn&&sn()});reactExports.useEffect(()=>{sn()},[sn]);const Bn=Sn=>{Kr||(an(!0),hn(!0),br&&br(Sn))},Hn=(Sn,mn)=>{Kr&&(an(!1),sr&&sr(Sn,mn))},Zr=(Sn,mn,zn,os)=>{if(nr){if(Lr.length===mn.length&&Lr.every((ls,hs)=>ls===mn[hs]))return}else if(Lr===mn)return;hr&&hr(Sn,mn,zn,os),jr(mn)},xn=reactExports.useRef(!1),An=(Sn,mn,zn="selectOption",os="options")=>{let ls=zn,hs=mn;if(nr){hs=Array.isArray(Lr)?Lr.slice():[];const Cs=findIndex(hs,Ds=>tr(mn,Ds));Cs===-1?hs.push(mn):os!=="freeSolo"&&(hs.splice(Cs,1),ls="removeOption")}Fr(Sn,hs),Zr(Sn,hs,ls,{option:mn}),!Xe&&(!Sn||!Sn.ctrlKey&&!Sn.metaKey)&&Hn(Sn,ls),(De===!0||De==="touch"&&xn.current||De==="mouse"&&!xn.current)&&Ar.current.blur()};function Wn(Sn,mn){if(Sn===-1)return-1;let zn=Sn;for(;;){if(mn==="next"&&zn===Lr.length||mn==="previous"&&zn===-1)return-1;const os=Nr.querySelector(`[data-tag-index="${zn}"]`);if(!os||!os.hasAttribute("tabindex")||os.disabled||os.getAttribute("aria-disabled")==="true")zn+=mn==="next"?1:-1;else return zn}}const ss=(Sn,mn)=>{if(!nr)return;fr===""&&Hn(Sn,"toggleInput");let zn=Hr;Hr===-1?fr===""&&mn==="previous"&&(zn=Lr.length-1):(zn+=mn==="next"?1:-1,zn<0&&(zn=0),zn===Lr.length&&(zn=-1)),zn=Wn(zn,mn),Vr(zn),In(zn)},Yn=Sn=>{_r.current=!0,Cr(""),Rr&&Rr(Sn,"","clear"),Zr(Sn,nr?[]:null,"clear")},en=Sn=>mn=>{if(Sn.onKeyDown&&Sn.onKeyDown(mn),!mn.defaultMuiPrevented&&(Hr!==-1&&["ArrowLeft","ArrowRight"].indexOf(mn.key)===-1&&(Vr(-1),In(-1)),mn.which!==229))switch(mn.key){case"Home":tn&&rr&&(mn.preventDefault(),on({diff:"start",direction:"next",reason:"keyboard",event:mn}));break;case"End":tn&&rr&&(mn.preventDefault(),on({diff:"end",direction:"previous",reason:"keyboard",event:mn}));break;case"PageUp":mn.preventDefault(),on({diff:-pageSize,direction:"previous",reason:"keyboard",event:mn}),Bn(mn);break;case"PageDown":mn.preventDefault(),on({diff:pageSize,direction:"next",reason:"keyboard",event:mn}),Bn(mn);break;case"ArrowDown":mn.preventDefault(),on({diff:1,direction:"next",reason:"keyboard",event:mn}),Bn(mn);break;case"ArrowUp":mn.preventDefault(),on({diff:-1,direction:"previous",reason:"keyboard",event:mn}),Bn(mn);break;case"ArrowLeft":ss(mn,"previous");break;case"ArrowRight":ss(mn,"next");break;case"Enter":if(Sr.current!==-1&&tn){const zn=Qr[Sr.current],os=Qe?Qe(zn):!1;if(mn.preventDefault(),os)return;An(mn,zn,"selectOption"),je&&Ar.current.setSelectionRange(Ar.current.value.length,Ar.current.value.length)}else Ke&&fr!==""&&cn===!1&&(nr&&mn.preventDefault(),An(mn,fr,"createOption","freeSolo"));break;case"Escape":tn?(mn.preventDefault(),mn.stopPropagation(),Hn(mn,"escape")):Be&&(fr!==""||nr&&Lr.length>0)&&(mn.preventDefault(),mn.stopPropagation(),Yn(mn));break;case"Backspace":if(nr&&!kr&&fr===""&&Lr.length>0){const zn=Hr===-1?Lr.length-1:Hr,os=Lr.slice();os.splice(zn,1),Zr(mn,os,"removeOption",{option:Lr[zn]})}break;case"Delete":if(nr&&!kr&&fr===""&&Lr.length>0&&Hr!==-1){const zn=Hr,os=Lr.slice();os.splice(zn,1),Zr(mn,os,"removeOption",{option:Lr[zn]})}break}},Gr=Sn=>{$r(!0),vr&&!_r.current&&Bn(Sn)},nn=Sn=>{if(Re(Tr)){Ar.current.focus();return}$r(!1),Ir.current=!0,_r.current=!1,Me&&Sr.current!==-1&&tn?An(Sn,Qr[Sr.current],"blur"):Me&&Ke&&fr!==""?An(Sn,fr,"blur","freeSolo"):$e&&Fr(Sn,Lr),Hn(Sn,"blur")},En=Sn=>{const mn=Sn.target.value;fr!==mn&&(Cr(mn),hn(!1),Rr&&Rr(Sn,mn,"input")),mn===""?!We&&!nr&&Zr(Sn,null,"clear"):Bn(Sn)},Cn=Sn=>{const mn=Number(Sn.currentTarget.getAttribute("data-option-index"));Sr.current!==mn&&Mn({event:Sn,index:mn,reason:"mouse"})},jn=Sn=>{Mn({event:Sn,index:Number(Sn.currentTarget.getAttribute("data-option-index")),reason:"touch"}),xn.current=!0},$n=Sn=>{const mn=Number(Sn.currentTarget.getAttribute("data-option-index"));An(Sn,Qr[mn],"selectOption"),xn.current=!1},Vn=Sn=>mn=>{const zn=Lr.slice();zn.splice(Sn,1),Zr(mn,zn,"removeOption",{option:Lr[Sn]})},Qn=Sn=>{Kr?Hn(Sn,"toggleInput"):Bn(Sn)},Un=Sn=>{Sn.currentTarget.contains(Sn.target)&&Sn.target.getAttribute("id")!==ur&&Sn.preventDefault()},fs=Sn=>{Sn.currentTarget.contains(Sn.target)&&(Ar.current.focus(),cr&&Ir.current&&Ar.current.selectionEnd-Ar.current.selectionStart===0&&Ar.current.select(),Ir.current=!1)},Jn=Sn=>{!He&&(fr===""||!Kr)&&Qn(Sn)};let ts=Ke&&fr.length>0;ts=ts||(nr?Lr.length>0:Lr!==null);let cs=Qr;return ir&&(cs=Qr.reduce((Sn,mn,zn)=>{const os=ir(mn);return Sn.length>0&&Sn[Sn.length-1].group===os?Sn[Sn.length-1].options.push(mn):Sn.push({key:zn,index:zn,group:os,options:[mn]}),Sn},[])),He&&Mr&&nn(),{getRootProps:(Sn={})=>_extends$1({"aria-owns":gn?`${ur}-listbox`:null},Sn,{onKeyDown:en(Sn),onMouseDown:Un,onClick:fs}),getInputLabelProps:()=>({id:`${ur}-label`,htmlFor:ur}),getInputProps:()=>({id:ur,value:fr,onBlur:nn,onFocus:Gr,onChange:En,onMouseDown:Jn,"aria-activedescendant":tn?"":null,"aria-autocomplete":je?"both":"list","aria-controls":gn?`${ur}-listbox`:void 0,"aria-expanded":gn,autoComplete:"off",ref:Ar,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:He}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Yn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Qn}),getTagProps:({index:Sn})=>_extends$1({key:Sn,"data-tag-index":Sn,tabIndex:-1},!kr&&{onDelete:Vn(Sn)}),getListboxProps:()=>({role:"listbox",id:`${ur}-listbox`,"aria-labelledby":`${ur}-label`,ref:On,onMouseDown:Sn=>{Sn.preventDefault()}}),getOptionProps:({index:Sn,option:mn})=>{var zn;const os=(nr?Lr:[Lr]).some(hs=>hs!=null&&tr(mn,hs)),ls=Qe?Qe(mn):!1;return{key:(zn=Ze==null?void 0:Ze(mn))!=null?zn:gr(mn),tabIndex:-1,role:"option",id:`${ur}-option-${Sn}`,onMouseMove:Cn,onClick:$n,onTouchStart:jn,"data-option-index":Sn,"aria-disabled":ls,"aria-selected":os}},id:ur,inputValue:fr,value:Lr,dirty:ts,expanded:tn&&Nr,popupOpen:tn,focused:Mr||Hr!==-1,anchorEl:Nr,setAnchorEl:Br,focusedTag:Hr,groupedOptions:cs}}var useThemeWithoutDefault={};Object.defineProperty(useThemeWithoutDefault,"__esModule",{value:!0});var default_1$4=useThemeWithoutDefault.default=void 0,React=_interopRequireWildcard(reactExports),_styledEngine=require$$1;function _getRequireWildcardCache(Ee){if(typeof WeakMap!="function")return null;var Re=new WeakMap,Te=new WeakMap;return(_getRequireWildcardCache=function(je){return je?Te:Re})(Ee)}function _interopRequireWildcard(Ee,Re){if(Ee&&Ee.__esModule)return Ee;if(Ee===null||typeof Ee!="object"&&typeof Ee!="function")return{default:Ee};var Te=_getRequireWildcardCache(Re);if(Te&&Te.has(Ee))return Te.get(Ee);var je={__proto__:null},Oe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Me in Ee)if(Me!=="default"&&Object.prototype.hasOwnProperty.call(Ee,Me)){var De=Oe?Object.getOwnPropertyDescriptor(Ee,Me):null;De&&(De.get||De.set)?Object.defineProperty(je,Me,De):je[Me]=Ee[Me]}return je.default=Ee,Te&&Te.set(Ee,je),je}function isObjectEmpty$1(Ee){return Object.keys(Ee).length===0}function useTheme(Ee=null){const Re=React.useContext(_styledEngine.ThemeContext);return!Re||isObjectEmpty$1(Re)?Ee:Re}default_1$4=useThemeWithoutDefault.default=useTheme;var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(Ee,Re){return Ee.concat([Re+"-"+start,Re+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(Ee,Re){return Ee.concat([Re,Re+"-"+start,Re+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(Ee){return Ee?(Ee.nodeName||"").toLowerCase():null}function getWindow(Ee){if(Ee==null)return window;if(Ee.toString()!=="[object Window]"){var Re=Ee.ownerDocument;return Re&&Re.defaultView||window}return Ee}function isElement(Ee){var Re=getWindow(Ee).Element;return Ee instanceof Re||Ee instanceof Element}function isHTMLElement$1(Ee){var Re=getWindow(Ee).HTMLElement;return Ee instanceof Re||Ee instanceof HTMLElement}function isShadowRoot(Ee){if(typeof ShadowRoot>"u")return!1;var Re=getWindow(Ee).ShadowRoot;return Ee instanceof Re||Ee instanceof ShadowRoot}function applyStyles(Ee){var Re=Ee.state;
vendor: 20,755 bytes, line 548
548Object.keys(Re.elements).forEach(function(Te){var je=Re.styles[Te]||{},Oe=Re.attributes[Te]||{},Me=Re.elements[Te];!isHTMLElement$1(Me)||!getNodeName(Me)||(Object.assign(Me.style,je),Object.keys(Oe).forEach(function(De){var $e=Oe[De];$e===!1?Me.removeAttribute(De):Me.setAttribute(De,$e===!0?"":$e)}))})}function effect$2(Ee){var Re=Ee.state,Te={popper:{position:Re.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(Re.elements.popper.style,Te.popper),Re.styles=Te,Re.elements.arrow&&Object.assign(Re.elements.arrow.style,Te.arrow),function(){Object.keys(Re.elements).forEach(function(je){var Oe=Re.elements[je],Me=Re.attributes[je]||{},De=Object.keys(Re.styles.hasOwnProperty(je)?Re.styles[je]:Te[je]),$e=De.reduce(function(Be,Ue){return Be[Ue]="",Be},{});!isHTMLElement$1(Oe)||!getNodeName(Oe)||(Object.assign(Oe.style,$e),Object.keys(Me).forEach(function(Be){Oe.removeAttribute(Be)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(Ee){return Ee.split("-")[0]}var max=Math.max,min=Math.min,round$1=Math.round;function getUAString(){var Ee=navigator.userAgentData;return Ee!=null&&Ee.brands&&Array.isArray(Ee.brands)?Ee.brands.map(function(Re){return Re.brand+"/"+Re.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(Ee,Re,Te){Re===void 0&&(Re=!1),Te===void 0&&(Te=!1);var je=Ee.getBoundingClientRect(),Oe=1,Me=1;Re&&isHTMLElement$1(Ee)&&(Oe=Ee.offsetWidth>0&&round$1(je.width)/Ee.offsetWidth||1,Me=Ee.offsetHeight>0&&round$1(je.height)/Ee.offsetHeight||1);var De=isElement(Ee)?getWindow(Ee):window,$e=De.visualViewport,Be=!isLayoutViewport()&&Te,Ue=(je.left+(Be&&$e?$e.offsetLeft:0))/Oe,ze=(je.top+(Be&&$e?$e.offsetTop:0))/Me,We=je.width/Oe,Xe=je.height/Me;return{width:We,height:Xe,top:ze,right:Ue+We,bottom:ze+Xe,left:Ue,x:Ue,y:ze}}function getLayoutRect(Ee){var Re=getBoundingClientRect(Ee),Te=Ee.offsetWidth,je=Ee.offsetHeight;return Math.abs(Re.width-Te)<=1&&(Te=Re.width),Math.abs(Re.height-je)<=1&&(je=Re.height),{x:Ee.offsetLeft,y:Ee.offsetTop,width:Te,height:je}}function contains(Ee,Re){var Te=Re.getRootNode&&Re.getRootNode();if(Ee.contains(Re))return!0;if(Te&&isShadowRoot(Te)){var je=Re;do{if(je&&Ee.isSameNode(je))return!0;je=je.parentNode||je.host}while(je)}return!1}function getComputedStyle$1(Ee){return getWindow(Ee).getComputedStyle(Ee)}function isTableElement(Ee){return["table","td","th"].indexOf(getNodeName(Ee))>=0}function getDocumentElement(Ee){return((isElement(Ee)?Ee.ownerDocument:Ee.document)||window.document).documentElement}function getParentNode(Ee){return getNodeName(Ee)==="html"?Ee:Ee.assignedSlot||Ee.parentNode||(isShadowRoot(Ee)?Ee.host:null)||getDocumentElement(Ee)}function getTrueOffsetParent(Ee){return!isHTMLElement$1(Ee)||getComputedStyle$1(Ee).position==="fixed"?null:Ee.offsetParent}function getContainingBlock(Ee){var Re=/firefox/i.test(getUAString()),Te=/Trident/i.test(getUAString());if(Te&&isHTMLElement$1(Ee)){var je=getComputedStyle$1(Ee);if(je.position==="fixed")return null}var Oe=getParentNode(Ee);for(isShadowRoot(Oe)&&(Oe=Oe.host);isHTMLElement$1(Oe)&&["html","body"].indexOf(getNodeName(Oe))<0;){var Me=getComputedStyle$1(Oe);if(Me.transform!=="none"||Me.perspective!=="none"||Me.contain==="paint"||["transform","perspective"].indexOf(Me.willChange)!==-1||Re&&Me.willChange==="filter"||Re&&Me.filter&&Me.filter!=="none")return Oe;Oe=Oe.parentNode}return null}function getOffsetParent(Ee){for(var Re=getWindow(Ee),Te=getTrueOffsetParent(Ee);Te&&isTableElement(Te)&&getComputedStyle$1(Te).position==="static";)Te=getTrueOffsetParent(Te);return Te&&(getNodeName(Te)==="html"||getNodeName(Te)==="body"&&getComputedStyle$1(Te).position==="static")?Re:Te||getContainingBlock(Ee)||Re}function getMainAxisFromPlacement(Ee){return["top","bottom"].indexOf(Ee)>=0?"x":"y"}function within(Ee,Re,Te){return max(Ee,min(Re,Te))}function withinMaxClamp(Ee,Re,Te){var je=within(Ee,Re,Te);return je>Te?Te:je}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(Ee){return Object.assign({},getFreshSideObject(),Ee)}function expandToHashMap(Ee,Re){return Re.reduce(function(Te,je){return Te[je]=Ee,Te},{})}var toPaddingObject=function(Re,Te){return Re=typeof Re=="function"?Re(Object.assign({},Te.rects,{placement:Te.placement})):Re,mergePaddingObject(typeof Re!="number"?Re:expandToHashMap(Re,basePlacements))};function arrow(Ee){var Re,Te=Ee.state,je=Ee.name,Oe=Ee.options,Me=Te.elements.arrow,De=Te.modifiersData.popperOffsets,$e=getBasePlacement(Te.placement),Be=getMainAxisFromPlacement($e),Ue=[left,right].indexOf($e)>=0,ze=Ue?"height":"width";if(!(!Me||!De)){var We=toPaddingObject(Oe.padding,Te),Xe=getLayoutRect(Me),He=Be==="y"?top:left,qe=Be==="y"?bottom:right,Ge=Te.rects.reference[ze]+Te.rects.reference[Be]-De[Be]-Te.rects.popper[ze],Ye=De[Be]-Te.rects.reference[Be],Ve=getOffsetParent(Me),Ke=Ve?Be==="y"?Ve.clientHeight||0:Ve.clientWidth||0:0,Qe=Ge/2-Ye/2,Ze=We[He],Je=Ke-Xe[ze]-We[qe],ir=Ke/2-Xe[ze]/2+Qe,rr=within(Ze,ir,Je),ar=Be;Te.modifiersData[je]=(Re={},Re[ar]=rr,Re.centerOffset=rr-ir,Re)}}function effect$1(Ee){var Re=Ee.state,Te=Ee.options,je=Te.element,Oe=je===void 0?"[data-popper-arrow]":je;Oe!=null&&(typeof Oe=="string"&&(Oe=Re.elements.popper.querySelector(Oe),!Oe)||contains(Re.elements.popper,Oe)&&(Re.elements.arrow=Oe))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(Ee){return Ee.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(Ee,Re){var Te=Ee.x,je=Ee.y,Oe=Re.devicePixelRatio||1;return{x:round$1(Te*Oe)/Oe||0,y:round$1(je*Oe)/Oe||0}}function mapToStyles(Ee){var Re,Te=Ee.popper,je=Ee.popperRect,Oe=Ee.placement,Me=Ee.variation,De=Ee.offsets,$e=Ee.position,Be=Ee.gpuAcceleration,Ue=Ee.adaptive,ze=Ee.roundOffsets,We=Ee.isFixed,Xe=De.x,He=Xe===void 0?0:Xe,qe=De.y,Ge=qe===void 0?0:qe,Ye=typeof ze=="function"?ze({x:He,y:Ge}):{x:He,y:Ge};He=Ye.x,Ge=Ye.y;var Ve=De.hasOwnProperty("x"),Ke=De.hasOwnProperty("y"),Qe=left,Ze=top,Je=window;if(Ue){var ir=getOffsetParent(Te),rr="clientHeight",ar="clientWidth";if(ir===getWindow(Te)&&(ir=getDocumentElement(Te),getComputedStyle$1(ir).position!=="static"&&$e==="absolute"&&(rr="scrollHeight",ar="scrollWidth")),ir=ir,Oe===top||(Oe===left||Oe===right)&&Me===end){Ze=bottom;var or=We&&ir===Je&&Je.visualViewport?Je.visualViewport.height:ir[rr];Ge-=or-je.height,Ge*=Be?1:-1}if(Oe===left||(Oe===top||Oe===bottom)&&Me===end){Qe=right;var pr=We&&ir===Je&&Je.visualViewport?Je.visualViewport.width:ir[ar];He-=pr-je.width,He*=Be?1:-1}}var tr=Object.assign({position:$e},Ue&&unsetSides),nr=ze===!0?roundOffsetsByDPR({x:He,y:Ge},getWindow(Te)):{x:He,y:Ge};if(He=nr.x,Ge=nr.y,Be){var hr;return Object.assign({},tr,(hr={},hr[Ze]=Ke?"0":"",hr[Qe]=Ve?"0":"",hr.transform=(Je.devicePixelRatio||1)<=1?"translate("+He+"px, "+Ge+"px)":"translate3d("+He+"px, "+Ge+"px, 0)",hr))}return Object.assign({},tr,(Re={},Re[Ze]=Ke?Ge+"px":"",Re[Qe]=Ve?He+"px":"",Re.transform="",Re))}function computeStyles(Ee){var Re=Ee.state,Te=Ee.options,je=Te.gpuAcceleration,Oe=je===void 0?!0:je,Me=Te.adaptive,De=Me===void 0?!0:Me,$e=Te.roundOffsets,Be=$e===void 0?!0:$e,Ue={placement:getBasePlacement(Re.placement),variation:getVariation(Re.placement),popper:Re.elements.popper,popperRect:Re.rects.popper,gpuAcceleration:Oe,isFixed:Re.options.strategy==="fixed"};Re.modifiersData.popperOffsets!=null&&(Re.styles.popper=Object.assign({},Re.styles.popper,mapToStyles(Object.assign({},Ue,{offsets:Re.modifiersData.popperOffsets,position:Re.options.strategy,adaptive:De,roundOffsets:Be})))),Re.modifiersData.arrow!=null&&(Re.styles.arrow=Object.assign({},Re.styles.arrow,mapToStyles(Object.assign({},Ue,{offsets:Re.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:Be})))),Re.attributes.popper=Object.assign({},Re.attributes.popper,{"data-popper-placement":Re.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(Ee){var Re=Ee.state,Te=Ee.instance,je=Ee.options,Oe=je.scroll,Me=Oe===void 0?!0:Oe,De=je.resize,$e=De===void 0?!0:De,Be=getWindow(Re.elements.popper),Ue=[].concat(Re.scrollParents.reference,Re.scrollParents.popper);return Me&&Ue.forEach(function(ze){ze.addEventListener("scroll",Te.update,passive)}),$e&&Be.addEventListener("resize",Te.update,passive),function(){Me&&Ue.forEach(function(ze){ze.removeEventListener("scroll",Te.update,passive)}),$e&&Be.removeEventListener("resize",Te.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(Ee){return Ee.replace(/left|right|bottom|top/g,function(Re){return hash$1[Re]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(Ee){return Ee.replace(/start|end/g,function(Re){return hash[Re]})}function getWindowScroll(Ee){var Re=getWindow(Ee),Te=Re.pageXOffset,je=Re.pageYOffset;return{scrollLeft:Te,scrollTop:je}}function getWindowScrollBarX(Ee){return getBoundingClientRect(getDocumentElement(Ee)).left+getWindowScroll(Ee).scrollLeft}function getViewportRect(Ee,Re){var Te=getWindow(Ee),je=getDocumentElement(Ee),Oe=Te.visualViewport,Me=je.clientWidth,De=je.clientHeight,$e=0,Be=0;if(Oe){Me=Oe.width,De=Oe.height;var Ue=isLayoutViewport();(Ue||!Ue&&Re==="fixed")&&($e=Oe.offsetLeft,Be=Oe.offsetTop)}return{width:Me,height:De,x:$e+getWindowScrollBarX(Ee),y:Be}}function getDocumentRect(Ee){var Re,Te=getDocumentElement(Ee),je=getWindowScroll(Ee),Oe=(Re=Ee.ownerDocument)==null?void 0:Re.body,Me=max(Te.scrollWidth,Te.clientWidth,Oe?Oe.scrollWidth:0,Oe?Oe.clientWidth:0),De=max(Te.scrollHeight,Te.clientHeight,Oe?Oe.scrollHeight:0,Oe?Oe.clientHeight:0),$e=-je.scrollLeft+getWindowScrollBarX(Ee),Be=-je.scrollTop;return getComputedStyle$1(Oe||Te).direction==="rtl"&&($e+=max(Te.clientWidth,Oe?Oe.clientWidth:0)-Me),{width:Me,height:De,x:$e,y:Be}}function isScrollParent(Ee){var Re=getComputedStyle$1(Ee),Te=Re.overflow,je=Re.overflowX,Oe=Re.overflowY;return/auto|scroll|overlay|hidden/.test(Te+Oe+je)}function getScrollParent(Ee){return["html","body","#document"].indexOf(getNodeName(Ee))>=0?Ee.ownerDocument.body:isHTMLElement$1(Ee)&&isScrollParent(Ee)?Ee:getScrollParent(getParentNode(Ee))}function listScrollParents(Ee,Re){var Te;Re===void 0&&(Re=[]);var je=getScrollParent(Ee),Oe=je===((Te=Ee.ownerDocument)==null?void 0:Te.body),Me=getWindow(je),De=Oe?[Me].concat(Me.visualViewport||[],isScrollParent(je)?je:[]):je,$e=Re.concat(De);return Oe?$e:$e.concat(listScrollParents(getParentNode(De)))}function rectToClientRect(Ee){return Object.assign({},Ee,{left:Ee.x,top:Ee.y,right:Ee.x+Ee.width,bottom:Ee.y+Ee.height})}function getInnerBoundingClientRect(Ee,Re){var Te=getBoundingClientRect(Ee,!1,Re==="fixed");return Te.top=Te.top+Ee.clientTop,Te.left=Te.left+Ee.clientLeft,Te.bottom=Te.top+Ee.clientHeight,Te.right=Te.left+Ee.clientWidth,Te.width=Ee.clientWidth,Te.height=Ee.clientHeight,Te.x=Te.left,Te.y=Te.top,Te}function getClientRectFromMixedType(Ee,Re,Te){return Re===viewport?rectToClientRect(getViewportRect(Ee,Te)):isElement(Re)?getInnerBoundingClientRect(Re,Te):rectToClientRect(getDocumentRect(getDocumentElement(Ee)))}function getClippingParents(Ee){var Re=listScrollParents(getParentNode(Ee)),Te=["absolute","fixed"].indexOf(getComputedStyle$1(Ee).position)>=0,je=Te&&isHTMLElement$1(Ee)?getOffsetParent(Ee):Ee;return isElement(je)?Re.filter(function(Oe){return isElement(Oe)&&contains(Oe,je)&&getNodeName(Oe)!=="body"}):[]}function getClippingRect(Ee,Re,Te,je){var Oe=Re==="clippingParents"?getClippingParents(Ee):[].concat(Re),Me=[].concat(Oe,[Te]),De=Me[0],$e=Me.reduce(function(Be,Ue){var ze=getClientRectFromMixedType(Ee,Ue,je);return Be.top=max(ze.top,Be.top),Be.right=min(ze.right,Be.right),Be.bottom=min(ze.bottom,Be.bottom),Be.left=max(ze.left,Be.left),Be},getClientRectFromMixedType(Ee,De,je));return $e.width=$e.right-$e.left,$e.height=$e.bottom-$e.top,$e.x=$e.left,$e.y=$e.top,$e}function computeOffsets(Ee){var Re=Ee.reference,Te=Ee.element,je=Ee.placement,Oe=je?getBasePlacement(je):null,Me=je?getVariation(je):null,De=Re.x+Re.width/2-Te.width/2,$e=Re.y+Re.height/2-Te.height/2,Be;switch(Oe){case top:Be={x:De,y:Re.y-Te.height};break;case bottom:Be={x:De,y:Re.y+Re.height};break;case right:Be={x:Re.x+Re.width,y:$e};break;case left:Be={x:Re.x-Te.width,y:$e};break;default:Be={x:Re.x,y:Re.y}}var Ue=Oe?getMainAxisFromPlacement(Oe):null;if(Ue!=null){var ze=Ue==="y"?"height":"width";switch(Me){case start:Be[Ue]=Be[Ue]-(Re[ze]/2-Te[ze]/2);break;case end:Be[Ue]=Be[Ue]+(Re[ze]/2-Te[ze]/2);break}}return Be}function detectOverflow(Ee,Re){Re===void 0&&(Re={});var Te=Re,je=Te.placement,Oe=je===void 0?Ee.placement:je,Me=Te.strategy,De=Me===void 0?Ee.strategy:Me,$e=Te.boundary,Be=$e===void 0?clippingParents:$e,Ue=Te.rootBoundary,ze=Ue===void 0?viewport:Ue,We=Te.elementContext,Xe=We===void 0?popper:We,He=Te.altBoundary,qe=He===void 0?!1:He,Ge=Te.padding,Ye=Ge===void 0?0:Ge,Ve=mergePaddingObject(typeof Ye!="number"?Ye:expandToHashMap(Ye,basePlacements)),Ke=Xe===popper?reference:popper,Qe=Ee.rects.popper,Ze=Ee.elements[qe?Ke:Xe],Je=getClippingRect(isElement(Ze)?Ze:Ze.contextElement||getDocumentElement(Ee.elements.popper),Be,ze,De),ir=getBoundingClientRect(Ee.elements.reference),rr=computeOffsets({reference:ir,element:Qe,placement:Oe}),ar=rectToClientRect(Object.assign({},Qe,rr)),or=Xe===popper?ar:ir,pr={top:Je.top-or.top+Ve.top,bottom:or.bottom-Je.bottom+Ve.bottom,left:Je.left-or.left+Ve.left,right:or.right-Je.right+Ve.right},tr=Ee.modifiersData.offset;if(Xe===popper&&tr){var nr=tr[Oe];Object.keys(pr).forEach(function(hr){var sr=[right,bottom].indexOf(hr)>=0?1:-1,xr=[top,bottom].indexOf(hr)>=0?"y":"x";pr[hr]+=nr[xr]*sr})}return pr}function computeAutoPlacement(Ee,Re){Re===void 0&&(Re={});var Te=Re,je=Te.placement,Oe=Te.boundary,Me=Te.rootBoundary,De=Te.padding,$e=Te.flipVariations,Be=Te.allowedAutoPlacements,Ue=Be===void 0?placements:Be,ze=getVariation(je),We=ze?$e?variationPlacements:variationPlacements.filter(function(qe){return getVariation(qe)===ze}):basePlacements,Xe=We.filter(function(qe){return Ue.indexOf(qe)>=0});Xe.length===0&&(Xe=We);var He=Xe.reduce(function(qe,Ge){return qe[Ge]=detectOverflow(Ee,{placement:Ge,boundary:Oe,rootBoundary:Me,padding:De})[getBasePlacement(Ge)],qe},{});return Object.keys(He).sort(function(qe,Ge){return He[qe]-He[Ge]})}function getExpandedFallbackPlacements(Ee){if(getBasePlacement(Ee)===auto)return[];var Re=getOppositePlacement(Ee);return[getOppositeVariationPlacement(Ee),Re,getOppositeVariationPlacement(Re)]}function flip(Ee){var Re=Ee.state,Te=Ee.options,je=Ee.name;if(!Re.modifiersData[je]._skip){for(var Oe=Te.mainAxis,Me=Oe===void 0?!0:Oe,De=Te.altAxis,$e=De===void 0?!0:De,Be=Te.fallbackPlacements,Ue=Te.padding,ze=Te.boundary,We=Te.rootBoundary,Xe=Te.altBoundary,He=Te.flipVariations,qe=He===void 0?!0:He,Ge=Te.allowedAutoPlacements,Ye=Re.options.placement,Ve=getBasePlacement(Ye),Ke=Ve===Ye,Qe=Be||(Ke||!qe?[getOppositePlacement(Ye)]:getExpandedFallbackPlacements(Ye)),Ze=[Ye].concat(Qe).reduce(function(ur,gr){return ur.concat(getBasePlacement(gr)===auto?computeAutoPlacement(Re,{placement:gr,boundary:ze,rootBoundary:We,padding:Ue,flipVariations:qe,allowedAutoPlacements:Ge}):gr)},[]),Je=Re.rects.reference,ir=Re.rects.popper,rr=new Map,ar=!0,or=Ze[0],pr=0;pr<Ze.length;pr++){var tr=Ze[pr],nr=getBasePlacement(tr),hr=getVariation(tr)===start,sr=[top,bottom].indexOf(nr)>=0,xr=sr?"width":"height",Rr=detectOverflow(Re,{placement:tr,boundary:ze,rootBoundary:We,altBoundary:Xe,padding:Ue}),br=sr?hr?right:left:hr?bottom:top;Je[xr]>ir[xr]&&(br=getOppositePlacement(br));var wr=getOppositePlacement(br),vr=[];if(Me&&vr.push(Rr[nr]<=0),$e&&vr.push(Rr[br]<=0,Rr[wr]<=0),vr.every(function(ur){return ur})){or=tr,ar=!1;break}rr.set(tr,vr)}if(ar)for(var Dr=qe?3:1,kr=function(gr){var _r=Ze.find(function(Ir){var Ar=rr.get(Ir);if(Ar)return Ar.slice(0,gr).every(function(Tr){return Tr})});if(_r)return or=_r,"break"},cr=Dr;cr>0;cr--){var dr=kr(cr);if(dr==="break")break}Re.placement!==or&&(Re.modifiersData[je]._skip=!0,Re.placement=or,Re.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(Ee,Re,Te){return Te===void 0&&(Te={x:0,y:0}),{top:Ee.top-Re.height-Te.y,right:Ee.right-Re.width+Te.x,bottom:Ee.bottom-Re.height+Te.y,left:Ee.left-Re.width-Te.x}}function isAnySideFullyClipped(Ee){return[top,right,bottom,left].some(function(Re){return Ee[Re]>=0})}function hide(Ee){var Re=Ee.state,Te=Ee.name,je=Re.rects.reference,Oe=Re.rects.popper,Me=Re.modifiersData.preventOverflow,De=detectOverflow(Re,{elementContext:"reference"}),$e=detectOverflow(Re,{altBoundary:!0}),Be=getSideOffsets(De,je),Ue=getSideOffsets($e,Oe,Me),ze=isAnySideFullyClipped(Be),We=isAnySideFullyClipped(Ue);Re.modifiersData[Te]={referenceClippingOffsets:Be,popperEscapeOffsets:Ue,isReferenceHidden:ze,hasPopperEscaped:We},Re.attributes.popper=Object.assign({},Re.attributes.popper,{"data-popper-reference-hidden":ze,"data-popper-escaped":We})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(Ee,Re,Te){var je=getBasePlacement(Ee),Oe=[left,top].indexOf(je)>=0?-1:1,Me=typeof Te=="function"?Te(Object.assign({},Re,{placement:Ee})):Te,De=Me[0],$e=Me[1];return De=De||0,$e=($e||0)*Oe,[left,right].indexOf(je)>=0?{x:$e,y:De}:{x:De,y:$e}}function offset(Ee){var Re=Ee.state,Te=Ee.options,je=Ee.name,Oe=Te.offset,Me=Oe===void 0?[0,0]:Oe,De=placements.reduce(function(ze,We){return ze[We]=distanceAndSkiddingToXY(We,Re.rects,Me),ze},{}),$e=De[Re.placement],Be=$e.x,Ue=$e.y;Re.modifiersData.popperOffsets!=null&&(Re.modifiersData.popperOffsets.x+=Be,Re.modifiersData.popperOffsets.y+=Ue),Re.modifiersData[je]=De}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(Ee){var Re=Ee.state,Te=Ee.name;Re.modifiersData[Te]=computeOffsets({reference:Re.rects.reference,element:Re.rects.popper,placement:Re.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(Ee){return Ee==="x"?"y":"x"}function preventOverflow(Ee){var Re=Ee.state,Te=Ee.options,je=Ee.name,Oe=Te.mainAxis,Me=Oe===void 0?!0:Oe,De=Te.altAxis,$e=De===void 0?!1:De,Be=Te.boundary,Ue=Te.rootBoundary,ze=Te.altBoundary,We=Te.padding,Xe=Te.tether,He=Xe===void 0?!0:Xe,qe=Te.tetherOffset,Ge=qe===void 0?0:qe,Ye=detectOverflow(Re,{boundary:Be,rootBoundary:Ue,padding:We,altBoundary:ze}),Ve=getBasePlacement(Re.placement),Ke=getVariation(Re.placement),Qe=!Ke,Ze=getMainAxisFromPlacement(Ve),Je=getAltAxis(Ze),ir=Re.modifiersData.popperOffsets,rr=Re.rects.reference,ar=Re.rects.popper,or=typeof Ge=="function"?Ge(Object.assign({},Re.rects,{placement:Re.placement})):Ge,pr=typeof or=="number"?{mainAxis:or,altAxis:or}:Object.assign({mainAxis:0,altAxis:0},or),tr=Re.modifiersData.offset?Re.modifiersData.offset[Re.placement]:null,nr={x:0,y:0};if(ir){if(Me){var hr,sr=Ze==="y"?top:left,xr=Ze==="y"?bottom:right,Rr=Ze==="y"?"height":"width",br=ir[Ze],wr=br+Ye[sr],vr=br-Ye[xr],Dr=He?-ar[Rr]/2:0,kr=Ke===start?rr[Rr]:ar[Rr],cr=Ke===start?-ar[Rr]:-rr[Rr],dr=Re.elements.arrow,ur=He&&dr?getLayoutRect(dr):{width:0,height:0},gr=Re.modifiersData["arrow#persistent"]?Re.modifiersData["arrow#persistent"].padding:getFreshSideObject(),_r=gr[sr],Ir=gr[xr],Ar=within(0,rr[Rr],ur[Rr]),Tr=Qe?rr[Rr]/2-Dr-Ar-_r-pr.mainAxis:kr-Ar-_r-pr.mainAxis,Nr=Qe?-rr[Rr]/2+Dr+Ar+Ir+pr.mainAxis:cr+Ar+Ir+pr.mainAxis,Br=Re.elements.arrow&&getOffsetParent(Re.elements.arrow),Hr=Br?Ze==="y"?Br.clientTop||0:Br.clientLeft||0:0,Vr=(hr=tr==null?void 0:tr[Ze])!=null?hr:0,mr=br+Tr-Vr-Hr,Sr=br+Nr-Vr,Lr=within(He?min(wr,mr):wr,br,He?max(vr,Sr):vr);ir[Ze]=Lr,nr[Ze]=Lr-br}if($e){var jr,fr=Ze==="x"?top:left,Cr=Ze==="x"?bottom:right,Mr=ir[Je],$r=Je==="y"?"height":"width",Fr=Mr+Ye[fr],Kr=Mr-Ye[Cr],an=[top,left].indexOf(Ve)!==-1,Wr=(jr=tr==null?void 0:tr[Je])!=null?jr:0,hn=an?Fr:Mr-rr[$r]-ar[$r]-Wr+pr.altAxis,cn=an?Mr+rr[$r]+ar[$r]-Wr-pr.altAxis:Kr,tn=He&&an?withinMaxClamp(hn,Mr,cn):within(He?hn:Fr,Mr,He?cn:Kr);ir[Je]=tn,nr[Je]=tn-Mr}Re.modifiersData[je]=nr}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(Ee){return{scrollLeft:Ee.scrollLeft,scrollTop:Ee.scrollTop}}
vendor: 4,493 bytes, line 548
548function getNodeScroll(Ee){return Ee===getWindow(Ee)||!isHTMLElement$1(Ee)?getWindowScroll(Ee):getHTMLElementScroll(Ee)}function isElementScaled(Ee){var Re=Ee.getBoundingClientRect(),Te=round$1(Re.width)/Ee.offsetWidth||1,je=round$1(Re.height)/Ee.offsetHeight||1;return Te!==1||je!==1}function getCompositeRect(Ee,Re,Te){Te===void 0&&(Te=!1);var je=isHTMLElement$1(Re),Oe=isHTMLElement$1(Re)&&isElementScaled(Re),Me=getDocumentElement(Re),De=getBoundingClientRect(Ee,Oe,Te),$e={scrollLeft:0,scrollTop:0},Be={x:0,y:0};return(je||!je&&!Te)&&((getNodeName(Re)!=="body"||isScrollParent(Me))&&($e=getNodeScroll(Re)),isHTMLElement$1(Re)?(Be=getBoundingClientRect(Re,!0),Be.x+=Re.clientLeft,Be.y+=Re.clientTop):Me&&(Be.x=getWindowScrollBarX(Me))),{x:De.left+$e.scrollLeft-Be.x,y:De.top+$e.scrollTop-Be.y,width:De.width,height:De.height}}function order(Ee){var Re=new Map,Te=new Set,je=[];Ee.forEach(function(Me){Re.set(Me.name,Me)});function Oe(Me){Te.add(Me.name);var De=[].concat(Me.requires||[],Me.requiresIfExists||[]);De.forEach(function($e){if(!Te.has($e)){var Be=Re.get($e);Be&&Oe(Be)}}),je.push(Me)}return Ee.forEach(function(Me){Te.has(Me.name)||Oe(Me)}),je}function orderModifiers(Ee){var Re=order(Ee);return modifierPhases.reduce(function(Te,je){return Te.concat(Re.filter(function(Oe){return Oe.phase===je}))},[])}function debounce(Ee){var Re;return function(){return Re||(Re=new Promise(function(Te){Promise.resolve().then(function(){Re=void 0,Te(Ee())})})),Re}}function mergeByName(Ee){var Re=Ee.reduce(function(Te,je){var Oe=Te[je.name];return Te[je.name]=Oe?Object.assign({},Oe,je,{options:Object.assign({},Oe.options,je.options),data:Object.assign({},Oe.data,je.data)}):je,Te},{});return Object.keys(Re).map(function(Te){return Re[Te]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var Ee=arguments.length,Re=new Array(Ee),Te=0;Te<Ee;Te++)Re[Te]=arguments[Te];return!Re.some(function(je){return!(je&&typeof je.getBoundingClientRect=="function")})}function popperGenerator(Ee){Ee===void 0&&(Ee={});var Re=Ee,Te=Re.defaultModifiers,je=Te===void 0?[]:Te,Oe=Re.defaultOptions,Me=Oe===void 0?DEFAULT_OPTIONS:Oe;return function($e,Be,Ue){Ue===void 0&&(Ue=Me);var ze={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,Me),modifiersData:{},elements:{reference:$e,popper:Be},attributes:{},styles:{}},We=[],Xe=!1,He={state:ze,setOptions:function(Ve){var Ke=typeof Ve=="function"?Ve(ze.options):Ve;Ge(),ze.options=Object.assign({},Me,ze.options,Ke),ze.scrollParents={reference:isElement($e)?listScrollParents($e):$e.contextElement?listScrollParents($e.contextElement):[],popper:listScrollParents(Be)};var Qe=orderModifiers(mergeByName([].concat(je,ze.options.modifiers)));return ze.orderedModifiers=Qe.filter(function(Ze){return Ze.enabled}),qe(),He.update()},forceUpdate:function(){if(!Xe){var Ve=ze.elements,Ke=Ve.reference,Qe=Ve.popper;if(areValidElements(Ke,Qe)){ze.rects={reference:getCompositeRect(Ke,getOffsetParent(Qe),ze.options.strategy==="fixed"),popper:getLayoutRect(Qe)},ze.reset=!1,ze.placement=ze.options.placement,ze.orderedModifiers.forEach(function(pr){return ze.modifiersData[pr.name]=Object.assign({},pr.data)});for(var Ze=0;Ze<ze.orderedModifiers.length;Ze++){if(ze.reset===!0){ze.reset=!1,Ze=-1;continue}var Je=ze.orderedModifiers[Ze],ir=Je.fn,rr=Je.options,ar=rr===void 0?{}:rr,or=Je.name;typeof ir=="function"&&(ze=ir({state:ze,options:ar,name:or,instance:He})||ze)}}}},update:debounce(function(){return new Promise(function(Ye){He.forceUpdate(),Ye(ze)})}),destroy:function(){Ge(),Xe=!0}};if(!areValidElements($e,Be))return He;He.setOptions(Ue).then(function(Ye){!Xe&&Ue.onFirstUpdate&&Ue.onFirstUpdate(Ye)});function qe(){ze.orderedModifiers.forEach(function(Ye){var Ve=Ye.name,Ke=Ye.options,Qe=Ke===void 0?{}:Ke,Ze=Ye.effect;if(typeof Ze=="function"){var Je=Ze({state:ze,name:Ve,instance:He,options:Qe}),ir=function(){};We.push(Je||ir)}})}function Ge(){We.forEach(function(Ye){return Ye()}),We=[]}return He}}var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers});function getContainer$1(Ee){return typeof Ee=="function"?Ee():Ee}const Portal=reactExports.forwardRef(function(Re,Te){const{children:je,container:Oe,disablePortal:Me=!1}=Re,[De,$e]=reactExports.useState(null),Be=useForkRef(reactExports.isValidElement(je)?getReactElementRef(je):null,Te);
548if(useEnhancedEffect(()=>{Me||$e(getContainer$1(Oe)||document.body)},[Oe,Me]),useEnhancedEffect(()=>{if(De&&!Me)return setRef(Te,De),()=>{setRef(Te,null)}},[Te,De,Me]),Me){if(reactExports.isValidElement(je)){const Ue={ref:Be};return reactExports.cloneElement(je,Ue)}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:je})}return jsxRuntimeExports.jsx(reactExports.Fragment,{children:De&&reactDomExports.createPortal(je,De)})});function getPopperUtilityClass(Ee){return generateUtilityClass("MuiPopper",Ee)}generateUtilityClasses("MuiPopper",["root"]);const _excluded$12=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],_excluded2$8=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function flipPlacement(Ee,Re){if(Re==="ltr")return Ee;switch(Ee){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return Ee}}function resolveAnchorEl$1(Ee){return typeof Ee=="function"?Ee():Ee}function isHTMLElement(Ee){return Ee.nodeType!==void 0}const useUtilityClasses$W=Ee=>{const{classes:Re}=Ee;return composeClasses({root:["root"]},getPopperUtilityClass,Re)},defaultPopperOptions={},PopperTooltip=reactExports.forwardRef(function(Re,Te){var je;const{anchorEl:Oe,children:Me,direction:De,disablePortal:$e,modifiers:Be,open:Ue,placement:ze,popperOptions:We,popperRef:Xe,slotProps:He={},slots:qe={},TransitionProps:Ge}=Re,Ye=_objectWithoutPropertiesLoose(Re,_excluded$12),Ve=reactExports.useRef(null),Ke=useForkRef(Ve,Te),Qe=reactExports.useRef(null),Ze=useForkRef(Qe,Xe),Je=reactExports.useRef(Ze);useEnhancedEffect(()=>{Je.current=Ze},[Ze]),reactExports.useImperativeHandle(Xe,()=>Qe.current,[]);const ir=flipPlacement(ze,De),[rr,ar]=reactExports.useState(ir),[or,pr]=reactExports.useState(resolveAnchorEl$1(Oe));reactExports.useEffect(()=>{Qe.current&&Qe.current.forceUpdate()}),reactExports.useEffect(()=>{Oe&&pr(resolveAnchorEl$1(Oe))},[Oe]),useEnhancedEffect(()=>{if(!or||!Ue)return;const xr=wr=>{ar(wr.placement)};let Rr=[{name:"preventOverflow",options:{altBoundary:$e}},{name:"flip",options:{altBoundary:$e}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:wr})=>{xr(wr)}}];Be!=null&&(Rr=Rr.concat(Be)),We&&We.modifiers!=null&&(Rr=Rr.concat(We.modifiers));const br=createPopper(or,Ve.current,_extends$1({placement:ir},We,{modifiers:Rr}));return Je.current(br),()=>{br.destroy(),Je.current(null)}},[or,$e,Be,Ue,We,ir]);const tr={placement:rr};Ge!==null&&(tr.TransitionProps=Ge);const nr=useUtilityClasses$W(Re),hr=(je=qe.root)!=null?je:"div",sr=useSlotProps({elementType:hr,externalSlotProps:He.root,externalForwardedProps:Ye,additionalProps:{role:"tooltip",ref:Ke},ownerState:Re,className:nr.root});return jsxRuntimeExports.jsx(hr,_extends$1({},sr,{children:typeof Me=="function"?Me(tr):Me}))}),Popper$1=reactExports.forwardRef(function(Re,Te){const{anchorEl:je,children:Oe,container:Me,direction:De="ltr",disablePortal:$e=!1,keepMounted:Be=!1,modifiers:Ue,open:ze,placement:We="bottom",popperOptions:Xe=defaultPopperOptions,popperRef:He,style:qe,transition:Ge=!1,slotProps:Ye={},slots:Ve={}}=Re,Ke=_objectWithoutPropertiesLoose(Re,_excluded2$8),[Qe,Ze]=reactExports.useState(!0),Je=()=>{Ze(!1)},ir=()=>{Ze(!0)};if(!Be&&!ze&&(!Ge||Qe))return null;let rr;if(Me)rr=Me;else if(je){const pr=resolveAnchorEl$1(je);rr=pr&&isHTMLElement(pr)?ownerDocument(pr).body:ownerDocument(null).body}const ar=!ze&&Be&&(!Ge||Qe)?"none":void 0,or=Ge?{in:ze,onEnter:Je,onExited:ir}:void 0;return jsxRuntimeExports.jsx(Portal,{disablePortal:$e,container:rr,children:jsxRuntimeExports.jsx(PopperTooltip,_extends$1({anchorEl:je,direction:De,disablePortal:$e,modifiers:Ue,ref:Te,open:Ge?!Qe:ze,placement:We,popperOptions:Xe,popperRef:He,slotProps:Ye,slots:Ve},Ke,{style:_extends$1({position:"fixed",top:0,left:0,display:ar},qe),TransitionProps:or,children:Oe}))})}),_excluded$11=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],PopperRoot=styled(Popper$1,{name:"MuiPopper",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})({}),Popper=reactExports.forwardRef(function(Re,Te){var je;const Oe=default_1$4(),Me=useDefaultProps({props:Re,name:"MuiPopper"}),{anchorEl:De,component:$e,components:Be,componentsProps:Ue,container:ze,disablePortal:We,keepMounted:Xe,modifiers:He,open:qe,placement:Ge,popperOptions:Ye,popperRef:Ve,transition:Ke,slots:Qe,slotProps:Ze}
vendor: 6,600 bytes, line 548
548=Me,Je=_objectWithoutPropertiesLoose(Me,_excluded$11),ir=(je=Qe==null?void 0:Qe.root)!=null?je:Be==null?void 0:Be.Root,rr=_extends$1({anchorEl:De,container:ze,disablePortal:We,keepMounted:Xe,modifiers:He,open:qe,placement:Ge,popperOptions:Ye,popperRef:Ve,transition:Ke},Je);return jsxRuntimeExports.jsx(PopperRoot,_extends$1({as:$e,direction:Oe==null?void 0:Oe.direction,slots:{root:ir},slotProps:Ze??Ue},rr,{ref:Te}))});function getListSubheaderUtilityClass(Ee){return generateUtilityClass("MuiListSubheader",Ee)}generateUtilityClasses("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const _excluded$10=["className","color","component","disableGutters","disableSticky","inset"],useUtilityClasses$V=Ee=>{const{classes:Re,color:Te,disableGutters:je,inset:Oe,disableSticky:Me}=Ee,De={root:["root",Te!=="default"&&`color${capitalize$1(Te)}`,!je&&"gutters",Oe&&"inset",!Me&&"sticky"]};return composeClasses(De,getListSubheaderUtilityClass,Re)},ListSubheaderRoot=styled("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.color!=="default"&&Re[`color${capitalize$1(Te.color)}`],!Te.disableGutters&&Re.gutters,Te.inset&&Re.inset,!Te.disableSticky&&Re.sticky]}})(({theme:Ee,ownerState:Re})=>_extends$1({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(Ee.vars||Ee).palette.text.secondary,fontFamily:Ee.typography.fontFamily,fontWeight:Ee.typography.fontWeightMedium,fontSize:Ee.typography.pxToRem(14)},Re.color==="primary"&&{color:(Ee.vars||Ee).palette.primary.main},Re.color==="inherit"&&{color:"inherit"},!Re.disableGutters&&{paddingLeft:16,paddingRight:16},Re.inset&&{paddingLeft:72},!Re.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(Ee.vars||Ee).palette.background.paper})),ListSubheader=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiListSubheader"}),{className:Oe,color:Me="default",component:De="li",disableGutters:$e=!1,disableSticky:Be=!1,inset:Ue=!1}=je,ze=_objectWithoutPropertiesLoose(je,_excluded$10),We=_extends$1({},je,{color:Me,component:De,disableGutters:$e,disableSticky:Be,inset:Ue}),Xe=useUtilityClasses$V(We);return jsxRuntimeExports.jsx(ListSubheaderRoot,_extends$1({as:De,className:clsx(Xe.root,Oe),ref:Te,ownerState:We},ze))});ListSubheader.muiSkipListHighlight=!0;const CancelIcon$1=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function getChipUtilityClass(Ee){return generateUtilityClass("MuiChip",Ee)}const chipClasses=generateUtilityClasses("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),_excluded$$=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],useUtilityClasses$U=Ee=>{const{classes:Re,disabled:Te,size:je,color:Oe,iconColor:Me,onDelete:De,clickable:$e,variant:Be}=Ee,Ue={root:["root",Be,Te&&"disabled",`size${capitalize$1(je)}`,`color${capitalize$1(Oe)}`,$e&&"clickable",$e&&`clickableColor${capitalize$1(Oe)}`,De&&"deletable",De&&`deletableColor${capitalize$1(Oe)}`,`${Be}${capitalize$1(Oe)}`],label:["label",`label${capitalize$1(je)}`],avatar:["avatar",`avatar${capitalize$1(je)}`,`avatarColor${capitalize$1(Oe)}`],icon:["icon",`icon${capitalize$1(je)}`,`iconColor${capitalize$1(Me)}`],deleteIcon:["deleteIcon",`deleteIcon${capitalize$1(je)}`,`deleteIconColor${capitalize$1(Oe)}`,`deleteIcon${capitalize$1(Be)}Color${capitalize$1(Oe)}`]};return composeClasses(Ue,getChipUtilityClass,Re)},ChipRoot=styled("div",{name:"MuiChip",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee,{color:je,iconColor:Oe,clickable:Me,onDelete:De,size:$e,variant:Be}=Te;return[{[`& .${chipClasses.avatar}`]:Re.avatar},{[`& .${chipClasses.avatar}`]:Re[`avatar${capitalize$1($e)}`]},{[`& .${chipClasses.avatar}`]:Re[`avatarColor${capitalize$1(je)}`]},{[`& .${chipClasses.icon}`]:Re.icon},{[`& .${chipClasses.icon}`]:Re[`icon${capitalize$1($e)}`]},{[`& .${chipClasses.icon}`]:Re[`iconColor${capitalize$1(Oe)}`]},{[`& .${chipClasses.deleteIcon}`]:Re.deleteIcon},{[`& .${chipClasses.deleteIcon}`]:Re[`deleteIcon${capitalize$1($e)}`]},{[`& .${chipClasses.deleteIcon}`]:Re[`deleteIconColor${capitalize$1(je)}`]},{[`& .${chipClasses.deleteIcon}`]:Re[`deleteIcon${capitalize$1(Be)}Color${capitalize$1(je)}`]},Re.root,Re[`size${capitalize$1($e)}`],Re[`color${capitalize$1(je)}`],Me&&Re.clickable,Me&&je!=="default"&&Re[`clickableColor${capitalize$1(je)})`],De&&Re.deletable,De&&je!=="default"&&Re[`deletableColor${capitalize$1(je)}`],Re[Be],Re[`${Be}${capitalize$1(je)}`]]}})(({theme:Ee,ownerState:Re})=>{const Te=Ee.palette.mode==="light"?Ee.palette.grey[700]:Ee.palette.grey[300];return _extends$1({maxWidth:"100%",fontFamily:Ee.typography.fontFamily,fontSize:Ee.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(Ee.vars||Ee).palette.text.primary,backgroundColor:(Ee.vars||Ee).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:Ee.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${chipClasses.disabled}`]:{opacity:(Ee.vars||Ee).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${chipClasses.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:Ee.vars?Ee.vars.palette.Chip.defaultAvatarColor:Te,fontSize:Ee.typography.pxToRem(12)},[`& .${chipClasses.avatarColorPrimary}`]:{color:(Ee.vars||Ee).palette.primary.contrastText,backgroundColor:(Ee.vars||Ee).palette.primary.dark},[`& .${chipClasses.avatarColorSecondary}
548`]:{color:(Ee.vars||Ee).palette.secondary.contrastText,backgroundColor:(Ee.vars||Ee).palette.secondary.dark},[`& .${chipClasses.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:Ee.typography.pxToRem(10)},[`& .${chipClasses.icon}`]:_extends$1({marginLeft:5,marginRight:-6},Re.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},Re.iconColor===Re.color&&_extends$1({color:Ee.vars?Ee.vars.palette.Chip.defaultIconColor:Te},Re.color!=="default"&&{color:"inherit"})),[`& .${chipClasses.deleteIcon}`]:_extends$1({WebkitTapHighlightColor:"transparent",color:Ee.vars?`rgba(${Ee.vars.palette.text.primaryChannel} / 0.26)`:alpha_1(Ee.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:Ee.vars?`rgba(${Ee.vars.palette.text.primaryChannel} / 0.4)`:alpha_1(Ee.palette.text.primary,.4)}},Re.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},Re.color!=="default"&&{color:Ee.vars?`rgba(${Ee.vars.palette[Re.color].contrastTextChannel} / 0.7)`:alpha_1(Ee.palette[Re.color].contrastText,.7),"&:hover, &:active":{color:(Ee.vars||Ee).palette[Re.color].contrastText}})},Re.size==="small"&&{height:24},Re.color!=="default"&&{backgroundColor:(Ee.vars||Ee).palette[Re.color].main,color:(Ee.vars||Ee).palette[Re.color].contrastText},Re.onDelete&&{[`&.${chipClasses.focusVisible}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.action.selectedChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.focusOpacity}))`:alpha_1(Ee.palette.action.selected,Ee.palette.action.selectedOpacity+Ee.palette.action.focusOpacity)}},Re.onDelete&&Re.color!=="default"&&{[`&.${chipClasses.focusVisible}`]:{backgroundColor:(Ee.vars||Ee).palette[Re.color].dark}})},({theme:Ee,ownerState:Re})=>_extends$1({},Re.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.action.selectedChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.hoverOpacity}))`:alpha_1(Ee.palette.action.selected,Ee.palette.action.selectedOpacity+Ee.palette.action.hoverOpacity)},[`&.${chipClasses.focusVisible}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.action.selectedChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.focusOpacity}))`:alpha_1(Ee.palette.action.selected,Ee.palette.action.selectedOpacity+Ee.palette.action.focusOpacity)},"&:active":{boxShadow:(Ee.vars||Ee).shadows[1]}},Re.clickable&&Re.color!=="default"&&{[`&:hover, &.${chipClasses.focusVisible}`]:{backgroundColor:(Ee.vars||Ee).palette[Re.color].dark}}),({theme:Ee,ownerState:Re})=>_extends$1({},Re.variant==="outlined"&&{backgroundColor:"transparent",border:Ee.vars?`1px solid ${Ee.vars.palette.Chip.defaultBorder}`:`1px solid ${Ee.palette.mode==="light"?Ee.palette.grey[400]:Ee.palette.grey[700]}`,[`&.${chipClasses.clickable}:hover`]:{backgroundColor:(Ee.vars||Ee).palette.action.hover},[`&.${chipClasses.focusVisible}`]:{backgroundColor:(Ee.vars||Ee).palette.action.focus},[`& .${chipClasses.avatar}`]:{marginLeft:4},[`& .${chipClasses.avatarSmall}`]:{marginLeft:2},[`& .${chipClasses.icon}`]:{marginLeft:4},[`& .${chipClasses.iconSmall}`]:{marginLeft:2},[`& .${chipClasses.deleteIcon}`]:{marginRight:5},[`& .${chipClasses.deleteIconSmall}`]:{marginRight:3}},Re.variant==="outlined"&&Re.color!=="default"&&{color:(Ee.vars||Ee).palette[Re.color].main,border:`1px solid ${Ee.vars?`rgba(${Ee.vars.palette[Re.color].mainChannel} / 0.7)`:alpha_1(Ee.palette[Re.color].main,.7)}`,[`&.${chipClasses.clickable}:hover`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette[Re.color].mainChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Ee.palette[Re.color].main,Ee.palette.action.hoverOpacity)},[`&.${chipClasses.focusVisible}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette[Re.color].mainChannel} / ${Ee.vars.palette.action.focusOpacity})`:alpha_1(Ee.palette[Re.color].main,Ee.palette.action.focusOpacity)},[`& .${chipClasses.deleteIcon}`]:{color:Ee.vars?`rgba(${Ee.vars.palette[Re.color].mainChannel} / 0.7)`:alpha_1(Ee.palette[Re.color].main,.7),"&:hover, &:active":{color:(Ee.vars||Ee).palette[Re.color].main}}})),ChipLabel=styled("span",{name:"MuiChip",slot:"Label",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee,{size:je}=Te;return[Re.label,Re[`label${capitalize$1(je)}`]]}})(({ownerState:Ee})=>_extends$1({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},Ee.variant==="outlined"&&{paddingLeft:11,paddingRight:11},Ee.size==="small"&&{paddingLeft:8,paddingRight:8},Ee.size==="small"&&Ee.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function isDeleteKeyboardEvent(Ee){return Ee.key==="Backspace"||Ee.key==="Delete"}const Chip=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiChip"}),{avatar:Oe,className:Me,clickable:De,color:$e="default",component:Be,deleteIcon:Ue,disabled:ze=!1,icon:We,label:Xe,onClick:He,onDelete:qe,onKeyDown:Ge,onKeyUp:Ye,size:Ve="medium",variant:Ke="filled",tabIndex:Qe,skipFocusWhenDisabled:Ze=!1}=je,Je=_objectWithoutPropertiesLoose(je,_excluded$$),ir=reactExports.useRef(null),rr=useForkRef(ir,Te),ar=vr=>{vr.stopPropagation(),qe&&qe(vr)},or=vr=>{vr.currentTarget===vr.target&&isDeleteKeyboardEvent(vr)&&vr.preventDefault(),Ge&&Ge(vr)},pr=vr=>{vr.currentTarget===vr.target&&(qe&&isDeleteKeyboardEvent(vr)?qe(vr):vr.key==="Escape"&&ir.current&&ir.current.blur()),Ye&&Ye(vr)},tr=De!==!1&&He?!0:De,nr=tr||qe?ButtonBase:Be||"div",hr=_extends$1({},je,{component:nr,disabled:ze,size:Ve,color:$e,iconColor:reactExports.isValidElement(We)&&We.props.color||$e,onDelete:!!qe,clickable:tr,variant:Ke}),sr=useUtilityClasses$U(hr),xr=nr===ButtonBase?_extends$1({component:Be||"div",focu
548sVisibleClassName:sr.focusVisible},qe&&{disableRipple:!0}):{};let Rr=null;qe&&(Rr=Ue&&reactExports.isValidElement(Ue)?reactExports.cloneElement(Ue,{className:clsx(Ue.props.className,sr.deleteIcon),onClick:ar}):jsxRuntimeExports.jsx(CancelIcon$1,{className:clsx(sr.deleteIcon),onClick:ar}));let br=null;Oe&&reactExports.isValidElement(Oe)&&(br=reactExports.cloneElement(Oe,{className:clsx(sr.avatar,Oe.props.className)}));let wr=null;return We&&reactExports.isValidElement(We)&&(wr=reactExports.cloneElement(We,{className:clsx(sr.icon,We.props.className)})),jsxRuntimeExports.jsxs(ChipRoot,_extends$1({as:nr,className:clsx(sr.root,Me),disabled:tr&&ze?!0:void 0,onClick:He,onKeyDown:or,onKeyUp:pr,ref:rr,tabIndex:Ze&&ze?-1:Qe,ownerState:hr},xr,Je,{children:[br||wr,jsxRuntimeExports.jsx(ChipLabel,{className:clsx(sr.label),ownerState:hr,children:Xe}),Rr]}))}),_excluded$_=["onChange","maxRows","minRows","style","value"];function getStyleValue(Ee){return parseInt(Ee,10)||0}const styles$4={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function isObjectEmpty(Ee){for(const Re in Ee)return!1;return!0}function isEmpty$1(Ee){return isObjectEmpty(Ee)||Ee.outerHeightStyle===0&&!Ee.overflowing}const TextareaAutosize=reactExports.forwardRef(function(Re,Te){const{onChange:je,maxRows:Oe,minRows:Me=1,style:De,value:$e}=Re,Be=_objectWithoutPropertiesLoose(Re,_excluded$_),{current:Ue}=reactExports.useRef($e!=null),ze=reactExports.useRef(null),We=useForkRef(Te,ze),Xe=reactExports.useRef(null),He=reactExports.useRef(null),qe=reactExports.useCallback(()=>{const Qe=ze.current,Ze=He.current;if(!Qe||!Ze)return;const ir=ownerWindow(Qe).getComputedStyle(Qe);if(ir.width==="0px")return{outerHeightStyle:0,overflowing:!1};Ze.style.width=ir.width,Ze.value=Qe.value||Re.placeholder||"x",Ze.value.slice(-1)===` 549`&&(Ze.value+=" ");const rr=ir.boxSizing,ar=getStyleValue(ir.paddingBottom)+getStyleValue(ir.paddingTop),or=getStyleValue(ir.borderBottomWidth)+getStyleValue(ir.borderTopWidth),pr=Ze.scrollHeight;Ze.value="x";const tr=Ze.scrollHeight;let nr=pr;Me&&(nr=Math.max(Number(Me)*tr,nr)),Oe&&(nr=Math.min(Number(Oe)*tr,nr)),nr=Math.max(nr,tr);const hr=nr+(rr==="border-box"?ar+or:0),sr=Math.abs(nr-pr)<=1;return{outerHeightStyle:hr,overflowing:sr}},[Oe,Me,Re.placeholder]),Ge=useEventCallback(()=>{const Qe=ze.current,Ze=qe();if(!Qe||!Ze||isEmpty$1(Ze))return!1;const Je=Ze.outerHeightStyle;return Xe.current!=null&&Xe.current!==Je}),Ye=reactExports.useCallback(()=>{const Qe=ze.current,Ze=qe();if(!Qe||!Ze||isEmpty$1(Ze))return;const Je=Ze.outerHeightStyle;Xe.current!==Je&&(Xe.current=Je,Qe.style.height=`${Je}px`),Qe.style.overflow=Ze.overflowing?"hidden":""},[qe]),Ve=reactExports.useRef(-1);useEnhancedEffect(()=>{const Qe=debounce$1(Ye),Ze=ze==null?void 0:ze.current;if(!Ze)return;const Je=ownerWindow(Ze);Je.addEventListener("resize",Qe);let ir;return typeof ResizeObserver<"u"&&(ir=new ResizeObserver(()=>{Ge()&&(ir.unobserve(Ze),cancelAnimationFrame(Ve.current),Ye(),Ve.current=requestAnimationFrame(()=>{ir.observe(Ze)}))}),ir.observe(Ze)),()=>{Qe.clear(),cancelAnimationFrame(Ve.current),Je.removeEventListener("resize",Qe),ir&&ir.disconnect()}},[qe,Ye,Ge]),useEnhancedEffect(()=>{Ye()});const Ke=Qe=>{Ue||Ye(),je&&je(Qe)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",_extends$1({value:$e,onChange:Ke,ref:We,rows:Me,style:De},Be)),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:Re.className,readOnly:!0,ref:He,tabIndex:-1,style:_extends$1({},styles$4.shadow,De,{paddingTop:0,paddingBottom:0})})]})});function formControlState({props:Ee,states:Re,muiFormControl:Te}){return Re.reduce((je,Oe)=>(je[Oe]=Ee[Oe],Te&&typeof Ee[Oe]>"u"&&(je[Oe]=Te[Oe]),je),{})}const FormControlContext=reactExports.createContext(void 0);function useFormControl(){return reactExports.useContext(FormControlContext)}function GlobalStyles(Ee){return jsxRuntimeExports.jsx(GlobalStyles$1,_extends$1({},Ee,{defaultTheme:defaultTheme$1,themeId:THEME_ID}))}function hasValue(Ee){return Ee!=null&&!(Array.isArray(Ee)&&Ee.length===0)}function isFilled(Ee,Re=!1){return Ee&&(hasValue(Ee.value)&&Ee.value!==""||Re&&hasValue(Ee.defaultValue)&&Ee.defaultValue!=="")}function isAdornedStart(Ee){return Ee.startAdornment}function getInputBaseUtilityClass(Ee){return generateUtilityClass("MuiInputBase",Ee)}const inputBaseClasses=generateUtilityClasses("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),_excluded$Z=["aria-describedby","autoComplete","autoF
549ocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],rootOverridesResolver=(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.formControl&&Re.formControl,Te.startAdornment&&Re.adornedStart,Te.endAdornment&&Re.adornedEnd,Te.error&&Re.error,Te.size==="small"&&Re.sizeSmall,Te.multiline&&Re.multiline,Te.color&&Re[`color${capitalize$1(Te.color)}`],Te.fullWidth&&Re.fullWidth,Te.hiddenLabel&&Re.hiddenLabel]},inputOverridesResolver=(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.input,Te.size==="small"&&Re.inputSizeSmall,Te.multiline&&Re.inputMultiline,Te.type==="search"&&Re.inputTypeSearch,Te.startAdornment&&Re.inputAdornedStart,Te.endAdornment&&Re.inputAdornedEnd,Te.hiddenLabel&&Re.inputHiddenLabel]},useUtilityClasses$T=Ee=>{const{classes:Re,color:Te,disabled:je,error:Oe,endAdornment:Me,focused:De,formControl:$e,fullWidth:Be,hiddenLabel:Ue,multiline:ze,readOnly:We,size:Xe,startAdornment:He,type:qe}=Ee,Ge={root:["root",`color${capitalize$1(Te)}`,je&&"disabled",Oe&&"error",Be&&"fullWidth",De&&"focused",$e&&"formControl",Xe&&Xe!=="medium"&&`size${capitalize$1(Xe)}`,ze&&"multiline",He&&"adornedStart",Me&&"adornedEnd",Ue&&"hiddenLabel",We&&"readOnly"],input:["input",je&&"disabled",qe==="search"&&"inputTypeSearch",ze&&"inputMultiline",Xe==="small"&&"inputSizeSmall",Ue&&"inputHiddenLabel",He&&"inputAdornedStart",Me&&"inputAdornedEnd",We&&"readOnly"]};return composeClasses(Ge,getInputBaseUtilityClass,Re)},InputBaseRoot=styled("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:Ee,ownerState:Re})=>_extends$1({},Ee.typography.body1,{color:(Ee.vars||Ee).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses.disabled}`]:{color:(Ee.vars||Ee).palette.text.disabled,cursor:"default"}},Re.multiline&&_extends$1({padding:"4px 0 5px"},Re.size==="small"&&{paddingTop:1}),Re.fullWidth&&{width:"100%"})),InputBaseComponent=styled("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:Ee,ownerState:Re})=>{const Te=Ee.palette.mode==="light",je=_extends$1({color:"currentColor"},Ee.vars?{opacity:Ee.vars.opacity.inputPlaceholder}:{opacity:Te?.42:.5},{transition:Ee.transitions.create("opacity",{duration:Ee.transitions.duration.shorter})}),Oe={opacity:"0 !important"},Me=Ee.vars?{opacity:Ee.vars.opacity.inputPlaceholder}:{opacity:Te?.42:.5};return _extends$1({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":je,"&::-moz-placeholder":je,"&:-ms-input-placeholder":je,"&::-ms-input-placeholder":je,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses.formControl} &`]:{"&::-webkit-input-placeholder":Oe,"&::-moz-placeholder":Oe,"&:-ms-input-placeholder":Oe,"&::-ms-input-placeholder":Oe,"&:focus::-webkit-input-placeholder":Me,"&:focus::-moz-placeholder":Me,"&:focus:-ms-input-placeholder":Me,"&:focus::-ms-input-placeholder":Me},[`&.${inputBaseClasses.disabled}`]:{opacity:1,WebkitTextFillColor:(Ee.vars||Ee).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},Re.size==="small"&&{paddingTop:1},Re.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},Re.type==="search"&&{MozAppearance:"textfield"})}),inputGlobalStyles=jsxRuntimeExports.jsx(GlobalStyles,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),InputBase=reactExports.forwardRef(function(Re,Te){var je;const Oe=useDefaultProps({props:Re,name:"MuiInputBase"}),{"aria-describedby":Me,autoComplete:De,autoFocus:$e,className:Be,components:Ue={},componentsProps:ze={},defaultValue:We,disabled:Xe,disableInjectingGlobalStyles:He,endAdornment:qe,fullWidth:Ge=!1,id:Ye,inputComponent:Ve="input",inputProps:Ke={},inputRef:Qe,maxRows:Ze,minRows:Je,multiline:ir=!1,name:rr,onBlur:ar,onChange:or,onClick:pr,onFocus:tr,onKeyDown:nr,onKeyUp:hr,placeholder:sr,readOnly:xr,render
549Suffix:Rr,rows:br,slotProps:wr={},slots:vr={},startAdornment:Dr,type:kr="text",value:cr}=Oe,dr=_objectWithoutPropertiesLoose(Oe,_excluded$Z),ur=Ke.value!=null?Ke.value:cr,{current:gr}=reactExports.useRef(ur!=null),_r=reactExports.useRef(),Ir=reactExports.useCallback(tn=>{},[]),Ar=useForkRef(_r,Qe,Ke.ref,Ir),[Tr,Nr]=reactExports.useState(!1),Br=useFormControl(),Hr=formControlState({props:Oe,muiFormControl:Br,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Hr.focused=Br?Br.focused:Tr,reactExports.useEffect(()=>{!Br&&Xe&&Tr&&(Nr(!1),ar&&ar())},[Br,Xe,Tr,ar]);const Vr=Br&&Br.onFilled,mr=Br&&Br.onEmpty,Sr=reactExports.useCallback(tn=>{isFilled(tn)?Vr&&Vr():mr&&mr()},[Vr,mr]);useEnhancedEffect(()=>{gr&&Sr({value:ur})},[ur,Sr,gr]);const Lr=tn=>{if(Hr.disabled){tn.stopPropagation();return}tr&&tr(tn),Ke.onFocus&&Ke.onFocus(tn),Br&&Br.onFocus?Br.onFocus(tn):Nr(!0)},jr=tn=>{ar&&ar(tn),Ke.onBlur&&Ke.onBlur(tn),Br&&Br.onBlur?Br.onBlur(tn):Nr(!1)},fr=(tn,...Qr)=>{if(!gr){const wn=tn.target||_r.current;if(wn==null)throw new Error(formatMuiErrorMessage$1(1));Sr({value:wn.value})}Ke.onChange&&Ke.onChange(tn,...Qr),or&&or(tn,...Qr)};reactExports.useEffect(()=>{Sr(_r.current)},[]);const Cr=tn=>{_r.current&&tn.currentTarget===tn.target&&_r.current.focus(),pr&&pr(tn)};let Mr=Ve,$r=Ke;ir&&Mr==="input"&&(br?$r=_extends$1({type:void 0,minRows:br,maxRows:br},$r):$r=_extends$1({type:void 0,maxRows:Ze,minRows:Je},$r),Mr=TextareaAutosize);const Fr=tn=>{Sr(tn.animationName==="mui-auto-fill-cancel"?_r.current:{value:"x"})};reactExports.useEffect(()=>{Br&&Br.setAdornedStart(!!Dr)},[Br,Dr]);const Kr=_extends$1({},Oe,{color:Hr.color||"primary",disabled:Hr.disabled,endAdornment:qe,error:Hr.error,focused:Hr.focused,formControl:Br,fullWidth:Ge,hiddenLabel:Hr.hiddenLabel,multiline:ir,size:Hr.size,startAdornment:Dr,type:kr}),an=useUtilityClasses$T(Kr),Wr=vr.root||Ue.Root||InputBaseRoot,hn=wr.root||ze.root||{},cn=vr.input||Ue.Input||InputBaseComponent;return $r=_extends$1({},$r,(je=wr.input)!=null?je:ze.input),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!He&&inputGlobalStyles,jsxRuntimeExports.jsxs(Wr,_extends$1({},hn,!isHostComponent(Wr)&&{ownerState:_extends$1({},Kr,hn.ownerState)},{ref:Te,onClick:Cr},dr,{className:clsx(an.root,hn.className,Be,xr&&"MuiInputBase-readOnly"),children:[Dr,jsxRuntimeExports.jsx(FormControlContext.Provider,{value:null,children:jsxRuntimeExports.jsx(cn,_extends$1({ownerState:Kr,"aria-invalid":Hr.error,"aria-describedby":Me,autoComplete:De,autoFocus:$e,defaultValue:We,disabled:Hr.disabled,id:Ye,onAnimationStart:Fr,name:rr,placeholder:sr,readOnly:xr,required:Hr.required,rows:br,value:ur,onKeyDown:nr,onKeyUp:hr,type:kr},$r,!isHostComponent(cn)&&{as:Mr,ownerState:_extends$1({},Kr,$r.ownerState)},{ref:Ar,className:clsx(an.input,$r.className,xr&&"MuiInputBase-readOnly"),onBlur:jr,onChange:fr,onFocus:Lr}))}),qe,Rr?Rr(_extends$1({},Hr,{startAdornment:Dr})):null]}))]})});function getInputUtilityClass(Ee){return generateUtilityClass("MuiInput",Ee)}const inputClasses=_extends$1({},inputBaseClasses,generateUtilityClasses("MuiInput",["root","underline","input"]));function getOutlinedInputUtilityClass(Ee){return generateUtilityClass("MuiOutlinedInput",Ee)}const outlinedInputClasses=_extends$1({},inputBaseClasses,generateUtilityClasses("MuiOutlinedInput",["root","notchedOutline","input"]));function getFilledInputUtilityClass(Ee){return generateUtilityClass("MuiFilledInput",Ee)}const filledInputClasses=_extends$1({},inputBaseClasses,generateUtilityClasses("MuiFilledInput",["root","underline","input"])),ArrowDropDownIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function getAutocompleteUtilityClass(Ee){return generateUtilityClass("MuiAutocomplete",Ee)}const autocompleteClasses=generateUtilityClasses("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","
549input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var _ClearIcon,_ArrowDropDownIcon;const _excluded$Y=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],_excluded2$7=["ref"],_excluded3$1=["key"],_excluded4=["key"],useUtilityClasses$S=Ee=>{const{classes:Re,disablePortal:Te,expanded:je,focused:Oe,fullWidth:Me,hasClearIcon:De,hasPopupIcon:$e,inputFocused:Be,popupOpen:Ue,size:ze}=Ee,We={root:["root",je&&"expanded",Oe&&"focused",Me&&"fullWidth",De&&"hasClearIcon",$e&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",Be&&"inputFocused"],tag:["tag",`tagSize${capitalize$1(ze)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",Ue&&"popupIndicatorOpen"],popper:["popper",Te&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return composeClasses(We,getAutocompleteUtilityClass,Re)},AutocompleteRoot=styled("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee,{fullWidth:je,hasClearIcon:Oe,hasPopupIcon:Me,inputFocused:De,size:$e}=Te;return[{[`& .${autocompleteClasses.tag}`]:Re.tag},{[`& .${autocompleteClasses.tag}`]:Re[`tagSize${capitalize$1($e)}`]},{[`& .${autocompleteClasses.inputRoot}`]:Re.inputRoot},{[`& .${autocompleteClasses.input}`]:Re.input},{[`& .${autocompleteClasses.input}`]:De&&Re.inputFocused},Re.root,je&&Re.fullWidth,Me&&Re.hasPopupIcon,Oe&&Re.hasClearIcon]}})({[`&.${autocompleteClasses.focused} .${autocompleteClasses.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${autocompleteClasses.clearIndicator}`]:{visibility:"visible"}},[`& .${autocompleteClasses.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${autocompleteClasses.inputRoot}`]:{[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:30},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:56},[`& .${autocompleteClasses.input}`]:{width:0,minWidth:30}},[`& .${inputClasses.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${inputClasses.root}.${inputBaseClasses.sizeSmall}`]:{[`& .${inputClasses.input}`]:{padding:"2px 4px 3px 0"}},[`& .${outlinedInputClasses.root}`]:{padding:9,[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:39},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:65},[`& .${autocompleteClasses.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${autocompleteClasses.endAdornment}`]:{right:9}},[`& .${outlinedInputClasses.root}.${inputBaseClasses.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${autocompleteClasses.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${filledInputClasses.root}`]:{paddingTop:19,paddingLeft:8,[`.${autocompleteClasses.hasPopupIcon}&, .${autocompleteClasses.hasClearIcon}&`]:{paddingRight:39},[`.${autocompleteClasses.hasPopupIcon}.${autocompleteClasses.hasClearIcon}&`]:{paddingRight:65},[`& .${filledInputClasses.input}`]:{padding:"7px 4px"},[`& .${autocompleteClasses.endAdornment}`]:{right:9}},[`& .${filledInputClasses.root}.${inputBaseClasses.sizeSmall}`]:{paddingBottom:1,[`& .${filledInputClasses.input}`]:{padding:"2.5px 4px"}},[`& .${inputBaseClasses.hiddenLabel}`]:{paddingTop:8},[`& .${filledInputClasses.root}.${inputBaseClasses.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${autocompleteClasses.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${filledInputClasses.root}.${inputBaseClasses.hiddenLabel}.${inputBaseClasses.sizeSmall}`]:{[`& .${autocompleteClasses.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${autocompleteClasses.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0}
vendor: 5,106 bytes, line 549
549,variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${autocompleteClasses.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${autocompleteClasses.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${autocompleteClasses.inputRoot}`]:{flexWrap:"wrap"}}}]}),AutocompleteEndAdornment=styled("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(Ee,Re)=>Re.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),AutocompleteClearIndicator=styled(IconButton,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(Ee,Re)=>Re.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),AutocompletePopupIndicator=styled(IconButton,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:Ee},Re)=>_extends$1({},Re.popupIndicator,Ee.popupOpen&&Re.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),AutocompletePopper=styled(Popper,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[{[`& .${autocompleteClasses.option}`]:Re.option},Re.popper,Te.disablePortal&&Re.popperDisablePortal]}})(({theme:Ee})=>({zIndex:(Ee.vars||Ee).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),AutocompletePaper=styled(Paper,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(Ee,Re)=>Re.paper})(({theme:Ee})=>_extends$1({},Ee.typography.body1,{overflow:"auto"})),AutocompleteLoading=styled("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(Ee,Re)=>Re.loading})(({theme:Ee})=>({color:(Ee.vars||Ee).palette.text.secondary,padding:"14px 16px"})),AutocompleteNoOptions=styled("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(Ee,Re)=>Re.noOptions})(({theme:Ee})=>({color:(Ee.vars||Ee).palette.text.secondary,padding:"14px 16px"})),AutocompleteListbox=styled("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(Ee,Re)=>Re.listbox})(({theme:Ee})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${autocompleteClasses.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[Ee.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${autocompleteClasses.focused}`]:{backgroundColor:(Ee.vars||Ee).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(Ee.vars||Ee).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${autocompleteClasses.focusVisible}`]:{backgroundColor:(Ee.vars||Ee).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / ${Ee.vars.palette.action.selectedOpacity})`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity),[`&.${autocompleteClasses.focused}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.hoverOpacity}))`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity+Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(Ee.vars||Ee).palette.action.selected}},[`&.${autocompleteClasses.focusVisible}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.focusOpacity}))`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity+Ee.palette.action.focusOpacity)}}}})),AutocompleteGroupLabel=styled(ListSubheader,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(Ee,Re)=>Re.groupLabel})(({theme:Ee})=>({backgroundColor:(Ee.vars||Ee).palette.background.paper,top:-8})),AutocompleteGroupUl=styled("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(Ee,Re)=>Re.groupUl})({padding:0,[`& .${autocompleteClasses.option}`]:{paddingLeft:24}}),Autocomplete=reactExports.forwardRef(function(Re,Te){var je,Oe,Me,De;const $e=useDefaultProps({props:Re,name:"MuiAutocomplete"}),{autoComplete:Be=!1,autoHighlight:Ue=!1,autoSelect:ze=!1,blurOnSelect:We=!1,ChipProps:Xe,className:He,clearIcon:qe=_ClearIcon||(_ClearIcon=jsxRuntimeExports.jsx(ClearIcon,{fontSize:"small"})),clearOnBlur:Ge=!$e.freeSolo,clearOnEscape:Ye=!1,clearText:Ve="Clear",closeText:Ke="Close",componentsProps:Qe={},defaultValue:Ze=$e.multiple?[]:null,disableClearable:Je=!1,disableCloseOnSelect:ir=!1,disabled:rr=!1,disabledItemsFocusable:ar=!1,disableListWrap:or=!1,disablePortal:pr=!1,filterSelectedOptions:tr=!1,forcePopupIcon:nr="auto",freeSolo:hr=!1,fullWidth:sr=!1,getLimitTagsText:xr=mn=>`+${mn}`,getOptionLabel:Rr,groupBy:br,handleHomeEndKeys:wr=!$e.freeSolo,includeInputInList:vr=!1,limitTags:Dr=-1,ListboxComponent:kr="ul",ListboxProps:cr,loading:dr=!1,loadingText:ur="Loadingâ¦",multiple:gr=!1,noOptionsText:_r="No options",openOnFocus:Ir=!1,openText:Ar="Open",Pa
549perComponent:Tr=Paper,PopperComponent:Nr=Popper,popupIcon:Br=_ArrowDropDownIcon||(_ArrowDropDownIcon=jsxRuntimeExports.jsx(ArrowDropDownIcon,{})),readOnly:Hr=!1,renderGroup:Vr,renderInput:mr,renderOption:Sr,renderTags:Lr,selectOnFocus:jr=!$e.freeSolo,size:fr="medium",slotProps:Cr={}}=$e,Mr=_objectWithoutPropertiesLoose($e,_excluded$Y),{getRootProps:$r,getInputProps:Fr,getInputLabelProps:Kr,getPopupIndicatorProps:an,getClearProps:Wr,getTagProps:hn,getListboxProps:cn,getOptionProps:tn,value:Qr,dirty:wn,expanded:gn,id:In,popupOpen:yn,focused:Mn,focusedTag:on,anchorEl:Yr,setAnchorEl:sn,inputValue:On,groupedOptions:Bn}=useAutocomplete(_extends$1({},$e,{componentName:"Autocomplete"})),Hn=!Je&&!rr&&wn&&!Hr,Zr=(!hr||nr===!0)&&nr!==!1,{onMouseDown:xn}=Fr(),{ref:An}=cr??{},Wn=cn(),{ref:ss}=Wn,Yn=_objectWithoutPropertiesLoose(Wn,_excluded2$7),en=useForkRef(ss,An),nn=Rr||(mn=>{var zn;return(zn=mn.label)!=null?zn:mn}),En=_extends$1({},$e,{disablePortal:pr,expanded:gn,focused:Mn,fullWidth:sr,getOptionLabel:nn,hasClearIcon:Hn,hasPopupIcon:Zr,inputFocused:on===-1,popupOpen:yn,size:fr}),Cn=useUtilityClasses$S(En);let jn;if(gr&&Qr.length>0){const mn=zn=>_extends$1({className:Cn.tag,disabled:rr},hn(zn));Lr?jn=Lr(Qr,mn,En):jn=Qr.map((zn,os)=>{const ls=mn({index:os}),{key:hs}=ls,Cs=_objectWithoutPropertiesLoose(ls,_excluded3$1);return jsxRuntimeExports.jsx(Chip,_extends$1({label:nn(zn),size:fr},Cs,Xe),hs)})}if(Dr>-1&&Array.isArray(jn)){const mn=jn.length-Dr;!Mn&&mn>0&&(jn=jn.splice(0,Dr),jn.push(jsxRuntimeExports.jsx("span",{className:Cn.tag,children:xr(mn)},jn.length)))}const Vn=Vr||(mn=>jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx(AutocompleteGroupLabel,{className:Cn.groupLabel,ownerState:En,component:"div",children:mn.group}),jsxRuntimeExports.jsx(AutocompleteGroupUl,{className:Cn.groupUl,ownerState:En,children:mn.children})]},mn.key)),Un=Sr||((mn,zn)=>{const{key:os}=mn,ls=_objectWithoutPropertiesLoose(mn,_excluded4);return jsxRuntimeExports.jsx("li",_extends$1({},ls,{children:nn(zn)}),os)}),fs=(mn,zn)=>{const os=tn({option:mn,index:zn});return Un(_extends$1({},os,{className:Cn.option}),mn,{selected:os["aria-selected"],index:zn,inputValue:On},En)},Jn=(je=Cr.clearIndicator)!=null?je:Qe.clearIndicator,ts=(Oe=Cr.paper)!=null?Oe:Qe.paper,cs=(Me=Cr.popper)!=null?Me:Qe.popper,Sn=(De=Cr.popupIndicator)!=null?De:Qe.popupIndicator;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(AutocompleteRoot,_extends$1({ref:Te,className:clsx(Cn.root,He),ownerState:En},$r(Mr),{children:mr({id:In,disabled:rr,fullWidth:!0,size:fr==="small"?"small":void 0,InputLabelProps:Kr(),InputProps:_extends$1({ref:sn,className:Cn.inputRoot,startAdornment:jn,onClick:mn=>{mn.target===mn.currentTarget&&xn(mn)}},(Hn||Zr)&&{endAdornment:jsxRuntimeExports.jsxs(AutocompleteEndAdornment,{className:Cn.endAdornment,ownerState:En,children:[Hn?jsxRuntimeExports.jsx(AutocompleteClearIndicator,_extends$1({},Wr(),{"aria-label":Ve,title:Ve,ownerState:En},Jn,{className:clsx(Cn.clearIndicator,Jn==null?void 0:Jn.className),children:qe})):null,Zr?jsxRuntimeExports.jsx(AutocompletePopupIndicator,_extends$1({},an(),{disabled:rr,"aria-label":yn?Ke:Ar,title:yn?Ke:Ar,ownerState:En},Sn,{className:clsx(Cn.popupIndicator,Sn==null?void 0:Sn.className),children:Br})):null]})}),inputProps:_extends$1({className:Cn.input,disabled:rr,readOnly:Hr},Fr())})})),Yr?jsxRuntimeExports.jsx(AutocompletePopper,_extends$1({as:Nr,disablePortal:pr,style:{width:Yr?Yr.clientWidth:null},ownerState:En,role:"presentation",anchorEl:Yr,open:yn},cs,{className:clsx(Cn.popper,cs==null?void 0:cs.className),children:jsxRuntimeExports.jsxs(AutocompletePaper,_extends$1({ownerState:En,as:Tr},ts,{className:clsx(Cn.paper,ts==null?void 0:ts.className),children:[dr&&Bn.length===0?jsxRuntimeExports.jsx(AutocompleteLoading,{className:Cn.loading,ownerState:En,children:ur}):null,Bn.length===0&&!hr&&!dr?jsxRuntimeExports.jsx(AutocompleteNoOptions,{className:Cn.noOptions,ownerState:En,role:"presentation",onMouseDown:mn=>{mn.preventDefault()},children:_r}):null,Bn.length>0?jsxRuntimeExports.jsx(AutocompleteListbox,_extends$1({as:kr,className:Cn.listbox,ownerState:En},Yn,cr,{ref:en,children:Bn.map((mn,zn)=>br?Vn({key:mn.key,group:mn.group,children:mn.options.map((os,ls)=>fs(os,mn.index+ls))}):fs(mn,zn))})):null]}))})):null]})}),Person$1=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function getAvatarUtilityClass(Ee){return generateUtilityClass("MuiAvatar",Ee)}generateUtilityClasses("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const _excluded$X=["alt","children","className","component","slots","slotProps","imgProps","
549sizes","src","srcSet","variant"],useUtilityClasses$R=Ee=>{const{classes:Re,variant:Te,colorDefault:je}=Ee;return composeClasses({root:["root",Te,je&&"colorDefault"],img:["img"],fallback:["fallback"]},getAvatarUtilityClass,Re)},AvatarRoot=styled("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[Te.variant],Te.colorDefault&&Re.colorDefault]}})(({theme:Ee})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:Ee.typography.fontFamily,fontSize:Ee.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(Ee.vars||Ee).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:_extends$1({color:(Ee.vars||Ee).palette.background.default},Ee.vars?{backgroundColor:Ee.vars.palette.Avatar.defaultBg}:_extends$1({backgroundColor:Ee.palette.grey[400]},Ee.applyStyles("dark",{backgroundColor:Ee.palette.grey[600]})))}]})),AvatarImg=styled("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(Ee,Re)=>Re.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),AvatarFallback=styled(Person$1,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(Ee,Re)=>Re.fallback})({width:"75%",height:"75%"});function useLoaded({crossOrigin:Ee,referrerPolicy:Re,src:Te,srcSet:je}){const[Oe,Me]=reactExports.useState(!1);return reactExports.useEffect(()=>{if(!Te&&!je)return;Me(!1);let De=!0;const $e=new Image;return $e.onload=()=>{De&&Me("loaded")},$e.onerror=()=>{De&&Me("error")},$e.crossOrigin=Ee,$e.referrerPolicy=Re,$e.src=Te,je&&($e.srcset=je),()=>{De=!1}},[Ee,Re,Te,je]),Oe}const Avatar=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiAvatar"}),{alt:Oe,children:Me,className:De,component:$e="div",slots:Be={},slotProps:Ue={},imgProps:ze,sizes:We,src:Xe,srcSet:He,variant:qe="circular"}=je,Ge=_objectWithoutPropertiesLoose(je,_excluded$X);let Ye=null;const Ve=useLoaded(_extends$1({},ze,{src:Xe,srcSet:He})),Ke=Xe||He,Qe=Ke&&Ve!=="error",Ze=_extends$1({},je,{colorDefault:!Qe,component:$e,variant:qe}),Je=useUtilityClasses$R(Ze),[ir,rr]=useSlot("img",{className:Je.img,elementType:AvatarImg,externalForwardedProps:{slots:Be,slotProps:{img:_extends$1({},ze,Ue.img)}},additionalProps:{alt:Oe,src:Xe,srcSet:He,sizes:We},ownerState:Ze});return Qe?Ye=jsxRuntimeExports.jsx(ir,_extends$1({},rr)):Me||Me===0?Ye=Me:Ke&&Oe?Ye=Oe[0]:Ye=jsxRuntimeExports.jsx(AvatarFallback,{ownerState:Ze,className:Je.fallback}),jsxRuntimeExports.jsx(AvatarRoot,_extends$1({as:$e,ownerState:Ze,className:clsx(Je.root,De),ref:Te},Ge,{children:Ye}))}),_excluded$W=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],styles$3={entering:{opacity:1},entered:{opacity:1}},Fade=reactExports.forwardRef(function(Re,Te){const je=useTheme$1(),Oe={enter:je.transitions.duration.enteringScreen,exit:je.transitions.duration.leavingScreen},{addEndListener:Me,appear:De=!0,children:$e,easing:Be,in:Ue,onEnter:ze,onEntered:We,onEntering:Xe,onExit:He,onExited:qe,onExiting:Ge,style:Ye,timeout:Ve=Oe,TransitionComponent:Ke=Transition}=Re,Qe=_objectWithoutPropertiesLoose(Re,_excluded$W),Ze=reactExports.useRef(null),Je=useForkRef(Ze,getReactElementRef($e),Te),ir=sr=>xr=>{if(sr){const Rr=Ze.current;xr===void 0?sr(Rr):sr(Rr,xr)}},rr=ir(Xe),ar=ir((sr,xr)=>{reflow(sr);const Rr=getTransitionProps({style:Ye,timeout:Ve,easing:Be},{mode:"enter"});sr.style.webkitTransition=je.transitions.create("opacity",Rr),sr.style.transition=je.transitions.create("opacity",Rr),ze&&ze(sr,xr)}),or=ir(We),pr=ir(Ge),tr=ir(sr=>{const xr=getTransitionProps({style:Ye,timeout:Ve,easing:Be},{mode:"exit"});sr.style.webkitTransition=je.transitions.create("opacity",xr),sr.style.transition=je.transitions.create("opacity",xr),He&&He(sr)}),nr=ir(qe),hr=sr=>{Me&&Me(Ze.current,sr)};return jsxRuntimeExports.jsx(Ke,_extends$1({appear:De,in:Ue,nodeRef:Ze,onEnter:ar,onEntered:or,onEntering:rr,onExit:tr,onExited:nr,onExiting:pr,addEndListener:hr,timeout:Ve},Qe,{children:(sr,xr)=>reactExports.cloneElement($e,_extends$1({style:_extends$1({opacity:0,visibility:sr==="exited"&&!Ue?"hidden":void 0},styles$3[sr],Ye,$e.props.style),ref:Je},xr))}))});function getBackdropUtilityClass(Ee){return generateUtilityClass("MuiBackdrop",Ee)}generateUtilityClasses("MuiBackdrop",["root","invisible"]);const _excluded$V=["children","className","component","components","componentsProps","invisible","open","slotProps","
549slots","TransitionComponent","transitionDuration"],useUtilityClasses$Q=Ee=>{const{classes:Re,invisible:Te}=Ee;return composeClasses({root:["root",Te&&"invisible"]},getBackdropUtilityClass,Re)},BackdropRoot=styled("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.invisible&&Re.invisible]}})(({ownerState:Ee})=>_extends$1({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},Ee.invisible&&{backgroundColor:"transparent"})),Backdrop=reactExports.forwardRef(function(Re,Te){var je,Oe,Me;const De=useDefaultProps({props:Re,name:"MuiBackdrop"}),{children:$e,className:Be,component:Ue="div",components:ze={},componentsProps:We={},invisible:Xe=!1,open:He,slotProps:qe={},slots:Ge={},TransitionComponent:Ye=Fade,transitionDuration:Ve}=De,Ke=_objectWithoutPropertiesLoose(De,_excluded$V),Qe=_extends$1({},De,{component:Ue,invisible:Xe}),Ze=useUtilityClasses$Q(Qe),Je=(je=qe.root)!=null?je:We.root;return jsxRuntimeExports.jsx(Ye,_extends$1({in:He,timeout:Ve},Ke,{children:jsxRuntimeExports.jsx(BackdropRoot,_extends$1({"aria-hidden":!0},Je,{as:(Oe=(Me=Ge.root)!=null?Me:ze.Root)!=null?Oe:Ue,className:clsx(Ze.root,Be,Je==null?void 0:Je.className),ownerState:_extends$1({},Qe,Je==null?void 0:Je.ownerState),classes:Ze,ref:Te,children:$e}))}))}),boxClasses=generateUtilityClasses("MuiBox",["root"]),defaultTheme=createTheme(),Box=createBox({themeId:THEME_ID,defaultTheme,defaultClassName:boxClasses.root,generateClassName:ClassNameGenerator.generate});function getButtonUtilityClass(Ee){return generateUtilityClass("MuiButton",Ee)}const buttonClasses=generateUtilityClasses("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),ButtonGroupContext=reactExports.createContext({}),ButtonGroupButtonContext=reactExports.createContext(void 0),_excluded$U=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],useUtilityClasses$P=Ee=>{const{color:Re,disableElevation:Te,fullWidth:je,size:Oe,variant:Me,classes:De}=Ee,$e={root:["root",Me,`${Me}${capitalize$1(Re)}`,`size${capitalize$1(Oe)}`,`${Me}Size${capitalize$1(Oe)}`,`color${capitalize$1(Re)}`,Te&&"disableElevation",je&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${capitalize$1(Oe)}`],endIcon:["icon","endIcon",`iconSize${capitalize$1(Oe)}`]},Be=composeClasses($e,getButtonUtilityClass,De);return _extends$1({},De,Be)},commonIconStyles=Ee=>_extends$1({},Ee.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},Ee.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},Ee.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),ButtonRoot=styled(ButtonBase,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiButton",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[Te.variant],Re[`${Te.variant}${capitalize$1(Te.color)}`],Re[`size${capitalize$1(Te.size)}`],Re[`${Te.variant}Size${capitalize$1(Te.size)}`],Te.color==="inherit"&&Re.colorInherit,Te.disableElevation&&Re.disableElevation,Te.fullWidth&&Re.fullWidth]}})(({theme:Ee,ownerState:Re})=>{var Te,je;const Oe=Ee.palette.mode==="light"?Ee.palette.grey[300]:Ee.palette.grey[800],Me=Ee.palette.mode==="light"?Ee.palette.grey.A100:Ee.palette.grey[700];return _extends$1({},Ee.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(Ee.vars||Ee).shape.borderRadius,transition:Ee.transitions.create(["background-color","box-shadow","border-color","color"],{duration:Ee.transitions.duration.short}),"&:hover":_extends$1({textDecoration:"none",backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.text.primaryChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Ee.palette.text.primary,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},Re.variant==="text"&&Re.color!=="inherit"&&{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette[Re.color].mainCh
549annel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Ee.palette[Re.color].main,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},Re.variant==="outlined"&&Re.color!=="inherit"&&{border:`1px solid ${(Ee.vars||Ee).palette[Re.color].main}`,backgroundColor:Ee.vars?`rgba(${Ee.vars.palette[Re.color].mainChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Ee.palette[Re.color].main,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},Re.variant==="contained"&&{backgroundColor:Ee.vars?Ee.vars.palette.Button.inheritContainedHoverBg:Me,boxShadow:(Ee.vars||Ee).shadows[4],"@media (hover: none)":{boxShadow:(Ee.vars||Ee).shadows[2],backgroundColor:(Ee.vars||Ee).palette.grey[300]}},Re.variant==="contained"&&Re.color!=="inherit"&&{backgroundColor:(Ee.vars||Ee).palette[Re.color].dark,"@media (hover: none)":{backgroundColor:(Ee.vars||Ee).palette[Re.color].main}}),"&:active":_extends$1({},Re.variant==="contained"&&{boxShadow:(Ee.vars||Ee).shadows[8]}),[`&.${buttonClasses.focusVisible}`]:_extends$1({},Re.variant==="contained"&&{boxShadow:(Ee.vars||Ee).shadows[6]}),[`&.${buttonClasses.disabled}`]:_extends$1({color:(Ee.vars||Ee).palette.action.disabled},Re.variant==="outlined"&&{border:`1px solid ${(Ee.vars||Ee).palette.action.disabledBackground}`},Re.variant==="contained"&&{color:(Ee.vars||Ee).palette.action.disabled,boxShadow:(Ee.vars||Ee).shadows[0],backgroundColor:(Ee.vars||Ee).palette.action.disabledBackground})},Re.variant==="text"&&{padding:"6px 8px"},Re.variant==="text"&&Re.color!=="inherit"&&{color:(Ee.vars||Ee).palette[Re.color].main},Re.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},Re.variant==="outlined"&&Re.color!=="inherit"&&{color:(Ee.vars||Ee).palette[Re.color].main,border:Ee.vars?`1px solid rgba(${Ee.vars.palette[Re.color].mainChannel} / 0.5)`:`1px solid ${alpha_1(Ee.palette[Re.color].main,.5)}`},Re.variant==="contained"&&{color:Ee.vars?Ee.vars.palette.text.primary:(Te=(je=Ee.palette).getContrastText)==null?void 0:Te.call(je,Ee.palette.grey[300]),backgroundColor:Ee.vars?Ee.vars.palette.Button.inheritContainedBg:Oe,boxShadow:(Ee.vars||Ee).shadows[2]},Re.variant==="contained"&&Re.color!=="inherit"&&{color:(Ee.vars||Ee).palette[Re.color].contrastText,backgroundColor:(Ee.vars||Ee).palette[Re.color].main},Re.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},Re.size==="small"&&Re.variant==="text"&&{padding:"4px 5px",fontSize:Ee.typography.pxToRem(13)},Re.size==="large"&&Re.variant==="text"&&{padding:"8px 11px",fontSize:Ee.typography.pxToRem(15)},Re.size==="small"&&Re.variant==="outlined"&&{padding:"3px 9px",fontSize:Ee.typography.pxToRem(13)},Re.size==="large"&&Re.variant==="outlined"&&{padding:"7px 21px",fontSize:Ee.typography.pxToRem(15)},Re.size==="small"&&Re.variant==="contained"&&{padding:"4px 10px",fontSize:Ee.typography.pxToRem(13)},Re.size==="large"&&Re.variant==="contained"&&{padding:"8px 22px",fontSize:Ee.typography.pxToRem(15)},Re.fullWidth&&{width:"100%"})},({ownerState:Ee})=>Ee.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${buttonClasses.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${buttonClasses.disabled}`]:{boxShadow:"none"}}),ButtonStartIcon=styled("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.startIcon,Re[`iconSize${capitalize$1(Te.size)}`]]}})(({ownerState:Ee})=>_extends$1({display:"inherit",marginRight:8,marginLeft:-4},Ee.size==="small"&&{marginLeft:-2},commonIconStyles(Ee))),ButtonEndIcon=styled("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.endIcon,Re[`iconSize${capitalize$1(Te.size)}`]]}})(({ownerState:Ee})=>_extends$1({display:"inherit",marginRight:-4,marginLeft:8},Ee.size==="small"&&{marginRight:-2},commonIconStyles(Ee))),Button=reactExports.forwardRef(function(Re,Te){const je=reactExports.useContext(ButtonGroupContext),Oe=reactExports.useContext(ButtonGroupButtonContext),Me=resolveProps(je,Re),De=useDefaultProps({props:Me,name:"MuiButton"}),{children:$e,color:Be="primary",component:Ue="button",className:ze,disabled:We=!1,disableElevation:Xe=!1,disableFocusRipple:He=!1,endIcon:qe,focusVisibleClassName:Ge,fullWidth:Ye=!1,size:Ve="medium",startIcon:Ke,type:Qe,variant:Ze="text"}=De,Je=_objectWithoutPropertiesLoose(De,_excluded$U),ir=_extends$1({},De,{color:Be,component:Ue,disabled:We,disableElevation:Xe,disableFocusRipple:He,fullWidth:Ye,size:Ve,type:Qe,variant:Ze}),rr=useUtilityClasses$P(ir),ar=Ke&&jsxRuntimeExports.jsx(ButtonStartIcon,{className:rr.startIcon,ownerState:ir,children:Ke}),or=qe&&jsxRuntimeExports.jsx(ButtonEndIcon,{className:rr.endIcon,ownerState:ir,children:qe}),pr=Oe||"";return jsxRuntimeExports.jsxs(ButtonRoot,_extends$1({ownerState:ir,className:clsx(je.className,rr.root,ze,pr),component:Ue,disabled:We,focusRipple:!He,focusVisibleClassName:clsx(rr.focusVisible,Ge),ref:Te,type:Qe},Je,{classes:rr,children:[ar,$e,or]}))});function getCardUtilityClass(Ee){return generateUtilityClass("MuiCard",Ee)}generateUtilityClasses("MuiCard",["root"]);const _excluded$T=["className","raised"],useUtilityClasses$O=Ee=>{const{classes:Re}=Ee;return composeClasses({root:["root"]},getCardUtilityClass,Re)},CardRoot=styled(Paper,{name:"MuiCard",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})(()=>({overflow:"hidden"})),Card=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiCard"}),{className:Oe,raised:Me=!1}
549=je,De=_objectWithoutPropertiesLoose(je,_excluded$T),$e=_extends$1({},je,{raised:Me}),Be=useUtilityClasses$O($e);return jsxRuntimeExports.jsx(CardRoot,_extends$1({className:clsx(Be.root,Oe),elevation:Me?8:void 0,ref:Te,ownerState:$e},De))});function getCardContentUtilityClass(Ee){return generateUtilityClass("MuiCardContent",Ee)}generateUtilityClasses("MuiCardContent",["root"]);const _excluded$S=["className","component"],useUtilityClasses$N=Ee=>{const{classes:Re}=Ee;return composeClasses({root:["root"]},getCardContentUtilityClass,Re)},CardContentRoot=styled("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),CardContent=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiCardContent"}),{className:Oe,component:Me="div"}=je,De=_objectWithoutPropertiesLoose(je,_excluded$S),$e=_extends$1({},je,{component:Me}),Be=useUtilityClasses$N($e);return jsxRuntimeExports.jsx(CardContentRoot,_extends$1({as:Me,className:clsx(Be.root,Oe),ownerState:$e,ref:Te},De))});function getSwitchBaseUtilityClass(Ee){return generateUtilityClass("PrivateSwitchBase",Ee)}generateUtilityClasses("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const _excluded$R=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],useUtilityClasses$M=Ee=>{const{classes:Re,checked:Te,disabled:je,edge:Oe}=Ee,Me={root:["root",Te&&"checked",je&&"disabled",Oe&&`edge${capitalize$1(Oe)}`],input:["input"]};return composeClasses(Me,getSwitchBaseUtilityClass,Re)},SwitchBaseRoot=styled(ButtonBase,{name:"MuiSwitchBase"})(({ownerState:Ee})=>_extends$1({padding:9,borderRadius:"50%"},Ee.edge==="start"&&{marginLeft:Ee.size==="small"?-3:-12},Ee.edge==="end"&&{marginRight:Ee.size==="small"?-3:-12})),SwitchBaseInput=styled("input",{name:"MuiSwitchBase",shouldForwardProp:rootShouldForwardProp})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),SwitchBase=reactExports.forwardRef(function(Re,Te){const{autoFocus:je,checked:Oe,checkedIcon:Me,className:De,defaultChecked:$e,disabled:Be,disableFocusRipple:Ue=!1,edge:ze=!1,icon:We,id:Xe,inputProps:He,inputRef:qe,name:Ge,onBlur:Ye,onChange:Ve,onFocus:Ke,readOnly:Qe,required:Ze=!1,tabIndex:Je,type:ir,value:rr}=Re,ar=_objectWithoutPropertiesLoose(Re,_excluded$R),[or,pr]=useControlled({controlled:Oe,default:!!$e,name:"SwitchBase",state:"checked"}),tr=useFormControl(),nr=vr=>{Ke&&Ke(vr),tr&&tr.onFocus&&tr.onFocus(vr)},hr=vr=>{Ye&&Ye(vr),tr&&tr.onBlur&&tr.onBlur(vr)},sr=vr=>{if(vr.nativeEvent.defaultPrevented)return;const Dr=vr.target.checked;pr(Dr),Ve&&Ve(vr,Dr)};let xr=Be;tr&&typeof xr>"u"&&(xr=tr.disabled);const Rr=ir==="checkbox"||ir==="radio",br=_extends$1({},Re,{checked:or,disabled:xr,disableFocusRipple:Ue,edge:ze}),wr=useUtilityClasses$M(br);return jsxRuntimeExports.jsxs(SwitchBaseRoot,_extends$1({component:"span",className:clsx(wr.root,De),centerRipple:!0,focusRipple:!Ue,disabled:xr,tabIndex:null,role:void 0,onFocus:nr,onBlur:hr,ownerState:br,ref:Te},ar,{children:[jsxRuntimeExports.jsx(SwitchBaseInput,_extends$1({autoFocus:je,checked:Oe,defaultChecked:$e,className:wr.input,disabled:xr,id:Rr?Xe:void 0,name:Ge,onChange:sr,readOnly:Qe,ref:qe,required:Ze,ownerState:br,tabIndex:Je,type:ir},ir==="checkbox"&&rr===void 0?{}:{value:rr},He)),or?Me:We]}))}),CheckBoxOutlineBlankIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),CheckBoxIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),IndeterminateCheckBoxIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function getCheckboxUtilityClass(Ee){return generateUtilityClass("MuiCheckbox",Ee)}const checkboxClasses=generateUtilityClasses("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),_excluded$Q=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","
549size","className"],useUtilityClasses$L=Ee=>{const{classes:Re,indeterminate:Te,color:je,size:Oe}=Ee,Me={root:["root",Te&&"indeterminate",`color${capitalize$1(je)}`,`size${capitalize$1(Oe)}`]},De=composeClasses(Me,getCheckboxUtilityClass,Re);return _extends$1({},Re,De)},CheckboxRoot=styled(SwitchBase,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.indeterminate&&Re.indeterminate,Re[`size${capitalize$1(Te.size)}`],Te.color!=="default"&&Re[`color${capitalize$1(Te.color)}`]]}})(({theme:Ee,ownerState:Re})=>_extends$1({color:(Ee.vars||Ee).palette.text.secondary},!Re.disableRipple&&{"&:hover":{backgroundColor:Ee.vars?`rgba(${Re.color==="default"?Ee.vars.palette.action.activeChannel:Ee.vars.palette[Re.color].mainChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Re.color==="default"?Ee.palette.action.active:Ee.palette[Re.color].main,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},Re.color!=="default"&&{[`&.${checkboxClasses.checked}, &.${checkboxClasses.indeterminate}`]:{color:(Ee.vars||Ee).palette[Re.color].main},[`&.${checkboxClasses.disabled}`]:{color:(Ee.vars||Ee).palette.action.disabled}})),defaultCheckedIcon$1=jsxRuntimeExports.jsx(CheckBoxIcon,{}),defaultIcon$1=jsxRuntimeExports.jsx(CheckBoxOutlineBlankIcon,{}),defaultIndeterminateIcon=jsxRuntimeExports.jsx(IndeterminateCheckBoxIcon,{}),Checkbox=reactExports.forwardRef(function(Re,Te){var je,Oe;const Me=useDefaultProps({props:Re,name:"MuiCheckbox"}),{checkedIcon:De=defaultCheckedIcon$1,color:$e="primary",icon:Be=defaultIcon$1,indeterminate:Ue=!1,indeterminateIcon:ze=defaultIndeterminateIcon,inputProps:We,size:Xe="medium",className:He}=Me,qe=_objectWithoutPropertiesLoose(Me,_excluded$Q),Ge=Ue?ze:Be,Ye=Ue?ze:De,Ve=_extends$1({},Me,{color:$e,indeterminate:Ue,size:Xe}),Ke=useUtilityClasses$L(Ve);return jsxRuntimeExports.jsx(CheckboxRoot,_extends$1({type:"checkbox",inputProps:_extends$1({"data-indeterminate":Ue},We),icon:reactExports.cloneElement(Ge,{fontSize:(je=Ge.props.fontSize)!=null?je:Xe}),checkedIcon:reactExports.cloneElement(Ye,{fontSize:(Oe=Ye.props.fontSize)!=null?Oe:Xe}),ownerState:Ve,ref:Te,className:clsx(Ke.root,He)},qe,{classes:Ke}))});function getCircularProgressUtilityClass(Ee){return generateUtilityClass("MuiCircularProgress",Ee)}generateUtilityClasses("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const _excluded$P=["className","color","disableShrink","size","style","thickness","value","variant"];let _$2=Ee=>Ee,_t$1,_t2$1,_t3$1,_t4$1;const SIZE=44,circularRotateKeyframe=keyframes(_t$1||(_t$1=_$2` 550 0% { 551 transform: rotate(0deg); 552 } 553 554 100% { 555 transform: rotate(360deg); 556 } 557`)),circularDashKeyframe=keyframes(_t2$1||(_t2$1=_$2` 558 0% { 559 stroke-dasharray: 1px, 200px; 560 stroke-dashoffset: 0; 561 } 562 563 50% { 564 stroke-dasharray: 100px, 200px; 565 stroke-dashoffset: -15px; 566 } 567 568 100% { 569 stroke-dasharray: 100px, 200px; 570 stroke-dashoffset: -125px; 571 } 572`)),useUtilityClasses$K=Ee=>{const{classes:Re,variant:Te,color:je,disableShrink:Oe}=Ee,Me={root:["root",Te,`color${capitalize$1(je)}`],svg:["svg"],circle:["circle",`circle${capitalize$1(Te)}`,Oe&&"circleDisableShrink"]};return composeClasses(Me,getCircularProgressUtilityClass,Re)},CircularProgressRoot=styled("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[Te.variant],Re[`color${capitalize$1(Te.color)}`]]}})(({ownerState:Ee,theme:Re})=>_extends$1({display:"inline-block"},Ee.variant==="determinate"&&{transition:Re.transitions.create("transform")},Ee.color!=="inherit"&&{color:(Re.vars||Re).palette[Ee.color].main}),({ownerState:Ee})=>Ee.variant==="indeterminate"&&css(_t3$1||(_t3$1=_$2` 573 animation: ${0} 1.4s linear infinite; 574 `),circularRotateKeyframe)),CircularProgressSVG=styled("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(Ee,Re)=>Re.svg})({display:"block"}),CircularProgressCircle=styled("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.circle,Re[`circle${capitalize$1(Te.variant)}`],Te.disableShrink&&Re.circleDisableShrink]}})(({ownerState:Ee,theme:Re})=>_extends$1({stroke:"currentColor"},Ee.variant==="determinate"&&{transition:Re.transitions.create("stroke-dashoffset")},Ee.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:Ee})=>Ee.variant==="indeterminate"&&!Ee.disableShrink&&css(_t4$1||(_t4$1=_$2` 575 animation: ${0} 1.4s ease-in-out infinite; 576 `),circularDashKeyframe)),CircularProgress=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiCircularProgress"}),{className:Oe,color:Me="primary",disableShrink:De=!1,size:$e=40,style:Be,thickness:Ue=3.6,value:ze=0,variant:We="indeterminate"}=je,Xe=_objectWithoutPropertiesLoose(je,_excluded$P),He=_extends$1({},je,{color:Me,disableShrink:De,size:$e,thickness:Ue,value:ze,variant:We}),qe=useUtilityClasses$K(He),Ge={},Ye={},Ve={};if(We==="determinate"){const Ke=2*Math.PI*((SIZE-Ue)/2);Ge.strokeDasharray=Ke.toFixed(3),Ve["aria-valuenow"]=Math.round(ze),Ge.strokeDashoffset=`${((100-ze)/100*Ke).toFixed(3)}px`,Ye.transform="rotate(-90deg)"}return jsxRuntimeExports.jsx(CircularProgressRoot,_extends$1({className:clsx(qe.root,Oe),style:_extends$1({width:$e,height:$e},Ye,Be),ownerState:He,ref:Te,role:"progressbar"},Ve,Xe,{children:jsxRuntimeExports.jsx(CircularProgressSVG,{className:qe.svg,ownerState:He,viewBox:`${SIZE/2} ${SIZE/2} ${SIZE} ${SIZE}`,children:jsxRuntimeExports.jsx(CircularProgressCircle,{className:qe.circle,style:Ge,ownerState:He,cx:SIZE,cy:SIZE,r:(SIZE-Ue)/2,fill:"none",strokeWidth:Ue})})}))});function mapEventPropToEvent(Ee){return Ee.substring(2).toLowerCase()}function clickedRootScrollbar(Ee,Re){return Re.documentElement.clientWidth<Ee.clientX||Re.documentElement.clientHeight<Ee.clientY}function ClickAwayListener(Ee){const{children:Re,disableReactTree:Te=!1,mouseEvent:je="onClick",onClickAway:Oe,touchEvent:Me="onTouchEnd"}=Ee,De=reactExports.useRef(!1),$e=reactExports.useRef(null),Be=reactExports.useRef(!1),Ue=reactExports.useRef(!1);reactExports.useEffect(()=>(setTimeout(()=>{Be.current=!0},0),()=>{Be.current=!1}),[]);const ze=useForkRef(getReactElementRef(Re),$e),We=useEventCallback(qe=>{const Ge=Ue.current;Ue.current=!1;const Ye=ownerDocument($e.current);if(!Be.current||!$e.current||"clientX"in qe&&clickedRootScrollbar(qe,Ye))return;if(De.current){De.current=!1;return}let Ve;qe.composedPath?Ve=qe.composedPath().indexOf($e.current)>-1:Ve=!Ye.documentElement.contains(qe.target)||$e.current.contains(qe.target),!Ve&&(Te||!Ge)&&Oe(qe)}),Xe=qe=>Ge=>{Ue.current=!0;const Ye=Re.props[qe];Ye&&Ye(Ge)},He={ref:ze};return Me!==!1&&(He[Me]=Xe(Me)),reactExports.useEffect(()=>{if(Me!==!1){const qe=mapEventPropToEvent(Me),Ge=ownerDocument($e.current),Ye=()=>{De.current=!0};return Ge.addEventListener(qe,We),Ge.addEventListener("touchmove",Ye),()=>{Ge.removeEventListener(qe,We),Ge.removeEventListener("touchmove",Ye)}}},[We,Me]),je!==!1&&(He[je]=Xe(je)),reactExports.useEffect(()=>{if(je!==!1){const qe=mapEventPropToEvent(je),Ge=ownerDocument($e.current);return Ge.addEventListener(qe,We),()=>{Ge.removeEventListener(qe,We)}}},[We,je]),jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(Re,He)})}const Container=createContainer({createStyledComponent:styled("div",{name:"MuiContainer",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[`maxWidth${capitalize$1(String(Te.maxWidth))}
576`],Te.fixed&&Re.fixed,Te.disableGutters&&Re.disableGutters]}}),useThemeProps:Ee=>useDefaultProps({props:Ee,name:"MuiContainer"})}),html=(Ee,Re)=>_extends$1({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},Re&&!Ee.vars&&{colorScheme:Ee.palette.mode}),body=Ee=>_extends$1({color:(Ee.vars||Ee).palette.text.primary},Ee.typography.body1,{backgroundColor:(Ee.vars||Ee).palette.background.default,"@media print":{backgroundColor:(Ee.vars||Ee).palette.common.white}}),styles$2=(Ee,Re=!1)=>{var Te;const je={};Re&&Ee.colorSchemes&&Object.entries(Ee.colorSchemes).forEach(([De,$e])=>{var Be;je[Ee.getColorSchemeSelector(De).replace(/\s*&/,"")]={colorScheme:(Be=$e.palette)==null?void 0:Be.mode}});let Oe=_extends$1({html:html(Ee,Re),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:Ee.typography.fontWeightBold},body:_extends$1({margin:0},body(Ee),{"&::backdrop":{backgroundColor:(Ee.vars||Ee).palette.background.default}})},je);const Me=(Te=Ee.components)==null||(Te=Te.MuiCssBaseline)==null?void 0:Te.styleOverrides;return Me&&(Oe=[Oe,Me]),Oe};function CssBaseline(Ee){const Re=useDefaultProps({props:Ee,name:"MuiCssBaseline"}),{children:Te,enableColorScheme:je=!1}=Re;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(GlobalStyles,{styles:Oe=>styles$2(Oe,je)}),Te]})}function isOverflowing(Ee){const Re=ownerDocument(Ee);return Re.body===Ee?ownerWindow(Ee).innerWidth>Re.documentElement.clientWidth:Ee.scrollHeight>Ee.clientHeight}function ariaHidden(Ee,Re){Re?Ee.setAttribute("aria-hidden","true"):Ee.removeAttribute("aria-hidden")}function getPaddingRight(Ee){return parseInt(ownerWindow(Ee).getComputedStyle(Ee).paddingRight,10)||0}function isAriaHiddenForbiddenOnElement(Ee){const Te=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(Ee.tagName)!==-1,je=Ee.tagName==="INPUT"&&Ee.getAttribute("type")==="hidden";return Te||je}function ariaHiddenSiblings(Ee,Re,Te,je,Oe){const Me=[Re,Te,...je];[].forEach.call(Ee.children,De=>{const $e=Me.indexOf(De)===-1,Be=!isAriaHiddenForbiddenOnElement(De);$e&&Be&&ariaHidden(De,Oe)})}function findIndexOf(Ee,Re){let Te=-1;return Ee.some((je,Oe)=>Re(je)?(Te=Oe,!0):!1),Te}function handleContainer(Ee,Re){const Te=[],je=Ee.container;if(!Re.disableScrollLock){if(isOverflowing(je)){const De=getScrollbarSize(ownerDocument(je));Te.push({value:je.style.paddingRight,property:"padding-right",el:je}),je.style.paddingRight=`${getPaddingRight(je)+De}px`;const $e=ownerDocument(je).querySelectorAll(".mui-fixed");[].forEach.call($e,Be=>{Te.push({value:Be.style.paddingRight,property:"padding-right",el:Be}),Be.style.paddingRight=`${getPaddingRight(Be)+De}px`})}let Me;if(je.parentNode instanceof DocumentFragment)Me=ownerDocument(je).body;else{const De=je.parentElement,$e=ownerWindow(je);Me=(De==null?void 0:De.nodeName)==="HTML"&&$e.getComputedStyle(De).overflowY==="scroll"?De:je}Te.push({value:Me.style.overflow,property:"overflow",el:Me},{value:Me.style.overflowX,property:"overflow-x",el:Me},{value:Me.style.overflowY,property:"overflow-y",el:Me}),Me.style.overflow="hidden"}return()=>{Te.forEach(({value:Me,el:De,property:$e})=>{Me?De.style.setProperty($e,Me):De.style.removeProperty($e)})}}function getHiddenSiblings(Ee){const Re=[];return[].forEach.call(Ee.children,Te=>{Te.getAttribute("aria-hidden")==="true"&&Re.push(Te)}),Re}class ModalManager{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(Re,Te){let je=this.modals.indexOf(Re);if(je!==-1)return je;je=this.modals.length,this.modals.push(Re),Re.modalRef&&ariaHidden(Re.modalRef,!1);const Oe=getHiddenSiblings(Te);ariaHiddenSiblings(Te,Re.mount,Re.modalRef,Oe,!0);const Me=findIndexOf(this.containers,De=>De.container===Te);return Me!==-1?(this.containers[Me].modals.push(Re),je):(this.containers.push({modals:[Re],container:Te,restore:null,hiddenSiblings:Oe}),je)}mount(Re,Te){const je=findIndexOf(this.containers,Me=>Me.modals.indexOf(Re)!==-1),Oe=this.containers[je];Oe.restore||(Oe.restore=handleContainer(Oe,Te))}remove(Re,Te=!0){const je=this.modals.indexOf(Re);if(je===-1)return je;const Oe=findIndexOf(this.containers,De=>De.modals.indexOf(Re)!==-1),Me=this.containers[Oe];
576if(Me.modals.splice(Me.modals.indexOf(Re),1),this.modals.splice(je,1),Me.modals.length===0)Me.restore&&Me.restore(),Re.modalRef&&ariaHidden(Re.modalRef,Te),ariaHiddenSiblings(Me.container,Re.mount,Re.modalRef,Me.hiddenSiblings,!1),this.containers.splice(Oe,1);else{const De=Me.modals[Me.modals.length-1];De.modalRef&&ariaHidden(De.modalRef,!1)}return je}isTopModal(Re){return this.modals.length>0&&this.modals[this.modals.length-1]===Re}}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(Ee){const Re=parseInt(Ee.getAttribute("tabindex")||"",10);return Number.isNaN(Re)?Ee.contentEditable==="true"||(Ee.nodeName==="AUDIO"||Ee.nodeName==="VIDEO"||Ee.nodeName==="DETAILS")&&Ee.getAttribute("tabindex")===null?0:Ee.tabIndex:Re}function isNonTabbableRadio(Ee){if(Ee.tagName!=="INPUT"||Ee.type!=="radio"||!Ee.name)return!1;const Re=je=>Ee.ownerDocument.querySelector(`input[type="radio"]${je}`);let Te=Re(`[name="${Ee.name}"]:checked`);return Te||(Te=Re(`[name="${Ee.name}"]`)),Te!==Ee}function isNodeMatchingSelectorFocusable(Ee){return!(Ee.disabled||Ee.tagName==="INPUT"&&Ee.type==="hidden"||isNonTabbableRadio(Ee))}function defaultGetTabbable(Ee){const Re=[],Te=[];return Array.from(Ee.querySelectorAll(candidatesSelector)).forEach((je,Oe)=>{const Me=getTabIndex(je);Me===-1||!isNodeMatchingSelectorFocusable(je)||(Me===0?Re.push(je):Te.push({documentOrder:Oe,tabIndex:Me,node:je}))}),Te.sort((je,Oe)=>je.tabIndex===Oe.tabIndex?je.documentOrder-Oe.documentOrder:je.tabIndex-Oe.tabIndex).map(je=>je.node).concat(Re)}function defaultIsEnabled(){return!0}function FocusTrap(Ee){const{children:Re,disableAutoFocus:Te=!1,disableEnforceFocus:je=!1,disableRestoreFocus:Oe=!1,getTabbable:Me=defaultGetTabbable,isEnabled:De=defaultIsEnabled,open:$e}=Ee,Be=reactExports.useRef(!1),Ue=reactExports.useRef(null),ze=reactExports.useRef(null),We=reactExports.useRef(null),Xe=reactExports.useRef(null),He=reactExports.useRef(!1),qe=reactExports.useRef(null),Ge=useForkRef(getReactElementRef(Re),qe),Ye=reactExports.useRef(null);reactExports.useEffect(()=>{!$e||!qe.current||(He.current=!Te)},[Te,$e]),reactExports.useEffect(()=>{if(!$e||!qe.current)return;const Qe=ownerDocument(qe.current);return qe.current.contains(Qe.activeElement)||(qe.current.hasAttribute("tabIndex")||qe.current.setAttribute("tabIndex","-1"),He.current&&qe.current.focus()),()=>{Oe||(We.current&&We.current.focus&&(Be.current=!0,We.current.focus()),We.current=null)}},[$e]),reactExports.useEffect(()=>{if(!$e||!qe.current)return;const Qe=ownerDocument(qe.current),Ze=rr=>{Ye.current=rr,!(je||!De()||rr.key!=="Tab")&&Qe.activeElement===qe.current&&rr.shiftKey&&(Be.current=!0,ze.current&&ze.current.focus())},Je=()=>{const rr=qe.current;if(rr===null)return;if(!Qe.hasFocus()||!De()||Be.current){Be.current=!1;return}if(rr.contains(Qe.activeElement)||je&&Qe.activeElement!==Ue.current&&Qe.activeElement!==ze.current)return;if(Qe.activeElement!==Xe.current)Xe.current=null;else if(Xe.current!==null)return;if(!He.current)return;let ar=[];if((Qe.activeElement===Ue.current||Qe.activeElement===ze.current)&&(ar=Me(qe.current)),ar.length>0){var or,pr;const tr=!!((or=Ye.current)!=null&&or.shiftKey&&((pr=Ye.current)==null?void 0:pr.key)==="Tab"),nr=ar[0],hr=ar[ar.length-1];typeof nr!="string"&&typeof hr!="string"&&(tr?hr.focus():nr.focus())}else rr.focus()};Qe.addEventListener("focusin",Je),Qe.addEventListener("keydown",Ze,!0);const ir=setInterval(()=>{Qe.activeElement&&Qe.activeElement.tagName==="BODY"&&Je()},50);return()=>{clearInterval(ir),Qe.removeEventListener("focusin",Je),Qe.removeEventListener("keydown",Ze,!0)}},[Te,je,Oe,De,$e,Me]);const Ve=Qe=>{We.current===null&&(We.current=Qe.relatedTarget),He.current=!0,Xe.current=Qe.target;const Ze=Re.props.onFocus;Ze&&Ze(Qe)},Ke=Qe=>{We.current===null&&(We.current=Qe.relatedTarget),He.current=!0};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{tabIndex:$e?0:-1,onFocus:Ke,ref:Ue,"data-testid":"sentinelStart"}),reactExports.cloneElement(Re,{ref:Ge,onFocus:Ve}),jsxRuntimeExports.jsx("div",{tabIndex:$e?0:-1,onFocus:Ke,ref:ze,"data-testid":"sentinelEnd"})]})}function getContainer(Ee){return typeof Ee=="function"?Ee():Ee}function getHasTransition(Ee){return Ee?Ee.props.hasOwnProperty("in"):!1}const defaultManager=new ModalManager;function useModal(Ee){const{container:Re,disableEscapeKeyDown:Te=!1,disableScrollLock:je=!1,manager:Oe=defaultManager,closeAfterTransition:Me=!1,onTransitionEnter:De,onTransitionExited:$e,children:Be,onClose:Ue,open:ze,rootRef:We}=Ee,Xe=reactExports.useRef({}),He=reactExports.useRef(null),qe=reactExports.useRef(null),Ge=useForkRef(qe,We),[Ye,Ve]=reactExports.useState(!ze),Ke=getHasTransition(Be);let Qe=!0;(Ee["aria-hidden"]==="false"||Ee["aria-hidden"]===!1)&&(Qe=!1);const Ze=()=>ownerDocument(He.current),Je=()=>(Xe.current.modalRef=qe.current,Xe.current.mount=He.current,Xe.current),ir=()=>{Oe.mount(Je(),{disableScrollLock:je}),qe.current&&(qe.current.scrollTop=0)},rr=useEventCallback(()=>{const Rr=getContainer(Re)||Ze().body;Oe.add(Je(),Rr),qe.current&&ir()}),ar=reactExports.useCallback(()=>Oe.isTopModal(Je()),[Oe]),or=useEventCallback(Rr=>{He.current=Rr,Rr&&(ze&&ar()?ir():qe.current&&ariaHidden(qe.current,Qe))}),pr=reactExports.useCallback(()=>{Oe.remove(Je(),Qe)},[Qe,Oe]);reactExports.useEffect(()=>()=>{pr()},[pr]),reactExports.useEffect(()=>{ze?rr():(!Ke||!Me)&&pr()},[ze,pr,Ke,Me,rr]);const tr=Rr=>br=>{var wr;(wr=Rr.onKeyDown)==null||wr.call(Rr,br),!(br.key!=="Escape"||br.which===229||!ar(
576))&&(Te||(br.stopPropagation(),Ue&&Ue(br,"escapeKeyDown")))},nr=Rr=>br=>{var wr;(wr=Rr.onClick)==null||wr.call(Rr,br),br.target===br.currentTarget&&Ue&&Ue(br,"backdropClick")};return{getRootProps:(Rr={})=>{const br=extractEventHandlers(Ee);delete br.onTransitionEnter,delete br.onTransitionExited;const wr=_extends$1({},br,Rr);return _extends$1({role:"presentation"},wr,{onKeyDown:tr(wr),ref:Ge})},getBackdropProps:(Rr={})=>{const br=Rr;return _extends$1({"aria-hidden":!0},br,{onClick:nr(br),open:ze})},getTransitionProps:()=>{const Rr=()=>{Ve(!1),De&&De()},br=()=>{Ve(!0),$e&&$e(),Me&&pr()};return{onEnter:createChainedFunction(Rr,Be==null?void 0:Be.props.onEnter),onExited:createChainedFunction(br,Be==null?void 0:Be.props.onExited)}},rootRef:Ge,portalRef:or,isTopModal:ar,exited:Ye,hasTransition:Ke}}function getModalUtilityClass(Ee){return generateUtilityClass("MuiModal",Ee)}generateUtilityClasses("MuiModal",["root","hidden","backdrop"]);const _excluded$O=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],useUtilityClasses$J=Ee=>{const{open:Re,exited:Te,classes:je}=Ee;return composeClasses({root:["root",!Re&&Te&&"hidden"],backdrop:["backdrop"]},getModalUtilityClass,je)},ModalRoot=styled("div",{name:"MuiModal",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,!Te.open&&Te.exited&&Re.hidden]}})(({theme:Ee,ownerState:Re})=>_extends$1({position:"fixed",zIndex:(Ee.vars||Ee).zIndex.modal,right:0,bottom:0,top:0,left:0},!Re.open&&Re.exited&&{visibility:"hidden"})),ModalBackdrop=styled(Backdrop,{name:"MuiModal",slot:"Backdrop",overridesResolver:(Ee,Re)=>Re.backdrop})({zIndex:-1}),Modal=reactExports.forwardRef(function(Re,Te){var je,Oe,Me,De,$e,Be;const Ue=useDefaultProps({name:"MuiModal",props:Re}),{BackdropComponent:ze=ModalBackdrop,BackdropProps:We,className:Xe,closeAfterTransition:He=!1,children:qe,container:Ge,component:Ye,components:Ve={},componentsProps:Ke={},disableAutoFocus:Qe=!1,disableEnforceFocus:Ze=!1,disableEscapeKeyDown:Je=!1,disablePortal:ir=!1,disableRestoreFocus:rr=!1,disableScrollLock:ar=!1,hideBackdrop:or=!1,keepMounted:pr=!1,onBackdropClick:tr,open:nr,slotProps:hr,slots:sr}=Ue,xr=_objectWithoutPropertiesLoose(Ue,_excluded$O),Rr=_extends$1({},Ue,{closeAfterTransition:He,disableAutoFocus:Qe,disableEnforceFocus:Ze,disableEscapeKeyDown:Je,disablePortal:ir,disableRestoreFocus:rr,disableScrollLock:ar,hideBackdrop:or,keepMounted:pr}),{getRootProps:br,getBackdropProps:wr,getTransitionProps:vr,portalRef:Dr,isTopModal:kr,exited:cr,hasTransition:dr}=useModal(_extends$1({},Rr,{rootRef:Te})),ur=_extends$1({},Rr,{exited:cr}),gr=useUtilityClasses$J(ur),_r={};if(qe.props.tabIndex===void 0&&(_r.tabIndex="-1"),dr){const{onEnter:Vr,onExited:mr}=vr();_r.onEnter=Vr,_r.onExited=mr}const Ir=(je=(Oe=sr==null?void 0:sr.root)!=null?Oe:Ve.Root)!=null?je:ModalRoot,Ar=(Me=(De=sr==null?void 0:sr.backdrop)!=null?De:Ve.Backdrop)!=null?Me:ze,Tr=($e=hr==null?void 0:hr.root)!=null?$e:Ke.root,Nr=(Be=hr==null?void 0:hr.backdrop)!=null?Be:Ke.backdrop,Br=useSlotProps({elementType:Ir,externalSlotProps:Tr,externalForwardedProps:xr,getSlotProps:br,additionalProps:{ref:Te,as:Ye},ownerState:ur,className:clsx(Xe,Tr==null?void 0:Tr.className,gr==null?void 0:gr.root,!ur.open&&ur.exited&&(gr==null?void 0:gr.hidden))}),Hr=useSlotProps({elementType:Ar,externalSlotProps:Nr,additionalProps:We,getSlotProps:Vr=>wr(_extends$1({},Vr,{onClick:mr=>{tr&&tr(mr),Vr!=null&&Vr.onClick&&Vr.onClick(mr)}})),className:clsx(Nr==null?void 0:Nr.className,We==null?void 0:We.className,gr==null?void 0:gr.backdrop),ownerState:ur});return!pr&&!nr&&(!dr||cr)?null:jsxRuntimeExports.jsx(Portal,{ref:Dr,container:Ge,disablePortal:ir,children:jsxRuntimeExports.jsxs(Ir,_extends$1({},Br,{children:[!or&&ze?jsxRuntimeExports.jsx(Ar,_extends$1({},Hr)):null,jsxRuntimeExports.jsx(FocusTrap,{disableEnforceFocus:Ze,disableAutoFocus:Qe,disableRestoreFocus:rr,isEnabled:kr,open:nr,children:reactExports.cloneElement(qe,_r)})]}))})});function getDialogUtilityClass(Ee){return generateUtilityClass("MuiDialog",Ee)}const dialogClasses=generateUtilityClasses("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),DialogContext=reactExports.createContext({}),_excluded$N=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","Pa
576perProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],DialogBackdrop=styled(Backdrop,{name:"MuiDialog",slot:"Backdrop",overrides:(Ee,Re)=>Re.backdrop})({zIndex:-1}),useUtilityClasses$I=Ee=>{const{classes:Re,scroll:Te,maxWidth:je,fullWidth:Oe,fullScreen:Me}=Ee,De={root:["root"],container:["container",`scroll${capitalize$1(Te)}`],paper:["paper",`paperScroll${capitalize$1(Te)}`,`paperWidth${capitalize$1(String(je))}`,Oe&&"paperFullWidth",Me&&"paperFullScreen"]};return composeClasses(De,getDialogUtilityClass,Re)},DialogRoot=styled(Modal,{name:"MuiDialog",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})({"@media print":{position:"absolute !important"}}),DialogContainer=styled("div",{name:"MuiDialog",slot:"Container",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.container,Re[`scroll${capitalize$1(Te.scroll)}`]]}})(({ownerState:Ee})=>_extends$1({height:"100%","@media print":{height:"auto"},outline:0},Ee.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},Ee.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),DialogPaper=styled(Paper,{name:"MuiDialog",slot:"Paper",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.paper,Re[`scrollPaper${capitalize$1(Te.scroll)}`],Re[`paperWidth${capitalize$1(String(Te.maxWidth))}`],Te.fullWidth&&Re.paperFullWidth,Te.fullScreen&&Re.paperFullScreen]}})(({theme:Ee,ownerState:Re})=>_extends$1({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},Re.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},Re.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!Re.maxWidth&&{maxWidth:"calc(100% - 64px)"},Re.maxWidth==="xs"&&{maxWidth:Ee.breakpoints.unit==="px"?Math.max(Ee.breakpoints.values.xs,444):`max(${Ee.breakpoints.values.xs}${Ee.breakpoints.unit}, 444px)`,[`&.${dialogClasses.paperScrollBody}`]:{[Ee.breakpoints.down(Math.max(Ee.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},Re.maxWidth&&Re.maxWidth!=="xs"&&{maxWidth:`${Ee.breakpoints.values[Re.maxWidth]}${Ee.breakpoints.unit}`,[`&.${dialogClasses.paperScrollBody}`]:{[Ee.breakpoints.down(Ee.breakpoints.values[Re.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},Re.fullWidth&&{width:"calc(100% - 64px)"},Re.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${dialogClasses.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Dialog=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiDialog"}),Oe=useTheme$1(),Me={enter:Oe.transitions.duration.enteringScreen,exit:Oe.transitions.duration.leavingScreen},{"aria-describedby":De,"aria-labelledby":$e,BackdropComponent:Be,BackdropProps:Ue,children:ze,className:We,disableEscapeKeyDown:Xe=!1,fullScreen:He=!1,fullWidth:qe=!1,maxWidth:Ge="sm",onBackdropClick:Ye,onClick:Ve,onClose:Ke,open:Qe,PaperComponent:Ze=Paper,PaperProps:Je={},scroll:ir="paper",TransitionComponent:rr=Fade,transitionDuration:ar=Me,TransitionProps:or}=je,pr=_objectWithoutPropertiesLoose(je,_excluded$N),tr=_extends$1({},je,{disableEscapeKeyDown:Xe,fullScreen:He,fullWidth:qe,maxWidth:Ge,scroll:ir}),nr=useUtilityClasses$I(tr),hr=reactExports.useRef(),sr=wr=>{hr.current=wr.target===wr.currentTarget},xr=wr=>{Ve&&Ve(wr),hr.current&&(hr.current=null,Ye&&Ye(wr),Ke&&Ke(wr,"backdropClick"))},Rr=useId($e),br=reactExports.useMemo(()=>({titleId:Rr}),[Rr]);return jsxRuntimeExports.jsx(DialogRoot,_extends$1({className:clsx(nr.root,We),closeAfterTransition:!0,components:{Backdrop:DialogBackdrop},componentsProps:{backdrop:_extends$1({transitionDuration:ar,as:Be},Ue)},disableEscapeKeyDown:Xe,onClose:Ke,open:Qe,ref:Te,onClick:xr,ownerState:tr},pr,{children:jsxRuntimeExports.jsx(rr,_extends$1({appear:!0,in:Qe,timeout:ar,role:"presentation"},or,{children:jsxRuntimeExports.jsx(DialogContainer,{className:clsx(nr.container),onMouseDown:sr,ownerState:tr,children:jsxRuntimeExports.jsx(DialogPaper,_extends$1({as:Ze,elevation:24,role:"dialog","aria-describedby":De,"aria-labelledby":Rr},Je,{className:clsx(nr.paper,Je.className),ownerState:tr,children:jsxRuntimeExports.jsx(DialogContext.Provider,{value:br,children:ze})}))})}))}))});function getDialogActionsUtilityClass(Ee){return generateUtilityClass("MuiDialogActions",Ee)}generateUtilityClasses("MuiDialogActions",["root","spacing"]);const _excluded$M=["className","disableSpacing"],useUtilityClasses$H=Ee=>{const{classes:Re,disableSpacing:Te}=Ee;return composeClasses({root:["root",!Te&&"spacing"]},getDialogActionsUtilityClass,Re)},DialogActionsRoot=styled("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,!Te.disableSpacing&&Re.spacing]}})(({ownerState:Ee})=>_extends$1({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!Ee.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),DialogActions=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiDialogActions"}),{className:Oe,disableSpacing:Me=!1}
vendor: 24,325 bytes, line 576
576=je,De=_objectWithoutPropertiesLoose(je,_excluded$M),$e=_extends$1({},je,{disableSpacing:Me}),Be=useUtilityClasses$H($e);return jsxRuntimeExports.jsx(DialogActionsRoot,_extends$1({className:clsx(Be.root,Oe),ownerState:$e,ref:Te},De))});function getDialogContentUtilityClass(Ee){return generateUtilityClass("MuiDialogContent",Ee)}generateUtilityClasses("MuiDialogContent",["root","dividers"]);function getDialogTitleUtilityClass(Ee){return generateUtilityClass("MuiDialogTitle",Ee)}const dialogTitleClasses=generateUtilityClasses("MuiDialogTitle",["root"]),_excluded$L=["className","dividers"],useUtilityClasses$G=Ee=>{const{classes:Re,dividers:Te}=Ee;return composeClasses({root:["root",Te&&"dividers"]},getDialogContentUtilityClass,Re)},DialogContentRoot=styled("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.dividers&&Re.dividers]}})(({theme:Ee,ownerState:Re})=>_extends$1({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},Re.dividers?{padding:"16px 24px",borderTop:`1px solid ${(Ee.vars||Ee).palette.divider}`,borderBottom:`1px solid ${(Ee.vars||Ee).palette.divider}`}:{[`.${dialogTitleClasses.root} + &`]:{paddingTop:0}})),DialogContent=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiDialogContent"}),{className:Oe,dividers:Me=!1}=je,De=_objectWithoutPropertiesLoose(je,_excluded$L),$e=_extends$1({},je,{dividers:Me}),Be=useUtilityClasses$G($e);return jsxRuntimeExports.jsx(DialogContentRoot,_extends$1({className:clsx(Be.root,Oe),ownerState:$e,ref:Te},De))}),_excluded$K=["className","id"],useUtilityClasses$F=Ee=>{const{classes:Re}=Ee;return composeClasses({root:["root"]},getDialogTitleUtilityClass,Re)},DialogTitleRoot=styled(Typography,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})({padding:"16px 24px",flex:"0 0 auto"}),DialogTitle=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiDialogTitle"}),{className:Oe,id:Me}=je,De=_objectWithoutPropertiesLoose(je,_excluded$K),$e=je,Be=useUtilityClasses$F($e),{titleId:Ue=Me}=reactExports.useContext(DialogContext);return jsxRuntimeExports.jsx(DialogTitleRoot,_extends$1({component:"h2",className:clsx(Be.root,Oe),ownerState:$e,ref:Te,variant:"h6",id:Me??Ue},De))});function getDividerUtilityClass(Ee){return generateUtilityClass("MuiDivider",Ee)}const dividerClasses=generateUtilityClasses("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),_excluded$J=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],useUtilityClasses$E=Ee=>{const{absolute:Re,children:Te,classes:je,flexItem:Oe,light:Me,orientation:De,textAlign:$e,variant:Be}=Ee;return composeClasses({root:["root",Re&&"absolute",Be,Me&&"light",De==="vertical"&&"vertical",Oe&&"flexItem",Te&&"withChildren",Te&&De==="vertical"&&"withChildrenVertical",$e==="right"&&De!=="vertical"&&"textAlignRight",$e==="left"&&De!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",De==="vertical"&&"wrapperVertical"]},getDividerUtilityClass,je)},DividerRoot=styled("div",{name:"MuiDivider",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.absolute&&Re.absolute,Re[Te.variant],Te.light&&Re.light,Te.orientation==="vertical"&&Re.vertical,Te.flexItem&&Re.flexItem,Te.children&&Re.withChildren,Te.children&&Te.orientation==="vertical"&&Re.withChildrenVertical,Te.textAlign==="right"&&Te.orientation!=="vertical"&&Re.textAlignRight,Te.textAlign==="left"&&Te.orientation!=="vertical"&&Re.textAlignLeft]}})(({theme:Ee,ownerState:Re})=>_extends$1({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(Ee.vars||Ee).palette.divider,borderBottomWidth:"thin"},Re.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},Re.light&&{borderColor:Ee.vars?`rgba(${Ee.vars.palette.dividerChannel} / 0.08)`:alpha_1(Ee.palette.divider,.08)},Re.variant==="inset"&&{marginLeft:72},Re.variant==="middle"&&Re.orientation==="horizontal"&&{marginLeft:Ee.spacing(2),marginRight:Ee.spacing(2)},Re.variant==="middle"&&Re.orientation==="vertical"&&{marginTop:Ee.spacing(1),marginBottom:Ee.spacing(1)},Re.orientation==="vertical"&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},Re.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:Ee})=>_extends$1({},Ee.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:Ee,ownerState:Re})=>_extends$1({},Re.children&&Re.orientation!=="vertical"&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(Ee.vars||Ee).palette.divider}`,borderTopStyle:"inherit"}}),({theme:Ee,ownerState:Re})=>_extends$1({},Re.children&&Re.orientation==="vertical"&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(Ee.vars||Ee).palette.divider}`,borderLeftStyle:"inherit"}}),({ownerState:Ee})=>_extends$1({},Ee.textAlign==="right"&&Ee.orientation!=="vertical"&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},Ee.textAlign==="left"&&Ee.orientation!=="vertical"&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),DividerWrapper=styled("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.wrapper,Te.orientation==="vertical"&&Re.wrapperVertical]}})(({theme:Ee,ownerState:Re})=>_extends$1({display:"inline-block",paddingLeft:`calc(${Ee.spacing(1)} * 1.2)`,paddingRight:`calc(${Ee.spacing(1)} * 1.2)`},Re.orientation==="vertical"&&{paddingTop:`calc(${Ee.spacing(1)} * 1.2)`,paddingBottom:`calc(${Ee.spacing(1)} * 1.2)`})),Divider=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiDivider"}),{absolute:Oe=!1,children:Me,className:De,component:$e=Me?"div":"hr",flexItem:Be=!1,light:Ue=!1,orientation:ze="horizontal",role:We=$e!=="hr"?"separator":void 0,textAlign:Xe="center",variant:He="fullWidth"}=je,qe=_objectWithoutPropertiesLoose(je,_excluded$J),Ge=_extends$1({},je,{absolute:Oe,component:$e,flexItem:Be,light:Ue,orientation:ze,role:We,textAlign:Xe,variant:He}),Ye=useUtilityClasses$E(Ge);return jsxRuntimeExports.jsx(DividerRoot,_extends$1({as:$e,className:clsx(Ye.root,De),role:We,ref:Te,ownerState:Ge},qe,{children:Me?jsxRuntimeExports.jsx(DividerWrapper,{className:Ye.wrapper,ownerState:Ge,children:Me}):null}))});Divider.muiSkipListHighlight=!0;const _excluded$I=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getTranslateValue(Ee,Re,Te){const je=Re.getBoundingClientRect(),Oe=Te&&Te.getBoundingClientRect(),Me=ownerWindow(Re);let De;if(Re.fakeTransform)De=Re.fakeTransform;else{const Ue=Me.getComputedStyle(Re);De=Ue.getPropertyValue("-webkit-transform")||Ue.getPropertyValue("transform")}let $e=0,Be=0;if(De&&De!=="none"&&typeof De=="string"){const Ue=De.split("(")[1].split(")")[0].split(",");$e=parseInt(Ue[4],10),Be=parseInt(Ue[5],10)}return Ee==="left"?Oe?`translateX(${Oe.right+$e-je.left}px)`:`translateX(${Me.innerWidth+$e-je.left}px)`:Ee==="right"?Oe?`translateX(-${je.right-Oe.left-$e}px)`:`translateX(-${je.left+je.width-$e}px)`:Ee==="up"?Oe?`translateY(${Oe.bottom+Be-je.top}px)`:`translateY(${Me.innerHeight+Be-je.top}px)`:Oe?`translateY(-${je.top-Oe.top+je.height-Be}px)`:`translateY(-${je.top+je.height-Be}px)`}function resolveContainer(Ee){return typeof Ee=="function"?Ee():Ee}function setTranslateValue(Ee,Re,Te){const je=resolveContainer(Te),Oe=getTranslateValue(Ee,Re,je);Oe&&(Re.style.webkitTransform=Oe,Re.style.transform=Oe)}const Slide=reactExports.forwardRef(function(Re,Te){const je=useTheme$1(),Oe={enter:je.transitions.easing.easeOut,exit:je.transitions.easing.sharp},Me={enter:je.transitions.duration.enteringScreen,exit:je.transitions.duration.leavingScreen},{addEndListener:De,appear:$e=!0,children:Be,container:Ue,direction:ze="down",easing:We=Oe,in:Xe,onEnter:He,onEntered:qe,onEntering:Ge,onExit:Ye,onExited:Ve,onExiting:Ke,style:Qe,timeout:Ze=Me,TransitionComponent:Je=Transition}=Re,ir=_objectWithoutPropertiesLoose(Re,_excluded$I),rr=reactExports.useRef(null),ar=useForkRef(getReactElementRef(Be),rr,Te),or=wr=>vr=>{wr&&(vr===void 0?wr(rr.current):wr(rr.current,vr))},pr=or((wr,vr)=>{setTranslateValue(ze,wr,Ue),reflow(wr),He&&He(wr,vr)}),tr=or((wr,vr)=>{const Dr=getTransitionProps({timeout:Ze,style:Qe,easing:We},{mode:"enter"});wr.style.webkitTransition=je.transitions.create("-webkit-transform",_extends$1({},Dr)),wr.style.transition=je.transitions.create("transform",_extends$1({},Dr)),wr.style.webkitTransform="none",wr.style.transform="none",Ge&&Ge(wr,vr)}),nr=or(qe),hr=or(Ke),sr=or(wr=>{const vr=getTransitionProps({timeout:Ze,style:Qe,easing:We},{mode:"exit"});wr.style.webkitTransition=je.transitions.create("-webkit-transform",vr),wr.style.transition=je.transitions.create("transform",vr),setTranslateValue(ze,wr,Ue),Ye&&Ye(wr)}),xr=or(wr=>{wr.style.webkitTransition="",wr.style.transition="",Ve&&Ve(wr)}),Rr=wr=>{De&&De(rr.current,wr)},br=reactExports.useCallback(()=>{rr.current&&setTranslateValue(ze,rr.current,Ue)},[ze,Ue]);return reactExports.useEffect(()=>{if(Xe||ze==="down"||ze==="right")return;const wr=debounce$1(()=>{rr.current&&setTranslateValue(ze,rr.current,Ue)}),vr=ownerWindow(rr.current);return vr.addEventListener("resize",wr),()=>{wr.clear(),vr.removeEventListener("resize",wr)}},[ze,Xe,Ue]),reactExports.useEffect(()=>{Xe||br()},[Xe,br]),jsxRuntimeExports.jsx(Je,_extends$1({nodeRef:rr,onEnter:pr,onEntered:nr,onEntering:tr,onExit:sr,onExited:xr,onExiting:hr,addEndListener:Rr,appear:$e,in:Xe,timeout:Ze},ir,{children:(wr,vr)=>reactExports.cloneElement(Be,_extends$1({ref:ar,style:_extends$1({visibility:wr==="exited"&&!Xe?"hidden":void 0},Qe,Be.props.style)},vr))}))});function getDrawerUtilityClass(Ee){return generateUtilityClass("MuiDrawer",Ee)}generateUtilityClasses("MuiDrawer",["root","docked","paper","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const _excluded$H=["BackdropProps"],_excluded2$6=["anchor","BackdropProps","children","className","elevation","hideBackdrop","ModalProps","onClose","open","PaperProps","SlideProps","TransitionComponent","transitionDuration","variant"],overridesResolver$4=(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,(Te.variant==="permanent"||Te.variant==="persistent")&&Re.docked,Re.modal]},useUtilityClasses$D=Ee=>{const{classes:Re,anchor:Te,variant:je}=Ee,Oe={root:["root"],docked:[(je==="permanent"||je==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${capitalize$1(Te)}`,je!=="temporary"&&`paperAnchorDocked${capitalize$1(Te)}`]};return composeClasses(Oe,getDrawerUtilityClass,Re)},DrawerRoot=styled(Modal,{name:"MuiDrawer",slot:"Root",overridesResolver:overridesResolver$4})(({theme:Ee})=>({zIndex:(Ee.vars||Ee).zIndex.drawer})),DrawerDockedRoot=styled("div",{shouldForwardProp:rootShouldForwardProp,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:overridesResolver$4})({flex:"0 0 auto"}),DrawerPaper=styled(Paper,{name:"MuiDrawer",slot:"Paper",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.paper,Re[`paperAnchor${capitalize$1(Te.anchor)}`],Te.variant!=="temporary"&&Re[`paperAnchorDocked${capitalize$1(Te.anchor)}`]]}})(({theme:Ee,ownerState:Re})=>_extends$1({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(Ee.vars||Ee).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0},Re.anchor==="left"&&{left:0},Re.anchor==="top"&&{top:0,left:0,right:0,height:"auto",maxHeight:"100%"},Re.anchor==="right"&&{right:0},Re.anchor==="bottom"&&{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"},Re.anchor==="left"&&Re.variant!=="temporary"&&{borderRight:`1px solid ${(Ee.vars||Ee).palette.divider}`},Re.anchor==="top"&&Re.variant!=="temporary"&&{borderBottom:`1px solid ${(Ee.vars||Ee).palette.divider}`},Re.anchor==="right"&&Re.variant!=="temporary"&&{borderLeft:`1px solid ${(Ee.vars||Ee).palette.divider}`},Re.anchor==="bottom"&&Re.variant!=="temporary"&&{borderTop:`1px solid ${(Ee.vars||Ee).palette.divider}`})),oppositeDirection={left:"right",right:"left",top:"down",bottom:"up"};function isHorizontal(Ee){return["left","right"].indexOf(Ee)!==-1}function getAnchor({direction:Ee},Re){return Ee==="rtl"&&isHorizontal(Re)?oppositeDirection[Re]:Re}const Drawer=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiDrawer"}),Oe=useTheme$1(),Me=useRtl(),De={enter:Oe.transitions.duration.enteringScreen,exit:Oe.transitions.duration.leavingScreen},{anchor:$e="left",BackdropProps:Be,children:Ue,className:ze,elevation:We=16,hideBackdrop:Xe=!1,ModalProps:{BackdropProps:He}={},onClose:qe,open:Ge=!1,PaperProps:Ye={},SlideProps:Ve,TransitionComponent:Ke=Slide,transitionDuration:Qe=De,variant:Ze="temporary"}=je,Je=_objectWithoutPropertiesLoose(je.ModalProps,_excluded$H),ir=_objectWithoutPropertiesLoose(je,_excluded2$6),rr=reactExports.useRef(!1);reactExports.useEffect(()=>{rr.current=!0},[]);const ar=getAnchor({direction:Me?"rtl":"ltr"},$e),pr=_extends$1({},je,{anchor:$e,elevation:We,open:Ge,variant:Ze},ir),tr=useUtilityClasses$D(pr),nr=jsxRuntimeExports.jsx(DrawerPaper,_extends$1({elevation:Ze==="temporary"?We:0,square:!0},Ye,{className:clsx(tr.paper,Ye.className),ownerState:pr,children:Ue}));if(Ze==="permanent")return jsxRuntimeExports.jsx(DrawerDockedRoot,_extends$1({className:clsx(tr.root,tr.docked,ze),ownerState:pr,ref:Te},ir,{children:nr}));const hr=jsxRuntimeExports.jsx(Ke,_extends$1({in:Ge,direction:oppositeDirection[ar],timeout:Qe,appear:rr.current},Ve,{children:nr}));return Ze==="persistent"?jsxRuntimeExports.jsx(DrawerDockedRoot,_extends$1({className:clsx(tr.root,tr.docked,ze),ownerState:pr,ref:Te},ir,{children:hr})):jsxRuntimeExports.jsx(DrawerRoot,_extends$1({BackdropProps:_extends$1({},Be,He,{transitionDuration:Qe}),className:clsx(tr.root,tr.modal,ze),open:Ge,ownerState:pr,onClose:qe,hideBackdrop:Xe,ref:Te},ir,Je,{children:hr}))});function getFabUtilityClass(Ee){return generateUtilityClass("MuiFab",Ee)}const fabClasses=generateUtilityClasses("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),_excluded$G=["children","className","color","component","disabled","disableFocusRipple","focusVisibleClassName","size","variant"],useUtilityClasses$C=Ee=>{const{color:Re,variant:Te,classes:je,size:Oe}=Ee,Me={root:["root",Te,`size${capitalize$1(Oe)}`,Re==="inherit"?"colorInherit":Re]},De=composeClasses(Me,getFabUtilityClass,je);return _extends$1({},je,De)},FabRoot=styled(ButtonBase,{name:"MuiFab",slot:"Root",shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[Te.variant],Re[`size${capitalize$1(Te.size)}`],Te.color==="inherit"&&Re.colorInherit,Re[capitalize$1(Te.size)],Re[Te.color]]}})(({theme:Ee,ownerState:Re})=>{var Te,je;return _extends$1({},Ee.typography.button,{minHeight:36,transition:Ee.transitions.create(["background-color","box-shadow","border-color"],{duration:Ee.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(Ee.vars||Ee).zIndex.fab,boxShadow:(Ee.vars||Ee).shadows[6],"&:active":{boxShadow:(Ee.vars||Ee).shadows[12]},color:Ee.vars?Ee.vars.palette.text.primary:(Te=(je=Ee.palette).getContrastText)==null?void 0:Te.call(je,Ee.palette.grey[300]),backgroundColor:(Ee.vars||Ee).palette.grey[300],"&:hover":{backgroundColor:(Ee.vars||Ee).palette.grey.A100,"@media (hover: none)":{backgroundColor:(Ee.vars||Ee).palette.grey[300]},textDecoration:"none"},[`&.${fabClasses.focusVisible}`]:{boxShadow:(Ee.vars||Ee).shadows[6]}},Re.size==="small"&&{width:40,height:40},Re.size==="medium"&&{width:48,height:48},Re.variant==="extended"&&{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48},Re.variant==="extended"&&Re.size==="small"&&{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34},Re.variant==="extended"&&Re.size==="medium"&&{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40},Re.color==="inherit"&&{color:"inherit"})},({theme:Ee,ownerState:Re})=>_extends$1({},Re.color!=="inherit"&&Re.color!=="default"&&(Ee.vars||Ee).palette[Re.color]!=null&&{color:(Ee.vars||Ee).palette[Re.color].contrastText,backgroundColor:(Ee.vars||Ee).palette[Re.color].main,"&:hover":{backgroundColor:(Ee.vars||Ee).palette[Re.color].dark,"@media (hover: none)":{backgroundColor:(Ee.vars||Ee).palette[Re.color].main}}}),({theme:Ee})=>({[`&.${fabClasses.disabled}`]:{color:(Ee.vars||Ee).palette.action.disabled,boxShadow:(Ee.vars||Ee).shadows[0],backgroundColor:(Ee.vars||Ee).palette.action.disabledBackground}})),Fab=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiFab"}),{children:Oe,className:Me,color:De="default",component:$e="button",disabled:Be=!1,disableFocusRipple:Ue=!1,focusVisibleClassName:ze,size:We="large",variant:Xe="circular"}=je,He=_objectWithoutPropertiesLoose(je,_excluded$G),qe=_extends$1({},je,{color:De,component:$e,disabled:Be,disableFocusRipple:Ue,size:We,variant:Xe}),Ge=useUtilityClasses$C(qe);return jsxRuntimeExports.jsx(FabRoot,_extends$1({className:clsx(Ge.root,Me),component:$e,disabled:Be,focusRipple:!Ue,focusVisibleClassName:clsx(Ge.focusVisible,ze),ownerState:qe,ref:Te},He,{classes:Ge,children:Oe}))}),_excluded$F=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$B=Ee=>{const{classes:Re,disableUnderline:Te}=Ee,Oe=composeClasses({root:["root",!Te&&"underline"],input:["input"]},getFilledInputUtilityClass,Re);return _extends$1({},Re,Oe)},FilledInputRoot=styled(InputBaseRoot,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[...rootOverridesResolver(Ee,Re),!Te.disableUnderline&&Re.underline]}})(({theme:Ee,ownerState:Re})=>{var Te;const je=Ee.palette.mode==="light",Oe=je?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",Me=je?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",De=je?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",$e=je?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return _extends$1({position:"relative",backgroundColor:Ee.vars?Ee.vars.palette.FilledInput.bg:Me,borderTopLeftRadius:(Ee.vars||Ee).shape.borderRadius,borderTopRightRadius:(Ee.vars||Ee).shape.borderRadius,transition:Ee.transitions.create("background-color",{duration:Ee.transitions.duration.shorter,easing:Ee.transitions.easing.easeOut}),"&:hover":{backgroundColor:Ee.vars?Ee.vars.palette.FilledInput.hoverBg:De,"@media (hover: none)":{backgroundColor:Ee.vars?Ee.vars.palette.FilledInput.bg:Me}},[`&.${filledInputClasses.focused}`]:{backgroundColor:Ee.vars?Ee.vars.palette.FilledInput.bg:Me},[`&.${filledInputClasses.disabled}`]:{backgroundColor:Ee.vars?Ee.vars.palette.FilledInput.disabledBg:$e}},!Re.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(Te=(Ee.vars||Ee).palette[Re.color||"primary"])==null?void 0:Te.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:Ee.transitions.create("transform",{duration:Ee.transitions.duration.shorter,easing:Ee.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(Ee.vars||Ee).palette.error.main}},"&::before":{borderBottom:`1px solid ${Ee.vars?`rgba(${Ee.vars.palette.common.onBackgroundChannel} / ${Ee.vars.opacity.inputUnderline})`:Oe}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:Ee.transitions.create("border-bottom-color",{duration:Ee.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses.disabled}, .${filledInputClasses.error}):before`]:{borderBottom:`1px solid ${(Ee.vars||Ee).palette.text.primary}`},[`&.${filledInputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}},Re.startAdornment&&{paddingLeft:12},Re.endAdornment&&{paddingRight:12},Re.multiline&&_extends$1({padding:"25px 12px 8px"},Re.size==="small"&&{paddingTop:21,paddingBottom:4},Re.hiddenLabel&&{paddingTop:16,paddingBottom:17},Re.hiddenLabel&&Re.size==="small"&&{paddingTop:8,paddingBottom:9}))}),FilledInputInput=styled(InputBaseComponent,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:Ee,ownerState:Re})=>_extends$1({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!Ee.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:Ee.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:Ee.palette.mode==="light"?null:"#fff",caretColor:Ee.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},Ee.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[Ee.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},Re.size==="small"&&{paddingTop:21,paddingBottom:4},Re.hiddenLabel&&{paddingTop:16,paddingBottom:17},Re.startAdornment&&{paddingLeft:0},Re.endAdornment&&{paddingRight:0},Re.hiddenLabel&&Re.size==="small"&&{paddingTop:8,paddingBottom:9},Re.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),FilledInput=reactExports.forwardRef(function(Re,Te){var je,Oe,Me,De;const $e=useDefaultProps({props:Re,name:"MuiFilledInput"}),{components:Be={},componentsProps:Ue,fullWidth:ze=!1,inputComponent:We="input",multiline:Xe=!1,slotProps:He,slots:qe={},type:Ge="text"}=$e,Ye=_objectWithoutPropertiesLoose($e,_excluded$F),Ve=_extends$1({},$e,{fullWidth:ze,inputComponent:We,multiline:Xe,type:Ge}),Ke=useUtilityClasses$B($e),Qe={root:{ownerState:Ve},input:{ownerState:Ve}},Ze=He??Ue?deepmerge$1(Qe,He??Ue):Qe,Je=(je=(Oe=qe.root)!=null?Oe:Be.Root)!=null?je:FilledInputRoot,ir=(Me=(De=qe.input)!=null?De:Be.Input)!=null?Me:FilledInputInput;return jsxRuntimeExports.jsx(InputBase,_extends$1({slots:{root:Je,input:ir},componentsProps:Ze,fullWidth:ze,inputComponent:We,multiline:Xe,ref:Te,type:Ge},Ye,{classes:Ke}))});FilledInput.muiName="Input";function getFormControlUtilityClasses(Ee){return generateUtilityClass("MuiFormControl",Ee)}generateUtilityClasses("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const _excluded$E=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],useUtilityClasses$A=Ee=>{const{classes:Re,margin:Te,fullWidth:je}=Ee,Oe={root:["root",Te!=="none"&&`margin${capitalize$1(Te)}`,je&&"fullWidth"]};return composeClasses(Oe,getFormControlUtilityClasses,Re)},FormControlRoot=styled("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:Ee},Re)=>_extends$1({},Re.root,Re[`margin${capitalize$1(Ee.margin)}`],Ee.fullWidth&&Re.fullWidth)})(({ownerState:Ee})=>_extends$1({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},Ee.margin==="normal"&&{marginTop:16,marginBottom:8},Ee.margin==="dense"&&{marginTop:8,marginBottom:4},Ee.fullWidth&&{width:"100%"})),FormControl=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiFormControl"}),{children:Oe,className:Me,color:De="primary",component:$e="div",disabled:Be=!1,error:Ue=!1,focused:ze,fullWidth:We=!1,hiddenLabel:Xe=!1,margin:He="none",required:qe=!1,size:Ge="medium",variant:Ye="outlined"}=je,Ve=_objectWithoutPropertiesLoose(je,_excluded$E),Ke=_extends$1({},je,{color:De,component:$e,disabled:Be,error:Ue,fullWidth:We,hiddenLabel:Xe,margin:He,required:qe,size:Ge,variant:Ye}),Qe=useUtilityClasses$A(Ke),[Ze,Je]=reactExports.useState(()=>{let hr=!1;
576return Oe&&reactExports.Children.forEach(Oe,sr=>{if(!isMuiElement(sr,["Input","Select"]))return;const xr=isMuiElement(sr,["Select"])?sr.props.input:sr;xr&&isAdornedStart(xr.props)&&(hr=!0)}),hr}),[ir,rr]=reactExports.useState(()=>{let hr=!1;return Oe&&reactExports.Children.forEach(Oe,sr=>{isMuiElement(sr,["Input","Select"])&&(isFilled(sr.props,!0)||isFilled(sr.props.inputProps,!0))&&(hr=!0)}),hr}),[ar,or]=reactExports.useState(!1);Be&&ar&&or(!1);const pr=ze!==void 0&&!Be?ze:ar;let tr;const nr=reactExports.useMemo(()=>({adornedStart:Ze,setAdornedStart:Je,color:De,disabled:Be,error:Ue,filled:ir,focused:pr,fullWidth:We,hiddenLabel:Xe,size:Ge,onBlur:()=>{or(!1)},onEmpty:()=>{rr(!1)},onFilled:()=>{rr(!0)},onFocus:()=>{or(!0)},registerEffect:tr,required:qe,variant:Ye}),[Ze,De,Be,Ue,ir,pr,We,Xe,tr,qe,Ge,Ye]);return jsxRuntimeExports.jsx(FormControlContext.Provider,{value:nr,children:jsxRuntimeExports.jsx(FormControlRoot,_extends$1({as:$e,ownerState:Ke,className:clsx(Qe.root,Me),ref:Te},Ve,{children:Oe}))})}),Stack=createStack({createStyledComponent:styled("div",{name:"MuiStack",slot:"Root",overridesResolver:(Ee,Re)=>Re.root}),useThemeProps:Ee=>useDefaultProps({props:Ee,name:"MuiStack"})});function getFormControlLabelUtilityClasses(Ee){return generateUtilityClass("MuiFormControlLabel",Ee)}const formControlLabelClasses=generateUtilityClasses("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),_excluded$D=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],useUtilityClasses$z=Ee=>{const{classes:Re,disabled:Te,labelPlacement:je,error:Oe,required:Me}=Ee,De={root:["root",Te&&"disabled",`labelPlacement${capitalize$1(je)}`,Oe&&"error",Me&&"required"],label:["label",Te&&"disabled"],asterisk:["asterisk",Oe&&"error"]};return composeClasses(De,getFormControlLabelUtilityClasses,Re)},FormControlLabelRoot=styled("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[{[`& .${formControlLabelClasses.label}`]:Re.label},Re.root,Re[`labelPlacement${capitalize$1(Te.labelPlacement)}`]]}})(({theme:Ee,ownerState:Re})=>_extends$1({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${formControlLabelClasses.disabled}`]:{cursor:"default"}},Re.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},Re.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},Re.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${formControlLabelClasses.label}`]:{[`&.${formControlLabelClasses.disabled}`]:{color:(Ee.vars||Ee).palette.text.disabled}}})),AsteriskComponent$1=styled("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(Ee,Re)=>Re.asterisk})(({theme:Ee})=>({[`&.${formControlLabelClasses.error}`]:{color:(Ee.vars||Ee).palette.error.main}})),FormControlLabel=reactExports.forwardRef(function(Re,Te){var je,Oe;const Me=useDefaultProps({props:Re,name:"MuiFormControlLabel"}),{className:De,componentsProps:$e={},control:Be,disabled:Ue,disableTypography:ze,label:We,labelPlacement:Xe="end",required:He,slotProps:qe={}}=Me,Ge=_objectWithoutPropertiesLoose(Me,_excluded$D),Ye=useFormControl(),Ve=(je=Ue??Be.props.disabled)!=null?je:Ye==null?void 0:Ye.disabled,Ke=He??Be.props.required,Qe={disabled:Ve,required:Ke};["checked","name","onChange","value","inputRef"].forEach(or=>{typeof Be.props[or]>"u"&&typeof Me[or]<"u"&&(Qe[or]=Me[or])});const Ze=formControlState({props:Me,muiFormControl:Ye,states:["error"]}),Je=_extends$1({},Me,{disabled:Ve,labelPlacement:Xe,required:Ke,error:Ze.error}),ir=useUtilityClasses$z(Je),rr=(Oe=qe.typography)!=null?Oe:$e.typography;let ar=We;return ar!=null&&ar.type!==Typography&&!ze&&(ar=jsxRuntimeExports.jsx(Typography,_extends$1({component:"span"},rr,{className:clsx(ir.label,rr==null?void 0:rr.className),children:ar}
576))),jsxRuntimeExports.jsxs(FormControlLabelRoot,_extends$1({className:clsx(ir.root,De),ownerState:Je,ref:Te},Ge,{children:[reactExports.cloneElement(Be,Qe),Ke?jsxRuntimeExports.jsxs(Stack,{display:"block",children:[ar,jsxRuntimeExports.jsxs(AsteriskComponent$1,{ownerState:Je,"aria-hidden":!0,className:ir.asterisk,children:["â","*"]})]}):ar]}))});function getFormGroupUtilityClass(Ee){return generateUtilityClass("MuiFormGroup",Ee)}generateUtilityClasses("MuiFormGroup",["root","row","error"]);const _excluded$C=["className","row"],useUtilityClasses$y=Ee=>{const{classes:Re,row:Te,error:je}=Ee;return composeClasses({root:["root",Te&&"row",je&&"error"]},getFormGroupUtilityClass,Re)},FormGroupRoot=styled("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.row&&Re.row]}})(({ownerState:Ee})=>_extends$1({display:"flex",flexDirection:"column",flexWrap:"wrap"},Ee.row&&{flexDirection:"row"})),FormGroup=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiFormGroup"}),{className:Oe,row:Me=!1}=je,De=_objectWithoutPropertiesLoose(je,_excluded$C),$e=useFormControl(),Be=formControlState({props:je,muiFormControl:$e,states:["error"]}),Ue=_extends$1({},je,{row:Me,error:Be.error}),ze=useUtilityClasses$y(Ue);return jsxRuntimeExports.jsx(FormGroupRoot,_extends$1({className:clsx(ze.root,Oe),ownerState:Ue,ref:Te},De))});function getFormHelperTextUtilityClasses(Ee){return generateUtilityClass("MuiFormHelperText",Ee)}const formHelperTextClasses=generateUtilityClasses("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var _span$3;const _excluded$B=["children","className","component","disabled","error","filled","focused","margin","required","variant"],useUtilityClasses$x=Ee=>{const{classes:Re,contained:Te,size:je,disabled:Oe,error:Me,filled:De,focused:$e,required:Be}=Ee,Ue={root:["root",Oe&&"disabled",Me&&"error",je&&`size${capitalize$1(je)}`,Te&&"contained",$e&&"focused",De&&"filled",Be&&"required"]};return composeClasses(Ue,getFormHelperTextUtilityClasses,Re)},FormHelperTextRoot=styled("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.size&&Re[`size${capitalize$1(Te.size)}`],Te.contained&&Re.contained,Te.filled&&Re.filled]}})(({theme:Ee,ownerState:Re})=>_extends$1({color:(Ee.vars||Ee).palette.text.secondary},Ee.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${formHelperTextClasses.disabled}`]:{color:(Ee.vars||Ee).palette.text.disabled},[`&.${formHelperTextClasses.error}`]:{color:(Ee.vars||Ee).palette.error.main}},Re.size==="small"&&{marginTop:4},Re.contained&&{marginLeft:14,marginRight:14})),FormHelperText=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiFormHelperText"}),{children:Oe,className:Me,component:De="p"}=je,$e=_objectWithoutPropertiesLoose(je,_excluded$B),Be=useFormControl(),Ue=formControlState({props:je,muiFormControl:Be,states:["variant","size","disabled","error","filled","focused","required"]}),ze=_extends$1({},je,{component:De,contained:Ue.variant==="filled"||Ue.variant==="outlined",variant:Ue.variant,size:Ue.size,disabled:Ue.disabled,error:Ue.error,filled:Ue.filled,focused:Ue.focused,required:Ue.required}),We=useUtilityClasses$x(ze);return jsxRuntimeExports.jsx(FormHelperTextRoot,_extends$1({as:De,ownerState:ze,className:clsx(We.root,Me),ref:Te},$e,{children:Oe===" "?_span$3||(_span$3=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"â"})):Oe}))});function getFormLabelUtilityClasses(Ee){return generateUtilityClass("MuiFormLabel",Ee)}const formLabelClasses=generateUtilityClasses("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),_excluded$A=["children","className","color","component","disabled","error","filled","focused","required"],useUtilityClasses$w=Ee=>{const{classes:Re,color:Te,focused:je,disabled:Oe,error:Me,filled:De,required:$e}=Ee,Be={root:["root",`color${capitalize$1(Te)}`,Oe&&"disabled",Me&&"error",De&&"filled",je&&"focused",$e&&"required"],asterisk:["asterisk",Me&&"error"]};return composeClasses(Be,getFormLabelUtilityClasses,Re)},FormLabelRoot=styled("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:Ee},Re)=>_extends$1({},Re.root,Ee.color==="secondary"&&Re.colorSecondary,Ee.filled&&Re.filled)})(({theme:Ee,ownerState:Re})=>_extends$1({color:(Ee.vars||Ee).palette.text.secondary},Ee.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${formLabelClasses.focused}`]:{color:(Ee.vars||Ee).palette[Re.color].main},[`&.${formLabelClasses.disabled}`]:{color:(Ee.vars||Ee).palette.text.disabled},[`&.${formLabelClasses.error}`]:{color:(Ee.vars||Ee).palette.error.main}})),AsteriskComponent=styled("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(Ee,Re)=>Re.asterisk})(({theme:Ee})=>({[`&.${formLabelClasses.error}`]:{color:(Ee.vars||Ee).palette.error.main}})),FormLabel=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiFormLabel"}),{children:Oe,className:Me,component:De="label"}=je,$e=_objectWithoutPropertiesLoose(je,_excluded$A),Be=useFormControl(),Ue=formControlState({props:je,muiFormControl:Be,states:["color","required","focused","disabled","error","filled"]}),ze=_extends$1({},je,{color:Ue.color||"primary",component:De,disabled:Ue.disabled,error:Ue.error,filled:Ue.filled,focused:Ue.focused,required:Ue.required}),We=useUtilityClasses$w(ze);return jsxRuntimeExports.jsxs(FormLabelRoot,_extends$1({as:De,ownerState:ze,className:clsx(We.root,Me),ref:Te},$e,{children:[Oe,Ue.required&&jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:ze,"aria-hidden":!0,
576className:We.asterisk,children:["â","*"]})]}))}),GridContext=reactExports.createContext();function getGridUtilityClass(Ee){return generateUtilityClass("MuiGrid",Ee)}const SPACINGS=[0,1,2,3,4,5,6,7,8,9,10],DIRECTIONS=["column-reverse","column","row-reverse","row"],WRAPS=["nowrap","wrap-reverse","wrap"],GRID_SIZES=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],gridClasses=generateUtilityClasses("MuiGrid",["root","container","item","zeroMinWidth",...SPACINGS.map(Ee=>`spacing-xs-${Ee}`),...DIRECTIONS.map(Ee=>`direction-xs-${Ee}`),...WRAPS.map(Ee=>`wrap-xs-${Ee}`),...GRID_SIZES.map(Ee=>`grid-xs-${Ee}`),...GRID_SIZES.map(Ee=>`grid-sm-${Ee}`),...GRID_SIZES.map(Ee=>`grid-md-${Ee}`),...GRID_SIZES.map(Ee=>`grid-lg-${Ee}`),...GRID_SIZES.map(Ee=>`grid-xl-${Ee}`)]),_excluded$z=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function getOffset(Ee){const Re=parseFloat(Ee);return`${Re}${String(Ee).replace(String(Re),"")||"px"}`}function generateGrid({theme:Ee,ownerState:Re}){let Te;return Ee.breakpoints.keys.reduce((je,Oe)=>{let Me={};if(Re[Oe]&&(Te=Re[Oe]),!Te)return je;if(Te===!0)Me={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(Te==="auto")Me={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const De=resolveBreakpointValues({values:Re.columns,breakpoints:Ee.breakpoints.values}),$e=typeof De=="object"?De[Oe]:De;if($e==null)return je;const Be=`${Math.round(Te/$e*1e8)/1e6}%`;let Ue={};if(Re.container&&Re.item&&Re.columnSpacing!==0){const ze=Ee.spacing(Re.columnSpacing);if(ze!=="0px"){const We=`calc(${Be} + ${getOffset(ze)})`;Ue={flexBasis:We,maxWidth:We}}}Me=_extends$1({flexBasis:Be,flexGrow:0,maxWidth:Be},Ue)}return Ee.breakpoints.values[Oe]===0?Object.assign(je,Me):je[Ee.breakpoints.up(Oe)]=Me,je},{})}function generateDirection({theme:Ee,ownerState:Re}){const Te=resolveBreakpointValues({values:Re.direction,breakpoints:Ee.breakpoints.values});return handleBreakpoints({theme:Ee},Te,je=>{const Oe={flexDirection:je};return je.indexOf("column")===0&&(Oe[`& > .${gridClasses.item}`]={maxWidth:"none"}),Oe})}function extractZeroValueBreakpointKeys({breakpoints:Ee,values:Re}){let Te="";Object.keys(Re).forEach(Oe=>{Te===""&&Re[Oe]!==0&&(Te=Oe)});const je=Object.keys(Ee).sort((Oe,Me)=>Ee[Oe]-Ee[Me]);return je.slice(0,je.indexOf(Te))}function generateRowGap({theme:Ee,ownerState:Re}){const{container:Te,rowSpacing:je}=Re;let Oe={};if(Te&&je!==0){const Me=resolveBreakpointValues({values:je,breakpoints:Ee.breakpoints.values});let De;typeof Me=="object"&&(De=extractZeroValueBreakpointKeys({breakpoints:Ee.breakpoints.values,values:Me})),Oe=handleBreakpoints({theme:Ee},Me,($e,Be)=>{var Ue;const ze=Ee.spacing($e);return ze!=="0px"?{marginTop:`-${getOffset(ze)}`,[`& > .${gridClasses.item}`]:{paddingTop:getOffset(ze)}}:(Ue=De)!=null&&Ue.includes(Be)?{}:{marginTop:0,[`& > .${gridClasses.item}`]:{paddingTop:0}}})}return Oe}function generateColumnGap({theme:Ee,ownerState:Re}){const{container:Te,columnSpacing:je}=Re;let Oe={};if(Te&&je!==0){const Me=resolveBreakpointValues({values:je,breakpoints:Ee.breakpoints.values});let De;typeof Me=="object"&&(De=extractZeroValueBreakpointKeys({breakpoints:Ee.breakpoints.values,values:Me})),Oe=handleBreakpoints({theme:Ee},Me,($e,Be)=>{var Ue;const ze=Ee.spacing($e);return ze!=="0px"?{width:`calc(100% + ${getOffset(ze)})`,marginLeft:`-${getOffset(ze)}`,[`& > .${gridClasses.item}`]:{paddingLeft:getOffset(ze)}}:(Ue=De)!=null&&Ue.includes(Be)?{}:{width:"100%",marginLeft:0,[`& > .${gridClasses.item}`]:{paddingLeft:0}}})}return Oe}function resolveSpacingStyles(Ee,Re,Te={}){if(!Ee||Ee<=0)return[];if(typeof Ee=="string"&&!Number.isNaN(Number(Ee))||typeof Ee=="number")return[Te[`spacing-xs-${String(Ee)}`]];const je=[];return Re.forEach(Oe=>{const Me=Ee[Oe];Number(Me)>0&&je.push(Te[`spacing-${Oe}-${String(Me)}`])}),je}const GridRoot=styled("div",{name:"MuiGrid",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee,{container:je,direction:Oe,item:Me,spacing:De,wrap:$e,zeroMinWidth:Be,breakpoints:Ue}=Te;let ze=[];je&&(ze=resolveSpacingStyles(De,Ue,Re));const We=[];return Ue.forEach(Xe=>{const He=Te[Xe];He&&We.push(Re[`grid-${Xe}-${String(He)}`])}),[Re.root,je&&Re.container,Me&&Re.item,Be&&Re.zeroMinWidth,...ze,Oe!=="row"&&Re[`direction-xs-${String(Oe)}`],$e!=="wrap"&&Re[`wrap-xs-${String($e)}`],...We]}})(({ownerState:Ee})=>_extends$1({boxSizing:"border-box"},Ee.container&&{display:"flex",flexWrap:"wrap",width:"100%"},Ee.item&&{margin:0},Ee.zeroMinWidth&&{minWidth:0},Ee.wrap!=="wrap"&&{flexWrap:Ee.wrap}),generateDirection,generateRowGap,generateColumnGap,generateGrid);function resolveSpacingClasses(Ee,Re){if(!Ee||Ee<=0)return[];if(typeof Ee=="string"&&!Number.isNaN(Number(Ee))||typeof Ee=="number")return[`spacing-xs-${String(Ee)}`];const Te=[];return Re.forEach(je=>{const Oe=Ee[je];if(Number(Oe)>0){const Me=`spacing-${je}-${String(Oe)}`;Te.push(Me)}}),Te}const useUtilityClasses$v=Ee=>{const{classes:Re,container:Te,direction:je,item:Oe,spacing:Me,wrap:De,zeroMinWidth:$e,breakpoints:Be}=Ee;let Ue=[];Te&&(Ue=resolveSpacingClasses(Me,Be));const ze=[];Be.forEach(Xe=>{const He=Ee[Xe];He&&ze.push(`grid-${Xe}-${String(He)}`)});const We={root:["root",Te&&"container",Oe&&"item",$e&&"zeroMinWidth",...Ue,je!=="row"&&`direction-xs-${String(je)}`,De!=="wrap"&&`wrap-xs-${String(De)}`,...ze]};return composeClasses(We,getGridUtilityClass,Re)},Grid=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiGrid"}),{breakpoints:Oe}=useTheme$1(),Me=extendSxProp(je),{className:De,columns:$e,columnSpacing:Be,component:Ue="div",container:ze=!1,direction:We="row",item:Xe=!1,rowSpacing:He,spacing:qe=0,wrap:Ge="wrap",zeroMinWidth:Ye=!1}
vendor: 5,519 bytes, line 576
576=Me,Ve=_objectWithoutPropertiesLoose(Me,_excluded$z),Ke=He||qe,Qe=Be||qe,Ze=reactExports.useContext(GridContext),Je=ze?$e||12:Ze,ir={},rr=_extends$1({},Ve);Oe.keys.forEach(pr=>{Ve[pr]!=null&&(ir[pr]=Ve[pr],delete rr[pr])});const ar=_extends$1({},Me,{columns:Je,container:ze,direction:We,item:Xe,rowSpacing:Ke,columnSpacing:Qe,wrap:Ge,zeroMinWidth:Ye,spacing:qe},ir,{breakpoints:Oe.keys}),or=useUtilityClasses$v(ar);return jsxRuntimeExports.jsx(GridContext.Provider,{value:Je,children:jsxRuntimeExports.jsx(GridRoot,_extends$1({ownerState:ar,className:clsx(or.root,De),as:Ue,ref:Te},rr))})}),_excluded$y=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function getScale(Ee){return`scale(${Ee}, ${Ee**2})`}const styles$1={entering:{opacity:1,transform:getScale(1)},entered:{opacity:1,transform:"none"}},isWebKit154=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Grow=reactExports.forwardRef(function(Re,Te){const{addEndListener:je,appear:Oe=!0,children:Me,easing:De,in:$e,onEnter:Be,onEntered:Ue,onEntering:ze,onExit:We,onExited:Xe,onExiting:He,style:qe,timeout:Ge="auto",TransitionComponent:Ye=Transition}=Re,Ve=_objectWithoutPropertiesLoose(Re,_excluded$y),Ke=useTimeout(),Qe=reactExports.useRef(),Ze=useTheme$1(),Je=reactExports.useRef(null),ir=useForkRef(Je,getReactElementRef(Me),Te),rr=xr=>Rr=>{if(xr){const br=Je.current;Rr===void 0?xr(br):xr(br,Rr)}},ar=rr(ze),or=rr((xr,Rr)=>{reflow(xr);const{duration:br,delay:wr,easing:vr}=getTransitionProps({style:qe,timeout:Ge,easing:De},{mode:"enter"});let Dr;Ge==="auto"?(Dr=Ze.transitions.getAutoHeightDuration(xr.clientHeight),Qe.current=Dr):Dr=br,xr.style.transition=[Ze.transitions.create("opacity",{duration:Dr,delay:wr}),Ze.transitions.create("transform",{duration:isWebKit154?Dr:Dr*.666,delay:wr,easing:vr})].join(","),Be&&Be(xr,Rr)}),pr=rr(Ue),tr=rr(He),nr=rr(xr=>{const{duration:Rr,delay:br,easing:wr}=getTransitionProps({style:qe,timeout:Ge,easing:De},{mode:"exit"});let vr;Ge==="auto"?(vr=Ze.transitions.getAutoHeightDuration(xr.clientHeight),Qe.current=vr):vr=Rr,xr.style.transition=[Ze.transitions.create("opacity",{duration:vr,delay:br}),Ze.transitions.create("transform",{duration:isWebKit154?vr:vr*.666,delay:isWebKit154?br:br||vr*.333,easing:wr})].join(","),xr.style.opacity=0,xr.style.transform=getScale(.75),We&&We(xr)}),hr=rr(Xe),sr=xr=>{Ge==="auto"&&Ke.start(Qe.current||0,xr),je&&je(Je.current,xr)};return jsxRuntimeExports.jsx(Ye,_extends$1({appear:Oe,in:$e,nodeRef:Je,onEnter:or,onEntered:pr,onEntering:ar,onExit:nr,onExited:hr,onExiting:tr,addEndListener:sr,timeout:Ge==="auto"?null:Ge},Ve,{children:(xr,Rr)=>reactExports.cloneElement(Me,_extends$1({style:_extends$1({opacity:0,transform:getScale(.75),visibility:xr==="exited"&&!$e?"hidden":void 0},styles$1[xr],qe,Me.props.style),ref:ir},Rr))}))});Grow.muiSupportAuto=!0;const _excluded$x=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],useUtilityClasses$u=Ee=>{const{classes:Re,disableUnderline:Te}=Ee,Oe=composeClasses({root:["root",!Te&&"underline"],input:["input"]},getInputUtilityClass,Re);return _extends$1({},Re,Oe)},InputRoot=styled(InputBaseRoot,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiInput",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[...rootOverridesResolver(Ee,Re),!Te.disableUnderline&&Re.underline]}})(({theme:Ee,ownerState:Re})=>{let je=Ee.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return Ee.vars&&(je=`rgba(${Ee.vars.palette.common.onBackgroundChannel} / ${Ee.vars.opacity.inputUnderline})`),_extends$1({position:"relative"},Re.formControl&&{"label + &":{marginTop:16}},!Re.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(Ee.vars||Ee).palette[Re.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:Ee.transitions.create("transform",{duration:Ee.transitions.duration.shorter,easing:Ee.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(Ee.vars||Ee).palette.error.main}},"&::before":{borderBottom:`1px solid ${je}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:Ee.transitions.create("border-bottom-color",{duration:Ee.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]:{borderBottom:`2px solid ${(Ee.vars||Ee).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${je}`}},[`&.${inputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}})}),InputInput=styled(InputBaseComponent,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input=reactExports.forwardRef(function(Re,Te){var je,Oe,Me,De;const $e=useDefaultProps({props:Re,name:"MuiInput"}),{disableUnderline:Be,components:Ue={},componentsProps:ze,fullWidth:We=!1,inputComponent:Xe="input",multiline:He=!1,slotProps:qe,slots:Ge={},type:Ye="text"}=$e,Ve=_objectWithoutPropertiesLoose($e,_excluded$x),Ke=useUtilityClasses$u($e),Ze={root:{ownerState:{disableUnderline:Be}}},Je=qe??ze?deepmerge$1(qe??ze,Ze):Ze,ir=(je=(Oe=Ge.root)!=null?Oe:Ue.Root)!=null?je:InputRoot,rr=(Me=(De=Ge.input)!=null?De:Ue.In
576put)!=null?Me:InputInput;return jsxRuntimeExports.jsx(InputBase,_extends$1({slots:{root:ir,input:rr},slotProps:Je,fullWidth:We,inputComponent:Xe,multiline:He,ref:Te,type:Ye},Ve,{classes:Ke}))});Input.muiName="Input";function getInputAdornmentUtilityClass(Ee){return generateUtilityClass("MuiInputAdornment",Ee)}const inputAdornmentClasses=generateUtilityClasses("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var _span$2;const _excluded$w=["children","className","component","disablePointerEvents","disableTypography","position","variant"],overridesResolver$3=(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[`position${capitalize$1(Te.position)}`],Te.disablePointerEvents===!0&&Re.disablePointerEvents,Re[Te.variant]]},useUtilityClasses$t=Ee=>{const{classes:Re,disablePointerEvents:Te,hiddenLabel:je,position:Oe,size:Me,variant:De}=Ee,$e={root:["root",Te&&"disablePointerEvents",Oe&&`position${capitalize$1(Oe)}`,De,je&&"hiddenLabel",Me&&`size${capitalize$1(Me)}`]};return composeClasses($e,getInputAdornmentUtilityClass,Re)},InputAdornmentRoot=styled("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:overridesResolver$3})(({theme:Ee,ownerState:Re})=>_extends$1({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(Ee.vars||Ee).palette.action.active},Re.variant==="filled"&&{[`&.${inputAdornmentClasses.positionStart}&:not(.${inputAdornmentClasses.hiddenLabel})`]:{marginTop:16}},Re.position==="start"&&{marginRight:8},Re.position==="end"&&{marginLeft:8},Re.disablePointerEvents===!0&&{pointerEvents:"none"})),InputAdornment=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiInputAdornment"}),{children:Oe,className:Me,component:De="div",disablePointerEvents:$e=!1,disableTypography:Be=!1,position:Ue,variant:ze}=je,We=_objectWithoutPropertiesLoose(je,_excluded$w),Xe=useFormControl()||{};let He=ze;ze&&Xe.variant,Xe&&!He&&(He=Xe.variant);const qe=_extends$1({},je,{hiddenLabel:Xe.hiddenLabel,size:Xe.size,disablePointerEvents:$e,position:Ue,variant:He}),Ge=useUtilityClasses$t(qe);return jsxRuntimeExports.jsx(FormControlContext.Provider,{value:null,children:jsxRuntimeExports.jsx(InputAdornmentRoot,_extends$1({as:De,ownerState:qe,className:clsx(Ge.root,Me),ref:Te},We,{children:typeof Oe=="string"&&!Be?jsxRuntimeExports.jsx(Typography,{color:"text.secondary",children:Oe}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Ue==="start"?_span$2||(_span$2=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"â"})):null,Oe]})}))})});function getInputLabelUtilityClasses(Ee){return generateUtilityClass("MuiInputLabel",Ee)}generateUtilityClasses("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const _excluded$v=["disableAnimation","margin","shrink","variant","className"],useUtilityClasses$s=Ee=>{const{classes:Re,formControl:Te,size:je,shrink:Oe,disableAnimation:Me,variant:De,required:$e}=Ee,Be={root:["root",Te&&"formControl",!Me&&"animated",Oe&&"shrink",je&&je!=="normal"&&`size${capitalize$1(je)}`,De],asterisk:[$e&&"asterisk"]},Ue=composeClasses(Be,getInputLabelUtilityClasses,Re);return _extends$1({},Re,Ue)},InputLabelRoot=styled(FormLabel,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[{[`& .${formLabelClasses.asterisk}`]:Re.asterisk},Re.root,Te.formControl&&Re.formControl,Te.size==="small"&&Re.sizeSmall,Te.shrink&&Re.shrink,!Te.disableAnimation&&Re.animated,Te.focused&&Re.focused,Re[Te.variant]]}})(({theme:Ee,ownerState:Re})=>_extends$1({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},Re.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},Re.size==="small"&&{transform:"translate(0, 17px) scale(1)"},Re.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!Re.disableAnimation&&{transition:Ee.transitions.create(["color","transform","max-width"],{duration:Ee.transitions.duration.shorter,easing:Ee.transitions.easing.easeOut})},Re.variant==="filled"&&_extends$1({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},Re.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},Re.shrink&&_extends$1({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7
576px) scale(0.75)",maxWidth:"calc(133% - 24px)"},Re.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),Re.variant==="outlined"&&_extends$1({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},Re.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},Re.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),InputLabel=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({name:"MuiInputLabel",props:Re}),{disableAnimation:Oe=!1,shrink:Me,className:De}=je,$e=_objectWithoutPropertiesLoose(je,_excluded$v),Be=useFormControl();let Ue=Me;typeof Ue>"u"&&Be&&(Ue=Be.filled||Be.focused||Be.adornedStart);const ze=formControlState({props:je,muiFormControl:Be,states:["size","variant","required","focused"]}),We=_extends$1({},je,{disableAnimation:Oe,formControl:Be,shrink:Ue,size:ze.size,variant:ze.variant,required:ze.required,focused:ze.focused}),Xe=useUtilityClasses$s(We);return jsxRuntimeExports.jsx(InputLabelRoot,_extends$1({"data-shrink":Ue,ownerState:We,ref:Te,className:clsx(Xe.root,De)},$e,{classes:Xe}))});function getLinearProgressUtilityClass(Ee){return generateUtilityClass("MuiLinearProgress",Ee)}generateUtilityClasses("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const _excluded$u=["className","color","value","valueBuffer","variant"];let _$1=Ee=>Ee,_t,_t2,_t3,_t4,_t5,_t6;const TRANSITION_DURATION=4,indeterminate1Keyframe=keyframes(_t||(_t=_$1` 577 0% { 578 left: -35%; 579 right: 100%; 580 } 581 582 60% { 583 left: 100%; 584 right: -90%; 585 } 586 587 100% { 588 left: 100%; 589 right: -90%; 590 } 591`)),indeterminate2Keyframe=keyframes(_t2||(_t2=_$1` 592 0% { 593 left: -200%; 594 right: 100%; 595 } 596 597 60% { 598 left: 107%; 599 right: -8%; 600 } 601 602 100% { 603 left: 107%; 604 right: -8%; 605 } 606`)),bufferKeyframe=keyframes(_t3||(_t3=_$1` 607 0% { 608 opacity: 1; 609 background-position: 0 -23px; 610 } 611 612 60% { 613 opacity: 0; 614 background-position: 0 -23px; 615 } 616 617 100% { 618 opacity: 1; 619 background-position: -200px -23px; 620 } 621`)),useUtilityClasses$r=Ee=>{const{classes:Re,variant:Te,color:je}=Ee,Oe={root:["root",`color${capitalize$1(je)}`,Te],dashed:["dashed",`dashedColor${capitalize$1(je)}`],bar1:["bar",`barColor${capitalize$1(je)}`,(Te==="indeterminate"||Te==="query")&&"bar1Indeterminate",Te==="determinate"&&"bar1Determinate",Te==="buffer"&&"bar1Buffer"],bar2:["bar",Te!=="buffer"&&`barColor${capitalize$1(je)}`,Te==="buffer"&&`color${capitalize$1(je)}`,(Te==="indeterminate"||Te==="query")&&"bar2Indeterminate",Te==="buffer"&&"bar2Buffer"]};return composeClasses(Oe,getLinearProgressUtilityClass,Re)},getColorShade=(Ee,Re)=>Re==="inherit"?"currentColor":Ee.vars?Ee.vars.palette.LinearProgress[`${Re}Bg`]:Ee.palette.mode==="light"?lighten_1(Ee.palette[Re].main,.62):darken_1(Ee.palette[Re].main,.5),LinearProgressRoot=styled("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[`color${capitalize$1(Te.color)}`],Re[Te.variant]]}})(({ownerState:Ee,theme:Re})=>_extends$1({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:getColorShade(Re,Ee.color)},Ee.color==="inherit"&&Ee.variant!=="buffer"&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},Ee.variant==="buffer"&&{backgroundColor:"transparent"},Ee.variant==="query"&&{transform:"rotate(180deg)"})),LinearProgressDashed=styled("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.dashed,Re[`dashedColor${capitalize$1(Te.color)}`]]}})(({ownerState:Ee,theme:Re})=>{const Te=getColorShade(Re,Ee.color);return _extends$1({position:"absolute",marginTop:0,height:"100%",width:"100%"},Ee.color==="inherit"&&{opacity:.3},{backgroundImage:`radial-gradient(${Te} 0%, ${Te} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},css(_t4||(_t4=_$1` 622 animation: ${0} 3s infinite linear; 623 `),bufferKeyframe)),LinearProgressBar1=styled("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.bar,Re[`barColor${capitalize$1(Te.color)}`],(Te.variant==="indeterminate"||Te.variant==="query")&&Re.bar1Indeterminate,Te.variant==="determinate"&&Re.bar1Determinate,Te.variant==="buffer"&&Re.bar1Buffer]}})(({ownerState:Ee,theme:Re})=>_extends$1({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:Ee.color==="inherit"?"currentColor":(Re.vars||Re).palette[Ee.color].main},Ee.variant==="determinate"&&{transition:`transform .${TRANSITION_DURATION}s linear`},Ee.variant==="buffer"&&{zIndex:1,transition:`transform .${TRANSITION_DURATION}s linear`}),({ownerState:Ee})=>(Ee.variant==="indeterminate"||Ee.variant==="query")&&css(_t5||(_t5=_$1` 624 width: auto; 625 animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; 626 `),indeterminate1Keyframe)),LinearProgressBar2=styled("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.bar,Re[`barColor${capitalize$1(Te.color)}`],(Te.variant==="indeterminate"||Te.variant==="query")&&Re.bar2Indeterminate,Te.variant==="buffer"&&Re.bar2Buffer]}})(({ownerState:Ee,theme:Re})=>_extends$1({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},Ee.variant!=="buffer"&&{backgroundColor:Ee.color==="inherit"?"currentColor":(Re.vars||Re).palette[Ee.color].main},Ee.color==="inherit"&&{opacity:.3},Ee.variant==="buffer"&&{backgroundColor:getColorShade(Re,Ee.color),transition:`transform .${TRANSITION_DURATION}s linear`}),({ownerState:Ee})=>(Ee.variant==="indeterminate"||Ee.variant==="query")&&css(_t6||(_t6=_$1` 627 width: auto; 628 animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; 629 `),indeterminate2Keyframe)),LinearProgress=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiLinearProgress"}),{className:Oe,color:Me="primary",value:De,valueBuffer:$e,variant:Be="indeterminate"}=je,Ue=_objectWithoutPropertiesLoose(je,_excluded$u),ze=_extends$1({},je,{color:Me,variant:Be}),We=useUtilityClasses$r(ze),Xe=useRtl(),He={},qe={bar1:{},bar2:{}};if((Be==="determinate"||Be==="buffer")&&De!==void 0){He["aria-valuenow"]=Math.round(De),He["aria-valuemin"]=0,He["aria-valuemax"]=100;let Ge=De-100;Xe&&(Ge=-Ge),qe.bar1.transform=`translateX(${Ge}%)`}if(Be==="buffer"&&$e!==void 0){let Ge=($e||0)-100;Xe&&(Ge=-Ge),qe.bar2.transform=`translateX(${Ge}%)`}return jsxRuntimeExports.jsxs(LinearProgressRoot,_extends$1({className:clsx(We.root,Oe),ownerState:ze,role:"progressbar"},He,{ref:Te},Ue,{children:[Be==="buffer"?jsxRuntimeExports.jsx(LinearProgressDashed,{className:We.dashed,ownerState:ze}):null,jsxRuntimeExports.jsx(LinearProgressBar1,{className:We.bar1,ownerState:ze,style:qe.bar1}),Be==="determinate"?null:jsxRuntimeExports.jsx(LinearProgressBar2,{className:We.bar2,ownerState:ze,style:qe.bar2})]}))});function getLinkUtilityClass(Ee){return generateUtilityClass("MuiLink",Ee)}const linkClasses=generateUtilityClasses("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),colorTransformations={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},transformDeprecatedColors=Ee=>colorTransformations[Ee]||Ee,getTextDecoration=({theme:Ee,ownerState:Re})=>{const Te=transformDeprecatedColors(Re.color),je=getPath(Ee,`palette.${Te}`,!1)||Re.color,Oe=getPath(Ee,`palette.${Te}Channel`);return"vars"in Ee&&Oe?`rgba(${Oe} / 0.4)`:alpha_1(je,.4)},_excluded$t=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],useUtilityClasses$q=Ee=>{const{classes:Re,component:Te,focusVisible:je,underline:Oe}=Ee,Me={root:["root",`underline${capitalize$1(Oe)}`,Te==="button"&&"button",je&&"focusVisible"]};return composeClasses(Me,getLinkUtilityClass,Re)},LinkRoot=styled(Typography,{name:"MuiLink",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[`underline${capitalize$1(Te.underline)}`],Te.component==="button"&&Re.button]}})(({theme:Ee,ownerState:Re})=>_extends$1({},Re.underline==="none"&&{textDecoration:"none"},Re.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},Re.underline==="always"&&_extends$1({textDecoration:"underline"},Re.color!=="inherit"&&{textDecorationColor:getTextDecoration({theme:Ee,ownerState:Re})},{"&:hover":{textDecorationColor:"inherit"}}),Re.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${linkClasses.focusVisible}`]:{outline:"auto"}})),Link=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiLink"}),{className:Oe,color:Me="primary",component:De="a",onBlur:$e,onFocus:Be,TypographyClasses:Ue,underline:ze="always",variant:We="inherit",sx:Xe}=je,He=_objectWithoutPropertiesLoose(je,_excluded$t),{isFocusVisibleRef:qe,onBlur:Ge,onFocus:Ye,ref:Ve}=useIsFocusVisible(),[Ke,Qe]=reactExports.useState(!1),Ze=useForkRef(Te,Ve),Je=or=>{Ge(or),qe.current===!1&&Qe(!1),$e&&$e(or)},ir=or=>{Ye(or),qe.current===!0&&Qe(!0),Be&&Be(or)},rr=_extends$1({},je,{color:Me,component:De,focusVisible:Ke,underline:ze,variant:We}),ar=useUtilityClasses$q(rr);return jsxRuntimeExports.jsx(LinkRoot,_extends$1({color:Me,className:clsx(ar.root,Oe),classes:Ue,component:De,onBlur:Je,onFocus:ir,ref:Ze,ownerState:rr,variant:We,sx:[...Object.keys(colorTransformations).includes(Me)?[]:[{color:Me}],...Array.isArray(Xe)?Xe:[Xe]]},He))}),ListContext=reactExports.createContext({});function getListUtilityClass(Ee){return generateUtilityClass("MuiList",Ee)}generateUtilityClasses("MuiList",["root","padding","dense","subheader"]);const _excluded$s=["children","className","component","dense","disablePadding","subheader"],useUtilityClasses$p=Ee=>
vendor: 8,326 bytes, line 629
629{const{classes:Re,disablePadding:Te,dense:je,subheader:Oe}=Ee;return composeClasses({root:["root",!Te&&"padding",je&&"dense",Oe&&"subheader"]},getListUtilityClass,Re)},ListRoot=styled("ul",{name:"MuiList",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,!Te.disablePadding&&Re.padding,Te.dense&&Re.dense,Te.subheader&&Re.subheader]}})(({ownerState:Ee})=>_extends$1({listStyle:"none",margin:0,padding:0,position:"relative"},!Ee.disablePadding&&{paddingTop:8,paddingBottom:8},Ee.subheader&&{paddingTop:0})),List=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiList"}),{children:Oe,className:Me,component:De="ul",dense:$e=!1,disablePadding:Be=!1,subheader:Ue}=je,ze=_objectWithoutPropertiesLoose(je,_excluded$s),We=reactExports.useMemo(()=>({dense:$e}),[$e]),Xe=_extends$1({},je,{component:De,dense:$e,disablePadding:Be}),He=useUtilityClasses$p(Xe);return jsxRuntimeExports.jsx(ListContext.Provider,{value:We,children:jsxRuntimeExports.jsxs(ListRoot,_extends$1({as:De,className:clsx(He.root,Me),ref:Te,ownerState:Xe},ze,{children:[Ue,Oe]}))})});function getListItemUtilityClass(Ee){return generateUtilityClass("MuiListItem",Ee)}const listItemClasses=generateUtilityClasses("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]);function getListItemButtonUtilityClass(Ee){return generateUtilityClass("MuiListItemButton",Ee)}const listItemButtonClasses=generateUtilityClasses("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),_excluded$r=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],overridesResolver$2=(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.dense&&Re.dense,Te.alignItems==="flex-start"&&Re.alignItemsFlexStart,Te.divider&&Re.divider,!Te.disableGutters&&Re.gutters]},useUtilityClasses$o=Ee=>{const{alignItems:Re,classes:Te,dense:je,disabled:Oe,disableGutters:Me,divider:De,selected:$e}=Ee,Ue=composeClasses({root:["root",je&&"dense",!Me&&"gutters",De&&"divider",Oe&&"disabled",Re==="flex-start"&&"alignItemsFlexStart",$e&&"selected"]},getListItemButtonUtilityClass,Te);return _extends$1({},Te,Ue)},ListItemButtonRoot=styled(ButtonBase,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:overridesResolver$2})(({theme:Ee,ownerState:Re})=>_extends$1({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:Ee.transitions.create("background-color",{duration:Ee.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(Ee.vars||Ee).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${listItemButtonClasses.selected}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / ${Ee.vars.palette.action.selectedOpacity})`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity),[`&.${listItemButtonClasses.focusVisible}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.focusOpacity}))`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity+Ee.palette.action.focusOpacity)}},[`&.${listItemButtonClasses.selected}:hover`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.hoverOpacity}))`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity+Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / ${Ee.vars.palette.action.selectedOpacity})`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity)}},[`&.${listItemButtonClasses.focusVisible}`]:{backgroundColor:(Ee.vars||Ee).palette.action.focus},[`&.${listItemButtonClasses.disabled}`]:{opacity:(Ee.vars||Ee).palette.action.disabledOpacity}},Re.divider&&{borderBottom:`1px solid ${(Ee.vars||Ee).palette.divider}`,backgroundClip:"padding-box"},Re.alignItems==="flex-start"&&{alignItems:"flex-start"},!Re.disableGutters&&{paddingLeft:16,paddingRight:16},Re.dense&&{paddingTop:4,paddingBottom:4})),ListItemButton=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiListItemButton"}),{alignItems:Oe="center",autoFocus:Me=!1,component:De="div",children:$e,dense:Be=!1,disableGutters:Ue=!1,divider:ze=!1,focusVisibleClassName:We,selected:Xe=!1,className:He}=je,qe=_objectWithoutPropertiesLoose(je,_excluded$r),Ge=reactExports.useContext(ListContext),Ye=reactExports.useMemo(()=>({dense:Be||Ge.dense||!1,alignItems:Oe,disableGutters:Ue}),[Oe,Ge.dense,Be,Ue]),Ve=reactExports.useRef(null);useEnhancedEffect(()=>{Me&&Ve.current&&Ve.current.focus()},[Me]);const Ke=_extends$1({},je,{alignItems:Oe,dense:Ye.dense,disableGutters:Ue,divider:ze,selected:Xe}),Qe=useUtilityClasses$o(Ke),Ze=useForkRef(Ve,Te);return jsxRuntimeExports.jsx(ListContext.Provider,{value:Ye,children:jsxRuntimeExports.jsx(ListItemButtonRoot,_extends$1({ref:Ze,href:qe.href||qe.to,component:(qe.href||qe.to)&&De==="div"?"button":De,focusVisibleClassName:clsx(Qe.focusVisible,We),ownerState:Ke,className:clsx(Qe.root,He)},qe,{classes:Qe,children:$e}))})});function getListItemSecondaryActionClassesUtilityClass(Ee){return generateUtilityClass("MuiListItemSecondaryAction",Ee)}generateUtilityClasses("MuiListItemSecondaryAction",["root","disableGutters"]);const _excluded$q=["className"],useUtilityClasses$n=Ee=>{const{disableGutters:Re,classes:Te}=Ee;return composeClasses({root:["root",Re&&"disableGutters"]},getListItemSecondaryActionClassesUtilityClass,Te)},ListItemSecondaryActionRoot=styled("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.disableGutters&&Re.disableGutters]}})(({ownerState:Ee})=>_extends$1({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},Ee.disableGutters&&{right:0})),ListItemSecondaryAction=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiListItemSecondaryAction"}),{className:Oe}=je,Me=_objectWithoutPropertiesLoose(je,_excluded$q),De=reactExports.useContext(ListContext),$e=_extends$1({},je,{disableGutters:De.disableGutters}),Be=useUtilityClasses$n($e);return jsxRuntimeExports.jsx(ListItemSecondaryActionRoot,_extends$1({className:clsx(Be.root,Oe),ownerState:$e,ref:Te},Me))});ListItemSecondaryAction.muiName="ListItemSecondaryAction";const _excluded$p=["className"],_excluded2$5=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],overridesResolver$1=(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.dense&&Re.dense,Te.alignItems==="flex-start"&&Re.alignItemsFlexStart,Te.divider&&Re.divider,!Te.disableGutters&&Re.gutters,!Te.disablePadding&&Re.padding,Te.button&&Re.button,Te.hasSecondaryAction&&Re.secondaryAction]},useUtilityClasses$m=Ee=>{const{alignItems:Re,button:Te,classes:je,dense:Oe,disabled:Me,disableGutters:De,disablePadding:$e,divider:Be,hasSecondaryAction:Ue,selected:ze}=Ee;return composeClasses({root:["root",Oe&&"dense",!De&&"gutters",!$e&&"padding",Be&&"divider",Me&&"disabled",Te&&"button",Re==="flex-start"&&"alignItemsFlexStart",Ue&&"secondaryAction",ze&&"selected"],container:["container"]},getListItemUtilityClass,je)},ListItemRoot=styled("div",{name:"MuiListItem",slot:"Root",overridesResolver:overridesResolver$1})(({theme:Ee,ownerState:Re})=>_extends$1({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!Re.disablePadding&&_extends$1({paddingTop:8,paddingBottom:8},Re.dense&&{paddingTop:4,paddingBottom:4},!Re.disableGutters&&{paddingLeft:16,paddingRight:16},!!Re.secondaryAction&&{paddingRight:48}),!!Re.secondaryAction&&{[`& >
629 .${listItemButtonClasses.root}`]:{paddingRight:48}},{[`&.${listItemClasses.focusVisible}`]:{backgroundColor:(Ee.vars||Ee).palette.action.focus},[`&.${listItemClasses.selected}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / ${Ee.vars.palette.action.selectedOpacity})`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity),[`&.${listItemClasses.focusVisible}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.focusOpacity}))`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity+Ee.palette.action.focusOpacity)}},[`&.${listItemClasses.disabled}`]:{opacity:(Ee.vars||Ee).palette.action.disabledOpacity}},Re.alignItems==="flex-start"&&{alignItems:"flex-start"},Re.divider&&{borderBottom:`1px solid ${(Ee.vars||Ee).palette.divider}`,backgroundClip:"padding-box"},Re.button&&{transition:Ee.transitions.create("background-color",{duration:Ee.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(Ee.vars||Ee).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${listItemClasses.selected}:hover`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.hoverOpacity}))`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity+Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / ${Ee.vars.palette.action.selectedOpacity})`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity)}}},Re.hasSecondaryAction&&{paddingRight:48})),ListItemContainer=styled("li",{name:"MuiListItem",slot:"Container",overridesResolver:(Ee,Re)=>Re.container})({position:"relative"}),ListItem=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiListItem"}),{alignItems:Oe="center",autoFocus:Me=!1,button:De=!1,children:$e,className:Be,component:Ue,components:ze={},componentsProps:We={},ContainerComponent:Xe="li",ContainerProps:{className:He}={},dense:qe=!1,disabled:Ge=!1,disableGutters:Ye=!1,disablePadding:Ve=!1,divider:Ke=!1,focusVisibleClassName:Qe,secondaryAction:Ze,selected:Je=!1,slotProps:ir={},slots:rr={}}=je,ar=_objectWithoutPropertiesLoose(je.ContainerProps,_excluded$p),or=_objectWithoutPropertiesLoose(je,_excluded2$5),pr=reactExports.useContext(ListContext),tr=reactExports.useMemo(()=>({dense:qe||pr.dense||!1,alignItems:Oe,disableGutters:Ye}),[Oe,pr.dense,qe,Ye]),nr=reactExports.useRef(null);useEnhancedEffect(()=>{Me&&nr.current&&nr.current.focus()},[Me]);const hr=reactExports.Children.toArray($e),sr=hr.length&&isMuiElement(hr[hr.length-1],["ListItemSecondaryAction"]),xr=_extends$1({},je,{alignItems:Oe,autoFocus:Me,button:De,dense:tr.dense,disabled:Ge,disableGutters:Ye,disablePadding:Ve,divider:Ke,hasSecondaryAction:sr,selected:Je}),Rr=useUtilityClasses$m(xr),br=useForkRef(nr,Te),wr=rr.root||ze.Root||ListItemRoot,vr=ir.root||We.root||{},Dr=_extends$1({className:clsx(Rr.root,vr.className,Be),disabled:Ge},or);let kr=Ue||"li";return De&&(Dr.component=Ue||"div",Dr.focusVisibleClassName=clsx(listItemClasses.focusVisible,Qe),kr=ButtonBase),sr?(kr=!Dr.component&&!Ue?"div":kr,Xe==="li"&&(kr==="li"?kr="div":Dr.component==="li"&&(Dr.component="div")),jsxRuntimeExports.jsx(ListContext.Provider,{value:tr,children:jsxRuntimeExports.jsxs(ListItemContainer,_extends$1({as:Xe,className:clsx(Rr.container,He),ref:br,ownerState:xr},ar,{children:[jsxRuntimeExports.jsx(wr,_extends$1({},vr,!isHostComponent(wr)&&{as:kr,ownerState:_extends$1({},xr,vr.ownerState)},Dr,{children:hr})),hr.pop()]}))})):jsxRuntimeExports.jsx(ListContext.Provider,{value:tr,children:jsxRuntimeExports.jsxs(wr,_extends$1({},vr,{as:kr,ref:br},!isHostComponent(wr)&&{ownerState:_extends$1({},xr,vr.ownerState)},Dr,{children:[hr,Ze&&jsxRuntimeExports.jsx(ListItemSecondaryAction,{children:Ze})]}))})});function getListItemIconUtilityClass(Ee){return generateUtilityClass("MuiListItemIcon",Ee)}const listItemIconClasses=generateUtilityClasses("MuiListItemIcon",["root","alignItemsFlexStart"]),_excluded$o=["className"],useUtilityClasses$l=Ee=>{const{alignItems:Re,classes:Te}=Ee;return composeClasses({root:["root",Re==="flex-start"&&"alignItemsFlexStart"]},getListItemIconUtilityClass,Te)},ListItemIconRoot=styled("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.alignItems==="flex-start"&&Re.alignItemsFlexStart]}})(({theme:Ee,ownerState:Re})=>_extends$1({minWidth:56,color:(Ee.vars||Ee).palette.action.active,flexShrink:0,display:"inline-flex"},Re.alignItems==="flex-start"&&{marginTop:8})),ListItemIcon=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiListItemIcon"}),{className:Oe}=je,Me=_objectWithoutPropertiesLoose(je,_excluded$o),De=reactExports.useContext(ListContext),$e=_extends$1({},je,{alignItems:De.alignItems}),Be=useUtilityClasses$l($e);return jsxRuntimeExports.jsx(ListItemIconRoot,_extends$1({className:clsx(Be.root,Oe),ownerState:$e,ref:Te},Me))});function getListItemTextUtilityClass(Ee){return generateUtilityClass("MuiListItemText",Ee)}const listItemTextClasses=generateUtilityClasses("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),_excluded$n=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],useUtilityClasses$k=Ee=>{const{classes:Re,inset:Te,primary:je,secondary:Oe,dense:Me}=Ee;return composeClasses({root:["root",Te&&"inset",Me&&"dense",je&&Oe&&"multiline"],primary:["primary"],secondary:["secondary"]},getListItemTextUtilityClass,Re)},ListItemTextRoot=styled("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[{[`& .${listItemTextClasses.primary}`]:Re.primary},{[`& .${listItemTextClasses.secondary}`]:Re.secondary},Re.root,Te.inset&&Re.inset,Te.primary&&Te.secondary&&Re.multiline,Te.dense&&Re.dense]}})(({ownerState:Ee})=>_extends$1({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},Ee.primary&&Ee.secondary&&{marginTop:6,marginBottom:6},Ee.inset&&{paddingLeft:56})),ListItemText=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiListItemText"}),{children:Oe,className:Me,disableTypography:De=!1,inset:$e=!1,primary:Be,primaryTypographyProps:Ue,secondary:ze,secondaryTypographyProps:We}=je,Xe=_objectWithoutPropertiesLoose(je,_excluded$n),{dense:He}=reactExports.useContext(ListContext);let qe=Be??Oe,Ge=ze;const Ye=_extends$1({},je,{disableTypography:De,inset:$e,primary:!!qe,secondary:!!Ge,dense:He}),Ve=useUtilityClasses$k(Ye);return qe!=null&&qe.type!==Typography&&!De&&(qe=jsxRuntimeExports.jsx(Typography,_extends$1({variant:He?"body2":"body1",className:Ve.primary,component:Ue!=null&&Ue.variant?void 0:"span",display:"block"},Ue,{children:qe}))),Ge!=null&&Ge.type!==Typography&&!De&&(Ge=jsxRuntimeExports.jsx(Typography,_extends$1({variant:"body2",className:Ve.secondary,color:"text.secondary",display:"block"},We,{children:Ge}))),jsxRuntimeExports.jsxs(ListItemTextRoot,_extends$1({className:clsx(Ve.root,Me),ownerState:Ye,ref:Te},Xe,{children:[qe,Ge]}))}),_excluded$m=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function nextItem$1(Ee,Re,Te){return Ee===Re?Ee.firstChild:Re&&Re.nextElementSibling?Re.nextElementSibling:Te?null:Ee.firstChild}function previousItem$1(Ee,Re,Te){return Ee===Re?Te?Ee.firstChild:Ee.last
vendor: 5,369 bytes, line 629
629Child:Re&&Re.previousElementSibling?Re.previousElementSibling:Te?null:Ee.lastChild}function textCriteriaMatches(Ee,Re){if(Re===void 0)return!0;let Te=Ee.innerText;return Te===void 0&&(Te=Ee.textContent),Te=Te.trim().toLowerCase(),Te.length===0?!1:Re.repeating?Te[0]===Re.keys[0]:Te.indexOf(Re.keys.join(""))===0}function moveFocus$1(Ee,Re,Te,je,Oe,Me){let De=!1,$e=Oe(Ee,Re,Re?Te:!1);for(;$e;){if($e===Ee.firstChild){if(De)return!1;De=!0}const Be=je?!1:$e.disabled||$e.getAttribute("aria-disabled")==="true";if(!$e.hasAttribute("tabindex")||!textCriteriaMatches($e,Me)||Be)$e=Oe(Ee,$e,Te);else return $e.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(Re,Te){const{actions:je,autoFocus:Oe=!1,autoFocusItem:Me=!1,children:De,className:$e,disabledItemsFocusable:Be=!1,disableListWrap:Ue=!1,onKeyDown:ze,variant:We="selectedMenu"}=Re,Xe=_objectWithoutPropertiesLoose(Re,_excluded$m),He=reactExports.useRef(null),qe=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect(()=>{Oe&&He.current.focus()},[Oe]),reactExports.useImperativeHandle(je,()=>({adjustStyleForScrollbar:(Qe,{direction:Ze})=>{const Je=!He.current.style.width;if(Qe.clientHeight<He.current.clientHeight&&Je){const ir=`${getScrollbarSize(ownerDocument(Qe))}px`;He.current.style[Ze==="rtl"?"paddingLeft":"paddingRight"]=ir,He.current.style.width=`calc(100% + ${ir})`}return He.current}}),[]);const Ge=Qe=>{const Ze=He.current,Je=Qe.key,ir=ownerDocument(Ze).activeElement;if(Je==="ArrowDown")Qe.preventDefault(),moveFocus$1(Ze,ir,Ue,Be,nextItem$1);else if(Je==="ArrowUp")Qe.preventDefault(),moveFocus$1(Ze,ir,Ue,Be,previousItem$1);else if(Je==="Home")Qe.preventDefault(),moveFocus$1(Ze,null,Ue,Be,nextItem$1);else if(Je==="End")Qe.preventDefault(),moveFocus$1(Ze,null,Ue,Be,previousItem$1);else if(Je.length===1){const rr=qe.current,ar=Je.toLowerCase(),or=performance.now();rr.keys.length>0&&(or-rr.lastTime>500?(rr.keys=[],rr.repeating=!0,rr.previousKeyMatched=!0):rr.repeating&&ar!==rr.keys[0]&&(rr.repeating=!1)),rr.lastTime=or,rr.keys.push(ar);const pr=ir&&!rr.repeating&&textCriteriaMatches(ir,rr);rr.previousKeyMatched&&(pr||moveFocus$1(Ze,ir,!1,Be,nextItem$1,rr))?Qe.preventDefault():rr.previousKeyMatched=!1}ze&&ze(Qe)},Ye=useForkRef(He,Te);let Ve=-1;reactExports.Children.forEach(De,(Qe,Ze)=>{if(!reactExports.isValidElement(Qe)){Ve===Ze&&(Ve+=1,Ve>=De.length&&(Ve=-1));return}Qe.props.disabled||(We==="selectedMenu"&&Qe.props.selected||Ve===-1)&&(Ve=Ze),Ve===Ze&&(Qe.props.disabled||Qe.props.muiSkipListHighlight||Qe.type.muiSkipListHighlight)&&(Ve+=1,Ve>=De.length&&(Ve=-1))});const Ke=reactExports.Children.map(De,(Qe,Ze)=>{if(Ze===Ve){const Je={};return Me&&(Je.autoFocus=!0),Qe.props.tabIndex===void 0&&We==="selectedMenu"&&(Je.tabIndex=0),reactExports.cloneElement(Qe,Je)}return Qe});return jsxRuntimeExports.jsx(List,_extends$1({role:"menu",ref:Ye,className:$e,onKeyDown:Ge,tabIndex:Oe?0:-1},Xe,{children:Ke}))});function getPopoverUtilityClass(Ee){return generateUtilityClass("MuiPopover",Ee)}generateUtilityClasses("MuiPopover",["root","paper"]);const _excluded$l=["onEntering"],_excluded2$4=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],_excluded3=["slotProps"];function getOffsetTop(Ee,Re){let Te=0;return typeof Re=="number"?Te=Re:Re==="center"?Te=Ee.height/2:Re==="bottom"&&(Te=Ee.height),Te}function getOffsetLeft(Ee,Re){let Te=0;return typeof Re=="number"?Te=Re:Re==="center"?Te=Ee.width/2:Re==="right"&&(Te=Ee.width),Te}function getTransformOriginValue(Ee){return[Ee.horizontal,Ee.vertical].map(Re=>typeof Re=="number"?`${Re}px`:Re).join(" ")}function resolveAnchorEl(Ee){return typeof Ee=="function"?Ee():Ee}const useUtilityClasses$j=Ee=>{const{classes:Re}=Ee;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,Re)},PopoverRoot=styled(Modal,{name:"MuiPopover",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})({}),PopoverPaper=styled(Paper,{name:"MuiPopover",slot:"Paper",overridesResolver:(Ee,Re)=>Re.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(Re,Te){var je,Oe,Me;const De=useDefaultProps({props:Re,name:"MuiPopover"}),{action:$e,anchorEl:Be,anchorOrigin:Ue={vertical:"top",horizontal:"left"},anchorPosition:ze,anchorReference:We="anchorEl",children:Xe,className:He,container:qe,elevation:Ge=8,marginThreshold:Ye=16,open:Ve,PaperProps:Ke={},slots:Qe,slotProps:Ze,transformOrigin:Je={vertical:"top",horizontal:"left"},TransitionComponent:ir=Grow,transitionDuration:rr="auto",TransitionProps:{onEntering:ar}={},disableScrollLock:or=!1}=De,pr=_objectWithoutPropertiesLoose(De.TransitionProps,_excluded$l),tr=_objectWithoutPropertiesLoose(De,_excluded2$4),nr=(je=Ze==null?void 0:Ze.paper)!=null?je:Ke,hr=reactExports.useRef(),sr=useForkRef(hr,nr.ref),xr=_extends$1({},De,{anchorOrigin:Ue,anchorReference:We,elevation:Ge,marginThreshold:Ye,externalPaperSlotProps:nr,transformOrigin:Je,TransitionComponent:ir,transitionDuration:rr,TransitionProps:pr}),Rr=useUtilityClasses$j(xr),br=reactExports.useCallback(()=>
629{if(We==="anchorPosition")return ze;const Vr=resolveAnchorEl(Be),Sr=(Vr&&Vr.nodeType===1?Vr:ownerDocument(hr.current).body).getBoundingClientRect();return{top:Sr.top+getOffsetTop(Sr,Ue.vertical),left:Sr.left+getOffsetLeft(Sr,Ue.horizontal)}},[Be,Ue.horizontal,Ue.vertical,ze,We]),wr=reactExports.useCallback(Vr=>({vertical:getOffsetTop(Vr,Je.vertical),horizontal:getOffsetLeft(Vr,Je.horizontal)}),[Je.horizontal,Je.vertical]),vr=reactExports.useCallback(Vr=>{const mr={width:Vr.offsetWidth,height:Vr.offsetHeight},Sr=wr(mr);if(We==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue(Sr)};const Lr=br();let jr=Lr.top-Sr.vertical,fr=Lr.left-Sr.horizontal;const Cr=jr+mr.height,Mr=fr+mr.width,$r=ownerWindow(resolveAnchorEl(Be)),Fr=$r.innerHeight-Ye,Kr=$r.innerWidth-Ye;if(Ye!==null&&jr<Ye){const an=jr-Ye;jr-=an,Sr.vertical+=an}else if(Ye!==null&&Cr>Fr){const an=Cr-Fr;jr-=an,Sr.vertical+=an}if(Ye!==null&&fr<Ye){const an=fr-Ye;fr-=an,Sr.horizontal+=an}else if(Mr>Kr){const an=Mr-Kr;fr-=an,Sr.horizontal+=an}return{top:`${Math.round(jr)}px`,left:`${Math.round(fr)}px`,transformOrigin:getTransformOriginValue(Sr)}},[Be,We,br,wr,Ye]),[Dr,kr]=reactExports.useState(Ve),cr=reactExports.useCallback(()=>{const Vr=hr.current;if(!Vr)return;const mr=vr(Vr);mr.top!==null&&(Vr.style.top=mr.top),mr.left!==null&&(Vr.style.left=mr.left),Vr.style.transformOrigin=mr.transformOrigin,kr(!0)},[vr]);reactExports.useEffect(()=>(or&&window.addEventListener("scroll",cr),()=>window.removeEventListener("scroll",cr)),[Be,or,cr]);const dr=(Vr,mr)=>{ar&&ar(Vr,mr),cr()},ur=()=>{kr(!1)};reactExports.useEffect(()=>{Ve&&cr()}),reactExports.useImperativeHandle($e,()=>Ve?{updatePosition:()=>{cr()}}:null,[Ve,cr]),reactExports.useEffect(()=>{if(!Ve)return;const Vr=debounce$1(()=>{cr()}
629),mr=ownerWindow(Be);return mr.addEventListener("resize",Vr),()=>{Vr.clear(),mr.removeEventListener("resize",Vr)}},[Be,Ve,cr]);let gr=rr;rr==="auto"&&!ir.muiSupportAuto&&(gr=void 0);const _r=qe||(Be?ownerDocument(resolveAnchorEl(Be)).body:void 0),Ir=(Oe=Qe==null?void 0:Qe.root)!=null?Oe:PopoverRoot,Ar=(Me=Qe==null?void 0:Qe.paper)!=null?Me:PopoverPaper,Tr=useSlotProps({elementType:Ar,externalSlotProps:_extends$1({},nr,{style:Dr?nr.style:_extends$1({},nr.style,{opacity:0})}),additionalProps:{elevation:Ge,ref:sr},ownerState:xr,className:clsx(Rr.paper,nr==null?void 0:nr.className)}),Nr=useSlotProps({elementType:Ir,externalSlotProps:(Ze==null?void 0:Ze.root)||{},externalForwardedProps:tr,additionalProps:{ref:Te,slotProps:{backdrop:{invisible:!0}},container:_r,open:Ve},ownerState:xr,className:clsx(Rr.root,He)}),{slotProps:Br}=Nr,Hr=_objectWithoutPropertiesLoose(Nr,_excluded3);return jsxRuntimeExports.jsx(Ir,_extends$1({},Hr,!isHostComponent(Ir)&&{slotProps:Br,disableScrollLock:or},{children:jsxRuntimeExports.jsx(ir,_extends$1({appear:!0,in:Ve,onEntering:dr,onExited:ur,timeout:gr},pr,{children:jsxRuntimeExports.jsx(Ar,_extends$1({},Tr,{children:Xe}))}))}))});function getMenuUtilityClass(Ee){return generateUtilityClass("MuiMenu",Ee)}generateUtilityClasses("MuiMenu",["root","paper","list"]);const _excluded$k=["onEntering"],_excluded2$3=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$i=Ee=>{const{classes:Re}=Ee;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,Re)},MenuRoot=styled(Popover,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})({}),MenuPaper=styled(PopoverPaper,{name:"MuiMenu",slot:"Paper",overridesResolver:(Ee,Re)=>Re.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled(MenuList,{name:"MuiMenu",slot:"List",overridesResolver:(Ee,Re)=>Re.list})({outline:0}),Menu=reactExports.forwardRef(function(Re,Te){var je,Oe;const Me=useDefaultProps({props:Re,name:"MuiMenu"}),{autoFocus:De=!0,children:$e,className:Be,disableAutoFocusItem:Ue=!1,MenuListProps:ze={},onClose:We,open:Xe,PaperProps:He={},PopoverClasses:qe,transitionDuration:Ge="auto",TransitionProps:{onEntering:Ye}={},variant:Ve="selectedMenu",slots:Ke={},slotProps:Qe={}}=Me,Ze=_objectWithoutPropertiesLoose(Me.TransitionProps,_excluded$k),Je=_objectWithoutPropertiesLoose(Me,_excluded2$3),ir=useRtl(),rr=_extends$1({},Me,{autoFocus:De,disableAutoFocusItem:Ue,MenuListProps:ze,onEntering:Ye,PaperProps:He,transitionDuration:Ge,TransitionProps:Ze,variant:Ve}),ar=useUtilityClasses$i(rr),or=De&&!Ue&&Xe,pr=reactExports.useRef(null),tr=(wr,vr)=>{pr.current&&pr.current.adjustStyleForScrollbar(wr,{direction:ir?"rtl":"ltr"}),Ye&&Ye(wr,vr)},nr=wr=>{wr.key==="Tab"&&(wr.preventDefault(),We&&We(wr,"tabKeyDown"))};let hr=-1;reactExports.Children.map($e,(wr,vr)=>{reactExports.isValidElement(wr)&&(wr.props.disabled||(Ve==="selectedMenu"&&wr.props.selected||hr===-1)&&(hr=vr))});const sr=(je=Ke.paper)!=null?je:MenuPaper,xr=(Oe=Qe.paper)!=null?Oe:He,Rr=useSlotProps({elementType:Ke.root,externalSlotProps:Qe.root,ownerState:rr,className:[ar.root,Be]}),br=useSlotProps({elementType:sr,externalSlotProps:xr,ownerState:rr,className:ar.paper});return jsxRuntimeExports.jsx(MenuRoot,_extends$1({onClose:We,anchorOrigin:{vertical:"bottom",horizontal:ir?"right":"left"},transformOrigin:ir?RTL_ORIGIN:LTR_ORIGIN,slots:{paper:sr,root:Ke.root},slotProps:{root:Rr,paper:br},open:Xe,ref:Te,transitionDuration:Ge,TransitionProps:_extends$1({onEntering:tr},Ze),ownerState:rr},Je,{classes:qe,children:jsxRuntimeExports.jsx(MenuMenuList,_extends$1({onKeyDown:nr,actions:pr,autoFocus:De&&(hr===-1||Ue),autoFocusItem:or,variant:Ve},ze,{className:clsx(ar.list,ze.className),children:$e}))}))});function getMenuItemUtilityClass(Ee){return generateUtilityClass("MuiMenuItem",Ee)}const menuItemClasses=generateUtilityClasses("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),_excluded$j=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],overridesResolver=(Ee,Re)=>{const{ownerState:Te}=Ee;
vendor: 4,681 bytes, line 629
629return[Re.root,Te.dense&&Re.dense,Te.divider&&Re.divider,!Te.disableGutters&&Re.gutters]},useUtilityClasses$h=Ee=>{const{disabled:Re,dense:Te,divider:je,disableGutters:Oe,selected:Me,classes:De}=Ee,Be=composeClasses({root:["root",Te&&"dense",Re&&"disabled",!Oe&&"gutters",je&&"divider",Me&&"selected"]},getMenuItemUtilityClass,De);return _extends$1({},De,Be)},MenuItemRoot=styled(ButtonBase,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver})(({theme:Ee,ownerState:Re})=>_extends$1({},Ee.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!Re.disableGutters&&{paddingLeft:16,paddingRight:16},Re.divider&&{borderBottom:`1px solid ${(Ee.vars||Ee).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(Ee.vars||Ee).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${menuItemClasses.selected}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / ${Ee.vars.palette.action.selectedOpacity})`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity),[`&.${menuItemClasses.focusVisible}`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.focusOpacity}))`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity+Ee.palette.action.focusOpacity)}},[`&.${menuItemClasses.selected}:hover`]:{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.hoverOpacity}))`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity+Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.primary.mainChannel} / ${Ee.vars.palette.action.selectedOpacity})`:alpha_1(Ee.palette.primary.main,Ee.palette.action.selectedOpacity)}},[`&.${menuItemClasses.focusVisible}`]:{backgroundColor:(Ee.vars||Ee).palette.action.focus},[`&.${menuItemClasses.disabled}`]:{opacity:(Ee.vars||Ee).palette.action.disabledOpacity},[`& + .${dividerClasses.root}`]:{marginTop:Ee.spacing(1),marginBottom:Ee.spacing(1)},[`& + .${dividerClasses.inset}`]:{marginLeft:52},[`& .${listItemTextClasses.root}`]:{marginTop:0,marginBottom:0},[`& .${listItemTextClasses.inset}`]:{paddingLeft:36},[`& .${listItemIconClasses.root}`]:{minWidth:36}},!Re.dense&&{[Ee.breakpoints.up("sm")]:{minHeight:"auto"}},Re.dense&&_extends$1({minHeight:32,paddingTop:4,paddingBottom:4},Ee.typography.body2,{[`& .${listItemIconClasses.root} svg`]:{fontSize:"1.25rem"}}))),MenuItem=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiMenuItem"}),{autoFocus:Oe=!1,component:Me="li",dense:De=!1,divider:$e=!1,disableGutters:Be=!1,focusVisibleClassName:Ue,role:ze="menuitem",tabIndex:We,className:Xe}=je,He=_objectWithoutPropertiesLoose(je,_excluded$j),qe=reactExports.useContext(ListContext),Ge=reactExports.useMemo(()=>({dense:De||qe.dense||!1,disableGutters:Be}),[qe.dense,De,Be]),Ye=reactExports.useRef(null);useEnhancedEffect(()=>{Oe&&Ye.current&&Ye.current.focus()},[Oe]);const Ve=_extends$1({},je,{dense:Ge.dense,divider:$e,disableGutters:Be}),Ke=useUtilityClasses$h(je),Qe=useForkRef(Ye,Te);let Ze;return je.disabled||(Ze=We!==void 0?We:-1),jsxRuntimeExports.jsx(ListContext.Provider,{value:Ge,children:jsxRuntimeExports.jsx(MenuItemRoot,_extends$1({ref:Qe,role:ze,tabIndex:Ze,component:Me,focusVisibleClassName:clsx(Ke.focusVisible,Ue),className:clsx(Ke.root,Xe)},He,{ownerState:Ve,classes:Ke}))})});function getNativeSelectUtilityClasses(Ee){return generateUtilityClass("MuiNativeSelect",Ee)}const nativeSelectClasses=generateUtilityClasses("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),_excluded$i=["className","disabled","error","IconComponent","inputRef","variant"],useUtilityClasses$g=Ee=>{const{classes:Re,variant:Te,disabled:je,multiple:Oe,open:Me,error:De}=Ee,$e={select:["select",Te,je&&"disabled",Oe&&"multiple",De&&"error"],icon:["icon",`icon${capitalize$1(Te)}`,Me&&"iconOpen",je&&"disabled"]};return composeClasses($e,getNativeSelectUtilityClasses,Re)},nativeSelectSelectStyles=({ownerState:Ee,theme:Re})=>_extends$1({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":_extends$1({},Re.vars?{backgroundColor:`rgba(${Re.vars.palette.common.onBackgroun
629dChannel} / 0.05)`}:{backgroundColor:Re.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${nativeSelectClasses.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(Re.vars||Re).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},Ee.variant==="filled"&&{"&&&":{paddingRight:32}},Ee.variant==="outlined"&&{borderRadius:(Re.vars||Re).shape.borderRadius,"&:focus":{borderRadius:(Re.vars||Re).shape.borderRadius},"&&&":{paddingRight:32}}),NativeSelectSelect=styled("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.select,Re[Te.variant],Te.error&&Re.error,{[`&.${nativeSelectClasses.multiple}`]:Re.multiple}]}})(nativeSelectSelectStyles),nativeSelectIconStyles=({ownerState:Ee,theme:Re})=>_extends$1({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(Re.vars||Re).palette.action.active,[`&.${nativeSelectClasses.disabled}`]:{color:(Re.vars||Re).palette.action.disabled}},Ee.open&&{transform:"rotate(180deg)"},Ee.variant==="filled"&&{right:7},Ee.variant==="outlined"&&{right:7}),NativeSelectIcon=styled("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.icon,Te.variant&&Re[`icon${capitalize$1(Te.variant)}`],Te.open&&Re.iconOpen]}})(nativeSelectIconStyles),NativeSelectInput=reactExports.forwardRef(function(Re,Te){const{className:je,disabled:Oe,error:Me,IconComponent:De,inputRef:$e,variant:Be="standard"}=Re,Ue=_objectWithoutPropertiesLoose(Re,_excluded$i),ze=_extends$1({},Re,{disabled:Oe,variant:Be,error:Me}),We=useUtilityClasses$g(ze);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,_extends$1({ownerState:ze,className:clsx(We.select,je),disabled:Oe,ref:$e||Te},Ue)),Re.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:De,ownerState:ze,className:We.icon})]})});var _span$1;const _excluded$h=["children","classes","className","label","notched"],NotchedOutlineRoot$1=styled("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:rootShouldForwardProp})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),NotchedOutlineLegend=styled("legend",{name:"MuiNotchedOutlined",shouldForwardProp:rootShouldForwardProp})(({ownerState:Ee,theme:Re})=>_extends$1({float:"unset",width:"auto",overflow:"hidden"},!Ee.withLabel&&{padding:0,lineHeight:"11px",transition:Re.transitions.create("width",{duration:150,easing:Re.transitions.easing.easeOut})},Ee.withLabel&&_extends$1({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:Re.transitions.create("max-width",{duration:50,easing:Re.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},Ee.notched&&{maxWidth:"100%",transition:Re.transitions.create("max-width",{duration:100,easing:Re.transitions.easing.easeOut,delay:50})})));function NotchedOutline(Ee){const{className:Re,label:Te,notched:je}=Ee,Oe=_objectWithoutPropertiesLoose(Ee,_excluded$h),Me=Te!=null&&Te!=="",De=_extends$1({},Ee,{notched:je,withLabel:Me});return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,_extends$1({"aria-hidden":!0,className:Re,ownerState:De},Oe,{children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:De,children:Me?jsxRuntimeExports.jsx("span",{children:Te}):_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"â"}))})}))}const _excluded$g=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],useUtilityClasses$f=Ee=>{const{classes:Re}=Ee,je=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,Re);return _extends$1({},Re,je)},OutlinedInputRoot=styled(InputBaseRoot,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(({theme:Ee,ownerState:Re})=>{const Te=Ee.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return _extends$1({position:"relative",borderRadius:(Ee.vars||Ee).shape.borderRadius,[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:(Ee.vars||Ee).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:Ee.vars?`rgba(${Ee.vars.palette.common.onBackgroun
629dChannel} / 0.23)`:Te}},[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(Ee.vars||Ee).palette[Re.color].main,borderWidth:2},[`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(Ee.vars||Ee).palette.error.main},[`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(Ee.vars||Ee).palette.action.disabled}},Re.startAdornment&&{paddingLeft:14},Re.endAdornment&&{paddingRight:14},Re.multiline&&_extends$1({padding:"16.5px 14px"},Re.size==="small"&&{padding:"8.5px 14px"}))}),NotchedOutlineRoot=styled(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(Ee,Re)=>Re.notchedOutline})(({theme:Ee})=>{const Re=Ee.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:Ee.vars?`rgba(${Ee.vars.palette.common.onBackgroundChannel} / 0.23)`:Re}}),OutlinedInputInput=styled(InputBaseComponent,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(({theme:Ee,ownerState:Re})=>_extends$1({padding:"16.5px 14px"},!Ee.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:Ee.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:Ee.palette.mode==="light"?null:"#fff",caretColor:Ee.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},Ee.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[Ee.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},Re.size==="small"&&{padding:"8.5px 14px"},Re.multiline&&{padding:0},Re.startAdornment&&{paddingLeft:0},Re.endAdornment&&{paddingRight:0})),OutlinedInput=reactExports.forwardRef(function(Re,Te){var je,Oe,Me,De,$e;const Be=useDefaultProps({props:Re,name:"MuiOutlinedInput"}),{components:Ue={},fullWidth:ze=!1,inputComponent:We="input",label:Xe,multiline:He=!1,notched:qe,slots:Ge={},type:Ye="text"}=Be,Ve=_objectWithoutPropertiesLoose(Be,_excluded$g),Ke=useUtilityClasses$f(Be),Qe=useFormControl(),Ze=formControlState({props:Be,muiFormControl:Qe,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),Je=_extends$1({},Be,{color:Ze.color||"primary",disabled:Ze.disabled,error:Ze.error,focused:Ze.focused,formControl:Qe,fullWidth:ze,hiddenLabel:Ze.hiddenLabel,multiline:He,size:Ze.size,type:Ye}),ir=(je=(Oe=Ge.root)!=null?Oe:Ue.Root)!=null?je:OutlinedInputRoot,rr=(Me=(De=Ge.input)!=null?De:Ue.Input)!=null?Me:OutlinedInputInput;return jsxRuntimeExports.jsx(InputBase,_extends$1({slots:{root:ir,input:rr},renderSuffix:ar=>jsxRuntimeExports.jsx(NotchedOutlineRoot,{ownerState:Je,className:Ke.notchedOutline,label:Xe!=null&&Xe!==""&&Ze.required?$e||($e=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Xe,"â","*"]})):Xe,notched:typeof qe<"u"?qe:!!(ar.startAdornment||ar.filled||ar.focused)}),fullWidth:ze,inputComponent:We,multiline:He,ref:Te,type:Ye},Ve,{classes:_extends$1({},Ke,{notchedOutline:null})}))});OutlinedInput.muiName="Input";const RadioButtonUncheckedIcon=createSvgIcon$1(jsxRuntimeExports.jsx("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"),RadioButtonCheckedIcon=createSvgIcon$1(jsxRuntimeExports.jsx("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"),RadioButtonIconRoot=styled("span",{name:"MuiRadioButtonIcon",shouldForwardProp:rootShouldForwardProp})({position:"relative",display:"flex"}),RadioButtonIconBackground=styled(RadioButtonUncheckedIcon,{name:"MuiRadioButtonIcon"})({transform:"scale(1)"}),RadioButtonIconDot=styled(RadioButtonCheckedIcon,{name:"MuiRadioButtonIcon"})(({theme:Ee,ownerState:Re})=>_extends$1({left:0,position:"absolute",transform:"scale(0)",transition:Ee.transitions.create("transform",{easing:Ee.transitions.easing.easeIn,duration:Ee.transitions.duration.shortest})},Re.checked&&{transform:"scale(1)",transition:Ee.transitions.create("transform",{easing:Ee.transitions.easing.easeOut,duration:Ee.transitions.duration.shortest})}));function RadioButtonIcon(Ee){const{checked:Re=!1,classes:Te={},fontSize:je}=Ee,Oe=_extends$1({},Ee,{checked:Re});return jsxRuntimeExports.jsxs(RadioButtonIconRoot,{className:Te.root,ownerState:Oe,children:[jsxRuntimeExports.jsx(RadioButtonIconBackgroun
629d,{fontSize:je,className:Te.background,ownerState:Oe}),jsxRuntimeExports.jsx(RadioButtonIconDot,{fontSize:je,className:Te.dot,ownerState:Oe})]})}const RadioGroupContext=reactExports.createContext(void 0);function useRadioGroup(){return reactExports.useContext(RadioGroupContext)}function getRadioUtilityClass(Ee){return generateUtilityClass("MuiRadio",Ee)}const radioClasses=generateUtilityClasses("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),_excluded$f=["checked","checkedIcon","color","icon","name","onChange","size","className"],useUtilityClasses$e=Ee=>{const{classes:Re,color:Te,size:je}=Ee,Oe={root:["root",`color${capitalize$1(Te)}`,je!=="medium"&&`size${capitalize$1(je)}`]};return _extends$1({},Re,composeClasses(Oe,getRadioUtilityClass,Re))},RadioRoot=styled(SwitchBase,{shouldForwardProp:Ee=>rootShouldForwardProp(Ee)||Ee==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.size!=="medium"&&Re[`size${capitalize$1(Te.size)}`],Re[`color${capitalize$1(Te.color)}`]]}})(({theme:Ee,ownerState:Re})=>_extends$1({color:(Ee.vars||Ee).palette.text.secondary},!Re.disableRipple&&{"&:hover":{backgroundColor:Ee.vars?`rgba(${Re.color==="default"?Ee.vars.palette.action.activeChannel:Ee.vars.palette[Re.color].mainChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Re.color==="default"?Ee.palette.action.active:Ee.palette[Re.color].main,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},Re.color!=="default"&&{[`&.${radioClasses.checked}`]:{color:(Ee.vars||Ee).palette[Re.color].main}},{[`&.${radioClasses.disabled}`]:{color:(Ee.vars||Ee).palette.action.disabled}}));function areEqualValues$1(Ee,Re){return typeof Re=="object"&&Re!==null?Ee===Re:String(Ee)===String(Re)}const defaultCheckedIcon=jsxRuntimeExports.jsx(RadioButtonIcon,{checked:!0}),defaultIcon=jsxRuntimeExports.jsx(RadioButtonIcon,{}),Radio=reactExports.forwardRef(function(Re,Te){var je,Oe;const Me=useDefaultProps({props:Re,name:"MuiRadio"}),{checked:De,checkedIcon:$e=defaultCheckedIcon,color:Be="primary",icon:Ue=defaultIcon,name:ze,onChange:We,size:Xe="medium",className:He}=Me,qe=_objectWithoutPropertiesLoose(Me,_excluded$f),Ge=_extends$1({},Me,{color:Be,size:Xe}),Ye=useUtilityClasses$e(Ge),Ve=useRadioGroup();let Ke=De;const Qe=createChainedFunction(We,Ve&&Ve.onChange);let Ze=ze;return Ve&&(typeof Ke>"u"&&(Ke=areEqualValues$1(Ve.value,Me.value)),typeof Ze>"u"&&(Ze=Ve.name)),jsxRuntimeExports.jsx(RadioRoot,_extends$1({type:"radio",icon:reactExports.cloneElement(Ue,{fontSize:(je=defaultIcon.props.fontSize)!=null?je:Xe}),checkedIcon:reactExports.cloneElement($e,{fontSize:(Oe=defaultCheckedIcon.props.fontSize)!=null?Oe:Xe}),ownerState:Ge,classes:Ye,name:Ze,checked:Ke,onChange:Qe,ref:Te,className:clsx(Ye.root,He)},qe))});function getRadioGroupUtilityClass(Ee){return generateUtilityClass("MuiRadioGroup",Ee)}generateUtilityClasses("MuiRadioGroup",["root","row","error"]);const _excluded$e=["actions","children","className","defaultValue","name","onChange","value"],useUtilityClasses$d=Ee=>{const{classes:Re,row:Te,error:je}=Ee;return composeClasses({root:["root",Te&&"row",je&&"error"]},getRadioGroupUtilityClass,Re)},RadioGroup=reactExports.forwardRef(function(Re,Te){const{actions:je,children:Oe,className:Me,defaultValue:De,name:$e,onChange:Be,value:Ue}=Re,ze=_objectWithoutPropertiesLoose(Re,_excluded$e),We=reactExports.useRef(null),Xe=useUtilityClasses$d(Re),[He,qe]=useControlled({controlled:Ue,default:De,name:"RadioGroup"});reactExports.useImperativeHandle(je,()=>({focus:()=>{let Ke=We.current.querySelector("input:not(:disabled):checked");Ke||(Ke=We.current.querySelector("input:not(:disabled)")),Ke&&Ke.focus()}}),[]);const Ge=useForkRef(Te,We),Ye=useId($e),Ve=reactExports.useMemo(()=>({name:Ye,onChange(Ke){qe(Ke.target.value),Be&&Be(Ke,Ke.target.value)},value:He}),[Ye,Be,qe,He]);return jsxRuntimeExports.jsx(RadioGroupContext.Provider,{value:Ve,children:jsxRuntimeExports.jsx(FormGroup,_extends$1({role:"radiogroup",ref:Ge,className:clsx(Xe.root,Me)},ze,{children:Oe}))})});function getSelectUtilityClasses(Ee){return generateUtilityClass("MuiSelect",Ee)}const selectClasses=generateUtilityClasses("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var _span;
vendor: 4,380 bytes, line 629
629const _excluded$d=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],SelectSelect=styled("div",{name:"MuiSelect",slot:"Select",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[{[`&.${selectClasses.select}`]:Re.select},{[`&.${selectClasses.select}`]:Re[Te.variant]},{[`&.${selectClasses.error}`]:Re.error},{[`&.${selectClasses.multiple}`]:Re.multiple}]}})(nativeSelectSelectStyles,{[`&.${selectClasses.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.icon,Te.variant&&Re[`icon${capitalize$1(Te.variant)}`],Te.open&&Re.iconOpen]}})(nativeSelectIconStyles),SelectNativeInput=styled("input",{shouldForwardProp:Ee=>slotShouldForwardProp(Ee)&&Ee!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(Ee,Re)=>Re.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues(Ee,Re){return typeof Re=="object"&&Re!==null?Ee===Re:String(Ee)===String(Re)}function isEmpty(Ee){return Ee==null||typeof Ee=="string"&&!Ee.trim()}const useUtilityClasses$c=Ee=>{const{classes:Re,variant:Te,disabled:je,multiple:Oe,open:Me,error:De}=Ee,$e={select:["select",Te,je&&"disabled",Oe&&"multiple",De&&"error"],icon:["icon",`icon${capitalize$1(Te)}`,Me&&"iconOpen",je&&"disabled"],nativeInput:["nativeInput"]};return composeClasses($e,getSelectUtilityClasses,Re)},SelectInput=reactExports.forwardRef(function(Re,Te){var je;const{"aria-describedby":Oe,"aria-label":Me,autoFocus:De,autoWidth:$e,children:Be,className:Ue,defaultOpen:ze,defaultValue:We,disabled:Xe,displayEmpty:He,error:qe=!1,IconComponent:Ge,inputRef:Ye,labelId:Ve,MenuProps:Ke={},multiple:Qe,name:Ze,onBlur:Je,onChange:ir,onClose:rr,onFocus:ar,onOpen:or,open:pr,readOnly:tr,renderValue:nr,SelectDisplayProps:hr={},tabIndex:sr,value:xr,variant:Rr="standard"}=Re,br=_objectWithoutPropertiesLoose(Re,_excluded$d),[wr,vr]=useControlled({controlled:xr,default:We,name:"Select"}),[Dr,kr]=useControlled({controlled:pr,default:ze,name:"Select"}),cr=reactExports.useRef(null),dr=reactExports.useRef(null),[ur,gr]=reactExports.useState(null),{current:_r}=reactExports.useRef(pr!=null),[Ir,Ar]=reactExports.useState(),Tr=useForkRef(Te,Ye),Nr=reactExports.useCallback(yn=>{dr.current=yn,yn&&gr(yn)},[]),Br=ur==null?void 0:ur.parentNode;reactExports.useImperativeHandle(Tr,()=>({focus:()=>{dr.current.focus()},node:cr.current,value:wr}),[wr]),reactExports.useEffect(()=>{ze&&Dr&&ur&&!_r&&(Ar($e?null:Br.clientWidth),dr.current.focus())},[ur,$e]),reactExports.useEffect(()=>{De&&dr.current.focus()},[De]),reactExports.useEffect(()=>{if(!Ve)return;const yn=ownerDocument(dr.current).getElementById(Ve);if(yn){const Mn=()=>{getSelection().isCollapsed&&dr.current.focus()};return yn.addEventListener("click",Mn),()=>{yn.removeEventListener("click",Mn)}}},[Ve]);const Hr=(yn,Mn)=>{yn?or&&or(Mn):rr&&rr(Mn),_r||(Ar($e?null:Br.clientWidth),kr(yn))},Vr=yn=>{yn.button===0&&(yn.preventDefault(),dr.current.focus(),Hr(!0,yn))},mr=yn=>{Hr(!1,yn)},Sr=reactExports.Children.toArray(Be),Lr=yn=>{const Mn=Sr.find(on=>on.props.value===yn.target.value);Mn!==void 0&&(vr(Mn.props.value),ir&&ir(yn,Mn))},jr=yn=>Mn=>{let on;if(Mn.currentTarget.hasAttribute("tabindex")){if(Qe){on=Array.isArray(wr)?wr.slice():[];const Yr=wr.indexOf(yn.props.value);Yr===-1?on.push(yn.props.value):on.splice(Yr,1)}else on=yn.props.value;if(yn.props.onClick&&yn.props.onClick(Mn),wr!==on&&(vr(on),ir)){const Yr=Mn.nativeEvent||Mn,sn=new Yr.constructor(Yr.type,Yr);Object.defineProperty(sn,"target",{writable:!0,value:{value:on,name:Ze}}),ir(sn,yn)}Qe||Hr(!1,Mn)}},fr=yn=>{tr||[" ","ArrowUp","ArrowDown","Enter"].indexOf(yn.key)!==-1&&(yn.preventDefault(),Hr(!0,yn))},Cr=ur!==null&&Dr,Mr=yn=>{!Cr&&Je&&(Object.defineProperty(yn,"target",{writable:!0,value:{value:wr,name:Ze}}),Je(yn))};delete br["aria-invalid"];let $r,Fr;const Kr=[];let an=!1;(isFilled({value:wr})||He)&&(nr?$r=nr(wr):an=!0);const Wr=Sr.map(yn=>
629{if(!reactExports.isValidElement(yn))return null;let Mn;if(Qe){if(!Array.isArray(wr))throw new Error(formatMuiErrorMessage$1(2));Mn=wr.some(on=>areEqualValues(on,yn.props.value)),Mn&&an&&Kr.push(yn.props.children)}else Mn=areEqualValues(wr,yn.props.value),Mn&&an&&(Fr=yn.props.children);return reactExports.cloneElement(yn,{"aria-selected":Mn?"true":"false",onClick:jr(yn),onKeyUp:on=>{on.key===" "&&on.preventDefault(),yn.props.onKeyUp&&yn.props.onKeyUp(on)},role:"option",selected:Mn,value:void 0,"data-value":yn.props.value})});an&&(Qe?Kr.length===0?$r=null:$r=Kr.reduce((yn,Mn,on)=>(yn.push(Mn),on<Kr.length-1&&yn.push(", "),yn),[]):$r=Fr);let hn=Ir;!$e&&_r&&ur&&(hn=Br.clientWidth);let cn;typeof sr<"u"?cn=sr:cn=Xe?null:0;const tn=hr.id||(Ze?`mui-component-select-${Ze}`:void 0),Qr=_extends$1({},Re,{variant:Rr,value:wr,open:Cr,error:qe}),wn=useUtilityClasses$c(Qr),gn=_extends$1({},Ke.PaperProps,(je=Ke.slotProps)==null?void 0:je.paper),In=useId();return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(SelectSelect,_extends$1({ref:Nr,tabIndex:cn,role:"combobox","aria-controls":In,"aria-disabled":Xe?"true":void 0,"aria-expanded":Cr?"true":"false","aria-haspopup":"listbox","aria-label":Me,"aria-labelledby":[Ve,tn].filter(Boolean).join(" ")||void 0,"aria-describedby":Oe,onKeyDown:fr,onMouseDown:Xe||tr?null:Vr,onBlur:Mr,onFocus:ar},hr,{ownerState:Qr,className:clsx(hr.className,wn.select,Ue),id:tn,children:isEmpty($r)?_span||(_span=jsxRuntimeExports.jsx("span",{className:"notranslate",children:"â"})):$r})),jsxRuntimeExports.jsx(SelectNativeInput,_extends$1({"aria-invalid":qe,value:Array.isArray(wr)?wr.join(","):wr,name:Ze,ref:cr,"aria-hidden":!0,onChange:Lr,tabIndex:-1,disabled:Xe,className:wn.nativeInput,autoFocus:De,ownerState:Qr},br)),jsxRuntimeExports.jsx(SelectIcon,{as:Ge,className:wn.icon,ownerState:Qr}),jsxRuntimeExports.jsx(Menu,_extends$1({id:`menu-${Ze||""}`,anchorEl:Br,open:Cr,onClose:mr,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},Ke,{MenuListProps:_extends$1({"aria-labelledby":Ve,role:"listbox","aria-multiselectable":Qe?"true":void 0,disableListWrap:!0,id:In},Ke.MenuListProps),slotProps:_extends$1({},Ke.slotProps,{paper:_extends$1({},gn,{style:_extends$1({minWidth:hn},gn!=null?gn.style:null)})}),children:Wr}))]})}),_excluded$c=["autoWidth","children","classes","className","defaultOpen","displayEmpty","IconComponent","id","input","inputProps","label","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"],_excluded2$2=["root"],useUtilityClasses$b=Ee=>{const{classes:Re}=Ee;return Re},styledRootConfig={name:"MuiSelect",overridesResolver:(Ee,Re)=>Re.root,shouldForwardProp:Ee=>rootShouldForwardProp(Ee)&&Ee!=="variant",slot:"Root"},StyledInput=styled(Input,styledRootConfig)(""),StyledOutlinedInput=styled(OutlinedInput,styledRootConfig)(""),StyledFilledInput=styled(FilledInput,styledRootConfig)(""),Select=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({name:"MuiSelect",props:Re}),{autoWidth:Oe=!1,children:Me,classes:De={},className:$e,defaultOpen:Be=!1,displayEmpty:Ue=!1,IconComponent:ze=ArrowDropDownIcon,id:We,input:Xe,inputProps:He,label:qe,labelId:Ge,MenuProps:Ye,multiple:Ve=!1,native:Ke=!1,onClose:Qe,onOpen:Ze,open:Je,renderValue:ir,SelectDisplayProps:rr,variant:ar="outlined"}=je,or=_objectWithoutPropertiesLoose(je,_excluded$c),pr=Ke?NativeSelectInput:SelectInput,tr=useFormControl(),nr=formControlState({props:je,muiFormControl:tr,states:["variant","error"]}),hr=nr.variant||ar,sr=_extends$1({},je,{variant:hr,classes:De}),xr=useUtilityClasses$b(sr),Rr=_objectWithoutPropertiesLoose(xr,_excluded2$2),br=Xe||{standard:jsxRuntimeExports.jsx(StyledInput,{ownerState:sr}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:qe,ownerState:sr}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:sr})}[hr],wr=useForkRef(Te,getReactElementRef(br));return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(br,_extends$1({inputComponent:pr,inputProps:_extends$1({children:Me,error:nr.error,IconComponent:ze,variant:hr,type:void 0,multiple:Ve},Ke?{id:We}:{autoWidth:Oe,defaultOpen:Be,displayEmpty:Ue,labelId:Ge,MenuProps:Ye,onClose:Qe,onOpen:Ze,open:Je,renderValue:ir,SelectDisplayProps:_extends$1({id:We},rr)},He,{classes:He?deepmerge$1(Rr,He.classes):Rr},Xe?Xe.props.inputProps:{})},(Ve&&Ke||Ue)&&hr==="outlined"?{notched:!0}:{},{ref:wr,className:clsx(br.props.className,$e,xr.root)},!Xe&&{variant:hr},or))})});Select.muiName="Select";function areArraysEqual(Ee,Re,Te=(je,Oe)=>je===Oe){return Ee.length===Re.length&&Ee.every((je,Oe)=>Te(je,Re[Oe]))}const INTENTIONAL_DRAG_COUNT_THRESHOLD=2;function asc(Ee,Re){return Ee-Re}function findClosest(Ee,Re){var Te;const{index:je}=(Te=Ee.reduce((Oe,Me,De)=>{const $e=Math.abs(Re-Me);return Oe===null||$e<Oe.distance||$e===Oe.distance?{distance:$e,index:De}:Oe},null))!=null?Te:{};return je}function trackFinger(Ee,Re){if(Re.current!==void 0&&Ee.changedTouches){const Te=Ee;for(let je=0;je<Te.changedTouches.length;je+=1){const Oe=Te.changedTouches[je];
629if(Oe.identifier===Re.current)return{x:Oe.clientX,y:Oe.clientY}}return!1}return{x:Ee.clientX,y:Ee.clientY}}function valueToPercent(Ee,Re,Te){return(Ee-Re)*100/(Te-Re)}function percentToValue(Ee,Re,Te){return(Te-Re)*Ee+Re}function getDecimalPrecision(Ee){if(Math.abs(Ee)<1){const Te=Ee.toExponential().split("e-"),je=Te[0].split(".")[1];return(je?je.length:0)+parseInt(Te[1],10)}const Re=Ee.toString().split(".")[1];return Re?Re.length:0}function roundValueToStep(Ee,Re,Te){const je=Math.round((Ee-Te)/Re)*Re+Te;return Number(je.toFixed(getDecimalPrecision(Re)))}function setValueIndex({values:Ee,newValue:Re,index:Te}){const je=Ee.slice();return je[Te]=Re,je.sort(asc)}function focusThumb({sliderRef:Ee,activeIndex:Re,setActive:Te}){var je,Oe;const Me=ownerDocument(Ee.current);if(!((je=Ee.current)!=null&&je.contains(Me.activeElement))||Number(Me==null||(Oe=Me.activeElement)==null?void 0:Oe.getAttribute("data-index"))!==Re){var De;(De=Ee.current)==null||De.querySelector(`[type="range"][data-index="${Re}"]`).focus()}Te&&Te(Re)}function areValuesEqual(Ee,Re){return typeof Ee=="number"&&typeof Re=="number"?Ee===Re:typeof Ee=="object"&&typeof Re=="object"?areArraysEqual(Ee,Re):!1}const axisProps={horizontal:{offset:Ee=>({left:`${Ee}%`}),leap:Ee=>({width:`${Ee}%`})},"horizontal-reverse":{offset:Ee=>({right:`${Ee}%`}),leap:Ee=>({width:`${Ee}%`})},vertical:{offset:Ee=>({bottom:`${Ee}%`}),leap:Ee=>({height:`${Ee}%`})}},Identity$1=Ee=>Ee;let cachedSupportsTouchActionNone;function doesSupportTouchActionNone(){return cachedSupportsTouchActionNone===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?cachedSupportsTouchActionNone=CSS.supports("touch-action","none"):cachedSupportsTouchActionNone=!0),cachedSupportsTouchActionNone}function useSlider(Ee){const{"aria-labelledby":Re,defaultValue:Te,disabled:je=!1,disableSwap:Oe=!1,isRtl:Me=!1,marks:De=!1,max:$e=100,min:Be=0,name:Ue,onChange:ze,onChangeCommitted:We,orientation:Xe="horizontal",rootRef:He,scale:qe=Identity$1,step:Ge=1,shiftStep:Ye=10,tabIndex:Ve,value:Ke}=Ee,Qe=reactExports.useRef(void 0),[Ze,Je]=reactExports.useState(-1),[ir,rr]=reactExports.useState(-1),[ar,or]=reactExports.useState(!1),pr=reactExports.useRef(0),[tr,nr]=useControlled({controlled:Ke,default:Te??Be,name:"Slider"}),hr=ze&&((tn,Qr,wn)=>{const gn=tn.nativeEvent||tn,In=new gn.constructor(gn.type,gn);Object.defineProperty(In,"target",{writable:!0,value:{value:Qr,name:Ue}}),ze(In,Qr,wn)}),sr=Array.isArray(tr);let xr=sr?tr.slice().sort(asc):[tr];xr=xr.map(tn=>tn==null?Be:clamp$2(tn,Be,$e));const Rr=De===!0&&Ge!==null?[...Array(Math.floor(($e-Be)/Ge)+1)].map((tn,Qr)=>({value:Be+Ge*Qr})):De||[],br=Rr.map(tn=>tn.value),{isFocusVisibleRef:wr,onBlur:vr,onFocus:Dr,ref:kr}=useIsFocusVisible(),[cr,dr]=reactExports.useState(-1),ur=reactExports.useRef(null),gr=useForkRef(kr,ur),_r=useForkRef(He,gr),Ir=tn=>Qr=>{var wn;const gn=Number(Qr.currentTarget.getAttribute("data-index"));Dr(Qr),wr.current===!0&&dr(gn),rr(gn),tn==null||(wn=tn.onFocus)==null||wn.call(tn,Qr)},Ar=tn=>Qr=>{var wn;vr(Qr),wr.current===!1&&dr(-1),rr(-1),tn==null||(wn=tn.onBlur)==null||wn.call(tn,Qr)},Tr=(tn,Qr)=>{const wn=Number(tn.currentTarget.getAttribute("data-index")),gn=xr[wn],In=br.indexOf(gn);let yn=Qr;if(Rr&&Ge==null){const Mn=br[br.length-1];yn>Mn?yn=Mn:yn<br[0]?yn=br[0]:yn=yn<gn?br[In-1]:br[In+1]}if(yn=clamp$2(yn,Be,$e),sr){Oe&&(yn=clamp$2(yn,xr[wn-1]||-1/0,xr[wn+1]||1/0));const Mn=yn;yn=setValueIndex({values:xr,newValue:yn,index:wn});let on=wn;Oe||(on=yn.indexOf(Mn)),focusThumb({sliderRef:ur,activeIndex:on})}nr(yn),dr(wn),hr&&!areValuesEqual(yn,tr)&&hr(tn,yn,wn),We&&We(tn,yn)},Nr=tn=>Qr=>{var wn;if(Ge!==null){const gn=Number(Qr.currentTarget.getAttribute("data-index")),In=xr[gn];let yn=null;(Qr.key==="ArrowLeft"||Qr.key==="ArrowDown")&&Qr.shiftKey||Qr.key==="PageDown"?yn=Math.max(In-Ye,Be):((Qr.key==="ArrowRight"||Qr.key==="ArrowUp")&&Qr.shiftKey||Qr.key==="PageUp")&&(yn=Math.min(In+Ye,$e)),yn!==null&&(Tr(Qr,yn),Qr.preventDefault())}tn==null||(wn=tn.onKeyDown)==null||wn.call(tn,Qr)};useEnhancedEffect(()=>{if(je&&ur.current.contains(document.activeElement)){var tn;(tn=document.activeElement)==null||tn.blur()}},[je]),je&&Ze!==-1&&Je(-1),je&&cr!==-1&&dr(-1);const Br=tn=>Qr=>{var wn;(wn=tn.onChange)==null||wn.call(tn,Qr),Tr(Qr,Qr.target.valueAsNumber)},Hr=reactExports.useRef(void 0);let Vr=Xe;Me&&Xe==="horizontal"&&(Vr+="-reverse");const mr=({finger:tn,move:Qr=!1})=>{const{current:wn}=ur,{width:gn,height:In,bottom:yn,left:Mn}=wn.getBoundingClientRect();let on;Vr.indexOf("vertical")===0?on=(yn-tn.y)/In:on=(tn.x-Mn)/gn,Vr.indexOf("-reverse")!==-1&&(on=1-on);let Yr;
629if(Yr=percentToValue(on,Be,$e),Ge)Yr=roundValueToStep(Yr,Ge,Be);else{const On=findClosest(br,Yr);Yr=br[On]}Yr=clamp$2(Yr,Be,$e);let sn=0;if(sr){Qr?sn=Hr.current:sn=findClosest(xr,Yr),Oe&&(Yr=clamp$2(Yr,xr[sn-1]||-1/0,xr[sn+1]||1/0));const On=Yr;Yr=setValueIndex({values:xr,newValue:Yr,index:sn}),Oe&&Qr||(sn=Yr.indexOf(On),Hr.current=sn)}return{newValue:Yr,activeIndex:sn}},Sr=useEventCallback(tn=>{const Qr=trackFinger(tn,Qe);if(!Qr)return;if(pr.current+=1,tn.type==="mousemove"&&tn.buttons===0){Lr(tn);return}const{newValue:wn,activeIndex:gn}=mr({finger:Qr,move:!0});focusThumb({sliderRef:ur,activeIndex:gn,setActive:Je}),nr(wn),!ar&&pr.current>INTENTIONAL_DRAG_COUNT_THRESHOLD&&or(!0),hr&&!areValuesEqual(wn,tr)&&hr(tn,wn,gn)}),Lr=useEventCallback(tn=>{const Qr=trackFinger(tn,Qe);if(or(!1),!Qr)return;const{newValue:wn}=mr({finger:Qr,move:!0});Je(-1),tn.type==="touchend"&&rr(-1),We&&We(tn,wn),Qe.current=void 0,fr()}),jr=useEventCallback(tn=>{if(je)return;doesSupportTouchActionNone()||tn.preventDefault();const Qr=tn.changedTouches[0];Qr!=null&&(Qe.current=Qr.identifier);const wn=trackFinger(tn,Qe);if(wn!==!1){const{newValue:In,activeIndex:yn}=mr({finger:wn});focusThumb({sliderRef:ur,activeIndex:yn,setActive:Je}),nr(In),hr&&!areValuesEqual(In,tr)&&hr(tn,In,yn)}pr.current=0;const gn=ownerDocument(ur.current);gn.addEventListener("touchmove",Sr,{passive:!0}),gn.addEventListener("touchend",Lr,{passive:!0})}),fr=reactExports.useCallback(()=>{const tn=ownerDocument(ur.current);tn.removeEventListener("mousemove",Sr),tn.removeEventListener("mouseup",Lr),tn.removeEventListener("touchmove",Sr),tn.removeEventListener("touchend",Lr)},[Lr,Sr]);reactExports.useEffect(()=>{const{current:tn}=ur;return tn.addEventListener("touchstart",jr,{passive:doesSupportTouchActionNone()}),()=>{tn.removeEventListener("touchstart",jr),fr()}},[fr,jr]),reactExports.useEffect(()=>{je&&fr()},[je,fr]);const Cr=tn=>Qr=>{var wn;if((wn=tn.onMouseDown)==null||wn.call(tn,Qr),je||Qr.defaultPrevented||Qr.button!==0)return;Qr.preventDefault();const gn=trackFinger(Qr,Qe);if(gn!==!1){const{newValue:yn,activeIndex:Mn}=mr({finger:gn});focusThumb({sliderRef:ur,activeIndex:Mn,setActive:Je}),nr(yn),hr&&!areValuesEqual(yn,tr)&&hr(Qr,yn,Mn)}pr.current=0;const In=ownerDocument(ur.current);In.addEventListener("mousemove",Sr,{passive:!0}),In.addEventListener("mouseup",Lr)},Mr=valueToPercent(sr?xr[0]:Be,Be,$e),$r=valueToPercent(xr[xr.length-1],Be,$e)-Mr,Fr=(tn={})=>{const Qr=extractEventHandlers(tn),wn={onMouseDown:Cr(Qr||{})},gn=_extends$1({},Qr,wn);return _extends$1({},tn,{ref:_r},gn)},Kr=tn=>Qr=>{var wn;(wn=tn.onMouseOver)==null||wn.call(tn,Qr);const gn=Number(Qr.currentTarget.getAttribute("data-index"));rr(gn)},an=tn=>Qr=>{var wn;(wn=tn.onMouseLeave)==null||wn.call(tn,Qr),rr(-1)};return{active:Ze,axis:Vr,axisProps,dragging:ar,focusedThumbIndex:cr,getHiddenInputProps:(tn={})=>{var Qr;const wn=extractEventHandlers(tn),gn={onChange:Br(wn||{}),onFocus:Ir(wn||{}),onBlur:Ar(wn||{}),onKeyDown:Nr(wn||{})},In=_extends$1({},wn,gn);return _extends$1({tabIndex:Ve,"aria-labelledby":Re,"aria-orientation":Xe,"aria-valuemax":qe($e),"aria-valuemin":qe(Be),name:Ue,type:"range",min:Ee.min,max:Ee.max,step:Ee.step===null&&Ee.marks?"any":(Qr=Ee.step)!=null?Qr:void 0,disabled:je},tn,In,{style:_extends$1({},visuallyHidden,{direction:Me?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:Fr,getThumbProps:(tn={})=>{const Qr=extractEventHandlers(tn),wn={onMouseOver:Kr(Qr||{}),onMouseLeave:an(Qr||{})};return _extends$1({},tn,Qr,wn)},marks:Rr,open:ir,range:sr,rootRef:_r,trackLeap:$r,trackOffset:Mr,values:xr,getThumbStyle:tn=>({pointerEvents:Ze!==-1&&Ze!==tn?"none":void 0})}}const shouldSpreadAdditionalProps=Ee=>!Ee||!isHostComponent(Ee);function getSliderUtilityClass(Ee){return generateUtilityClass("MuiSlider",Ee)}const sliderClasses=generateUtilityClasses("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),useValueLabelClasses=Ee=>{const{open:Re}=Ee;return{offset:clsx(Re&&sliderClasses.valueLabelOpen),circle:sliderClasses.valueLabelCircle,label:sliderClasses.valueLabelLabel}};function SliderValueLabel$1(Ee){const{children:Re,className:Te,value:je}=Ee,Oe=useValueLabelClasses(Ee);return Re?reactExports.cloneElement(Re,{className:clsx(Re.props.className)},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Re.props.children,jsxRuntimeExports.jsx("span",{className:clsx(Oe.offset,Te),"aria-hidden":!0,
vendor: 9,331 bytes, line 629
629children:jsxRuntimeExports.jsx("span",{className:Oe.circle,children:jsxRuntimeExports.jsx("span",{className:Oe.label,children:je})})})]})):null}const _excluded$b=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function Identity(Ee){return Ee}const SliderRoot=styled("span",{name:"MuiSlider",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[`color${capitalize$1(Te.color)}`],Te.size!=="medium"&&Re[`size${capitalize$1(Te.size)}`],Te.marked&&Re.marked,Te.orientation==="vertical"&&Re.vertical,Te.track==="inverted"&&Re.trackInverted,Te.track===!1&&Re.trackFalse]}})(({theme:Ee})=>{var Re;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${sliderClasses.disabled}`]:{pointerEvents:"none",cursor:"default",color:(Ee.vars||Ee).palette.grey[400]},[`&.${sliderClasses.dragging}`]:{[`& .${sliderClasses.thumb}, & .${sliderClasses.track}`]:{transition:"none"}},variants:[...Object.keys(((Re=Ee.vars)!=null?Re:Ee).palette).filter(Te=>{var je;return((je=Ee.vars)!=null?je:Ee).palette[Te].main}).map(Te=>({props:{color:Te},style:{color:(Ee.vars||Ee).palette[Te].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),SliderRail=styled("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(Ee,Re)=>Re.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),SliderTrack=styled("span",{name:"MuiSlider",slot:"Track",overridesResolver:(Ee,Re)=>Re.track})(({theme:Ee})=>{var Re;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:Ee.transitions.create(["left","width","bottom","height"],{duration:Ee.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((Re=Ee.vars)!=null?Re:Ee).palette).filter(Te=>{var je;return((je=Ee.vars)!=null?je:Ee).palette[Te].main}).map(Te=>({props:{color:Te,track:"inverted"},style:_extends$1({},Ee.vars?{backgroundColor:Ee.vars.palette.Slider[`${Te}Track`],borderColor:Ee.vars.palette.Slider[`${Te}Track`]}:_extends$1({backgroundColor:lighten_1(Ee.palette[Te].main,.62),borderColor:lighten_1(Ee.palette[Te].main,.62)},Ee.applyStyles("dark",{backgroundColor:darken_1(Ee.palette[Te].main,.5)}),Ee.applyStyles("dark",{borderColor:darken_1(Ee.palette[Te].main,.5)})))}))]}}),SliderThumb=styled("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.thumb,Re[`thumbColor${capitalize$1(Te.color)}`],Te.size!=="medium"&&Re[`thumbSize${capitalize$1(Te.size)}`]]}})(({theme:Ee})=>{var Re;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:Ee.transitions.create(["box-shadow","left","bottom"],{duration:Ee.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(Ee.vars||Ee).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${sliderClasses.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.keys(((Re=Ee.vars)!=null?Re:Ee).palette).filter(Te=>{var je;return((je=Ee.vars)!=null?je:Ee).palette[Te].main}).map(Te=>({props:{color:Te},style:{[`&:hover, &.${sliderClasses.focusVisible}`]:_extends$1({},Ee.vars?{boxShadow:`0px 0px 0px 8px rgba(${Ee.vars.palette[Te].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${alpha_1(Ee.palette[Te].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${sliderClasses.active}`]:_extends$1({},Ee.vars?{boxShadow:`0px 0px 0px 14px rgba(${Ee.vars.palette[Te].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${alpha_1(Ee.palette[Te].main,.16)}`})}}))]}}),SliderValueLabel=styled(SliderValueLabel$1,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(Ee,Re)=>Re.valueLabel})(({theme:Ee})=>_extends$1({zIndex:1,whiteSpace:"nowrap"},Ee.typography.body2,{fontWeight:500,transition:Ee.transitions.create(["transform"],{duration:Ee.transitions.duration.shortest}),position:"absolute",backgroundColor:(Ee.vars||Ee).palette.grey[600],borderRadius:2,color:(Ee.vars||Ee).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${sliderClasses.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${sliderClasses.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:Ee.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),SliderMark=styled("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:Ee=>slotShouldForwardProp(Ee)&&Ee!=="markActive",overridesResolver:(Ee,Re)=>{const{markActive:Te}=Ee;return[Re.mark,Te&&Re.markActive]}})(({theme:Ee})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(Ee.vars||Ee).palette.background.paper,opacity:.8}}]})),SliderMarkLabel=styled("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:Ee=>slotShouldForwardProp(Ee)&&Ee!=="markLabelActive",overridesResolver:(Ee,Re)=>Re.markLabel})(({theme:Ee})=>_extends$1({},Ee.typography.body2,{color:(Ee.vars||Ee).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(Ee.vars||Ee).palette.text.primary}}]})),useUtilityClasses$a=Ee=>{const{disabled:Re,dragging:Te,marked:je,orientation:Oe,track:Me,classes:De,color:$e,size:Be}=Ee,Ue={root:["root",Re&&"disabled",Te&&"dragging",je&&"marked",Oe==="vertical"&&"vertical",Me==="inverted"&&"trackInverted",Me===!1&&"trackFalse",$e&&`color${capitalize$1($e)}`,Be&&`size${capitalize$1(Be)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",Re&&"disabled",Be&&`thumbSize${capitalize$1(Be)}`,$e&&`thumbColor${capitalize$1($e)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return composeClasses(Ue,getSliderUtilityClass,De)},Forward=({children:Ee})=>Ee,Slider=reactExports.forwardRef(function(Re,Te){var je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze,Je,ir,rr,ar,or,pr;const tr=useDefaultProps({props:Re,name:"MuiSlider"}),nr=useRtl(),{"aria-label":hr,"aria-valuetext":sr,"aria-labelledby":xr,component:Rr="span",components:br={},componentsProps:wr={},color:vr="primary",classes:Dr,className:kr,disableSwap:cr=!1,disabled:dr=!1,getAriaLabel:ur,getAr
629iaValueText:gr,marks:_r=!1,max:Ir=100,min:Ar=0,orientation:Tr="horizontal",shiftStep:Nr=10,size:Br="medium",step:Hr=1,scale:Vr=Identity,slotProps:mr,slots:Sr,track:Lr="normal",valueLabelDisplay:jr="off",valueLabelFormat:fr=Identity}=tr,Cr=_objectWithoutPropertiesLoose(tr,_excluded$b),Mr=_extends$1({},tr,{isRtl:nr,max:Ir,min:Ar,classes:Dr,disabled:dr,disableSwap:cr,orientation:Tr,marks:_r,color:vr,size:Br,step:Hr,shiftStep:Nr,scale:Vr,track:Lr,valueLabelDisplay:jr,valueLabelFormat:fr}),{axisProps:$r,getRootProps:Fr,getHiddenInputProps:Kr,getThumbProps:an,open:Wr,active:hn,axis:cn,focusedThumbIndex:tn,range:Qr,dragging:wn,marks:gn,values:In,trackOffset:yn,trackLeap:Mn,getThumbStyle:on}=useSlider(_extends$1({},Mr,{rootRef:Te}));Mr.marked=gn.length>0&&gn.some(Sn=>Sn.label),Mr.dragging=wn,Mr.focusedThumbIndex=tn;const Yr=useUtilityClasses$a(Mr),sn=(je=(Oe=Sr==null?void 0:Sr.root)!=null?Oe:br.Root)!=null?je:SliderRoot,On=(Me=(De=Sr==null?void 0:Sr.rail)!=null?De:br.Rail)!=null?Me:SliderRail,Bn=($e=(Be=Sr==null?void 0:Sr.track)!=null?Be:br.Track)!=null?$e:SliderTrack,Hn=(Ue=(ze=Sr==null?void 0:Sr.thumb)!=null?ze:br.Thumb)!=null?Ue:SliderThumb,Zr=(We=(Xe=Sr==null?void 0:Sr.valueLabel)!=null?Xe:br.ValueLabel)!=null?We:SliderValueLabel,xn=(He=(qe=Sr==null?void 0:Sr.mark)!=null?qe:br.Mark)!=null?He:SliderMark,An=(Ge=(Ye=Sr==null?void 0:Sr.markLabel)!=null?Ye:br.MarkLabel)!=null?Ge:SliderMarkLabel,Wn=(Ve=(Ke=Sr==null?void 0:Sr.input)!=null?Ke:br.Input)!=null?Ve:"input",ss=(Qe=mr==null?void 0:mr.root)!=null?Qe:wr.root,Yn=(Ze=mr==null?void 0:mr.rail)!=null?Ze:wr.rail,en=(Je=mr==null?void 0:mr.track)!=null?Je:wr.track,Gr=(ir=mr==null?void 0:mr.thumb)!=null?ir:wr.thumb,nn=(rr=mr==null?void 0:mr.valueLabel)!=null?rr:wr.valueLabel,En=(ar=mr==null?void 0:mr.mark)!=null?ar:wr.mark,Cn=(or=mr==null?void 0:mr.markLabel)!=null?or:wr.markLabel,jn=(pr=mr==null?void 0:mr.input)!=null?pr:wr.input,$n=useSlotProps({elementType:sn,getSlotProps:Fr,externalSlotProps:ss,externalForwardedProps:Cr,additionalProps:_extends$1({},shouldSpreadAdditionalProps(sn)&&{as:Rr}),ownerState:_extends$1({},Mr,ss==null?void 0:ss.ownerState),className:[Yr.root,kr]}),Vn=useSlotProps({elementType:On,externalSlotProps:Yn,ownerState:Mr,className:Yr.rail}),Qn=useSlotProps({elementType:Bn,externalSlotProps:en,additionalProps:{style:_extends$1({},$r[cn].offset(yn),$r[cn].leap(Mn))},ownerState:_extends$1({},Mr,en==null?void 0:en.ownerState),className:Yr.track}),Un=useSlotProps({elementType:Hn,getSlotProps:an,externalSlotProps:Gr,ownerState:_extends$1({},Mr,Gr==null?void 0:Gr.ownerState),className:Yr.thumb}),fs=useSlotProps({elementType:Zr,externalSlotProps:nn,ownerState:_extends$1({},Mr,nn==null?void 0:nn.ownerState),className:Yr.valueLabel}),Jn=useSlotProps({elementType:xn,externalSlotProps:En,ownerState:Mr,className:Yr.mark}),ts=useSlotProps({elementType:An,externalSlotProps:Cn,ownerState:Mr,className:Yr.markLabel}),cs=useSlotProps({elementType:Wn,getSlotProps:Kr,externalSlotProps:jn,ownerState:Mr});return jsxRuntimeExports.jsxs(sn,_extends$1({},$n,{children:[jsxRuntimeExports.jsx(On,_extends$1({},Vn)),jsxRuntimeExports.jsx(Bn,_extends$1({},Qn)),gn.filter(Sn=>Sn.value>=Ar&&Sn.value<=Ir).map((Sn,mn)=>{const zn=valueToPercent(Sn.value,Ar,Ir),os=$r[cn].offset(zn);let ls;return Lr===!1?ls=In.indexOf(Sn.value)!==-1:ls=Lr==="normal"&&(Qr?Sn.value>=In[0]&&Sn.value<=In[In.length-1]:Sn.value<=In[0])||Lr==="inverted"&&(Qr?Sn.value<=In[0]||Sn.value>=In[In.length-1]:Sn.value>=In[0]),jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(xn,_extends$1({"data-index":mn},Jn,!isHostComponent(xn)&&{markActive:ls},{style:_extends$1({},os,Jn.style),className:clsx(Jn.className,ls&&Yr.markActive)})),Sn.label!=null?jsxRuntimeExports.jsx(An,_extends$1({"aria-hidden":!0,"data-index":mn},ts,!isHostComponent(An)&&{markLabelActive:ls},{style:_extends$1({},os,ts.style),className:clsx(Yr.markLabel,ts.className,ls&&Yr.markLabelActive),children:Sn.label})):null]},mn)}),In.map((Sn,mn)=>{const zn=valueToPercent(Sn,Ar,Ir),os=$r[cn].offset(zn),ls=jr==="off"?Forward:Zr;return jsxRuntimeExports.jsx(ls,_extends$1({}
629,!isHostComponent(ls)&&{valueLabelFormat:fr,valueLabelDisplay:jr,value:typeof fr=="function"?fr(Vr(Sn),mn):fr,index:mn,open:Wr===mn||hn===mn||jr==="on",disabled:dr},fs,{children:jsxRuntimeExports.jsx(Hn,_extends$1({"data-index":mn},Un,{className:clsx(Yr.thumb,Un.className,hn===mn&&Yr.active,tn===mn&&Yr.focusVisible),style:_extends$1({},os,on(mn),Un.style),children:jsxRuntimeExports.jsx(Wn,_extends$1({"data-index":mn,"aria-label":ur?ur(mn):hr,"aria-valuenow":Vr(Sn),"aria-labelledby":xr,"aria-valuetext":gr?gr(Vr(Sn),mn):sr,value:In[mn]},cs))}))}),mn)})]}))});function useSnackbar(Ee={}){const{autoHideDuration:Re=null,disableWindowBlurListener:Te=!1,onClose:je,open:Oe,resumeHideDuration:Me}=Ee,De=useTimeout();reactExports.useEffect(()=>{if(!Oe)return;function Ve(Ke){Ke.defaultPrevented||(Ke.key==="Escape"||Ke.key==="Esc")&&(je==null||je(Ke,"escapeKeyDown"))}return document.addEventListener("keydown",Ve),()=>{document.removeEventListener("keydown",Ve)}},[Oe,je]);const $e=useEventCallback((Ve,Ke)=>{je==null||je(Ve,Ke)}),Be=useEventCallback(Ve=>{!je||Ve==null||De.start(Ve,()=>{$e(null,"timeout")})});reactExports.useEffect(()=>(Oe&&Be(Re),De.clear),[Oe,Re,Be,De]);const Ue=Ve=>{je==null||je(Ve,"clickaway")},ze=De.clear,We=reactExports.useCallback(()=>{Re!=null&&Be(Me??Re*.5)},[Re,Me,Be]),Xe=Ve=>Ke=>{const Qe=Ve.onBlur;Qe==null||Qe(Ke),We()},He=Ve=>Ke=>{const Qe=Ve.onFocus;Qe==null||Qe(Ke),ze()},qe=Ve=>Ke=>{const Qe=Ve.onMouseEnter;Qe==null||Qe(Ke),ze()},Ge=Ve=>Ke=>{const Qe=Ve.onMouseLeave;Qe==null||Qe(Ke),We()};return reactExports.useEffect(()=>{if(!Te&&Oe)return window.addEventListener("focus",We),window.addEventListener("blur",ze),()=>{window.removeEventListener("focus",We),window.removeEventListener("blur",ze)}},[Te,Oe,We,ze]),{getRootProps:(Ve={})=>{const Ke=_extends$1({},extractEventHandlers(Ee),extractEventHandlers(Ve));return _extends$1({role:"presentation"},Ve,Ke,{onBlur:Xe(Ke),onFocus:He(Ke),onMouseEnter:qe(Ke),onMouseLeave:Ge(Ke)})},onClickAway:Ue}}function getSnackbarContentUtilityClass(Ee){return generateUtilityClass("MuiSnackbarContent",Ee)}generateUtilityClasses("MuiSnackbarContent",["root","message","action"]);const _excluded$a=["action","className","message","role"],useUtilityClasses$9=Ee=>{const{classes:Re}=Ee;return composeClasses({root:["root"],action:["action"],message:["message"]},getSnackbarContentUtilityClass,Re)},SnackbarContentRoot=styled(Paper,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})(({theme:Ee})=>{const Re=Ee.palette.mode==="light"?.8:.98,Te=emphasize_1(Ee.palette.background.default,Re);return _extends$1({},Ee.typography.body2,{color:Ee.vars?Ee.vars.palette.SnackbarContent.color:Ee.palette.getContrastText(Te),backgroundColor:Ee.vars?Ee.vars.palette.SnackbarContent.bg:Te,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(Ee.vars||Ee).shape.borderRadius,flexGrow:1,[Ee.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),SnackbarContentMessage=styled("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(Ee,Re)=>Re.message})({padding:"8px 0"}),SnackbarContentAction=styled("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(Ee,Re)=>Re.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),SnackbarContent=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiSnackbarContent"}),{action:Oe,className:Me,message:De,role:$e="alert"}=je,Be=_objectWithoutPropertiesLoose(je,_excluded$a),Ue=je,ze=useUtilityClasses$9(Ue);return jsxRuntimeExports.jsxs(SnackbarContentRoot,_extends$1({role:$e,square:!0,elevation:6,className:clsx(ze.root,Me),ownerState:Ue,ref:Te},Be,{children:[jsxRuntimeExports.jsx(SnackbarContentMessage,{className:ze.message,ownerState:Ue,children:De}),Oe?jsxRuntimeExports.jsx(SnackbarContentAction,{className:ze.action,ownerState:Ue,children:Oe}):null]}))});function getSnackbarUtilityClass(Ee){return generateUtilityClass("MuiSnackbar",Ee)}generateUtilityClasses("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const _excluded$9=["onEnter","onExited"],_excluded2$1=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],useUtilityClasses$8=Ee=>{const{classes:Re,anchorOrigin:Te}=Ee,je={root:["root",`anchorOrigin${capitalize$1(Te.vertical)}${capitalize$1(Te.horizontal)}`]};return composeClasses(je,getSnackbarUtilityClass,Re)},SnackbarRoot=styled("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[`anchorOrigin${capitalize$1(Te.anchorOrigin.vertical)}${capitalize$1(Te.anchorOrigin.horizontal)}`]]}})(({theme:Ee,ownerState:Re})=>{const Te={left:"50%",right:"auto",transform:"translateX(-50%)"};return _extends$1({zIndex:(Ee.vars||Ee).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},Re.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},Re.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},Re.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[Ee.breakpoints.up("sm")]:_extends$1({},Re.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},Re.anchorOrigin.horizontal==="center"&&Te,Re.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},Re.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),Snackbar=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiSnackbar"}),Oe=useTheme$1(),Me={enter:Oe.transitions.duration.enteringScreen,exit:Oe.transitions.duration.leavingScreen},{action:De,anchorOrigin:{vertical:$e,horizontal:Be}={vertical:"bottom",horizontal:"left"},autoHideDuration:Ue=null,children:ze,className:We,ClickAwayListenerProps:Xe,ContentProps:He,disableWindowBlurListener:qe=!1,message:Ge,open:Ye,TransitionComponent:Ve=Grow,transitionDuration:Ke=Me,TransitionProps:{onEnter:Qe,onExited:Ze}={}}=je,Je=_objectWithoutPropertiesLoose(je.TransitionProps,_excluded$9),ir=_objectWithoutPropertiesLoose(je,_excluded2$1),rr=_extends$1({},je,{anchorOrigin:{vertical:$e,horizontal:Be},autoHideDuration:Ue,disableWindowBlurListener:qe,TransitionComponent:Ve,transitionDuration:Ke}),ar=useUtilityClasses$8(rr),{getRootProps:or,onClickAway:pr}=useSnackbar(_extends$1({},rr)),[tr,nr]=reactExports.useState(!0),hr=useSlotProps({elementType:SnackbarRoot,getSlotProps:or,externalForwardedProps:ir,ownerState:rr,additionalProps:{ref:Te},className:[ar.root,We]}),sr=Rr=>{nr(!0),Ze&&Ze(Rr)},xr=(Rr,br)=>{nr(!1),Qe&&Qe(Rr,br)};return!Ye&&tr?null:jsxRuntimeExports.jsx(ClickAwayListener,_extends$1({onClickAway:pr},Xe,{children:jsxRuntimeExports.jsx(SnackbarRoot,_extends$1({},hr,{children:jsxRuntimeExports.jsx(Ve,_extends$1({appear:!0,in:Ye,timeout:Ke,direction:$e==="top"?"down":"up",onEnter:xr,onExited:sr},Je,{children:ze||jsxRuntimeExports.jsx(SnackbarContent,_extends$1({message:Ge,action:De},He))}))}))}))});function getTooltipUtilityClass(Ee){return generateUtilityClass("MuiTooltip",
vendor: 18,728 bytes, line 629
629Ee)}const tooltipClasses=generateUtilityClasses("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),_excluded$8=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function round(Ee){return Math.round(Ee*1e5)/1e5}const useUtilityClasses$7=Ee=>{const{classes:Re,disableInteractive:Te,arrow:je,touch:Oe,placement:Me}=Ee,De={popper:["popper",!Te&&"popperInteractive",je&&"popperArrow"],tooltip:["tooltip",je&&"tooltipArrow",Oe&&"touch",`tooltipPlacement${capitalize$1(Me.split("-")[0])}`],arrow:["arrow"]};return composeClasses(De,getTooltipUtilityClass,Re)},TooltipPopper=styled(Popper,{name:"MuiTooltip",slot:"Popper",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.popper,!Te.disableInteractive&&Re.popperInteractive,Te.arrow&&Re.popperArrow,!Te.open&&Re.popperClose]}})(({theme:Ee,ownerState:Re,open:Te})=>_extends$1({zIndex:(Ee.vars||Ee).zIndex.tooltip,pointerEvents:"none"},!Re.disableInteractive&&{pointerEvents:"auto"},!Te&&{pointerEvents:"none"},Re.arrow&&{[`&[data-popper-placement*="bottom"] .${tooltipClasses.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${tooltipClasses.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]:_extends$1({},Re.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]:_extends$1({},Re.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),TooltipTooltip=styled("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.tooltip,Te.touch&&Re.touch,Te.arrow&&Re.tooltipArrow,Re[`tooltipPlacement${capitalize$1(Te.placement.split("-")[0])}`]]}})(({theme:Ee,ownerState:Re})=>_extends$1({backgroundColor:Ee.vars?Ee.vars.palette.Tooltip.bg:alpha_1(Ee.palette.grey[700],.92),borderRadius:(Ee.vars||Ee).shape.borderRadius,color:(Ee.vars||Ee).palette.common.white,fontFamily:Ee.typography.fontFamily,padding:"4px 8px",fontSize:Ee.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:Ee.typography.fontWeightMedium},Re.arrow&&{position:"relative",margin:0},Re.touch&&{padding:"8px 16px",fontSize:Ee.typography.pxToRem(14),lineHeight:`${round(16/14)}em`,fontWeight:Ee.typography.fontWeightRegular},{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:_extends$1({transformOrigin:"right center"},Re.isRtl?_extends$1({marginLeft:"14px"},Re.touch&&{marginLeft:"24px"}):_extends$1({marginRight:"14px"},Re.touch&&{marginRight:"24px"})),[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:_extends$1({transformOrigin:"left center"},Re.isRtl?_extends$1({marginRight:"14px"},Re.touch&&{marginRight:"24px"}):_extends$1({marginLeft:"14px"},Re.touch&&{marginLeft:"24px"})),[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]:_extends$1({transformOrigin:"center bottom",marginBottom:"14px"},Re.touch&&{marginBottom:"24px"}),[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]:_extends$1({transformOrigin:"center top",marginTop:"14px"},Re.touch&&{marginTop:"24px"})})),TooltipArrow=styled("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(Ee,Re)=>Re.arrow})(({theme:Ee})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:Ee.vars?Ee.vars.palette.Tooltip.bg:alpha_1(Ee.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let hystersisOpen=!1;const hystersisTimer=new Timeout;let cursorPosition={x:0,y:0};function composeEventHandler(Ee,Re){return(Te,...je)=>{Re&&Re(Te,...je),Ee(Te,...je)}}const Tooltip=reactExports.forwardRef(function(Re,Te){var je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze,Je;const ir=useDefaultProps({props:Re,name:"MuiTooltip"}),{arrow:rr=!1,children:ar,components:or={},componentsProps:pr={},describeChild:tr=!1,disableFocusListener:nr=!1,disableHoverListener:hr=!1,disableInteractive:sr=!1,disableTouchListener:xr=!1,enterDelay:Rr=100,enterNextDelay:br=0,enterTouchDelay:wr=700,followCursor:vr=!1,id:Dr,leaveDelay:kr=0,leaveTouchDelay:cr=1500,onClose:dr,onOpen:ur,open:gr,placement:_r="bottom",PopperComponent:Ir,PopperProps:Ar={},slotProps:Tr={},slots:Nr={},title:Br,TransitionComponent:Hr=Grow,TransitionProps:Vr}=ir,mr=_objectWithoutPropertiesLoose(ir,_excluded$8),Sr=reactExports.isValidElement(ar)?ar:jsxRuntimeExports.jsx("span",{children:ar}),Lr=useTheme$1(),jr=useRtl(),[fr,Cr]=reactExports.useState(),[Mr,$r]=reactExports.useState(null),Fr=reactExports.useRef(!1),Kr=sr||vr,an=useTimeout(),Wr=useTimeout(),hn=useTimeout(),cn=useTimeout(),[tn,Qr]=useControlled({controlled:gr,default:!1,name:"Tooltip",state:"open"});let wn=tn;const gn=useId(Dr),In=reactExports.useRef(),yn=useEventCallback(()=>{In.current!==void 0&&(document.body.style.WebkitUserSelect=In.current,In.current=void 0),cn.clear()});reactExports.useEffect(()=>yn,[yn]);const Mn=hs=>{hystersisTimer.clear(),hystersisOpen=!0,Qr(!0),ur&&!wn&&ur(hs)},on=useEventCallback(hs=>{hystersisTimer.start(800+kr,()=>{hystersisOpen=!1}),Qr(!1),dr&&wn&&dr(hs),an.start(Lr.transitions.duration.shortest,()=>{Fr.current=!1})}),Yr=hs=>{Fr.current&&hs.type!=="touchstart"||(fr&&fr.removeAttribute("title"),Wr.clear(),hn.clear(),Rr||hystersisOpen&&br?Wr.start(hystersisOpen?br:Rr,()=>{Mn(hs)}):Mn(hs))},sn=hs=>{Wr.clear(),hn.start(kr,()=>{on(hs)})},{isFocusVisibleRef:On,onBlur:Bn,onFocus:Hn,ref:Zr}=useIsFocusVisible(),[,xn]=reactExports.useState(!1),An=hs=>{Bn(hs),On.current===!1&&(xn(!1),sn(hs))},Wn=hs=>{fr||Cr(hs.currentTarget),Hn(hs),On.current===!0&&(xn(!0),Yr(hs))},ss=hs=>{Fr.current=!0;const Cs=Sr.props;Cs.onTouchStart&&Cs.onTouchStart(hs)},Yn=hs=>{ss(hs),hn.clear(),an.clear(),yn(),In.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",cn.start(wr,()=>{document.body.style.WebkitUserSelect=In.current,Yr(hs)})},en=hs=>{Sr.props.onTouchEnd&&Sr.props.onTouchEnd(hs),yn(),hn.start(cr,()=>{on(hs)})};reactExports.useEffect(()=>{if(!wn)return;function hs(Cs){(Cs.key==="Escape"||Cs.key==="Esc")&&on(Cs)}return document.addEventListener("keydown",hs),()=>{document.removeEventListener("keydown",hs)}},[on,wn]);const Gr=useForkRef(getReactElementRef(Sr),Zr,Cr,Te);!Br&&Br!==0&&(wn=!1);const nn=reactExports.useRef(),En=hs=>{const Cs=Sr.props;Cs.onMouseMove&&Cs.onMouseMove(hs),cursorPosition={x:hs.clientX,y:hs.clientY},nn.current&&nn.current.update()},Cn={},jn=typeof Br=="string";tr?(Cn.title=!wn&&jn&&!hr?Br:null,Cn["aria-describedby"]=wn?gn:null):(Cn["aria-label"]=jn?Br:null,Cn["aria-labelledby"]=wn&&!jn?gn:null);const $n=_extends$1({},Cn,mr,Sr.props,{className:clsx(mr.className,Sr.props.className),onTouchStart:ss,ref:Gr},vr?{onMouseMove:En}:{}),Vn={};xr||($n.onTouchStart=Yn,$n.onTouchEnd=en),hr||($n.onMouseOver=composeEventHandler(Yr,$n.onMouseOver),$n.onMouseLeave=composeEventHandler(sn,$n.onMouseLeave),Kr||(Vn.onMouseOver=Yr,Vn.onMouseLeave=sn)),nr||($n.onFocus=composeEventHandler(Wn,$n.onFocus),$n.onBlur=composeEventHandler(An,$n.onBlur),Kr||(Vn.onFocus=Wn,Vn.onBlur=An));const Qn=reactExports.useMemo(()=>{var hs;let Cs=[{name:"arrow",enabled:!!Mr,options:{element:Mr,padding:4}}];return(hs=Ar.popperOptions)!=null&&hs.modifiers&&(Cs=Cs.concat(Ar.popperOptions.modifiers)),_extends$1({},Ar.popperOptions,{modifiers:Cs})},[Mr,Ar]),Un=_extends$1({},ir,{isRtl:jr,arrow:rr,disableInteractive:Kr,placement:_r,PopperComponentProp:Ir,touch:Fr.current}),fs=useUtilityClasses$7(Un),Jn=(je=(Oe=Nr.popper)!=null?Oe:or.Popper)!=null?je:TooltipPopper,ts=(Me=(De=($e=Nr.transition)!=null?$e:or.Transition)!=null?De:Hr)!=null?Me:Grow,cs=(Be=(Ue=Nr.tooltip)!=null?Ue:or.Tooltip)!=null?Be:TooltipTooltip,Sn=(ze=(We=Nr.arrow)!=null?We:or.Arrow)!=null?ze:TooltipArrow,mn=appendOwnerState(Jn,_extends$1({},Ar,(Xe=Tr.popper)!=null?Xe:pr.popper,{className:clsx(fs.popper,Ar==null?void 0:Ar.className,(He=(qe=Tr.popper)!=null?qe:pr.popper)==null?void 0:He.className)}),Un),zn=appendOwnerState(ts,_extends$1({},Vr,(Ge=Tr.transition)!=null?Ge:pr.transition),Un),os=appendOwnerState(cs,_extends$1({},(Ye=Tr.tooltip)!=null?Ye:pr.tooltip,{className:clsx(fs.tooltip,(Ve=(Ke=Tr.tooltip)!=null?Ke:pr.tooltip)==null?void 0:Ve.className)}),Un),ls=appendOwnerState(Sn,_extends$1({},(Qe=Tr.arrow)!=null?Qe:pr.arrow,{className:clsx(fs.arrow,(Ze=(Je=Tr.arrow)!=null?Je:pr.arrow)==null?void 0:Ze.className)}),Un);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[reactExports.cloneElement(Sr,$n),jsxRuntimeExports.jsx(Jn,_extends$1({as:Ir??Popper,placement:_r,anchorEl:vr?{getBoundingClientRect:()=>({top:cursorPosition.y,left:cursorPosition.x,right:cursorPosition.x,bottom:cursorPosition.y,width:0,height:0})}:fr,popperRef:nn,open:fr?wn:!1,id:gn,transition:!0},Vn,mn,{popperOptions:Qn,children:({TransitionProps:hs})=>jsxRuntimeExports.jsx(ts,_extends$1({timeout:Lr.transitions.duration.shorter},hs,zn,{children:jsxRuntimeExports.jsxs(cs,_extends$1({},os,{children:[Br,rr?jsxRuntimeExports.jsx(Sn,_extends$1({},ls,{ref:$r})):null]}))}))}))]})});function getSwitchUtilityClass(Ee){return generateUtilityClass("MuiSwitch",Ee)}const switchClasses=generateUtilityClasses("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),_excluded$7=["className","color","edge","size","sx"],useUtilityClasses$6=Ee=>{const{classes:Re,edge:Te,size:je,color:Oe,checked:Me,disabled:De}=Ee,$e={root:["root",Te&&`edge${capitalize$1(Te)}`,`size${capitalize$1(je)}`],switchBase:["switchBase",`color${capitalize$1(Oe)}`,Me&&"checked",De&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},Be=composeClasses($e,getSwitchUtilityClass,Re);return _extends$1({},Re,Be)},SwitchRoot=styled("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.edge&&Re[`edge${capitalize$1(Te.edge)}`],Re[`size${capitalize$1(Te.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${switchClasses.thumb}`]:{width:16,height:16},[`& .${switchClasses.switchBase}`]:{padding:4,[`&.${switchClasses.checked}`]:{transform:"translateX(16px)"}}}}]}),SwitchSwitchBase=styled(SwitchBase,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.switchBase,{[`& .${switchClasses.input}`]:Re.input},Te.color!=="default"&&Re[`color${capitalize$1(Te.color)}`]]}})(({theme:Ee})=>({position:"absolute",top:0,left:0,zIndex:1,color:Ee.vars?Ee.vars.palette.Switch.defaultColor:`${Ee.palette.mode==="light"?Ee.palette.common.white:Ee.palette.grey[300]}`,transition:Ee.transitions.create(["left","transform"],{duration:Ee.transitions.duration.shortest}),[`&.${switchClasses.checked}`]:{transform:"translateX(20px)"},[`&.${switchClasses.disabled}`]:{color:Ee.vars?Ee.vars.palette.Switch.defaultDisabledColor:`${Ee.palette.mode==="light"?Ee.palette.grey[100]:Ee.palette.grey[600]}`},[`&.${switchClasses.checked} + .${switchClasses.track}`]:{opacity:.5},[`&.${switchClasses.disabled} + .${switchClasses.track}`]:{opacity:Ee.vars?Ee.vars.opacity.switchTrackDisabled:`${Ee.palette.mode==="light"?.12:.2}`},[`& .${switchClasses.input}`]:{left:"-100%",width:"300%"}}),({theme:Ee})=>({"&:hover":{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.action.activeChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Ee.palette.action.active,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(Ee.palette).filter(([,Re])=>Re.main&&Re.light).map(([Re])=>({props:{color:Re},style:{[`&.${switchClasses.checked}`]:{color:(Ee.vars||Ee).palette[Re].main,"&:hover":{backgroundColor:Ee.vars?`rgba(${Ee.vars.palette[Re].mainChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha_1(Ee.palette[Re].main,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${switchClasses.disabled}`]:{color:Ee.vars?Ee.vars.palette.Switch[`${Re}DisabledColor`]:`${Ee.palette.mode==="light"?lighten_1(Ee.palette[Re].main,.62):darken_1(Ee.palette[Re].main,.55)}`}},[`&.${switchClasses.checked} + .${switchClasses.track}`]:{backgroundColor:(Ee.vars||Ee).palette[Re].main}}}))]})),SwitchTrack=styled("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(Ee,Re)=>Re.track})(({theme:Ee})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:Ee.transitions.create(["opacity","background-color"],{duration:Ee.transitions.duration.shortest}),backgroundColor:Ee.vars?Ee.vars.palette.common.onBackground:`${Ee.palette.mode==="light"?Ee.palette.common.black:Ee.palette.common.white}`,opacity:Ee.vars?Ee.vars.opacity.switchTrack:`${Ee.palette.mode==="light"?.38:.3}`})),SwitchThumb=styled("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(Ee,Re)=>Re.thumb})(({theme:Ee})=>({boxShadow:(Ee.vars||Ee).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),Switch=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiSwitch"}),{className:Oe,color:Me="primary",edge:De=!1,size:$e="medium",sx:Be}=je,Ue=_objectWithoutPropertiesLoose(je,_excluded$7),ze=_extends$1({},je,{color:Me,edge:De,size:$e}),We=useUtilityClasses$6(ze),Xe=jsxRuntimeExports.jsx(SwitchThumb,{className:We.thumb,ownerState:ze});return jsxRuntimeExports.jsxs(SwitchRoot,{className:clsx(We.root,Oe),sx:Be,ownerState:ze,children:[jsxRuntimeExports.jsx(SwitchSwitchBase,_extends$1({type:"checkbox",icon:Xe,checkedIcon:Xe,ref:Te,ownerState:ze},Ue,{classes:_extends$1({},We,{root:We.switchBase})})),jsxRuntimeExports.jsx(SwitchTrack,{className:We.track,ownerState:ze})]})});function getTabUtilityClass(Ee){return generateUtilityClass("MuiTab",Ee)}const tabClasses=generateUtilityClasses("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),_excluded$6=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],useUtilityClasses$5=Ee=>{const{classes:Re,textColor:Te,fullWidth:je,wrapped:Oe,icon:Me,label:De,selected:$e,disabled:Be}=Ee,Ue={root:["root",Me&&De&&"labelIcon",`textColor${capitalize$1(Te)}`,je&&"fullWidth",Oe&&"wrapped",$e&&"selected",Be&&"disabled"],iconWrapper:["iconWrapper"]};return composeClasses(Ue,getTabUtilityClass,Re)},TabRoot=styled(ButtonBase,{name:"MuiTab",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.label&&Te.icon&&Re.labelIcon,Re[`textColor${capitalize$1(Te.textColor)}`],Te.fullWidth&&Re.fullWidth,Te.wrapped&&Re.wrapped,{[`& .${tabClasses.iconWrapper}`]:Re.iconWrapper}]}})(({theme:Ee,ownerState:Re})=>_extends$1({},Ee.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},Re.label&&{flexDirection:Re.iconPosition==="top"||Re.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},Re.icon&&Re.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${tabClasses.iconWrapper}`]:_extends$1({},Re.iconPosition==="top"&&{marginBottom:6},Re.iconPosition==="bottom"&&{marginTop:6},Re.iconPosition==="start"&&{marginRight:Ee.spacing(1)},Re.iconPosition==="end"&&{marginLeft:Ee.spacing(1)})},Re.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${tabClasses.selected}`]:{opacity:1},[`&.${tabClasses.disabled}`]:{opacity:(Ee.vars||Ee).palette.action.disabledOpacity}},Re.textColor==="primary"&&{color:(Ee.vars||Ee).palette.text.secondary,[`&.${tabClasses.selected}`]:{color:(Ee.vars||Ee).palette.primary.main},[`&.${tabClasses.disabled}`]:{color:(Ee.vars||Ee).palette.text.disabled}},Re.textColor==="secondary"&&{color:(Ee.vars||Ee).palette.text.secondary,[`&.${tabClasses.selected}`]:{color:(Ee.vars||Ee).palette.secondary.main},[`&.${tabClasses.disabled}`]:{color:(Ee.vars||Ee).palette.text.disabled}},Re.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},Re.wrapped&&{fontSize:Ee.typography.pxToRem(12)})),Tab=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiTab"}),{className:Oe,disabled:Me=!1,disableFocusRipple:De=!1,fullWidth:$e,icon:Be,iconPosition:Ue="top",indicator:ze,label:We,onChange:Xe,onClick:He,onFocus:qe,selected:Ge,selectionFollowsFocus:Ye,textColor:Ve="inherit",value:Ke,wrapped:Qe=!1}=je,Ze=_objectWithoutPropertiesLoose(je,_excluded$6),Je=_extends$1({},je,{disabled:Me,disableFocusRipple:De,selected:Ge,icon:!!Be,iconPosition:Ue,label:!!We,fullWidth:$e,textColor:Ve,wrapped:Qe}),ir=useUtilityClasses$5(Je),rr=Be&&We&&reactExports.isValidElement(Be)?reactExports.cloneElement(Be,{className:clsx(ir.iconWrapper,Be.props.className)}):Be,ar=pr=>{!Ge&&Xe&&Xe(pr,Ke),He&&He(pr)},or=pr=>{Ye&&!Ge&&Xe&&Xe(pr,Ke),qe&&qe(pr)};return jsxRuntimeExports.jsxs(TabRoot,_extends$1({focusRipple:!De,className:clsx(ir.root,Oe),ref:Te,role:"tab","aria-selected":Ge,disabled:Me,onClick:ar,onFocus:or,ownerState:Je,tabIndex:Ge?0:-1},Ze,{children:[Ue==="top"||Ue==="start"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[rr,We]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[We,rr]}),ze]}))}),KeyboardArrowLeft=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),KeyboardArrowRight=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function easeInOutSin(Ee){return(1+Math.sin(Math.PI*Ee-Math.PI/2))/2}function animate(Ee,Re,Te,je={},Oe=()=>{}){const{ease:Me=easeInOutSin,duration:De=300}=je;let $e=null;
629const Be=Re[Ee];let Ue=!1;const ze=()=>{Ue=!0},We=Xe=>{if(Ue){Oe(new Error("Animation cancelled"));return}$e===null&&($e=Xe);const He=Math.min(1,(Xe-$e)/De);if(Re[Ee]=Me(He)*(Te-Be)+Be,He>=1){requestAnimationFrame(()=>{Oe(null)});return}requestAnimationFrame(We)};return Be===Te?(Oe(new Error("Element already at target position")),ze):(requestAnimationFrame(We),ze)}const _excluded$5=["onChange"],styles={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ScrollbarSize(Ee){const{onChange:Re}=Ee,Te=_objectWithoutPropertiesLoose(Ee,_excluded$5),je=reactExports.useRef(),Oe=reactExports.useRef(null),Me=()=>{je.current=Oe.current.offsetHeight-Oe.current.clientHeight};return useEnhancedEffect(()=>{const De=debounce$1(()=>{const Be=je.current;Me(),Be!==je.current&&Re(je.current)}),$e=ownerWindow(Oe.current);return $e.addEventListener("resize",De),()=>{De.clear(),$e.removeEventListener("resize",De)}},[Re]),reactExports.useEffect(()=>{Me(),Re(je.current)},[Re]),jsxRuntimeExports.jsx("div",_extends$1({style:styles},Te,{ref:Oe}))}function getTabScrollButtonUtilityClass(Ee){return generateUtilityClass("MuiTabScrollButton",Ee)}const tabScrollButtonClasses=generateUtilityClasses("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),_excluded$4=["className","slots","slotProps","direction","orientation","disabled"],useUtilityClasses$4=Ee=>{const{classes:Re,orientation:Te,disabled:je}=Ee;return composeClasses({root:["root",Te,je&&"disabled"]},getTabScrollButtonUtilityClass,Re)},TabScrollButtonRoot=styled(ButtonBase,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Te.orientation&&Re[Te.orientation]]}})(({ownerState:Ee})=>_extends$1({width:40,flexShrink:0,opacity:.8,[`&.${tabScrollButtonClasses.disabled}`]:{opacity:0}},Ee.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${Ee.isRtl?-90:90}deg)`}})),TabScrollButton=reactExports.forwardRef(function(Re,Te){var je,Oe;const Me=useDefaultProps({props:Re,name:"MuiTabScrollButton"}),{className:De,slots:$e={},slotProps:Be={},direction:Ue}=Me,ze=_objectWithoutPropertiesLoose(Me,_excluded$4),We=useRtl(),Xe=_extends$1({isRtl:We},Me),He=useUtilityClasses$4(Xe),qe=(je=$e.StartScrollButtonIcon)!=null?je:KeyboardArrowLeft,Ge=(Oe=$e.EndScrollButtonIcon)!=null?Oe:KeyboardArrowRight,Ye=useSlotProps({elementType:qe,externalSlotProps:Be.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:Xe}),Ve=useSlotProps({elementType:Ge,externalSlotProps:Be.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:Xe});return jsxRuntimeExports.jsx(TabScrollButtonRoot,_extends$1({component:"div",className:clsx(He.root,De),ref:Te,role:null,ownerState:Xe,tabIndex:null},ze,{children:Ue==="left"?jsxRuntimeExports.jsx(qe,_extends$1({},Ye)):jsxRuntimeExports.jsx(Ge,_extends$1({},Ve))}))});function getTabsUtilityClass(Ee){return generateUtilityClass("MuiTabs",Ee)}const tabsClasses=generateUtilityClasses("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","
629indicator"]),_excluded$3=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],nextItem=(Ee,Re)=>Ee===Re?Ee.firstChild:Re&&Re.nextElementSibling?Re.nextElementSibling:Ee.firstChild,previousItem=(Ee,Re)=>Ee===Re?Ee.lastChild:Re&&Re.previousElementSibling?Re.previousElementSibling:Ee.lastChild,moveFocus=(Ee,Re,Te)=>{let je=!1,Oe=Te(Ee,Re);for(;Oe;){if(Oe===Ee.firstChild){if(je)return;je=!0}const Me=Oe.disabled||Oe.getAttribute("aria-disabled")==="true";if(!Oe.hasAttribute("tabindex")||Me)Oe=Te(Ee,Oe);else{Oe.focus();return}}},useUtilityClasses$3=Ee=>{const{vertical:Re,fixed:Te,hideScrollbar:je,scrollableX:Oe,scrollableY:Me,centered:De,scrollButtonsHideMobile:$e,classes:Be}=Ee;return composeClasses({root:["root",Re&&"vertical"],scroller:["scroller",Te&&"fixed",je&&"hideScrollbar",Oe&&"scrollableX",Me&&"scrollableY"],flexContainer:["flexContainer",Re&&"flexContainerVertical",De&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",$e&&"scrollButtonsHideMobile"],scrollableX:[Oe&&"scrollableX"],hideScrollbar:[je&&"hideScrollbar"]},getTabsUtilityClass,Be)},TabsRoot=styled("div",{name:"MuiTabs",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[{[`& .${tabsClasses.scrollButtons}`]:Re.scrollButtons},{[`& .${tabsClasses.scrollButtons}`]:Te.scrollButtonsHideMobile&&Re.scrollButtonsHideMobile},Re.root,Te.vertical&&Re.vertical]}})(({ownerState:Ee,theme:Re})=>_extends$1({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},Ee.vertical&&{flexDirection:"column"},Ee.scrollButtonsHideMobile&&{[`& .${tabsClasses.scrollButtons}`]:{[Re.breakpoints.down("sm")]:{display:"none"}}})),TabsScroller=styled("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.scroller,Te.fixed&&Re.fixed,Te.hideScrollbar&&Re.hideScrollbar,Te.scrollableX&&Re.scrollableX,Te.scrollableY&&Re.scrollableY]}})(({ownerState:Ee})=>_extends$1({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},Ee.fixed&&{overflowX:"hidden",width:"100%"},Ee.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},Ee.scrollableX&&{overflowX:"auto",overflowY:"hidden"},Ee.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),FlexContainer=styled("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.flexContainer,Te.vertical&&Re.flexContainerVertical,Te.centered&&Re.centered]}})(({ownerState:Ee})=>_extends$1({display:"flex"},Ee.vertical&&{flexDirection:"column"},Ee.centered&&{justifyContent:"center"})),TabsIndicator=styled("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(Ee,Re)=>Re.indicator})(({ownerState:Ee,theme:Re})=>_extends$1({position:"absolute",height:2,bottom:0,width:"100%",transition:Re.transitions.create()},Ee.indicatorColor==="primary"&&{backgroundColor:(Re.vars||Re).palette.primary.main},Ee.indicatorColor==="secondary"&&{backgroundColor:(Re.vars||Re).palette.secondary.main},Ee.vertical&&{height:"100%",width:2,right:0})),TabsScrollbarSize=styled(ScrollbarSize)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),defaultIndicatorStyle={},Tabs=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiTabs"}),Oe=useTheme$1(),Me=useRtl(),{"aria-label":De,"aria-labelledby":$e,action:Be,centered:Ue=!1,children:ze,className:We,component:Xe="div",allowScrollButtonsMobile:He=!1,indicatorColor:qe="primary",onChange:Ge,orientation:Ye="horizontal",ScrollButtonComponent:Ve=TabScrollButton,scrollButtons:Ke="auto",selectionFollowsFocus:Qe,slots:Ze={},slotProps:Je={},TabIndicatorProps:ir={},TabScrollButtonProps:rr={},textColor:ar="primary",value:or,variant:pr="standard",visibleScrollbar:tr=!1}=je,nr=_objectWithoutPropertiesLoose(je,_excluded$3),hr=pr==="scrollable",sr=Ye==="vertical",xr=sr?"scrollTop":"scrollLeft",Rr=sr?"top":"left",br=sr?"bottom":"right",wr=sr?"clientHeight":"clientWidth",vr=sr?"height":"width",Dr=_extends$1({},je,{component:Xe,allowScrollButtonsMobile:He,indicatorColor:qe,orientation:Ye,vertical:sr,scrollButtons:Ke,textColor:ar,variant:pr,visibleScrollbar:tr,fixed:!hr,hideScrollbar:hr&&!tr,scrollableX:hr&&!sr,scrollableY:hr&&sr,centered:Ue&&!hr,scrollButtonsHideMobile:!He}),kr=useUtilityClasses$3(Dr),cr=useSlotProps({elementType:Ze.StartScrollButtonIcon,externalSlotProps:Je.startScrollButtonIcon,ownerState:Dr}),dr=useSlotProps({elementType:Ze.EndScrollButtonIcon,externalSlotProps:Je.endScrollButtonIcon,ownerState:Dr}),[ur,gr]=reactExports.useState(!1),[_r,Ir]=reactExports.useState(defaultIndicatorStyle),[Ar,Tr]=reactExports.useState(!1),[Nr,Br]=reactExports.useState(!1),[Hr,Vr]=reactExports.useState(!1),[mr,Sr]=reactExports.useState({overflow:"hidden",scrollbarWidth:0}),Lr=new Map,jr=reactExports.useRef(null),fr=reactExports.useRef(null),Cr=()=>{const on=jr.current;let Yr;if(on){const On=on.getBoundingClientRect();Yr={clientWidth:on.clientWidth,scrollLeft:on.scrollLeft,scrollTop:on.scrollTop,scrollLeftNormalized:getNormalizedScrollLeft(on,Me?"rtl":"ltr"),scrollWidth:on.scrollWidth,top:On.top,bottom:On.bottom,left:On.left,right:On.right}}let sn;if(on&&or!==!1){const On=fr.current.children;if(On.length>0){const Bn=On[Lr.get(or)];sn=Bn?Bn.getBoundingClientRect():null}}return{tabsMeta:Yr,tabMeta:sn}},Mr=useEventCallback(()=>{const{tabsMeta:on,tabMeta:Yr}=Cr();let sn=0,On;if(sr)On="top",Yr&&on&&(sn=Yr.top-on.top+on.scrollTop);else if(On=Me?"right":"left",Yr&&on){const Hn=Me?on.scrollLeftNormalized+on.clientWidth-on.scrollWidth:on.scrollLeft;
629sn=(Me?-1:1)*(Yr[On]-on[On]+Hn)}const Bn={[On]:sn,[vr]:Yr?Yr[vr]:0};if(isNaN(_r[On])||isNaN(_r[vr]))Ir(Bn);else{const Hn=Math.abs(_r[On]-Bn[On]),Zr=Math.abs(_r[vr]-Bn[vr]);(Hn>=1||Zr>=1)&&Ir(Bn)}}),$r=(on,{animation:Yr=!0}={})=>{Yr?animate(xr,jr.current,on,{duration:Oe.transitions.duration.standard}):jr.current[xr]=on},Fr=on=>{let Yr=jr.current[xr];sr?Yr+=on:(Yr+=on*(Me?-1:1),Yr*=Me&&detectScrollType()==="reverse"?-1:1),$r(Yr)},Kr=()=>{const on=jr.current[wr];let Yr=0;const sn=Array.from(fr.current.children);for(let On=0;On<sn.length;On+=1){const Bn=sn[On];if(Yr+Bn[wr]>on){On===0&&(Yr=on);break}Yr+=Bn[wr]}return Yr},an=()=>{Fr(-1*Kr())},Wr=()=>{Fr(Kr())},hn=reactExports.useCallback(on=>{Sr({overflow:null,scrollbarWidth:on})},[]),cn=()=>{const on={};on.scrollbarSizeListener=hr?jsxRuntimeExports.jsx(TabsScrollbarSize,{onChange:hn,className:clsx(kr.scrollableX,kr.hideScrollbar)}):null;const sn=hr&&(Ke==="auto"&&(Ar||Nr)||Ke===!0);return on.scrollButtonStart=sn?jsxRuntimeExports.jsx(Ve,_extends$1({slots:{StartScrollButtonIcon:Ze.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:cr},orientation:Ye,direction:Me?"right":"left",onClick:an,disabled:!Ar},rr,{className:clsx(kr.scrollButtons,rr.className)})):null,on.scrollButtonEnd=sn?jsxRuntimeExports.jsx(Ve,_extends$1({slots:{EndScrollButtonIcon:Ze.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:dr},orientation:Ye,direction:Me?"left":"right",onClick:Wr,disabled:!Nr},rr,{className:clsx(kr.scrollButtons,rr.className)})):null,on},tn=useEventCallback(on=>{const{tabsMeta:Yr,tabMeta:sn}=Cr();if(!(!sn||!Yr)){if(sn[Rr]<Yr[Rr]){const On=Yr[xr]+(sn[Rr]-Yr[Rr]);$r(On,{animation:on})}else if(sn[br]>Yr[br]){const On=Yr[xr]+(sn[br]-Yr[br]);$r(On,{animation:on})}}}),Qr=useEventCallback(()=>{hr&&Ke!==!1&&Vr(!Hr)});reactExports.useEffect(()=>{const on=debounce$1(()=>{jr.current&&Mr()});let Yr;const sn=Hn=>{Hn.forEach(Zr=>{Zr.removedNodes.forEach(xn=>{var An;(An=Yr)==null||An.unobserve(xn)}),Zr.addedNodes.forEach(xn=>{var An;(An=Yr)==null||An.observe(xn)})}),on(),Qr()},On=ownerWindow(jr.current);On.addEventListener("resize",on);let Bn;return typeof ResizeObserver<"u"&&(Yr=new ResizeObserver(on),Array.from(fr.current.children).forEach(Hn=>{Yr.observe(Hn)})),typeof MutationObserver<"u"&&(Bn=new MutationObserver(sn),Bn.observe(fr.current,{childList:!0})),()=>{var Hn,Zr;on.clear(),On.removeEventListener("resize",on),(Hn=Bn)==null||Hn.disconnect(),(Zr=Yr)==null||Zr.disconnect()}},[Mr,Qr]),reactExports.useEffect(()=>{const on=Array.from(fr.current.children),Yr=on.length;if(typeof IntersectionObserver<"u"&&Yr>0&&hr&&Ke!==!1){const sn=on[0],On=on[Yr-1],Bn={root:jr.current,threshold:.99},Hn=Wn=>{Tr(!Wn[0].isIntersecting)},Zr=new IntersectionObserver(Hn,Bn);Zr.observe(sn);const xn=Wn=>{Br(!Wn[0].isIntersecting)},An=new IntersectionObserver(xn,Bn);return An.observe(On),()=>{Zr.disconnect(),An.disconnect()}}},[hr,Ke,Hr,ze==null?void 0:ze.length]),reactExports.useEffect(()=>{gr(!0)},[]),reactExports.useEffect(()=>{Mr()}),reactExports.useEffect(()=>{tn(defaultIndicatorStyle!==_r)},[tn,_r]),reactExports.useImperativeHandle(Be,()=>({updateIndicator:Mr,updateScrollButtons:Qr}),[Mr,Qr]);const wn=jsxRuntimeExports.jsx(TabsIndicator,_extends$1({},ir,{className:clsx(kr.indicator,ir.className),ownerState:Dr,style:_extends$1({},_r,ir.style)}));let gn=0;const In=reactExports.Children.map(ze,on=>{if(!reactExports.isValidElement(on))return null;const Yr=on.props.value===void 0?gn:on.props.value;Lr.set(Yr,gn);const sn=Yr===or;return gn+=1,reactExports.cloneElement(on,_extends$1({fullWidth:pr==="fullWidth",indicator:sn&&!ur&&wn,selected:sn,selectionFollowsFocus:Qe,onChange:Ge,textColor:ar,value:Yr},gn===1&&or===!1&&!on.props.tabIndex?{tabIndex:0}:{}))}),yn=on=>{const Yr=fr.current,sn=ownerDocument(Yr).activeElement;if(sn.getAttribute("role")!=="tab")return;let Bn=Ye==="horizontal"?"ArrowLeft":"ArrowUp",Hn=Ye==="horizontal"?"ArrowRight":"ArrowDown";switch(Ye==="horizontal"&&Me&&(Bn="ArrowRight",Hn="ArrowLeft"),on.key){case Bn:on.preventDefault(),moveFocus(Yr,sn,previousItem);break;case Hn:on.preventDefault(),moveFocus(Yr,sn,nextItem);break;case"Home":on.preventDefault(),moveFocus(Yr,null,nextItem);break;case"End":on.preventDefault(),moveFocus(Yr,null,previousItem);break}},Mn=cn();return jsxRuntimeExports.jsxs(TabsRoot,_extends$1({className:clsx(kr.root,We),ownerState:Dr,ref:Te,as:Xe},nr,{children:[Mn.scrollButtonStart,Mn.scrollbarSizeListener,jsxRuntimeExports.jsxs(TabsScroller,{className:kr.scroller,ownerState:Dr,style:{overflow:mr.overflow,[sr?`margin${Me?"Left":"Right"}`:"marginBottom"]:tr?void 0:-mr.scrollbarWidth},ref:jr,children:[jsxRuntimeExports.jsx(FlexContainer,{"aria-label":De,"aria-labelledby":$e,"aria-orientation":Ye==="vertical"?"vertical":null,className:kr.flexContainer,ownerState:Dr,onKeyDown:yn,ref:fr,role:"tablist",children:In}),ur&&wn]}),Mn.scrollButtonEnd]}))});function getTextFieldUtilityClass(Ee){return generateUtilityClass("MuiTextField",Ee)}generateUtilityClasses("MuiTextField",["root"]);
629const _excluded$2=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],variantComponent={standard:Input,filled:FilledInput,outlined:OutlinedInput},useUtilityClasses$2=Ee=>{const{classes:Re}=Ee;return composeClasses({root:["root"]},getTextFieldUtilityClass,Re)},TextFieldRoot=styled(FormControl,{name:"MuiTextField",slot:"Root",overridesResolver:(Ee,Re)=>Re.root})({}),TextField=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiTextField"}),{autoComplete:Oe,autoFocus:Me=!1,children:De,className:$e,color:Be="primary",defaultValue:Ue,disabled:ze=!1,error:We=!1,FormHelperTextProps:Xe,fullWidth:He=!1,helperText:qe,id:Ge,InputLabelProps:Ye,inputProps:Ve,InputProps:Ke,inputRef:Qe,label:Ze,maxRows:Je,minRows:ir,multiline:rr=!1,name:ar,onBlur:or,onChange:pr,onFocus:tr,placeholder:nr,required:hr=!1,rows:sr,select:xr=!1,SelectProps:Rr,type:br,value:wr,variant:vr="outlined"}=je,Dr=_objectWithoutPropertiesLoose(je,_excluded$2),kr=_extends$1({},je,{autoFocus:Me,color:Be,disabled:ze,error:We,fullWidth:He,multiline:rr,required:hr,select:xr,variant:vr}),cr=useUtilityClasses$2(kr),dr={};vr==="outlined"&&(Ye&&typeof Ye.shrink<"u"&&(dr.notched=Ye.shrink),dr.label=Ze),xr&&((!Rr||!Rr.native)&&(dr.id=void 0),dr["aria-describedby"]=void 0);const ur=useId(Ge),gr=qe&&ur?`${ur}-helper-text`:void 0,_r=Ze&&ur?`${ur}-label`:void 0,Ir=variantComponent[vr],Ar=jsxRuntimeExports.jsx(Ir,_extends$1({"aria-describedby":gr,autoComplete:Oe,autoFocus:Me,defaultValue:Ue,fullWidth:He,multiline:rr,name:ar,rows:sr,maxRows:Je,minRows:ir,type:br,value:wr,id:ur,inputRef:Qe,onBlur:or,onChange:pr,onFocus:tr,placeholder:nr,inputProps:Ve},dr,Ke));return jsxRuntimeExports.jsxs(TextFieldRoot,_extends$1({className:clsx(cr.root,$e),disabled:ze,error:We,fullWidth:He,ref:Te,required:hr,color:Be,variant:vr,ownerState:kr},Dr,{children:[Ze!=null&&Ze!==""&&jsxRuntimeExports.jsx(InputLabel,_extends$1({htmlFor:ur,id:_r},Ye,{children:Ze})),xr?jsxRuntimeExports.jsx(Select,_extends$1({"aria-describedby":gr,id:ur,labelId:_r,value:wr,input:Ar},Rr,{children:De})):Ar,qe&&jsxRuntimeExports.jsx(FormHelperText,_extends$1({id:gr},Xe,{children:qe}))]}))});function getToggleButtonUtilityClass(Ee){return generateUtilityClass("MuiToggleButton",Ee)}const toggleButtonClasses=generateUtilityClasses("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),ToggleButtonGroupContext=reactExports.createContext({}),ToggleButtonGroupButtonContext=reactExports.createContext(void 0);function isValueSelected(Ee,Re){return Re===void 0||Ee===void 0?!1:Array.isArray(Re)?Re.indexOf(Ee)>=0:Ee===Re}const _excluded$1=["value"],_excluded2=["children","className","color","disabled","disableFocusRipple","fullWidth","onChange","onClick","selected","size","value"],useUtilityClasses$1=Ee=>{const{classes:Re,fullWidth:Te,selected:je,disabled:Oe,size:Me,color:De}=Ee,$e={root:["root",je&&"selected",Oe&&"disabled",Te&&"fullWidth",`size${capitalize$1(Me)}`,De]};return composeClasses($e,getToggleButtonUtilityClass,Re)},ToggleButtonRoot=styled(ButtonBase,{name:"MuiToggleButton",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[Re.root,Re[`size${capitalize$1(Te.size)}`]]}})(({theme:Ee,ownerState:Re})=>{let Te=Re.color==="standard"?Ee.palette.text.primary:Ee.palette[Re.color].main,je;return Ee.vars&&(Te=Re.color==="standard"?Ee.vars.palette.text.primary:Ee.vars.palette[Re.color].main,je=Re.color==="standard"?Ee.vars.palette.text.primaryChannel:Ee.vars.palette[Re.color].mainChannel),_extends$1({},Ee.typography.button,{borderRadius:(Ee.vars||Ee).shape.borderRadius,padding:11,border:`1px solid ${(Ee.vars||Ee).palette.divider}`,color:(Ee.vars||Ee).palette.action.active},Re.fullWidth&&{width:"100%"}
vendor: 4,802 bytes, line 629
629,{[`&.${toggleButtonClasses.disabled}`]:{color:(Ee.vars||Ee).palette.action.disabled,border:`1px solid ${(Ee.vars||Ee).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:Ee.vars?`rgba(${Ee.vars.palette.text.primaryChannel} / ${Ee.vars.palette.action.hoverOpacity})`:alpha$1(Ee.palette.text.primary,Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${toggleButtonClasses.selected}`]:{color:Te,backgroundColor:Ee.vars?`rgba(${je} / ${Ee.vars.palette.action.selectedOpacity})`:alpha$1(Te,Ee.palette.action.selectedOpacity),"&:hover":{backgroundColor:Ee.vars?`rgba(${je} / calc(${Ee.vars.palette.action.selectedOpacity} + ${Ee.vars.palette.action.hoverOpacity}))`:alpha$1(Te,Ee.palette.action.selectedOpacity+Ee.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:Ee.vars?`rgba(${je} / ${Ee.vars.palette.action.selectedOpacity})`:alpha$1(Te,Ee.palette.action.selectedOpacity)}}}},Re.size==="small"&&{padding:7,fontSize:Ee.typography.pxToRem(13)},Re.size==="large"&&{padding:15,fontSize:Ee.typography.pxToRem(15)})}),ToggleButton=reactExports.forwardRef(function(Re,Te){const je=reactExports.useContext(ToggleButtonGroupContext),{value:Oe}=je,Me=_objectWithoutPropertiesLoose(je,_excluded$1),De=reactExports.useContext(ToggleButtonGroupButtonContext),$e=resolveProps(_extends$1({},Me,{selected:isValueSelected(Re.value,Oe)}),Re),Be=useDefaultProps({props:$e,name:"MuiToggleButton"}),{children:Ue,className:ze,color:We="standard",disabled:Xe=!1,disableFocusRipple:He=!1,fullWidth:qe=!1,onChange:Ge,onClick:Ye,selected:Ve,size:Ke="medium",value:Qe}=Be,Ze=_objectWithoutPropertiesLoose(Be,_excluded2),Je=_extends$1({},Be,{color:We,disabled:Xe,disableFocusRipple:He,fullWidth:qe,size:Ke}),ir=useUtilityClasses$1(Je),rr=or=>{Ye&&(Ye(or,Qe),or.defaultPrevented)||Ge&&Ge(or,Qe)},ar=De||"";return jsxRuntimeExports.jsx(ToggleButtonRoot,_extends$1({className:clsx(Me.className,ir.root,ze,ar),disabled:Xe,focusRipple:!He,ref:Te,onClick:rr,onChange:Ge,value:Qe,ownerState:Je,"aria-pressed":Ve},Ze,{children:Ue}))});function getToggleButtonGroupUtilityClass(Ee){return generateUtilityClass("MuiToggleButtonGroup",Ee)}const toggleButtonGroupClasses=generateUtilityClasses("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),_excluded=["children","className","color","disabled","exclusive","fullWidth","onChange","orientation","size","value"],useUtilityClasses=Ee=>{const{classes:Re,orientation:Te,fullWidth:je,disabled:Oe}=Ee,Me={root:["root",Te==="vertical"&&"vertical",je&&"fullWidth"],grouped:["grouped",`grouped${capitalize$1(Te)}`,Oe&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return composeClasses(Me,getToggleButtonGroupUtilityClass,Re)},ToggleButtonGroupRoot=styled("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(Ee,Re)=>{const{ownerState:Te}=Ee;return[{[`& .${toggleButtonGroupClasses.grouped}`]:Re.grouped},{[`& .${toggleButtonGroupClasses.grouped}`]:Re[`grouped${capitalize$1(Te.orientation)}`]},{[`& .${toggleButtonGroupClasses.firstButton}`]:Re.firstButton},{[`& .${toggleButtonGroupClasses.lastButton}`]:Re.lastButton},{[`& .${toggleButtonGroupClasses.middleButton}`]:Re.middleButton},Re.root,Te.orientation==="vertical"&&Re.vertical,Te.fullWidth&&Re.fullWidth]}})(({ownerState:Ee,theme:Re})=>_extends$1({display:"inline-flex",borderRadius:(Re.vars||Re).shape.borderRadius},Ee.orientation==="vertical"&&{flexDirection:"column"},Ee.fullWidth&&{width:"100%"},{[`& .${toggleButtonGroupClasses.grouped}`]:_extends$1({},Ee.orientation==="horizontal"?{[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.${toggleButtonGroupClasses.selected}`]:{borderLeft:0,marginLeft:0}}:{[`&.${toggleButtonGroupClasses.selected} + .${toggleButtonGroupClasses.grouped}.${toggleButtonGroupClasses.selected}`]:{borderTop:0,marginTop:0}})},Ee.orientation==="horizontal"?{[`& .${toggleButtonGroupClasses.firstButton},& .${toggleButtonGroupClasses.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${toggleButtonGroupClasses.lastButton},& .${toggleButtonGroupClasses.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0}}:{[`& .${toggleButtonGroupClasses.firstButton},& .${toggleButtonGroupClasses.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${toggleButtonGroupClasses.lastButton},& .${toggleButtonGroupClasses.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0}},Ee.orientation==="horizontal"?{[`& .${toggleButtonGroupClasses.lastButton}
629.${toggleButtonClasses.disabled},& .${toggleButtonGroupClasses.middleButton}.${toggleButtonClasses.disabled}`]:{borderLeft:"1px solid transparent"}}:{[`& .${toggleButtonGroupClasses.lastButton}.${toggleButtonClasses.disabled},& .${toggleButtonGroupClasses.middleButton}.${toggleButtonClasses.disabled}`]:{borderTop:"1px solid transparent"}})),ToggleButtonGroup=reactExports.forwardRef(function(Re,Te){const je=useDefaultProps({props:Re,name:"MuiToggleButtonGroup"}),{children:Oe,className:Me,color:De="standard",disabled:$e=!1,exclusive:Be=!1,fullWidth:Ue=!1,onChange:ze,orientation:We="horizontal",size:Xe="medium",value:He}=je,qe=_objectWithoutPropertiesLoose(je,_excluded),Ge=_extends$1({},je,{disabled:$e,fullWidth:Ue,orientation:We,size:Xe}),Ye=useUtilityClasses(Ge),Ve=reactExports.useCallback((rr,ar)=>{if(!ze)return;const or=He&&He.indexOf(ar);let pr;He&&or>=0?(pr=He.slice(),pr.splice(or,1)):pr=He?He.concat(ar):[ar],ze(rr,pr)},[ze,He]),Ke=reactExports.useCallback((rr,ar)=>{ze&&ze(rr,He===ar?null:ar)},[ze,He]),Qe=reactExports.useMemo(()=>({className:Ye.grouped,onChange:Be?Ke:Ve,value:He,size:Xe,fullWidth:Ue,color:De,disabled:$e}),[Ye.grouped,Be,Ke,Ve,He,Xe,Ue,De,$e]),Ze=getValidReactChildren(Oe),Je=Ze.length,ir=rr=>{const ar=rr===0,or=rr===Je-1;return ar&&or?"":ar?Ye.firstButton:or?Ye.lastButton:Ye.middleButton};return jsxRuntimeExports.jsx(ToggleButtonGroupRoot,_extends$1({role:"group",className:clsx(Ye.root,Me),ref:Te,ownerState:Ge},qe,{children:jsxRuntimeExports.jsx(ToggleButtonGroupContext.Provider,{value:Qe,children:Ze.map((rr,ar)=>jsxRuntimeExports.jsx(ToggleButtonGroupButtonContext.Provider,{value:ir(ar),children:rr},ar))})}))}),PRIMARY_ORANGE="#F97316",SECONDARY_GREY="#6B7280",BRAND_NAVY="#002D79",ThemeContext=reactExports.createContext(),useThemeMode=()=>{const Ee=reactExports.useContext(ThemeContext);if(!Ee)throw new Error("useThemeMode must be used within ThemeProvider");return Ee},ThemeProvider=({children:Ee})=>{const Re=useDispatch(),Te=useSelector(Me=>Me.theme.darkMode);reactExports.useEffect(()=>{document.documentElement.setAttribute("data-theme",Te?"dark":"light")},[Te]);const je=()=>{document.startViewTransition&&!document.body.hasAttribute("data-force-light-theme")?requestAnimationFrame(()=>{document.startViewTransition(()=>{Re(toggleDarkMode())})}):Re(toggleDarkMode())},Oe=reactExports.useMemo(()=>createTheme({transitions:{duration:{shortest:150,shorter:200,short:250,standard:400,complex:500,enteringScreen:400,leavingScreen:350},easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"}},palette:{mode:Te?"dark":"light",primary:{main:PRIMARY_ORANGE,light:"#FB923C",dark:"#EA580C",contrastText:"#FFFFFF"},secondary:{main:SECONDARY_GREY,light:"#9CA3AF",dark:"#4B5563",contrastText:"#FFFFFF"},background:{default:Te?"#0F172A":"#F9FAFB",paper:Te?"#1E293B":"#FFFFFF"},text:{primary:Te?"#F8FAFC":"#111827",secondary:Te?"#CBD5E1":SECONDARY_GREY},error:{main:Te?"#F87171":"#EF4444"},warning:{main:Te?"#FCD34D":"#F59E0B"},info:{main:Te?"#5B7FC4":BRAND_NAVY},success:{main:Te?"#34D399":"#10B981"},divider:Te?"#334155":"#E5E7EB"},typography:{fontFamily:'"Inter", "Roboto", "Helvetica", "Arial", sans-serif',h1:{fontSize:"2.5rem",fontWeight:700},h2:{fontSize:"2rem",fontWeight:600},h3:{fontSize:"1.75rem",fontWeight:600},h4:{fontSize:"1.5rem",fontWeight:600},h5:{fontSize:"1.25rem",fontWeight:500},h6:{fontSize:"1rem",fontWeight:500},button:{textTransform:"none",fontWeight:500}},shape:{borderRadius:8},components:{MuiButton:{styleOverrides:{root:{borderRadius:8,padding:"10px 20px",fontSize:"0.95rem"},contained:{boxShadow:"none","&:hover":{boxShadow:Te?"0 4px 6px -1px rgb(0 0 0 / 0.3)":"0 4px 6px -1px rgb(0 0 0 / 0.1)"}}}},MuiTextField:{styleOverrides:{root:{"& .MuiOutlinedInput-root":{borderRadius:8,backgroundColor:Te?"#0F172A":"transparent","& fieldset":{borderColor:Te?"#475569":"#E5E7EB"},"&:hover fieldset":{borderColor:Te?"#64748b":"#D1D5DB"},"&.Mui-focused fieldset":{borderColor:BRAND_NAVY}}
629,"& .MuiInputLabel-root":{color:Te?"#94A3B8":"#6B7280","&.Mui-focused":{color:BRAND_NAVY}}}}},MuiCard:{styleOverrides:{root:{borderRadius:12,boxShadow:Te?"0 4px 6px -1px rgb(0 0 0 / 0.3)":"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"}}},MuiPaper:{styleOverrides:{root:{borderRadius:12,backgroundImage:"none",backgroundColor:Te?"#1E293B":"#FFFFFF",border:Te?"1px solid #334155":"none"}}},MuiChip:{styleOverrides:{root:{fontWeight:500,borderRadius:8},filled:({ownerState:Me})=>Te?Me.color&&Me.color!=="default"?{}:{backgroundColor:"#334155",color:"#F1F5F9"}:{},colorSuccess:Te?{backgroundColor:"rgba(52, 211, 153, 0.2)",color:"#34D399"}:{},colorPrimary:Te?{backgroundColor:"rgba(96, 165, 250, 0.2)",color:"#60A5FA"}:{},colorSecondary:Te?{backgroundColor:"rgba(167, 139, 250, 0.2)",color:"#A78BFA"}:{},colorWarning:Te?{backgroundColor:"rgba(252, 211, 77, 0.2)",color:"#FCD34D"}:{},colorError:Te?{backgroundColor:"rgba(248, 113, 113, 0.2)",color:"#F87171"}:{}}},MuiDataGrid:{styleOverrides:{root:{border:"none","& .MuiDataGrid-cell":{borderBottom:Te?"1px solid #334155":"1px solid #F3F4F6",color:Te?"#E2E8F0":"#374151"},"& .MuiDataGrid-columnHeaders":{backgroundColor:Te?"#0F172A":"#F9FAFB",borderBottom:Te?"2px solid #475569":"2px solid #E5E7EB",color:Te?"#F1F5F9":"#111827","& .MuiDataGrid-columnHeaderTitle":{fontWeight:600}},"& .MuiDataGrid-columnSeparator":{color:Te?"#475569":"#E5E7EB"},"& .MuiDataGrid-row":{"&:hover":{backgroundColor:Te?"#334155":"#F3F4F6"},"&.Mui-selected":{backgroundColor:Te?"rgba(31, 74, 148, 0.25)":"rgba(0, 45, 121, 0.08)","&:hover":{backgroundColor:Te?"rgba(31, 74, 148, 0.35)":"rgba(0, 45, 121, 0.12)"}}},"& .MuiDataGrid-footerContainer":{borderTop:Te?"1px solid #334155":"1px solid #E5E7EB",backgroundColor:Te?"#1E293B":"#F9FAFB"}}}},MuiDrawer:{styleOverrides:{paper:{backgroundImage:"none"}}},MuiAppBar:{styleOverrides:{root:{backgroundImage:"none"}}},MuiDialog:{defaultProps:{disableEscapeKeyDown:!0},styleOverrides:{paper:{backgroundImage:"none",backgroundColor:Te?"#1E293B":"#FFFFFF",borderRadius:12,border:Te?"1px solid #334155":"none"}}},MuiDialogTitle:{styleOverrides:{root:{color:Te?"#F1F5F9":"#111827",fontWeight:600}}},MuiDialogContent:{styleOverrides:{root:{color:Te?"#E2E8F0":"#374151"}}},MuiModal:{defaultProps:{disableEscapeKeyDown:!0},styleOverrides:{backdrop:{backgroundColor:Te?"rgba(0, 0, 0, 0.7)":"rgba(0, 0, 0, 0.5)"}}},MuiSelect:{styleOverrides:{root:{backgroundColor:Te?"#0F172A":"#FFFFFF","& .MuiOutlinedInput-notchedOutline":{borderColor:Te?"#475569":"#E5E7EB"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:Te?"#64748b":"#D1D5DB"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:BRAND_NAVY}}}},MuiMenuItem:{styleOverrides:{root:{"&:hover":{backgroundColor:Te?"#334155":"#F3F4F6"},"&.Mui-selected":{backgroundColor:Te?"rgba(31, 74, 148, 0.25)":"rgba(0, 45, 121, 0.08)","&:hover":{backgroundColor:Te?"rgba(31, 74, 148, 0.35)":"rgba(0, 45, 121, 0.12)"}}}}},MuiMenu:{styleOverrides:{paper:{backgroundImage:"none",backgroundColor:Te?"#1E293B":"#FFFFFF",border:Te?"1px solid #334155":"none"}}},MuiInputLabel:{styleOverrides:{root:{color:Te?"#94A3B8":"#6B7280","&.Mui-focused":{color:BRAND_NAVY}}}},MuiTabs:{styleOverrides:{indicator:{backgroundColor:BRAND_NAVY}}},MuiTab:{styleOverrides:{root:{"&.Mui-selected":{color:BRAND_NAVY}}}},MuiLink:{styleOverrides:{root:{color:BRAND_NAVY}}},MuiCheckbox:{styleOverrides:{root:{"&.Mui-checked":{color:BRAND_NAVY},"&.MuiCheckbox-indeterminate":{color:BRAND_NAVY}}}},MuiRadio:{styleOverrides:{root:{"&.Mui-checked":{color:BRAND_NAVY}}}}}}),[Te]);return jsxRuntimeExports.jsx(ThemeContext.Provider,{value:{darkMode:Te,toggleDarkMode:je},children:jsxRuntimeExports.jsxs(ThemeProvider$1,{theme:Oe,children:[jsxRuntimeExports.jsx(CssBaseline,{}),jsxRuntimeExports.jsx("style",{children:` 630 /* Modern sliding theme transition like Google */ 631 632 /* Disable transitions on login/auth pages */ 633 body[data-force-light-theme] ::view-transition-old(root), 634 body[data-force-light-theme] ::view-transition-new(root) { 635 animation: none !important; 636 } 637 638 /* View Transition API (Chrome 111+, Edge 111+) */ 639 ::view-transition-old(root), 640 ::view-transition-new(root) { 641 animation-duration: 0.25s; 642 animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94); 643 will-change: transform, opacity; 644 } 645 646 ::view-transition-group(root) { 647 animation-duration: 0.25s; 648 } 649 650 /* Dark mode: slide from right to left */ 651 [data-theme="dark"]::view-transition-old(root) { 652 animation-name: slideOutLeft; 653 } 654 655 [data-theme="dark"]::view-transition-new(root) { 656 animation-name: slideInRight; 657 } 658 659 /* Light mode: slide from left to right */ 660 [data-theme="light"]::view-transition-old(root) { 661 animation-name: slideOutRight; 662 } 663 664 [data-theme="light"]::view-transition-new(root) { 665 animation-name: slideInLeft; 666 } 667 668 @keyframes slideOutLeft { 669 from { 670 transform: translateX(0); 671 } 672 to { 673 transform: translateX(-100%); 674 opacity: 0; 675 } 676 } 677 678 @keyframes slideInRight { 679 from { 680 transform: translateX(100%); 681 opacity: 0; 682 } 683 to { 684 transform: translateX(0); 685 opacity: 1; 686 } 687 } 688 689 @keyframes slideOutRight { 690 from { 691 transform: translateX(0); 692 } 693 to { 694 transform: translateX(100%); 695 opacity: 0; 696 } 697 } 698 699 @keyframes slideInLeft { 700 from { 701 transform: translateX(-100%); 702 opacity: 0; 703 } 704 to { 705 transform: translateX(0); 706 opacity: 1; 707 } 708 } 709 710 /* Fallback for browsers without View Transition API */ 711 html.theme-transitioning { 712 position: relative; 713 overflow-x: hidden; 714 } 715 716 html.theme-transitioning::before { 717 content: ''; 718 position: fixed; 719 top: 0; 720 left: 0; 721 right: 0; 722 bottom: 0; 723 background: ${Te?"#0F172A":"#F9FAFB"}; 724 z-index: 9999; 725 pointer-events: none; 726 } 727 728 /* Right to left for dark mode */ 729 html.theme-transitioning[data-transition-direction="right"]::before { 730 animation: slideRevealRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards; 731 } 732 733 /* Left to right for light mode */ 734 html.theme-transitioning[data-transition-direction="left"]::before { 735 animation: slideRevealLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards; 736 } 737 738 @keyframes slideRevealRight { 739 0% { 740 clip-path: inset(0 100% 0 0); 741 } 742 100% { 743 clip-path: inset(0 0 0 0); 744 } 745 } 746 747 @keyframes slideRevealLeft { 748 0% { 749 clip-path: inset(0 0 0 100%); 750 } 751 100% { 752 clip-path: inset(0 0 0 0); 753 } 754 } 755 756 /* Dark mode scrollbars */ 757 ::-webkit-scrollbar {
758 width: 12px; 759 height: 12px; 760 } 761 762 ::-webkit-scrollbar-track { 763 background: ${Te?"#0F172A":"#F9FAFB"}; 764 } 765 766 ::-webkit-scrollbar-thumb { 767 background: ${Te?"#475569":"#CBD5E1"}; 768 border-radius: 6px; 769 border: 2px solid ${Te?"#0F172A":"#F9FAFB"}; 770 } 771 772 ::-webkit-scrollbar-thumb:hover { 773 background: ${Te?"#64748B":"#94A3B8"}; 774 } 775 `}),Ee]})})},NavigationGuardContext=reactExports.createContext(),useNavigationGuard=()=>{const Ee=reactExports.useContext(NavigationGuardContext);if(!Ee)throw new Error("useNavigationGuard must be used within NavigationGuardProvider");return Ee},NavigationGuardProvider=({children:Ee})=>{const[Re,Te]=reactExports.useState(!1),[je,Oe]=reactExports.useState(null),[Me,De]=reactExports.useState(!1),$e=reactExports.useCallback(Xe=>{Te(Xe)},[]),Be=reactExports.useCallback(Xe=>Re?(Oe(()=>Xe),De(!0),!1):(Xe(),!0),[Re]),Ue=reactExports.useCallback(()=>{je&&(Te(!1),je(),Oe(null)),De(!1)},[je]),ze=reactExports.useCallback(()=>{Oe(null),De(!1)},[]),We={hasUnsavedChanges:Re,registerUnsavedChanges:$e,requestNavigation:Be,confirmNavigation:Ue,cancelNavigation:ze,showConfirmDialog:Me};return jsxRuntimeExports.jsx(NavigationGuardContext.Provider,{value:We,children:Ee})},AddIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),ArrowBack=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),ArrowForward$1=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),Article=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5 14H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"}),"Article"),Assessment=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Assessment"),AttachFile=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6z"}),"AttachFile"),AutoAwesome=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25z"}),"AutoAwesome"),BusinessIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"Business"),CancelIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel"),CancelOutlined=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined"),ChatIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"}),"Chat"),Check=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),CheckCircle=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),CheckCircleOutline=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline"),ChevronRight=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),Close$1=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),CloudUpload=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19.35 10.04C18.67 6.59
77515.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload"),Code=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),ContentCopy=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),DarkModeOutlined=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkModeOutlined"),DeleteIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),DeleteSweep=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M15 16h4v2h-4zm0-8h7v2h-7zm0 4h6v2h-6zM3 18c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V8H3zM14 5h-3l-1-1H6L5 5H2v2h12z"}),"DeleteSweep"),DocumentIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),DownloadIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),EditIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),ErrorIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline"),ExpandMoreIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),Favorite=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"}),"Favorite"),FavoriteBorder=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"}),"FavoriteBorder"),FilterList=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),FolderIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M10 4H4c-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-2h-8z"}),"Folder"),Gavel=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"m5.2494 8.0688 2.83-2.8269 14.1343 14.15-2.83 2.8269zm4.2363-4.2415 2.828-2.8289 5.6577 5.656-2.828 2.8289zM.9989 12.3147l2.8284-2.8285 5.6569 5.6569-2.8285 2.8284zM1 21h12v2H1z"}),"Gavel"),GraphicEq=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M7 18h2V6H7zm4 4h2V2h-2zm-8-8h2v-4H3zm12 4h2V6h-2zm4-8v4h2v-4z"}),"GraphicEq"),Group=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group"),HelpOutline=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),ImageIcon=createSvgIcon$1(jsxRuntimeExports.jsx("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-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),InsertDriveFile=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),KeyboardArrowDown=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),Language=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.
77516-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"}),"Language"),LightModeOutlined=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightModeOutlined"),LightbulbOutlined=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7m2.85 11.1-.85.6V16h-4v-2.3l-.85-.6C7.8 12.16 7 10.63 7 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1"}),"LightbulbOutlined"),Lock=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock"),MenuIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),Mic=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3m5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72z"}),"Mic"),MicOff=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19 11h-1.7c0 .74-.16 1.43-.43 2.05l1.23 1.23c.56-.98.9-2.09.9-3.28m-4.02.17c0-.06.02-.11.02-.17V5c0-1.66-1.34-3-3-3S9 3.34 9 5v.18zM4.27 3 3 4.27l6.01 6.01V11c0 1.66 1.33 3 2.99 3 .22 0 .44-.03.65-.08l1.66 1.66c-.71.33-1.5.52-2.31.52-2.76 0-5.3-2.1-5.3-5.1H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c.91-.13 1.77-.45 2.54-.9L19.73 21 21 19.73z"}),"MicOff"),MoreVertIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert"),PeopleAlt=createSvgIcon$1([jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M16.67 13.13C18.04 14.06 19 15.32 19 17v3h4v-3c0-2.18-3.57-3.47-6.33-3.87"},"0"),jsxRuntimeExports.jsx("circle",{cx:"9",cy:"8",r:"4",fillRule:"evenodd"},"1"),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4c-.47 0-.91.1-1.33.24C14.5 5.27 15 6.58 15 8s-.5 2.73-1.33 3.76c.42.14.86.24 1.33.24m-6 1c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"},"2")],"PeopleAlt"),Person=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),Phone=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02z"}),"Phone"),PictureAsPdf=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5zm4-3H19v1h1.5V11H19v2h-1.5V7h3zM9 9.5h1v-1H9zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm10 5.5h1v-3h-1z"}),"PictureAsPdf"),PushPin=createSvgIcon$1(jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3"}),"PushPin"),PushPinOutlined=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M14 4v5c0 1.12.37 2.16 1 3H9c.65-.86 1-1.9 1-3V4zm3-2H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3V4h1c.55 0 1-.45 1-1s-.45-1-1-1"}),"PushPinOutlined"),Science=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19.8 18.4 14 10.67V6.5l1.35-1.69c.26-.33.03-.81-.39-.81H9.04c-.42 0-.65.48-.39.81L10 6.5v4.17L4.2 18.4c-.49.66-.02 1.6.8 1.6h14c.82 0 1.29-.94.8-1.6"}),"Science"),SearchIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),Send=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}),"Send"),Settings=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),Share=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3
775-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92"}),"Share"),SpeedIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"m20.38 8.57-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83"}),"Speed"),Star=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star"),StarBorder=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"m22 9.24-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28z"}),"StarBorder"),Stop=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M6 6h12v12H6z"}),"Stop"),DatabaseIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M2 20h20v-4H2zm2-3h2v2H4zM2 4v4h20V4zm4 3H4V5h2zm-4 7h20v-4H2zm2-3h2v2H4z"}),"Storage"),ThumbDownAlt=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4h-8.1c-.71 0-1.36.37-1.72.97z"}),"ThumbDownAlt"),ThumbDownOffAlt=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"m10.89 18.28.57-2.89c.12-.59-.04-1.2-.42-1.66-.38-.46-.94-.73-1.54-.73H4v-1.08L6.57 6h8.09c.18 0 .34.16.34.34v7.84zM10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4h-8.1c-.71 0-1.36.37-1.72.97l-2.67 6.15c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22zm10-7h2V4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1"}),"ThumbDownOffAlt"),ThumbUpAlt=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97z"}),"ThumbUpAlt"),ThumbUpOffAlt=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"m13.11 5.72-.57 2.89c-.12.59.04 1.2.42 1.66.38.46.94.73 1.54.73H20v1.08L17.43 18H9.34c-.18 0-.34-.16-.34-.34V9.82zM14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.83C7 18.95 8.05 20 9.34 20h8.1c.71 0 1.36-.37 1.72-.97l2.67-6.15c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22zM4 9H2v11h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1"}),"ThumbUpOffAlt"),Tune=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"Tune"),VisibilityIcon=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),VolumeUp=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M3 9v6h4l5 5V4L7 9zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77"}),"VolumeUp"),Warning=createSvgIcon$1(jsxRuntimeExports.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),WorkOutline=createSvgIcon$1(jsxRuntimeExports.jsx("path",{fillRule:"evenodd",d:"M14 6V4h-4v2zM4 8v11h16V8zm16-2c1.11 0 2 .89 2 2v11c0 1.11-.89 2-2 2H4c-1.11 0-2-.89-2-2l.01-11c0-1.11.88-2 1.99-2h4V4c0-1.11.89-2 2-2h4c1.11 0 2 .89 2 2v2z"}),"WorkOutline"),COMPANY_SIZES=[{value:"1-10",label:"1â10 employees"},{value:"11-50",label:"11â50 employees"},{value:"51-200",label:"51â200 employees"},{value:"201-500",label:"201â500 employees"},{value:"501-1000",label:"501â1000 employees"},{value:"1000+",label:"1000+ employees"}],PROFILE_MODAL_Z_INDEX=1e4,PROFILE_SELECT_MENU_Z_INDEX=PROFILE_MODAL_Z_INDEX+10,SELECT_MENU_PROP
775S={disableScrollLock:!0,sx:{zIndex:PROFILE_SELECT_MENU_Z_INDEX},PaperProps:{sx:{mt:1,maxHeight:280,zIndex:PROFILE_SELECT_MENU_Z_INDEX}},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},formatPhone=Ee=>{const Re=Ee.replace(/\D/g,"").slice(0,10);return Re.length<=3?Re:Re.length<=6?`(${Re.slice(0,3)}) ${Re.slice(3)}`:`(${Re.slice(0,3)}) ${Re.slice(3,6)}-${Re.slice(6)}`},validate=Ee=>{const Re={};if(String(Ee.company_name||"").trim()||(Re.company_name="Company name is required."),Ee.mobile){const Te=Ee.mobile.replace(/\D/g,"");(Te.length<7||Te.length>15)&&(Re.mobile="Enter a valid phone number (7â15 digits).")}if(Ee.website)try{const Te=new URL(Ee.website.startsWith("http")?Ee.website:`https://${Ee.website}`);if(!["http:","https:"].includes(Te.protocol))throw new Error}catch{Re.website="Enter a valid URL (e.g. https://company.com)."}return Re},ProfileCompletionModal=({open:Ee,onClose:Re})=>{const Te=useDispatch(),{user:je}=useSelector(Ye=>Ye.auth),Oe=useSelector(selectIndustryOptions),{darkMode:Me}=useThemeMode(),[De,$e]=reactExports.useState({company_name:"",mobile:"",website:"",company_size:"",industry:""}),[Be,Ue]=reactExports.useState(!1),[ze,We]=reactExports.useState(""),[Xe,He]=reactExports.useState({});reactExports.useEffect(()=>{!Ee||!je||($e({company_name:je.company_name||"",mobile:je.mobile||"",website:je.website||"",company_size:je.company_size||"",industry:je.industry||""}),We(""),He({}))},[Ee,je]);const qe=reactExports.useCallback((Ye,Ve)=>{$e(Ke=>({...Ke,[Ye]:Ve})),He(Ke=>{if(!Ke[Ye])return Ke;const Qe={...Ke};return delete Qe[Ye],Qe}),We("")},[]),Ge=async()=>{const Ye=validate(De);if(Object.keys(Ye).length>0){He(Ye);return}Ue(!0),We("");try{const Ve=new FormData;Ve.append("company_name",String(De.company_name||"").trim()),["mobile","website","company_size","industry"].forEach(Ke=>{const Qe=String(De[Ke]||"").trim();Qe&&Ve.append(Ke,Qe)}),await Te(updateUserProfile$1(Ve)).unwrap(),await Te(fetchProfile(!0)),Re()}catch(Ve){We(typeof Ve=="string"?Ve:(Ve==null?void 0:Ve.message)||"Failed to save. Please try again.")}finally{Ue(!1)}};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:(Ye,Ve)=>{Ve==="backdropClick"||Ve==="escapeKeyDown"||Re()},disableEscapeKeyDown:!0,maxWidth:"sm",fullWidth:!0,sx:{zIndex:PROFILE_MODAL_Z_INDEX},PaperProps:{sx:{borderRadius:3,boxShadow:"0 20px 60px rgba(0,0,0,0.3)",backgroundColor:Me?"#1E293B":"#fff",color:Me?"#E2E8F0":"inherit"}},BackdropProps:{sx:{backgroundColor:"rgba(0,0,0,0.75)"}},children:[jsxRuntimeExports.jsxs(DialogContent,{sx:{pt:4,pb:2,px:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{mb:3,display:"flex",alignItems:"flex-start",gap:1.5},children:[jsxRuntimeExports.jsx(Box,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:Me?"rgba(91, 127, 196, 0.18)":"rgba(0, 45, 121, 0.1)"},children:jsxRuntimeExports.jsx(Person,{sx:{color:Me?"#93B4F0":"#002D79"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{mb:1,fontWeight:700,color:Me?"#93B4F0":"#002D79"},children:"Complete your profile"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"text.secondary",lineHeight:1.6},children:"Tell us a bit more about yourself â company name is required. Other fields are optional and can be updated anytime in settings."})]})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Typography,{variant:"body2",sx:{fontWeight:700,mb:.75,color:"text.primary"},children:["Company Name ",jsxRuntimeExports.jsx(Box,{component:"span",sx:{color:"#F97316"},children:"*"})]}),jsxRuntimeExports.jsx(TextField,{placeholder:"e.g. Acme Corporation",value:De.company_name,onChange:Ye=>qe("company_name",Ye.target.value),fullWidth:!0,size:"small",required:!0,error:!!Xe.company_name,helperText:Xe.company_name,InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(BusinessIcon,{sx:{fontSize:18,color:Xe.company_name?"error.main":"text.secondary"}})})}})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:700,mb:.75,color:"text.primary"},children:"Mobile Number"}),jsxRuntimeExports.jsx(TextField,{placeholder:"(123) 456-7890",value:De.mobile,onChange:Ye=>qe("mobile",formatPhone(Ye.target.value)),fullWidth:!0,size:"small",inputProps:{maxLength:14},error:!!Xe.mobile,helperText:Xe.mobile,InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(Phone,{sx:{fontSize:18,color:Xe.mobile?"error.main":"text.secondary"}})})}})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:700,mb:.75,color:"text.primary"},children:"Website"}),jsxRuntimeExports.jsx(TextField,{placeholder:"https://yourcompany.com",value:De.website,onChange:Ye=>qe("website",Ye.target.value),fullWidth:!0,size:"small",error:!!Xe.website,helperText:Xe.website,InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(Language,{sx:{fontSize:18,color:Xe.website?"error.main":"text.secondary"}})})}})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:2,flexDirection:{xs:"column",sm:"row"}},children:[jsxRuntimeExports.jsxs(Box,{sx:{flex:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:700,mb:.75,color:"text.primary"},children:"Company Size"}
775),jsxRuntimeExports.jsxs(TextField,{select:!0,value:De.company_size,onChange:Ye=>qe("company_size",Ye.target.value),fullWidth:!0,size:"small",SelectProps:{displayEmpty:!0,MenuProps:SELECT_MENU_PROPS},InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(PeopleAlt,{sx:{fontSize:18,color:"text.secondary"}})})},children:[jsxRuntimeExports.jsx(MenuItem,{value:"",children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Select size"})}),COMPANY_SIZES.map(({value:Ye,label:Ve})=>jsxRuntimeExports.jsx(MenuItem,{value:Ye,children:Ve},Ye))]})]}),jsxRuntimeExports.jsxs(Box,{sx:{flex:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:700,mb:.75,color:"text.primary"},children:"Industry"}),jsxRuntimeExports.jsxs(TextField,{select:!0,value:De.industry,onChange:Ye=>qe("industry",Ye.target.value),fullWidth:!0,size:"small",SelectProps:{displayEmpty:!0,MenuProps:SELECT_MENU_PROPS},InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(WorkOutline,{sx:{fontSize:18,color:"text.secondary"}})})},children:[jsxRuntimeExports.jsx(MenuItem,{value:"",children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Select industry"})}),Oe.map(Ye=>jsxRuntimeExports.jsx(MenuItem,{value:Ye,children:Ye},Ye))]})]})]}),ze&&jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"error",children:ze})]})]}),jsxRuntimeExports.jsxs(DialogActions,{sx:{px:3,pb:3,pt:0,justifyContent:"space-between"},children:[jsxRuntimeExports.jsx(Button,{onClick:Re,disabled:Be,sx:{textTransform:"none",color:"text.secondary",fontWeight:500},children:"Skip for now"}),jsxRuntimeExports.jsx(Button,{onClick:Ge,variant:"contained",disabled:Be,endIcon:Be?jsxRuntimeExports.jsx(CircularProgress,{size:16,color:"inherit"}):jsxRuntimeExports.jsx(CheckCircle,{}),sx:{textTransform:"none",fontWeight:600,minWidth:130,boxShadow:2},children:Be?"Savingâ¦":"Save Profile"})]})]})},TourContext=reactExports.createContext(),isTourStatusComplete=Ee=>Ee===!0||Ee==="true"||Ee===1,useTour=()=>{const Ee=reactExports.useContext(TourContext);if(!Ee)throw new Error("useTour must be used within TourProvider");return Ee},TourProvider=({children:Ee})=>{const Re=useDispatch(),[Te,je]=reactExports.useState(!1),[Oe,Me]=reactExports.useState(0),[De,$e]=reactExports.useState(null),[Be,Ue]=reactExports.useState(!1),[ze,We]=reactExports.useState(!1),{user:Xe,userFetched:He}=useSelector(rr=>rr.auth);reactExports.useEffect(()=>{Xe&&(isTourStatusComplete(Xe.tour_status)?$e(!0):He&&$e(!1))},[Xe,Xe==null?void 0:Xe.tour_status,He]);const qe=()=>{je(!0),Me(0)},Ge=()=>{Me(rr=>rr+1)},Ye=()=>{Me(rr=>Math.max(0,rr-1))};reactExports.useEffect(()=>{Te||!ze||(We(!1),Ue(!0))},[Te,ze]);const Ve=async()=>{Te&&We(!0),je(!1),Me(0),$e(!0),Re(updateTourStatus(!0));try{await userService.updateTourStatus(!0)}catch{}},ir={isTourActive:Te,currentStep:Oe,tourCompleted:De,showProfileModal:Be,setShowProfileModal:Ue,startTour:qe,nextStep:Ge,previousStep:Ye,skipTour:()=>Ve(),completeTour:()=>Ve(),closeTour:()=>Ve(),resetTour:async()=>{We(!1),$e(!1),je(!1),Me(0),Re(updateTourStatus(!1));try{await userService.updateTourStatus(!1)}catch{}}};return jsxRuntimeExports.jsxs(TourContext.Provider,{value:ir,children:[Ee,jsxRuntimeExports.jsx(ProfileCompletionModal,{open:Be,onClose:()=>Ue(!1)})]})},Loader=({message:Ee="Loading...",size:Re=40,fullScreen:Te=!1})=>jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,...Te&&{flex:1,minHeight:"100vh",width:"100%"}},children:[jsxRuntimeExports.jsx(CircularProgress,{size:Re}),Ee&&jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:Ee})]}),truncateFilename=(Ee,Re=50)=>{if(!Ee||typeof Ee!="string")return Ee||"";if(Ee.length<=Re)return Ee;const Te=Ee.lastIndexOf(".");if(Te>0&&Te<Ee.length-1){const Oe=Ee.substring(Te),Me=Ee.substring(0,Te),De=Re-Oe.length-3;return De<=0?Ee.substring(0,Re-3)+"...":Me.substring(0,De)+"..."+Oe}return Ee.substring(0,Re-3)+"..."},truncateErrorMessage=(Ee,Re=50)=>{if(!Ee||typeof Ee!="string")return Ee||"";const Te=/([a-zA-Z0-9_\-\s().]+\.(docx?|pdf|pptx?|xlsx?|csv|tsv|txt|jpg|jpeg|png|gif|bmp|svg|html?|xml|json|zip|rar|7z|tar|gz))/gi;return Ee.replace(Te,je=>truncateFilename(je,Re))},getUploadErrorMessage=(Ee,Re=null)=>{if(!Ee||typeof Ee!="string")return"Upload failed";const Te=Ee.toLowerCase();if(Te.includes("file name too long")||Te.includes("errno 36"))return"File name is too long. Please rename to under 200 characters.";if(Te.includes("too large")||Te.includes("size limit")||Te.includes("max size"))return"File is too large. Limits depend on type (2MB CSV/TSV/ODS, 5MB HTML/MD/TXT, 12MB XLSX, 20MB ODT/RTF/DOCX/PPTX, 50MB PDF).";if(Te.includes("unsupported")||Te.includes("file type")||Te.includes("not allowed"))return"File type not supported. Please use CSV, DOCX, PDF, PPTX, TSV, TXT, or XLSX.";if(Te.includes("permission")||Te.includes("access denied"))return"Permission denied. You may not have access to upload to this group.";if(Te.includes("storage")||Te.includes("disk")||Te.includes("space")){if(Ee.includes(":")){const je=Ee.split(":"),Oe=je[je.length-1].trim();if(Oe.toLowerCase().includes("storage")||Oe.toLowerCase().includes("limit"))return"Storage limit reached. Please contact support."}return"Storage limit reached. Please contact support."}return Ee.includes("/opt/")||Ee.includes("/var/")||Ee.includes("/tmp/")||Ee.includes(":\\")?"Upload failed. Please try again or c
775ontact support.":Ee.length<=100&&!Ee.includes("/")?Ee:"Upload failed. Please try again."},normalizeBillingCycle=Ee=>{if(!Ee||typeof Ee!="string")return"monthly";const Re=Ee.toLowerCase().trim();return Re==="month"||Re==="monthly"?"monthly":Re==="year"||Re==="yearly"||Re==="annual"||Re==="annually"?"annually":"monthly"},formatBillingCycle=Ee=>normalizeBillingCycle(Ee)==="annually"?"Annually":"Monthly",formatBillingCadence=Ee=>normalizeBillingCycle(Ee)==="annually"?"per year":"per month",formatBillingCycleShort=Ee=>normalizeBillingCycle(Ee)==="annually"?"year":"month",Toast=({open:Ee,message:Re,severity:Te="info",onClose:je,autoHideDuration:Oe=6e3})=>{const Me=truncateErrorMessage(Re,50);return jsxRuntimeExports.jsx(Snackbar,{open:Ee,autoHideDuration:Oe,onClose:je,anchorOrigin:{vertical:"top",horizontal:"right"},style:{zIndex:1e9,position:"fixed"},disableWindowBlurListener:!0,children:jsxRuntimeExports.jsx(Alert,{onClose:je,severity:Te,sx:{width:"100%",maxWidth:"500px",wordBreak:"break-word",boxShadow:3,"& .MuiAlert-message":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"pre-wrap"}},children:Me})})},getSubscriptionPlan=Ee=>{var Te;if(!Ee)return"";const Re=((Te=Ee==null?void 0:Ee.current_subscription)==null?void 0:Te.plan)||"";return Re?Re.toUpperCase():""},isEnterprisePlan=Ee=>getSubscriptionPlan(Ee)==="ENTERPRISE",isBusinessPlan=Ee=>getSubscriptionPlan(Ee)==="BUSINESS",getUserRole=Ee=>Ee?Ee.is_super_group_admin===!0||Ee.is_super_group_admin===1?ROLES.GROUP_ADMIN:Ee.role!==void 0?Ee.role:Ee.RoleID!==void 0?Ee.RoleID:Ee.role_level!==void 0?Ee.role_level:Ee.roleLevel!==void 0?Ee.roleLevel:(Ee.groups||Ee.Groups||[]).some(je=>je.is_admin===!0||je.isAdmin===!0)?ROLES.GROUP_ADMIN:ROLES.USER:null,getUserAdminGroups=Ee=>Ee?Ee.ManagedGroups&&Array.isArray(Ee.ManagedGroups)?Ee.ManagedGroups:Ee.managedGroups&&Array.isArray(Ee.managedGroups)?Ee.managedGroups:(Ee.groups||Ee.Groups||[]).filter(Te=>Te.is_admin===!0||Te.isAdmin===!0).map(Te=>Te.id||Te.GroupID||Te.group_id):[],canAccessUploadScreen=(Ee,Re=null)=>{if(!Ee||Ee.is_l1_admin||Ee.IsL1Admin||Ee.is_platform_admin)return!1;const je=getUserRole(Ee);return je===ROLES.VIEW_ONLY?!1:je===ROLES.TENANT_ADMIN?!isEnterprisePlan(Re):[ROLES.GROUP_ADMIN,ROLES.USER].includes(je)},canUploadToGroup=(Ee,Re,Te=null,je=null)=>{if(!Ee||Ee.is_l1_admin||Ee.IsL1Admin||Ee.is_platform_admin)return!1;const Me=getUserRole(Ee);return Me===ROLES.VIEW_ONLY?!1:(Te==null?void 0:Te.is_admin)===!0?!0:Me===ROLES.TENANT_ADMIN?!isEnterprisePlan(je):Me===ROLES.GROUP_ADMIN?(Ee.Groups||Ee.groups||[]).some($e=>$e.GroupID===Re||$e.id===Re||$e.group_id===Re):Me===ROLES.USER?(Ee.Groups||Ee.groups||[]).some($e=>$e.GroupID===Re||$e.id===Re):!1},canViewDocument=(Ee,Re,Te=null)=>{if(!Ee)return!1;if(Ee.is_l1_admin||Ee.IsL1Admin||Ee.is_platform_admin)return!0;const Oe=getUserRole(Ee);return Re?Oe===ROLES.TENANT_ADMIN?isEnterprisePlan(Te)?!1:Ee.TenantID===Re.TenantID||Ee.tenantId===Re.tenantId:(Oe===ROLES.GROUP_ADMIN||Oe===ROLES.USER||Oe===ROLES.VIEW_ONLY,!0):[ROLES.TENANT_ADMIN,ROLES.GROUP_ADMIN,ROLES.USER,ROLES.VIEW_ONLY].includes(Oe)},canDeleteDocument=(Ee,Re,Te=null)=>{var $e;if(!Ee||Ee.is_l1_admin||Ee.IsL1Admin||Ee.is_platform_admin)return!1;const Oe=getUserRole(Ee);if(Oe===ROLES.VIEW_ONLY)return!1;if(!Re)return[ROLES.TENANT_ADMIN,ROLES.GROUP_ADMIN,ROLES.USER].includes(Oe);const Me=Ee.UserID||Ee.id,De=Re.UploadedBy||Re.uploadedBy;if(Oe===ROLES.TENANT_ADMIN)return isEnterprisePlan(Te)?!1:Ee.TenantID===Re.TenantID||Ee.tenantId===Re.tenantId;if(Oe===ROLES.GROUP_ADMIN){const Be=getUserAdminGroups(Ee),Ue=Re.GroupID||Re.groupId||Re.group_id;return Be.length===0?!0:Be.includes(Ue)}if(Oe===ROLES.USER){const Be=(($e=Re.Status)==null?void 0:$e.toLowerCase())==="pending";return De===Me&&Be}return!1},canApproveDocuments=(Ee,Re=null,Te=null)=>{if(!Ee)return!1;const je=getUserRole(Ee);if(je===ROLES.VIEW_ONLY)return!1;if(je===ROLES.TENANT_ADMIN)return isEnterprisePlan(Te)?!1:Re?Ee.TenantID===Re.TenantID||Ee.tenantId===Re.tenantId:!0;if(je===ROLES.GROUP_ADMIN){if(!Re)return!0;const Oe=getUserAdminGroups(Ee),Me=Re.GroupID||Re.groupId||Re.group_id;return Oe.length===0?!0:Oe.includes(Me)}return!1},isTenantAdminOrHigher=Ee=>Ee?Ee.is_l1_admin||Ee.IsL1Admin||Ee.is_platform_admin?!0:getUserRole(Ee)===ROLES.TENANT_ADMIN:!1,isPlatformAdmin=Ee
775=>Ee?!!(Ee.is_l1_admin||Ee.IsL1Admin||Ee.is_platform_admin):!1,getUploadApprovalStatus=Ee=>{if(!Ee)return"required";if(Ee.is_l1_admin||Ee.IsL1Admin||Ee.is_platform_admin)return"none";const Te=getUserRole(Ee);return Te===ROLES.TENANT_ADMIN||Te===ROLES.GROUP_ADMIN?"auto-approved":"required"},canDownloadDocument=(Ee,Re,Te=null)=>!Ee||getUserRole(Ee)===ROLES.TENANT_ADMIN&&isEnterprisePlan(Te)?!1:canViewDocument(Ee,Re,Te),getLoginRedirectPath=(Ee,Re=null)=>{if(!Ee)return"/chat";if(Ee.is_l1_admin||Ee.IsL1Admin||Ee.is_platform_admin)return"/platform/tenants/overview";if(!(Ee.is_payment!==!1))return"/subscription";const Oe=getUserRole(Ee);return Oe===ROLES.TENANT_ADMIN?isEnterprisePlan(Re)?"/documents/repository":(isBusinessPlan(Re),"/chat"):(Oe===ROLES.GROUP_ADMIN,"/chat")},formatFileSize=(Ee,Re=0)=>{if(Ee===0)return"0 Bytes";const Te=1024,je=Re<0?0:Re,Oe=["Bytes","KB","MB","GB","TB"],Me=Math.floor(Math.log(Ee)/Math.log(Te));return parseFloat((Ee/Math.pow(Te,Me)).toFixed(je))+Oe[Me]},formatFileExtensions=Ee=>{if(!Ee||Ee.length===0)return"";const Re=["PDF","DOCX","DOC","XLSX","XLS","PPTX","PPT","CSV","TSV","TXT","MD","RTF","HTML","HTM","ODT","ODS"],Te=Ee.map(je=>je.replace(".","").toUpperCase()).filter((je,Oe,Me)=>Me.indexOf(je)===Oe).filter(je=>!["PNG","JPG","JPEG"].includes(je));return Te.sort((je,Oe)=>{const Me=Re.indexOf(je),De=Re.indexOf(Oe);return Me===-1&&De===-1?0:Me===-1?1:De===-1?-1:Me-De}),Te.join(", ")},getFileTypeDescription=Ee=>{if(!Ee||Ee.length===0)return"supported files";const Re={".pdf":"PDF",".docx":"Word",".doc":"Word",".xlsx":"Excel",".xls":"Excel",".pptx":"PowerPoint",".ppt":"PowerPoint",".odt":"ODT",".rtf":"RTF",".ods":"ODS",".csv":"CSV",".txt":"TXT",".tsv":"TSV",".md":"Markdown",".md":"MD",".html":"HTML",".htm":"HTML"},Te=["PDF","Word","Excel","PowerPoint","CSV","TSV","TXT","Markdown","RTF","HTML","ODT","ODS"],je=Ee.filter(Oe=>![".png",".jpg",".jpeg"].includes(Oe.toLowerCase())).map(Oe=>Re[Oe.toLowerCase()]||Oe.replace(".","").toUpperCase()).filter((Oe,Me,De)=>De.indexOf(Oe)===Me);return je.sort((Oe,Me)=>{const De=Te.indexOf(Oe),$e=Te.indexOf(Me);return De===-1&&$e===-1?0:De===-1?1:$e===-1?-1:De-$e}),je.join(", ")},ProtectedRoute=({children:Ee,requireAuth:Re=!0,requiredRole:Te=null})=>{const je=useLocation(),{isAuthenticated:Oe,user:Me,loading:De}=useSelector(Xe=>Xe.auth),{tcAccepted:$e,tcLoaded:Be}=useSelector(Xe=>Xe.user),[Ue,ze]=reactExports.useState(!1),{subscription:We}=useSelector(Xe=>Xe.subscription);if(reactExports.useEffect(()=>{if(Oe&&Me){const Xe=String(Me.user_id||Me.UserID||Me.id||""),He=sessionStorage.getItem("active_user_id");if(!He)sessionStorage.setItem("active_user_id",Xe);else if(He!==Xe){sessionStorage.removeItem("active_user_id"),window.location.href="/login";return}}else Oe||sessionStorage.removeItem("active_user_id")},[Oe,Me,je.pathname]),reactExports.useEffect(()=>{if(je.pathname.startsWith("/platform")&&!((Me==null?void 0:Me.is_l1_admin)||(Me==null?void 0:Me.IsL1Admin)||!1)&&Oe){ze(!0);const He=isEnterprisePlan(We)?"/documents/repository":"/chat";window.location.href=He}},[je.pathname,Me,Oe,We]),De&&!Oe)return jsxRuntimeExports.jsx(Loader,{fullScreen:!0,message:"Verifying authentication..."});if(Ue)return jsxRuntimeExports.jsx(Loader,{fullScreen:!0,message:""});if(je.pathname.startsWith("/platform")&&!((Me==null?void 0:Me.is_l1_admin)||(Me==null?void 0:Me.IsL1Admin)||!1)&&Oe)return jsxRuntimeExports.jsx(Loader,{fullScreen:!0,message:""});if(Re&&!Oe)return jsxRuntimeExports.jsx(Navigate,{to:"/login",state:{from:je},replace:!0});if(Oe&&Me&&!Be)return jsxRuntimeExports.jsx(Loader,{fullScreen:!0,message:""});if(Oe&&Me&&Be){const Xe=Me.is_payment!==!1,He=Me.is_l1_admin||Me.IsL1Admin||!1,qe=Me.trial_expired===!0;if(!He&&!Xe&&!qe&&je.pathname!=="/subscription")return jsxRuntimeExports.jsx(Navigate,{to:"/subscription",replace:!0})}if(Oe&&Me&&Be&&!$e&&je.pathname!=="/terms-acceptance")return jsxRuntimeExports.jsx(Navigate,{to:"/terms-acceptance",replace:!0});if(Te&&Me){const Xe=Me.role||Me.RoleID;if(Array.isArray(Te)){if(!Te.includes(Xe))return jsxRuntimeExports.jsx(Navigate,{to:"/unauthorized",replace:!0})}else if(Xe!==Te)return jsxRuntimeExports.jsx(Navigate,{to:"/unauthorized",replace:!0})}return Oe&&["/login","/register","/forgot-password"].includes(je.pathname)?jsxRuntimeExports.jsx(Navigate,{to:"/chat",replace:!0}):Ee},MaintenanceGuard=({children:Ee})=>{const Re=useLocation(),{user:Te}=useSelector($e=>$e.auth||{}),{maintenanceMode:je,loading:Oe}=useSelector($e=>$e.maintenance||{}),Me=(Te==null?void 0:Te.role)==="superadmin"||(Te==null?void 0:Te.role)==="super_admin",De=isPlatformAdmin(Te);return Oe?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"80vh"},children:jsxRuntimeExports.jsx(Loader,{message:"Checking system status..."})}):je&&!Me&&!De&&Re.pathname!=="/maintenance"?jsxRuntimeExports.jsx(Navigate,{to:"/maintenance",replace:!0}):je&&De&&!Re.pathname.startsWith("/platform")?jsxRuntimeExports.jsx(Navigate,{to:"/platform",replace:!0}):!je&&Re.pathname==="/maintenance"?jsxRuntimeExports.jsx(Navigate,{to:"/",replace:!0}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Ee})},NAV_ICONS={chat:jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),documents:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"})]}),favorites:jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"})}),agentApps:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"8",width:"18",height:"13",rx:"2"}),jsxRuntimeExports.jsx("path",{d:"M12 4v4"}),jsxRuntimeExports.jsx("circle",{cx:"12",cy:"3",r:"1"}),jsxRuntimeExports.jsx("path",{d:"M8 13h.01"}),jsxRuntimeExports.jsx("path",{d:"M16 13h.01"}),jsxRuntimeExports.jsx("path",{d:"M9 17h6"})]}),agentSchedules:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),jsxRuntimeExports.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"}),jsxRuntimeExports.jsx("path",{d:"M8 14h.01"}),jsxRuntimeExports.jsx("path",{d:"M12 14h.01"}),jsxRuntimeExports.jsx("path",{d:"M16 14h.01"}),jsxRuntimeExports.jsx("path",{d:"M8 18h.01"}),jsxRuntimeExports.jsx("path",{d:"M12 18h.01"})]}),models:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M12 2v4"}),jsxRuntimeExports.jsx("path",{d:"M12 18v4"}),jsxRuntimeExports.jsx("path",{d:"M4.93 4.93l2.83 2.83"}),jsxRuntimeExports.jsx("path",{d:"M16.24 16.24l2.83 2.83"}),jsxRuntimeExports.jsx("path",{d:"M2 12h4"}),jsxRuntimeExports.jsx("path",{d:"M18 12h4"}),jsxRuntimeExports.jsx("path",{d:"M4.93 19.07l2.83-2.83"}),jsxRuntimeExports.jsx("path",{d:"M16.24 7.76l2.83-2.83"}),jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),connectors:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),jsxRuntimeExports.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),chatSettings:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),users:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),jsxRuntimeExports.jsx("circle",{cx:"9",cy:"7",r:"4"}),jsxRuntimeExports.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),jsxRuntimeExports.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),groups:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),jsxRuntimeExports.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),analytics:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"22"}),jsxRuntimeExports.jsx("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]}),auditLogs:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),jsxRuntimeExports.jsx("polyline",{points:"10 9 9 9 8 9"})]}),executive:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M3 3v18h18"}),jsxRuntimeExports.jsx("path",{d:"M7 14l4-4 3 3 5-6"})]}),tenants:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),jsxRuntimeExports.jsx("polyline",{points:"9 22 9 12 15 12 15 22"})]}),subscriptions:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),jsxRuntimeExports.jsx("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),pipeline:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"}),jsxRuntimeExports.jsx("path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"})]}),health:jsxRuntimeExports.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"})}),agents:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),jsxRuntimeExports.jsx("circle",{cx:"12",cy:"5",r:"2"}),jsxRuntimeExports.jsx("path",{d:"M12 7v4"}),jsxRuntimeExports.jsx("line",{x1:"8",y1:"16",x2:"8",y2:"16"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"16",x2:"16",y2:"16"})]}),settings:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M12 1v6m0 6v6m5.2-13.2l-4.2 4.2m-1.8 1.8l-4.2 4.2M23 12h-6m-6 0H1m18.2 5.2l-4.2-4.2m-1.8-1.8l-4.2-4.2"})]})},TENANT_MENU_SECTIONS=[{id:"main",label:"Main",collapsible:!1,showLabel:!1,items:[{id:"chat",label:"Chat",path:"/chat",match:"/chat",icon:"chat",dataTour:"chat-nav",visible:"endUserCore"},{id:"documents",label:"Documents",path:"/documents/repository",match:"/documents",icon:"documents",dataTour:"documents-nav",visible:"notPlatformAdmin"},{id:"favorites",label:"Favorites",path:"/favorites",match:"/favorites",icon:"favorites",dataTour:"favorites-nav",visible:"endUserCore"}]},{id:"agents",label:"Agents",collapsible:!0,showLabel:!0,defaultExpanded:!1,items:[{id:"agent-apps",label:"Agent Apps",path:"/agent-apps",match:"/agent-apps",icon:"agentApps",dataTour:"agent-apps-nav",visible:"endUserCore"},{id:"agent-schedules",label:"Agent Schedules",path:"/agent-schedules",match:"/agent-schedules",icon:"agentSchedules",dataTour:"agent-schedules-nav",visible:"endUserCore"}]},{id:"platform",label:"Platform",collapsible:!0,showLabel:!0,defaultExpanded:!1,items:[{id:"models",label:"Models",path:"/admin/models",match:"/admin/models",icon:"models",dataTour:"models-nav",visible:"tenantAdmin"},{id:"connectors",label:"Connectors",path:"/admin/connectors",match:"/admin/connectors",icon:"connectors",dataTour:"connectors-nav",visible:"tenantOrGroupAdmin"},{id:"chat-settings",label:"Chat Settings",path:"/admin/chat-settings",match:"/admin/chat-settings",icon:"chatSettings",dataTour:"chat-settings-nav",visible:"tenantAdmin"}]},{id:"administration",label:"Administration",collapsible:!0,showLabel:!0,defaultExpanded:!1,items:[{id:"users",label:"Users",path:"/admin/users",match:"/admin/users",icon:"users",dataTour:"users-nav",visible:"canManageUsers"},{id:"groups",label:"Groups",path:"/groups",match:"/groups",icon:"groups",dataTour:"groups-nav",visible:"notViewOnlyOrPlatformAdmin"},{id:"analytics",label:"Analytics",path:"/analytics",match:"/analytics",icon:"analytics",dataTour:"analytics-nav",visible:"analyticsAccess"},{id:"audit-logs",label:"Audit Logs",path:"/admin/audit-logs",match:"/admin/audit-logs",icon:"auditLogs",dataTour:"audit-logs-nav",visible:"canManageUsers"}]}],PLATFORM_ADMIN_SECTION={id:"platform-admin",label:"Platform Admin",collapsible:!1,showLabel:!0,items:[{id:"executive",label:"Executive",path:"/platform/executive",match:"/platform/executive",icon:"executive",visible:"platformAdmin"},{id:"tenants",label:"Tenants",path:"/platform/tenants",match:"/platform/tenants",icon:"tenants",visible:"platformAdmin"},{id:"subscriptions",label:"Subscriptions",path:"/platform/subscriptions",match:"/platform/subscriptions",icon:"subscriptions",visible:"platformAdmin"},{id:"pipeline",label:"Pipeline",path:"/platform/pipeline",match:"/platform/pipeline",icon:"pipeline",visible:"platformAdmin"},{id:"health",label:"System Health",path:"/platform/health",match:"/platform/health",icon:"health",visible:"platformAdmin"},{id:"platform-audit-logs",label:"Audit Logs",path:"/platform/audit-logs",match:"/platform/audit-logs",icon:"auditLogs",visible:"platformAdmin"},{id:"pla
775tform-agents",label:"Agents",path:"/platform/agents",match:"/platform/agents",icon:"agents",visible:"platformAdmin"},{id:"platform-settings",label:"Settings",path:"/platform/settings",match:"/platform/settings",icon:"settings",visible:"platformAdmin"}]},ChevronIcon=({open:Ee})=>jsxRuntimeExports.jsx("svg",{className:`nav-section-chevron ${Ee?"open":""}`,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:jsxRuntimeExports.jsx("polyline",{points:"6 9 12 15 18 9"})}),NavButton=({item:Ee,active:Re,onNavigate:Te})=>jsxRuntimeExports.jsxs("button",{type:"button",className:`nav-button ${Re?"active":""}`,onClick:()=>Te(Ee.path),title:Ee.label,"data-tour":Ee.dataTour,children:[NAV_ICONS[Ee.icon],jsxRuntimeExports.jsx("span",{className:"nav-label",children:Ee.label})]}),NavigationMenu=()=>{const Ee=useNavigate(),Re=useLocation(),{user:Te}=useSelector(sr=>sr.auth),je=useSelector(sr=>{var xr;return((xr=sr.groups)==null?void 0:xr.groups)||[]}),{subscription:Oe}=useSelector(sr=>sr.subscription),[Me,De]=reactExports.useState(!1),[$e,Be]=reactExports.useState(!1),[Ue,ze]=reactExports.useState(!1),[We,Xe]=reactExports.useState(()=>{const sr={};return TENANT_MENU_SECTIONS.forEach(xr=>{xr.collapsible&&(sr[xr.id]=xr.defaultExpanded!==!1)}),sr}),{darkMode:He}=useThemeMode(),{requestNavigation:qe}=useNavigationGuard(),Ge=sr=>{qe(()=>Ee(sr)),ze(!1)},Ye=sr=>Re.pathname.startsWith(sr),Ve=()=>{const sr=(Te==null?void 0:Te.role)??(Te==null?void 0:Te.RoleID)??(Te==null?void 0:Te.role_level)??(Te==null?void 0:Te.level);if(typeof sr=="string"){const Rr=sr.toLowerCase();return["group_admin","group-admin","department_admin","department-admin"].includes(Rr)?ROLES.GROUP_ADMIN:["tenant_admin","tenant-admin"].includes(Rr)?ROLES.TENANT_ADMIN:["view_only","view-only","readonly","read-only"].includes(Rr)?ROLES.VIEW_ONLY:ROLES.USER}const xr=Number(sr);return Number.isNaN(xr)?ROLES.USER:xr},Ke=()=>(Te==null?void 0:Te.is_l1_admin)||(Te==null?void 0:Te.IsL1Admin)||!1,Qe=()=>Ve()===ROLES.VIEW_ONLY,Ze=()=>Ve()!==ROLES.TENANT_ADMIN?!1:isEnterprisePlan(Oe),Je=()=>!Ke()&&Ve()===ROLES.TENANT_ADMIN,ir=()=>!Ke()&&Ve()===ROLES.GROUP_ADMIN,rr=()=>{const sr=Ve(),xr=(Te==null?void 0:Te.is_l1_admin)||!1,br=(je.length>0?je:(Te==null?void 0:Te.groups)||(Te==null?void 0:Te.Groups)||[]).some(wr=>wr.is_admin===!0||wr.isAdmin===!0);return xr||sr===ROLES.TENANT_ADMIN||sr===ROLES.GROUP_ADMIN||br},ar=reactExports.useMemo(()=>({endUserCore:()=>!Ze()&&!Ke(),notPlatformAdmin:()=>!Ke(),tenantAdmin:()=>Je()&&!Qe(),tenantOrGroupAdmin:()=>(Je()||ir())&&!Qe(),canManageUsers:()=>rr()&&!Qe()&&!Ke(),notViewOnlyOrPlatformAdmin:()=>!Qe()&&!Ke(),analyticsAccess:()=>Ve()!==ROLES.USER&&!Qe()&&!Ke(),platformAdmin:()=>Ke()}),[Te,je,Oe]),or=sr=>{const xr=ar[sr.visible];return typeof xr=="function"?xr():!0},pr=reactExports.useMemo(()=>Ke()?[PLATFORM_ADMIN_SECTION]:TENANT_MENU_SECTIONS.map(sr=>({...sr,items:sr.items.filter(or)})).filter(sr=>sr.items.length>0),[ar]);reactExports.useEffect(()=>{Xe(sr=>{let xr=!1;const Rr={...sr};return pr.forEach(br=>{if(!br.collapsible)return;br.items.some(vr=>Ye(vr.match))&&!Rr[br.id]&&(Rr[br.id]=!0,xr=!0)}),xr?Rr:sr})},[Re.pathname,pr]),reactExports.useEffect(()=>{var Rr,br;const sr=(Rr=window.matchMedia)==null?void 0:Rr.call(window,"(max-width: 768px)");if(!sr)return;const xr=()=>{const wr=!!sr.matches;Be(wr),wr&&De(!0),ze(!1)};return xr(),(br=sr.addEventListener)==null||br.call(sr,"change",xr),()=>{var wr;return(wr=sr.removeEventListener)==null?void 0:wr.call(sr,"change",xr)}},[]),reactExports.useEffect(()=>{$e&&ze(!1)},[Re.pathname,$e]);const tr=sr=>!sr.collapsible||Me?!0:We[sr.id]!==!1,nr=sr=>{Xe(xr=>({...xr,[sr]:!xr[sr]}))},hr=sr=>{const xr=tr(sr),Rr=sr.items.some(br=>Ye(br.match));return jsxRuntimeExports.jsxs("div",{className:`nav-section ${sr.collapsible?"collapsible":""}`,children:[sr.showLabel&&(sr.collapsible&&!Me?jsxRuntimeExports.jsxs("button",{type:"button",className:`nav-section-header collapsible ${Rr?"has-active":""}`,onClick:()=>nr(sr.id),"aria-expanded":xr,"aria-controls":`nav-section-${sr.id}`,children:[jsxRuntimeExports.jsx("span",{className:"nav-section-label",children:sr.label}),jsxRuntimeExports.jsx(ChevronIcon,{open:xr})]}):jsxRuntimeExports.jsx("div",{className:"nav-section-header",children:jsxRuntimeExports.jsx("span",{className:"nav-section-label",children:sr.label})})),jsxRuntimeExports.jsx("div",{id:`nav-section-${sr.id}`,className:`nav-section-items ${sr.collapsible?xr?"expanded":"collapsed":""}`,role:sr.collapsible?"region":void 0,children:sr.items.map(br=>
775jsxRuntimeExports.jsx(NavButton,{item:br,active:Ye(br.match),onNavigate:Ge},br.id))})]},sr.id)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("button",{type:"button",className:`mobile-nav-toggle ${He?"dark":""}`,onClick:()=>ze(!0),"aria-label":"Open menu",children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),jsxRuntimeExports.jsx("button",{type:"button",className:`navigation-menu-overlay ${Ue?"open":""}`,onClick:()=>ze(!1),"aria-label":"Close menu"}),jsxRuntimeExports.jsxs("div",{className:`navigation-menu ${Me?"collapsed":""} ${He?"dark":""} ${$e?"mobile":""} ${Ue?"mobile-open":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"menu-header",children:[$e&&jsxRuntimeExports.jsx("button",{type:"button",className:"mobile-close",onClick:()=>ze(!1),"aria-label":"Close menu",children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),jsxRuntimeExports.jsx("button",{type:"button",className:"collapse-toggle",onClick:()=>De(!Me),"aria-label":Me?"Expand menu":"Collapse menu","aria-expanded":!Me,children:Me?jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:"9 18 15 12 9 6"})}):jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:"15 18 9 12 15 6"})})})]}),jsxRuntimeExports.jsx("nav",{className:"nav-items","aria-label":"Main navigation",children:pr.map(hr)}),jsxRuntimeExports.jsxs("div",{className:"nav-footer",children:[jsxRuntimeExports.jsx("div",{className:"nav-footer-text",children:"© 2026 OpenParser AI. All rights reserved."}),jsxRuntimeExports.jsxs("div",{className:"nav-footer-links",children:[jsxRuntimeExports.jsx("button",{type:"button",className:`nav-footer-link ${Ye("/terms")?"active":""}`,onClick:()=>Ge("/terms"),title:"Terms & Conditions",children:"Terms & Conditions"}),jsxRuntimeExports.jsx("span",{className:"nav-footer-separator",children:"â¢"}),jsxRuntimeExports.jsx("button",{type:"button",className:`nav-footer-link ${Ye("/privacy")?"active":""}`,onClick:()=>Ge("/privacy"),title:"Privacy Policy",children:"Privacy Policy"})]})]})]})]})},ROOT_KEY="__ROOT__";function getGroupStableId(Ee){if(!Ee||typeof Ee!="object")return"";const Re=Ee.id??Ee.group_id??Ee.GroupID;return Re==null?"":String(Re)}function getParentRefFromGroup(Ee){return!Ee||typeof Ee!="object"?null:Ee.parent_group_id??Ee.ParentGroupId??Ee.ParentGroupID??Ee.parentGroupId??Ee.parent_groupId??null}function parentKeyFromRef(Ee){return Ee==null||Ee===""?ROOT_KEY:String(Ee)}function buildGroupChildTree(Ee){const Re=Array.isArray(Ee)?Ee:[],Te=new Map;Re.forEach(Oe=>{if(!getGroupStableId(Oe))return;const De=parentKeyFromRef(getParentRefFromGroup(Oe));Te.has(De)||Te.set(De,[]),Te.get(De).push(Oe)}),Te.forEach(Oe=>{Oe.sort((Me,De)=>(Me.name||Me.GroupName||"").localeCompare(De.name||De.GroupName||"",void 0,{sensitivity:"case"}))});const je=Oe=>(Te.get(Oe)||[]).map(De=>{const $e=getGroupStableId(De);return{id:$e,name:De.name||De.GroupName||`Group ${$e}`,group:De,children:je($e)}});return je(ROOT_KEY)}function collectDescendantIds(Ee,Re){const Te=Re==null||Re===""?"":String(Re),je=new Map;(Array.isArray(Ee)?Ee:[]).forEach($e=>{if(!getGroupStableId($e))return;const Ue=parentKeyFromRef(getParentRefFromGroup($e));je.has(Ue)||je.set(Ue,[]),je.get(Ue).push($e)});
775const Me=new Set,De=[Te];for(;De.length;){const $e=De.pop();(je.get($e)||[]).forEach(Ue=>{const ze=getGroupStableId(Ue);ze&&!Me.has(ze)&&(Me.add(ze),De.push(ze))})}return Me}function groupsEqual(Ee,Re){return!Ee||!Re?!1:getGroupStableId(Ee)===getGroupStableId(Re)&&getGroupStableId(Ee)!==""}function normalizeGroupParentId(Ee){if(Ee==null||Ee==="")return null;const Re=Number(Ee);return Number.isNaN(Re)?null:Re}function findDuplicateGroupName(Ee,Re,{parentGroupId:Te=null,excludeGroupId:je=null}={}){const Oe=(Re||"").trim();if(!Oe)return null;const Me=normalizeGroupParentId(Te),De=je==null?null:Number(je);return(Array.isArray(Ee)?Ee:[]).find($e=>{const Be=$e.id??$e.group_id??$e.GroupID;if(De!=null&&Number(Be)===De)return!1;const Ue=($e.name||$e.GroupName||"").trim();return normalizeGroupParentId(getParentRefFromGroup($e))!==Me?!1:Ue===Oe})||null}const SelectedChipsSummary=({items:Ee=[],onRemove:Re,onClearAll:Te,threshold:je=2,title:Oe="Selected",size:Me="small",disabled:De=!1})=>{const[$e,Be]=reactExports.useState(!1);return Ee.length?Ee.length<=je?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Ee.map(Ue=>jsxRuntimeExports.jsx(Chip,{label:Ue.label,size:Me,disabled:De,onDelete:De||!Re?void 0:()=>Re(Ue.id)},Ue.id))}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Chip,{label:`${Ee.length} selected`,size:Me,disabled:De,onClick:Ue=>{Ue.stopPropagation(),Be(!0)}}),jsxRuntimeExports.jsxs(Dialog,{open:$e,onClose:()=>Be(!1),maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Oe,jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:()=>Be(!1),children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})})]}),jsxRuntimeExports.jsx(DialogContent,{dividers:!0,children:jsxRuntimeExports.jsx(Box,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:Ee.map(Ue=>jsxRuntimeExports.jsx(Chip,{label:Ue.label,size:Me,disabled:De,onDelete:De||!Re?void 0:()=>Re(Ue.id)},Ue.id))})}),jsxRuntimeExports.jsxs(DialogActions,{children:[Te&&jsxRuntimeExports.jsx(Button,{color:"error",onClick:()=>{Te(),Be(!1)},disabled:De,children:"Clear All"}),jsxRuntimeExports.jsx(Button,{onClick:()=>Be(!1),children:"Done"})]})]})]}):null};function renderTreeNodes({nodes:Ee,level:Re,multiple:Te,value:je,expanded:Oe,toggleExpand:Me,onPick:De,isSelected:$e,leafItemsByGroupId:Be}){return Ee.map(Ue=>{var qe;const ze=((qe=Be==null?void 0:Be.get)==null?void 0:qe.call(Be,String(Ue.id)))||[],We=Array.isArray(Ue.children)&&Ue.children.length>0||ze.length>0,Xe=!!Oe[Ue.id],He=$e(Ue.group);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(ListItemButton,{dense:!0,selected:!Te&&He,sx:{pl:1+Re*2,pr:1,py:.5,alignItems:"flex-start"},onClick:()=>De(Ue.group),children:[jsxRuntimeExports.jsx(Box,{sx:{width:28,flexShrink:0,display:"flex",alignItems:"flex-start",justifyContent:"center",pt:.25},children:We?jsxRuntimeExports.jsx(IconButton,{size:"small",sx:{p:.25},tabIndex:-1,onClick:Ge=>{Ge.stopPropagation(),Me(Ue.id)},children:Xe?jsxRuntimeExports.jsx(ExpandMoreIcon,{fontSize:"small"}):jsxRuntimeExports.jsx(ChevronRight,{fontSize:"small"})}):null}),Te&&jsxRuntimeExports.jsx(Checkbox,{size:"small",sx:{flexShrink:0,p:.25,mt:-.125,mr:.5,pointerEvents:"none"},checked:He,tabIndex:-1,disableRipple:!0}),jsxRuntimeExports.jsx(ListItemText,{primary:Ue.name,sx:{m:0,minWidth:0,flex:1},primaryTypographyProps:{variant:"body2",sx:{whiteSpace:"normal",wordBreak:"break-word",lineHeight:1.4}}})]}),We&&jsxRuntimeExports.jsx(Collapse,{in:Xe,timeout:"auto",unmountOnExit:!0,children:jsxRuntimeExports.jsxs(List,{disablePadding:!0,dense:!0,children:[renderTreeNodes({nodes:Ue.children,level:Re+1,multiple:Te,value:je,expanded:Oe,toggleExpand:Me,onPick:De,isSelected:$e,leafItemsByGroupId:Be}),ze.map(Ge=>jsxRuntimeExports.jsxs(ListItem,{dense:!0,sx:{pl:1+(Re+1)*2,py:.25},children:[jsxRuntimeExports.jsx(Box,{sx:{width:32,display:"flex",justifyContent:"center",flexShrink:0},children:Ge.icon||null}),jsxRuntimeExports.jsx(ListItemText,{sx:{my:0},primary:Ge.label,secondary:Ge.secondary,primaryTypographyProps:{variant:"body2",noWrap:!0,color:"text.secondary"},secondaryTypographyProps:{variant:"caption",noWrap:!0,color:"text.disabled"}})]},`leaf-${Ge.id}`))]})})]},Ue.id)})}const GroupHierarchyPicker=({options:Ee=[],value:Re,onChange:Te,multiple:je=!1,label:Oe,placeholder:Me="Select groupsâ¦",helperText:De,disabled:$e=!1,size:Be="medium",excludeIds:Ue=null,showTopLevelOption:ze=!1,topLevelLabel:We="Top-level group",leafItemsByGroupId:Xe=null,summaryThreshold:He=1/0})=>{const[qe,Ge]=reactExports.useState(null),[Ye,Ve]=reactExports.useState({}),Ke=reactExports.useMemo(()=>Ue?Ue instanceof Set?Ue:new Set(Ue.map(String)):new Set,[Ue]),Qe=reactExports.useMemo(()=>Ke.size===0?Ee:Ee.filter(tr=>!Ke.has(getGroupStableId(tr))),[Ee,Ke]),Ze=reactExports.useMemo(()=>buildGroupChildTree(Qe),[Qe]),Je=reactExports.useCallback(tr=>{Ve(nr=>({...nr,[tr]:!nr[tr]}))},[]),ir=reactExports.useCallback(tr=>{if(!tr)return!1;const nr=getGroupStableId(tr);return nr?je?(Array.isArray(Re)?Re:[]).some(sr=>getGroupStableId(sr)===nr):Re!=null&&groupsEqual(Re,tr):!1},[je,Re]),rr=reactExports.useCallback(tr=>{if(!$e)if(je){const nr=Array.isArray(Re)?Re:[],hr=getGroupStableId(tr),sr=nr.some(xr=>getGroupStableId(xr)===hr);Te(sr?nr.filter(xr=>getGroupStableId(xr)!==hr):[...nr,tr])}else Te(tr),Ge(null)},[$e,je,Te,Re]),ar=reactExports.useCallback(tr=>{if($e||!je)return;const nr=Array.isArray(Re)?Re:[],hr=getGroupStableId(tr);Te(nr.filter(sr=>getGroupStableId(sr)!==hr))},[$e,je,Te,Re]),or=!je&&Re?Re.name||Re.GroupName||`Group ${getGroupStableId(Re)}`:"",pr=!!qe;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TextField,{label:Oe,placeholder:Me,helperText:De,disabled:$e,size:Be,fullWidth:!0,value:je?"":or,onMouseDown:tr=>!$e&&tr.preventDefault(),onClick:tr=>!$e&&Ge(tr.currentTarget),sx:{cursor:$e?"not-allowed":"pointer","& .MuiInputBase-root":{cursor:$e?"not-allowed":"pointer"},"& .MuiInputBase-input":{cursor:$e?"not-allowed":"pointer",caretColor:"transparent",userSelect:"none"}},InputProps:{readOnly:!0,onKeyDown:tr=>{(tr.key==="Enter"||tr.key===" ")&&(tr.preventDefault(),$e||Ge(tr.currentTarget))},startAdornment:je&&Array.isArray(Re)&&Re.length>0?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5,py:.5,pr:1,maxWidth:"100%"},onClick:tr=>tr.stopPropagation(),children:jsxRuntimeExports.jsx(SelectedChipsSummary,{items:Re.map(tr=>({id:getGroupStableId(tr),label:tr.name||tr.GroupName||`Group ${getGroupStableId(tr)}`})),onRemove:$e?void 0:tr=>ar(Re.find(nr=>getGroupStableId(nr)===tr)),onClearAll:$e?void 0:()=>Te([]),threshold:He,title:"Selected Groups",size:Be==="small"?"small":"medium",disabled:$e})}):void 0},inputProps:{"aria-expanded":pr,"aria-haspopup":"tree"}}),jsxRuntimeExports.jsx(Popover,{open:pr,anchorEl:qe,onClose:()=>Ge(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{sx:{width:Math.max((qe==null?void 0:qe.offsetWidth)||0,360),maxHeight:420,mt:.5}},children:jsxRuntimeExports.jsxs(Box,{sx:{overflow:"auto",maxHeight:400},children:[ze&&!je&&jsxRuntimeExports.jsx(MenuItem,{dense:!0,selected:Re==null,onClick:()=>{$e||(Te(null),Ge(null))},children:We}),ze&&!je&&Ze.length>0&&jsxRuntimeExports.jsx(Divider,{}),Ze.length===0?!ze&&jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{p:2},children:"No groups available"}):jsxRuntimeExports.jsx(List,{dense:!0,disablePadding:!0,sx:{py:.5}
775,children:renderTreeNodes({nodes:Ze,level:0,multiple:je,value:Re,expanded:Ye,toggleExpand:Je,onPick:rr,isSelected:ir,leafItemsByGroupId:Xe})})]})})]})};function isSuperGroupAdminFlag(Ee){return(Ee==null?void 0:Ee.is_super_group_admin)===!0||(Ee==null?void 0:Ee.is_super_group_admin)===1}function extractGroupIds(Ee){return(Array.isArray(Ee)?Ee:[]).map(Re=>Re==null?null:typeof Re=="number"||typeof Re=="string"?Re:Re.group_id??Re.GroupID??Re.id??null).filter(Re=>Re!=null&&Re!=="")}async function releaseSuperGroupAdminAssignment(Ee,Re=0){await superGroupAdminService.unassign(Ee,Re)}async function syncSuperGroupAdminGroups(Ee,Re,Te=0){const je=[...new Set(extractGroupIds(Re).map(Oe=>Number(Oe)).filter(Oe=>!Number.isNaN(Oe)))];if(je.length===0){await releaseSuperGroupAdminAssignment(Ee,Te);return}await superGroupAdminService.assign(Ee,je)}async function syncSuperGroupAdminAfterRoleChange({userId:Ee,wasSuperGroupAdmin:Re,isSuperGroupAdmin:Te,groupIds:je,revertRole:Oe=0}){if(!(!Re&&!Te)){if(Re&&!Te){await releaseSuperGroupAdminAssignment(Ee,Oe);return}Te&&await syncSuperGroupAdminGroups(Ee,je,Oe)}}const DarkModeToggle=({sx:Ee})=>{const{darkMode:Re,toggleDarkMode:Te}=useThemeMode();return jsxRuntimeExports.jsx(Tooltip,{title:Re?"Switch to Light Mode":"Switch to Dark Mode",children:jsxRuntimeExports.jsx(IconButton,{onClick:Te,sx:{width:44,height:44,border:Re?"1px solid #475569":"1px solid #e5e7eb",borderRadius:"10px",backgroundColor:Re?"#334155":"#f9fafb",color:Re?"#F59E0B":"#6b7280",transition:"transform 0.15s ease, box-shadow 0.15s ease","&:hover":{backgroundColor:Re?"#475569":"#f3f4f6",borderColor:Re?"#64748b":"#d1d5db",color:Re?"#FCD34D":"#111827",transform:"scale(1.05)"},"&:active":{transform:"scale(0.95)"},...Ee},children:Re?jsxRuntimeExports.jsx(LightModeOutlined,{}):jsxRuntimeExports.jsx(DarkModeOutlined,{})})})},TenantSwitcher=({onClose:Ee})=>{const Re=useDispatch(),Te=useNavigate(),{user:je,tenants:Oe,tenantsLoading:Me,tenantsFetched:De,tenantsError:$e}=useSelector(Qe=>Qe.auth),[Be,Ue]=reactExports.useState(!1),[ze,We]=reactExports.useState(null),[Xe,He]=reactExports.useState(null),qe=reactExports.useRef(null),Ge=Me&&!De,Ye=$e;reactExports.useEffect(()=>{const Qe=Ze=>{qe.current&&!qe.current.contains(Ze.target)&&Ue(!1)};if(Be)return document.addEventListener("mousedown",Qe),()=>{document.removeEventListener("mousedown",Qe)}},[Be]),reactExports.useEffect(()=>{const Qe=Ze=>{Ze.key==="Escape"&&Be&&Ue(!1)};if(Be)return document.addEventListener("keydown",Qe),()=>{document.removeEventListener("keydown",Qe)}},[Be]);const Ve=async Qe=>{if(Qe===(je==null?void 0:je.user_id)||Qe===(je==null?void 0:je.id)){Ue(!1);return}try{He(Qe),We(null);const Ze=await Re(switchTenant(Qe)).unwrap();if(Ze!=null&&Ze.needs_email_verification){Ue(!1),Ee&&Ee(),Te("/login",{state:{message:"This organization has not been verified yet. Enter the code sent to your email to continue.",needsEmailVerification:!0,temp_token:Ze.temp_token}});return}Ue(!1),Ee&&Ee()}catch(Ze){console.error("Failed to switch tenant:",Ze),We(Ze||"Failed to switch tenant")}finally{He(null)}},Ke=Oe.filter(Qe=>!Qe.is_current);return Ge||!Ye&&Ke.length===0?null:jsxRuntimeExports.jsxs("div",{ref:qe,className:"tenant-switcher",children:[jsxRuntimeExports.jsxs("button",{className:"topbar-dropdown-item",onClick:()=>Ue(!Be),title:"Switch to another organization",children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"1"}),jsxRuntimeExports.jsx("path",{d:"M12 6v6m0 6v.01M6.22 6.22l4.24 4.24m5.08 0l4.24-4.24M6.22 17.78l4.24-4.24m5.08 0l4.24 4.24"})]}),"Switch Organization"]}),Be&&jsxRuntimeExports.jsx("div",{className:"tenant-switcher-modal-overlay",children:jsxRuntimeExports.jsxs("div",{className:"tenant-switcher-modal",children:[jsxRuntimeExports.jsxs("div",{className:"tenant-switcher-header",children:[jsxRuntimeExports.jsx("h3",{children:"Choose an Account"}),jsxRuntimeExports.jsx("button",{className:"tenant-switcher-close",onClick:()=>Ue(!1),"aria-label":"Close",children:"â"})]}),Ge&&jsxRuntimeExports.jsx("div",{className:"tenant-switcher-content",children:jsxRuntimeExports.jsx("p",{children:"Loading tenants..."})}),!Ge&&Ye&&jsxRuntimeExports.jsxs("div",{className:"tenant-switcher-content",children:[jsxRuntimeExports.jsx("p",{className:"tenant-switcher-error",children:Ye}),jsxRuntimeExports.jsx("button",{className:"tenant-switcher-retry",onClick:()=>Re(fetchMyTenants()),children:"Retry"})]}),!Ge&&!Ye&&Ke.length>0&&jsxRuntimeExports.jsxs("div",{className:"tenant-switcher-content",children:[ze&&jsxRuntimeExports.jsx("p",{className:"tenant-switcher-error",children:ze}),Ke.map(Qe=>jsxRuntimeExports.jsxs("button",{className:"tenant-switcher-option",onClick:()=>Ve(Qe.user_id),disabled:Xe===Qe.user_id,children:[jsxRuntimeExports.jsxs("div",{className:"tenant-switcher-option-content",children:[jsxRuntimeExports.jsx("div",{className:"tenant-switcher-name",children:Qe.tenant_name||`Tenant #${Qe.tenant_id}`}),Qe.role===2&&jsxRuntimeExports.jsx("span",{className:"tenant-switcher-badge",children:"Admin"})]}),Xe===Qe.user_id&&jsxRuntimeExports.jsx("div",{className:"tenant-switcher-spinner"})]},Qe.user_id))]}),!Ge&&!Ye&&Ke.length===0&&jsxRuntimeExports.jsx("div",{className:"tenant-switcher-content",children:jsxRuntimeExports.jsx("p",{children:"No other tenants available"})})]})})]})};
775var Close={},createSvgIcon={};const require$$0=getAugmentedNamespace(utils);var hasRequiredCreateSvgIcon;function requireCreateSvgIcon(){return hasRequiredCreateSvgIcon||(hasRequiredCreateSvgIcon=1,function(Ee){"use client";Object.defineProperty(Ee,"__esModule",{value:!0}),Object.defineProperty(Ee,"default",{enumerable:!0,get:function(){return Re.createSvgIcon}});var Re=require$$0}(createSvgIcon)),createSvgIcon}var _interopRequireDefault$3=interopRequireDefaultExports;Object.defineProperty(Close,"__esModule",{value:!0});var default_1$3=Close.default=void 0,_createSvgIcon$3=_interopRequireDefault$3(requireCreateSvgIcon()),_jsxRuntime$3=jsxRuntimeExports;default_1$3=Close.default=(0,_createSvgIcon$3.default)((0,_jsxRuntime$3.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var OndemandVideo={},_interopRequireDefault$2=interopRequireDefaultExports;Object.defineProperty(OndemandVideo,"__esModule",{value:!0});var default_1$2=OndemandVideo.default=void 0,_createSvgIcon$2=_interopRequireDefault$2(requireCreateSvgIcon()),_jsxRuntime$2=jsxRuntimeExports;default_1$2=OndemandVideo.default=(0,_createSvgIcon$2.default)((0,_jsxRuntime$2.jsx)("path",{d:"M21 3H3c-1.11 0-2 .89-2 2v12c0 1.1.89 2 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5c0-1.11-.9-2-2-2m0 14H3V5h18zm-5-6-7 4V7z"}),"OndemandVideo");var PlayArrow={},_interopRequireDefault$1=interopRequireDefaultExports;Object.defineProperty(PlayArrow,"__esModule",{value:!0});var default_1$1=PlayArrow.default=void 0,_createSvgIcon$1=_interopRequireDefault$1(requireCreateSvgIcon()),_jsxRuntime$1=jsxRuntimeExports;default_1$1=PlayArrow.default=(0,_createSvgIcon$1.default)((0,_jsxRuntime$1.jsx)("path",{d:"M8 5v14l11-7z"}),"PlayArrow");var ArrowForward={},_interopRequireDefault=interopRequireDefaultExports;Object.defineProperty(ArrowForward,"__esModule",{value:!0});var default_1=ArrowForward.default=void 0,_createSvgIcon=_interopRequireDefault(requireCreateSvgIcon()),_jsxRuntime=jsxRuntimeExports;default_1=ArrowForward.default=(0,_createSvgIcon.default)((0,_jsxRuntime.jsx)("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");async function listActiveVideoTutorials(){const{data:Ee}=await cachedAxios.get("/video-tutorials");return Ee}async function getVideoTutorialPlaybackUrl(Ee){const{data:Re}=await cachedAxios.get(`/video-tutorials/${Ee}/playback-url`);return Re}function youtubeEmbedFromUrl(Ee){try{const Re=new URL(String(Ee||"").trim()),Te=Re.hostname.replace(/^www\./,"");if(Te==="youtu.be"){const je=Re.pathname.split("/").filter(Boolean)[0];return je?`https://www.youtube.com/embed/${je}`:null}if(Te.endsWith("youtube.com")){const je=Re.searchParams.get("v");if(je)return`https://www.youtube.com/embed/${je}`;const Oe=Re.pathname.split("/").filter(Boolean);if(Oe[0]==="embed"||Oe[0]==="shorts"||Oe[0]==="v")return Oe[1]?`https://www.youtube.com/embed/${Oe[1]}`:null}}catch{return null}return null}const ALL_CATEGORIES="all",VideoTutorialsPopup=({open:Ee,onClose:Re})=>{var Rr;const Te=useTheme$1(),je=useMediaQuery(Te.breakpoints.down("sm")),{darkMode:Oe}=useThemeMode(),[Me,De]=reactExports.useState(!1),[$e,Be]=reactExports.useState(null),[Ue,ze]=reactExports.useState([]),[We,Xe]=reactExports.useState(ALL_CATEGORIES),[He,qe]=reactExports.useState(null),[Ge,Ye]=reactExports.useState(null),[Ve,Ke]=reactExports.useState(!1),[Qe,Ze]=reactExports.useState(null),Je=reactExports.useRef(null),ir=reactExports.useMemo(()=>{const br=new Map;return Ue.forEach(wr=>{(wr==null?void 0:wr.category_id)!=null&&(br.has(wr.category_id)||br.set(wr.category_id,wr.category_name||`Category ${wr.category_id}`))}),Array.from(br.entries()).map(([wr,vr])=>({id:wr,name:vr})).sort((wr,vr)=>String(wr.name).localeCompare(String(vr.name)))},[Ue]),rr=reactExports.useMemo(()=>We===ALL_CATEGORIES?Ue:Ue.filter(br=>String(br.category_id)===String(We)),[Ue,We]),ar=reactExports.useMemo(()=>rr.find(br=>br.id===He)||null,[rr,He]),or=reactExports.useMemo(()=>{if(!ar||ar.source_type!=="youtube")return null;const br=ar.youtube_embed_url||youtubeEmbedFromUrl(ar.youtube_url);return br?`${br}${br.includes("?")?"&":"?"}autoplay=1&rel=0`:null},[ar]),pr=reactExports.useCallback(()=>{Ye(null)},[]),tr=reactExports.useCallback(async()=>{var br;De(!0),Be(null);try{const wr=await listActiveVideoTutorials(),vr=Array.isArray(wr==null?void 0:wr.items)?wr.items:[];ze(vr),Xe(ALL_CATEGORIES),qe(((br=vr[0])==null?void 0:br.id)??null)}catch(wr){ze([]),qe(null),Xe(ALL_CATEGORIES),Be((wr==null?void 0:wr.message)||"Failed to load video tutorials")}finally{De(!1)}},[]);reactExports.useEffect(()=>{if(!Ee){pr(),Ze(null),Ke(!1);return}tr()},[Ee,tr,pr]),reactExports.useEffect(()=>{if(!rr.length){qe(null);return}rr.some(br=>br.id===He)||qe(rr[0].id)},[rr,He]),reactExports.useEffect(()=>{if(!Ee||!ar){pr(),Ze(null),Ke(!1);return}if(ar.source_type!=="file"||!ar.has_file){pr(),Ze(null),Ke(!1);return}let br=!1;return pr(),Ze(null),Ke(!0),(async()=>{try{const wr=await getVideoTutorialPlaybackUrl(ar.id);if(br)return;if(!(wr!=null&&wr.url))throw new Error("Playback URL missing");Ye(wr.url)}catch(wr){br||Ze((wr==null?void 0:wr.message)||"Failed to load video file")}finally{br||Ke(!1)}})(),()=>{br=!0}},[Ee,ar,pr]);const nr=()=>{pr(),Re==null||Re()},hr=()=>{var br,wr;(wr=(br=Je.current)==null?void 0:br.play)==null||wr.call(br)},sr=()=>{if(!rr.length)return;const br=rr.findIndex(vr=>vr.id===He),wr=rr[(br+1)%rr.length];wr&&qe(wr.id)},xr=br=>({height:32,borderRadius:"8px",fontWeight:br?700:500,bgcolor:br?"#002D79":Oe?"rgba(148, 163,
775184, 0.12)":"rgba(15, 23, 42, 0.06)",color:br?"#ffffff":"text.secondary",border:"1px solid",borderColor:br?"#002D79":"transparent","&:hover":{bgcolor:br?"#001D52":Oe?"rgba(148, 163, 184, 0.2)":"rgba(15, 23, 42, 0.1)"}});return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:nr,fullScreen:je,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{height:je?"100%":"min(720px, 90vh)",maxHeight:je?"100%":"90vh",borderRadius:je?0:2,overflow:"hidden"}},children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,py:1.75,px:2.5,borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Box,{sx:{p:1,borderRadius:"8px",bgcolor:Oe?"rgba(91, 127, 196, 0.18)":"rgba(0, 45, 121, 0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx(default_1$2,{sx:{color:Oe?"#93B4F0":"#002D79",fontSize:20}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:700,lineHeight:1.3,color:Oe?"#93B4F0":"#002D79"},children:"Video Tutorials"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Learn OpenParser with short guided videos"})]})]}),jsxRuntimeExports.jsx(IconButton,{onClick:nr,size:"small","aria-label":"Close video tutorials",children:jsxRuntimeExports.jsx(default_1$3,{})})]}),jsxRuntimeExports.jsxs(DialogContent,{sx:{p:0,display:"flex",flexDirection:je?"column":"row",overflow:"hidden",height:"100%"},children:[jsxRuntimeExports.jsxs(Box,{sx:{width:je?"100%":280,flexShrink:0,borderRight:je?"none":"1px solid",borderBottom:je?"1px solid":"none",borderColor:"divider",bgcolor:Oe?"#0F172A":"grey.50",display:"flex",flexDirection:"column",maxHeight:je?240:"100%",minHeight:0},children:[!Me&&!$e&&Ue.length>0&&jsxRuntimeExports.jsxs(Box,{sx:{px:1.5,pt:1.5,pb:1,borderBottom:"1px solid",borderColor:"divider",display:"flex",flexWrap:"wrap",gap:.75,flexShrink:0},children:[jsxRuntimeExports.jsx(Chip,{size:"small",label:"All",clickable:!0,onClick:()=>Xe(ALL_CATEGORIES),sx:xr(We===ALL_CATEGORIES)}),ir.map(br=>jsxRuntimeExports.jsx(Chip,{size:"small",label:br.name,clickable:!0,onClick:()=>Xe(br.id),sx:xr(String(We)===String(br.id))},br.id))]}),jsxRuntimeExports.jsx(Box,{sx:{flex:1,overflow:"auto",minHeight:0},children:Me?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",py:4},children:jsxRuntimeExports.jsx(CircularProgress,{size:28})}):$e?jsxRuntimeExports.jsx(Alert,{severity:"error",sx:{m:1.5},children:$e}):Ue.length?rr.length?jsxRuntimeExports.jsx(List,{disablePadding:!0,children:rr.map(br=>{const wr=br.id===He;return jsxRuntimeExports.jsxs(ListItemButton,{selected:wr,onClick:()=>qe(br.id),sx:{alignItems:"flex-start",gap:1.5,px:2,py:1.25,borderLeft:"3px solid",borderLeftColor:wr?"#F97316":"transparent","&.Mui-selected":{bgcolor:Oe?"rgba(91, 127, 196, 0.16)":"rgba(0, 45, 121, 0.06)"},"&.Mui-selected:hover":{bgcolor:Oe?"rgba(91, 127, 196, 0.22)":"rgba(0, 45, 121, 0.1)"}},children:[jsxRuntimeExports.jsx(Box,{sx:{width:36,height:36,borderRadius:"8px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",mt:.25,bgcolor:wr?"#F97316":Oe?"rgba(148, 163, 184, 0.16)":"rgba(15, 23, 42, 0.08)",boxShadow:wr?"0 0 12px rgba(249, 115, 22, 0.5)":"none"},children:jsxRuntimeExports.jsx(default_1$1,{sx:{fontSize:18,color:wr?"#ffffff"
775:Oe?"#94A3B8":"#9CA3AF"}})}),jsxRuntimeExports.jsx(ListItemText,{primary:br.title,secondary:We===ALL_CATEGORIES&&br.category_name||null,primaryTypographyProps:{fontWeight:wr?700:600,fontSize:14,color:Oe?"#93B4F0":"#002D79"},secondaryTypographyProps:{fontSize:12}})]},br.id)})}):jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{p:2},children:"No tutorials in this category."}):jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{p:2},children:"No active video tutorials yet."})})]}),jsxRuntimeExports.jsx(Box,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"auto",bgcolor:Oe?"#020617":"#fff"},children:ar?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{sx:{position:"relative",overflow:"hidden",minHeight:je?220:360,background:ar.source_type==="file"?"linear-gradient(160deg, #002D79 0%, #001D52 100%)":"#000"},children:[ar.source_type==="file"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{position:"absolute",top:-80,right:-80,width:260,height:260,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.06)",pointerEvents:"none"}}),jsxRuntimeExports.jsx(Box,{sx:{position:"absolute",bottom:-60,left:-60,width:200,height:200,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.05)",pointerEvents:"none"}})]}),ar.source_type==="youtube"&&or&&jsxRuntimeExports.jsx(Box,{sx:{position:"relative",pt:"56.25%"},children:jsxRuntimeExports.jsx(Box,{component:"iframe",src:or,title:ar.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{position:"absolute",inset:0,width:"100%",height:"100%",border:0}},ar.id)}),ar.source_type==="youtube"&&!or&&jsxRuntimeExports.jsx(Alert,{severity:"warning",sx:{m:2},children:"Invalid YouTube URL for this tutorial."}),ar.source_type==="file"&&Ve&&jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:10},children:jsxRuntimeExports.jsx(CircularProgress,{sx:{color:"#fff"}})}),ar.source_type==="file"&&!Ve&&Qe&&jsxRuntimeExports.jsx(Alert,{severity:"error",sx:{m:2},children:Qe}),ar.source_type==="file"&&!Ve&&!Qe&&Ge&&jsxRuntimeExports.jsx(Box,{component:"video",ref:Je,src:Ge,controls:!0,autoPlay:!0,sx:{position:"relative",display:"block",width:"100%",maxHeight:je?280:480,accentColor:"#F97316"}},ar.id)]}),jsxRuntimeExports.jsxs(Box,{sx:{p:2.5,borderTop:"1px solid",borderColor:"divider"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:1,flexWrap:"wrap"},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",fontWeight:700,sx:{color:Oe?"#93B4F0":"#002D79"},children:ar.title}),ar.category_name&&jsxRuntimeExports.jsx(Chip,{size:"small",label:ar.category_name,sx:{height:24,fontWeight:600,fontSize:12,bgcolor:Oe?"rgba(249, 115, 22, 0.18)":"rgba(249, 115, 22, 0.1)",color:"#F97316",border:"1px solid rgba(249, 115, 22, 0.35)"}})]}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-wrap",mb:2},children:((Rr=ar.description)==null?void 0:Rr.trim())||"No description provided."}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:[ar.source_type==="file"&&jsxRuntimeExports.jsx(Button,{variant:"contained",startIcon:jsxRuntimeExports.jsx(default_1$1,{}),onClick:hr,sx:{bgcolor:"#F97316","&:hover":{bgcolor:"#EA580C"}},children:"Resume"}),rr.length>1&&jsxRuntimeExports.jsx(Button,{variant:"outlined",endIcon:jsxRuntimeExports.jsx(default_1,{}),onClick:sr,sx:{color:"#002D79",borderColor:"#002D79","&:hover":{borderColor:"#001D52",bgcolor:"rgba(0,45,121,0.06)"}},children:"Next Video"})]})]})]}):jsxRuntimeExports.jsx(Box,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",p:3},children:jsxRuntimeExports.jsx(Typography,{color:"text.secondary",children:"Select a video to play"})})})]})]})},formatDate=(Ee,Re={})=>{if(!Ee)return"";const je={...{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"},...Re};let Oe=Ee;!Ee.endsWith("Z")&&!Ee.includes("+")&&!Ee.includes("T")?Oe=Ee:Ee.includes("T")&&!Ee.endsWith("Z")&&!Ee.match(/[+-]\d{2}:\d{2}$/)&&(Oe=Ee+"Z");const Me=new Date(Oe);
775return isNaN(Me.getTime())?"":Me.toLocaleString("en-US",je)},formatTime=(Ee,Re={})=>{if(!Ee)return"";const je={...{hour:"2-digit",minute:"2-digit"},...Re};let Oe=Ee;!Ee.endsWith("Z")&&!Ee.includes("+")&&!Ee.includes("T")?Oe=Ee:Ee.includes("T")&&!Ee.endsWith("Z")&&!Ee.match(/[+-]\d{2}:\d{2}$/)&&(Oe=Ee+"Z");const Me=new Date(Oe);return isNaN(Me.getTime())?"":Me.toLocaleTimeString("en-US",je)},TopBar=()=>{const Ee=useNavigate(),Re=useDispatch(),{user:Te}=useSelector(Tr=>Tr.auth),je=useSelector(Tr=>Tr.auth.photoError),{subscription:Oe}=useSelector(Tr=>Tr.subscription),[Me,De]=reactExports.useState(!1),[$e,Be]=reactExports.useState(!1),[Ue,ze]=reactExports.useState(!1),[We,Xe]=reactExports.useState(!1),[He,qe]=reactExports.useState([]),[Ge,Ye]=reactExports.useState(!1),[Ve,Ke]=reactExports.useState(null),[Qe,Ze]=reactExports.useState(0),Je=reactExports.useRef(null),ir=reactExports.useRef(null),rr=reactExports.useRef(null),{darkMode:ar}=useThemeMode(),{startTour:or,resetTour:pr}=useTour();reactExports.useEffect(()=>{!(Te!=null&&Te.photo_url)&&!je&&Re(getUserPhoto());let Tr=()=>{};return(async()=>{try{const Br=await notificationService.getUnreadCount();Ze(Br)}catch{}Tr=notificationService.subscribeUnreadCount(Br=>{Ze(Br)})})(),()=>{Tr&&Tr()}},[Re,Te==null?void 0:Te.photo_url,je]),reactExports.useEffect(()=>{if(!$e)return;let Tr=!1;return(async()=>{if(He.length>0){Ye(!1);return}Ye(!0);try{const Br=await notificationService.listNotifications({limit:50,skipCache:!0});Tr||qe(Br)}catch{Tr||qe([])}finally{Tr||Ye(!1)}})(),()=>{Tr=!0}},[$e,Qe]);const tr=reactExports.useRef(0);reactExports.useEffect(()=>{Qe>tr.current&¬ificationService.listNotifications({limit:50,skipCache:!0}).then(Tr=>{qe(Tr)}).catch(()=>{console.log("Failed to fetch notifications list on unread count increase.")}),tr.current=Qe},[Qe]);const nr=reactExports.useRef(!1);reactExports.useEffect(()=>{nr.current&&!$e&&Qe>0&¬ificationService.markNotificationsRead({all:!0}).then(()=>{qe(Nr=>Nr.map(Br=>({...Br,is_read:!0}))),Ze(0)}).catch(()=>{}),nr.current=$e},[$e,Qe]),reactExports.useEffect(()=>{const Tr=Nr=>{Je.current&&!Je.current.contains(Nr.target)&&Be(!1)};return document.addEventListener("mousedown",Tr),()=>document.removeEventListener("mousedown",Tr)},[]),reactExports.useEffect(()=>{const Tr=Nr=>{ir.current&&!ir.current.contains(Nr.target)&&De(!1)};return document.addEventListener("mousedown",Tr),()=>document.removeEventListener("mousedown",Tr)},[]),reactExports.useEffect(()=>{const Tr=Nr=>{rr.current&&!rr.current.contains(Nr.target)&&ze(!1)};return document.addEventListener("mousedown",Tr),()=>document.removeEventListener("mousedown",Tr)},[]);const hr=(Tr,Nr)=>{(Tr.key==="Enter"||Tr.key===" ")&&(Tr.preventDefault(),Nr())},sr=async()=>{De(!1);try{await Re(logout()).unwrap(),Ee("/login",{replace:!0,state:{message:"Logged out successfully"}})}catch{Ee("/login",{replace:!0,state:{message:"Logged out successfully"}})}},xr=Tr=>{Ee(Tr),De(!1)},Rr=()=>{De(!1),xr("/profile")},br=()=>{ze(!1),De(!1),Be(!1),or()},wr=()=>{ze(!1),De(!1),Be(!1),Xe(!0)},vr=async(Tr,Nr)=>{if(Nr.stopPropagation(),Ve!==Tr)try{Ke(Tr),await notificationService.deleteNotification(Tr);const Br=await notificationService.listNotifications({limit:50,skipCache:!0});qe(Br);const Hr=await notificationService.getUnreadCount();Ze(Hr)}catch(Br){console.error("Failed to delete notification:",Br)}finally{Ke(null)}},Dr=async Tr=>{if(Tr.stopPropagation(),Qe!==0)try{await notificationService.markNotificationsRead({all:!0}),qe(Nr=>Nr.map(Br=>({...Br,is_read:!0}))),Ze(0)}catch(Nr){console.error("Failed to mark all notifications as read:",Nr)}},kr=Tr=>{const Nr=`${Tr.event_type||""} ${Tr.title||""}`.toLowerCase();return Nr.includes("delete")?"muted":Nr.includes("maintenance")?"warning":Nr.includes("reject")||Nr.includes("fail")||Nr.includes("error")?"error":"navy"},cr=()=>Te!=null&&Te.first_name&&(Te!=null&&Te.last_name)?Te.first_name.charAt(0).toUpperCase()+Te.last_name.charAt(0).toUpperCase():Te!=null&&Te.first_name?Te.first_name.charAt(0).toUpperCase():Te!=null&&Te.email?Te.email.split("@")[0].substring(0,2).toUpperCase():"U",dr=()=>Te!=null&&Te.first_name&&(Te!=null&&Te.last_name)?`${Te.first_name} ${Te.last_name}`:Te!=null&&Te.email?Te.email.split("@")[0]:"User",ur=()=>{var Br;const Tr=(Te==null?void 0:Te.role)??(Te==null?void 0:Te.RoleID)??((Br=Te==null?void 0:Te.department)==null?void 0:Br.id),Nr=!!(Te!=null&&Te.is_l1_admin);return Tr===ROLES.TENANT_ADMIN&&!Nr&&!isSuperGroupAdminFlag(Te)},gr=()=>{var Nr;return((Te==null?void 0:Te.role)??(Te==null?void 0:Te.RoleID)??((Nr=Te==null?void 0:Te.department)==null?void 0:Nr.id))===ROLES.VIEW_ONLY},_r=()=>{var Tr;return!!((Tr=Oe==null?void 0:Oe.current_subscription)!=null&&Tr.is_private)},Ir=()=>{var Tr,Nr,Br;try{if(!Te||!ROLES||((Te==null?void 0:Te.role)??(Te==null?void 0:Te.RoleID)??((Tr=Te==null?void 0:Te.department)==null?void 0:Tr.id))!==ROLES.TENANT_ADMIN||isSuperGroupAdminFlag(Te)||!(Oe!=null&&Oe.current_subscription))return!1;const Vr=Oe.current_subscription,mr=Vr.billing_interval==="trial",Sr=((Nr=Vr.plan)==null?void 0:Nr.toUpperCase())==="FREE"||((Br=Vr.original_plan)==null?void 0:Br.toUpperCase())==="FREE";if(!mr||!Sr)return!1;const Lr=Vr.trial;if(!Lr)return!1;let jr;const fr=new Date;if(Lr.end_at){if(jr=new Date(Lr.end_at),isNaN(jr.getTime()))return!1}else if(Lr.start_at){const Mr=new Date(Lr.start_at);
775if(isNaN(Mr.getTime()))return!1;const $r=Lr.days||15;jr=new Date(Mr),jr.setDate(jr.getDate()+$r)}else if(Vr.created_at){const Mr=new Date(Vr.created_at);if(isNaN(Mr.getTime()))return!1;jr=new Date(Mr),jr.setDate(jr.getDate()+15)}else return!1;const Cr=Math.ceil((jr-fr)/(1e3*60*60*24));return isNaN(Cr)?!1:Cr<=2}catch(Hr){return console.error("Error checking trial warning:",Hr),!1}},Ar=()=>{try{if(!(Oe!=null&&Oe.current_subscription))return 0;const Tr=Oe.current_subscription,Nr=Tr.trial;if(!Nr)return 0;let Br;const Hr=new Date;if(Nr.end_at){if(Br=new Date(Nr.end_at),isNaN(Br.getTime()))return 0}else if(Nr.start_at){const mr=new Date(Nr.start_at);if(isNaN(mr.getTime()))return 0;const Sr=Nr.days||15;Br=new Date(mr),Br.setDate(Br.getDate()+Sr)}else if(Tr.created_at){const mr=new Date(Tr.created_at);if(isNaN(mr.getTime()))return 0;Br=new Date(mr),Br.setDate(Br.getDate()+15)}else return 0;const Vr=Math.ceil((Br-Hr)/(1e3*60*60*24));return isNaN(Vr)?0:Vr}catch(Tr){return console.error("Error calculating trial days:",Tr),0}};return jsxRuntimeExports.jsxs("header",{className:`top-bar ${ar?"dark":""}`,children:[jsxRuntimeExports.jsxs("div",{className:"topbar-brand",tabIndex:0,children:[jsxRuntimeExports.jsxs("div",{className:"topbar-logo-mark",children:[jsxRuntimeExports.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 40 40",fill:"none",children:[jsxRuntimeExports.jsx("ellipse",{cx:"20",cy:"20",rx:"17",ry:"7",stroke:"#002D79",strokeWidth:"2"}),jsxRuntimeExports.jsx("ellipse",{cx:"20",cy:"20",rx:"17",ry:"7",stroke:"#002D79",strokeWidth:"2",transform:"rotate(60 20 20)"}),jsxRuntimeExports.jsx("ellipse",{cx:"20",cy:"20",rx:"17",ry:"7",stroke:"#002D79",strokeWidth:"2",transform:"rotate(120 20 20)"}),jsxRuntimeExports.jsx("polygon",{points:"29,20 24.5,12.21 15.5,12.21 11,20 15.5,27.79 24.5,27.79",fill:"white",stroke:"#F97316",strokeWidth:"1.8"}),jsxRuntimeExports.jsx("polygon",{points:"25.5,20 22.75,15.24 17.25,15.24 14.5,20 17.25,24.76 22.75,24.76",fill:"white",stroke:"#002D79",strokeWidth:"1.6"})]}),jsxRuntimeExports.jsxs("span",{className:"topbar-logo-word",children:[jsxRuntimeExports.jsx("span",{style:{color:"#F97316"},children:"Open"}),jsxRuntimeExports.jsx("span",{style:{color:"#002D79"},children:"Parser"})]}),jsxRuntimeExports.jsx("span",{className:"topbar-logo-divider"}),jsxRuntimeExports.jsx("span",{className:"topbar-logo-ai",children:"AI"})]}),jsxRuntimeExports.jsx("div",{className:"topbar-text"})]}),jsxRuntimeExports.jsxs("div",{className:"topbar-actions",children:[Ir()&&jsxRuntimeExports.jsxs("div",{className:"topbar-trial-warning",children:[jsxRuntimeExports.jsxs("svg",{className:"topbar-trial-icon",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1Z",fill:"#DC2626",stroke:"#DC2626",strokeWidth:"1.2"}),jsxRuntimeExports.jsx("path",{d:"M8 4.5V8.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round"}),jsxRuntimeExports.jsx("circle",{cx:"8",cy:"11",r:"0.75",fill:"white"})]}),jsxRuntimeExports.jsx("span",{className:"topbar-trial-text",children:Ar()<=0?"Trial expired":`Trial expires in ${Ar()} day${Ar()!==1?"s":""}`}),jsxRuntimeExports.jsx("button",{className:"topbar-trial-btn",onClick:()=>Ee("/subscription"),children:"Upgrade"})]}),!(Te!=null&&Te.is_l1_admin)&&jsxRuntimeExports.jsxs("div",{className:"topbar-tour-wrap",ref:rr,children:[jsxRuntimeExports.jsx("button",{type:"button",className:"topbar-support-btn","aria-label":"OpenParser Tour",title:"OpenParser Tour","aria-haspopup":"menu","aria-expanded":Ue,onClick:()=>{De(!1),Be(!1),ze(Tr=>!Tr)},children:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"6",cy:"5",r:"2.25"}),jsxRuntimeExports.jsx("path",{d:"M4.25 9.25h3.5v5.25h-3.5z"}),jsxRuntimeExports.jsx("path",{d:"M4.75 14.5v5M7.25 14.5v5"}),jsxRuntimeExports.jsx("path",{d:"M7.75 11h4"}),jsxRuntimeExports.jsx("rect",{x:"12",y:"4",width:"8.5",height:"12.5",rx:"1.25"}),jsxRuntimeExports.jsx("path",{d:"M14 7.25h4.5"}),jsxRuntimeExports.jsx("path",{d:"M14 10h4.5"}),jsxRuntimeExports.jsx("path",{d:"M14 12.75h4.5"}),jsxRuntimeExports.jsx("path",{d:"M13.85 9.55l0.85 0.85 1.45-1.7"}),jsxRuntimeExports.jsx("path",{d:"M14 14.35l1.5 1.5M15.5 14.35l-1.5 1.5"}),jsxRuntimeExports.jsx("path",{d:"M3 20.75h18"})]})}),Ue&&jsxRuntimeExports.jsxs("div",{className:"topbar-dropdown topbar-tour-dropdown",role:"menu",children:[jsxRuntimeExports.jsx("button",{type:"button",className:"topbar-dropdown-item",role:"menuitem",onClick:br,children:"Tour"}),jsxRuntimeExports.jsx("button",{type:"button",className:"topbar-dropdown-item",role:"menuitem",onClick:wr,children:"Video Tutorials"})]})]}),jsxRuntimeExports.jsx("button",{type:"button",className:"topbar-support-btn","aria-label":"Support",title:"Support",onClick:()=>Ee(SUPPORT_URL||"/submit-ticket"),children:jsxRuntimeExports.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M3 18v-6a9 9 0 0 1 18 0v6"}),jsxRuntimeExports.jsx("path",{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3z"}),jsxRuntimeExports.jsx("path",{d:"M3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"})]})}),jsxRuntimeExports.jsx(DarkModeToggle,{}),jsxRuntimeExports.jsxs("div",{className:"topbar-notification-wrap",ref:Je,children:[jsxRuntimeExports.jsxs("button",{type:"button",className:"topbar-bell",onClick:()=>{De(!1),Be(Tr=>!Tr)},onKeyDown:Tr=>hr(Tr,()=>Be(Nr=>!Nr)),"aria-label":"Notifications",title:"Notifications",children:[jsxRuntimeExports.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),jsxRuntimeExports.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),Qe>0&&jsxRuntimeExports.jsx("span",{className:"topbar-bell-badge",children:Qe>99?"99+":Qe})]}),$e&&jsxRuntimeExports.jsxs("div",{className:"topbar-notifications-dropdown",children:[jsxRuntimeExports.jsxs("div",{className:"topbar-notifications-header",children:[jsxRuntimeExports.jsx("div",{className:"topbar-notifications-header-icon",children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),jsxRuntimeExports.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})}),jsxRuntimeExports.jsxs("div",{className:"topbar-notifications-title-row",children:[jsxRuntimeExports.jsx("span",{className:"topbar-notifications-title",children:"Notifications"}),Qe>0&&jsxRuntimeExports.jsxs("span",{className:"topbar-notifications-badge",children:[Qe," new"]})]}),Qe>0&&jsxRuntimeExports.jsx("button",{type:"button",className:"topbar-notifications-markall",onClick:Dr,children:"Mark all read"})]}),Ge?jsxRuntimeExports.jsx("div",{className:"topbar-notifications-loading",children:"Loading..."}):He.length===0?jsxRuntimeExports.jsx("div",{className:"topbar-notifications-empty",children:"No notifications"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("ul",{className:"topbar-notifications-list",children:He.map(Tr=>jsxRuntimeExports.jsxs("li",{className:`topbar-notification-item ${Tr.is_read?"topbar-notification-read":"topbar-notification-unread"}`,children:[jsxRuntimeExports.jsx("div",{className:`topbar-notification-icon topbar-notification-icon-${kr(Tr)}`,children:jsxRuntimeExports.jsx("span",{className:"topbar-notification-dot"})}),jsxRuntimeExports.jsxs("div",{className:"topbar-notification-content",children:[jsxRuntimeExports.jsx("div",{className:"topbar-notification-subject",children:Tr.title||Tr.event_type||"Notification"}),jsxRuntimeExports.jsx("div",{className:"topbar-notification-message",children:Tr.message}),Tr.created_at&&jsxRuntimeExports.jsx("div",{className:"topbar-notification-time",children:formatDate(Tr.created_at)})]}),jsxRuntimeExports.jsx("button",{className:`topbar-notification-delete ${Ve===Tr.id?"loading":""}`,onClick:Nr=>vr(Tr.id,Nr),disabled:Ve===Tr.id,"aria-label":"Delete notification",title:"Delete",children:Ve===Tr.id?jsxRuntimeExports.jsxs("svg",{className:"topbar-notification-spinner",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"10",opacity:"0.25"}),jsxRuntimeExports.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",opacity:"0.75"})]}):jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"3 6 5 6 21 6"}),jsxRuntimeExports.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),jsxRuntimeExports.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),jsxRuntimeExports.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})})]},Tr.id))}),jsxRuntimeExports.jsx("button",{type:"button",className:"topbar-notifications-viewall",onClick:()=>Be(!1),children:"View all notifications"})]})]})]}),jsxRuntimeExports.jsxs("div",{className:"topbar-user-wrapper",ref:ir,children:[jsxRuntimeExports.jsxs("div",{className:"topbar-user",onClick:()=>{Be(!1),De(!Me)},onKeyDown:Tr=>hr(Tr,()=>De(!Me)),role:"button",tabIndex:0,children:[Te!=null&&Te.photo_url?jsxRuntimeExports.jsx("img",{src:Te==null?void 0:Te.photo_url,alt:"Profile",className:"topbar-avatar-image"}):jsxRuntimeExports.jsx("div",{className:"topbar-avatar",children:cr()}),jsxRuntimeExports.jsxs("div",{className:"topbar-userinfo",children:[jsxRuntimeExports.jsx("div",{className:"topbar-name",children:dr()}),jsxRuntimeExports.jsx("div",{className:"topbar-email",children:Te==null?void 0:Te.email})]}),jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`topbar-dropdown-arrow ${Me?"open":""}`,children:jsxRuntimeExports.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),Me&&jsxRuntimeExports.jsxs("div",{className:"topbar-dropdown",children:[jsxRuntimeExports.jsxs("button",{className:"topbar-dropdown-item",onClick:Rr,children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),jsxRuntimeExports.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),"Profile"]}),ur()&&!gr()&&!_r()&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("button",{className:"topbar-dropdown-item",onClick:()=>xr("/subscription"),children:"ð³ Subscription"})}),jsxRuntimeExports.jsx(TenantSwitcher,{onClose:()=>De(!1)}),jsxRuntimeExports.jsx("hr",{className:"topbar-divider"}),jsxRuntimeExports.jsxs("button",{className:"topbar-dropdown-item danger",onClick:sr,children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),jsxRuntimeExports.jsx("polyline",{points:"16 17 21 12 16 7"}),jsxRuntimeExports.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),"Logout"]})]})]})]}),jsxRuntimeExports.jsx(VideoTutorialsPopup,{open:We,onClose:()=>Xe(!1)})]})},BillingSuccessHandler=({cancelled:Ee=!1})=>{const Re=useLocation(),Te=useSelector(selectPurchaseSourcePage);console.log("Cancelled:",Ee);const je=Te||"/subscription",Oe=new URLSearchParams(Re.search);Oe.set("payment",Ee?"cancelled":"success");const Me=`${je}?${Oe.toString()}`;return jsxRuntimeExports.jsx(Navigate,{to:Me,replace:!0})},SSOTokenHandler=({children:Ee})=>{const Re=useNavigate(),Te=useLocation(),je=useDispatch(),[Oe,Me]=reactExports.useState(!1);return reactExports.useEffect(()=>{const De=new URLSearchParams(Te.search),$e=De.get("token"),Be=De.get("error");
775if(De.get("tenant_selection_required")==="1"&&De.get("select_token")){Re(`/login?${De.toString()}`,{replace:!0});return}if(Be){console.error("â [SSOTokenHandler] SSO Error detected:",Be),Re("/login?error="+encodeURIComponent(Be),{replace:!0});return}if(!$e){console.log("â¹ï¸ [SSOTokenHandler] No token found, rendering children normally");return}(async()=>{var ze,We,Xe,He;Me(!0);try{localStorage.setItem("doculens_auth_token",$e);const qe=await je(getCurrentUser());if(!(qe!=null&&qe.payload))throw new Error("Failed to fetch user data");if(((We=(ze=qe==null?void 0:qe.payload)==null?void 0:ze.tc_status)==null?void 0:We.accepted)===!1){Re("/terms-acceptance",{replace:!0});return}const Ge=(Xe=qe==null?void 0:qe.payload)==null?void 0:Xe.user,Ve=((Ge==null?void 0:Ge.role)??(Ge==null?void 0:Ge.RoleID)??((He=Ge==null?void 0:Ge.department)==null?void 0:He.id))===ROLES.TENANT_ADMIN;let Ke=null;if(Ve)try{Ke=(await je(fetchSubscription(!0))).payload}catch(Ze){console.warn("â ï¸ [SSOTokenHandler] Could not fetch subscription:",Ze)}const Qe=getLoginRedirectPath(Ge,Ke);Re(Qe,{replace:!0,state:{message:"Logged in successfully",severity:"success"}})}catch(qe){console.error("â [SSOTokenHandler] Error details:",qe.message,qe.stack),localStorage.removeItem("doculens_auth_token"),Me(!1),Re("/login?error=SSO authentication failed",{replace:!0})}})()},[Te.search,je,Re]),Oe?jsxRuntimeExports.jsx(Box,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"linear-gradient(135deg, #fef9e7 0%, #fef5d9 100%)"},children:jsxRuntimeExports.jsx(Container,{maxWidth:"sm",children:jsxRuntimeExports.jsxs(Box,{sx:{textAlign:"center"},children:[jsxRuntimeExports.jsx(Loader,{size:60}),jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{mt:3},children:"Completing sign in..."}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mt:1,opacity:.8},children:"Please wait while we authenticate your account"})]})})}):(console.log("â
[SSOTokenHandler] Rendering children (no token processing needed)"),Ee)},AGENT_APPS_TOUR_STEPS=[{id:"agent-apps-navigation",title:"Explore Agent Apps",description:'Agent Apps are focused AI workflows for extraction, document review, investigations, and more. Click "Agent Apps" in the sidebar.',targetSelector:'[data-tour="agent-apps-nav"]',route:null,position:"right",showArrow:!0},{id:"agent-apps-overview",title:"Browse Published Agents",description:"Each card is a published agent workflow. Open an app to launch its dedicated chat panel, attach documents, and run structured tasks.",targetSelector:'[data-tour="agent-apps-grid"]',route:"/agent-apps",position:"center",showArrow:!1,autoNavigate:!0},{id:"agent-apps-manage",title:"Find & Manage Agents",description:"Search agents by name, then open a card to start a workflow. Tenant admins can enable, disable, or remove agents from the card menu.",targetSelector:'[data-tour="agent-apps-search"]',route:"/agent-apps",position:"bottom",showArrow:!0}],CONNECTORS_TOUR_STEPS=[{id:"connectors-navigation",title:"Manage Connectors",description:'Connect external document sources and data systems to OpenParser. Click "Connectors" in the sidebar.',targetSelector:'[data-tour="connectors-nav"]',route:null,position:"right",showArrow:!0},{id:"connectors-list",title:"Connector Access & Scope",description:"Review which connectors are granted and active. The Scope column shows whether configuration is tenant-wide, group-based, or per-user.",targetSelector:'[data-tour="connectors-list"]',route:"/admin/connectors",position:"center",showArrow:!1,autoNavigate:!0},{id:"connectors-configure",title:"Configure Connectors",description:'Click "Configure" to open setup for authentication, folders, and group assignment. Bulk connectors also use modals for Start, Sync, and job status.',targetSelector:'[data-tour="connectors-configure"]',route:"/admin/connectors",position:"left",showArrow:!0}],CHAT_SETTINGS_TOUR_STEPS=[{id:"chat-settings-navigation",title:"Open Chat Settings",description:'Set organization-wide AI defaults and control what users can change in chat. Click "Chat Settings" in the sidebar.',targetSelector:'[data-tour="chat-settings-nav"]',route:null,position:"right",showArrow:!0},{id:"chat-settings-overview",title:"Organization Chat Defaults",description:"Configure strict mode, response presets, document scope, content preferences, and fallback messages for all users in your tenant.",targetSelector:'[data-tour="chat-settings-overview"]',route:"/admin/chat-settings",position:"center",showArrow:!1,autoNavigate:!0},{id:"chat-settings-enforcement",title:"Role-Based Controls",description:'Use "Lock" options to enforce settings by role so users cannot override them. Use "Show in chat" to hide sections that should stay admin-only.',targetSelector:'[data-tour="chat-settings-enforcement"]',route:"/admin/chat-settings",position:"bottom",showArrow:!0}],ADMIN_TOUR_STEPS=[{id:"welcome",title:"Welcome to OpenParser AI! ð",description:"Let's get you started with a quick tour. We'll show you how to organize your documents and get the most out of our AI assistant.",targetSelector:null,route:null,position:"center",showArrow:!1}
775,{id:"groups-navigation",title:"Navigate to Groups",description:'First, you need to create a group. Groups help you organize documents by projects, teams, or categories. Click on "Groups" in the sidebar.',targetSelector:'[data-tour="groups-nav"]',route:null,position:"right",showArrow:!0},{id:"create-group",title:"Create Your First Group",description:'Click the "Create Group" button to create your first group. You can add documents and team members to groups.',targetSelector:'[data-tour="create-group-btn"]',route:"/groups",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"documents-navigation",title:"Go to Documents",description:`Now let's navigate to Documents to upload your files. Click "Documents" in the sidebar.`,targetSelector:'[data-tour="documents-nav"]',route:null,position:"right",showArrow:!0},{id:"quick-upload",title:"Quick Upload Documents",description:"Use the Quick Upload card to drag & drop or click to upload your documents.",targetSelector:'[data-tour="quick-upload"]',route:"/documents/repository",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"chat-navigation",title:"Start Chatting! ð¬",description:'Once you have documents uploaded, navigate to Chat to ask questions. Click "Chat" in the sidebar.',targetSelector:'[data-tour="chat-nav"]',route:null,position:"right",showArrow:!0},{id:"new-chat",title:"Create New Chat",description:'Click "New Chat" to start a new conversation. Each chat session keeps your conversation history.',targetSelector:'[data-tour="new-chat-btn"]',route:"/chat",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"custom-instructions",title:"Customize AI Responses",description:"Click the response styles icon to customize how the AI responds - set response style, citation format, and more!",targetSelector:'[data-tour="custom-instructions"]',route:"/chat",position:"bottom",showArrow:!0},{id:"chat-input",title:"Ask Questions",description:"Type your questions here! The AI will search through your documents and provide accurate answers.",targetSelector:'[data-tour="chat-input"]',route:"/chat",position:"top",showArrow:!0},...AGENT_APPS_TOUR_STEPS,...CONNECTORS_TOUR_STEPS,...CHAT_SETTINGS_TOUR_STEPS,{id:"users-navigation",title:"Manage Users",description:"Navigate to Users to invite team members and manage access permissions.",targetSelector:'[data-tour="users-nav"]',route:null,position:"right",showArrow:!0}
775,{id:"add-user",title:"Invite Users",description:'Click "Add User" to invite team members. You can assign them to specific groups and set their permissions.',targetSelector:'[data-tour="add-user-btn"]',route:"/admin/users",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"edit-user",title:"Edit User Actions",description:"Click the three-dot menu icon in any user row below to edit permissions, change roles, or manage group assignments.",targetSelector:'[data-tour="edit-user-action"]',route:"/admin/users",position:"left",showArrow:!0},{id:"pending-requests",title:"Pending Requests",description:'Click the "Pending Requests" tab to review the users to whom invitations have been sent.',targetSelector:'[data-tour="pending-requests-tab"]',route:"/admin/users",position:"right",showArrow:!0},{id:"analytics-navigation",title:"View Analytics",description:'Navigate to Analytics to view insights about document usage, user activity, and system performance. Click "Analytics" in the sidebar.',targetSelector:'[data-tour="analytics-nav"]',route:null,position:"right",showArrow:!0},{id:"audit-logs-navigation",title:"Review Audit Logs",description:'Navigate to Audit Logs to track all system activities, user actions, and document changes for compliance and security. Click "Audit Logs" in the sidebar.',targetSelector:'[data-tour="audit-logs-nav"]',route:null,position:"right",showArrow:!0},{id:"complete",title:"You're All Set! ð",description:"Great job! You now know how to create groups, upload documents, chat with AI, use Agent Apps, manage connectors, configure chat settings, and manage users. Start exploring OpenParser AI!",targetSelector:null,route:null,position:"center",showArrow:!1}],USER_TOUR_STEPS=[{id:"welcome",title:"Welcome to OpenParser AI! ð",description:"Let's take a quick tour! We'll show you how to upload documents, ask questions, save favorites, and explore your groups.",targetSelector:null,route:null,position:"center",showArrow:!1},{id:"documents-navigation",title:"Navigate to Documents",description:`First, let's go to Documents where you can upload your files. Click "Documents" in the sidebar.`,targetSelector:'[data-tour="documents-nav"]',route:null,position:"right",showArrow:!0},{id:"quick-upload",title:"Upload Your Documents",description:"Use the Quick Upload card to drag & drop or click to upload your documents. Your team admin will approve them!",targetSelector:'[data-tour="quick-upload"]',route:"/documents/repository",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"document-status",title:"Check Document Status",description:"After uploading, your documents will show a status (Pending, Approved, or Rejected). Once approved by your admin and document is processed successfully, you can use them in chat!",targetSelector:'[data-tour="document-status"]',route:"/documents/repository",position:"center",showArrow:!1},{id:"chat-navigation",title:"Start Chatting! ð¬",description:'Once your documents are approved, navigate to Chat to ask questions. Click "Chat" in the sidebar.',targetSelector:'[data-tour="chat-nav"]',route:null,position:"right",showArrow:!0},{id:"new-chat",title:"Create New Chat",description:'Click "New Chat" to start a new conversation. Each chat session keeps your conversation history.',targetSelector:'[data-tour="new-chat-btn"]',route:"/chat",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"chat-input",title:"Ask Questions",description:"Type your questions here! The AI will search through your approved documents and provide accurate answers.",targetSelector:'[data-tour="chat-input"]',route:"/chat",position:"top",showArrow:!0},...AGENT_APPS_TOUR_STEPS,{id:"favorites-navigation",title:"Explore Favorites",description:'Navigate to Favorites to save and reuse your frequently asked questions. Click "Favorites" in the sidebar.',targetSelector:'[data-tour="favorites-nav"]',route:null,position:"right",showArrow:!0},{id:"favorites-screen",title:"Add Favorite Prompts",description:'Click the "Add Favorite" button to save your commonly used questions for quick access. You can organize them into folders and reuse them in any chat!',targetSelector:'[data-tour="add-favorite-btn"]',route:"/favorites",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"groups-navigation",title:"View Your Groups",description:`Navigate to Groups to see which teams or projects you're part of. Click "Groups" in the sidebar.`,targetSelector:'[data-tour="groups-nav"]',route:null,position:"right",showArrow:!0},{id:"groups-screen",title:"Your Group Memberships",description:"Here you can see all groups you're a member of. Each group has its own set of documents and team members.",targetSelector:'[data-tour="create-group-btn"]',route:"/groups",position:"center",showArrow:!1,autoNavigate:!0},{id:"complete",title:"You're All Set! ð",description:"Great job! You now know how to upload documents, chat with AI, use Agent Apps, save favorites, and view your groups. Start exploring OpenParser AI!",targetSelector:null,route:null,position:"center",showArrow:!1}
775],GROUP_ADMIN_TOUR_STEPS=[{id:"welcome",title:"Welcome to OpenParser AI! ð",description:"Let's take a quick tour! As a Group Admin, you can upload documents, approve documents, manage group members, and chat with AI.",targetSelector:null,route:null,position:"center",showArrow:!1},{id:"documents-navigation",title:"Navigate to Documents",description:`Let's start by going to Documents where you can upload and approve files. Click "Documents" in the sidebar.`,targetSelector:'[data-tour="documents-nav"]',route:null,position:"right",showArrow:!0},{id:"quick-upload",title:"Upload Documents",description:"Use the Quick Upload card to drag & drop or click to upload documents to your groups.",targetSelector:'[data-tour="quick-upload"]',route:"/documents/repository",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"approve-documents",title:"Approve or Reject Documents",description:"As a Group Admin, you can approve or reject documents uploaded by members. Look for the green checkmark (â) to approve or red X (â) icons in the Actions column below for each document.",targetSelector:'[data-tour="actions-column"]',route:"/documents/repository",position:"bottom",showArrow:!0},{id:"chat-navigation",title:"Start Chatting! ð¬",description:'Navigate to Chat to ask questions about your approved documents. Click "Chat" in the sidebar.',targetSelector:'[data-tour="chat-nav"]',route:null,position:"right",showArrow:!0},{id:"new-chat",title:"Create New Chat",description:'Click "New Chat" to start a new conversation. Each chat session keeps your conversation history.',targetSelector:'[data-tour="new-chat-btn"]',route:"/chat",position:"bottom",showArrow:!0,autoNavigate:!0},{id:"chat-input",title:"Ask Questions",description:"Type your questions here! The AI will search through your approved documents and provide accurate answers.",targetSelector:'[data-tour="chat-input"]',route:"/chat",position:"top",showArrow:!0},...AGENT_APPS_TOUR_STEPS,{id:"groups-navigation",title:"Manage Your Groups",description:'Navigate to Groups to manage members in groups you administer. Click "Groups" in the sidebar.',targetSelector:'[data-tour="groups-nav"]',route:null,position:"right",showArrow:!0},{id:"view-members",title:"View Group Members",description:'Click the three-dot menu icon on any group row, then select "View Members" to see and manage members in your groups.',targetSelector:'[data-tour="view-members-action"]',route:"/groups",position:"left",showArrow:!0,autoNavigate:!0},...CONNECTORS_TOUR_STEPS,{id:"users-navigation",title:"Manage User Permissions",description:"Navigate to Users to edit user permissions and assign them to groups you administer.",targetSelector:'[data-tour="users-nav"]',route:null,position:"right",showArrow:!0},{id:"edit-user",title:"Edit User Actions",description:"Click the three-dot menu icon in any user row below to edit permissions and assign users to groups you manage.",targetSelector:'[data-tour="edit-user-action"]',route:"/admin/users",position:"left",showArrow:!0,autoNavigate:!0},{id:"analytics-navigation",title:"View Analytics",description:'Navigate to Analytics to view insights about document usage, user activity in your groups, and system performance. Click "Analytics" in the sidebar.',targetSelector:'[data-tour="analytics-nav"]',route:null,position:"right",showArrow:!0},{id:"audit-logs-navigation",title:"Review Audit Logs",description:'Navigate to Audit Logs to track activities and changes within your groups for compliance and security. Click "Audit Logs" in the sidebar.',targetSelector:'[data-tour="audit-logs-nav"]',route:null,position:"right",showArrow:!0},{id:"complete",title:"You're All Set! ð",description:"Great job! You now know how to upload documents, approve submissions, use Agent Apps, manage connectors, manage group members, and chat with AI. Start exploring OpenParser AI!",targetSelector:null,route:null,position:"center",showArrow:!1}],renderTourTitle=Ee=>String(Ee||"").split(/(\bAI\b)/g).map((Te,je)=>Te==="AI"?jsxRuntimeExports.jsx(Box,{component:"span",sx:{color:"#F97316"},children:Te},je):jsxRuntimeExports.jsx(React$3.Fragment,{children:Te},je)),OnboardingTour=()=>{const{isTourActive:Ee,currentStep:Re,nextStep:Te,previousStep:je,skipTour:Oe,completeTour:Me,closeTour:De}=useTour(),$e=useNavigate(),Be=useLocation(),[Ue,ze]=reactExports.useState(null),[We,Xe]=reactExports.useState({top:0,left:0}),He=useSelector(pr=>pr.auth.user);if(He!=null&&He.is_l1_admin)return null;const qe=(He==null?void 0:He.role)===ROLES.TENANT_ADMIN?ADMIN_TOUR_STEPS:(He==null?void 0:He.role)===ROLES.GROUP_ADMIN?GROUP_ADMIN_TOUR_STEPS:USER_TOUR_STEPS,Ge=qe[Re],Ye=(Re+1)/qe.length*100,Ve=Re===qe.length-1,Ke=Re===0,Qe=reactExports.useCallback(()=>
775{if(!(Ge!=null&&Ge.targetSelector)){ze(null);return}const pr=document.querySelector(Ge.targetSelector);if(pr){ze(pr);const tr=pr.getBoundingClientRect(),nr=420,hr=300,sr=24;let xr=0,Rr=0;switch(Ge.position){case"bottom":xr=tr.bottom+sr,Rr=tr.left+tr.width/2;break;case"right":xr=tr.top+tr.height/2,Rr=tr.right+sr;break;case"left":xr=tr.top+tr.height/2,Rr=tr.left-sr;break;case"top":xr=tr.top-sr,Rr=tr.left+tr.width/2;break;default:xr=window.innerHeight/2,Rr=window.innerWidth/2}const br=window.innerWidth-nr-20,wr=window.innerHeight-hr-20;Rr>br&&(Rr=br),Rr<20&&(Rr=20),xr>wr&&(xr=wr),xr<20&&(xr=20),Xe({top:xr,left:Rr})}else ze(null)},[Ge]);reactExports.useEffect(()=>{if(Ee){let pr=0;const tr=20;let nr=null,hr=!1;const sr=()=>{hr||(Qe(),Ge!=null&&Ge.targetSelector&&!document.querySelector(Ge.targetSelector)&&(pr++,pr<tr&&!hr&&(nr=setTimeout(sr,100))))};return nr=setTimeout(sr,200),()=>{hr=!0,nr&&clearTimeout(nr)}}},[Ee,Re,Qe,Be.pathname,Ge]),reactExports.useEffect(()=>{Ee&&(Ge!=null&&Ge.autoNavigate)&&(Ge!=null&&Ge.route)&&Be.pathname!==Ge.route&&$e(Ge.route)},[Ee,Re,Ge,$e,Be.pathname]),reactExports.useEffect(()=>{if(Ee)return window.addEventListener("resize",Qe),window.addEventListener("scroll",Qe),()=>{window.removeEventListener("resize",Qe),window.removeEventListener("scroll",Qe)}},[Ee,Qe]);const Ze=()=>{Ve?Me():Te()},Je=()=>{Oe()},ir=()=>{Oe()};if(!Ee)return null;const rr=()=>{if(!Ue)return{};const pr=Ue.getBoundingClientRect();return{top:pr.top-8,left:pr.left-8,width:pr.width+16,height:pr.height+16}};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Fade,{in:Ee,timeout:300,children:jsxRuntimeExports.jsx(Box,{className:"tour-backdrop"})}),Ue&&jsxRuntimeExports.jsx(Fade,{in:!0,timeout:400,children:jsxRuntimeExports.jsx(Box,{className:"tour-spotlight",sx:{position:"fixed",...rr(),pointerEvents:"none",zIndex:9998}})}),jsxRuntimeExports.jsx(Grow,{in:Ee,timeout:400,children:jsxRuntimeExports.jsxs(Paper,{elevation:8,className:`tour-tooltip ${(Ge==null?void 0:Ge.position)==="center"?"tour-tooltip-center":""}`,sx:{position:"fixed",top:(Ge==null?void 0:Ge.position)==="center"?"50%":`${We.top}px`,left:(Ge==null?void 0:Ge.position)==="center"?"50%":`${We.left}px`,transform:(Ge==null?void 0:Ge.position)==="center"?"translate(-50%, -50%)":(Ge==null?void 0:Ge.position)==="bottom"?"translateX(-50%)":(Ge==null?void 0:Ge.position)==="right"?"translateY(-50%)":(Ge==null?void 0:Ge.position)==="left"?"translate(-100%, -50%)":(Ge==null?void 0:Ge.position)==="top"?"translate(-50%, -100%)":"translate(-50%, -50%)",zIndex:9999,maxWidth:420,minWidth:360,p:3,pt:5,borderRadius:3,boxShadow:"0 20px 60px rgba(0,0,0,0.3)"},children:[jsxRuntimeExports.jsx(IconButton,{onClick:ir,size:"small",sx:{position:"absolute",top:8,right:8,color:"text.secondary",zIndex:1},children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})}),jsxRuntimeExports.jsxs(Box,{sx:{mb:2},children:[jsxRuntimeExports.jsx(LinearProgress,{variant:"determinate",value:Ye,sx:{height:6,borderRadius:3,bgcolor:"rgba(0,0,0,0.08)","& .MuiLinearProgress-bar":{borderRadius:3,bgcolor:"primary.main"}}}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",sx:{display:"block",mt:.5,color:"text.secondary",fontWeight:600},children:["Step ",Re+1," of ",qe.length]})]}),jsxRuntimeExports.jsxs(Box,{sx:{mb:3},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{mb:1.5,fontWeight:700,color:"#002D79"},children:renderTourTitle(Ge.title)}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"text.secondary",lineHeight:1.6},children:Ge.description})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1.5,justifyContent:"space-between",alignItems:"center"},children:[jsxRuntimeExports.jsx(Button,{onClick:Je,size:"medium",sx:{textTransform:"none",color:"text.secondary",fontWeight:600,"&:hover":{bgcolor:"rgba(0,0,0,0.04)"}},children:"Skip Tour"}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1},children:[!Ke&&jsxRuntimeExports.jsx(Button,{onClick:je,variant:"outlined",startIcon:jsxRuntimeExports.jsx(ArrowBack,{}),sx:{textTransform:"none",fontWeight:600,borderWidth:2,"&:hover":{borderWidth:2}},children:"Back"}),jsxRuntimeExports.jsx(Button,{onClick:Ze,variant:"contained",endIcon:Ve?jsxRuntimeExports.jsx(CheckCircle,{}):jsxRuntimeExports.jsx(ArrowForward$1,{}),sx:{textTransform:"none",fontWeight:600,minWidth:100,borderRadius:"10px",bgcolor:"#F97316",boxShadow:"0 8px 20px rgba(249, 115, 22, 0.45)","&:hover":{bgcolor:"#EA580C",boxShadow:"0 10px 24px rgba(249, 115, 22, 0.55)"}},children:Ve?"Finish":"Next"})]})]})]})}),(Ge==null?void 0:Ge.showArrow)&&Ue&&jsxRuntimeExports.jsx(Fade,{in:!0,timeout:500,
775children:jsxRuntimeExports.jsx(Box,{className:"tour-arrow",sx:{position:"fixed",...ar(),zIndex:9997,animation:"pulse-arrow 2s infinite"},children:jsxRuntimeExports.jsx(Box,{sx:{width:0,height:0,...or()}})})})]});function ar(){if(!Ue)return{};const pr=Ue.getBoundingClientRect();switch(Ge.position){case"bottom":return{top:pr.bottom+8,left:pr.left+pr.width/2-10};case"right":return{top:pr.top+pr.height/2-10,left:pr.right+8};case"left":return{top:pr.top+pr.height/2-10,left:pr.left-28};case"top":return{top:pr.top-28,left:pr.left+pr.width/2-10};default:return{}}}function or(){const pr="#f97316";switch(Ge.position){case"bottom":return{borderLeft:"10px solid transparent",borderRight:"10px solid transparent",borderBottom:"20px solid",borderBottomColor:pr};case"right":return{borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderRight:"20px solid",borderRightColor:pr};case"left":return{borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderLeft:"20px solid",borderLeftColor:pr};case"top":return{borderLeft:"10px solid transparent",borderRight:"10px solid transparent",borderTop:"20px solid",borderTopColor:pr};default:return{}}}},SIZE_MAP={small:{width:28,height:28,fontSize:"0.875rem"},medium:{width:40,height:40,fontSize:"1rem"},large:{width:56,height:56,fontSize:"1.25rem"}},UserAvatar=({userId:Ee,displayName:Re,size:Te="small",sx:je,...Oe})=>{var Ue;const[Me,De]=reactExports.useState(null);reactExports.useEffect(()=>{let ze=null,We=!1;return(async()=>{if(!Ee){De(null);return}try{const He=await userService.getUserPhotoById(Ee);We||(ze=He,De(He))}catch{We||De(null)}})(),()=>{We=!0,ze&&URL.revokeObjectURL(ze)}},[Ee]);const $e=Re?(Ue=Re.trim()[0])==null?void 0:Ue.toUpperCase():null,Be=SIZE_MAP[Te]||SIZE_MAP.small;return jsxRuntimeExports.jsx(Avatar,{alt:Re||"User",src:Me||void 0,sx:{...Be,bgcolor:Me?"transparent":"action.selected",...je},...Oe,children:!Me&&($e||jsxRuntimeExports.jsx(Person,{fontSize:"small"}))})},pulseRing=keyframes` 776 0% { transform: scale(1); opacity: 0.55; } 777 70% { transform: scale(1.55); opacity: 0; } 778 100% { transform: scale(1.55); opacity: 0; } 779`,MAX_RECORDING_MS=5*60*1e3;function getSpeechRecognitionCtor(){return typeof window>"u"?null:window.SpeechRecognition||window.webkitSpeechRecognition||null}function pad2(Ee){return String(Ee).padStart(2,"0")}function buildDefaultVoiceNoteTitle(Ee=new Date){const Re=Ee.getFullYear(),Te=pad2(Ee.getMonth()+1),je=pad2(Ee.getDate()),Oe=pad2(Ee.getHours()),Me=pad2(Ee.getMinutes()),De=pad2(Ee.getSeconds());return`Voice Note_${Re}-${Te}-${je}_${Oe}-${Me}-${De}`}function sanitizeFilenameBase(Ee){return String(Ee||"").trim().replace(/[<>:"/\\|?*\u0000-\u001f]/g,"_").replace(/\s+/g," ").replace(/\.+$/,"")||buildDefaultVoiceNoteTitle()}function formatDuration(Ee){const Re=Math.max(0,Math.floor(Ee/1e3)),Te=Math.floor(Re/60),je=Re%60;return`${pad2(Te)}:${pad2(je)}`}const VoiceNotesModal=({open:Ee,onClose:Re,onSaved:Te,showToast:je})=>{const Oe=useDispatch(),Me=useSelector(Ar=>{var Tr;return(Tr=Ar.auth)==null?void 0:Tr.user}),De=useSelector(Ar=>{var Tr;return(Tr=Ar.groups)==null?void 0:Tr.groups}),$e=useSelector(Ar=>{var Tr;return((Tr=Ar.groups)==null?void 0:Tr.loading)??!1}),[Be,Ue]=reactExports.useState("record"),[ze,We]=reactExports.useState(!1),[Xe,He]=reactExports.useState(0),[qe,Ge]=reactExports.useState(""),[Ye,Ve]=reactExports.useState(""),[Ke,Qe]=reactExports.useState(""),[Ze,Je]=reactExports.useState(null),[ir,rr]=reactExports.useState(""),ar=reactExports.useMemo(()=>{const Ar=Array.isArray(De)?De:[];if(!Me)return[];const Tr={...Me,groups:Ar};return Ar.filter(Nr=>canUploadToGroup(Tr,Nr.GroupID??Nr.id??Nr.group_id,Nr))},[Me,De]),or=reactExports.useRef(null),pr=reactExports.useRef([]),tr=reactExports.useRef(""),nr=reactExports.useRef(0),hr=reactExports.useRef(null),sr=reactExports.useRef(null),xr=reactExports.useRef(!1),Rr=reactExports.useCallback(()=>{hr.current&&(clearInterval(hr.current),hr.current=null),sr.current&&(clearTimeout(sr.current),sr.current=null)},[]),br=reactExports.useCallback(()=>{Rr();const Ar=or.current;if(Ar){try{Ar.onresult=null,Ar.onerror=null,Ar.onend=null,Ar.stop()}catch{}or.current=null}We(!1),He(0)},[Rr]),wr=reactExports.useCallback(()=>{xr.current=!0,br(),pr.current=[],Ue("record"),Ge(""),Ve(""),Qe(""),Je(null),rr(""),xr.current=!1},[br]);reactExports.useEffect(()=>{if(!Ee){wr();return}Qe(buildDefaultVoiceNoteTitle()),Oe(fetchGroups(!0))},[Ee,wr,Oe]),reactExports.useEffect(()=>{!Ee||$e||ar.length===1&&!Ze&&Je(ar[0])},[Ee,$e,ar,Ze]),reactExports.useEffect(()=>()=>br(),[br]);const vr=reactExports.useCallback(Ar=>{const Tr=String(Ar||"").trim();if(!Tr){rr("No speech detected. Please try again or type your note manually."),Ve(""),Ue("review");return}Ve(Tr),Qe(Nr=>Nr||buildDefaultVoiceNoteTitle()),rr(""),Ue("review")},[]),Dr=reactExports.useCallback(()=>{const Ar=getSpeechRecognitionCtor();if(!Ar)return rr("Speech recognition is not supported in this browser. Please use Chrome, Edge, or Safari."),!1;rr(""),xr.current=!1,pr.current=[],Ge("");const Tr=new Ar;Tr.continuous=!0,Tr.interimResults=!0,Tr.lang="en-US",Tr.onstart=()=>{We(!0),nr.current=Date.now(),He(0),Rr(),hr.current=setInterval(()=>{He(Date.now()-nr.current)},200),sr.current=setTimeout(()=>{rr("Maximum recording length (5 minutes) reached.");try{Tr.stop()}catch{}},MAX_RECORDING_MS)},Tr.onresult=Nr=>{var mr;let Br="";const Hr=[...pr.current];for(let Sr=Nr.resultIndex;Sr<Nr.results.length;Sr+=1){const Lr=Nr.results[Sr],jr=(((mr=Lr[0])==null?void 0:mr.transcript)||"").trim();jr&&(Lr.isFinal?Hr.push(jr):Br+=(Br?" ":"")+jr)}pr.current=Hr;
779const Vr=[...Hr,Br].filter(Boolean).join(" ").trim();tr.current=Vr,Ge(Vr)},Tr.onerror=Nr=>{const Br=(Nr==null?void 0:Nr.error)||"";if(Br==="aborted")return;let Hr="Speech recognition error. Please try again.";Br==="no-speech"?Hr="No speech detected. Please try again.":Br==="audio-capture"?Hr="No microphone found. Please check your microphone settings.":Br==="not-allowed"?Hr="Microphone permission denied. Please allow microphone access in your browser settings.":Br&&(Hr=`Speech recognition error: ${Br}`),rr(Hr),We(!1),Rr()},Tr.onend=()=>{if(Rr(),We(!1),or.current=null,xr.current){pr.current=[],tr.current="",Ge("");return}const Nr=pr.current.join(" ").trim();vr(Nr||tr.current)},or.current=Tr;try{return Tr.start(),!0}catch(Nr){if((Nr==null?void 0:Nr.name)==="InvalidStateError"){try{Tr.stop()}catch{}return setTimeout(()=>{try{Tr.start()}catch{rr("Failed to start speech recognition. Please try again.")}},100),!0}return rr("Failed to start speech recognition. Please try again."),!1}},[Rr,vr]),kr=()=>{Be!=="saving"&&(ze&&(xr.current=!0,br()),Re==null||Re())},cr=()=>{var Ar;if(Be==="record"){if(ze||or.current){xr.current=!1;try{(Ar=or.current)==null||Ar.stop()}catch{}return}Dr()}},dr=()=>{var Ar;if(!(!ze&&!or.current)){xr.current=!1;try{(Ar=or.current)==null||Ar.stop()}catch{}}},ur=()=>{xr.current=!0,br(),pr.current=[],tr.current="",Ge(""),rr(""),Ue("record")},gr=()=>{br(),pr.current=[],Ge(""),Ve(""),rr(""),Ue("record")},_r=!!Ye.trim()&&!!Ke.trim()&&!!Ze&&Be==="review",Ir=async()=>{var Tr,Nr,Br,Hr;if(!_r)return;const Ar=getGroupStableId(Ze);if(!Ar){rr("Please select a group.");return}Ue("saving"),rr("");try{const Vr=sanitizeFilenameBase(Ke),mr=Vr.toLowerCase().endsWith(".txt")?Vr:`${Vr}.txt`,Sr=new File([Ye],mr,{type:"text/plain"}),Lr=Number(Ar);await documentService.uploadDocument(Sr,Number.isNaN(Lr)?Ar:Lr),je==null||je(`Voice note "${mr}" saved successfully`,"success"),Te==null||Te({filename:mr,groupId:Ar}),Re==null||Re()}catch(Vr){const mr=((Nr=(Tr=Vr==null?void 0:Vr.response)==null?void 0:Tr.data)==null?void 0:Nr.error)||((Hr=(Br=Vr==null?void 0:Vr.response)==null?void 0:Br.data)==null?void 0:Hr.message)||(Vr==null?void 0:Vr.message)||"Failed to save voice note. Please try again.";rr(mr),Ue("review")}};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:kr,maxWidth:"sm",fullWidth:!0,disableEscapeKeyDown:Be==="saving",PaperProps:{sx:{borderRadius:2}},children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pr:1},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Mic,{color:"primary"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",component:"span",fontWeight:700,children:"Voice Notes"})]}),jsxRuntimeExports.jsx(IconButton,{"aria-label":"close",onClick:kr,disabled:Be==="saving",children:jsxRuntimeExports.jsx(Close$1,{})})]}),jsxRuntimeExports.jsx(DialogContent,{dividers:!0,children:jsxRuntimeExports.jsxs(Stack,{spacing:2.5,children:[ir&&jsxRuntimeExports.jsx(Alert,{severity:"error",onClose:()=>rr(""),children:ir}),Be==="record"&&jsxRuntimeExports.jsxs(Stack,{spacing:2,alignItems:"center",sx:{py:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",textAlign:"center",children:"Click the microphone to start speaking (same speech-to-text as Chat). Click again or tap Stop when finished."}),jsxRuntimeExports.jsx(Typography,{variant:"h4",fontWeight:700,sx:{fontVariantNumeric:"tabular-nums",letterSpacing:1},children:formatDuration(Xe)}),jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",color:ze?"error.main":"text.secondary",sx:{display:"flex",alignItems:"center",gap:.75},children:ze?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(GraphicEq,{fontSize:"small"}),"Recordingâ¦"]}):"Ready"}),ze&&qe&&jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{px:2,maxWidth:"100%",textAlign:"center",fontStyle:"italic"},children:qe}),jsxRuntimeExports.jsxs(Box,{sx:{position:"relative",display:"inline-flex"},children:[ze&&jsxRuntimeExports.jsx(Box,{sx:{position:"absolute",inset:-8,borderRadius:"50%",border:"2px s
779olid",borderColor:"error.main",animation:`${pulseRing} 1.4s ease-out infinite`,pointerEvents:"none"}}),jsxRuntimeExports.jsx(IconButton,{color:ze?"error":"primary",onClick:cr,sx:{width:88,height:88,bgcolor:ze?"error.main":"primary.main",color:"common.white",touchAction:"manipulation",userSelect:"none","&:hover":{bgcolor:ze?"error.dark":"primary.dark"}},"aria-label":ze?"Stop recording":"Start recording",children:jsxRuntimeExports.jsx(Mic,{sx:{fontSize:40}})})]}),ze&&jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:1,children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",color:"inherit",onClick:ur,startIcon:jsxRuntimeExports.jsx(Close$1,{}),children:"Cancel"}),jsxRuntimeExports.jsx(Button,{variant:"contained",color:"error",onClick:dr,startIcon:jsxRuntimeExports.jsx(Stop,{}),children:"Stop"})]})]}),(Be==="review"||Be==="saving")&&jsxRuntimeExports.jsxs(Stack,{spacing:2,children:[jsxRuntimeExports.jsx(TextField,{label:"Title",value:Ke,onChange:Ar=>Qe(Ar.target.value),fullWidth:!0,required:!0,disabled:Be==="saving",helperText:"Saved as a .txt file"}),jsxRuntimeExports.jsx(GroupHierarchyPicker,{label:"Group *",placeholder:$e?"Loading groupsâ¦":ar.length===0?"No groups available":"Select a groupâ¦",options:ar,value:Ze,onChange:Je,disabled:Be==="saving"||$e||ar.length===0}),jsxRuntimeExports.jsx(TextField,{label:"Transcribed text",value:Ye,onChange:Ar=>Ve(Ar.target.value),fullWidth:!0,required:!0,multiline:!0,minRows:6,maxRows:14,disabled:Be==="saving",placeholder:"Edit your voice note hereâ¦"}),jsxRuntimeExports.jsx(Button,{size:"small",onClick:gr,disabled:Be==="saving",sx:{alignSelf:"flex-start"},children:"Record again"})]})]})}),jsxRuntimeExports.jsxs(DialogActions,{sx:{px:3,py:2},children:[jsxRuntimeExports.jsx(Button,{onClick:kr,color:"inherit",disabled:Be==="saving",children:"Close"}),(Be==="review"||Be==="saving")&&jsxRuntimeExports.jsx(Button,{variant:"contained",onClick:Ir,disabled:!_r||Be==="saving",startIcon:Be==="saving"?jsxRuntimeExports.jsx(CircularProgress,{size:16,color:"inherit"}):jsxRuntimeExports.jsx(CloudUpload,{}),children:Be==="saving"?"Savingâ¦":"Save note"})]})]})},GA_MEASUREMENT_ID="G-VRH9BD92VW",GTAG_SRC=`https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}`;function installGtagSnippet(){if(GTAG_SRC){if(window.dataLayer=window.dataLayer||[],typeof window.gtag!="function"&&(window.gtag=function(){window.dataLayer.push(arguments)}),window.gtag("js",new Date),!document.querySelector(`script[src="${GTAG_SRC}"]`)){const Ee=document.createElement("script");Ee.async=!0,Ee.src=GTAG_SRC,document.head.appendChild(Ee)}window.gtag("config",GA_MEASUREMENT_ID,{send_page_view:!1})}}const GoogleAnalytics=()=>{const Ee=useLocation();return reactExports.useEffect(()=>{installGtagSnippet()},[]),reactExports.useEffect(()=>{if(typeof window.gtag!="function")return;const Re=`${Ee.pathname}${Ee.search}${Ee.hash}`;window.gtag("config",GA_MEASUREMENT_ID,{page_path:Re})},[Ee.pathname,Ee.search,Ee.hash]),null},knowledgeBaseMarkdown=`# OpenParser AI â Complete User Help Knowledge Base\r 780\r 781This is the official end-user guide for OpenParser AI. The in-app **OPAI Assistant** answers from this file plus the full **Terms & Conditions** and **Privacy Policy** documents. It always replies with numbered step-by-step instructions only. Section **26. Application user flows** lists every main user workflow.\r 782\r 783Product name: **OpenParser AI** \r 784Footer: © 2026 OpenParser AI. All rights reserved. \r 785Related links in the sidebar footer: **Terms & Conditions** · **Privacy Policy**\r 786\r 787---\r 788\r 789## Table of contents\r 790\r 7911. What is OpenParser AI?\r 7922. Roles and what you can see\r 7933. Getting started\r 7944. Sign in, registration, passwords, invitations, SSO, MFA\r 7955. Terms & Conditions (user guide)\r 7966. Privacy Policy (user guide)\r 7977. Terms acceptance (first login)\r 7988. Top bar, Support, notifications, dark mode, tour, help assistant\r 7999. Navigation map\r 80010. Chat\r 80111. Documents\r 80212. Groups\r 80313. Agent Apps\r 80414. Favorites\r 80515. Connectors\r 80616. Users, invitations, and licenses\r 80717. Chat Settings\r 80818. Models\r 80919. Analytics\r 81020. Audit Logs\r 81121. Profile\r 81222. Subscription\r 81323. Platform Admin (platform operators)\r 81424. Maintenance and other pages\r
81525. Common questions\r 81626. Application user flows (step-by-step)\r 81727. Glossary\r 818\r 819Note: Section 26 includes **Purchase Licenses**, **User Management**, and all other step-by-step flows.\r 820\r 821---\r 822\r 823## 1. What is OpenParser AI?\r 824\r 825OpenParser AI is an intelligent document platform. Depending on your role and plan, you can:\r 826\r 827- Upload and manage documents\r 828- Chat with documents, groups, databases, or websites\r 829- Launch **Agent Apps** for focused workflows\r 830- Save **Favorite Prompts**\r 831- Organize access with **Groups**\r 832- Connect external sources (**Connectors**)\r 833- Manage users, subscription, and AI chat defaults (admins)\r 834\r 835Use the **OPAI Assistant** (help icon) anytime you need guidance about features, workflows, or navigation.\r 836\r 837---\r 838\r 839## 2. Roles and what you can see\r 840\r 841| Role | Typical access |\r 842|------|----------------|\r 843| **User** | Chat, Agent Apps, Favorites, Documents (upload may need approval), Groups (membership), Profile |\r 844| **View Only** | Limited documents and chat-related access; Groups management and most admin tools hidden |\r 845| **Group Admin** | User tools plus approve/reject documents, manage groups/members, connectors (when allowed), scoped users, Analytics, Audit Logs |\r 846| **Tenant Admin** | Full tenant tools: Users, Chat Settings, Models, Connectors, Analytics, Audit Logs, Subscription |\r 847| **Platform Admin** | Platform console only (\`/platform/...\`): tenants, subscriptions, pipeline, health, agents, settings |\r 848| **Enterprise Tenant Admin** | Chat, Agent Apps, and Favorites may be hidden; Documents often view-only |\r 849\r 850After login:\r 851\r 852- Platform Admin usually lands on the platform tenants overview\r 853- Enterprise Tenant Admin often lands on Documents\r 854- Other users usually land on Chat\r 855\r 856---\r 857\r 858## 3. Getting started\r 859\r 8601. Sign in with email/password or SSO (Google / Microsoft), if enabled.\r 8612. Accept **Terms & Conditions** and **Privacy Policy** if prompted (\`Terms Acceptance\`).\r 8623. Optionally run the **OpenParser Tour** from your profile menu.\r 8634. Common first path for a new organization:\r 864 - Admins create **Groups**\r 865 - Users or admins upload **Documents**\r 866 - Documents are approved when required\r 867 - Users open **Chat** (or **Agent Apps**) and ask questions\r 868\r 869---\r 870\r 871## 4. Sign in, registration, passwords, invitations, SSO, MFA\r 872\r 873### Login (\`/login\`)\r 874\r 875- Tabs: **Sign In** / company signup (signup may be disabled during maintenance)\r 876- Fields: Email Address, Password (show/hide), **Sign In**\r 877- SSO: **Google** and **Microsoft** buttons\r 878- Links: **Forgot password?**; company signup may send you to **Subscription**\r 879- Alerts may appear for remaining login attempts or account lockout\r 880- Hero themes: Secure & Compliant; AI-Powered Intelligence; Team Collaboration\r 881\r 882### Multi-Factor Authentication (MFA)\r 883\r 884When required after login:\r 885\r 886- Screen title: **Multi-Factor Authentication Required**\r 887- May show a QR code and backup secret for an authenticator app\r 888- Enter the authentication code â **Verify**\r 889- **Cancel** returns to login\r 890\r 891### Register / company signup\r 892\r 893- Fields typically include First name, Last name, Email, Company, optional Mobile, Password, Confirm password\r 894- Password guidance: at least 8 characters with upper, lower, number, and special character\r 895- Must accept Terms & Conditions (and may preview Terms / Privacy)\r 896- Google/Microsoft OAuth may be available\r 897- After signup you may go to **Registration Pending**\r 898\r 899### Registration Pending (\`/registration-pending\`)\r 900\r 901- Shows that approval is pending\r 902- Displays account/email details\r 903- Wait for an admin approval email\r 904- **Back to Login**\r 905\r 906### Forgot password (\`/forgot-password\`)\r 907\r 9081. Enter **Email Address**\r 9092. Click **Send Reset Link**\r 9103. Success message: password reset email sent\r 9114. Return to login\r 912\r 913### Reset password (\`/forgotPassword\`)\r 914\r 9151. Open the email link\r 9162. Enter New password and Confirm password\r 9173. Follow the password strength checklist\r 9184. Success â return to login\r 919\r 920### Verify invitation (\`/verifyInvitation\`)\r 921\r 922Possible states:\r 923\r 924- **Invitation Verified!**\r 925- **Invitation Cancelled**\r 926- **Verification Failed** (expired or invalid)\r 927- Loading: âVerifying your invitation...â\r 928\r 929### SSO callback (\`/auth/callback\`)\r 930\r 931Completes Google/Microsoft sign-in after the identity provider redirects back to OpenParser AI.\r 932\r 933---\r 934\r 935## 5. Terms & Conditions (user guide)\r 936\r 937Public page: **Terms & Conditions** (\`/terms\`) \r 938Also linked in the sidebar footer and signup/acceptance flows.\r 939\r 940OpenParser AI Terms cover how Innovatix Technology Partners provides the service to your organization (Customer) and what users/admins must follow.\r 941\r 942### Major Terms sections (what they mean for you)\r 943\r 944| Section | Practical meaning |\r 945|---------|-------------------|\r 946| **Parties and Acceptance** | By using the service you accept the Terms on behalf of yourself / your organization |\r 947| **Definitions** | Explains key words used in the agreement |\r 948| **Subscription and Account Administration** | How accounts, seats, and admins are managed |\r 949| **Use Restrictions / Acceptable Use** | Allowed and prohibited uses of the platform |\r 950| **Service Availability and Changes** | Service may change; availability is described here |\r 951| **Customer Content and Data Rights** | Your uploaded documents remain Customer Content; processing roles and export are covered |\r 952| **AI Features, Outputs, and Human Review** | AI answers can be wrong; humans should review important decisions; training/use of content is disclosed |\r 953| **Security and Incident Response** | How security and incidents are handled |\r 954| **Support and Maintenance** | Support expectations |\r 955| **Fees, Payment, and Taxes** | Billing, invoices, and payment obligations |\r 956| **Suspension** | Accounts/service can be suspended for non-payment or misuse |\r 957| **Confidentiality** | Protect confidential information |\r 958| **Intellectual Property / Feedback** | Platform IP remains with the provider; feedback usage is described |\r 959| **Third-Party / Open Source** | Connected third-party tools and open-source notices |\r 960| **Compliance, Export, Sanctions** | Legal compliance requirements |\r 961| **Term, Renewal, Termination** | How the agreement starts, renews, and ends |\r 962| **Warranties** | Service warranty terms |\r 963| **Indemnification** | Who covers certain claims |\r 964| **Limitation of Liability** | Caps/limits on damages |\r 965| **Dispute Resolution / Governing Law** | How disputes are handled |\r 966| **Changes** | Terms can be updated; continued use may mean acceptance |\r 967| **Miscellaneous** | Standard legal closing terms |\r 968| **Exhibits** | Supporting schedules such as Order Form, DPA summary, Security Measures, Acceptable Use Policy, AI Usage Disclosure |\r 969| **Contact** | How to reach the provider about the Terms |\r 970\r 971### Important practical obligations for users\r 972\r 973- Keep login credentials secure and use the service appropriately\r 974- Do not upload restricted/sensitive data unless your organization agreement allows it\r 975- Do not misuse the platform (spam, unlawful content, attempts to break security)\r 976- Treat AI output as assistance â review before relying on it for legal, compliance, or high-impact decisions\r 977- Organization admins are responsible for seats, billing, and user invitations\r 978\r 979The full legal **Terms & Conditions** text is also indexed for the help assistant (\`TERMS_AND_CON
979DITIONS.md\`, same content as \`/terms\`). Open that page for the complete agreement. This section is a functionality overview, not a legal substitute.\r 980\r 981---\r 982\r 983## 6. Privacy Policy (user guide)\r 984\r 985Public page: **Privacy Policy** (\`/privacy\`) \r 986Also linked in the sidebar footer and acceptance flows.\r 987\r 988### Major Privacy sections (what they mean for you)\r 989\r 990| Section | Practical meaning |\r 991|---------|-------------------|\r 992| **Scope** | What the policy covers |\r 993| **Roles (Customer vs Innovatix)** | Your organization is typically controller of business/content decisions; Innovatix processes Customer Content on instruction |\r 994| **Information We Collect** | Account details you provide; Customer Content (uploads/chats); automatic technical data; some third-party data |\r 995| **How We Use Information** | Operate, secure, support, improve, and bill the service |\r 996| **How We Share Information** | Sharing with subprocessors/providers under controls; legal requirements |\r 997| **Cookies** | Cookies/similar technologies for session and product operation |\r 998| **AI Features** | How document/chat context is used to generate answers |\r 999| **Retention** | How long data may be kept |\r 1000| **Security** | Safeguards for systems and data |\r 1001| **International Transfers** | Cross-border transfer disclosures |\r 1002| **Rights & Choices** | Account choices; EEA/UK rights; CCPA/CPRA rights where applicable |\r 1003| **Childrenâs Privacy** | Not intended for children |\r 1004| **Changes** | Policy updates |\r 1005| **Contact** | Privacy contact information |\r 1006| **Appendix A â AI Usage Disclosure** | Disclosure about AI processing and outputs |\r 1007\r 1008### Practical privacy tips for users\r 1009\r 1010- Only upload documents your organization authorizes\r 1011- Admins should configure groups and access carefully\r 1012- Review Profile notification preferences\r 1013- Contact Support or your tenant admin for data access/deletion requests through your organization process\r 1014\r 1015The full **Privacy Policy** text is also indexed for the help assistant (\`PRIVACY_POLICY.md\`, same content as \`/privacy\`). Open that page for the complete policy. This section is a functionality overview, not a legal substitute.\r 1016\r 1017---\r 1018\r 1019## 7. Terms acceptance (first login)\r 1020\r 1021Protected page: **Terms Acceptance** (\`/terms-acceptance\`)\r 1022\r 1023- Expandable Terms and Privacy sections with version chips\r 1024- Warning appears if you must accept both\r 1025- Button: **Accept & Continue**\r 1026- You cannot proceed into the main app until required documents are accepted\r 1027\r 1028---\r 1029\r 1030## 8. Top bar, Support, notifications, dark mode, tour, help assistant\r 1031\r 1032### Top bar\r 1033\r 1034- OpenParser AI logo\r 1035- **Support** (opens external support / ticket URL)\r 1036- **Dark mode** toggle\r 1037- **Notifications** bell (unread badge, open list, delete items; empty: âNo notificationsâ; closing can mark all read)\r 1038- User avatar menu:\r 1039 - **Profile**\r 1040 - **OpenParser Tour** (not shown for platform admins)\r 1041 - **Subscription** (tenant admins)\r 1042 - **Logout**\r 1043- Trial banner (tenant admins near trial end): âTrial expires in N day(s)â / âTrial expiredâ â **Upgrade**\r 1044\r 1045### OpenParser Tour\r 1046\r 1047Role-based walkthrough with **Skip Tour**, **Back**, **Next**, **Finish**, and âStep X of Yâ.\r 1048\r 1049- **Tenant Admin tour themes:** Groups â Create Group â Documents â Quick Upload â Chat â New Chat â customize AI responses â ask questions â Agent Apps â Connectors â Chat Settings â Users (Add/Edit/Pending) â Analytics â Audit Logs\r 1050- **User tour themes:** Documents â Upload â status â Chat â Agent Apps â Favorites â Groups\r 1051- **Group Admin tour themes:** Documents â Upload â Approve/Reject â Chat â Agent Apps â Groups (View Members) â Connectors â Users â Analytics â Audit Logs\r 1052\r 1053### OPAI Assistant\r 1054\r 1055- Floating help button (help icon)\r 1056- On **Chat**: sits on the right above the chat input\r 1057- Elsewhere: right-side floating help\r 1058- Ask **how to** do something in OpenParser â answers are numbered step-by-step instructions from this guide only\r 1059- Conceptual questions (for example âWhat is chat?â) are not answered; the assistant replies that it has no instructions yet\r 1060- Placeholder: âe.g. How do I upload a document?â\r 1061- If the guide does not cover your question: âI don't have instructions for that yet. Please contact support.â\r 1062\r 1063---\r 1064\r 1065## 9. Navigation map\r 1066\r 1067Sidebar items (visibility depends on role/plan):\r 1068\r 1069| Label | Purpose |\r 1070|-------|---------|\r 1071| **Chat** | Ask questions about attached sources |\r 1072| **Agent Apps** | Launch specialized agent workflows |\r 1073| **Favorites** | Saved prompts |\r 1074| **Documents** | Document repository |\r 1075| **Groups** | Membership / group management |\r
1076| **Connectors** | External source connections |\r 1077| **Models** | Tenant cloud models |\r 1078| **Analytics** | Usage insights |\r 1079| **Chat Settings** | Org AI defaults |\r 1080| **Users** | Invite and manage people |\r 1081| **Audit Logs** | Action history |\r 1082| Platform items | Executive, Tenants, Subscriptions, Pipeline, System Health, Agents, Settings |\r 1083\r 1084Footer always shows Terms & Conditions and Privacy Policy.\r 1085\r 1086---\r 1087\r 1088## 10. Chat\r 1089\r 1090Path: \`/chat\`\r 1091\r 1092### Conversations sidebar\r 1093\r 1094- Search chats\r 1095- **New Chat**\r 1096- Pin / Unpin\r 1097- Rename\r 1098- Clear conversation\r 1099- Delete session\r 1100- On narrow screens: open/close conversations drawer\r 1101\r 1102### Header and tools\r 1103\r 1104- Header support text: ask questions about your data sources or get assistance\r 1105- **Strict** switch (may be locked by organization Chat Settings)\r 1106- Source chips for selected documents / groups / websites / database connection (with remove)\r 1107- Favorite Prompts\r 1108- Response Style\r 1109- Document Settings\r 1110- Content Preferences\r 1111- Additional Instructions\r 1112- More options (includes Export Chat on many layouts)\r 1113\r 1114### Attaching sources (Select Source)\r 1115\r 1116Open attach / paperclip / Select Source. Tabs/flows may include:\r 1117\r 1118- **Documents** â search by name; filter by groups; select files; preview\r 1119- **Database(s)** â choose a database connection\r 1120- **Website(s)** â choose website connections\r 1121- **Groups** â select document groups\r 1122\r 1123Important behavior:\r 1124\r 1125- Source types are typically exclusive (groups vs documents/DB/websites)\r 1126- Active scope appears as chips above the input\r 1127- Scope at send time drives that answer; later scope changes do not rewrite older message history\r 1128\r 1129### Message input\r 1130\r 1131- Placeholder: âType your message... (Shift+Enter for new line)â\r 1132- Send\r 1133- Voice input (mic) when available\r 1134- Save current text as favorite\r 1135- Slash commands for certain agent workflows (may require a minimum number of selected documents)\r 1136\r 1137### Answers\r 1138\r 1139While generating, stages may include: Preparing â Searching documents â Ranking matches â Drafting answer â Checking answer â Finalizing.\r 1140\r 1141Under answers you may see:\r 1142\r 1143- Document source chips / names (click to preview when available)\r 1144- Save to Favorites (for user messages)\r 1145- Copy / share / edit actions from message menus\r 1146- Read-aloud (TTS) when enabled\r 1147\r 1148### Empty state tip\r 1149\r 1150Start a conversation and attach data sources for better, context-aware answers.\r 1151\r 1152---\r 1153\r 1154## 11. Documents\r 1155\r 1156### Document Repository (\`/documents/repository\`)\r 1157\r 1158Purpose: view and manage uploaded documents.\r 1159\r 1160**Stats cards**\r 1161\r 1162- Active Files\r 1163- Pending Files\r 1164- Total Files\r 1165- Storage Used\r 1166\r 1167**Quick Upload**\r 1168\r 1169- Drag and drop files or choose from local folder\r 1170- Assign to group(s) when prompted\r 1171- Caption: Upload from local folder / Drop Files Here\r 1172\r 1173**Filters**\r 1174\r 1175- Search documentsâ¦\r 1176- Status\r 1177- Groups\r 1178- Date From / Date To\r 1179\r 1180**Row actions**\r 1181\r 1182- Preview\r 1183- Download\r 1184- Change Group\r 1185- Delete\r 1186- Approve / Reject (when you have review permission)\r 1187\r 1188**Pending review**\r 1189\r 1190- Pending Files review UI\r 1191- Approve or Reject with reason\r 1192- Empty: No pending files / no files match filters\r 1193\r 1194**Status concepts**\r 1195\r 1196- Pending â awaiting approval/processing\r 1197- Approved / Active â available for use\r 1198- Rejected â not approved (reason may be shown)\r 1199\r 1200**Role notes**\r 1201\r 1202- Regular users often upload for approval\r 1203- Group/Tenant admins can approve/reject\r 1204- View Only / some Enterprise admin modes may be view-only (no upload/approve/delete)\r 1205\r 1206### Pending Approvals (\`/documents/pending\`)\r 1207\r 1208- Badge with pending count\r 1209- Cards with Approve / Reject / Preview\r 1210- Rejection reason required\r 1211- Empty: No Pending Approvals\r 1212- Access warning if your role cannot approve\r 1213\r 1214### Limits\r 1215\r 1216If storage or document limits are reached, you may see an upgrade / subscription message.\r 1217\r 1218---\r 1219\r 1220## 12. Groups\r 1221\r 1222Path: \`/groups\`\r 1223\r 1224### Members view (My Group(s))\r 1225\r 1226- See groups you belong to\r 1227- Nested groups can expand/collapse\r 1228\r 1229### Admin view (Group Management)\r 1230\r 1231Purpose copy: create and manage groups for document access control.\r 1232\r 1233**Actions**\r 1234\r 1235- **Create Group**\r 1236- Search groups\r 1237- Table / Grid view\r 1238- Edit / Delete group\r 1239- **View Members**\r 1240- Expand nested groups\r 1241\r 1242**Create / Edit fields**\r 1243\r 1244- Group Name (example: Finance Department)\r 1245- Description\r 1246- Parent group (optional â leave empty for a top-level/parent group)\r 1247\r 1248**Members modal**\r 1249\r 1250- Search by name/email/role\r 1251- Make / Remove group admin\r 1252- Remove member\r 1253- Empty: No members\r 1254\r 1255**Confirms**\r 1256\r 1257- Remove Member\r 1258- Delete Group (may warn about nested impact)\r 1259\r 1260Groups are also used when uploading documents and when scoping Chat / Agent Apps.\r 1261\r 1262---\r 1263\r 1264## 13. Agent Apps\r 1265\r 1266Path: \`/agent-apps\`\r 1267\r 1268Purpose: launch focused OpenParser agents as app-like workflows with a dedicated chat/workbench panel.\r 1269\r 1270### Catalog UI\r 1271\r 1272- Search agents\r 1273- Sections such as **Advanced Agent Apps** and **Published Agents**\r 1274- Empty: Published agents will appear here when available / No agents found\r 1275- Tenant admin card menu: Enable / Disable / Remove\r 1276\r 1277### Common requirement chips\r 1278\r 1279- Requires documents\r 1280- Requires 2 documents\r 1281- Approval queue\r 1282- Tenant configured\r 1283- Requires commitment + evidence\r 1284\r 1285### Named advanced apps (examples)\r 1286\r 1287| App | Typical requirement |\r 1288|-----|---------------------|\r 1289| SIRE Vetting Response | Tenant configured |\r 1290| Vendor Qualification Audit | Tenant configured |\r 1291| Title Commitment Review | Tenant configured |\r 1292| Title Commitment Compliance Review | Requires commitment + evidence |\r 1293| Extraction Workbench | Requires documents |\r 1294| Diff Review App / Compare & Diff | Requires 2 documents |\r 1295| Approval Workflow App | Approval queue |\r 1296| Document Investigation App | Requires documents |\r 1297\r 1298### How to use Agent Apps\r 1299\r 1300For step-by-step instructions, ask the OPAI Assistant: *How do I use an Agent App?* (see **Section 26 â Common help questions**).\r 1301\r 1302Published agents created by platform operators may also appear beyond the advanced catalog.\r 1303\r 1304---\r 1305\r 1306## 14. Favorites\r 1307\r 1308Path: \`/favorites\` \r 1309Also available from Chat (Favorite Prompts picker / save actions)\r 1310\r 1311Purpose: save your best prompts for quick access.\r 1312\r 1313**Actions**\r 1314\r 1315- **Add Favorite** (Title + Prompt)\r 1316- Search favorites\r 1317- Sort by Date Added / Title / Prompt Text\r 1318- Use prompt\r 1319- Edit / Remove\r 1320- Multi-delete / Delete All where available\r 1321\r 1322**Notes**\r 1323\r 1324- Global organization prompts may only be edited/removed by a tenant admin\r 1325- Empty: No favorite prompts yet / No favorites match\r 1326\r 1327---\r 1328\r 1329## 15. Connectors\r 1330\r 1331Path: \`/admin/connectors\` \r 1332Who: Tenant Admin or Group Admin (when allowed)\r 1333\r 1334Purpose: manage which external document sources and data connections tenant users can use.\r 1335\r 1336### Connectors list\r 1337\r 1338Columns/concepts often include:\r 1339\r 1340- Connector name and description\r 1341- Access (Free for all / Plan included / Tenant grant)\r 1342- Status (Available, Deactivated, Not subscribed, etc.)\r 1343- Scope\r 1344- Tenant setting (Active / Deactivated)\r 1345- Actions: Configure, Start, Sync, View Sync Report\r 1346\r 1347Empty: No connectors are registered yet.\r 1348\r 1349### Connector types\r 1350\r 1351#### Database\r 1352\r 1353- Add connections for PostgreSQL / MSSQL / MySQL (as offered)\r 1354- Test connection\r 1355- Query log page for a connection\r 1356- Sync report\r 1357\r 1358#### Website\r 1359\r 1360- Add website connections (name, description, URL-style configuration)\r 1361- Use later in Chat website source selection\r 1362\r 1363#### Cloud Drive\r 1364\r 1365- Google Drive and SharePoint / OneDrive style connect-and-configure OAuth flows\r 1366- Choose upload/target group\r 1367- Sync / import\r 1368\r 1369#### Google Drive bulk / SharePoint bulk\r 1370\r 1371- Connect provider\r 1372- Pick folder/site/drive\r 1373- Start or Sync job\r 1374- Job status: Uploaded / Failed / Skipped / Total Files\r 1375- Requires an upload group; warning appears if none is configured\r 1376\r 1377Some document/chat flows also support per-file Google Drive / SharePoint import with format options.\r 1378\r 1379---\r 1380\r 1381## 16. Users, invitations, and licenses\r 1382\r 1383Path: \`/admin/users\` \r 1384Who: Tenant Admin / Group Admin (scoped) / Platform Admin (some actions)\r 1385\r 1386See **Section 26 â User Management** for full step-by-step flows (invite, edit, suspend, pending requests, licenses, etc.).\r 1387\r 1388### Users tab\r 1389\r 1390- **Add User**, **Refresh**, **Search users...**, **Roles** filter, table/gri
1390d toggle\r 1391- Row **â®** menu: **View Details**, **Edit**, **Resend Invite**, **Cancel Invite** (pending), **Lock**/**Unlock**, **Delete**/**Restore** (platform), **Suspend**/**Activate** (Super Admin)\r 1392\r 1393### Pending Requests tab\r 1394\r 1395- Pending invites and registration requests\r 1396- **Approve** / **Reject** registration requests with role and group assignment\r 1397- **Resend Invite** / **Cancel Invite** for pending invites\r 1398\r 1399### Licenses\r 1400\r 1401- License card: total, active, available\r 1402- **Buy Licenses** / **Request more licenses** when seats are exhausted\r 1403\r 1404---\r 1405\r 1406## 17. Chat Settings\r 1407\r 1408Path: \`/admin/chat-settings\` \r 1409Who: Tenant Admin\r 1410\r 1411Purpose: configure how AI behaves for users. Locked settings cannot be changed by users. Hidden sections will not appear in Chat.\r 1412\r 1413### Sections\r 1414\r 14151. **Strict Mode** â enable/disable; Lock for all users; optional Show in chat\r 14162. **Response presets** â Default Preset; Tone & Style; Response Length; Detail Level; Preferred Language; Lock; Show in chat\r 14173. **Document Settings** â Document Scope (for example All Approved Documents); Citation Style (for example Document Name, Page); Lock; Show in chat\r 14184. **Content Preferences** â Format Preference; Lock; Show in chat\r 14195. **Additional Instructions** â default custom instructions; Lock\r 14206. **Fallback Response Message** â custom âI donât knowâ / fallback wording\r 1421\r 1422Save your changes with **Save**.\r 1423\r 1424---\r 1425\r 1426## 18. Models\r 1427\r 1428Path: \`/admin/models\` \r 1429Who: Tenant Admin\r 1430\r 1431Purpose: manage tenant cloud model keys and monitor usage.\r 1432\r 1433**Actions**\r 1434\r 1435- View models table (display name, provider, Active/Inactive, OpenParser system chip)\r 1436- Add / Edit model: Provider, Display name, Cloud model name, API key, Active\r 1437- Delete model (confirm)\r 1438- Selected models may appear as choices in Chat when configured\r 1439\r 1440---\r 1441\r 1442## 19. Analytics\r 1443\r 1444Path: \`/analytics\` \r 1445Who: Group Admin / Tenant Admin (not regular User in typical nav)\r 1446\r 1447**Overview cards / insights**\r 1448\r 1449- Live snapshot\r 1450- Total documents\r 1451- Active / Pending counts\r 1452- Storage used\r 1453- Groups\r 1454- Favorites\r 1455- Chat sessions\r 1456- Last 7 days uploads\r 1457- Recent uploads / activity\r 1458- Group activity\r 1459\r 1460Empty examples: No documents uploaded yet · No group activity yet\r 1461\r 1462---\r 1463\r 1464## 20. Audit Logs\r 1465\r 1466Path: \`/admin/audit-logs\` \r 1467Who: admins with audit access\r 1468\r 1469**Stats**\r 1470\r 1471- Total Events\r 1472- Todayâs Events\r 1473- Last 7 Days\r 1474- Critical Actions\r 1475\r 1476**Filters**\r 1477\r 1478- Search by user, action, resource\r 1479- Groups / Users filters\r 1480- Clear filters / refresh\r 1481- Show/hide columns\r 1482\r 1483Display may say âShowing X of Y audit entriesâ.\r 1484\r 1485Platform Admins have a separate platform-wide Audit Logs area.\r 1486\r 1487---\r 1488\r 1489## 21. Profile\r 1490\r 1491Path: \`/profile\`\r 1492\r 1493**Actions**\r 1494\r 1495- View Company, Email, Role\r 1496- **Edit Profile**\r 1497- **Change Password**\r 1498- Email notification toggles (role-dependent), for example:\r 1499 - Password Changes\r 1500 - Processing Failed\r 1501 - Suspension with Reason\r 1502 - Document Rejection\r 1503 - Document Deleted\r 1504 - Document Awaiting Approval\r 1505 - Subscription Updated\r 1506 - Licenses Buy with Invoice\r 1507 - Subscription Cancel\r 1508\r 1509---\r 1510\r 1511## 22. Subscription\r 1512\r 1513### Subscription (\`/subscription\`, plan deep links, campaign)\r 1514\r 1515Guests:\r 1516\r 1517- View plan cards (for example SaaS / On-Premises)\r 1518- Sign up / SSO signup\r 1519- Stripe payment modal\r 1520- Profile completion prompts (company size / industry) when required\r 1521\r 1522Authenticated tenant admins:\r 1523\r 1524- Current Plan\r 1525- Total / Active / Available licenses\r 1526- Upgrade / Downgrade / Buy Licenses\r 1527- Invoice history / quick actions\r 1528- On-Premises contact path where offered\r 1529\r 1530### Purchase Licenses flow (summary)\r 1531\r 15321. **Buy Licenses** / **Buy More Licenses** from **Users** or **Subscription**\r 15332. **Purchase Additional Licenses** â enter quantity â review prorated **Due Today**\r 15343. **Purchase for $X.XX** â Stripe checkout â return to source page\r 15354. **Refresh** license pool â add or approve users\r 1536\r 1537### Top bar / menu\r 1538\r 1539- Tenant Admin: Subscription\r 1540- Trial expiry upgrade CTA when applicable\r 1541\r 1542### Stripe result pages\r 1543\r 1544- \`/billing/success\` â payment success redirect\r 1545- \`/billing/cancel\` â payment cancelled redirect\r 1546\r 1547---\r 1548\r 1549## 23. Platform Admin (platform operators)\r 1550\r 1551Visible only to Platform Admins (\`/platform/...\`).\r 1552\r 1553| Area | What it is for |\r 1554|------|----------------|\r 1555| **Executive** | High-level KPIs (registrations, docs, storage, questions, charts) |\r 1556| **Tenants** | Overview / Create / Manage / Metadata; suspend/activate/delete tenants; filters |\r 1557| **Subscriptions** | Overview, billing status, plan editor |\r 1558| **Pipeline** | Processing pipeline monitoring |\r 1559| **System Health** | Overview, resources, connectivity, performance |\r 1560| **Audit Logs** | Platform-wide audits |\r 1561| **Agents** | Create/edit/publish agents used by tenants |\r 1562| **Settings** | General settings and rate limits |\r 1563\r 1564Tenant end users do not use these screens for day-to-day document chat work.\r 1565\r 1566---\r 1567\r 1568## 24. Maintenance and other pages\r 1569\r 1570### Maintenance (\`/maintenance\`)\r 1571\r 1572- Service temporarily unavailable page\r 1573- **Refresh**\r 1574- **Logout**\r 1575- Protected app routes can be blocked by a maintenance guard\r 1576\r 1577### 404\r 1578\r 1579- Page not found when a route does not exist\r 1580\r 1581### Admin extras\r 1582\r 1583- \`/admin/agent-credentials\` â tenant agent credential management when enabled\r 1584- \`/admin/subscription\` â subscription center under admin\r 1585\r 1586### Embedded widget\r 1587\r 1588A separate embeddable chat widget exists for external sites; it is not the same as the in-app Chat page.\r 1589\r 1590---\r 1591\r 1592## 25. Common questions\r 1593\r 1594### How do I accept Terms and Privacy?\r 1595\r 1596On first required login you are sent to **Terms Acceptance**. Expand the documents, then click **Accept & Continue**. You can always re-read **Terms & Conditions** and **Pr
1596ivacy Policy** from the sidebar footer.\r 1597\r 1598### Why canât I see Chat?\r 1599\r 1600Your role/plan may hide Chat (for example some Enterprise Tenant Admin modes or Platform Admin). Use Documents or the areas shown in your sidebar.\r 1601\r 1602### Why arenât chat answers useful?\r 1603\r 1604- Confirm documents are processed and approved\r 1605- Attach the right documents/groups/DB/website scope\r 1606- Check Strict mode and org Chat Settings locks\r 1607- Ask a clearer question about the attached content\r 1608\r 1609### Documents vs Groups in Chat?\r 1610\r 1611- Documents = specific files\r 1612- Groups = documents in selected groups\r 1613- Mixing is usually prevented so the active scope stays clear\r 1614\r 1615### Who approves documents?\r 1616\r 1617Typically Group Admins and Tenant Admins. Regular users may upload as Pending until approved.\r 1618\r 1619### Who invites users?\r 1620\r 1621Tenant Admins, and Group Admins when permitted.\r 1622\r 1623### How do I get support?\r 1624\r 1625Use **Support** in the top bar, or contact your tenant administrator.\r 1626\r 1627### Where do I restart the product tour?\r 1628\r 1629Profile menu â **OpenParser Tour**.\r 1630\r 1631### Can the OPAI Assistant read my private documents?\r 1632\r 1633No. It answers from this user help guide about how the product works. For document Q&A, use **Chat** or **Agent Apps** with attached sources.\r 1634\r 1635---\r 1636\r 1637## 26. Application user flows (step-by-step)\r 1638\r 1639Use these flows when you need exact steps inside OpenParser AI. Each subsection is written for the in-app **OPAI Assistant**.\r 1640\r 1641**Tip:** Ask clearly with **How do Iâ¦** or **How toâ¦** and name the feature (for example: *How do I approve a document?* or *How do I change models in Chat?*).\r 1642\r 1643### Authentication and account\r 1644\r 1645#### How to sign in with email and password\r 1646\r 16471. Open **Login** (\`/login\`).\r 16482. Select the **Sign In** tab.\r 16493. Enter your **Email Address** and **Password**.\r 16504. Click **Sign In**.\r 16515. If prompted, complete **Terms Acceptance** or **MFA** before entering the app.\r 1652\r 1653#### How to sign in with Google or Microsoft SSO\r 1654\r 16551. Open **Login** (\`/login\`).\r 16562. Click **Google** or **Microsoft**.\r 16573. Complete sign-in with your identity provider.\r 16584. If prompted, accept **Terms & Conditions** and **Privacy Policy**, then click **Accept & Continue**.\r 1659\r 1660#### How to register a new company account\r 1661\r 16621. Open **Login** (\`/login\`) or go to **Subscription** signup.\r 16632. Open the company signup / **Register** form.\r 16643. Enter First name, Last name, Email, Company, Password, and Confirm password.\r 16654. Accept **Terms & Conditions** (preview Terms / Privacy if needed).\r 16665. Click the signup / register button.\r 16676. If approval is required, wait on **Registration Pending** until an admin approves you.\r 1668\r 1669#### How to reset a forgotten password\r 1670\r 16711. On **Login**, click **Forgot password?**\r 16722. Enter your **Email Address**.\r 16733. Click **Send Reset Link**.\r 16744. Open the email link.\r 16755. On **Reset password**, enter **New password** and **Confirm password**.\r 16766. Follow the password strength checklist, then return to **Login**.\r 1677\r 1678#### How to accept a user invitation\r 1679\r 16801. Open the invitation link (route: \`/verifyInvitation\`).\r 16812. Wait for **Invitation Verified!**\r 16823. Sign in with the invited email and set your password if prompted.\r 1683\r 1684#### How to accept Terms and Privacy on first login\r 1685\r 16861. After login, open **Terms Acceptance** (\`/terms-acceptance\`).\r 16872. Expand **Terms & Conditions** and **Privacy Policy** to review them.\r 16883. Click **Accept & Continue**.\r 16894. You cannot enter the main app until both are accepted.\r 1690\r 1691#### How to complete MFA after login\r 1692\r 16931. On **Multi-Factor Authentication Required**, scan the QR code in your authenticator app (or enter the backup secret).\r 16942. Enter the authentication code.\r 16953. Click **Verify**.\r 1696\r 1697#### How to log out\r 1698\r 16991. Click your **avatar** in the top bar.\r 17002. Click **Logout**.\r 1701\r 1702---\r 1703\r 1704### Chat\r 1705\r 1706#### How to start a new chat\r 1707\r 17081. Open **Chat** from the sidebar (\`/chat\`).\r 17092. In the conversations sidebar, click **New Chat**.\r 17103. Attach sources (documents, groups, database, or websites) before asking your question.\r 1711\r 1712#### How to attach documents in Chat\r 1713\r 17141. Open **Chat**.\r 17152. Click **Select documents** (document icon) in the message input area.\r 17163. In **Select Source**, open the **Documents** tab.\r 17174. Search by name and/or filter by **Groups**.\r 17185. Check the documents you want.\r 17196. Click **Confirm** / save selection.\r 17207. Selected documents appear as **Sources** chips above the input.\r 1721\r 1722#### How to attach groups in Chat\r 1723\r 17241. Open **Chat**.\r 17252. Clear any selected documents, database, or website sources first (groups cannot be mixed with those source types).\r 17263. Click **Select groups** (group icon) in the message input area.\r 17274. In **Select Groups**, search groups and check the groups you want.\r 17285. Click **Confirm**.\r 17296. Selected groups appear as **Sources** chips above the input.\r 1730\r 1731#### How to attach a database connection in Chat\r 1732\r 17331. Open **Chat**.\r 17342. Clear any selected groups first.\r 17353. Click **Select documents** to open **Select Source**.\r 17364. Open the **Database** or **Databases** tab (visible when active database connections exist).\r 17375. Select one database connection.\r 17386. Click **Confirm**.\r 17397. The database appears as a **Sources** chip above the input.\r 1740\r 1741#### How to attach website connections in Chat\r 1742\r 17431. Open **Chat**.\r 17442. Clear any selected groups first.\r 17453. Click **Select documents** to open **Select Source**.\r 17464. Open the **Website** or **Websites** tab (visible when active website connections exist).\r 17475. Select the website connection(s).\r 17486. Click **Confirm**.\r 17497. Selected websites appear as **Sources** chips above the input.\r 1750\r 1751#### How to remove an attached source in Chat\r 1752\r 17531. In **Chat**, find the **Sources** chip bar above the message input.\r 17542. Click the **X** on the chip you want to remove.\r 17553. Repeat for each source you want to clear.\r 1756\r 1757#### How to send a chat message\r 1758\r 17591. Attach the sources you need (optional but recommended).\r 17602. Type your question in **Type your message... (Shift+Enter for new line)**.\r 17613. Click **Send** or press Enter.\r 1762\r 1763#### How to use voice input in Chat\r 1764\r 17651. Open **Chat**.\r 17662. Click the **microphone** icon in the message input to use voice input.\r 17673. Speak your question.\r 17684. Click the microphone again to stop recording, then review and **Send**.\r 17695. Optional: click the **speaker** icon on the assistant reply to hear the answer read aloud.\r 1770\r 1771#### How to view source blocks used in an answer\r 1772\r 17731. After the assistant replies, click **Show N source blocks** under the answer.\r 17742. The source blocks sidebar opens on the right with the passages used.\r 17753. Click a source block to preview the document section when available.\r 17764. Click **Close** on the sidebar to hide it.\r 1777\r 1778#### How to preview a source chip on a message\r 1779\r 17801. Under an assistant answer, click **Show N source blocks**.\r 17812. In the sidebar, select the source block you want.\r 17823. Open the document preview from the block when a preview action is available.\r 1783\r 1784#### How to pin a conversation\r 1785\r 17861. Open **Chat**.\r 17872. In the conversations sidebar, open the **â®** menu on a session.\r 17883. Click **Pin** / **Pin conversation**.\r 1789\r 1790#### How to rename a conversation\r 1791\r 17921. Open **Chat**.\r 17932. In the conversations sidebar, open the **â®** menu on a session.\r 17943. Click **Rename**.\r 17954. Enter the new name and save.\r 1796\r 1797#### How to clear a conversation\r 1798\r 17991. Open **Chat**.\r 18002. In the conversations sidebar, open the **â®** menu on a session.\r 18013. Click **Clear conversation** and confirm.\r 1802\r 1803#### How to delete a chat session\r 1804\r 18051. Open **Chat**.\r 18062. In the conversations sidebar, open the **â®** menu on a session.\r 18073. Click **Delete** and confirm.\r 1808\r 1809#### How to search conversations\r 1810\r 18111. Open **Chat**.\r 18122. Use **Search chats** at the top of the conversations sidebar.\r 18133. Type part of the session name to filter the list.\r 1814\r 1815#### How to save a prompt as a favorite from Chat\r 1816\r 18171. Type your prompt in the Chat input.\r 18182. Click **Save as favorite** (star icon) on the input toolbar.\r 18193. Enter a title and save, or save from the favorites dialog when shown.\r 1820\r 1821#### How to use a favorite prompt in Chat\r 1822\r 18231. Open **Chat**.\r 18242. Click **Favorite Prompts** in the header (or open from the more menu on narrow screens).\r 18253. Search or browse favorites.\r 18264. Click **Use prompt** on the favorite you want.\r 18275. The prompt is placed in the input â edit if needed, then **Send**.\r 1828\r 1829#### How to change response style in Chat\r 1830\r 18311. Open **Chat**.\r 18322. Click **Response Style** in the header.\r 18333. Adjust tone, length, detail, or language settings that are not locked by your organization.\r 18344. Click **Save** or close the panel to apply.\r 1835\r 1836#### How to open document settings in Chat\r 1837\r 18381. Open **Chat**.\r 18392. Click **Document Settings** in the header (if shown for your role).\r 18403. Change document scope or citation style when not locked.\r 18414. Save your changes.\r 1842\r 1843#### How to open content preferences in Chat\r 1844\r 18451. Open **Chat**.\r 18462. Click **Content Preferences** in the header (if shown).\r 18473. Change format preferences when not locked.\r 18484. Save your changes.\r 1849\r 1850#### How to add additional instructions in Chat\r 1851\r 18521. Open **Chat**.\r 18532. Click **Additional Instructions** or **Custom Instructions** in the header (if shown).\r 18543. Enter instructions for how the assistant should answer.\r 18554. Save when not locked by tenant settings.\r 1856\r 1857#### How to toggle strict mode in Chat\r 1858\r 18591. Open **Chat**.\r 18602. Find the **Strict** switch in the header.\r 18613. Turn it **on** to prefer answers grounded in attached sources, or **off** for broader answers (when not locked by **Chat Settings**).\r 1862\r 1863#### How to change the chat model in Chat\r 1864\r 18651. Open **Chat**.\r 18662. In the message input toolbar, open the **model** dropdown (shows **Default** or the current model).\r 18673. Select the model to use for your next messages.\r 1868\r 1869#### How to export a chat\r 1870\r 18711. Open **Chat**.\r 18722. Open the **More** menu (â®) in the header.\r 18733. Click **Export Chat**.\r 18744. Choose the export format and download.\r 1875\r 1876#### How to share a chat\r 1877\r 1878**Share a single message**\r 1879\r 18801. Open **Chat** and find the message you want to share.\r 18812. Click the **â®** menu on the message bubble.\r 18823. Click **Share** when your browser supports sharing, or **Copy** to copy the text.\r 1883\r 1884**Share the full conversation**\r 1885\r 18861. Open **Chat**.\r 18872. Open the **More** menu (â®) in the header.\r 18883. Click **Export Chat** and download the conversation file to share.\r 1889\r 1890#### How to copy or share a message\r 1891\r 18921. In **Chat**, open the **â®** menu on a message bubble.\r 18932. Click **Copy** to copy text to the clipboard.\r 18943. Or click **Share** when your browser supports sharing.\r 1895\r 1896#### How to edit a user message and resend\r 1897\r 18981. In **Chat**, open the **â®** menu on your message.\r 18992. Click **Edit**.\r 19003. Change the text and save â the edited text is placed back in the input to send again.\r 1901\r 1902---\r 1903\r 1904### Documents\r 1905\r 1906#### How to upload a document\r 1907\r 19081. Open **Documents** (\`/documents/repository\`).\r 19092. In **Quick Upload**, drag files onto the drop zone or click to choose files from your computer.\r 19103. When prompted, assign the document to one or more **Groups**.\r 19114. Click upload / confirm.\r 19125. Wait for processing; status may show **Pending** until approved.\r 1913\r 1914#### How to search and filter documents\r 1915\r 19161. Open **Documents**.\r
19172. Use **Search documentsâ¦** to find files by name.\r 19183. Set **Status**, **Groups**, **Date From**, and **Date To** filters as needed.\r 19194. Review the filtered table or grid.\r 1920\r 1921#### How to preview a document\r 1922\r 19231. Open **Documents**.\r 19242. Find the document row.\r 19253. Click **Preview** (or the document name if it opens preview).\r 1926\r 1927#### How to download a document\r 1928\r 19291. Open **Documents**.\r 19302. Find the document.\r 19313. Click **Download** on the row actions menu.\r 1932\r 1933#### How to change a document's group\r 1934\r 19351. Open **Documents**.\r 19362. Find the document.\r 19373. Click **Change Group**.\r 19384. Select the new group(s) and confirm.\r 1939\r 1940#### How to delete a document\r 1941\r 19421. Open **Documents**.\r 19432. Find the document (you need delete permission).\r 19443. Click **Delete** and confirm.\r 1945\r 1946#### How to approve a pending document\r 1947\r 19481. Open **Documents** or **Pending Approvals** (\`/documents/pending\`).\r 19492. Find a document with **Pending** status.\r 19503. Click **Preview** if you need to review it first.\r 19514. Click **Approve**.\r 1952\r 1953#### How to reject a pending document\r 1954\r 19551. Open **Documents** or **Pending Approvals**.\r 19562. Find a **Pending** document.\r 19573. Click **Reject**.\r 19584. Enter a rejection reason and confirm.\r 1959\r 1960#### How to bulk approve documents\r 1961\r 19621. Open **Documents** (as a user with approve permission).\r 19632. Select multiple pending documents using the row checkboxes.\r 19643. Click **Approve** on the bulk actions toolbar.\r 19654. Confirm the approval.\r 1966\r 1967---\r 1968\r 1969### Groups\r 1970\r 1971#### How to create a group\r 1972\r 19731. Open **Groups** (\`/groups\`) as a Group Admin or Tenant Admin.\r 19742. Click **Create Group**.\r 19753. Enter **Group Name** and optional **Description**.\r 19764. Choose a **Parent group** or leave empty for a top-level group.\r 19775. Click **Create Group**.\r 1978\r 1979#### How to edit a group\r 1980\r 19811. Open **Groups**.\r 19822. Find the group in the table or grid.\r 19833. Click **Edit**.\r 19844. Update name, description, or parent group.\r 19855. Click **Save Changes**.\r 1986\r 1987#### How to delete a group\r 1988\r 19891. Open **Groups**.\r 19902. Find the group.\r 19913. Click **Delete**.\r 19924. Confirm deletion (note nested group warnings if shown).\r 1993\r 1994#### How to view members of a group\r 1995\r 19961. Open **Groups**.\r 19972. Find the group.\r 19983. Click **View Members**.\r 19994. Search by name, email, or role inside the members modal.\r 2000\r 2001#### How to add a member to a group\r 2002\r 20031. Open **Groups** â **View Members** for the group.\r 20042. Click **Add Member** (or open the add members dialog).\r 20053. Search for the user and select them.\r 20064. Confirm to add the member.\r 2007\r 2008#### How to make a member a group admin\r 2009\r 20101. Open **Groups** â **View Members**.\r 20112. Find the member.\r 20123. Click **Make group admin** (or equivalent action in the row menu).\r 2013\r 2014#### How to remove a member from a group\r 2015\r 20161. Open **Groups** â **View Members**.\r 20172. Find the member.\r 20183. Click **Remove member** and confirm.\r 2019\r 2020#### How to view groups you belong to\r 2021\r 20221. Open **Groups** (\`/groups\`) as a regular user.\r 20232. Review **My Group(s)** â expand nested groups with the arrow icons.\r 2024\r 2025---\r 2026\r 2027### Agent Apps\r 2028\r 2029#### How to open an Agent App\r 2030\r 20311. Open **Agent Apps** from the sidebar (\`/agent-apps\`).\r 20322. Search or browse **Advanced Agent Apps** and **Published Agents**.\r 20333. Click **Open** on the agent row to launch its workbench or chat panel.\r 2034\r 2035#### How to run an Agent App that requires documents\r 2036\r 20371. Open **Agent Apps**.\r 20382. Open an app showing **Requires documents** (or similar).\r 20393. Attach the required document(s) when prompted.\r 20404. Follow the appâs chat or workbench steps and send your request.\r 2041\r 2042#### How to enable or disable an agent (Tenant Admin)\r 2043\r 20441. Open **Agent Apps**.\r 20452. On a tenant-published agent card, open the card menu.\r 20463. Click **Enable** or **Disable** (or **Remove** when available).\r 2047\r 2048---\r 2049\r 2050### Favorites\r 2051\r 2052#### How to add a favorite prompt\r 2053\r 20541. Open **Favorites** (\`/favorites\`) or use **Chat**.\r 20552. Click **Add Favorite**.\r 20563. Enter **Title** and **Prompt** text.\r 20574. Save the favorite.\r 2058\r 2059#### How to use a favorite prompt\r 2060\r 20611. Open **Chat**.\r 20622. Click **Favorite Prompts** in the header (or open from the more menu on small screens).\r 20633. Search or browse your favorites.\r 20644. Click **Use prompt** on the favorite you want.\r 20655. Edit the text if needed, then click **Send**.\r 2066\r 2067#### How to edit a favorite prompt\r 2068\r 20691. Open **Favorites**.\r 20702. Find the favorite.\r 20713. Click **Edit**, change the title or prompt, and save.\r 2072\r 2073#### How to delete a favorite prompt\r 2074\r 20751. Open **Favorites**.\r 20762. Select one or more favorites.\r 20773. Click **Remove** or **Delete All** and confirm.\r 2078\r 2079---\r 2080\r 2081### Connectors (Tenant Admin / Group Admin)\r 2082\r 2083#### How to open Connectors\r 2084\r 20851. Open **Connectors** from the sidebar (\`/admin/connectors\`).\r 20862. Review the connectors list (name, access, status, scope).\r 2087\r 2088#### How to add a database connector\r 2089\r 20901. Open **Connectors**.\r 20912. Open the **Database** connector area (\`/admin/connectors/database\`).\r 20923. Click **Add connection** (or equivalent).\r 20934. Enter connection name, host, port, database, credentials, and settings.\r 20945. Click **Test connection**, then save.\r 20956. Use **Sync** when you are ready to index data for Chat.\r 2096\r 2097#### How to add a website connector\r 2098\r 20991. Open **Connectors** â **Website** (\`/admin/connectors/website\`).\r 21002. Click **Add connection**.\r 21013. Enter connection name, URL, and description.\r 21024. Save and run **Sync** if required.\r 2103\r 2104#### How to connect Google Drive or SharePoint\r 2105\r 21061. Open **Connectors** â **Cloud Drive** (\`/admin/connectors/cloud_drive\`).\r 21072. Choose **Google Drive** or **SharePoint / OneDrive**.\r 21083. Complete the OAuth sign-in and permission steps.\r 21094. Choose the target upload **Group**.\r 21105. Start **Sync** or import.\r 2111\r 2112#### How to run a bulk Google Drive or SharePoint sync\r 2113\r 21141. Open **Connectors** â **Google Drive bulk** or **SharePoint bulk**.\r 21152. Connect the provider if not already connected.\r 21163. Pick the folder, site, or drive to import.\r 21174. Assign an upload **Group** (required).\r 21185. Click **Start** or **Sync** and monitor job status (Uploaded / Failed / Skipped).\r 2119\r 2120#### How to view a connector sync report\r 2121\r 21221. Open **Connectors**.\r 21232. Find the connector row.\r 21243. Click **View Sync Report** (or open sync status from the row actions).\r 2125\r 2126---\r 2127\r 2128### User Management (Tenant Admin / Group Admin / Super Admin)\r 2129\r 2130Path: **Users** (\`/admin/users\`) \r 2131Page title: **User Management** â manage users, roles, and access permissions.\r 2132\r 2133**Who can do what**\r 2134\r 2135- **Tenant Admin**: full user list, **Add User**, **Pending Requests** tab, license card, suspend/activate (if Super Admin), resend/cancel invites\r 2136- **Group Admin / Super Group Admin**: invite and edit users in scoped groups (license pool may be read-only for SGA)\r 2137- **Platform Admin**: lock/unlock and delete/restore users (platform-level actions on the action menu)\r 2138\r 2139**Tabs**\r 2140\r 2141- **Users** â active users table or grid\r 2142- **Pending Requests** â pending invites and registration requests (Tenant Admin / Platform Admin)\r 2143\r 2144**License card (top of page)**\r 2145\r 2146- Shows total, active, and available licenses\r 2147- **Buy Licenses** or **Request more licenses** when seats run out\r 2148\r 2149---\r 2150\r 2151#### How to open User Management\r 2152\r 21531. Open **Users** from the sidebar (\`/admin/users\`).\r 21542. Review the **User Management** header and license card at the top.\r 21553. Use the **Users** or **Pending Requests** tab as needed.\r 2156\r 2157#### How to refresh the users list\r 2158\r 21591. Open **Users** (\`/admin/users\`).\r 21602. Click the **Refresh** icon in the page header.\r 2161\r 2162#### How to search users\r 2163\r 21641. Open **Users** â **Users** tab.\r 21652. Type in **Search users...**.\r 21663. Review the filtered table or grid results.\r 2167\r 2168#### How to filter users by role\r 2169\r 21701. Open **Users** â **Users** tab.\r 21712. Open the **Roles** filter.\r 21723. Select one or more roles: **User**, **Group Admin**, **Tenant Admin**, or **View Only**.\r 21734. Review the filtered list.\r 2174\r 2175#### How to switch between table and grid view for users\r 2176\r 21771. Open **Users** â **Users** tab.\r 21782. Click the **Table View** (â°) or **Grid View** (â) toggle above the list.\r 2179\r 2180#### How to view user details\r 2181\r 21821. Open **Users** â **Users** tab.\r 21832. Find the user row or card.\r 21843. Click the **â®** actions menu â **View Details**.\r
21854. Review name, email, role, groups, and status in the details dialog.\r 2186\r 2187#### How to invite a user (Add User)\r 2188\r 21891. Open **Users** (\`/admin/users\`).\r 21902. Confirm you have available licenses on the license card (if not, click **Buy Licenses** first).\r 21913. Click **Add User**.\r 21924. In the **Add User** dialog, enter **Email**, **First Name**, and **Last Name**.\r 21935. Select **User Role**: **User**, **Group Admin**, **View Only**, **Tenant Admin**, or **Super Group Admin** (options depend on your role).\r 21946. If required, use **Assign to Groups** to pick group(s) from the hierarchy picker.\r 21957. Click **Send Invitation**.\r 21968. The user receives an email invitation and appears as **Pending** until they accept.\r 2197\r 2198#### How to assign a View Only user\r 2199\r 22001. Open **Users** (\`/admin/users\`).\r 22012. To invite a new View Only user: click **Add User**, enter email and name, set **User Role** to **View Only**, assign groups if needed, then click **Send Invitation**.\r 22023. To change an existing user: open **â®** â **Edit** on the user row.\r 22034. Set **User Role** to **View Only**.\r 22045. Adjust groups if needed, then click **Save Changes**.\r 2205\r 2206#### How to invite a Super Group Admin\r 2207\r 22081. Open **Users** â **Add User**.\r 22092. Select **Super Group Admin** under **User Role**.\r 22103. Select at least one group in **Assign to Groups** (required; cannot overlap another Super Group Adminâs groups).\r 22114. Click **Send Invitation**.\r 2212\r 2213#### How to resend a user invitation\r 2214\r 22151. Open **Users** â **Pending Requests** tab (or find a **Pending** user on the **Users** tab).\r 22162. Click **Resend Invite** on the row (or open **â®** â **Resend Invite**).\r 22173. Confirm when prompted.\r 22184. A new invitation email is sent.\r 2219\r 2220#### How to cancel a user invitation\r 2221\r 22221. Open **Users** â **Pending Requests** tab (or find a pending user).\r 22232. Click **Cancel Invite** on the row (or open **â®** â **Cancel Invite**).\r 22243. Confirm cancellation.\r 22254. The invitation is cancelled and the license may be freed.\r 2226\r 2227#### How to edit a user\r 2228\r 22291. Open **Users** â **Users** tab.\r 22302. Click **â®** on the user row â **Edit**.\r 22313. In **Edit User**, update **First Name**, **Last Name**, **Email**, or **User Role** when permitted.\r 22324. Update group assignments using **Assign to Groups**, **Admin Groups**, or **Member Groups** as shown for your role.\r 22335. Click **Save Changes**.\r 2234\r 2235#### How to change a user's role\r 2236\r 22371. Open **Users** â **â®** â **Edit** on the user.\r 22382. Change **User Role** (User, Group Admin, View Only, Tenant Admin, or Super Group Admin).\r 22393. Adjust group assignments if the role requires groups.\r 22404. Click **Save Changes**.\r 2241\r 2242#### How to assign a user to groups when editing\r 2243\r 22441. Open **Users** â **â®** â **Edit** on the user.\r 22452. In **Assign to Groups** (or **Admin Groups** / **Member Groups** for tenant admins), select groups from the hierarchy picker.\r 22463. Click **Save Changes**.\r 2247\r 2248#### How to suspend a user (Super Admin only)\r 2249\r 22501. Open **Users** â **Users** tab as the main tenant **Super Admin**.\r 22512. Click **â®** on the user â **Suspend**.\r 22523. Enter a suspension reason in the reason dialog.\r 22534. Confirm to suspend the user.\r 2254\r 2255#### How to activate a suspended user (Super Admin only)\r 2256\r 22571. Open **Users** â **Users** tab as **Super Admin**.\r 22582. Click **â®** on the suspended user â **Activate**.\r 22593. Confirm activation (requires an available license if none are free).\r 2260\r 2261#### How to lock a user (Platform Admin)\r 2262\r 22631. Open **Users** as **Platform Admin**.\r 22642. Click **â®** on the user â **Lock**.\r 22653. The user account is locked.\r 2266\r 2267#### How to unlock a user (Platform Admin)\r 2268\r 22691. Open **Users** as **Platform Admin**.\r 22702. Click **â®** on the locked user â **Unlock**.\r 2271\r 2272#### How to delete a user (Platform Admin)\r 2273\r 22741. Open **Users** as **Platform Admin**.\r 22752. Click **â®** on the user â **Delete**.\r 22763. Confirm deletion in the dialog.\r 2277\r 2278#### How to restore a deleted user (Platform Admin)\r 2279\r 22801. Open **Users** as **Platform Admin**.\r 22812. Find the user with **Deleted** status.\r 22823. Click **â®** â **Restore**.\r 2283\r 2284#### How to view pending requests\r 2285\r 22861. Open **Users** (\`/admin/users\`).\r 22872. Click the **Pending Requests** tab.\r 22883. Review pending invites and registration requests with status chips.\r 2289\r 2290#### How to approve a registration request\r 2291\r 22921. Open **Users** â **Pending Requests**.\r 22932. Find a registration request (not a simple pending invite).\r 22943. Click **Approve** (checkmark icon).\r 22954. In the approval dialog, choose **Role** (User, Group Admin, View Only, or Tenant Admin).\r 22965. Assign **Groups** when required for the role.\r 22976. Confirm approval (requires an available license).\r 2298\r 2299#### How to reject a registration request\r 2300\r 23011. Open **Users** â **Pending Requests**.\r 23022. Find the registration request.\r 23033. Click **Reject** (X icon).\r 23044. Enter a rejection reason and confirm.\r 2305\r 2306#### How to view details of a pending request\r 2307\r 23081. Open **Users** â **Pending Requests**.\r 23092. Click **View Details** (eye icon) on the row.\r 23103. Review the request information in the dialog.\r 2311\r 2312#### How to buy more licenses from User Management\r 2313\r 23141. Open **Users** (\`/admin/users\`).\r 23152. On the **License Pool** card, click **Buy Licenses** (Tenant Admin; hidden on free/trial plans).\r 23163. Continue with the **Purchase Additional Licenses** steps below.\r 2317\r 2318#### How to purchase licenses when the license pool is empty\r 2319\r 23201. Open **Users** (\`/admin/users\`).\r 23212. On the **License Pool** card, read the **No licenses available** alert.\r 23223. Click **Buy Licenses Now**.\r
23234. Continue with the **Purchase Additional Licenses** steps below.\r 2324\r 2325#### How to purchase licenses when adding a user fails (no seats)\r 2326\r 23271. Open **Users** â click **Add User**.\r 23282. If a limit dialog appears, click **Buy Licenses** (paid plan) or **Subscribe** (free/trial plan).\r 23293. For **Buy Licenses**, continue with the **Purchase Additional Licenses** steps below.\r 23304. After payment succeeds, return to **Users** â **Refresh** â **Add User** again.\r 2331\r 2332---\r 2333\r 2334### Purchase Licenses (Tenant Admin)\r 2335\r 2336Who: **Tenant Admin** on a paid subscription plan. Free/trial plans must **Subscribe** first (\`/subscription\`) before purchasing licenses.\r 2337\r 2338**Where you can start**\r 2339\r 2340| Location | Button |\r 2341|----------|--------|\r 2342| **Users** (\`/admin/users\`) â License Pool card | **Buy Licenses** or **Buy Licenses Now** |\r 2343| **Subscription** (\`/subscription\`) | **Buy More Licenses** |\r 2344| **Users** â **Add User** (no seats left) | **Buy Licenses** in the limit dialog |\r 2345\r 2346#### How to purchase additional licenses\r 2347\r 23481. Open **Users** or **Subscription** as a Tenant Admin.\r 23492. Click **Buy Licenses**, **Buy Licenses Now**, or **Buy More Licenses**.\r 23503. In **Purchase Additional Licenses**, review **Current Plan**, price per license, and license counts (total, active, available).\r 23514. Under **How many licenses do you need?**, enter the number of licenses (minimum **1**).\r 23525. Review **Billing Cycle** (Monthly or Annual) and the **Cost Summary**:\r 2353 - Base price (quantity à price per license)\r 2354 - Prorated charge for days remaining in the current cycle\r 2355 - **Due Today (Prorated)**\r 2356 - **Next billing** amount for the new licenses\r 23576. Click **Purchase for $X.XX** (or your currency equivalent).\r 23587. Wait for **Processing...** â you are redirected to **Stripe** checkout.\r 23598. On Stripe, enter payment details and complete checkout.\r 23609. After payment, you are returned to the page you started from (for example **Users** or **Subscription**) with a success status.\r 236110. Confirm **Purchase Successful!** or a success toast, then click **Refresh** on the **License Pool** card to see updated **Total**, **Active**, and **Available** license counts.\r 236211. You can now **Add User** or **Approve** pending requests that require a license.\r 2363\r 2364#### How to purchase licenses from the Subscription page\r 2365\r 23661. Click your **avatar** â **Subscription**, or open **Subscription** (\`/subscription\`).\r 23672. In the license section, click **Buy More Licenses**.\r 23683. Follow steps 3â11 in **How to purchase additional licenses** above.\r 23694. After payment you return to **Subscription** with updated license counts.\r 2370\r 2371#### How to purchase licenses from User Management\r 2372\r 23731. Open **Users** (\`/admin/users\`).\r 23742. On the **License Pool** card header, click **Buy Licenses** (or **Buy** on narrow screens).\r 23753. Follow steps 3â11 in **How to purchase additional licenses** above.\r 23764. After payment you return to **Users** â click **Refresh** on the license card, then invite users.\r 2377\r 2378#### How to cancel a license purchase\r 2379\r 23801. In **Purchase Additional Licenses**, click **Cancel** before paying (closes the dialog).\r 23812. If already on Stripe checkout, cancel or use the browser back button â you return with payment cancelled and no licenses are added.\r 23823. If payment was cancelled, open **Buy Licenses** again when ready to retry.\r 2383\r 2384#### How to refresh license counts after purchasing\r 2385\r 23861. Open **Users** or **Subscription**.\r 23872. On the **License Pool** card, click the **Refresh** icon.\r 23883. Confirm **Total Licenses**, **Active Users**, and **Available** updated after your purchase.\r 2389\r 2390#### How to purchase licenses on a free or trial plan\r 2391\r 23921. Open **Users** or **Subscription**.\r 23932. If you see **Free Plan Limit Reached** or **Subscribe**, click **Subscribe**.\r 23943. Complete subscription signup and payment on **Subscription** (\`/subscription\`).\r 23954. After you have a paid plan, use **Buy Licenses** or **Buy More Licenses** to add seats.\r 2396\r 2397#### How to request more licenses (Super Group Admin â cannot purchase)\r 2398\r 23991. Open **Users** as **Super Group Admin** (purchase button may be hidden).\r 24002. On the license card, click **Request more licenses**.\r 24013. Submit the request â your **Tenant Admin** purchases licenses using the flows above.\r 2402\r 2403#### How to handle âNo Users Foundâ\r 2404\r 24051. Open **Users** â **Users** tab.\r 24062. If filters are active, clear **Search users...** and **Roles** filters.\r 24073. If the list is still empty and you are an admin, click **Add User** to invite your first teammate.\r 2408\r 2409---\r 2410\r 24111. Open **Users** â **Users** tab.\r 24122. If filters are active, clear **Search users...** and **Roles** filters.\r 24133. If the list is still empty and you are an admin, click **Add User** to invite your first teammate.\r 2414\r 2415---\r 2416\r 2417### Chat Settings (Tenant Admin)\r 2418\r 2419#### How to lock strict mode for all users\r 2420\r 24211. Open **Chat Settings** (\`/admin/chat-settings\`) as a Tenant Admin.\r 24222. In **Strict Mode**, set the default **Strict mode** switch on or off.\r 24233. Check **Lock strict mode for all users** so users cannot change it.\r 24244. Click **Save**.\r 2425\r 2426#### How to lock presets for all users\r 2427\r 24281. Open **Chat Settings** (\`/admin/chat-settings\`) as a Tenant Admin.\r 24292. In **Response Styles**, set the **Default Preset** and any tone, length, or detail options.\r 24303. Check **Lock preset for all users** so users cannot switch presets.\r 24314. Click **Save**.\r 2432\r 2433#### How to lock document settings for all users\r 2434\r 24351. Open **Chat Settings** (\`/admin/chat-settings\`) as a Tenant Admin.\r 24362. In **Document Settings**, set **Document Scope** and **Citation Style**.\r 24373. Check **Lock document settings for all users** so users cannot change them.\r 24384. Click **Save**.\r 2439\r 2440#### How to lock content preferences for all users\r 2441\r 24421. Open **Chat Settings** (\`/admin/chat-settings\`) as a Tenant Admin.\r 24432. In **Content Preferences**, set **Format Preference** and any display options.\r 24443. Check **Lock content preferences for all users** so users cannot change them.\r 24454. Click **Save**.\r 2446\r 2447#### How to lock additional instructions for all users\r 2448\r 24491. Open **Chat Settings** (\`/admin/chat-settings\`) as a Tenant Admin.\r 24502. In **Additional Instructions**, enter the default custom instructions text.\r 24513. Check **Lock additional instructions for all users** so users cannot edit them.\r 24524. Click **Save**.\r 2453\r 2454#### How to set organization response presets\r 2455\r 24561. Open **Chat Settings**.\r 24572. Open **Response presets**.\r 24583. Set Default Preset, Tone & Style, Response Length, Detail Level, and Preferred Language.\r 24594. Use **Lock** and **Show in chat** as needed.\r 24605. Click **Save**.\r 2461\r 2462#### How to set document scope and citation style for the organization\r 2463\r 24641. Open **Chat Settings**.\r 24652. Open **Document Settings**.\r 24663. Set **Document Scope** and **Citation Style**.\r 24674. Lock or show in chat as needed.\r 24685. Click **Save**.\r 2469\r 2470#### How to set a fallback response message\r 2471\r 24721. Open **Chat Settings**.\r 24732. Open **Fallback Response Message**.\r 24743. Enter the custom âI donât knowâ / fallback text.\r 24754. Click **Save**.\r 2476\r 2477---\r 2478\r 2479### Models (Tenant Admin)\r 2480\r 2481#### How to add a cloud model\r 2482\r 24831. Open **Models** (\`/admin/models\`).\r 24842. Click **Add model**.\r 24853. Enter Provider, Display name, Cloud model name, and API key.\r 24864. Set **Active** and save.\r 2487\r 2488#### How to edit or delete a model\r 2489\r 24901. Open **Models**.\r 24912. Find the model row.\r 24923. Click **Edit** to update fields, or **Delete** and confirm removal.\r 2493\r 2494---\r 2495\r 2496### Analytics and Audit Logs\r 2497\r
2498#### How to view analytics\r 2499\r 25001. Open **Analytics** (\`/analytics\`) as Group Admin or Tenant Admin.\r 25012. Review overview cards: documents, storage, groups, favorites, chat sessions, and recent activity.\r 2502\r 2503#### How to search audit logs\r 2504\r 25051. Open **Audit Logs** (\`/admin/audit-logs\`).\r 25062. Use **Search** by user, action, or resource.\r 25073. Apply **Groups** / **Users** filters.\r 25084. Click **Refresh** or **Clear filters** as needed.\r 2509\r 2510---\r 2511\r 2512### Profile and notifications\r 2513\r 2514#### How to edit your profile\r 2515\r 25161. Open **Profile** (\`/profile\`) from the avatar menu.\r 25172. Click **Edit Profile**.\r 25183. Update your details and save.\r 2519\r 2520#### How to change your password\r 2521\r 25221. Open **Profile**.\r 25232. Click **Change Password**.\r 25243. Enter current and new passwords, then save.\r 2525\r 2526#### How to change email notification settings\r 2527\r 25281. Open **Profile**.\r 25292. Toggle the notification switches (for example Password Changes, Document Rejection, Subscription Updated).\r 25303. Save if a save button is shown.\r 2531\r 2532---\r 2533\r 2534### Subscription (Tenant Admin)\r 2535\r 2536#### How to view your subscription plan\r 2537\r 25381. Click your **avatar** â **Subscription**, or open **Subscription** (\`/subscription\`).\r 25392. Review **Current Plan**, license counts, and renewal details.\r 2540\r 2541#### How to upgrade or buy licenses\r 2542\r 25431. Open **Subscription** (\`/subscription\`).\r 25442. Click **Buy More Licenses** to open **Purchase Additional Licenses**.\r 25453. Follow the full **Purchase Licenses** flow in Section 26 (enter quantity â **Purchase for $X.XX** â complete Stripe â refresh license pool).\r 2546\r 2547#### How to add a user when no licenses are available\r 2548\r 25491. Open **Users** â **Add User**.\r 25502. If no licenses are available, click **Buy Licenses** in the limit dialog (or **Subscribe** on free/trial).\r 25513. Complete the **Purchase Licenses** flow, then **Refresh** and **Add User** again.\r 2552\r 2553#### How to download an invoice\r 2554\r 25551. Open **Subscription** (\`/subscription\`).\r 25562. Find the row in the invoice / billing history section.\r 25573. Click **Download** on the invoice.\r 2558\r 2559---\r 2560\r 2561### Support, tour, and help\r 2562\r 2563#### How to contact support\r 2564\r 25651. Click **Support** in the top bar.\r 25662. Submit your request through the external support / ticket page that opens.\r 2567\r 2568#### How to log a support ticket\r 2569\r 25701. Click **Support** in the top bar.\r 25712. Fill out and submit the form on the external support / ticket page that opens.\r 2572\r 2573#### How to use the OPAI Assistant\r 2574\r 25751. Click the floating **help** icon (on Chat it appears above the input; elsewhere on the right).\r 25762. Type a **how to** question (for example âHow do I upload a document?â).\r 25773. Read the numbered steps in the reply.\r 25784. Click **Close** when finished.\r 2579\r 2580#### How to start the OpenParser product tour\r 2581\r 25821. Click your **avatar** in the top bar.\r 25832. Click **OpenParser Tour** (not shown for Platform Admins).\r 25843. Use **Next**, **Back**, **Skip Tour**, or **Finish** to complete the walkthrough.\r 2585\r 2586#### How to switch dark mode on or off\r 2587\r 25881. Click the **dark mode** toggle in the top bar to switch to dark mode.\r 25892. Click the toggle again to return to light mode.\r 2590\r 2591#### How to switch dark mode\r 2592\r 25931. Click the **dark mode** toggle in the top bar.\r 25942. Click again to return to light mode.\r 2595\r 2596#### How to read Terms or Privacy from the app\r 2597\r 25981. Scroll to the sidebar footer.\r 25992. Click **Terms & Conditions** or **Privacy Policy**.\r 2600\r 2601---\r 2602\r 2603### Common help questions\r 2604\r 2605These flows match the most common OPAI Assistant questions. Ask using **How do Iâ¦** or **How toâ¦** wording.\r 2606\r 2607#### How to create or edit a chat\r 2608\r 2609**Create a new chat**\r 2610\r 26111. Open **Chat** from the sidebar (\`/chat\`).\r 26122. In the conversations sidebar, click **New Chat**.\r 26133. Type your first message or attach sources before asking.\r 2614\r 2615**Rename an existing chat**\r 2616\r 26171. Open **Chat**.\r 26182. In the conversations sidebar, open the **â®** menu on the session.\r 26193. Click **Rename**.\r 26204. Enter the new name and save.\r 2621\r 2622#### How to use response styles in Chat\r 2623\r 26241. Open **Chat**.\r 26252. Click **Response Style** in the chat header.\r 26263. Choose tone, length, detail, or language options that are not locked by your organization.\r 26274. Click **Save** or close the panel to apply the style to your messages.\r 2628\r 2629#### How to use voice conversation in Chat\r 2630\r 26311. Open **Chat**.\r 26322. Click the **microphone** icon in the message input to start voice conversation.\r 26333. Speak your question, then stop recording.\r 26344. Review the transcribed text and click **Send**.\r 26355. Optional: click the **speaker** icon on the assistant reply to hear the answer read aloud.\r 2636\r 2637#### How to export a chat from the header\r 2638\r 26391. Open **Chat**.\r 26402. Open the **More** menu (â®) in the header.\r 26413. Click **Export Chat** and choose the export format to download.\r 2642\r 2643#### How to share a chat from Chat\r 2644\r 26451. Open **Chat** and find the message you want to share.\r 26462. Click the **â®** menu on the message bubble.\r
26473. Click **Share** or **Copy** to share that message text.\r 26484. To share the full conversation, use **Export Chat** from the header **More** menu.\r 2649\r 2650#### How to change models in Chat\r 2651\r 26521. Open **Chat**.\r 26532. In the message input toolbar, open the **model** dropdown (it may show **Default** or the current model name).\r 26543. Select the model you want to use.\r 26554. Send your message â replies use the selected model (when your tenant has models configured).\r 2656\r 2657#### How to turn strict mode on or off in Chat\r 2658\r 26591. Open **Chat**.\r 26602. Find the **Strict** switch in the chat header.\r 26613. Turn it **on** to prefer answers grounded in your attached sources.\r 26624. Turn it **off** for broader answers (when your organization has not locked strict mode in **Chat Settings**).\r 2663\r 2664#### How to use an Agent App\r 2665\r 26661. Open **Agent Apps** from the sidebar (\`/agent-apps\`).\r 26672. Browse **Advanced Agent Apps** or **Published Agents**.\r 26683. Click **Open** on the agent you want.\r 26694. Attach required documents or sources when prompted.\r 26705. Follow the agent panel instructions and send your request in the agent chat.\r 2671\r 2672#### How to add or edit a favorite prompt\r 2673\r 2674**Add a favorite**\r 2675\r 26761. Open **Favorites** (\`/favorites\`) or **Chat**.\r 26772. Click **Add Favorite** (on Favorites) or **Save as favorite** (star icon in Chat).\r 26783. Enter a **Title** and **Prompt**.\r 26794. Click **Save**.\r 2680\r 2681**Edit a favorite**\r 2682\r 26831. Open **Favorites**.\r 26842. Find the favorite in the list.\r 26853. Click **Edit**.\r 26864. Update the title or prompt text and save.\r 2687\r 2688#### How to use a favorite prompt in Chat\r 2689\r 26901. Open **Chat**.\r 26912. Click **Favorite Prompts** in the header (or open it from the more menu on small screens).\r 26923. Search or browse your favorites.\r 26934. Click **Use prompt** on the favorite you want.\r 26945. Edit the text if needed, then click **Send**.\r 2695\r 2696#### How to add a favorite prompt for all users\r 2697\r 26981. Open **Favorites** (\`/favorites\`).\r 26992. Click **Add Favorite**.\r 27003. Enter **Title** and **Prompt**.\r 27014. Check **Available for all users**.\r 27025. Click **Save** â the favorite is shared with everyone in your tenant.\r 2703\r 2704#### How to approve a document\r 2705\r 27061. Open **Documents** (\`/documents/repository\`) or **Pending Approvals** (\`/documents/pending\`).\r 27072. Find a document with **Pending** status.\r 27083. Optional: click **Preview** to review the file.\r 27094. Click **Approve**.\r 2710\r 2711#### How to reject a document\r 2712\r 27131. Open **Documents** or **Pending Approvals**.\r 27142. Find a **Pending** document.\r 27153. Click **Reject**.\r 27164. Enter a rejection reason and confirm.\r 2717\r 2718#### How to view a document\r 2719\r 27201. Open **Documents** (\`/documents/repository\`).\r 27212. Use **Search documentsâ¦** or filters to find the file.\r 27223. Click **Preview** (or the document name if it opens preview).\r 27234. Review the document in the preview panel and close when finished.\r 2724\r 2725#### How to change a document's group\r 2726\r 27271. Open **Documents**.\r 27282. Find the document in the table or grid.\r 27293. Click **Change Group**.\r 27304. Select the new group(s) and confirm.\r 2731\r 2732#### How to create a group\r 2733\r 27341. Open **Groups** (\`/groups\`) as a Group Admin or Tenant Admin.\r 27352. Click **Create Group**.\r 27363. Enter **Group Name** and optional **Description**.\r 27374. Choose a **Parent group** or leave empty for a top-level group.\r 27385. Click **Create Group**.\r 2739\r 2740#### How to edit a group\r 2741\r 27421. Open **Groups**.\r 27432. Find the group in the table or grid.\r 27443. Click **Edit**.\r 27454. Update the name, description, or parent group.\r 27465. Save your changes.\r 2747\r 2748#### How to remove a member from a group\r 2749\r 27501. Open **Groups**.\r 27512. Click **View Members** on the group.\r 27523. Find the member in the list.\r 27534. Click **Remove** (or the remove action in the row menu) and confirm.\r 2754\r 2755#### How to add a cloud model (Tenant Admin)\r 2756\r 27571. Open **Models** (\`/admin/models\`).\r 27582. Click **Add model**.\r 27593. Enter **Provider**, **Display name**, **Cloud model name**, and **API key**.\r 27604. Set **Active** and save.\r 27615. The model can then appear in the Chat model dropdown.\r 2762\r 2763#### How to change your password\r 2764\r 27651. Open **Profile** (\`/profile\`) from your avatar menu.\r 27662. Click **Change Password**.\r 27673. Enter your current password and new password.\r 27684. Save your changes.\r 2769\r 2770#### How to reset a forgotten password\r 2771\r 27721. On **Login**, click **Forgot password?**\r 27732. Enter your account email and submit.\r 27743. Open the reset link from your email.\r 27754. On **Reset password**, enter **New password** and **Confirm password**.\r 27765. Follow the password strength checklist, then sign in again.\r 2777\r 2778#### How to change your profile picture\r 2779\r 27801. Open **Profile** (\`/profile\`) from your avatar menu.\r 27812. Click **Edit Profile**.\r 27823. Click the profile image area or **Upload** to choose a photo (image file, max 5MB).\r 27834. Adjust other profile fields if needed.\r 27845. Click **Save** to upload the new picture.\r 2785\r 2786#### What file types are supported for upload?\r 2787\r 27881. Open **Documents** â **Quick Upload** (or the upload area on the repository page).\r 27892. Supported types include **PDF**, **DOCX**, **PPTX**, **XLSX**, **CSV**, **TXT**, **HTML**, **MD**, **RTF**, **ODT**, and **ODS** (your tenant admin may restrict the list in platform settings).\r
27903. If a file is rejected, check the extension and try a supported format.\r 2791\r 2792#### What is the maximum file size for upload?\r 2793\r 27941. Open **Documents** and use **Quick Upload** or drag files into the upload area.\r 27952. Size limits depend on file type: **2MB** for CSV/TSV/ODS; **5MB** for HTML/MD/TXT; **12MB** for XLSX; **20MB** for ODT/RTF/DOCX/PPTX; **50MB** for PDF (tenant settings may set a lower platform cap).\r 27963. If upload fails for size, compress or split the file, or ask your tenant admin about limits.\r 2797\r 2798#### Can I drag and drop files to upload?\r 2799\r 28001. Open **Documents** (\`/documents/repository\`).\r 28012. Use **Quick Upload** â drag files into **Drop Files Here** or choose from your local folder.\r 28023. Assign the document to one or more **Groups** when prompted, then wait for processing/approval.\r 2803\r 2804#### Why is my document pending approval?\r 2805\r 28061. After upload, documents often start in **Pending** status until an approver reviews them.\r 28072. Regular users usually upload for approval; **Group Admins** and **Tenant Admins** can a
2807pprove when permitted.\r 28083. Open **Documents** or **Pending Approvals** to check status, or contact your group/tenant admin if it stays pending.\r 2809\r 2810#### Who can approve my documents?\r 2811\r 28121. **Group Admins** and **Tenant Admins** can approve documents when your organization allows it.\r 28132. Regular users typically upload as **Pending** until an approver acts.\r 28143. Open **Pending Approvals** (\`/documents/pending\`) if you have approval permissions; otherwise ask your admin.\r 2815\r 2816#### Why do I need to provide a reason for rejection?\r 2817\r 28181. When you **Reject** a document, the uploader needs a clear reason to fix or resubmit the file.\r 28192. Open **Documents** or **Pending Approvals**, click **Reject**, enter the reason, and confirm.\r 28203. The uploader may receive a notification showing the rejection reason.\r 2821\r 2822#### How to check your license pool\r 2823\r 28241. Open **Users** (\`/admin/users\`) as a **Tenant Admin**.\r 28252. Review the **License Pool** card at the top (Total, Active, and Available licenses).\r 28263. Click the **Refresh** icon on the card to update counts after purchases or user changes.\r 2827\r 2828#### How to upgrade your subscription\r 2829\r 28301. Open **Subscription** (\`/subscription\`) as a **Tenant Admin**.\r 28312. Review **Current Plan** and available upgrade options.\r 28323. Click **Upgrade**, **Buy More Licenses**, or the plan action shown for your account and complete checkout.\r 2833\r 2834#### How to cancel your subscription\r 2835\r 28361. Open **Subscription** (\`/subscription\`) as a **Tenant Admin**.\r 28372. Find **Cancel Subscription** on your current plan card.\r 28383. Click **Cancel Subscription**, optionally enter a reason, and confirm â access usually continues until the end of the current billing period.\r 2839\r 2840#### How to view billing history\r 2841\r 28421. Open **Subscription** (\`/subscription\`) as a **Tenant Admin**.\r 28432. Scroll to the invoice / billing history section.\r 28443. Review past charges and use **Download** on a row to save an invoice PDF.\r 2845\r 2846#### How to disconnect Google Drive\r 2847\r 28481. Open **Connectors** â **Google Drive bulk** (\`/admin/connectors/cloud_drive\` or the Google Drive bulk connector).\r 28492. Find the Google Drive connection row.\r 28503. Open the row menu and choose **Remove** / **Disconnect**, or use **auth disconnect** if shown, then confirm.\r 2851\r 2852#### How to process files from Google Drive\r 2853\r 28541. Open **Connectors** â **Google Drive bulk**.\r 28552. Connect Google Drive if needed and choose the folder to import.\r 28563. Assign an upload **Group**, then click **Start** or **Sync** and monitor Uploaded / Failed / Skipped status.\r 2857\r 2858#### How to connect SharePoint\r 2859\r 28601. Open **Connectors** â **SharePoint bulk** or **Cloud Drive** (\`/admin/connectors/cloud_drive\`).\r 28612. Choose **SharePoint / OneDrive** and complete the OAuth sign-in.\r 28623. Save the connection and pick the target site or folder in the connector setup.\r 2863\r 2864#### How to select a site or folder from SharePoint\r 2865\r 28661. Open **Connectors** â **SharePoint bulk** (or edit an existing SharePoint connection).\r 28672. After OAuth sign-in, use **Browse** / folder picker to choose the site, library, or folder.\r 28683. Assign an upload **Group** and save the configuration.\r 2869\r 2870#### How to disconnect SharePoint\r 2871\r 28721. Open **Connectors** â **SharePoint bulk** or the SharePoint connection list.\r 28732. Find the SharePoint connection.\r 28743. Open the row menu â **Remove** / **Disconnect** (or auth disconnect) and confirm.\r 2875\r 2876#### How to process files from SharePoint\r 2877\r 28781. Open **Connectors** â **SharePoint bulk**.\r 28792. Ensure SharePoint is connected and the correct site or folder is selected for file import.\r 28803. Assign a **Group**, click **Start** or **Sync** to process files, and review the sync job report.\r 2881\r 2882#### How to sync new connector files\r 2883\r 28841. Open **Connectors** and select the Google Drive or SharePoint bulk connector.\r 28852. Open the connectionâs job/status panel.\r 28863. Click **Sync ** to import new files and retry failed items without a full re-download.\r 2887\r 2888#### How to reprocess failed connector files\r 2889\r 28901. Open **Connectors** â the bulk Google Drive or SharePoint connector.\r 28912. Open **View Sync Report** or the job status dialog for the connection.\r 28923. Review **Failed** items, fix access or quota issues if needed, then run **Sync** again.\r 2893\r 2894#### How to test a database connection\r 2895\r 28961. Open **Connectors** â **Database** (\`/admin/connectors/database\`).\r 28972. Click **Add connection** or **Edit** on an existing connection.\r 28983. Enter host, port, database, and credentials, then click **Test connection** before saving.\r 2899\r 2900#### How to edit a database connection\r 2901\r 29021. Open **Connectors** â **Database**.\r 29032. Find the connection row and click **Edit**.\r 29043. Update settings (host, credentials, row limit, data dictionary), test if needed, and save.\r 2905\r 2906#### How to delete a database connection\r 2907\r 29081. Open **Connectors** â **Database**.\r 29092. Find the connection you want to remove.\r 29103. Click **Delete** / **Remove** on the row and confirm â this stops Chat from using that connection.\r 2911\r 2912#### What database types are supported?\r 2913\r 29141. Open **Connectors** â **Database** â **Add connection**.\r 29152. In **Database type**, choose from the types your tenant offers (commonly **PostgreSQL**, **MySQL**, and **MSSQL**).\r 29163. Enter the matching host, port, and credentials for that engine, then test and save.\r 2917\r 2918---\r 2919\r 2920### Quick workflow cheat sheets\r 2921\r 2922#### Ask about a PDF\r 2923\r 29241. **Documents** â **Quick Upload** â assign group â wait for processing/approval\r 29252. **Chat** â **New Chat** â **Select documents** â attach document â ask\r 2926\r 2927#### Ask about a department set of files\r 2928\r 29291. Confirm the **Group** has the right documents in **Groups** / **Documents**\r 29302. **Chat** â **Select groups** â attach group â ask\r 2931\r 2932#### Approve uploads\r 2933\r 29341. **Documents** â **Pending Approvals** or pending filter\r 29352. **Preview** â **Approve** or **Reject** with reason\r 2936\r 2937#### Save a reusable prompt\r 2938\r 29391. **Favorites** â **Add Favorite**, or **Save as favorite** from Chat\r 29402. Later: **Favorite Prompts** â **Use prompt**\r 2941\r 2942#### Invite a teammate\r 2943\r 29441. **Users** â confirm licenses on the license card â **Add User**\r 29452. Enter email, name, role, and groups â **Send Invitation**\r 29463. Track **Pending Requests** until the user accepts\r 2947\r 2948#### Manage a pending invite\r 2949\r 29501. **Users** â **Pending Requests**\r 29512. **Resend Invite** or **Cancel Invite** as needed\r 2952\r 2953#### Approve a self-registration request\r 2954\r 29551. **Users** â **Pending Requests**\r 29562. **Approve** â choose role and groups â confirm\r 2957\r 2958#### Buy licenses before adding users\r 2959\r 29601. **Users** â **License Pool** â **Buy Licenses**\r 29612. **Purchase Additional Licenses** â enter quantity â **Purchase for $X.XX**\r 29623. Complete Stripe checkout â **Refresh** â **Add User**\r 2963\r 2964---\r 2965\r 2966## 27. Glossary\r 2967\r 2968| Term | Meaning |\r 2969|------|---------|\r 2970| **Source** | Document, group, database, or website selected to ground Chat answers |\r 2971| **Strict mode** | Prefer answers grounded in selected sources |\r 2972| **Agent App** | Dedicated workflow/chat for a specialized task |\r 2973| **Favorite prompt** | Saved reusable prompt text |\r 2974| **Group** | People + document access boundary |\r
2975| **Connector** | Link to an external content or data system |\r 2976| **Tenant** | Your organization workspace |\r 2977| **Pending document** | Uploaded file waiting approval/processing |\r 2978| **Citation / source chip** | Reference to material used in an answer |\r 2979| **MFA** | Multi-factor authentication code verification |\r 2980| **SSO** | Sign in through Google/Microsoft (or similar) |\r 2981| **Terms Acceptance** | Required acknowledgment of Terms and Privacy before using the app |\r 2982| **Platform Admin** | Operator of the overall OpenParser platform, not a tenant end user |\r 2983\r 2984---\r 2985\r 2986*End of OpenParser AI user help knowledge base.*\r 2987`,termsMarkdown=`# OpenParser AI SaaS Terms and Conditions (Master Subscription Agreement)\r 2988\r 2989Provider: Innovatix Technology Partners\r 2990Effective Date: 9/23/2026\r 2991Public page: /terms\r 2992Contact: [email protected]\r 2993\r 2994Table of Contents\r 2995 \r 2996 - 1. Parties and Acceptance\r 2997\r 2998 - 2. Definitions\r 2999\r 3000 - 3. Subscription; Account Administration\r 3001\r 3002 - 4. Use Restrictions; Acceptable Use\r 3003\r 3004 - 5. Service; Availability; Changes\r 3005\r 3006 - 6. Customer Content; Data Rights\r 3007\r 3008 - 7. AI Features; Outputs; Human Review\r 3009\r 3010 - 8. Security; Incident Response\r 3011\r 3012 - 9. Support; Maintenance\r 3013\r 3014 - 10. Fees; Payment; Taxes\r 3015\r 3016 - 11. Suspension\r 3017\r 3018 - 12. Confidentiality\r 3019\r 3020 - 13. Intellectual Property; Feedback\r 3021\r 3022 - 14. Third-Party Services; Open Source\r 3023\r 3024 - 15. Compliance; Export; Sanctions\r 3025\r 3026 - 16. Term; Renewal; Termination\r 3027\r 3028 - 17. Warranties; Disclaimers\r 3029\r 3030 - 18. Indemnification\r 3031\r 3032 - 19. Limitation of Liability\r 3033\r 3034 - 20. Dispute Resolution; Governing Law\r 3035\r 3036 - 21. Changes to the Agreement\r 3037\r 3038 - 22. Miscellaneous\r 3039\r 3040 - Exhibits and Policies\r 3041\r 3042 \r 3043 \r 3044\r 3045 \r 3046 \r 3047## 1. Parties and Acceptance\r 3048\r 3049 \r 3050This Agreement is between Provider and Customer. If Customer is accepting on behalf of an organization, Customer represents it has authority to bind that organization and its Authorized Users.\r 3051\r 3052 \r 3053**Order of precedence.** If there is a conflict among the Order Form, an amendment, this Agreement, and any Documentation or policies, the following order controls: (1) Order Form, (2) signed amendment, (3) this Agreement, (4) Documentation and policies.\r 3054\r 3055 \r 3056**Electronic acceptance.** Customer agrees that electronic acceptance, including click-through acceptance and electronic signatures, is legally binding.\r 3057\r 3058 \r 3059\r 3060 \r 3061 \r 3062## 2. Definitions\r 3063\r 3064 \r 3065 - **"Affiliate"** means an entity that controls, is controlled by, or is under common control with a party.\r 3066\r 3067 - **"Authorized Users"** means Customer's employees, contractors, and agents who are authorized by Customer to access and use the Service under Customer's subscription.\r 3068\r 3069 - **"Customer Content"** means documents, files, data, prompts/inputs, and other materials submitted to or processed through the Service by or for Customer.\r 3070\r 3071 - **"Documentation"** means Provider's then-current user guides, technical documentation, and policies relating to the Service.\r 3072\r 3073 - **"Order Form"** means an ordering document or online checkout that references this Agreement and identifies the subscription plan, usage limits (if any), fees, and Subscription Term.\r 3074\r 3075 - **"Outputs"** means responses, summaries, extractions, classifications, analytics, recommendations, or other results generated by the Service (including AI-enabled features) from Customer Content and/or inputs.\r 3076\r 3077 - **"Provider Technology"** means the Service, software, models, algorithms, interfaces, configurations, templates, and other technology provided by Provider, excluding Customer Content.\r 3078\r 3079 - **"Security Incident"** means a confirmed unauthorized access to Customer Content in Provider's possession or control.\r 3080\r 3081 - **"Subscription Term"** means the subscription period stated in the Order Form.\r 3082\r 3083 - **"Usage Data"** means telemetry and operational data about use of the Service that does not intentionally include Customer Content and does not identify Customer's documents (e.g., feature usage, performance, reliability, and security signals).\r 3084\r 3085 \r 3086 \r 3087\r 3088 \r 3089 \r 3090## 3. Subscription; Account Administration\r 3091\r 3092 \r 3093**Subscription.** Subject to Customer's compliance with this Agreement and the applicable Order Form, Provider grants Customer a limited, non-exclusive, non-transferable, non-sublicensable right during the Subscription Term to access and use the Service solely for Customer's internal business purposes.\r 3094\r 3095 \r 3096**Authorized Users.** Customer may permit Authorized Users to access the Service only for Customer's internal business purposes. Customer is responsible for all activities conducted under its accounts, including acts and omissions of Authorized Users.\r 3097\r 3098 \r 3099**Account security.** Customer will maintain the confidentiality of its credentials and will promptly notify Provider of any suspected unauthorized access. Provider may assume that all actions taken using Customer credentials are authorized by Customer.\r 3100\r 3101 \r 3102**Usage limits.** The Service may be subject to usage limits (e.g., users, storage, documents, API calls, tokens). Provider may enforce limits via technical controls, rate limits, or feature restrictions. Overage fees, if any, will be described
3102in the Order Form or Documentation.\r 3103\r 3104 \r 3105\r 3106 \r 3107 \r 3108## 4. Use Restrictions; Acceptable Use\r 3109\r 3110 \r 3111Customer will not, and will not permit any third party to:\r 3112\r 3113 \r 3114 - Reverse engineer, decompile, disassemble, or attempt to derive source code, models, weights, prompts, or underlying ideas of the Service, except to the extent prohibited by law;\r 3115\r 3116 - Copy, modify, translate, or create derivative works of Provider Technology, except as expressly permitted by Documentation;\r 3117\r 3118 - Circumvent or disable security, usage limits, access controls, or authentication mechanisms;\r 3119\r 3120 - Access or use the Service to develop, train, benchmark, or improve a competing product or service, or to extract Outputs in a systematic way to create a substitute dataset;\r 3121\r 3122 - Use the Service to transmit malware, conduct phishing, perform unauthorized scanning, or otherwise interfere with the integrity or performance of the Service;\r 3123\r 3124 - Use the Service in a manner that violates applicable law, regulation, or third-party rights (including privacy, publicity, and intellectual property rights).\r 3125\r 3126 \r 3127 \r 3128**Acceptable Use Policy.** Customer agrees to comply with the Acceptable Use Policy in Exhibit D (or as posted in Documentation). Violation of the AUP is a material breach.\r 3129\r 3130 \r 3131**Restricted and regulated data.** Unless expressly permitted in an Order Form or written amendment, Customer will not upload or process Restricted Data (defined in Section 6.5).\r 3132\r 3133 \r 3134\r 3135 \r 3136 \r 3137## 5. Service; Availability; Changes\r 3138\r 3139 \r 3140**Service description.** The Service provides document ingestion, search, extraction, summarization, Q&A, and related workflows, including AI-enabled features.\r 3141\r 3142 \r 3143**Multi-tenancy.** The Service may be provided on a multi-tenant basis. Customer's tenant is logically segregated from other tenants using access controls.\r 3144\r 3145 \r 3146**Availability.** Provider will use commercially reasonable efforts to make the Service available, except for (a) planned maintenance, (b) emergency maintenance, (c) Customer or third-party network issues, and (d) circumstances outside Provider's reasonable control.\r 3147\r 3148 \r 3149**Changes and discontinuation.** Provider may update the Service, including adding, modifying, or removing features. Provider will not materially reduce core functionality during a paid Subscription Term without providing a commercially reasonable alternative, workaround, or remedy.\r 3150\r 3151 \r 3152**Beta/preview features.** Beta or preview features are provided "as is," may be modified or discontinued, and are excluded from any warranty or SLA unless expressly stated otherwise.\r 3153\r 3154 \r 3155\r 3156 \r 3157 \r 3158## 6. Customer Content; Data Rights\r 3159\r 3160 \r 3161**Ownership.** As between the parties, Customer retains all right, title, and interest in Customer Content. Provider retains all right, title, and interest in Provider Technology.\r 3162\r 3163 \r 3164**License to process.** Customer grants Provider a limited, worldwide license to host, store, copy, transmit, and process Customer Content solely to provide, maintain, secure, support, and improve the Service (including to prevent abuse and ensure reliability), and as otherwise permitted by this Agreement and the Privacy Policy.\r 3165\r 3166 \r 3167**Customer responsibilities.** Customer represents and warrants that it has obtained, and will maintain, all rights, consents, and permissions necessary for Provider to process Customer Content and personal data contained in Customer Content in accordance with this Agreement.\r 3168\r 3169 \r 3170**Data accuracy.** Customer is responsible for the completeness, accuracy, quality, and legality of Customer Content, and for how Customer uses Outputs.\r 3171\r 3172 \r 3173### 6.1 Data processing roles\r 3174\r 3175 \r 3176To the extent Customer Content includes personal data subject to data protection laws, Customer is the "controller" or "business" (as applicable) and Provider is the "processor" or "service provider" (as applicable), processing such data only on Customer's documented instructions as described
3176in this Agreement and any Data Processing Addendum ("DPA").\r 3177\r 3178 \r 3179### 6.2 Subprocessors\r 3180\r 3181 \r 3182Provider may use subprocessors (including cloud hosting, analytics, and AI model providers) to help deliver the Service. Provider will maintain contractual protections with subprocessors consistent with applicable law and the DPA (where applicable).\r 3183\r 3184 \r 3185### 6.3 Data export\r 3186\r 3187 \r 3188During the Subscription Term, Customer may export Customer Content using available export features. After termination, Provider will make Customer Content available for export for a limited period described in Section 16.4, after which Provider will delete or de-identify Customer Content in accordance with its retention practices, unless retention is required or permitted by law.\r 3189\r 3190 \r 3191### 6.4 Usage Data\r 3192\r 3193 \r 3194Provider may collect and use Usage Data to provide, secure, and improve the Service, including capacity planning, feature performance, reliability, and abuse prevention. Usage Data does not grant Provider the right to disclose Customer Content to other customers.\r 3195\r 3196 \r 3197### 6.5 Restricted Data\r 3198\r 3199 \r 3200"Restricted Data" means any data subject to special regulatory or contractual requirements, including: (a) payment card data subject to PCI DSS; (b) protected health information regulated by HIPAA; (c) classified, controlled unclassified, or export-controlled government information; (d) biometric identifiers/templates; (e) precise geolocation for tracking individuals; (f) Social Security numbers or government-issued IDs at scale; and (g) any other data requiring safeguards beyond those generally provided by the Service.\r 3201\r 3202 \r 3203Unless expressly permitted in an Order Form or written amendment, Customer will not upload Restricted Data. If Customer uploads Restricted Data in violation of this section, Customer does so at its own risk and Provider may delete or quarantine the data and/or suspend access as necessary to protect the Service.\r 3204\r 3205 \r 3206\r 3207 \r 3208 \r 3209## 7. AI Features; Outputs; Human Review\r 3210\r 3211 \r 3212**AI acknowledgment.** Customer acknowledges the Service uses automated and AI/ML techniques to process inputs and generate Outputs. Outputs may be probabilistic, non-deterministic, inaccurate, incomplete, or unsuitable for Customer's purposes.\r 3213\r 3214 \r 3215**Human review required.** Customer is solely responsible for human review and independent verification of Outputs before use, especially for regulated, high-stakes, or external-facing purposes (including legal, insurance, financial, medical, employment, or safety decisions).\r 3216\r 3217 \r 3218**No professional advice.** Provider does not provide legal, tax, insurance, medical, or other professional advice. Outputs are provided for informational purposes only.\r 3219\r 3220 \r 3221**No uniqueness; third-party rights.** Provider does not warrant that Outputs are unique or non-infringing. Customer is responsible for ensuring its use of Outputs complies with law and third-party rights.\r 3222\r 3223 \r 3224### 7.1 Training and model improvement\r 3225\r 3226 \r 3227**Default: no cross-customer training.** By default, Provider does not use Customer Content to train or fine-tune generalized AI models made available to other customers. Any such use will occur only if expressly agreed in a written amendment or Order Form that clearly describes the scope and opt-in terms.\r 3228\r 3229 \r 3230**Service improvement.** Provider may use Usage Data and may use Customer Content in de-identified and/or aggregated form where reasonably practicable to maintain, secure, and improve the Service (e.g., reliability, latency, abuse prevention, and feature performance), provided such use does not intentionally disclose Customer identity or Customer Content to other customers.\r 3231\r 3232 \r 3233\r 3234 \r 3235 \r 3236## 8. Security; Incident Response\r 3237\r 3238 \r 3239**Security measures.** Provider will maintain commercially reasonable administrative, technical, and organizational safeguards designed to protect Customer Content against unauthorized access, disclosure, alteration, or destruction. Example security measures are described
3239in Exhibit C (which may be updated from time to time).\r 3240\r 3241 \r 3242**Customer security.** Customer is responsible for configuring the Service appropriately, limiting access to Authorized Users, using strong authentication, and securing its own systems and endpoints.\r 3243\r 3244 \r 3245**Security Incident notice.** Upon confirming a Security Incident, Provider will notify Customer without undue delay and provide information reasonably necessary for Customer to meet applicable legal obligations. Provider is not responsible for incidents caused by Customer's acts or omissions, compromised Customer credentials, or Customer-controlled systems.\r 3246\r 3247 \r 3248\r 3249 \r 3250 \r 3251## 9. Support; Maintenance\r 3252\r 3253 \r 3254**Support.** Provider will provide support as described in the applicable Order Form or Documentation.\r 3255\r 3256 \r 3257**Maintenance.** Provider may perform maintenance and updates. Provider will use commercially reasonable efforts to provide advance notice of scheduled maintenance when practicable.\r 3258\r 3259 \r 3260\r 3261 \r 3262 \r 3263## 10. Fees; Payment; Taxes\r 3264\r 3265 \r 3266**Fees.** Customer will pay all fees specified in the applicable Order Form or at the time of subscription sign-up. Except as expressly stated in this Agreement, all fees are non-cancelable and non-refundable.\r 3267\r 3268 \r 3269**Payment terms.** Unless otherwise specified in the Order Form, all fees are due and payable in full at the time of subscription sign-up or prior to activation of the services. Provider will not provision or activate access to the services until payment has been received and processed. For any renewal, add-on services, or usage-based charges (if applicable), payment is due in advance unless otherwise agreed in writing. Any amounts not paid when due (where post-billing is expressly approved) may incur a late fee at the lesser of 1.5% per month or the maximum permitted by law, and Provider may recover reasonable collection costs.\r 3270\r 3271 \r 3272**Taxes.** Fees exclude all applicable taxes. Customer is responsible for all sales, use, VAT, GST, duties, and similar governmental charges, excluding taxes based on Provider's net income.\r 3273\r 3274 \r 3275**Pricing Changes.** Provider reserves the right to modify fees, subscription charges, or pricing structure at any time at its sole discretion. Any changes will apply to new subscriptions and renewal terms, unless otherwise stated in the Order Form.\r 3276\r 3277 \r 3278\r 3279 \r 3280 \r 3281## 11. Suspension\r 3282\r 3283 \r 3284Provider may suspend Customer's access to the Service (in whole or in part): (a) for non-payment of undisputed amounts; (b) if Customer's use violates this Agreement or the AUP; (c) if Customer's use poses a security risk or threatens the integrity of the Service; or (d) to comply with law or a governmental request.\r 3285\r 3286 \r 3287Provider will use commercially reasonable efforts to provide notice and to limit suspension to the minimum scope and duration necessary. Suspension does not relieve Customer of payment obligations.\r 3288\r 3289 \r 3290\r 3291 \r 3292 \r 3293## 12. Confidentiality\r 3294\r 3295 \r 3296**Confidential Information.** "Confidential Information" means non-public information disclosed by one party to the other that is designated as confidential or that reasonably should be understood to be confidential. Customer Content is Customer's Confidential Information. Provider Technology is Provider's Confidential Information.\r 3297\r 3298 \r 3299**Protection.** The receiving party will protect the disclosing party's Confidential Information using at least reasonable care and will not use or disclose it except as permitted under this Agreement.\r 3300\r 3301 \r 3302**Permitted disclosures.** The receiving party may disclose Confidential Information to its employees, contractors, and advisors with a need to know and who are bound by confidentiality obligations at least as protective as this Agreement.\r 3303\r 3304 \r 3305**Exceptions.** Confidentiality obligations do not apply to information that (a) is or becomes public through no fault of the receiving party, (b) was independently developed without use of Confidential Information, (c) was rightfully received without restriction, or (d) was approved for release in writing.\r 3306\r 3307 \r 3308**Compelled disclosure.** If compelled by law, the receiving party may disclose Confidential Information provided it gives notice where legally permitted and cooperates in seeking protective treatment.\r 3309\r 3310 \r 3311\r 3312 \r 3313 \r 3314## 13. Intellectual Property; Feedback\r 3315\r 3316 \r 3317**Provider IP.** Provider retains all right, title, and interest in and to Provider Technology, including all intellectual property rights. No rights are granted except as expressly stated.\r 3318\r 3319 \r 3320**Feedback.** If Customer provides suggestions or feedback, Provider may use it without restriction or obligation, and without compensation to Customer.\r 3321\r 3322 \r 3323**Trademarks.** Each party retains ownership of its trademarks. Customer may not use Provider's marks without prior written consent.\r 3324\r 3325 \r 3326\r 3327 \r 3328 \r 3329## 14. Third-Party Services; Open Source\r 3330\r 3331 \r 3332**Third-party services.** The Service may interoperate with third-party services. Customer's use of third-party services is subject to third-party terms. Provider is not responsible for third-party outages or acts/omissions.\r 3333\r 3334 \r
3335**Open-source software.** The Service may include open-source components subject to applicable open-source licenses. To the extent an open-source license grants Customer additional rights, those rights apply only to the open-source components and not the Service as a whole.\r 3336\r 3337 \r 3338\r 3339 \r 3340 \r 3341## 15. Compliance; Export; Sanctions\r 3342\r 3343 \r 3344**Compliance with law.** Each party will comply with applicable laws and regulations. Customer is responsible for ensuring its use of the Service (and Outputs) complies with law and industry requirements.\r 3345\r 3346 \r 3347**Export controls and sanctions.** Customer will not use the Service in violation of U.S. export control laws or sanctions, and will not permit access by sanctioned persons or prohibited jurisdictions.\r 3348\r 3349 \r 3350\r 3351 \r 3352 \r 3353## 16. Term; Renewal; Termination\r 3354\r 3355 \r 3356**Term.** This Agreement begins on the Effective Date and continues until all Order Forms expire or are terminated.\r 3357\r 3358 \r 3359**Renewal.** Unless otherwise stated in an Order Form, subscriptions renew automatically for successive terms equal to the prior term, unless either party gives written notice of non-renewal at least [30] days before the end of the then-current term.\r 3360\r 3361 \r 3362**Termination for cause.** Either party may terminate an Order Form for material breach if the breaching party fails to cure within 30 days after written notice (10 days for non-payment). Provider may terminate immediately for Customer's unlawful use or repeated AUP violations.\r 3363\r 3364 \r 3365**Effect of termination; data export.** Upon termination or expiration, Customer's right to access the Service ends. Upon request, Provider will make Customer Content available for export for a limited period of 30 days, after which Provider will delete or de-identify Customer Content in accordance with Provider's retention practices unless a longer retention is required or permitted by law.\r 3366\r 3367 \r 3368**Survival.** Sections that by their nature should survive termination will survive, including Fees owed, Use Restrictions, Confidentiality, IP, Indemnification, Limitation of Liability, and Dispute Resolution.\r 3369\r 3370 \r 3371\r 3372 \r 3373 \r 3374## 17. Warranties; Disclaimers\r 3375\r 3376 \r 3377**Authority.** Each party represents it has the authority to enter into this Agreement.\r 3378\r 3379 \r 3380**Limited performance warranty.** Provider warrants it will provide the Service in a professional and workmanlike manner. Customer's exclusive remedy for breach of this warranty is re-performance of the affected Service, and if re-performance is not commercially reasonable, Provider may terminate the affected Order Form.\r 3381\r 3382 \r 3383**Disclaimer.** EXCEPT AS EXPRESSLY STATED, THE SERVICE AND OUTPUTS ARE PROVIDED "AS IS" AND PROVIDER DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. Provider does not warrant that the Service will be uninterrupted or error-free, or that Outputs will be accurate or complete.\r 3384\r 3385 \r 3386\r 3387 \r 3388 \r 3389## 18. Indemnification\r 3390\r 3391 \r 3392### 18.1 Customer indemnity\r 3393\r 3394 \r 3395Customer will defend, indemnify, and hold harmless Provider, its Affiliates, and their respective officers, directors, employees, and agents from and against any third-party claims, damages, liabilities, costs, and expenses (including reasonable attorneys' fees) arising out of or related to: (a) Customer Content; (b) Customer's or Authorized Users' misuse of the Service; or (c) Customer's breach of this Agreement or violation of law.\r 3396\r 3397 \r 3398### 18.2 Provider IP indemnity\r 3399\r 3400 \r 3401Provider will defend, indemnify, and hold harmless Customer from third-party claims that the Service (excluding Customer Content and third-party services) infringes a U.S. patent, copyright, or trade secret, and will pay covered damages, provided Customer: (a) promptly notifies Provider; (b) cooperates; and (c) allows Provider to control the defense and settlement.\r 3402\r 3403 \r 3404If a claim is likely, Provider may: (i) modify the Service so it becomes non-infringing; (ii) replace the Service with a functionally equivalent service; or (iii) terminate the affected Order Form and refund prepaid, unused fees.\r 3405\r 3406 \r 3407### 18.3 Exclusions\r 3408\r 3409 \r 3410Provider has no indemnity obligation to the extent a claim arises from: (a) Customer Content; (b) Customer's instructions, configurations, or combinations with
3410non-Provider products; (c) third-party services; or (d) use not in accordance with this Agreement.\r 3411\r 3412 \r 3413\r 3414 \r 3415 \r 3416## 19. Limitation of Liability\r 3417\r 3418 \r 3419**EXCLUSION OF DAMAGES.** TO THE MAXIMUM EXTENT PERMITTED BY LAW, NEITHER PARTY WILL BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR FOR LOST PROFITS, LOST REVENUE, OR LOSS OF DATA, EVEN IF ADVISED OF THE POSSIBILITY.\r 3420\r 3421 \r 3422**LIABILITY CAP.** TO THE MAXIMUM EXTENT PERMITTED BY LAW, EACH PARTY'S TOTAL LIABILITY ARISING OUT OF OR RELATED TO THIS AGREEMENT WILL NOT EXCEED THE AMOUNTS PAID OR PAYABLE BY CUSTOMER TO PROVIDER UNDER THE APPLICABLE ORDER FORM IN THE TWELVE (12) MONTHS BEFORE THE EVENT GIVING RISE TO LIABILITY.\r 3423\r 3424 \r 3425**Carve-outs.** The foregoing limitations do not apply to: (a) Customer's payment obligations; (b) Customer's indemnity obligations; or (c) a party's gross negligence or willful misconduct.\r 3426\r 3427 \r 3428\r 3429 \r 3430 \r 3431## 20. Dispute Resolution; Governing Law\r 3432\r 3433 \r 3434**Governing law.** This Agreement is governed by the laws of the State of New Jersey, excluding its conflict-of-laws rules.\r 3435\r 3436 \r 3437**Venue.** The parties agree to exclusive jurisdiction and venue in the state or federal courts located in Somerset, NJ, unless the parties agree to arbitration in an Order Form or amendment.\r 3438\r 3439 \r 3440**Optional arbitration.** If arbitration applies, disputes will be resolved by binding arbitration administered by the American Arbitration Association under its Commercial Arbitration Rules in Somerset, NJ. Judgment may be entered in any court of competent jurisdiction.\r 3441\r 3442 \r 3443**Injunctive relief.** Either party may seek injunctive or equitable relief for actual or threatened breach of confidentiality, security, or intellectual property rights.\r 3444\r 3445 \r 3446**OPTIONAL: Class action waiver / jury trial waiver.** Include if desired and permitted by law: (a) the parties waive any right to a jury trial; and (b) disputes will be brought only in an individual capacity and not as a plaintiff or class member in any purported class action.\r 3447\r 3448 \r 3449\r 3450 \r 3451 \r 3452## 21. Changes to the Agreement\r 3453\r 3454 \r 3455Provider may update this Agreement to reflect changes in law, security, or the Service. Provider will provide reasonable notice (e.g., email or in-app). Continued use after the effective date constitutes acceptance, unless Customer terminates the subscription before the effective date (where permitted).\r 3456\r 3457 \r 3458\r 3459 \r 3460 \r 3461## 22. Miscellaneous\r 3462\r 3463 \r 3464 - **Assignment.** Customer may not assign this Agreement without Provider's prior written consent, except to an Affiliate or in connection with a merger, acquisition, or sale of substantially all assets, provided the assignee agrees in writing to be bound.\r 3465\r 3466 - **Subcontracting.** Provider may subcontract performance of the Service provided Provider remains responsible for its obligations under this Agreement.\r 3467\r 3468 - **Force majeure.** Neither party is liable for delays or failures due to circumstances beyond its reasonable control.\r 3469\r 3470 - **Independent contractors.** The parties are independent contractors and no partnership, joint venture, or agency relationship is created.\r 3471\r 3472 - **Severability; waiver.** If any provision is unenforceable, the remainder will remain in effect. Waivers must be in
3472writing and are limited to the specific instance.\r 3473\r 3474 - **Entire agreement.** This Agreement, the Order Form(s), and incorporated policies are the entire agreement and supersede prior discussions.\r 3475\r 3476 \r 3477 \r 3478\r 3479 \r 3480 \r 3481## Exhibits and Policies\r 3482\r 3483 \r 3484The following exhibits are templates or summaries and may be incorporated by reference into an Order Form or made available in Documentation.\r 3485\r 3486 \r 3487### Exhibit A - Order Form Template\r 3488\r 3489 \r 3490 - Customer legal name, address, and billing contact\r 3491\r 3492 - Subscription plan/tier and permitted use\r 3493\r 3494 - Usage limits (users, documents, storage, API calls, tokens) and overage terms\r 3495\r 3496 - Fees, billing frequency, payment terms\r 3497\r 3498 - Subscription Term start and end dates; renewal terms\r 3499\r 3500 - Support/SLA tier (if any)\r 3501\r 3502 - Security and compliance addenda (if any)\r 3503\r 3504 - Data Processing Addendum (if applicable)\r 3505\r 3506 \r 3507 \r 3508### Exhibit B - Data Processing Addendum (DPA) - Summary\r 3509\r 3510 \r 3511 - Applies where Customer Content includes personal data subject to GDPR/UK GDPR or similar laws.\r 3512\r 3513 - Roles: Customer is Controller and Provider is Processor (or business/service provider under applicable U.S. state privacy laws).\r 3514\r 3515 - Processing: Provider processes personal data only on documented instructions to provide the Service.\r 3516\r 3517 - Subprocessors: Provider may use subprocessors and will maintain appropriate contractual protections; where required, Provider will provide notice of material changes with an objection mechanism.\r 3518\r 3519 - International transfers: SCCs and the UK Addendum (where applicable).\r 3520\r 3521 - Assistance: Provider will provide reasonable assistance with security inquiries and data subject requests where required by law.\r 3522\r 3523 - Deletion: Provider will delete personal data after termination subject to agreed retention and legal requirements.\r 3524\r 3525 - Audit: Provider will provide reasonable security information (e.g., audit summaries) subject to confidentiality.\r 3526\r 3527 \r 3528 \r 3529### Exhibit C - Security Measures - Summary\r 3530\r 3531 \r 3532 - Logical access controls and role-based access\r 3533\r 3534 - Tenant isolation controls and tenant-scoped authorization\r 3535\r 3536 - Audit logging for key security events\r 3537\r 3538 - Encryption in transit (TLS) and, where applicable, encryption at rest\r 3539\r 3540 - ⢠Data utilized within retrieval components (e.g., vector databases) is maintained in a controlled environment with tenant-level isolation and restricted access, consistent with the overall security framework.\r 3541\r 3542 - Vulnerability management and patching\r 3543\r 3544 - Backups and disaster recovery (as applicable)\r 3545\r 3546 - Secure software development lifecycle\r 3547\r 3548 - Incident response procedures\r 3549\r 3550 \r 3551 \r 3552### Exhibit D - Acceptable Use Policy (AUP)\r 3553\r 3554 \r 3555Customer and Authorized Users will not use the Service to:\r 3556\r 3557 \r 3558 - Violate law or third-party rights, including privacy and intellectual property rights;\r 3559\r 3560 - Transmit malware or abusive traffic, or disrupt the Service;\r 3561\r 3562 - Perform unauthorized penetration testing, security scanning, or benchmarking;\r 3563\r 3564 - Engage in unlawful surveillance or collect personal data without proper notices/consents;\r 3565\r 3566 - Create, improve, or benchmark competing products, or systematically extract Outputs to create substitute datasets;\r 3567\r 3568 - Upload Restricted Data except as expressly permitted in an Order Form or written amendment.\r 3569\r 3570 \r 3571 \r 3572### Exhibit E - Data Privacy & AI Usage Disclosure\r 3573\r 3574 \r 3575This Exhibit describes how Provider processes Customer Content and personal data in connection with the Service, including AI-enabled features. This Exhibit is incorporated by reference and, where applicable law requires, the parties will enter into Provider's Data Processing Addendum ("DPA"), which will control to the extent it conflicts with this Exhibit.\r 3576\r 3577 \r 3578 - **Roles; Scope.** Customer determines the purposes and means of processing Customer Content and any personal data contained therein. To the extent Provider processes personal data on behalf of Customer, Provider acts as a "processor" or "service provider" (as applicable) and processes such personal data only to provide, maintain, secure, and support the Service, and as otherwise permitted under this Agreement, the Privacy Policy, and the DPA (if applicable).\r 3579\r 3580 - **Processing Purposes.** Customer Content (including uploaded documents, prompts/inputs, and associated metadata) may be processed to: (a) provide and operate the Service and its features (including search, extraction, summarization, and Q&A); (b) perform customer-requested configurations, workflows, and support; (c) prevent fraud, abuse, and security incidents; (d) perform debugging, reliability, and performance monitoring; and (e) comply with law and enforce this Agreement.\r 3581\r 3582 - **AI Processing Acknowledgment.** Customer acknowledges the Service uses artificial intelligence and machine-learning technologies to process Customer Content and generate Outputs. Outputs may be inaccurate, incomplete, non-deterministic, or otherwise unsuitable. Customer is solely responsible for human review and independent verification of Outputs prior to use, particularly for regulated, high-stakes, or external purposes.\r 3583\r 3584 - **Third-Party Providers; Subprocessors.** To provide AI-enabled features, Provider may transmit limited portions of Customer Content and/or prompts/inputs to third-party service providers acting as subprocessors. Customer authorizes such disclosures to the extent necessary to provide the Service. Provider will maintain commercially reasonable contractual protections with subprocessors consistent with the DPA (where applicable).\r 3585\r 3586 - **Training; Model Improvement (Default: No Cross-Customer Training).** By default, Provider does not use Customer Content to train or fine-tune generalized AI models made available to other customers. Any such use will occur only if expressly agreed in writing. Provider may use Usage Data and may use Customer Content in de-identified or aggregated form where reasonably practicable for maintaining, securing, and improving the Service, provided such use does not intentionally disclose Customer identity or Customer Content to other customers.\r 3587\r 3588 - **No Human Review Obligation.** Provider does not guarantee human review of Customer Content or Outputs and has no obligation to monitor, validate, correct, or curate Customer Content or Outputs.\r 3589\r 3590 - **Data Security.** Provider implements commercially reasonable safeguards designed to protect Customer Content and personal data. No security measures are infallible; Provider does not guarantee absolute security. Customer is responsible for securely managing credentials and user access within Customer's environment.\r 3591\r 3592 - **Security Incidents.** If Provider confirms a Security Incident, Provider will notify Customer without undue delay and provide information reasonably necessary for Customer to meet applicable legal obligations, consistent with Section 8.\r 3593\r 3594 - **Data Retention;
3594 Deletion.** Customer Content is retained for the duration of the subscription and as reasonably necessary to provide the Service, comply with legal obligations, resolve disputes, or enforce this Agreement. After termination, Provider will delete or de-identify Customer Content in accordance with Provider's retention practices, unless a longer period is required or permitted by law.\r 3595\r 3596 - **Restricted Data.** Unless expressly permitted, Customer will not upload Restricted Data, including PCI, PHI, export-controlled, or other highly sensitive data requiring special safeguards.\r 3597\r 3598 - **Customer Responsibilities.** Customer is responsible for providing required notices and obtaining consents; ensuring Customer Content is lawfully collected, used, and disclosed; complying with privacy laws; and conducting assessments (e.g., DPIAs) as required for Customer's use of AI features.\r 3599\r 3600 - **International Transfers.** Customer acknowledges the Service may be provided from, and Customer Content may be processed in, the United States and other countries. Where required, transfers will be addressed through the DPA and applicable transfer mechanisms.\r 3601\r 3602 - **No Waiver; Limitation of Liability.** This Exhibit does not modify Provider's disclaimers, limitations of liability, or indemnification obligations elsewhere in this Agreement.\r 3603\r 3604 \r 3605 \r 3606\r 3607 \r 3608 \r 3609## Contact Information\r 3610\r 3611 \r 3612\r 3613 If you have any questions about these Terms and Conditions, please contact us at{' '}\r 3614 {supportEmail}\r 3615 \r 3616\r 3617 \r 3618 \r 3619 \r 3620 \r 3621 );\r 3622};\r 3623`,privacyMarkdown=`# OpenParser AI Privacy Policy\r 3624\r 3625Innovatix Technology Partners\r 3626Effective Date: 9/23/2026\r 3627Public page: /privacy\r 3628Contact: [email protected]\r 3629\r 3630Table of Contents\r 3631 \r 3632 - 1. Scope and Key Concepts\r 3633\r 3634 - 2. Roles: Customer vs. Innovatix\r 3635\r 3636 - 3. Information We Collect\r 3637\r 3638 - 4. How We Use Information\r 3639\r 3640 - 5. How We Share Information\r 3641\r 3642 - 6. Cookies and Similar Technologies\r 3643\r 3644 - 7. AI Features and Automated Processing\r 3645\r 3646 - 8. Data Retention\r 3647\r 3648 - 9. Security\r 3649\r 3650 - 10. International Transfers\r 3651\r 3652 - 11. Your Rights and Choices\r 3653\r 3654 - 12. Children's Privacy\r 3655\r 3656 - 13. Changes to This Policy\r 3657\r 3658 - 14. Contact Us\r 3659\r 3660 - Appendix A - Data Privacy & AI Usage Disclosure\r 3661\r 3662 \r 3663 \r 3664\r 3665 \r 3666 \r 3667## 1. Scope and Key Concepts\r 3668\r 3669 \r 3670This Privacy Policy applies to personal information we process in connection with the Service, including when you visit our website, create an account, use the Service, or contact us for support.\r 3671\r 3672 \r 3673"Personal information" (or "personal data") means information that identifies, relates to, describes, is reasonably capable of being associated with, or could reasonably be linked to an individual. Definitions may vary by jurisdiction.\r 3674\r 3675 \r 3676This Policy does not cover third-party websites or services that may be linked from the Service or integrated at your direction. Their privacy practices are governed by their own policies.\r 3677\r 3678 \r 3679\r 3680 \r 3681 \r 3682## 2. Roles: Customer vs. Innovatix\r 3683\r 3684 \r 3685When a business customer uses the Service, Innovatix typically acts as a service provider/processor for Customer Content. The Customer is responsible for determining what information is uploaded, for providing required notices, and for obtaining any required consents.\r 3686\r 3687 \r 3688Innovatix acts as a controller/business for personal information we process for our own purposes, such as account administration, billing, security, product analytics, and marketing (where permitted).\r 3689\r 3690 \r 3691If applicable law requires, Innovatix and the Customer may enter into a Data Processing Addendum ("DPA") to govern our processor/service provider obligations.\r 3692\r 3693 \r 3694\r 3695 \r 3696 \r 3697## 3. Information We Collect\r 3698\r 3699 \r 3700We collect information from (a) you or your organization, (b) your use of the Service, and (c) third parties (e.g., payment processors) as described below.\r 3701\r 3702 \r 3703### 3.1 Information you provide\r 3704\r 3705 \r 3706 - Account and contact information (e.g., name, email address, phone number, organization name, job title).\r 3707\r 3708 - Billing and transactional information (e.g., billing contact details, invoices, payment status; payment card data is typically processed by our payment processor and not stored by us except as necessary for billing records).\r 3709\r
3710 - Support communications (e.g., messages you send to support, feedback, and related metadata).\r 3711\r 3712 \r 3713 \r 3714### 3.2 Customer Content processed on behalf of Customers\r 3715\r 3716 \r 3717The Service allows Customers and Authorized Users to upload documents, files, prompts/inputs, and other content ("Customer Content"). Customer Content may contain personal information, confidential information, or sensitive information. Innovatix processes Customer Content primarily on behalf of and under the instructions of the Customer to provide the Service.\r 3718\r 3719 \r 3720### 3.3 Information collected automatically\r 3721\r 3722 \r 3723 - Usage and log data (e.g., feature usage, timestamps, pages/screens viewed, clicks, error logs).\r 3724\r 3725 - Device and network data (e.g., IP address, browser type, device identifiers, operating system, approximate location derived from IP).\r 3726\r 3727 - Security signals (e.g., authentication events, suspicious activity indicators, and audit logs).\r 3728\r 3729 \r 3730 \r 3731### 3.4 Information from third parties\r 3732\r 3733 \r 3734 - Payment processors and billing providers (e.g., payment confirmation, billing address, and transaction metadata).\r 3735\r 3736 - Identity and authentication providers (if you use single sign-on) (e.g., SSO identifiers).\r 3737\r 3738 - Analytics providers (e.g., aggregated usage metrics).\r 3739\r 3740 \r 3741 \r 3742\r 3743 \r 3744 \r 3745## 4. How We Use Information\r 3746\r 3747 \r 3748We use personal information for the following purposes:\r 3749\r 3750 \r 3751 - Provide, operate, and maintain the Service, including authenticating users and enabling features such as document processing, search, extraction, summarization, and Q&A.\r 3752\r 3753 - Provide customer support, respond to inquiries, and deliver requested configurations and troubleshooting.\r 3754\r 3755 - Process transactions, manage subscriptions, send invoices, and administer accounts.\r 3756\r 3757 - Monitor, protect, and improve the security and integrity of the Service, including detecting and preventing fraud and abuse.\r 3758\r 3759 - Understand service performance and usage trends, and improve features, reliability, and user experience.\r 3760\r 3761 - Comply with legal obligations and enforce our agreements and policies.\r 3762\r 3763 - Send service-related messages (e.g., security notices, administrative updates).\r 3764\r 3765 - Marketing and promotional communications, where permitted by law and subject to your choices (e.g., opt-out).\r 3766\r 3767 \r 3768 \r 3769\r 3770 \r 3771 \r 3772## 5. How We Share Information\r 3773\r 3774 \r 3775We may share personal information in the following circumstances:\r 3776\r 3777 \r 3778 - **Service providers and subprocessors.** We use vendors to host infrastructure, provide analytics, support, billing, and AI-enabled processing. These vendors process data under contractual obligations consistent with this Policy and applicable law.\r 3779\r 3780 - **At Customer direction.** If a Customer enables a third-party integration, we may share information as directed by the Customer or Authorized Users.\r 3781\r 3782 - **Affiliates.** We may share information with our Affiliates for operational, support, and business purposes consistent with this Policy.\r 3783\r 3784 - **Legal and safety.** We may disclose information to comply with law, respond to lawful requests, protect rights and safety, investigate fraud, and enforce our agreements.\r 3785\r 3786 - **Business transfers.** We may share information in connection with a merger, acquisition, financing, reorganization, bankruptcy, or sale of assets. We will take reasonable steps to ensure continued protection of personal information.\r 3787\r 3788 \r 3789 \r 3790We do not knowingly disclose Customer Content to other customers. Customer Content is processed to provide the Service to the Customer that supplied it.\r 3791\r 3792 \r 3793\r 3794 \r 3795 \r 3796## 6. Cookies and Similar Technologies\r 3797\r 3798 \r 3799We may use cookies and similar technologies (such as pixels and local storage) to operate the website and Service, remember preferences, maintain sessions, understand usage, and enhance security.\r 3800\r 3801 \r 3802**Your choices.** You can control cookies through your browser settings and, where available, in-product cookie preferences. Disabling cookies may affect functionality.\r 3803\r 3804 \r 3805**Do Not Track.** Some browsers offer a "Do Not Track" feature. There is no consistent industry standard for responding to such signals;
3805 we may not respond to them.\r 3806\r 3807 \r 3808\r 3809 \r 3810 \r 3811## 7. AI Features and Automated Processing\r 3812\r 3813 \r 3814The Service includes AI-enabled features that analyze Customer Content and user inputs to generate Outputs (e.g., extractions, summaries, and answers). Outputs may be inaccurate, incomplete, non-deterministic, or otherwise unsuitable for your purposes. Customers are responsible for human review and verification before relying on Outputs.\r 3815\r 3816 \r 3817**Training and model improvement.** By default, we do not use Customer Content to train or fine-tune generalized AI models made available to other customers, unless the Customer explicitly opts in via a written agreement or Order Form. We may use usage telemetry and may use de-identified and/or aggregated data where reasonably practicable to maintain, secure, and improve the Service.\r 3818\r 3819 \r 3820\r 3821 \r 3822 \r 3823## 8. Data Retention\r 3824\r 3825 \r 3826We retain personal information for as long as necessary to provide the Service, comply with legal obligations, resolve disputes, enforce agreements, and for legitimate business purposes. Retention periods vary based on the type of data, the Customer's subscription term, and legal requirements.\r 3827\r 3828 \r 3829Customer Content is generally retained for the duration of the Customer's subscription and then deleted or de-identified in accordance with our retention practices, subject to export windows and legal requirements.\r 3830\r 3831 \r 3832\r 3833 \r 3834 \r 3835## 9. Security\r 3836\r 3837 \r 3838We implement commercially reasonable administrative, technical, and organizational measures designed to protect personal information against unauthorized access, disclosure, alteration, or destruction. However, no security measures are infallible, and we cannot guarantee absolute security.\r 3839\r 3840 \r 3841You are responsible for securing your own accounts and devices, using strong passwords, enabling multi-factor authentication where available, and limiting access to authorized personnel.\r 3842\r 3843 \r 3844\r 3845 \r 3846 \r 3847## 10. International Transfers\r 3848\r 3849 \r 3850We may process and store information in the United States and other countries where we or our service providers operate. Where required by law, we use appropriate safeguards for international transfers, such as Standard Contractual Clauses and the UK Addendum, as applicable and typically documented in a DPA.\r 3851\r 3852 \r 3853\r 3854 \r 3855 \r 3856## 11. Your Rights and Choices\r 3857\r 3858 \r 3859### 11.1 Account and communications\r 3860\r 3861 \r 3862 - **Account information.** You may update certain account information through the Service or by contacting us.\r 3863\r 3864 - **Marketing communications.** You can opt out of marketing emails by using the unsubscribe link in the email or contacting us. Service-related communications are not optional.\r 3865\r 3866 \r 3867 \r 3868### 11.2 Data subject rights (EEA/UK and other jurisdictions)\r 3869\r 3870 \r 3871Depending on your location, you may have rights to access, correct, delete, restrict or object to processing, and to data portability. Where we act as a processor/service provider for Customer Content, requests should be directed to the Customer (the data controller/business). We will assist Customers with such requests as required by law and contractual commitments.\r 3872\r 3873 \r 3874To submit a request regarding information we control, contact us at [email protected]. We may need to verify your identity before fulfilling requests.\r 3875\r 3876 \r 3877### 11.3 California privacy notice (CCPA/CPRA)\r 3878\r 3879 \r 3880If you are a California resident, California law may provide you with additional rights regarding your personal information, including the right to know, delete, correct, and opt out of "sale" or "sharing" of personal information (as those terms are defined by law), and the right to limit use and disclosure of sensitive personal information (where applicable).\r 3881\r 3882 \r 3883We do not sell personal information for monetary consideration. Depending on how cookies and advertising technologies are configured, certain disclosures for cross-context behavioral advertising may be considered "sharing" under California law. If we engage in such sharing, we will provide an opt-out mechanism (e.g., a "Do Not Sell or Share My Personal Information" link or cookie preference center) as required.\r 3884\r 3885 \r 3886**Authorized agent.** You may designate an authorized agent to submit requests on your behalf. We may require proof of authorization and identity verification.\r 3887\r 3888 \r 3889**Non-discrimination.** We will not discriminate against you for exercising your privacy rights.\r 3890\r 3891 \r 3892\r 3893 \r 3894 \r 3895## 12. Children's Privacy\r 3896\r 3897 \r 3898The Service is not directed to children under 13 (or such higher age as may be required by law). We do not knowingly collect personal information from children. If you believe a child has provided personal information, contact us so we can take appropriate action.\r 3899\r 3900 \r 3901\r 3902 \r 3903 \r 3904## 13. Changes to This Policy\r 3905\r 3906 \r 3907We may update this Policy from time to time. We will post the updated Policy with a new effective date and, if changes are material, provide additional notice (e.g., via email or in-product notice).\r 3908\r 3909 \r 3910\r 3911 \r 3912 \r 3913## 14. Contact Us\r 3914\r 3915 \r 3916Innovatix Technology Partners\r 3917\r 3918 \r 3919Attn: Privacy\r 3920\r 3921 \r 3922135 Route 202/206, Suite 9 Bedminster, NJ 07921\r 3923\r 3924 \r 3925\r 3926 Email: {supportEmail}\r 3927 \r 3928\r 3929 \r 3930\r 3931 \r 3932 \r 3933## Appendix A - Data Privacy & AI Usage Disclosure\r 3934\r 3935 \r 3936This Appendix describes how Innovatix Technology Partners (the "Company") processes Customer Content and personal data in connection with the Service, including AI-enabled features. By accessing or using the Service, Customer acknowledges and agrees to the practices described herein and in this Privacy Policy. If Customer or its Authorized Users are located outside the United States or applicable law so requires, the parties will enter into (or are deemed to have entered into) the Company's Data Processing Addendum ("DPA"), which will govern to the extent it conflicts with this Appendix.\r 3937\r 3938 \r 3939 - **Roles; Scope.** Customer is responsible for determining the purposes and means of processing Customer Content and any personal data contained therein. To the extent the Company processes personal data on behalf of Customer, the Company acts as a "processor" or "service provider" (as applicable) and processes such personal data only to provide, maintain, secure, and support the Service, and as otherwise permitted under this Privacy Policy, the Agreement, and the DPA (if applicable).\r 3940\r 3941 - **Processing Purposes.** Customer Content (including uploaded documents, prompts/inputs, and associated metadata) may be processed to: (a) provide and operate the Service and its features (including search, extraction, summarization, and Q&A over Customer Content); (b) perform customer-requested configurations, workflows, and support; (c) prevent fraud, abuse, and security incidents; (d) perform debugging, reliability, and performance monitoring; and (e) comply with applicable law and enforce applicable terms.\r 3942\r 3943 - **AI Processing Acknowledgment.** Customer expressly acknowledges the Service uses artificial intelligence and machine-learning technologies (including automated systems and probabilistic models) to process Customer Content and generate outputs, recommendations, and other results ("Outputs"). Outputs may be inaccurate, incomplete, non-deterministic, or otherwise unsuitable for Customer's purposes. Customer is solely responsible for human review and independent verification of Outputs prior to use, particularly for regulated, high-stakes, or external purposes.\r 3944\r 3945 - **Third-Party AI Providers; Subprocessors.** To provide AI-enabled features, the Company may transmit limited portions of Customer Content and/or prompts/inputs to third-party service providers (including AI model providers, hosting providers, and analytics providers) acting as subprocessors. Customer authorizes such disclosures and processing to the extent necessary to provide the Service. The Company will maintain commercially reasonable contractual protections with subprocessors consistent with the DPA (where applicable), and may update subprocessors from time to time. Where required by law or the DPA, the Company will provide notice of material subprocessor changes and an opportunity to object.\r 3946\r 3947 - **Training; Model Improvement (Default: No Cross-Customer Training).** By default, the Company does not use Customer Content to train or fine-tune generalized AI models made available to other customers. Any use of Customer Content for such training will occur only if expressly agreed in a written amendment or Order Form that clearly describes scope and opt-in terms. The Company may, however, use usage data and service telemetry, and may use Customer Content in a de-identified, aggregated, or otherwise non-customer-specific form where reasonably practicable, for purposes of maintaining, securing, and improving the Service (e.g., reliability, latency, abuse prevention, and feature performance), provided that such use does not intentionally disclose Customer identity or Customer Content to other customers.\r 3948\r 3949 - **No Human Review Obligation.** The Company does not guarantee human review of Customer Content or Outputs and has no obligation to monitor, validate, correct, or curate Customer Content or Outputs. Customer is responsible for establishing appropriate internal review, approval, and governance controls for any use of the Service and Outputs.\r 3950\r 3951 - **Data Security.** The Company implements commercially reasonable administrative, technical, and organizational safeguards designed to protect Customer Content and personal data against unauthorized access, disclosure, alteration, or destruction. Customer acknowledges that no security measures are infallible and the Company does not guarantee absolute security. Customer is responsible for securely managing credentials, user access, and endpoint security within Customer's environment.\r 3952\r 3953 - **Security Incidents.** In the event the Company confirms a security incident involving unauthorized access to Customer Content or personal data, the Company will notify Customer without undue delay and provide information reasonably necessary for Customer to meet applicable legal obligations.\r 3954\r 3955 - **Data Retention;
3955 Deletion.** Customer Content is retained for the duration of Customer's subscription and as otherwise reasonably necessary to provide the Service, comply with legal obligations, resolve disputes, or enforce applicable terms. Following termination or expiration, the Company will make Customer Content available for export for a limited period and will thereafter delete or de-identify Customer Content in accordance with the Company's retention practices, unless a longer retention period is required or permitted by law.\r 3956\r 3957 - **Restricted and Regulated Data.** Unless expressly permitted in an applicable Order Form or written amendment, Customer will not upload to the Service: (a) payment card data subject to PCI DSS; (b) protected health information regulated by HIPAA; (c) classified, controlled unclassified, or export-controlled government information; or (d) other highly sensitive data requiring special safeguards beyond those generally provided by the Service ("Restricted Data").\r 3958\r 3959 - **Customer Responsibilities.** Customer is solely responsible for providing required notices and obtaining necessary consents and authorizations; ensuring Customer Content is lawfully collected, used, and disclosed; and complying with applicable privacy, data protection, and sector-specific laws.\r 3960\r 3961 - **International Transfers.** Customer acknowledges that the Service may be provided from, and Customer Content may be processed in, the United States and other countries. Where required by applicable law, international transfers will be addressed through the DPA and applicable transfer mechanisms.\r 3962\r 3963 - **Regulatory Transparency.** This disclosure is intended to support transparency obligations under applicable U.S. consumer protection and privacy laws. To the extent the Company processes personal information subject to state privacy laws on behalf of Customer, the Company will process such data as a service provider/processor for the business purposes described in this Appendix and the DPA (if applicable).\r 3964\r 3965 - **No Waiver; Limitation of Liability.** Nothing in this Appendix modifies or limits the AI disclaimers, restricted use provisions, limitation of liability, or indemnification obligations set forth elsewhere in the parties' agreement.\r 3966\r 3967 \r 3968 \r 3969 \r 3970 \r 3971 \r 3972 );\r 3973};\r 3974`,NO_INSTRUCTIONS_REPLY="I don't have instructions for that yet. Please contact support.",STOP_WORDS=new Set(["a","an","the","and","or","to","of","in","on","for","is","are","how","what","where","when","why","do","i","can","me","my","with","this","that","it","be","you","your","from","about"]);function splitSections(Ee){const Re=String(Ee||"").split(/\r?\n/),Te=[];let je={title:"Overview",body:[]};return Re.forEach(Oe=>{const Me=Oe.match(/^#{1,3}\s+(.+)$/);if(Me){(je.body.length>0||je.title!=="Overview")&&Te.push({title:je.title,text:je.body.join(` 3975`).trim()}),je={title:Me[1].trim(),body:[]};return}je.body.push(Oe)}),(je.body.length>0||Te.length===0)&&Te.push({title:je.title,text:je.body.join(` 3976`).trim()}),Te.filter(Oe=>Oe.text.length>0)}function splitLegalSections(Ee){const Re=String(Ee||"").split(/\r?\n/),Te=[];let je=null;return Re.forEach(Oe=>{const Me=Oe.match(/^##\s+(.+)$/);if(Me){je&&Te.push({title:je.title,text:je.body.join(` 3977`).trim()}),je={title:Me[1].trim(),body:[]};return}je&&je.body.push(Oe)}),je&&Te.push({title:je.title,text:je.body.join(` 3978`).trim()}),Te.filter(Oe=>Oe.text.length>0)}function tokenize(Ee){return String(Ee||"").toLowerCase().replace(/[^a-z0-9\s/-]/g," ").split(/\s+/).filter(Re=>Re.length>2&&!STOP_WORDS.has(Re))}function isHowToQuestion(Ee){return/\b(how\s+(to|do\s+i|can\s+i)|steps?\s+to|walk\s+me\s+through|show\s+me\s+how)\b/i.test(String(Ee||""))}function isHelpAssistantQuestion(Ee){return isHowToQuestion(Ee)?!0:/\b(what|which|who|why|can i|when|where)\b/i.test(String(Ee||""))}function isConceptualQuestion(Ee){return isHelpAssistantQuestion(Ee)?!1:/\b(what is|what are|tell me about|explain|describe|define)\b/i.test(String(Ee||""))}const USER_MANAGEMENT_Q=/\b(user|users|invite|invitation|licenses?|role|pending requests?|registration requests?|suspend|activate|super admin|add user|resend invite|cancel invite|lock user|unlock user|delete user|restore user)\b/i;function isUserManagementQuestion(Ee){return USER_MANAGEMENT_Q.test(String(Ee||""))}const MIN_SECTION_SCORE=10,MIN_SUBSECTION_SCORE=10,FAQ_HEADING_PATTERN="(?:How|What|Why|Can|Who|Which)",HELP_QUERY_ALIASES={"how to use agent apps":"How do I use an Agent App?","how to use agent app":"How do I use an Agent App?","common help questions":"Common help questions","common help question":"Common help questions","how do i login with google sso":"How do I sign in with Google SSO?","how do i login with google":"How do I sign in with Google SSO?","how do i update my profile information":"How do I edit my profile?","how do i update my name":"How do I edit my profile?","how do i update my profile name":"How do I edit my profile?","how do i delete a chat":"How do I delete a chat session?","how do i delete a group":"How do I delete a group?","how do i view members of a group":"How do I view members of a group?","how do i assign a group admin":"How do I make a member a group admin?","how do i check my license pool":"How do I check my license pool?","how do i upgrade my subscription":"How do I upgrade my subscription?","how to upgrade your subscription":"How do I upgrade my subscription?","how do i cancel my subscription":"How do I cancel my subscription?","how do i view my billing history":"How do I view billing history?","how do i download an invoice":"How do I download an invoice?","how do i add a database connection":"How do I add a database connector?","how do i select a site/folder from sharepoint":"How do I select a site or folder from SharePoint?","how do i reprocess failed files":"How do I reprocess failed connector files?","how do i process files from sharepoint":"How do I process files from SharePoint?","how do i process files from google drive":"How do I process files from Google Drive?","how do i add custom instructions":"How do I add additional instructions in Chat?","how do i assign a view only user":"How do I assign a View Only user?","how do i assign a view-only user":"How do I assign a View Only user?","how do i create a view only user":"How do I assign a View Only user?","how do i add a view only user":"How do I assign a View Only user?","how do i set a user as view only":"How do I assign a View Only user?","how do i change a user to view only":"How do I assign a View Only user?","how do i use voice conversation":"How to use voice conversation in Chat?","how to use voice conversation in chat":"How to use voice conversation in Chat?","how to use voice conversation":"How to use voice conversation in Chat?","how to lock strict mode for all users":"How to lock strict mode for all users?","how to lock presets for all users":"How to lock presets for all users?","how to lock preset for all users":"How to lock presets for all users?","how to lock document settings for all users":"How to lock document settings for all users?","how to lock content preferences for all users":"How to lock content preferences for all users?","how to lock additional instructions for all users":"How to lock additional instructions for all users?","how to export a chat":"How to export a chat?","how do i export a chat":"How to export a chat?","how to share a chat":"How to share a chat?","how do i share a chat":"How to share a chat?","how to switch on/off dark mode":"How to switch dark mode on or off?","how to switch dark mode on or off":"How to switch dark mode on or off?","how to turn dark mode on or off":"How to switch dark mode on or off?","how to log a support ticket":"How to log a support ticket?","how do i log a support ticket":"How to log a support ticket?","how to submit a support ticket":"How to log a support ticket?"};function normalizeHelpQuestion(Ee){const Re=String(Ee||"").trim();if(!Re)return Re;const Te=Re.toLowerCase().replace(/\?+$/,"").trim();return HELP_QUERY_ALIASES[Te]||Re}function isCommonHelpOverviewQuestion(Ee){return/^common help questions?$/i.test(String(Ee||"").trim())}function extractReferencedHowToQuery(Ee){const Re=String(Ee||""),Te=[/\*How do I[^*]+\*/i,/\*How to[^*]+\*/i,/\*\*How do I[^*]+\*\*/i,/\*\*How to[^*]+\*\*/i];for(const je of Te){const Oe=Re.match(je);if(Oe)return Oe[0].replace(/^\*+|\*+$/g,"").trim()}return null}function listHowToTopicsFromSection(Ee){return[...String((Ee==null?void 0:Ee.text)||"").matchAll(new RegExp(`####\\s+(${FAQ_HEADING_PATTERN}[^\\n]+)`,"gi"))].map(Re=>
3978Re[1].trim()).filter(Boolean)}function buildCommonHelpOverviewAnswer(Ee){const Re=listHowToTopicsFromSection(Ee);return Re.length===0?NO_INSTRUCTIONS_REPLY:`Common help topics â pick one below or ask with **How do Iâ¦**: 3979 3980${Re.map((je,Oe)=>`${Oe+1}. ${je}`).join(` 3981`)}`}function buildCommonHelpOverviewSources(Ee,Re=0){return listHowToTopicsFromSection(Ee).slice(0,4).map((je,Oe)=>({id:`kb-overview-${Re+Oe}-${je}`,filepath:Ee.filepath,title:je,snippet:je,score:Ee.score||0,clickQuery:je.endsWith("?")?je:`${je}?`}))}const HELP_TOPIC_MATCHES=[{question:/\buser management\b|\bopen users\b/i,heading:/open user management/i,boost:30},{question:/\binvite\b.*\buser\b|\badd user\b|\binvite a user\b/i,heading:/invite a user|add user/i,boost:30,questionExclude:/\bview\s*-?\s*only\b/i},{question:/\bview\s*-?\s*only\b/i,heading:/assign a view only user|view only/i,boost:32},{question:/\bchange\b.*\brole\b|\buser.?s?\b.*\brole\b/i,heading:/change a user's role/i,boost:28,questionExclude:/\bview\s*-?\s*only\b/i},{question:/\bgoogle\b.*\b(sso|sign|login)\b|\b(sso|sign|login)\b.*\bgoogle\b/i,heading:/sign in with google|google or microsoft sso/i,boost:30},{question:/\b(update|edit)\b.*\b(profile|name)\b|\b(profile|name)\b.*\b(update|edit)\b/i,heading:/edit your profile/i,boost:28},{question:/\bfile types?\b|\bsupported\b.*\bupload\b|\bupload\b.*\btypes?\b/i,heading:/file types are supported/i,boost:30},{question:/\b(maximum|max)\b.*\b(file )?size\b|\bfile size\b/i,heading:/maximum file size/i,boost:30},{question:/\bdrag\b.*\bdrop\b|\bdrop\b.*\bfiles?\b/i,heading:/drag and drop/i,boost:30},{question:/\bpending approval\b|\bwhy\b.*\bpending\b/i,heading:/pending approval/i,boost:30},{question:/\bwho\b.*\bapprove\b.*\bdocument\b|\bapprove\b.*\bdocument\b.*\bwho\b/i,heading:/who can approve/i,boost:30},{question:/\breason\b.*\breject\b|\breject\b.*\breason\b/i,heading:/reason for rejection/i,boost:30},{question:/\bdelete\b.*\bchat\b|\bchat\b.*\bdelete\b/i,heading:/delete a chat/i,boost:30},{question:/\bdelete\b.*\bgroup\b|\bgroup\b.*\bdelete\b/i,heading:/delete a group/i,boost:30,questionExclude:/\buser\b/i},{question:/\bview\b.*\bmembers?\b.*\bgroup\b|\bmembers?\b.*\bgroup\b/i,heading:/view members of a group/i,boost:30},{question:/\b(assign|make)\b.*\bgroup admin\b|\bgroup admin\b/i,heading:/make a member a group admin/i,boost:30,questionExclude:/\bsuper group admin\b/i},{question:/\blicense pool\b|\bcheck\b.*\blicen/i,heading:/check your license pool|license pool/i,boost:28},{question:/\bupgrade\b.*\bsubscription\b|\bsubscription\b.*\bupgrade\b/i,heading:/upgrade your subscription|upgrade or buy/i,boost:28},{question:/\bcancel\b.*\bsubscription\b|\bsubscription\b.*\bcancel\b/i,heading:/cancel your subscription/i,boost:30},{question:/\bbilling history\b|\binvoice\b/i,heading:/billing history|download an invoice/i,boost:30},{question:/\bdownload\b.*\binvoice\b|\binvoice\b.*\bdownload\b/i,heading:/download an invoice/i,boost:28},{question:/\bdisconnect\b.*\bgoogle drive\b|\bgoogle drive\b.*\bdisconnect\b/i,heading:/disconnect google drive/i,boost:30},{question:/\bprocess\b.*\bgoogle drive\b|\bgoogle drive\b.*\bprocess\b/i,heading:/process files from google drive/i,boost:30},{question:/\bconnect\b.*\bsharepoint\b|\bsharepoint\b.*\bconnect\b/i,heading:/connect sharepoint/i,boost:30},{question:/\bselect\b.*\b(site|folder)\b.*\bsharepoint\b|\bsharepoint\b.*\b(site|folder)\b/i,heading:/select a site.*folder from sharepoint/i,boost:30},{question:/\bdisconnect\b.*\bsharepoint\b|\bsharepoint\b.*\bdisconnect\b/i,heading:/disconnect sharepoint/i,boost:30},{question:/\bprocess\b.*\bsharepoint\b|\bsharepoint\b.*\bprocess\b/i,heading:/process files from sharepoint/i,boost:30},{question:/\bsync\b.*\bnew\b.*\bfiles?\b|\bnew\b.*\bfiles?\b.*\bsync\b/i,heading:/sync new connector files/i,boost:30},{question:/\breprocess\b.*\bfailed\b|\bfailed\b.*\bfiles?\b/i,heading:/reprocess failed/i,boost:30},{question:/\badd\b.*\bdatabase\b.*\bconnection\b|\bdatabase\b.*\bconnection\b.*\badd\b/i,heading:/add a database connector|add a database connection/i,boost:30},{question:/\btest\b.*\bdatabase\b.*\bconnection\b|\bdatabase\b.*\bconnection\b.*\btest\b/i,heading:/test a database connection/i,boost:30},{question:/\bedit\b.*\bdatabase\b.*\bconnection\b|\bdatabase\b.*\bconnection\b.*\bedit\b/i,heading:/edit a database connection/i,boost:30},{question:/\bdelete\b.*\bdatabase\b.*\bconnection\b|\bdatabase\b.*\bconnection\b.*\bdelete\b/i,heading:/delete a database connection/i,boost:30},{question:/\bdatabase types?\b|\bwhat\b.*\bdatabase\b.*\bsupported\b/i,heading:/database types are supported/i,boost:30},{question:/\bcustom instructions?\b|\badditional instructions?\b/i,heading:/additional instructions in chat/i,boost:28,questionExclude:/\block\b/i},{question:/\b(create|edit|rename|new)\b.*\bchat\b|\bchat\b.*\b(create|edit|rename|new)\b/i,heading:/create or edit a chat|start a new chat|rename a conversation/i,boost:24},{question:/\bexport\b.*\bchat\b|\bchat\b.*\bexport\b/i,heading:/export a chat/i,boost:32},{question:/\bshare\b.*\bchat\b|\bchat\b.*\bshare\b/i,heading:/share a chat|share a message/i,boost:32},{question:/\bdark\b.*\bmode\b|\bmode\b.*\bdark\b/i,heading:/switch dark mode|dark mode/i,boost:30},{question:/\bsupport\b.*\bticket\b|\bticket\b.*\bsupport\b|\blog\b.*\bsupport\b/i,heading:/log a support ticket|contact support/i,boost:32},{question:/\block\b.*\bstrict\b|\bstrict\b.*\block\b/i,heading:/lock strict mode for all users/i,boost:34},{question:/\block\b.*\bpresets?\b|\bpresets?\b.*\block\b/i,heading:/lock presets? for all users/i,boost:34},{question:/\block\b.*\bdocument\b.*\bsetting\b|\bdocument\b.*\bsetting\b.*\block\b/i,heading:/lock document settings for all users/i,boost:34},{question:/\block\b.*\bcontent\b.*\bpreference\b|\bcontent\b.*\bpreference\b.*\block\b/i,heading:/lock content preferences for all users/i,boost:34},{question:/\block\b.*\badditional\b.*\binstruction\b|\badditional\b.*\binstruction\b.*\block\b/i,heading:/lock additional instructions for all users/i,boost:34},{question:/\bresponse\s*styles?\b/i,heading:/response style/i,boost:24},{question:/\bvoice\b/i,heading:/voice conversation|voice input/i,boost:28,questionExclude:/\binvoice\b/i},{question:/\b(model|models)\b/i,questionExclude:/\badmin\b/i,heading:/change models? in chat|change the chat model/i,questionRequire:/\bchat\b/i,boost:26},{question:/\badd\b.*\bmodel\b/i,heading:/add a cloud model/i,questionExclude:/\bchat\b/i,boost:24},{question:/\bstrict\b/i,heading:/strict mode/i,boost:24,questionExclude:/\block\b/i},{question:/\bagent\b/i,heading:/use an agent|open an agent|agent app/i,boost:24},{question:/\b(add|edit)\b.*\bfavorite\b|\bfavorite\b.*\b(add|edit)\b/i,heading:/add or edit a favorite/i,boost:24},{question:/\buse\b.*\bfavorite\b|\bfavorite\b.*\buse\b/i,heading:/use a favorite prompt/i,headingExclude:/\b(add|edit|delete)\b/i,boost:24},{question:/\bfavorite\b.*\b(all users|everyone|shared|global)\b/i,heading:/favorite prompt for all users/i,boost:28},{question:/\bapprove\b.*\bdocument\b|\bdocument\b.*\bapprove\b/i,heading:/approve a document|approve a pending document/i,boost:24,questionExclude:/\bwho\b/i},{question:/\breject\b.*\bdocument\b|\bdocument\b.*\breject\b/i,heading:/reject a document|reject a pending document/i,boost:24,questionExclude:/\bwhy\b/i},{question:/\bview\b.*\bdocument\b|\bdocument\b.*\bview\b|\bpreview\b.*\bdocument\b/i,heading:/view a document|preview a document/i,boost:24},{question:/\bchange\b.*\b(group|groups)\b.*\bdocument\b|\bdocument\b.*\bgroup\b/i,heading:/change a document's group|change a document group/i,boost:24},{question:/\bcreate\b.*\bgroup\b/i,heading:/create a group/i,boost:24},{question:/\bedit\b.*\bgroup\b/i,heading:/edit a group/i,boost:24},{question:/\bremove\b.*\b(member|user)\b.*\bgroup\b|\bgroup\b.*\bremove\b/i,heading:/remove a member from a group/i,boost:24},{question:/\bchange\b.*\bpassword\b/i,heading:/change your password/i,boost:24},{question:/\breset\b.*\bpassword\b|\bforgot\b.*\bpassword\b/i,heading:/reset a forgotten password|forgotten password/i,boost:24},{question:/\bprofile\b.*\b(picture|photo|image|avatar)\b|\b(picture|photo|image|avatar)\b.*\bprofile\b/i,heading:/change your profile picture/i,boost:26}];function scoreHelpTopicMatch(Ee,{heading:Re="",sectionText:Te=""}={}){const je=String(Ee||""),Oe=`${Re} 3982${Te}`.toLowerCase();let Me=0;return HELP_TOPIC_MATCHES.forEach(De=>{if(De.question&&!De.question.test(je)||De.questionExclude&&De.questionExclude.test(je)||De.questionRequire&&!De.questionRequire.test(je))return;const $e=De.heading;if(!(De.headingExclude&&$e&&$e.test(Re)&&De.headingExclude.test(Re))){if($e&&$e.test(Re)){Me+=De.boost;return}$e&&$e.test(Oe)&&(Me+=Math.max(De.boost-6,8))}}),/common help questions/i.test(Oe)&&isHelpAssistantQuestion(je)&&(Me+=6),Me}function sectionHasActionableSteps(Ee){return new RegExp(`####?\\s+${FAQ_HEADING_PATTERN}`,"i").test(Ee.text)||/\n\d+\.\s/.test(Ee.text)}function isConceptualLine(Ee){const Re=String(Ee||"").trim();return!!(!Re||/^\|/.test(Re)||/\|$/.test(Re)||/^#{1,6}\s/.test(Re)||/^Purpose:/i.test(Re)||/^Path:/i.test(Re)||/^[-*]{3,}$/.test(Re)||/^(OpenParser AI is|Depending on your|Product name:|Footer:|Related links|This is the official|Typically |Usually |No\. It answers)/i.test(Re)||/^(Documents|Groups|Websites|Databases)\s*=/i.test(Re))}function isActionableLine(Ee){const Re=String(Ee||"").trim();return isConceptualLine(Re)?!1:!!(/^\d+\.\s+/.test(Re)||/^[-*]\s+/.test(Re)&&/\*\*[^*]+\*\*/.test(Re)||/â/.test(Re))}function normalizeStep(Ee){return String(Ee||"").trim().replace(/^\d+\.\s+/,"").replace(/^[-*]\s+/,"").replace(/\s+/g," ").trim()}function extractStepsFromBlock(Ee,{onlyHowToSubsections:Re=!1,question:Te=""}={}
3982){const je=String(Ee||""),Oe=[],Me=new Set,De=Be=>{const Ue=normalizeStep(Be);if(!Ue||isConceptualLine(Ue))return;const ze=Ue.toLowerCase().replace(/\*\*/g,"");Me.has(ze)||(Me.add(ze),Oe.push(Ue))},$e=[...je.matchAll(new RegExp(`####?\\s+(${FAQ_HEADING_PATTERN}[^\\n]*)\\n([\\s\\S]*?)(?=\\r?\\n####?|\\r?\\n###|\\r?\\n##|$)`,"gi"))];if(Te&&$e.length>0){const Be=$e.map(ze=>{const We=ze[1].trim(),Xe=ze[2],He=`${We} 3983${Xe}`.toLowerCase();let qe=0;return tokenize(Te).forEach(Ge=>{We.toLowerCase().includes(Ge)&&(qe+=3),He.includes(Ge)&&(qe+=1)}),qe+=scoreHelpTopicMatch(Te,{heading:We}),/open user management/i.test(We)&&/\b(user management|open users)\b/i.test(Te)&&(qe+=20),/use a favorite prompt in chat/i.test(We)&&/\buse\b/i.test(Te)&&/\bfavorite/i.test(Te)&&(qe+=8),/how to upload a document/i.test(We)&&/\bupload\b/i.test(Te)&&/\bdocument/i.test(Te)&&(qe+=15),/how to read terms/i.test(We)&&/\bread\b/i.test(Te)&&/\bterms\b/i.test(Te)&&(qe+=12),/lock strict mode for all users|lock presets? for all users|lock document settings|lock content preferences|lock additional instructions/i.test(We)&&/\block\b/i.test(Te)&&(qe+=18),/voice conversation|voice input/i.test(We)&&/\bvoice\b/i.test(Te)&&(qe+=16),/export a chat/i.test(We)&&/\bexport\b/i.test(Te)&&/\bchat\b/i.test(Te)&&(qe+=16),/share a chat|share a message/i.test(We)&&/\bshare\b/i.test(Te)&&/\bchat\b/i.test(Te)&&(qe+=16),/log a support ticket|contact support/i.test(We)&&(/\bticket\b/i.test(Te)||/\blog\b.*\bsupport\b/i.test(Te))&&(qe+=16),/switch dark mode|dark mode/i.test(We)&&/\bdark\b/i.test(Te)&&/\bmode\b/i.test(Te)&&(qe+=16),{match:ze,heading:We,score:qe}}).filter(ze=>ze.score>=MIN_SUBSECTION_SCORE).sort((ze,We)=>We.score-ze.score);if(Be.length===0)return[];const Ue=Be[0].match;return extractStepsFromBlock(Ue[2],{onlyHowToSubsections:!1}).forEach(ze=>De(ze)),Oe}return Re&&$e.length>0?($e.slice(0,1).forEach(Be=>{extractStepsFromBlock(Be[2],{onlyHowToSubsections:!1}).forEach(Ue=>De(Ue))}),Oe):(je.split(` 3984`).forEach(Be=>{isActionableLine(Be)&&De(Be)}),Oe)}function scoreSection(Ee,Re,Te){if(Re.length===0)return 0;const je=`${Ee.title} 3985${Ee.text}`.toLowerCase();let Oe=0;if(Re.forEach(De=>{Ee.title.toLowerCase().includes(De)&&(Oe+=4),je.includes(De)&&(Oe+=1)}),isHowToQuestion(Te)||isHelpAssistantQuestion(Te)){/how to/i.test(Ee.title)&&(Oe+=10),new RegExp(`####?\\s+${FAQ_HEADING_PATTERN}`,"i").test(Ee.text)&&(Oe+=8),/\n\d+\.\s/.test(Ee.text)&&(Oe+=5),/application user flows/i.test(Ee.title)&&(Oe+=12),/quick workflow cheat sheets/i.test(Ee.title)&&(Oe+=8);const De=String(Te||"").toLowerCase();/\b(terms|privacy|conditions)\b/.test(De)&&/\bread\b/.test(De)&&(/how to read terms/i.test(Ee.text)&&(Oe+=25),/terms & conditions \(user guide\)/i.test(Ee.title)&&(Oe+=12)),/\bterms acceptance\b/.test(De)&&/terms acceptance/i.test(Ee.text)&&(Oe+=20),/\b(terms|privacy|conditions)\b/.test(De)&&!/\b(license|purchase|buy|subscribe)\b/.test(De)&&/purchase licenses/i.test(Ee.title)&&(Oe-=12)}/application user flows/i.test(Ee.title)&&(Oe+=4),/quick workflow cheat sheets/i.test(Ee.title)&&(Oe+=3),/user management/i.test(Ee.title)&&(isUserManagementQuestion(Te)?Oe+=12:Oe-=24);const Me=String(Te||"").toLowerCase();return/\b(group|groups|member)\b/.test(Me)&&!isUserManagementQuestion(Te)&&(/^groups$/i.test(Ee.title.trim())&&(Oe+=22),/how to delete a group|how to view members of a group|make a member a group admin/i.test(Ee.text)&&(Oe+=18)),/\b(connector|google drive|sharepoint|database|sync|reprocess|disconnect)\b/i.test(Me)&&(/connectors/i.test(Ee.title)&&(Oe+=18),/common help questions/i.test(Ee.text)&&(Oe+=14)),/\b(upload|file types?|drag|drop|pending approval|invoice|billing|subscription|license pool)\b/i.test(Me)&&((/documents/i.test(Ee.title)||/common help questions/i.test(Ee.title))&&(Oe+=14),(/^subscription$/i.test(Ee.title.trim())||/subscription \(tenant admin\)/i.test(Ee.title))&&(Oe+=12)),/\block\b/i.test(Me)&&/\b(strict|presets?|document|content|additional|chat settings)\b/i.test(Me)&&/chat settings/i.test(Ee.title)&&(Oe+=28),/\b(export|share)\b/i.test(Me)&&/\bchat\b/i.test(Me)&&(/^chat$/i.test(Ee.title.trim())||/common help questions/i.test(Ee.title))&&(Oe+=20),/\bdark\b/i.test(Me)&&/\bmode\b/i.test(Me)&&/support, tour, and help/i.test(Ee.title)&&(Oe+=22),/\b(support|ticket)\b/i.test(Me)&&/\b(log|submit|contact)\b/i.test(Me)&&/support, tour, and help/i.test(Ee.title)&&(Oe+=22),/\bvoice\b/i.test(Me)&&!/\binvoice\b/i.test(Me)&&(/^chat$/i.test(Ee.title.trim())||/common help questions/i.test(Ee.title))&&(Oe+=18),/\b(purchase|buy|license|licenses|subscribe)\b/.test(Me)&&/purchase licenses/i.test(Ee.title)&&(Oe+=10),/\bupload\b/.test(Me)&&/\bdocument/.test(Me)&&(/^documents$/i.test(Ee.title.trim())&&(Oe+=22),/how to upload a document/i.test(Ee.text)&&(Oe+=25),/purchase licenses/i.test(Ee.title)&&(Oe-=18)),/\b(purchase|buy)\b/i.test(String(Te||""))&&/\b(license|licenses)\b/i.test(String(Te||""))&&(/purchase licenses/i.test(Ee.text)||/purchase additional licenses/i.test(Ee.text))&&(Oe+=8),/\b(user|users|invite|invitation|license)\b/i.test(String(Te||""))&&/user management/i.test(Ee.text)&&(Oe+=5),/TERMS_AND_CON
3985DITIONS|PRIVACY_POLICY/.test(Ee.filepath)&&!sectionHasActionableSteps(Ee)&&(Oe-=25),Ee.filepath==="USER_HELP_KNOWLEDGE_BASE.md"&§ionHasActionableSteps(Ee)&&(Oe+=4),Oe+=scoreHelpTopicMatch(Te,{heading:Ee.title,sectionText:Ee.text}),/common help questions/i.test(Ee.text)&&isHelpAssistantQuestion(Te)&&(Oe+=10),/\bagent\b/i.test(Me)&&/how to use an agent app/i.test(Ee.text)&&(Oe+=18),isHowToQuestion(Te)&&/\b(terms|privacy|policy)\b/.test(Me)&&/how to read terms/i.test(Ee.text)&&(Oe+=15),Oe}function dedupeSteps(Ee){const Re=new Set;return Ee.filter(Te=>{const je=Te.toLowerCase().replace(/\*\*/g,"").trim();return!je||Re.has(je)?!1:(Re.add(je),!0)})}function formatNumberedSteps(Ee){return Ee.map((Re,Te)=>`${Te+1}. ${Re}`).join(` 3986`)}function isAnswerRelevant(Ee,Re){const Te=String(Ee||"").trim(),je=String(Re||"").trim().toLowerCase();if(!je||je===NO_INSTRUCTIONS_REPLY.toLowerCase()||/super admin|main tenant|super group admin/i.test(je)&&!/\b(suspend|activate|super admin|super group admin|invite)\b/i.test(Te)||/open \*\*users\*\*|user management/i.test(je)&&!isUserManagementQuestion(Te)&&!/\buser management\b/i.test(Te)||[/search users/i,/roles filter/i,/pending requests/i,/table.*grid|grid.*table/i,/refresh.*icon/i].filter(ze=>ze.test(je)).length>=3&&!/\b(search users|filter.*role|pending request|refresh)\b/i.test(Te))return!1;if(scoreHelpTopicMatch(Te,{sectionText:je})>=MIN_SUBSECTION_SCORE||["google drive","sharepoint","license pool","billing history","database connection","custom instructions","voice conversation","voice input","microphone","export chat","support ticket","dark mode","lock strict mode","lock preset","lock document settings","lock content preferences","lock additional instructions"].some(ze=>Te.toLowerCase().includes(ze)&&je.includes(ze)))return!0;const $e=tokenize(Te).filter(ze=>ze.length>2);if($e.length===0)return!0;const Be=$e.filter(ze=>je.includes(ze)).length,Ue=Math.min(2,$e.length);return Be>=Ue}function buildSourceClickQuery(Ee,Re){const Te=String((Ee==null?void 0:Ee.text)||""),je=String((Ee==null?void 0:Ee.title)||"").trim(),Oe=normalizeHelpQuestion(Re);if(/^common help questions$/i.test(je))return"Common help questions";const Me=[...Te.matchAll(new RegExp(`####\\s+(${FAQ_HEADING_PATTERN}[^\\n]+)`,"gi"))];if(!sectionHasActionableSteps(Ee)){const De=extractReferencedHowToQuery(Te);if(De)return De.endsWith("?")?De:`${De}?`;const $e=HELP_QUERY_ALIASES[je.toLowerCase()];if($e&&$e!==je)return $e.endsWith("?")?$e:`${$e}?`}if(Me.length>0){const De=isCommonHelpOverviewQuestion(Oe)?"":Oe,$e=Me.map(Be=>{const Ue=Be[1].trim();let ze=scoreHelpTopicMatch(De,{heading:Ue});return tokenize(De).forEach(We=>{Ue.toLowerCase().includes(We)&&(ze+=2)}),{heading:Ue,score:ze}}).filter(Be=>Be.score>0).sort((Be,Ue)=>Ue.score-Be.score);if($e.length>0){const Be=$e[0].heading;return Be.endsWith("?")?Be:`${Be}?`}if(Me.length===1){const Be=Me[0][1].trim();return Be.endsWith("?")?Be:`${Be}?`}}if(/^how to /i.test(je)){const De=normalizeHelpQuestion(je);return De.endsWith("?")?De:`${De}?`}return`How do I use ${je}?`}function canAnswerHelpQuery(Ee,Re){const Te=normalizeHelpQuestion(Re);if(!Te)return!1;if(isCommonHelpOverviewQuestion(Te))return splitSectionsFromSources(normalizeKnowledgeSources(Ee)).some(Me=>/common help questions/i.test(Me.title));const{reply:je}=answerFromKnowledgeBase(Ee,Te,{skipSourceFilter:!0});return je!==NO_INSTRUCTIONS_REPLY}function filterUsableSources(Ee,Re,Te){return Re.filter(je=>{const Oe=je.clickQuery||buildSourceClickQuery(je,Te);return sectionHasActionableSteps(je)&&formatAnswer([je],Oe)!==NO_INSTRUCTIONS_REPLY?!0:canAnswerHelpQuery(Ee,Oe)})}function mapSourceForList(Ee,Re,Te){const je=buildSourceClickQuery(Ee,Te);return{id:`kb-${Re}-${Ee.title}`,filepath:Ee.filepath,title:Ee.title,snippet:Ee.text.slice(0,180),score:Ee.score,clickQuery:je}}function buildHelpMeta({ranked:Ee,reply:Re,knowledgeSource:Te}){return{used_context:Ee.length>0&&Re!==NO_INSTRUCTIONS_REPLY,retrieval_mode:"frontend_knowledge_base",knowledge_source:Te,assistant_rules:"step_by_step_only"}}function formatAnswer(Ee,Re){if(!Ee.length)return NO_INSTRUCTIONS_REPLY;const Te=Ee.filter(Oe=>sectionHasActionableSteps(Oe)),je=Te.length>0?Te:Ee;for(const Oe of je){const Me=dedupeSteps(extractStepsFromBlock(Oe.text,{onlyHowToSubsections:!0,question:Re}));if(Me.length===0)continue;const De=formatNumberedSteps(Me.slice(0,8));if(isAnswerRelevant(Re,De))return De}return NO_INSTRUCTIONS_REPLY}function splitSectionsFromSources(Ee){const Re=[];return Ee.forEach(({filepath:Te,markdown:je})=>
3986{(/TERMS_AND_CONDITIONS|PRIVACY_POLICY/.test(Te)?splitLegalSections(je):splitSections(je)).forEach(Me=>{Re.push({...Me,filepath:Te})})}),Re}function normalizeKnowledgeSources(Ee){return Array.isArray(Ee)?Ee:[{filepath:"USER_HELP_KNOWLEDGE_BASE.md",markdown:Ee}]}function answerFromKnowledgeBase(Ee,Re,Te={}){const je=normalizeKnowledgeSources(Ee),Oe=je.map(Xe=>Xe.filepath).join(", "),Me=normalizeHelpQuestion(Re),De=!!Te.skipSourceFilter;if(isCommonHelpOverviewQuestion(Me)){const He=splitSectionsFromSources(je).find(Ye=>/common help questions/i.test(Ye.title));if(!He)return{reply:NO_INSTRUCTIONS_REPLY,sources:[],meta:buildHelpMeta({ranked:[],reply:NO_INSTRUCTIONS_REPLY,knowledgeSource:Oe})};const qe=buildCommonHelpOverviewAnswer(He),Ge=buildCommonHelpOverviewSources(He);return{reply:qe,sources:Ge,meta:buildHelpMeta({ranked:[He],reply:qe,knowledgeSource:Oe})}}if(isConceptualQuestion(Me))return{reply:NO_INSTRUCTIONS_REPLY,sources:[],meta:{used_context:!1,retrieval_mode:"frontend_knowledge_base",knowledge_source:Oe,assistant_rules:"step_by_step_only"}};const $e=splitSectionsFromSources(je),Be=tokenize(Me),Ue=$e.map(Xe=>({...Xe,score:scoreSection(Xe,Be,Me)})).filter(Xe=>Xe.score>0).sort((Xe,He)=>He.score-Xe.score).slice(0,3);if(Ue.length===0||Ue[0].score<MIN_SECTION_SCORE)return{reply:NO_INSTRUCTIONS_REPLY,sources:[],meta:buildHelpMeta({ranked:[],reply:NO_INSTRUCTIONS_REPLY,knowledgeSource:Oe})};const ze=formatAnswer(Ue,Me);if(ze===NO_INSTRUCTIONS_REPLY)return{reply:NO_INSTRUCTIONS_REPLY,sources:[],meta:buildHelpMeta({ranked:[],reply:NO_INSTRUCTIONS_REPLY,knowledgeSource:Oe})};const We=De?Ue.map((Xe,He)=>mapSourceForList(Xe,He,Me)):filterUsableSources(je,Ue.map((Xe,He)=>mapSourceForList(Xe,He,Me)),Me);return{reply:ze,sources:We,meta:buildHelpMeta({ranked:Ue,reply:ze,knowledgeSource:Oe})}}function answerFromKnowledgeBaseSection(Ee,Re,Te,je={}){const Oe=normalizeKnowledgeSources(Ee),Me=Oe.map(qe=>qe.filepath).join(", "),$e=splitSectionsFromSources(Oe).find(qe=>qe.title===Re),Be=je.clickQuery?normalizeHelpQuestion(je.clickQuery):null;if(!$e){const qe=normalizeHelpQuestion(Be||Te||Re||"");return answerFromKnowledgeBase(Ee,qe)}if(isCommonHelpOverviewQuestion(Te)||isCommonHelpOverviewQuestion(Re))return answerFromKnowledgeBase(Ee,"Common help questions");const Ue=Be||(String(Te||"").trim().toLowerCase()===Re.trim().toLowerCase()?Re:Te)||Re,ze=Be||buildSourceClickQuery($e,Ue);let We=sectionHasActionableSteps($e)?formatAnswer([$e],ze):NO_INSTRUCTIONS_REPLY;if(We===NO_INSTRUCTIONS_REPLY)return answerFromKnowledgeBase(Ee,ze);const Xe=mapSourceForList($e,0,ze),He=filterUsableSources(Oe,[Xe],ze);return{reply:We,sources:He,meta:buildHelpMeta({ranked:[$e],reply:We,knowledgeSource:Me})}}const KNOWLEDGE_SOURCES=[{filepath:"USER_HELP_KNOWLEDGE_BASE.md",markdown:knowledgeBaseMarkdown},{filepath:"TERMS_AND_CONDITIONS.md",markdown:termsMarkdown},{filepath:"PRIVACY_POLICY.md",markdown:privacyMarkdown}],KNOWLEDGE_SOURCE_LABEL=KNOWLEDGE_SOURCES.map(Ee=>Ee.filepath).join(", "),helpService={async getStatus(){return{ok:!0,storage_mode:"frontend",knowledge_source:KNOWLEDGE_SOURCE_LABEL}},async bootstrap(){return{ok:!0,storage_mode:"frontend",knowledge_source:KNOWLEDGE_SOURCE_LABEL}},async sendMessage(Ee){return answerFromKnowledgeBase(KNOWLEDGE_SOURCES,Ee)},async sendMessageFromSource(Ee,Re){return answerFromKnowledgeBaseSection(KNOWLEDGE_SOURCES,Ee,Re)},async submitFeedback(Ee,Re,{question:Te,answer:je,sources:Oe}={}){return(await cachedAxios.put("/help/feedback",{message_id:Ee,rating:Re,question:Te,answer:je,sources:Oe})).data},async clearFeedback(Ee){return(await cachedAxios.delete(`/help/feedback/${encodeURIComponent(Ee)}`)).data}},HelpMessageFeedback=({messageId:Ee,question:Re,answer:Te,sources:je,initialRating:Oe=null})=>{const[Me,De]=reactExports.useState(Oe),[$e,Be]=reactExports.useState(!1);if(!Ee)return null;const Ue=async ze=>{if($e)return;const We=Me;Be(!0),De(ze);try{ze===null?await helpService.clearFeedback(Ee):await helpService.submitFeedback(Ee,ze,{question:Re,answer:Te,sources:je})}catch(Xe){console.error("Failed to save assistant feedback:",Xe),De(We)}finally{Be(!1)}};return jsxRuntimeExports.jsxs(Box,{sx:{display:"inline-flex",alignItems:"center",gap:.25,mt:.5},children:[jsxRuntimeExports.jsx(Tooltip,{title:"Helpful",children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:()=>Ue(Me==="up"?null:"up"),disabled:$e,"aria-label":"Helpful","aria-pressed":Me==="up",sx:{color:Me==="up"?"success.main":"text.secondary",opacity:Me==="up"?1:.7,"&:hover":{opacity:1,color:"success.main"}},children:Me==="up"?jsxRuntimeExports.jsx(ThumbUpAlt,{sx:{fontSize:15}}):jsxRuntimeExports.jsx(ThumbUpOffAlt,{sx:{fontSize:15}})})}),jsxRuntimeExports.jsx(Tooltip,{title:"Not helpful",children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:()=>Ue(Me==="down"?null:"down"),disabled:$e,"aria-label":"Not helpful","aria-pressed":Me==="down",sx:{color:Me==="down"?"error.main":"text.secondary",opacity:Me==="down"?1:.7,"&:hover":{opacity:1,color:"error.main"}},children:Me==="down"?jsxRuntimeExports.jsx(ThumbDownAlt,{sx:{fontSize:15}}):jsxRuntimeExports.jsx(ThumbDownOffAlt,{sx:{fontSize:15}})})})]})},GREETING=`Hi! I'm your OPAI Assistant. Ask clearly with "How do Iâ¦" or "How toâ¦" (for example: How do I approve a document?). I'll reply with numbered step-by-step instructions from the user guide.`,session={open:!1,messages:[{role:"assistant",content:GREETING}
3986],input:""},openListeners=new Set;function getHelpAssistantSession(){return session}function setHelpAssistantOpen(Ee,{notify:Re=!0}={}){const Te=!!Ee;session.open!==Te&&(session.open=Te,Re&&openListeners.forEach(je=>{try{je(Te)}catch{}}))}function subscribeHelpAssistantOpen(Ee){return typeof Ee!="function"?()=>{}:(openListeners.add(Ee),()=>openListeners.delete(Ee))}function setHelpAssistantMessages(Ee){session.messages=Array.isArray(Ee)?Ee:session.messages}function setHelpAssistantInput(Ee){session.input=String(Ee||"")}const createMessageId=()=>typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`help-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,SUGGESTED_QUESTIONS=["How do I upload a document?","How do I approve a document?","How do I use an Agent App?","How do I change models in Chat?","How do I add a favorite prompt for all users?"],truncateChipLabel=(Ee,Re=42)=>{const Te=String(Ee||"").trim();return Te.length<=Re?Te:`${Te.slice(0,Re-1)}â¦`},chipSx={height:"auto",maxWidth:"100%",alignItems:"flex-start","& .MuiChip-label":{display:"block",whiteSpace:"normal",wordBreak:"break-word",lineHeight:1.4,py:.75,textAlign:"left"}},isInternalAppPath=Ee=>/^\/[A-Za-z0-9/_\-?=&%.]*$/.test(String(Ee||"")),HELP_PAGE_ROUTES={chat:"/chat",documents:"/documents/repository","document repository":"/documents/repository",groups:"/groups","agent apps":"/agent-apps",favorites:"/favorites",users:"/admin/users","user management":"/admin/users",connectors:"/admin/connectors",database:"/admin/connectors/database",website:"/admin/connectors/website","cloud drive":"/admin/connectors/cloud_drive","google drive":"/admin/connectors/cloud_drive","google drive bulk":"/admin/connectors/cloud_drive",sharepoint:"/admin/connectors/cloud_drive","sharepoint bulk":"/admin/connectors/cloud_drive",profile:"/profile",analytics:"/analytics",models:"/admin/models","audit logs":"/admin/audit-logs",login:"/login","terms & conditions":"/terms","terms and conditions":"/terms","privacy policy":"/privacy",privacy:"/privacy","terms acceptance":"/terms-acceptance"},isSubscriptionLabel=Ee=>/^subscription$/i.test(String(Ee||"").trim()),isSubscriptionPath=Ee=>/^\/subscription\/?$/i.test(String(Ee||"").trim()),isChatSettingsLabel=Ee=>/^chat settings$/i.test(String(Ee||"").trim()),isChatSettingsPath=Ee=>/^\/admin\/chat-settings\/?$/i.test(String(Ee||"").trim()),isPendingApprovalsLabel=Ee=>/^pending approvals$/i.test(String(Ee||"").trim()),isPendingApprovalsPath=Ee=>/^\/documents\/pending\/?$/i.test(String(Ee||"").trim()),resolveHelpPageRoute=Ee=>{const Re=String(Ee||"").toLowerCase().replace(/\s+/g," ").trim();return Re==="subscription"||Re==="chat settings"||Re==="pending approvals"?null:HELP_PAGE_ROUTES[Re]||null},HelpPageLink=({to:Ee,children:Re,onNavigate:Te})=>jsxRuntimeExports.jsx(Link,{component:"button",type:"button",underline:"hover",color:"primary",onClick:je=>{je.preventDefault(),je.stopPropagation(),Te==null||Te(Ee)},sx:{fontWeight:700,cursor:"pointer",font:"inherit",verticalAlign:"baseline",background:"none",border:"none",padding:0,textAlign:"inherit"},children:Re}),renderFormattedHelpText=(Ee,Re)=>{const Te=String(Ee||"");if(!Te)return null;const je=/(\*\*[^*]+\*\*\s*\(`\/[^`]+`\)|\*\*[^*]+\*\*|`\/[^`]+`|`[^`]+`)/g;return Te.split(je).map((Oe,Me)=>{if(!Oe)return null;const De=Oe.match(/^\*\*([^*]+)\*\*\s*\(`(\/[^`]+)`\)$/);if(De){const[,ze,We]=De;if(isSubscriptionLabel(ze)||isSubscriptionPath(We)||isChatSettingsLabel(ze)||isChatSettingsPath(We)||isPendingApprovalsLabel(ze)||isPendingApprovalsPath(We))return jsxRuntimeExports.jsx("strong",{children:ze},`plain-${Me}`);if(isInternalAppPath(We))return jsxRuntimeExports.jsxs(React$3.Fragment,{children:[jsxRuntimeExports.jsx(HelpPageLink,{to:We,onNavigate:Re,children:ze})," ",jsxRuntimeExports.jsxs(Link,{component:"button",type:"button",underline:"hover",color:"text.secondary",onClick:Xe=>{Xe.preventDefault(),Xe.stopPropagation(),Re==null||Re(We)},sx:{fontFamily:"monospace",fontSize:"0.85em",cursor:"pointer",font:"inherit",verticalAlign:"baseline",background:"none",border:"none",padding:0},children:["(",We,")"]})]},`page-${Me}`)}const $e=Oe.match(/^\*\*([^*]+)\*\*$/);if($e){const ze=$e[1],We=resolveHelpPageRoute(ze);return We?jsxRuntimeExports.jsx(HelpPageLink,{to:We,onNavigate:Re,children:ze},`named-${Me}`):jsxRuntimeExports.jsx("strong",{children:ze},`bold-${Me}`)}const Be=Oe.match(/^`(\/[^`]+)`$/);if(Be&&isInternalAppPath(Be[1])){const ze=Be[1];return isSubscriptionPath(ze)||isChatSettingsPath(ze)||isPendingApprovalsPath(ze)?null:jsxRuntimeExports.jsx(Link,{component:"button",type:"button",underline:"hover",color:"primary",onClick:We=>{We.preventDefault(),We.stopPropagation(),Re==null||Re(ze)},sx:{fontFamily:"monospace",fontSize:"0.9em",fontWeight:600,cursor:"pointer",background:"none",border:"none",padding:0,verticalAlign:"baseline"},children:ze},`path-${Me}`)}const Ue=Oe.match(/^`([^`]+)`$/);return Ue?jsxRuntimeExports.jsx(Box,{component:"span",sx:{fontFamily:"monospace",fontSize:"0.9em"},children:Ue[1]},`code-${Me}`):jsxRuntimeExports.jsx(React$3.Fragment,{children:Oe},`text-${Me}`)})},HelpAssistant=({placement:Ee})=>{var tr;const Re=useLocation(),Te=useNavigate(),je=getHelpAssistantSession(),Oe=Ee||"global",Me=Oe==="chat-input",De=`help-assistant-root help-assistant-root--${Oe}`,[$e,Be]=reactExports.useState(je.open),[Ue,ze]=reactExports.useState(je.messages),[We,Xe]=reactExports.useState(je.input),[He,qe]=reactExports.useState(!1),[Ge,Ye]=reactExports.useState(!1),Ve=reactExports.useRef(null);reactExports.useEffect(()=>{setHelpAssistantOpen($e,{notify:!1})},[$e]),reactExports.useEffect(()=>subscribeHelpAssistantOpen(nr=>{Be(hr=>hr===nr?hr:nr)}),[]),reactExports.useEffect(()=>{setHelpAssistantMessages(Ue)},[Ue]),reactExports.useEffect(()=>{setHelpAssistantInput(We)},[We]);const Ke=reactExports.useCallback(nr=>{!nr||nr===Re.pathname||Te(nr)},[Re.pathname,Te]);reactExports.useEffect(()=>{$e&&(Ye(!0),helpService.bootstrap().finally(()=>Ye(!1)))},[$e]),reactExports.useEffect(()=>{var nr;$e&&((nr=Ve.current)==null||nr.scrollIntoView({behavior:"smooth"}))},[Ue,$e,He]);const Qe=reactExports.useCallback(async(nr,hr={})=>{const sr=String(nr||"").trim();if(!sr||He)return;const{displayText:xr=sr,sectionTitle:Rr=null,contextQuestion:br=sr}=hr;Xe(""),ze(wr=>[...wr,{role:"user",content:xr}]),qe(!0);try{const wr=Rr?await helpService.sendMessageFromSource(Rr,br):await helpService.sendMessage(sr);ze(vr=>[...vr,{role:"assistant",id:createMessageId(),question:br,content:wr.reply||"Sorry, I could not generate a response.",sources:wr.sources||[]}])}catch{ze(wr=>[...wr,{role:"assistant",content:"Sorry, something went wrong. Please try again in a moment."}])}finally{qe(!1)}},[He]),Ze=reactExports.useCallback(()=>{Qe(We.trim())},[Qe,We]),Je=reactExports.useCallback(nr=>{Qe(nr)},[Qe]),ir=reactExports.useCallback(nr=>{!(nr!=null&&nr.clickQuery)||He||Qe(nr.clickQuery,{displayText:nr.title||nr.clickQuery})},[Qe,He]),rr=nr=>{nr.key==="Enter"&&!nr.shiftKey&&(nr.preventDefault(),Ze())},ar=Ue.length===1&&((tr=Ue[0])==null?void 0:tr.role)==="assistant",or=Re.pathname==="/submit-ticket",pr=jsxRuntimeExports.jsxs(Box,{className:De,children:[jsxRuntimeExports.jsx(Tooltip,{title:"OPAI Assistant",placement:Me?"top":"left",children:jsxRuntimeExports.jsx(Fab,{color:"primary",size:Me?"medium":"large","aria-label":"Open OPAI Assistant",className:"help-assistant-fab",onClick:()=>Be(nr=>!nr),children:$e?jsxRuntimeExports.jsx(Close$1,{}):jsxRuntimeExports.jsx(HelpOutline,{})})}),jsxRuntimeExports.jsx(Slide,{direction:"up",in:$e,mountOnEnter:!0,unmountOnExit:!0,children:jsxRuntimeExports.jsxs(Paper,{elevation:8,className:"help-assistant-panel",children:[jsxRuntimeExports.jsxs(Box,{className:"help-assistant-header",children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(AutoAwesome,{fontSize:"small"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700,lineHeight:1.2},children:"OPAI Assistant"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Numbered step-by-step instructions from the user guide only"})]})]}),jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:()=>Be(!1),"aria-label":"Close OPAI Assistant",children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})})]}),jsxRuntimeExports.jsxs(Box,{className:"help-assistant-messages",children:[Ge&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,py:1},children:[jsxRuntimeExports.jsx(CircularProgress,{size:16}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Preparing knowledge base..."})]}),Ue.map((nr,hr)=>{var sr;return jsxRuntimeExports.jsxs(Box,{className:`help-assistant-message help-assistant-message--${nr.role}`,children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{whiteSpace:"pre-wrap"},children:renderFormattedHelpText(nr.content,Ke)}),nr.role==="assistant"&&ar&&hr===0&&jsxRuntimeExports.jsxs(Box,{className:"help-assistant-suggestions",sx:{mt:1.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{dis
3986play:"block",mb:.75},children:"Suggested questions"}),jsxRuntimeExports.jsx(Box,{className:"help-assistant-chip-row",children:SUGGESTED_QUESTIONS.map(xr=>jsxRuntimeExports.jsx(Chip,{size:"small",variant:"outlined",label:truncateChipLabel(xr,48),title:xr,clickable:!0,disabled:He,className:"help-assistant-suggestion-chip",sx:chipSx,onClick:()=>Je(xr)},xr))})]}),((sr=nr.sources)==null?void 0:sr.length)>0&&jsxRuntimeExports.jsxs(Box,{sx:{mt:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.75},children:"Related topics â click to learn more"}),jsxRuntimeExports.jsx(Box,{className:"help-assistant-chip-row",children:nr.sources.slice(0,4).map((xr,Rr)=>{const br=xr.title||xr.filepath;return jsxRuntimeExports.jsx(Chip,{size:"small",variant:"outlined",label:truncateChipLabel(br),title:br,clickable:!0,disabled:He||!xr.clickQuery,className:"help-assistant-suggestion-chip",sx:chipSx,onClick:()=>ir(xr)},xr.id||`${br}-${Rr}`)})})]}),nr.role==="assistant"&&nr.id&&jsxRuntimeExports.jsx(HelpMessageFeedback,{messageId:nr.id,question:nr.question,answer:nr.content,sources:nr.sources,initialRating:nr.feedback||null})]},`${nr.role}-${hr}`)}),He&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,py:1},children:[jsxRuntimeExports.jsx(CircularProgress,{size:16}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Thinking..."})]}),jsxRuntimeExports.jsx("div",{ref:Ve})]}),jsxRuntimeExports.jsxs(Box,{className:"help-assistant-input",children:[jsxRuntimeExports.jsx(TextField,{fullWidth:!0,multiline:!0,maxRows:4,size:"small",placeholder:"How do I approve a document?",value:We,onChange:nr=>Xe(nr.target.value),onKeyDown:rr,disabled:He}),jsxRuntimeExports.jsx(IconButton,{color:"primary",onClick:Ze,disabled:!We.trim()||He,"aria-label":"Send help message",children:jsxRuntimeExports.jsx(Send,{})})]}),!or&&jsxRuntimeExports.jsx(Box,{sx:{px:2,pb:1.5,pt:.5,borderTop:"1px solid rgba(0, 0, 0, 0.06)",display:"flex",justifyContent:"center"},children:jsxRuntimeExports.jsx(Link,{component:"button",type:"button",underline:"hover",color:"primary",onClick:()=>{Be(!1),Te("/submit-ticket")},sx:{fontSize:"0.8125rem",fontWeight:600},children:"Still need help? Submit a support ticket"})})]})})]});return!Me&&typeof document<"u"?reactDomExports.createPortal(pr,document.body):pr},SectionLoader=()=>jsxRuntimeExports.jsx(Box,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",minHeight:0},children:jsxRuntimeExports.jsx(Loader,{message:"Loading..."})}),ProtectedLayout=({children:Ee})=>{const Re=useDispatch(),Te=useLocation(),{user:je,userFetched:Oe}=useSelector(Xe=>Xe.auth),{tcAccepted:Me}=useSelector(Xe=>Xe.user),De=reactExports.useRef(Te.pathname),{darkMode:$e}=useThemeMode(),{tourCompleted:Be,startTour:Ue}=useTour(),[ze,We]=reactExports.useState(!1);return reactExports.useEffect(()=>{if(Be===!1&&je&&Me&&!ze&&!je.is_l1_admin&&Oe){const Xe=setTimeout(()=>{Ue(),We(!0)},1500);return()=>clearTimeout(Xe)}},[Be,je,Me,Ue,ze,Oe]),reactExports.useEffect(()=>{je&&!isPlatformAdmin(je)&&(Re(fetchGroups()),je.role===ROLES.TENANT_ADMIN&&Re(fetchSubscription(!0)))},[Re,je]),reactExports.useEffect(()=>{const Xe=De.current,He=Te.pathname;Xe.includes("/subscription")&&!He.includes("/subscription")&&je&&!isPlatformAdmin(je)&&je.role===ROLES.TENANT_ADMIN&&Re(fetchSubscription(!0)),De.current=He},[Te.pathname,Re,je]),jsxRuntimeExports.jsxs("div",{className:`protected-layout ${$e?"dark":""}`,children:[jsxRuntimeExports.jsx(TopBar,{}),jsxRuntimeExports.jsxs("div",{className:"layout-body",children:[jsxRuntimeExports.jsx(NavigationMenu,{}),jsxRuntimeExports.jsx("div",{className:`layout-content ${Te.pathname==="/chat"?"layout-content-chat":""}`,children:jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(SectionLoader,{}),children:Ee})})]}),jsxRuntimeExports.jsx(HelpAssistant,{placement:"global"}),jsxRuntimeExports.jsx(OnboardingTour,{})]})},AGENT_SLUG_PATTERN="[A-Za-z0-9_\\-]+",LEGACY_AGENT_INVOKE_RE=new RegExp(`^/agent\\s+(${AGENT_SLUG_PATTERN})([\\s\\S]*)$`),AGENT_INVOKE_RE=new RegExp(`^/(${AGENT_SLUG_PATTERN})([\\s\\S]*)$`);function parseAgentMessage(Ee){const Re=(Ee||"").trim(),Te=Re.match(LEGACY_AGENT_INVOKE_RE);if(Te)return{slug:Te[1],rest:Te[2].trim(),isLegacy:!0};const je=Re.match(AGENT_INVOKE_RE);return je?{slug:je[1],rest:je[2].trim(),isLegacy:!1}
3986:null}function hasExplicitDocumentIds(Ee){return Ee.length>0&&Ee.split(/\s+/).some(Re=>/^\d+$/.test(Re))}function buildWireMessage(Ee,Re,Te=""){return[`/agent ${Ee}`,Re,Te].filter(Boolean).join(" ")}function buildDisplayMessage(Ee,Re,Te=""){return[`/${Ee}`,Re,Te].filter(Boolean).join(" ")}function lookupDocumentName(Ee,Re){if(!Ee||Re==null)return null;const Te=String(Re);return Ee[Re]??Ee[Te]??Ee[Number(Te)]??null}function isAgentMessage(Ee){return!!parseAgentMessage(Ee)}function resolveAgentMessage(Ee,Re){const Te=parseAgentMessage(Ee);if(!Te)return Ee;const{slug:je,rest:Oe,isLegacy:Me}=Te;return Me?Ee:buildWireMessage(je,Oe)}function buildAgentDisplayMessage(Ee,Re,Te){const je=parseAgentMessage(Ee);if(!je)return Ee;const{slug:Oe,rest:Me}=je;if(hasExplicitDocumentIds(Me))return buildDisplayMessage(Oe,Me);const De=(Re||[]).map(Number).filter(Be=>Number.isFinite(Be)&&Be>0);if(De.length===0)return buildDisplayMessage(Oe,Me);const $e=De.map(Be=>lookupDocumentName(Te,Be)||String(Be)).join(", ");return buildDisplayMessage(Oe,Me,`(${$e})`)}const RenameSessionDialog=({open:Ee,onClose:Re,currentName:Te,onRename:je,allSessions:Oe=[]})=>{const[Me,De]=reactExports.useState(""),[$e,Be]=reactExports.useState(""),Ue=Oe.filter(qe=>{var Ge;return((Ge=qe.name)==null?void 0:Ge.toLowerCase())!==(Te==null?void 0:Te.toLowerCase())}).map(qe=>{var Ge;return((Ge=qe.name)==null?void 0:Ge.toLowerCase())||""});reactExports.useEffect(()=>{Ee&&(De(Te||""),Be(""))},[Ee,Te]);const ze=()=>{const qe=Me.trim();if(!qe){Be("Chat title is required");return}if(qe===Te){Be("Please enter a different name");return}if(Ue.includes(qe)){Be("A chat with this title already exists");return}if(qe.length>100){Be("Chat title must be 100 characters or less");return}Be(""),je(qe)},We=qe=>{qe.key==="Enter"&&!$e&&Me.trim()&&ze()},Xe=qe=>{De(qe.target.value),$e&&Be("")},He=(qe,Ge)=>{Ge==="backdropClick"||Ge==="escapeKeyDown"||Re()};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:He,maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Rename Chat Session"}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsxs(Box,{sx:{pt:2},children:[jsxRuntimeExports.jsx(TextField,{autoFocus:!0,fullWidth:!0,label:"Session Name",value:Me,onChange:Xe,onKeyPress:We,inputProps:{maxLength:100},error:!!$e,helperText:$e}),jsxRuntimeExports.jsxs(Box,{sx:{mt:1,textAlign:"right",color:"#999",fontSize:"12px"},children:[Me.length,"/100"]})]})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Re,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:ze,variant:"contained",disabled:!Me.trim()||Me.trim()===Te||!!$e,children:"Rename"})]})]})},DeleteSessionDialog=({open:Ee,onClose:Re,sessionName:Te,onDelete:je})=>{const Oe=(Me,De)=>{De==="backdropClick"||De==="escapeKeyDown"||Re()};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:Oe,maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:jsxRuntimeExports.jsxs(Typography,{variant:"h6",sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Warning,{color:"error"}),"Delete Chat Session"]})}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(Alert,{severity:"warning",sx:{mb:2},children:"This action cannot be undone."}),jsxRuntimeExports.jsxs(Typography,{variant:"body1",children:["Are you sure you want to delete ",jsxRuntimeExports.jsxs("strong",{children:['"',Te,'"']}),"?"]}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"All messages in this session will be permanently deleted."})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Re,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:je,variant:"contained",color:"error",children:"Delete"})]})]})},ClearConversationDialog=({open:Ee,onClose:Re,sessionName:Te,messageCount:je,onClear:Oe})=>{const Me=(De,$e)=>{$e==="backdropClick"||$e==="escapeKeyDown"||Re()};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:Me,maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:jsxRuntimeExports.jsxs(Typography,{variant:"h6",sx:{dis
3986play:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(DeleteSweep,{color:"warning"}),"Clear Conversation"]})}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(Alert,{severity:"warning",sx:{mb:2},children:"This action cannot be undone."}),jsxRuntimeExports.jsxs(Typography,{variant:"body1",children:["Are you sure you want to clear all messages in ",jsxRuntimeExports.jsxs("strong",{children:['"',Te,'"']}),"?"]}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[je," message",je!==1?"s":""," will be permanently deleted. The session will remain, but will be empty."]})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Re,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Oe,variant:"contained",color:"warning",children:"Clear Messages"})]})]})},CreateSessionDialog=({open:Ee,onClose:Re,onCreateSession:Te,existingSessions:je=[],loading:Oe=!1})=>{const[Me,De]=reactExports.useState(""),[$e,Be]=reactExports.useState(""),Ue=je.map(qe=>{var Ge;return((Ge=qe.name)==null?void 0:Ge.toLowerCase())||""});reactExports.useEffect(()=>{Ee&&(De(""),Be(""))},[Ee]);const ze=()=>{const qe=Me.trim();if(!qe){Be("Chat title is required");return}if(Ue.includes(qe.toLowerCase())){Be("A chat with this title already exists");return}if(qe.length>100){Be("Chat title must be 100 characters or less");return}Be(""),Te(qe)},We=qe=>{qe.key==="Enter"&&!$e&&Me.trim()&&ze()},Xe=qe=>{De(qe.target.value),$e&&Be("")},He=(qe,Ge)=>{Ge==="backdropClick"||Ge==="escapeKeyDown"||Re()};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:He,maxWidth:"xs",fullWidth:!0,disabled:Oe,children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Create New Chat"}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsxs(Box,{sx:{pt:2},children:[jsxRuntimeExports.jsx(TextField,{autoFocus:!0,fullWidth:!0,label:"Chat Title",placeholder:"e.g., Project Discussion, Q&A Session...",value:Me,onChange:Xe,onKeyPress:We,disabled:Oe,inputProps:{maxLength:100},error:!!$e,helperText:$e}),jsxRuntimeExports.jsxs(Box,{sx:{mt:1,textAlign:"right",color:"#999",fontSize:"12px"},children:[Me.length,"/100"]})]})}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Re,disabled:Oe,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:ze,variant:"contained",disabled:!Me.trim()||Oe||!!$e,children:"Create Chat"})]})]})},SessionSidebar=({sessions:Ee,currentSessionId:Re,onSelectSession:Te,onCreateSession:je,onRenameSession:Oe,onDeleteSession:Me,onTogglePin:De,onClearConversation:$e,loading:Be,creatingSession:Ue=!1,showArchived:ze=!1,sharedSessions:We=[],onShareSession:Xe})=>{const[He,qe]=reactExports.useState(""),[Ge,Ye]=reactExports.useState(null),[Ve,Ke]=reactExports.useState(null),[Qe,Ze]=reactExports.useState(!1),[Je,ir]=reactExports.useState(!1),[rr,ar]=reactExports.useState(!1),[or,pr]=reactExports.useState(!1),[tr,nr]=reactExports.useState(!1),[hr,sr]=reactExports.useState(15),xr=reactExports.useRef(null),Rr=reactExports.useRef(null),wr=[...Ee.filter(Hr=>Hr.name.toLowerCase().includes(He.toLowerCase())&&(ze?Hr.archived:!Hr.archived))].sort((Hr,Vr)=>{if(Hr.pinned&&!Vr.pinned)return-1;if(!Hr.pinned&&Vr.pinned)return 1;const mr=new Date(Hr.updated_at||0);return new Date(Vr.updated_at||0)-mr}),vr=wr.slice(0,hr),Dr=hr<wr.length,kr=reactExports.useCallback(()=>{try{const Hr=xr.current;if(!Hr||!Dr)return;const Vr=Hr.scrollTop||0,mr=Hr.scrollHeight||0,Sr=Hr.clientHeight||0;if(mr===0||Sr===0)return;const Lr=mr-Vr-Sr;Lr<100&&Lr>=0&&(Rr.current&&clearTimeout(Rr.current),Rr.current=setTimeout(()=>{sr(jr=>Math.min(jr+10,wr.length))},600))}catch(Hr){console.error("Error in handleScroll:",Hr)}},[Dr,wr.length]);React$3.useEffect(()=>{sr(15)},[He,ze]),React$3.useEffect(()=>()=>{Rr.current&&clearTimeout(Rr.current)},[]);const cr=(Hr,Vr)=>{Hr.stopPropagation(),Ke(Vr),Ye(Hr.currentTarget)},dr=()=>{Ye(null)},ur=()=>{dr(),Ze(!0)},gr=()=>{dr(),ir(!0)},_r=()=>{Ve&&De(Ve.session_id,Ve.pinned),dr()},Ir=async Hr=>{if(Ve){Ze(!1),nr(!0);try{await Oe(Ve.session_id,Hr)}catch(Vr){console.error("Error renaming session:",Vr)}finally{nr(!1)}}},Ar=()=>{Ve&&Me(Ve.session_id),ir(!1)},Tr=()=>{Ve&&$e(Ve.session_id),ar(!1)},Nr=async Hr=>{try{await je(Hr),pr(!1)}catch(Vr){console.error("Error creating session:",Vr)}},Br=Hr=>{if(!Hr)return"";const Vr=new Date(Hr),Sr=Math.floor((new Date-Vr)/(1e3*60*60*24));return Sr===0?"Today":Sr===1?"Yesterday":Sr<7?`${Sr} days ago`:Vr.toLocaleDateString("en-US",{month:"short",day:"numeric"})};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Ue&&jsxRuntimeExports.jsx(Box,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:jsxRuntimeExports.jsxs(Box,{sx:{bgcolor:"background.paper",borderRadius:2,p:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[jsxRuntimeExports.jsx(CircularProgress,{size:60}),jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Creating Chat..."})]})}),tr&&jsxRuntimeExports.jsx(Box,{sx:{position:"fixed",top:0,left:0,right:0,bottom:0,bgcolor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:jsxRuntimeExports.jsxs(Box,{sx:{bgcolor:"background.paper",borderRadius:2,p:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[jsxRuntimeExports.jsx(CircularProgress,{size:60}),jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Renaming Chat..."})]})}),jsxRuntimeExports.jsxs(Paper,{elevation:0,sx:{width:280,height:"100%",display:"flex",flexDirection:"column",borderRight:"1px solid",borderColor:"divider",bgcolor:"background.default"},children:[jsxRuntimeExports.jsxs(Box,{sx:{p:2},children:[jsxRuntimeExports.jsx(Button,{fullWidth:!0,variant:"contained",startIcon:jsxRuntimeExports.jsx(AddIcon,{}),onClick:()=>pr(!0),"data-tour":"new-chat-btn",sx:{mb:2},children:"New Chat"}),jsxRuntimeExports.jsx(TextField,{fullWidth:!0,size:"small",placeholder:"Search chats...",value:He,onCh
3986ange:Hr=>qe(Hr.target.value),InputProps:{startAdornment:jsxRuntimeExports.jsx(SearchIcon,{sx:{mr:1,color:"action.disabled"}})}})]}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsx(List,{ref:xr,onScroll:kr,sx:{flex:1,overflowY:"auto",py:0},children:wr.length===0?jsxRuntimeExports.jsxs(Box,{sx:{p:3,textAlign:"center",color:"text.secondary"},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",children:He?"No chats found":ze?"No archived chats":"No chats yet"}),!He&&!ze&&jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{mt:1,display:"block"},children:'Click "New Chat" to start'})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[vr.map(Hr=>jsxRuntimeExports.jsx(ListItem,{disablePadding:!0,secondaryAction:jsxRuntimeExports.jsx(IconButton,{edge:"end",size:"small",onClick:Vr=>cr(Vr,Hr),children:jsxRuntimeExports.jsx(MoreVertIcon,{fontSize:"small"})}),children:jsxRuntimeExports.jsxs(ListItemButton,{selected:Hr.session_id===Re,onClick:()=>{Be&&Hr.session_id!==Re||Hr.session_id!==Re&&Te(Hr.session_id)},sx:{borderLeft:"3px solid transparent","&.Mui-selected":{borderLeftColor:"#002D79",bgcolor:"rgba(0, 45, 121, 0.08)","&:hover":{bgcolor:"rgba(0, 45, 121, 0.12)"}},"&:hover":{bgcolor:"rgba(0, 45, 121, 0.05)"}},children:[Hr.pinned?jsxRuntimeExports.jsx(PushPin,{sx:{mr:2,color:"warning.main",fontSize:20}}):jsxRuntimeExports.jsx(ChatIcon,{sx:{mr:2,color:Hr.session_id===Re?"#002D79":"action.active"}}),jsxRuntimeExports.jsx(ListItemText,{primary:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:Hr.session_id===Re?600:400,color:Hr.session_id===Re?"#002D79":"text.primary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Hr.name}),secondary:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:Br(Hr.created_at||Hr.last_updated)})})]})},Hr.session_id)),Dr&&jsxRuntimeExports.jsxs(Box,{sx:{p:2,display:"flex",flexDirection:"column",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Chip,{label:`${wr.length-hr} more chats`,size:"small",color:"primary",variant:"outlined"}),jsxRuntimeExports.jsx(Button,{size:"small",variant:"text",endIcon:jsxRuntimeExports.jsx(ExpandMoreIcon,{}),onClick:()=>{sr(Hr=>Math.min(Hr+15,wr.length))},sx:{textTransform:"none"},children:"Load More"})]})]})}),We&&We.length>0&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(List,{sx:{py:0,flex:We.length>3?"0 0 auto":void 0,maxHeight:We.length>3?"200px":void 0,overflowY:We.length>3?"auto":"visible"},children:[jsxRuntimeExports.jsx(ListItem,{children:jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{fontWeight:700,color:"text.secondary",px:2,py:1,textTransform:"uppercase"},children:"Shared with me"})}),We.map(Hr=>jsxRuntimeExports.jsx(ListItem,{disablePadding:!0,secondaryAction:jsxRuntimeExports.jsx(Chip,{label:Hr.access==="edit"?"Can edit":"View",size:"small",color:Hr.access==="edit"?"primary":"default",variant:"outlined",sx:{mr:1}}),children:jsxRuntimeExports.jsxs(ListItemButton,{selected:Hr.id===Re||Hr.session_id===Re,onClick:()=>{Be||Te(Hr.id||Hr.session_id)},sx:{borderLeft:"3px solid transparent","&.Mui-selected":{borderLeftColor:"#002D79",bgcolor:"rgba(0, 45, 121, 0.08)","&:hover":{bgcolor:"rgba(0, 45, 121, 0.12)"}},"&:hover":{bgcolor:"rgba(0, 45, 121, 0.05)"}},children:[jsxRuntimeExports.jsx(ChatIcon,{sx:{mr:2,color:"info.main"}}),jsxRuntimeExports.jsx(ListItemText,{primary:jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",children:["by ",Hr.owner_name||"Unknown"]})})]})},`shared-${Hr.id||Hr.session_id}`))]})]}),jsxRuntimeExports.jsxs(Menu,{anchorEl:Ge,open:!!Ge,onClose:dr,children:[jsxRuntimeExports.jsxs(MenuItem,{onClick:ur,children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(EditIcon,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText,{children:"Rename"})]}),jsxRuntimeExports.jsxs(MenuItem,{onClick:_r,children:[jsxRuntimeExports.jsx(ListItemIcon,{children:Ve!=null&&Ve.pinned?jsxRuntimeExports.jsx(PushPinOutlined,{fontSize:"small"}):jsxRuntimeExports.jsx(PushPin,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText,{children:Ve!=null&&Ve.pinned?"Unpin":"Pin"})]}),jsxRuntimeExports.jsxs(MenuItem,{onClick:()=>{Ve&&Xe&&Xe(Ve),dr()},children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(Share,{fontSize:"small"})}),jsxRuntimeExports.jsx(ListItemText,{children:"Share"})]}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(MenuItem,{onClick:gr,sx:{color:"error.main"},children:[jsxRuntimeExports.jsx(ListItemIcon,{children:jsxRuntimeExports.jsx(DeleteIcon,{fontSize:"small",color:"error"})}),jsxRuntimeExports.jsx(ListItemText,{children:"Delete Session"})]})]}),jsxRuntimeExports.jsx(CreateSessionDialog,{open:or,onClose:()=>pr(!1),onCreateSession:Nr,existingSessions:Ee,loading:Ue}),jsxRuntimeExports.jsx(RenameSessionDialog,{open:Qe,onClose:()=>Ze(!1),currentName:(Ve==null?void 0:Ve.name)||"",onRename:Ir,allSessions:Ee}),jsxRuntimeExports.jsx(DeleteSessionDialog,{open:Je,onClose:()=>ir(!1),sessionName:(Ve==null?void 0:Ve.name)||"",onDelete:Ar}),jsxRuntimeExports.jsx(ClearConversationDialog,{open:rr,onClose:()=>ar(!1),sessionName:(Ve==null?void 0:Ve.name)||"",messageCount:0,onClear:Tr})]})]})},CustomRobotIcon=Ee=>jsxRuntimeExports.jsxs(SvgIcon,{...Ee,viewBox:"0 0 24 24",fill:"
3986currentColor",children:[jsxRuntimeExports.jsx("ellipse",{cx:"12",cy:"6.5",rx:"5",ry:"4"}),jsxRuntimeExports.jsx("ellipse",{cx:"12",cy:"6.8",rx:"3.8",ry:"2.8"}),jsxRuntimeExports.jsx("rect",{x:"9.2",y:"6",width:"1.4",height:"0.9",rx:"0.2"}),jsxRuntimeExports.jsx("rect",{x:"13.4",y:"6",width:"1.4",height:"0.9",rx:"0.2"}),jsxRuntimeExports.jsx("rect",{x:"10",y:"2.8",width:"4",height:"0.8",rx:"0.4"}),jsxRuntimeExports.jsx("ellipse",{cx:"4.5",cy:"6.5",rx:"1.4",ry:"2"}),jsxRuntimeExports.jsx("ellipse",{cx:"19.5",cy:"6.5",rx:"1.4",ry:"2"}),jsxRuntimeExports.jsx("rect",{x:"5.5",y:"10",width:"13",height:"9",rx:"2.5"}),jsxRuntimeExports.jsx("circle",{cx:"12",cy:"14.5",r:"2"}),jsxRuntimeExports.jsx("rect",{x:"3",y:"11.5",width:"2.5",height:"1.2",rx:"0.5"}),jsxRuntimeExports.jsx("rect",{x:"18.5",y:"11.5",width:"2.5",height:"1.2",rx:"0.5"})]}),VOICE_STORAGE_KEY$1="doculens_tts_voice",SpeakButton=({messageId:Ee,text:Re,available:Te,voices:je=[],defaultVoice:Oe=null,playingId:Me,onSpeak:De,onStop:$e})=>{const[Be,Ue]=reactExports.useState(()=>localStorage.getItem(VOICE_STORAGE_KEY$1)||Oe||""),[ze,We]=reactExports.useState(null);if(!Te)return null;const Xe=Me===Ee,He=()=>{var Ke;if(Xe){$e();return}const Ve=Be||Oe||((Ke=je[0])==null?void 0:Ke.name)||"";De(Ee,Re,Ve)},qe=Ve=>{Ve.stopPropagation(),We(Ve.currentTarget)},Ge=Ve=>{Ue(Ve.name),localStorage.setItem(VOICE_STORAGE_KEY$1,Ve.name),We(null),Xe&&($e(),setTimeout(()=>De(Ee,Re,Ve.name),80))},Ye=Xe?"Stop":"Read aloud";return jsxRuntimeExports.jsxs(Box,{sx:{display:"inline-flex",alignItems:"center"},children:[jsxRuntimeExports.jsx(Tooltip,{title:Ye,placement:"top",arrow:!0,children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:He,"aria-label":Ye,sx:{bgcolor:"background.paper",boxShadow:1,color:Xe?"primary.main":"text.secondary",transition:"color 0.15s, background-color 0.15s","&:hover":{bgcolor:"action.hover",color:Xe?"primary.dark":"primary.main"}},children:Xe?jsxRuntimeExports.jsx(Stop,{fontSize:"small"}):jsxRuntimeExports.jsx(VolumeUp,{fontSize:"small"})})}),!Xe&&je.length>1&&jsxRuntimeExports.jsx(Tooltip,{title:"Choose voice",placement:"top",children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:qe,"aria-label":"Choose voice",sx:{width:16,height:16,ml:-.75,p:0,bgcolor:"background.paper",boxShadow:1,color:"text.disabled","&:hover":{color:"primary.main",bgcolor:"action.hover"}},children:jsxRuntimeExports.jsx(KeyboardArrowDown,{sx:{fontSize:13}})})}),jsxRuntimeExports.jsxs(Menu,{anchorEl:ze,open:!!ze,onClose:()=>We(null),anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{sx:{minWidth:220,maxHeight:360}},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{px:2,pt:1,pb:.5,display:"block",color:"text.secondary",fontWeight:700,letterSpacing:.5,textTransform:"uppercase"},children:"Voice"}),jsxRuntimeExports.jsx(Divider,{}),je.map(Ve=>{const Ke=Be?Ve.name===Be:Ve.default;return jsxRuntimeExports.jsxs(MenuItem,{onClick:()=>Ge(Ve),dense:!0,children:[Ke&&jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:28},children:jsxRuntimeExports.jsx(Check,{fontSize:"small",color:"primary"})}),jsxRuntimeExports.jsx(ListItemText,{inset:!Ke,primary:Ve.name,secondary:Ve.lang,primaryTypographyProps:{variant:"body2",noWrap:!0},secondaryTypographyProps:{variant:"caption"}})]},Ve.voiceURI)})]})]})},FEEDBACK_REASON_CATEGORIES=[{value:"fact",label:"Factual issue"},{value:"style",label:"Style / tone"}],FEEDBACK_MAX_COMMENT_CHARS=500,submitMessageFeedback=async(Ee,{rating:Re,reasonCategory:Te,comment:je,modelVersion:Oe}={})=>(await cachedAxios.put(`/chat/message/${Ee}/feedback`,{rating:Re,reason_category:Te||void 0,comment:je||void 0,model_version:Oe||void 0})).data,clearMessageFeedback=async Ee=>(await cachedAxios.delete(`/chat/message/${Ee}/feedback`)).data,getFeedbackSummary=async(Ee=30)=>(await cachedAxios.get("/admin/feedback/summary",{params:{days:Ee},cache:{enabled:!1}})).data,listFeedback=async({days:Ee=30,rating:Re,limit:Te=25,offset:je=0}={})=>(await cachedAxios.get("/admin/feedback",{params:{days:Ee,rating:Re||void 0,limit:Te,offset:je},cache:{enabled:!1}})).data,feedbackService={submitMessageFeedback,clearMessageFeedback,getFeedbackSummary,listFeedback,FEEDBACK_REASON_CATEGORIES,FEEDBACK_MAX_COMMENT_CHARS},MessageFeedback=({messageId:Ee,initialFeedback:Re=null,modelVersion:Te=null,disabled:je=!1})=>{const[Oe,Me]=reactExports.useState((Re==null?void 0:Re.rating)||null),[De,$e]=reactExports.useState(!1),[Be,Ue]=reactExports.useState(!1),[ze,We]=reactExports.useState(null),[Xe,He]=reactExports.useState(""),qe=reactExports.useRef(null),Ge=Number(Ee);if(!Number.isInteger(Ge)||Ge<=0)return null;const Ye=async(Je,ir={})=>
3986{if(De||je)return!1;const rr=Oe;$e(!0),Me(Je);try{return Je===null?await feedbackService.clearMessageFeedback(Ge):await feedbackService.submitMessageFeedback(Ge,{rating:Je,modelVersion:Te,...ir}),!0}catch(ar){return console.error("Failed to save feedback:",ar),Me(rr),!1}finally{$e(!1)}},Ve=()=>{Ye(Oe==="up"?null:"up")},Ke=async()=>{if(Oe==="down"){Ye(null);return}await Ye("down")&&(We(null),He(""),Ue(!0))},Qe=async()=>{Ue(!1),!(!ze&&!Xe.trim())&&await Ye("down",{reasonCategory:ze||void 0,comment:Xe.trim()||void 0})},Ze=()=>{Ue(!1)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"inline-flex",alignItems:"center",gap:.25},children:[jsxRuntimeExports.jsx(Tooltip,{title:"Good response",children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:Ve,disabled:De||je,"aria-label":"Good response","aria-pressed":Oe==="up",sx:{color:Oe==="up"?"success.main":"text.secondary",opacity:Oe==="up"?1:.7,"&:hover":{opacity:1,color:"success.main"}},children:Oe==="up"?jsxRuntimeExports.jsx(ThumbUpAlt,{sx:{fontSize:16}}):jsxRuntimeExports.jsx(ThumbUpOffAlt,{sx:{fontSize:16}})})}),jsxRuntimeExports.jsx(Tooltip,{title:"Bad response",children:jsxRuntimeExports.jsx(IconButton,{ref:qe,size:"small",onClick:Ke,disabled:De||je,"aria-label":"Bad response","aria-pressed":Oe==="down",sx:{color:Oe==="down"?"error.main":"text.secondary",opacity:Oe==="down"?1:.7,"&:hover":{opacity:1,color:"error.main"}},children:Oe==="down"?jsxRuntimeExports.jsx(ThumbDownAlt,{sx:{fontSize:16}}):jsxRuntimeExports.jsx(ThumbDownOffAlt,{sx:{fontSize:16}})})})]}),jsxRuntimeExports.jsx(Popper,{open:Be,anchorEl:qe.current,placement:"bottom-start",disablePortal:!1,modifiers:[{name:"offset",options:{offset:[0,8]}},{name:"preventOverflow",options:{padding:8}}],sx:{zIndex:1300},children:jsxRuntimeExports.jsx(ClickAwayListener,{onClickAway:Ze,children:jsxRuntimeExports.jsxs(Paper,{elevation:6,onKeyDown:Je=>{Je.key==="Escape"&&Ze()},sx:{width:280,p:2,borderRadius:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",fontWeight:700,sx:{mb:.5},children:"What went wrong?"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:1.5},children:"Optional â keep chatting any time, this won't interrupt you."}),jsxRuntimeExports.jsx(Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mb:1.5},children:FEEDBACK_REASON_CATEGORIES.map(({value:Je,label:ir})=>jsxRuntimeExports.jsx(Chip,{label:ir,size:"small",color:ze===Je?"primary":"default",variant:ze===Je?"filled":"outlined",onClick:()=>We(ze===Je?null:Je)},Je))}),jsxRuntimeExports.jsx(TextField,{fullWidth:!0,multiline:!0,rows:3,size:"small",placeholder:"Tell us more (optional)",value:Xe,onChange:Je=>{Je.target.value.length<=FEEDBACK_MAX_COMMENT_CHARS&&He(Je.target.value)}}),jsxRuntimeExports.jsxs("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"4px",textAlign:"right"},children:[Xe.length,"/",FEEDBACK_MAX_COMMENT_CHARS," characters"]}),jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"flex-end",mt:1.5},children:jsxRuntimeExports.jsx(Button,{onClick:Qe,variant:"contained",size:"small",disabled:!ze&&!Xe.trim(),sx:{textTransform:"none"},children:"Submit"})})]})})})]})},synthState={playingId:null,utterance:null,listeners:new Set,notify(){this.listeners.forEach(Ee=>Ee(this.playingId))},stop(){typeof window.speechSynthesis<"u"&&window.speechSynthesis.cancel(),this.utterance=null,this.playingId=null,this.notify()},subscribe(Ee){return this.listeners.add(Ee),()=>this.listeners.delete(Ee)}};function stopTTS(){synthState.stop()}typeof document<"u"&&document.addEventListener("visibilitychange",()=>{document.hidden&&stopTTS()});let cachedVoices=[];function loadVoices(){if(typeof window.speechSynthesis>"u")return[];const Ee=window.speechSynthesis.getVoices(),Re=Ee.filter(Te=>Te.lang.toLowerCase().startsWith("en"));return Re.length>0?Re:Ee}function stripMarkdown(Ee){return Ee?Ee.replace(/```[\s\S]*?```/g,"").replace(/`[^`]+`/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!?\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/[*_~]{1,3}([^*_~\n]+)[*_~]{1,3}/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^[-*+]\s+/gm,"").replace(/^\d+\.\s+/gm,"").replace(/\[\d+\]/g,"").replace(/^\s*>\s*/gm,"").replace(/\n{2,}/g,". ").replace(/\n/g," ").replace(/\s{2,}/g," ").trim():""}function useTTS(){var Be,Ue;const Ee=typeof window<"u"&&typeof window.speechSynthesis<"u",[Re,Te]=reactExports.useState(cachedVoices),[je,Oe]=reactExports.useState(synthState.playingId);reactExports.useEffect(()=>{if(!Ee)return;const ze=()=>{cachedVoices=loadVoices(),Te([...cachedVoices])};return ze(),window.speechSynthesis.addEventListener("voiceschanged",ze),()=>window.speechSynthesis.removeEventListener("voiceschanged",ze)},[Ee]),reactExports.useEffect(()=>synthState.subscribe(ze=>Oe(ze)),[]);const Me=reactExports.useCallback((ze,We,Xe)=>{if(!Ee||!(We!=null&&We.trim()))return;const He=stripMarkdown(We);if(!He)return;synthState.stop();const qe=new SpeechSynthesisUtterance(He),Ge=cachedVoices.find(Ve=>Ve.name===Xe)||cachedVoices.find(Ve=>
3986Ve.default)||cachedVoices[0]||null;Ge&&(qe.voice=Ge),qe.rate=1,qe.pitch=1;const Ye=()=>{synthState.utterance===qe&&(synthState.utterance=null,synthState.playingId=null,synthState.notify())};qe.onend=Ye,qe.onerror=Ye,synthState.utterance=qe,synthState.playingId=ze,synthState.notify(),window.speechSynthesis.speak(qe)},[Ee]),De=reactExports.useCallback(()=>stopTTS(),[]),$e=((Be=Re.find(ze=>ze.default))==null?void 0:Be.name)||((Ue=Re[0])==null?void 0:Ue.name)||null;return{available:Ee,voices:Re,defaultVoice:$e,playingId:je,loadingId:null,speak:Me,stop:De}}function commonjsRequire(Ee){throw new Error('Could not dynamically require "'+Ee+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports$1){(function(Re,Te){module.exports=Re.pdfjsLib=Te()})(globalThis,()=>(()=>{var __webpack_modules__=[,(Ee,Re)=>{var Mn;Object.defineProperty(Re,"__esModule",{value:!0}),Re.VerbosityLevel=Re.Util=Re.UnknownErrorException=Re.UnexpectedResponseException=Re.TextRenderingMode=Re.RenderingIntentFlag=Re.PromiseCapability=Re.PermissionFlag=Re.PasswordResponses=Re.PasswordException=Re.PageActionEventType=Re.OPS=Re.MissingPDFException=Re.MAX_IMAGE_SIZE_TO_CACHE=Re.LINE_FACTOR=Re.LINE_DESCENT_FACTOR=Re.InvalidPDFException=Re.ImageKind=Re.IDENTITY_MATRIX=Re.FormatError=Re.FeatureTest=Re.FONT_IDENTITY_MATRIX=Re.DocumentActionEventType=Re.CMapCompressionType=Re.BaseException=Re.BASELINE_FACTOR=Re.AnnotationType=Re.AnnotationReplyType=Re.AnnotationPrefix=Re.AnnotationMode=Re.AnnotationFlag=Re.AnnotationFieldFlag=Re.AnnotationEditorType=Re.AnnotationEditorPrefix=Re.AnnotationEditorParamsType=Re.AnnotationBorderStyleType=Re.AnnotationActionEventType=Re.AbortException=void 0,Re.assert=vr,Re.bytesToString=Br,Re.createValidAbsoluteUrl=kr,Re.getModificationDate=cn,Re.getUuid=In,Re.getVerbosityLevel=xr,Re.info=Rr,Re.isArrayBuffer=Wr,Re.isArrayEqual=hn,Re.isNodeJS=void 0,Re.normalizeUnicode=gn,Re.objectFromMap=Sr,Re.objectSize=mr,Re.setVerbosityLevel=sr,Re.shadow=cr,Re.string32=Vr,Re.stringToBytes=Hr,Re.stringToPDFString=Fr,Re.stringToUTF8String=Kr,Re.unreachable=wr,Re.utf8StringToString=an,Re.warn=br;const Te=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");Re.isNodeJS=Te;const je=[1,0,0,1,0,0];Re.IDENTITY_MATRIX=je;const Oe=[.001,0,0,.001,0,0];Re.FONT_IDENTITY_MATRIX=Oe;const Me=1e7;Re.MAX_IMAGE_SIZE_TO_CACHE=Me;const De=1.35;Re.LINE_FACTOR=De;const $e=.35;Re.LINE_DESCENT_FACTOR=$e;const Be=$e/De;Re.BASELINE_FACTOR=Be;const Ue={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};Re.RenderingIntentFlag=Ue;const ze={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};Re.AnnotationMode=ze;const We="pdfjs_internal_editor_";Re.AnnotationEditorPrefix=We;const Xe={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};Re.AnnotationEditorType=Xe;const He={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};Re.AnnotationEditorParamsType=He;const qe={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};Re.PermissionFlag=qe;const Ge={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};Re.TextRenderingMode=Ge;const Ye={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};Re.ImageKind=Ye;const Ve={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};Re.AnnotationType=Ve;const Ke={GROUP:"Group",REPLY:"R"};Re.AnnotationReplyType=Ke;const Qe={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};Re.AnnotationFlag=Qe;const Ze={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};Re.AnnotationFieldFlag=Ze;const Je={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};Re.AnnotationBorderStyleType=Je;const ir={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};Re.AnnotationActionEventType=ir;const rr={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};Re.DocumentActionEventType=rr;const ar={O:"PageOpen",C:"PageClose"};Re.PageActionEventType=ar;const or={ERRORS:0,WARNINGS:1,INFOS:5};Re.VerbosityLevel=or;const pr={NONE:0,BINARY:1};Re.CMapCompressionType=pr;const tr={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};Re.OPS=tr;const nr={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};Re.PasswordResponses=nr;let hr=or.WARNINGS;function sr(on){Number.isInteger(on)&&(hr=on)}function xr(){return hr}function Rr(on){hr>=or.INFOS&&console.log(`Info: ${on}`)}function br(on){hr>=or.WARNINGS&&console.log(`Warning: ${on}`)}function wr(on){throw new Error(on)}function vr(on,Yr){on||wr(Yr)}function Dr(on){switch(on==null?void 0:on.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function kr(on,Yr=null,sn=null){if(!on)return null;
3986try{if(sn&&typeof on=="string"){if(sn.addDefaultProtocol&&on.startsWith("www.")){const Bn=on.match(/\./g);(Bn==null?void 0:Bn.length)>=2&&(on=`http://${on}`)}if(sn.tryConvertEncoding)try{on=Kr(on)}catch{}}const On=Yr?new URL(on,Yr):new URL(on);if(Dr(On))return On}catch{}return null}function cr(on,Yr,sn,On=!1){return Object.defineProperty(on,Yr,{value:sn,enumerable:!On,configurable:!0,writable:!1}),sn}const dr=function(){function Yr(sn,On){this.constructor===Yr&&wr("Cannot initialize BaseException."),this.message=sn,this.name=On}return Yr.prototype=new Error,Yr.constructor=Yr,Yr}();Re.BaseException=dr;class ur extends dr{constructor(Yr,sn){super(Yr,"PasswordException"),this.code=sn}}Re.PasswordException=ur;class gr extends dr{constructor(Yr,sn){super(Yr,"UnknownErrorException"),this.details=sn}}Re.UnknownErrorException=gr;class _r extends dr{constructor(Yr){super(Yr,"InvalidPDFException")}}Re.InvalidPDFException=_r;class Ir extends dr{constructor(Yr){super(Yr,"MissingPDFException")}}Re.MissingPDFException=Ir;class Ar extends dr{constructor(Yr,sn){super(Yr,"UnexpectedResponseException"),this.status=sn}}Re.UnexpectedResponseException=Ar;class Tr extends dr{constructor(Yr){super(Yr,"FormatError")}}Re.FormatError=Tr;class Nr extends dr{constructor(Yr){super(Yr,"AbortException")}}Re.AbortException=Nr;function Br(on){(typeof on!="object"||(on==null?void 0:on.length)===void 0)&&wr("Invalid argument for bytesToString");const Yr=on.length,sn=8192;if(Yr<sn)return String.fromCharCode.apply(null,on);const On=[];for(let Bn=0;Bn<Yr;Bn+=sn){const Hn=Math.min(Bn+sn,Yr),Zr=on.subarray(Bn,Hn);On.push(String.fromCharCode.apply(null,Zr))}return On.join("")}function Hr(on){typeof on!="string"&&wr("Invalid argument for stringToBytes");const Yr=on.length,sn=new Uint8Array(Yr);for(let On=0;On<Yr;++On)sn[On]=on.charCodeAt(On)&255;return sn}function Vr(on){return String.fromCharCode(on>>24&255,on>>16&255,on>>8&255,on&255)}function mr(on){return Object.keys(on).length}function Sr(on){const Yr=Object.create(null);for(const[sn,On]of on)Yr[sn]=On;return Yr}function Lr(){const on=new Uint8Array(4);return on[0]=1,new Uint32Array(on.buffer,0,1)[0]===1}function jr(){try{return new Function(""),!0}catch{return!1}}class fr{static get isLittleEndian(){return cr(this,"isLittleEndian",Lr())}static get isEvalSupported(){return cr(this,"isEvalSupported",jr(
3986))}static get isOffscreenCanvasSupported(){return cr(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?cr(this,"platform",{isWin:!1,isMac:!1}):cr(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var Yr,sn;return cr(this,"isCSSRoundSupported",(sn=(Yr=globalThis.CSS)==null?void 0:Yr.supports)==null?void 0:sn.call(Yr,"width: round(1.5px, 1px)"))}}Re.FeatureTest=fr;const Cr=[...Array(256).keys()].map(on=>on.toString(16).padStart(2,"0"));class Mr{static makeHexColor(Yr,sn,On){return`#${Cr[Yr]}${Cr[sn]}${Cr[On]}`}static scaleMinMax(Yr,sn){let On;Yr[0]?(Yr[0]<0&&(On=sn[0],sn[0]=sn[1],sn[1]=On),sn[0]*=Yr[0],sn[1]*=Yr[0],Yr[3]<0&&(On=sn[2],sn[2]=sn[3],sn[3]=On),sn[2]*=Yr[3],sn[3]*=Yr[3]):(On=sn[0],sn[0]=sn[2],sn[2]=On,On=sn[1],sn[1]=sn[3],sn[3]=On,Yr[1]<0&&(On=sn[2],sn[2]=sn[3],sn[3]=On),sn[2]*=Yr[1],sn[3]*=Yr[1],Yr[2]<0&&(On=sn[0],sn[0]=sn[1],sn[1]=On),sn[0]*=Yr[2],sn[1]*=Yr[2]),sn[0]+=Yr[4],sn[1]+=Yr[4],sn[2]+=Yr[5],sn[3]+=Yr[5]}static transform(Yr,sn){return[Yr[0]*sn[0]+Yr[2]*sn[1],Yr[1]*sn[0]+Yr[3]*sn[1],Yr[0]*sn[2]+Yr[2]*sn[3],Yr[1]*sn[2]+Yr[3]*sn[3],Yr[0]*sn[4]+Yr[2]*sn[5]+Yr[4],Yr[1]*sn[4]+Yr[3]*sn[5]+Yr[5]]}static applyTransform(Yr,sn){const On=Yr[0]*sn[0]+Yr[1]*sn[2]+sn[4],Bn=Yr[0]*sn[1]+Yr[1]*sn[3]+sn[5];return[On,Bn]}static applyInverseTransform(Yr,sn){const On=sn[0]*sn[3]-sn[1]*sn[2],Bn=(Yr[0]*sn[3]-Yr[1]*sn[2]+sn[2]*sn[5]-sn[4]*sn[3])/On,Hn=(-Yr[0]*sn[1]+Yr[1]*sn[0]+sn[4]*sn[1]-sn[5]*sn[0])/On;return[Bn,Hn]}static getAxialAlignedBoundingBox(Yr,sn){const On=this.applyTransform(Yr,sn),Bn=this.applyTransform(Yr.slice(2,4),sn),Hn=this.applyTransform([Yr[0],Yr[3]],sn),Zr=this.applyTransform([Yr[2],Yr[1]],sn);return[Math.min(On[0],Bn[0],Hn[0],Zr[0]),Math.min(On[1],Bn[1],Hn[1],Zr[1]),Math.max(On[0],Bn[0],Hn[0],Zr[0]),Math.max(On[1],Bn[1],Hn[1],Zr[1])]}static inverseTransform(Yr){const sn=Yr[0]*Yr[3]-Yr[1]*Yr[2];return[Yr[3]/sn,-Yr[1]/sn,-Yr[2]/sn,Yr[0]/sn,(Yr[2]*Yr[5]-Yr[4]*Yr[3])/sn,(Yr[4]*Yr[1]-Yr[5]*Yr[0])/sn]}static singularValueDecompose2dScale(Yr){const sn=[Yr[0],Yr[2],Yr[1],Yr[3]],On=Yr[0]*sn[0]+Yr[1]*sn[2],Bn=Yr[0]*sn[1]+Yr[1]*sn[3],Hn=Yr[2]*sn[0]+Yr[3]*sn[2],Zr=Yr[2]*sn[1]+Yr[3]*sn[3],xn=(On+Zr)/2,An=Math.sqrt((On+Zr)**2-4*(On*Zr-Hn*Bn))/2,Wn=xn+An||1,ss=xn-An||1;return[Math.sqrt(Wn),Math.sqrt(ss)]}static normalizeRect(Yr){const sn=Yr.slice(0);return Yr[0]>Yr[2]&&(sn[0]=Yr[2],sn[2]=Yr[0]),Yr[1]>Yr[3]&&(sn[1]=Yr[3],sn[3]=Yr[1]),sn}static intersect(Yr,sn){const On=Math.max(Math.min(Yr[0],Yr[2]),Math.min(sn[0],sn[2])),Bn=Math.min(Math.max(Yr[0],Yr[2]),Math.max(sn[0],sn[2]));if(On>Bn)return null;const Hn=Math.max(Math.min(Yr[1],Yr[3]),Math.min(sn[1],sn[3])),Zr=Math.min(Math.max(Yr[1],Yr[3]),Math.max(sn[1],sn[3]));return Hn>Zr?null:[On,Hn,Bn,Zr]}static bezierBoundingBox(Yr,sn,On,Bn,Hn,Zr,xn,An){const Wn=[],ss=[[],[]];let Yn,en,Gr,nn,En,Cn,jn,$n;for(let fs=0;fs<2;++fs){if(fs===0?(en=6*Yr-12*On+6*Hn,Yn=-3*Yr+9*On-9*Hn+3*xn,Gr=3*On-3*Yr):(en=6*sn-12*Bn+6*Zr,Yn=-3*sn+9*Bn-9*Zr+3*An,Gr=3*Bn-3*sn),Math.abs(Yn)<1e-12){if(Math.abs(en)<1e-12)continue;nn=-Gr/en,0<nn&&nn<1&&Wn.push(nn);continue}jn=en*en-4*Gr*Yn,$n=Math.sqrt(jn),!(jn<0)&&(En=(-en+$n)/(2*Yn),0<En&&En<1&&Wn.push(En),Cn=(-en-$n)/(2*Yn),0<Cn&&Cn<1&&Wn.push(Cn))}let Vn=Wn.length,Qn;const Un=Vn;for(;Vn--;)nn=Wn[Vn],Qn=1-nn,ss[0][Vn]=Qn*Qn*Qn*Yr+3*Qn*Qn*nn*On+3*Qn*nn*nn*Hn+nn*nn*nn*xn,ss[1][Vn]=Qn*Qn*Qn*sn+3*Qn*Qn*nn*Bn+3*Qn*nn*nn*Zr+nn*nn*nn*An;return ss[0][Un]=Yr,ss[1][Un]=sn,ss[0][Un+1]=xn,ss[1][Un+1]=An,ss[0].length=ss[1].length=Un+2,[Math.min(...ss[0]),Math.min(...ss[1]),Math.max(...ss[0]),Math.max(...ss[1])]}}Re.Util=Mr;const $r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Fr(on){if(on[0]>="ï"){let sn;if(on[0]==="þ"&&on[1]==="ÿ"?sn="utf-16be":on[0]==="ÿ"&&on[1]==="þ"?sn="utf-16le":on[0]==="ï"&&on[1]==="»"&&on[2]==="¿"&&(sn="utf-8"),sn)try{const On=new TextDecoder(sn,{fatal:!0}),Bn=Hr(on);return On.decode(Bn)}catch(On){br(`stringToPDFString: "${On}".`)}}const Yr=[];for(let sn=0,On=on.length;sn<On;sn++){const Bn=$r[on.charCodeAt(sn)];Yr.push(Bn?String.fromCharCode(Bn):on.charAt(sn))}return Yr.join("")}function Kr(on){return decodeURIComponent(escape(on))}function an(on){return unescape(encodeURIComponent(on))}function Wr(on){return typeof on=="object"&&(on==null?void 0:on.byteLength)!==void 0}function hn(on,Yr){if(on.length!==Yr.length)return!1;for(let sn=0,On=on.length;sn<On;sn++)if(on[sn]!==Yr[sn])return!1;return!0}function cn(on=new Date){return[on.getUTCFullYear().toString(),(on.getUTCMonth()+1).toString().padStart(2,"0"),on.getUTCDate().toString().padStart(2,"0"),on.getUTCHours().toString().padStart(2,"0"),on.getUTCMinutes().toString().padStart(2,"0"),on.getUTCSeconds().toString().padStart(2,"0")].join("")}class tn{constructor(){Pn(this,Mn,!1);this.promise=new Promise((Yr,sn)=>{this.resolve=On=>{kn(this,Mn,!0),Yr(On)},this.reject=On=>{kn(this,Mn,!0),sn(On)}})}get settled(){return Pr(this,Mn)}}Mn=new WeakMap,Re.PromiseCapability=tn;let Qr=null,wn=null;function gn(on){return Qr||(Qr=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,wn=new Map([["ï¬
","ſt"]])),on.replaceAll(Qr,(Yr,sn,On)=>sn?sn.normalize("NFKC"):wn.get(On))}function In(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const on=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(on);else for(let Yr=0;Yr<32;Yr++)on[Yr]=Math.floor(Math.random()*255);return Br(on)}const yn="pdfjs_internal_id_";Re.AnnotationPrefix=yn},(__unused_webpack_module,exports$1,__w_pdfjs_require__)=>{var Ee,Te,je,Oe,ka,kl,$e,Be,Ue,ze,We,Xe,He,qe,Ge,jl,Ve,Ke,cc,Ze,Je;Object.defineProperty(exports$1,"__esModule",{value:!0}),exports$1.RenderTask=exports$1.PDFWorkerUtil=exports$1.PDFWorker=exports$1.PDFPageProxy=exports$1.PDFDocumentProxy=exports$1.PDFDocumentLoadingTask=exports$1.PDFDataRangeTransport=exports$1.LoopbackPort=exports$1.DefaultStandardFontDataFactory=exports$1.DefaultFilterFactory=exports$1.DefaultCanvasFactory=exports$1.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports$1,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports$1.build=void 0,exports$1.getDocument=getDocument,exports$1.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_c
3986anvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports$1.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports$1.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports$1.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports$1.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(rr){if(typeof rr=="string"||rr instanceof URL?rr={url:rr}:(0,_util.isArrayBuffer)(rr)&&(rr={data:rr}),typeof rr!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!rr.url&&!rr.data&&!rr.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const ar=new PDFDocumentLoadingTask,{docId:or}=ar,pr=rr.url?getUrlProp(rr.url):null,tr=rr.data?getDataProp(rr.data):null,nr=rr.httpHeaders||null,hr=rr.withCredentials===!0,sr=rr.password??null,xr=rr.range instanceof PDFDataRangeTransport?rr.range:null,Rr=Number.isInteger(rr.rangeChunkSize)&&rr.rangeChunkSize>0?rr.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let br=rr.worker instanceof PDFWorker?rr.worker:null;const wr=rr.verbosity,vr=typeof rr.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(rr.docBaseUrl)?rr.docBaseUrl:null,Dr=typeof rr.cMapUrl=="string"?rr.cMapUrl:null,kr=rr.cMapPacked!==!1,cr=rr.CMapReaderFactory||DefaultCMapReaderFactory,dr=typeof rr.standardFontDataUrl=="string"?rr.standardFontDataUrl:null,ur=rr.StandardFontDataFactory||DefaultStandardFontDataFactory,gr=rr.stopAtErrors!==!0,_r=Number.isInteger(rr.maxImageSize)&&rr.maxImageSize>-1?rr.maxImageSize:-1,Ir=rr.isEvalSupported!==!1,Ar=typeof rr.isOffscreenCanvasSupported=="boolean"?rr.isOffscreenCanvasSupported:!_util.isNodeJS,Tr=Number.isInteger(rr.canvasMaxAreaInBytes)?rr.canvasMaxAreaInBytes:-1,Nr=typeof rr.disableFontFace=="boolean"?rr.disableFontFace:_util.isNodeJS,Br=rr.fontExtraProperties===!0,Hr=rr.enableXfa===!0,Vr=rr.ownerDocument||globalThis.document,mr=rr.disableRange===!0,Sr=rr.disableStream===!0,Lr=rr.disableAutoFetch===!0,jr=rr.pdfBug===!0,fr=xr?xr.length:rr.length??NaN,Cr=typeof rr.useSystemFonts=="boolean"?rr.useSystemFonts:!_util.isNodeJS&&!Nr,Mr=typeof rr.useWorkerFetch=="boolean"?rr.useWorkerFetch:cr===_display_utils.DOMCMapReaderFactory&&ur===_display_utils.DOMStandardFontDataFactory&&Dr&&dr&&(0,_display_utils.isValidFetchUrl)(Dr,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(dr,document.baseURI),$r=rr.canvasFactory||new DefaultCanvasFactory({ownerDocument:Vr}),Fr=rr.filterFactory||new DefaultFilterFactory({docId:or,ownerDocument:Vr}),Kr=null;(0,_util.setVerbosityLevel)(wr);const an={canvasFactory:$r,filterFactory:Fr};if(Mr||(an.cMapReaderFactory=new cr({baseUrl:Dr,isCompressed:kr}),an.standardFontDataFactory=new ur({baseUrl:dr})),!br){const cn={verbosity:wr,port:_worker_options.GlobalWorkerOptions.workerPort};br=cn.port?PDFWorker.fromPort(cn):new PDFWorker(cn),ar._worker=br}const Wr={docId:or,apiVersion:"3.11.174",data:tr,password:sr,disableAutoFetch:Lr,rangeChunkSize:Rr,length:fr,docBaseUrl:vr,enableXfa:Hr,evaluatorOptions:{maxImageSize:_r,disableFontFace:Nr,ignoreErrors:gr,isEvalSupported:Ir,isOffscreenCanvasSupported:Ar,canvasMaxAreaInBytes:Tr,fontExtraProperties:Br,useSystemFonts:Cr,cMapUrl:Mr?Dr:null,standardFontDataUrl:Mr?dr:null}},hn={ignoreErrors:gr,isEvalSupported:Ir,disableFontFace:Nr,fontE
3986xtraProperties:Br,enableXfa:Hr,ownerDocument:Vr,disableAutoFetch:Lr,pdfBug:jr,styleElement:Kr};return br.promise.then(function(){if(ar.destroyed)throw new Error("Loading aborted");const cn=_fetchDocument(br,Wr),tn=new Promise(function(Qr){let wn;xr?wn=new _transport_stream.PDFDataTransportStream({length:fr,initialData:xr.initialData,progressiveDone:xr.progressiveDone,contentDispositionFilename:xr.contentDispositionFilename,disableRange:mr,disableStream:Sr},xr):tr||(wn=(In=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(In):(0,_display_utils.isValidFetchUrl)(In.url)?new _displayFetch_stream.PDFFetchStream(In):new _displayNetwork.PDFNetworkStream(In))({url:pr,length:fr,httpHeaders:nr,withCredentials:hr,rangeChunkSize:Rr,disableRange:mr,disableStream:Sr})),Qr(wn)});return Promise.all([cn,tn]).then(function([Qr,wn]){if(ar.destroyed)throw new Error("Loading aborted");const gn=new _message_handler.MessageHandler(or,Qr,br.port),In=new WorkerTransport(gn,ar,wn,hn,an);ar._transport=In,gn.send("Ready",null)})}).catch(ar._capability.reject),ar}async function _fetchDocument(rr,ar){if(rr.destroyed)throw new Error("Worker was destroyed");const or=await rr.messageHandler.sendWithPromise("GetDocRequest",ar,ar.data?[ar.data.buffer]:null);if(rr.destroyed)throw new Error("Worker was destroyed");return or}function getUrlProp(rr){if(rr instanceof URL)return rr.href;try{return new URL(rr,window.location).href}catch{if(_util.isNodeJS&&typeof rr=="string")return rr}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(rr){if(_util.isNodeJS&&typeof Buffer<"u"&&rr instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(rr instanceof Uint8Array&&rr.byteLength===rr.buffer.byteLength)return rr;if(typeof rr=="string")return(0,_util.stringToBytes)(rr);if(typeof rr=="object"&&!isNaN(rr==null?void 0:rr.length)||(0,_util.isArrayBuffer)(rr))return new Uint8Array(rr);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const Re=class Re{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Ka(Re,Ee)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var ar,or,pr;this.destroyed=!0;try{(ar=this._worker)!=null&&ar.port&&(this._worker._pendingDestroy=!0),await((or=this._transport)==null?void 0:or.destroy())}catch(tr){throw(pr=this._worker)!=null&&pr.port&&delete this._worker._pendingDestroy,tr}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};Ee=new WeakMap,Pn(Re,Ee,0);let PDFDocumentLoadingTask=Re;exports$1.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(ar,or,pr=!1,tr=null){this.length=ar,this.initialData=or,this.progressiveDone=pr,this.contentDispositionFilename=tr,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(ar){this._rangeListeners.push(ar)}addProgressListener(ar){this._progressListeners.push(ar)}addProgressiveReadListener(ar){this._progressiveReadListeners.push(ar)}addProgressiveDoneListener(ar){this._progressiveDoneListeners.push(ar)}onDataRange(ar,or){for(const pr of this._rangeListeners)pr(ar,or)}onDataProgress(ar,or){this._readyCapability.promise.then(()=>{for(const pr of this._progressListeners)pr(ar,or)})}onDataProgressiveRead(ar){this._readyCapability.promise.then(()=>{for(const or of this._progressiveReadListeners)or(ar)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const ar of this._progressiveDoneListeners)ar()})}transportReady(){this._readyCapability.resolve()}requestDataRange(ar,or){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports$1.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(ar,or){this._pdfInfo=ar,this._transport=or,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(pr=>{if(!pr)return pr;const tr=[];for(const nr in pr)tr.push(...pr[nr]);return tr}))})}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,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(ar){return this._transport.getPage(ar)}getPageIndex(ar){return this._transport.getPageIndex(ar)}getDestinations(){return this._transport.getDestinations()}getDestination(ar){return this._transport.getDestination(ar)}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(){return this._transport.getOptionalContentConfig()}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(ar=!1){return this._transport.startCleanup(ar||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}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()}}exports$1.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(ar,or,pr,tr=!1){Pn(this,Oe);Pn(this,Te,null);Pn(this,je,!1);this._pageIndex=ar,this._pageInfo=or,this._transport=pr,this._stats=tr?new _display_utils.StatTimer:null,this._pdfBug=tr,this.commonObjs=pr.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:ar,rotation:or=this.rotate,offsetX:pr=0,offsetY:tr=0,dontFlip:nr=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:ar,rotation:or,offsetX:pr,offsetY:tr,dontFlip:nr})}getAnnotations({intent:ar="display"}={}
3986){const or=this._transport.getRenderingIntent(ar);return this._transport.getAnnotations(this._pageIndex,or.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var ar;return((ar=this._transport._htmlForXfa)==null?void 0:ar.children[this._pageIndex])||null}render({canvasContext:ar,viewport:or,intent:pr="display",annotationMode:tr=_util.AnnotationMode.ENABLE,transform:nr=null,background:hr=null,optionalContentConfigPromise:sr=null,annotationCanvasMap:xr=null,pageColors:Rr=null,printAnnotationStorage:br=null}){var ur,gr;(ur=this._stats)==null||ur.time("Overall");const wr=this._transport.getRenderingIntent(pr,tr,br);kn(this,je,!1),vn(this,Oe,kl).call(this),sr||(sr=this._transport.getOptionalContentConfig());let vr=this._intentStates.get(wr.cacheKey);vr||(vr=Object.create(null),this._intentStates.set(wr.cacheKey,vr)),vr.streamReaderCancelTimeout&&(clearTimeout(vr.streamReaderCancelTimeout),vr.streamReaderCancelTimeout=null);const Dr=!!(wr.renderingIntent&_util.RenderingIntentFlag.PRINT);vr.displayReadyCapability||(vr.displayReadyCapability=new _util.PromiseCapability,vr.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(gr=this._stats)==null||gr.time("Page Request"),this._pumpOperatorList(wr));const kr=_r=>{var Ir,Ar;vr.renderTasks.delete(cr),(this._maybeCleanupAfterRender||Dr)&&kn(this,je,!0),vn(this,Oe,ka).call(this,!Dr),_r?(cr.capability.reject(_r),this._abortOperatorList({intentState:vr,reason:_r instanceof Error?_r:new Error(_r)})):cr.capability.resolve(),(Ir=this._stats)==null||Ir.timeEnd("Rendering"),(Ar=this._stats)==null||Ar.timeEnd("Overall")},cr=new InternalRenderTask({callback:kr,params:{canvasContext:ar,viewport:or,transform:nr,background:hr},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:xr,operatorList:vr.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!Dr,pdfBug:this._pdfBug,pageColors:Rr});(vr.renderTasks||(vr.renderTasks=new Set)).add(cr);const dr=cr.task;return Promise.all([vr.displayReadyCapability.promise,sr]).then(([_r,Ir])=>{var Ar;if(this.destroyed){kr();return}(Ar=this._stats)==null||Ar.time("Rendering"),cr.initializeGraphics({transparency:_r,optionalContentConfig:Ir}),cr.operatorListChanged()}).catch(kr),dr}getOperatorList({intent:ar="display",annotationMode:or=_util.AnnotationMode.ENABLE,printAnnotationStorage:pr=null}={}){var xr;function tr(){hr.operatorList.lastChunk&&(hr.opListReadCapability.resolve(hr.operatorList),hr.renderTasks.delete(sr))}const nr=this._transport.getRenderingIntent(ar,or,pr,!0);let hr=this._intentStates.get(nr.cacheKey);hr||(hr=Object.create(null),this._intentStates.set(nr.cacheKey,hr));let sr;return hr.opListReadCapability||(sr=Object.create(null),sr.operatorListChanged=tr,hr.opListReadCapability=new _util.PromiseCapability,(hr.renderTasks||(hr.renderTasks=new Set)).add(sr),hr.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(xr=this._stats)==null||xr.time("Page Request"),this._pumpOperatorList(nr)),hr.opListReadCapability.promise}streamTextContent({includeMarkedContent:ar=!1,disableNormalization:or=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:ar===!0,disableNormalization:or===!0},{highWaterMark:100,size(tr){return tr.items.length}})}getTextContent(ar={}){if(this._transport._htmlForXfa)return this.getXfa().then(pr=>_xfa_text.XfaText.textContent(pr));const or=this.streamTextContent(ar);return new Promise(function(pr,tr){function nr(){hr.read().then(function({value:xr,done:Rr}){if(Rr){pr(sr);return}Object.assign(sr.styles,xr.styles),sr.items.push(...xr.items),nr()},tr)}const hr=or.getReader(),sr={items:[],styles:Object.create(null)};nr()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const ar=[];for(const or of this._intentStates.values())if(this._abortOperatorList({intentState:or,reason:new Error("Page was destroyed."),force:!0}),!or.opListReadCapability)for(const pr of or.renderTasks)ar.push(pr.completed),pr.cancel();return this.objs.clear(),kn(this,je,!1),vn(this,Oe,kl).call(this),Promise.all(ar)}cleanup(ar=!1){kn(this,je,!0);const or=vn(this,Oe,ka).call(this,!1);return ar&&or&&this._stats&&(this._stats=new _display_utils.StatTimer),or}_startRenderPage(ar,or){var tr,nr;const pr=this._intentStates.get(or);
3986pr&&((tr=this._stats)==null||tr.timeEnd("Page Request"),(nr=pr.displayReadyCapability)==null||nr.resolve(ar))}_renderPageChunk(ar,or){for(let pr=0,tr=ar.length;pr<tr;pr++)or.operatorList.fnArray.push(ar.fnArray[pr]),or.operatorList.argsArray.push(ar.argsArray[pr]);or.operatorList.lastChunk=ar.lastChunk,or.operatorList.separateAnnots=ar.separateAnnots;for(const pr of or.renderTasks)pr.operatorListChanged();ar.lastChunk&&vn(this,Oe,ka).call(this,!0)}_pumpOperatorList({renderingIntent:ar,cacheKey:or,annotationStorageSerializable:pr}){const{map:tr,transfers:nr}=pr,sr=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:ar,cacheKey:or,annotationStorage:tr},nr).getReader(),xr=this._intentStates.get(or);xr.streamReader=sr;const Rr=()=>{sr.read().then(({value:br,done:wr})=>{if(wr){xr.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(br,xr),Rr())},br=>{if(xr.streamReader=null,!this._transport.destroyed){if(xr.operatorList){xr.operatorList.lastChunk=!0;for(const wr of xr.renderTasks)wr.operatorListChanged();vn(this,Oe,ka).call(this,!0)}if(xr.displayReadyCapability)xr.displayReadyCapability.reject(br);else if(xr.opListReadCapability)xr.opListReadCapability.reject(br);else throw br}})};Rr()}_abortOperatorList({intentState:ar,reason:or,force:pr=!1}){if(ar.streamReader){if(ar.streamReaderCancelTimeout&&(clearTimeout(ar.streamReaderCancelTimeout),ar.streamReaderCancelTimeout=null),!pr){if(ar.renderTasks.size>0)return;if(or instanceof _display_utils.RenderingCancelledException){let tr=RENDERING_CANCELLED_TIMEOUT;or.extraDelay>0&&or.extraDelay<1e3&&(tr+=or.extraDelay),ar.streamReaderCancelTimeout=setTimeout(()=>{ar.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:ar,reason:or,force:!0})},tr);return}}if(ar.streamReader.cancel(new _util.AbortException(or.message)).catch(()=>{}),ar.streamReader=null,!this._transport.destroyed){for(const[tr,nr]of this._intentStates)if(nr===ar){this._intentStates.delete(tr);break}this.cleanup()}}}get stats(){return this._stats}}Te=new WeakMap,je=new WeakMap,Oe=new WeakSet,ka=function(ar=!1){if(vn(this,Oe,kl).call(this),!Pr(this,je)||this.destroyed)return!1;if(ar)return kn(this,Te,setTimeout(()=>{kn(this,Te,null),vn(this,Oe,ka).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:or,operatorList:pr}of this._intentStates.values())if(or.size>0||!pr.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),kn(this,je,!1),!0},kl=function(){Pr(this,Te)&&(clearTimeout(Pr(this,Te)),kn(this,Te,null))},exports$1.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){Pn(this,$e,new Set);Pn(this,Be,Promise.resolve())}postMessage(ar,or){const pr={data:structuredClone(ar,or?{transfer:or}:null)};Pr(this,Be).then(()=>{for(const tr of Pr(this,$e))tr.call(this,pr)})}addEventListener(ar,or){Pr(this,$e).add(or)}removeEventListener(ar,or){Pr(this,$e).delete(or)}terminate(){Pr(this,$e).clear()}}$e=new WeakMap,Be=new WeakMap,exports$1.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports$1.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const rr=(Ue=document==null?void 0:document.currentScript)==null?void 0:Ue.src;rr&&(PDFWorkerUtil.fallbackWorkerSrc=rr.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(rr,ar){let or;try{if(or=new URL(rr),!or.origin||or.origin==="null")return!1}catch{return!1}const pr=new URL(ar,or);return or.origin===pr.origin},PDFWorkerUtil.createCDNWrapper=function(rr){const ar=`importScripts("${rr}");`;return URL.createObjectURL(new Blob([ar]))}}const _PDFWorker=class _PDFWorker{constructor({name:rr=null,port:ar=null,verbosity:or=(0,_util.getVerbosityLevel)()}={}){var pr;if(this.name=rr,this.destroyed=!1,this.verbosity=or,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,ar){if((pr=Pr(_PDFWorker,ze))!=null&&pr.has(ar))throw new Error("Cannot use more than one PDFWorker per port.");(Pr(_PDFWorker,ze)||kn(_PDFWorker,ze,new WeakMap)).set(ar,this),this._initializeFromPort(ar);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(rr){this._port=rr,this._messageHandler=new _message_handler.MessageHandler("main","worker",rr),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:rr}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,rr)||(rr=PDFWorkerUtil.createCDNWrapper(new URL(rr,window.location).href));const ar=new Worker(rr),or=new _message_handler.MessageHandler("main","worker",ar),pr=()=>
3986{ar.removeEventListener("error",tr),or.destroy(),ar.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},tr=()=>{this._webWorker||pr()};ar.addEventListener("error",tr),or.on("test",hr=>{if(ar.removeEventListener("error",tr),this.destroyed){pr();return}hr?(this._messageHandler=or,this._port=ar,this._webWorker=ar,this._readyCapability.resolve(),or.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),or.destroy(),ar.terminate())}),or.on("ready",hr=>{if(ar.removeEventListener("error",tr),this.destroyed){pr();return}try{nr()}catch{this._setupFakeWorker()}});const nr=()=>{const hr=new Uint8Array;or.send("test",hr,[hr.buffer])};nr();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(rr=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const ar=new LoopbackPort;this._port=ar;const or=`fake${PDFWorkerUtil.fakeWorkerId++}`,pr=new _message_handler.MessageHandler(or+"_worker",or,ar);rr.setup(pr,ar);const tr=new _message_handler.MessageHandler(or,or+"_worker",ar);this._messageHandler=tr,this._readyCapability.resolve(),tr.send("configure",{verbosity:this.verbosity})}).catch(rr=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${rr.message}".`))})}destroy(){var rr;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(rr=Pr(_PDFWorker,ze))==null||rr.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(rr){var or;if(!(rr!=null&&rr.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const ar=(or=Pr(this,ze))==null?void 0:or.get(rr.port);if(ar){if(ar._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return ar}return new _PDFWorker(rr)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var rr;try{return((rr=globalThis.pdfjsWorker)==null?void 0:rr.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};ze=new WeakMap,Pn(_PDFWorker,ze);let PDFWorker=_PDFWorker;exports$1.PDFWorker=PDFWorker;class WorkerTransport{constructor(ar,or,pr,tr,nr){Pn(this,Ge);Pn(this,We,new Map);Pn(this,Xe,new Map);Pn(this,He,new Map);Pn(this,qe,null);this.messageHandler=ar,this.loadingTask=or,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:tr.ownerDocument,styleElement:tr.styleElement}),this._params=tr,this.canvasFactory=nr.canvasFactory,this.filterFactory=nr.filterFactory,this.cMapReaderFactory=nr.cMapReaderFactory,this.standardFontDataFactory=nr.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=pr,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(ar,or=_util.AnnotationMode.ENABLE,pr=null,tr=!1){let nr=_util.RenderingIntentFlag.DISPLAY,hr=_annotation_storage.SerializableEmpty;switch(ar){case"any":nr=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":nr=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${ar}`)}switch(or){case _util.AnnotationMode.DISABLE:nr+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:nr+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:nr+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,hr=(nr&_util.RenderingIntentFlag.PRINT&&pr instanceof _annotation_storage.PrintAnnotationStorage?pr:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${or}`)}return tr&&(nr+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:nr,cacheKey:`${nr}_${hr.hash}`,annotationStorageSerializable:hr}}destroy(){var pr;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(pr=Pr(this,qe))==null||pr.reject(new Error("Worker was destroyed during onPassword callback"));const ar=[];for(const tr of Pr(this,Xe).values())ar.push(tr._destroy());Pr(this,Xe).clear(),Pr(this,He).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();
3986const or=this.messageHandler.sendWithPromise("Terminate",null);return ar.push(or),Promise.all(ar).then(()=>{var tr;this.commonObjs.clear(),this.fontLoader.clear(),Pr(this,We).clear(),this.filterFactory.destroy(),(tr=this._networkStream)==null||tr.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:ar,loadingTask:or}=this;ar.on("GetReader",(pr,tr)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=nr=>{this._lastProgress={loaded:nr.loaded,total:nr.total}},tr.onPull=()=>{this._fullReader.read().then(function({value:nr,done:hr}){if(hr){tr.close();return}(0,_util.assert)(nr instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),tr.enqueue(new Uint8Array(nr),1,[nr])}).catch(nr=>{tr.error(nr)})},tr.onCancel=nr=>{this._fullReader.cancel(nr),tr.ready.catch(hr=>{if(!this.destroyed)throw hr})}}),ar.on("ReaderHeadersReady",pr=>{const tr=new _util.PromiseCapability,nr=this._fullReader;return nr.headersReady.then(()=>{var hr;(!nr.isStreamingSupported||!nr.isRangeSupported)&&(this._lastProgress&&((hr=or.onProgress)==null||hr.call(or,this._lastProgress)),nr.onProgress=sr=>{var xr;(xr=or.onProgress)==null||xr.call(or,{loaded:sr.loaded,total:sr.total})}),tr.resolve({isStreamingSupported:nr.isStreamingSupported,isRangeSupported:nr.isRangeSupported,contentLength:nr.contentLength})},tr.reject),tr.promise}),ar.on("GetRangeReader",(pr,tr)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const nr=this._networkStream.getRangeReader(pr.begin,pr.end);if(!nr){tr.close();return}tr.onPull=()=>{nr.read().then(function({value:hr,done:sr}){if(sr){tr.close();return}(0,_util.assert)(hr instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),tr.enqueue(new Uint8Array(hr),1,[hr])}).catch(hr=>{tr.error(hr)})},tr.onCancel=hr=>{nr.cancel(hr),tr.ready.catch(sr=>{if(!this.destroyed)throw sr})}}),ar.on("GetDoc",({pdfInfo:pr})=>{this._numPages=pr.numPages,this._htmlForXfa=pr.htmlForXfa,delete pr.htmlForXfa,or._capability.resolve(new PDFDocumentProxy(pr,this))}),ar.on("DocException",function(pr){let tr;switch(pr.name){case"PasswordException":tr=new _util.PasswordException(pr.message,pr.code);break;case"InvalidPDFException":tr=new _util.InvalidPDFException(pr.message);break;case"MissingPDFException":tr=new _util.MissingPDFException(pr.message);break;case"UnexpectedResponseException":tr=new _util.UnexpectedResponseException(pr.message,pr.status);break;case"UnknownErrorException":tr=new _util.UnknownErrorException(pr.message,pr.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}or._capability.reject(tr)}),ar.on("PasswordRequest",pr=>{if(kn(this,qe,new _util.PromiseCapability),or.onPassword){const tr=nr=>{nr instanceof Error?Pr(this,qe).reject(nr):Pr(this,qe).resolve({password:nr})};try{or.onPassword(tr,pr.code)}catch(nr){Pr(this,qe).reject(nr)}}else Pr(this,qe).reject(new _util.PasswordException(pr.message,pr.code));return Pr(this,qe).promise}),ar.on("DataLoaded",pr=>{var tr;(tr=or.onProgress)==null||tr.call(or,{loaded:pr.length,total:pr.length}),this.downloadInfoCapability.resolve(pr)}),ar.on("StartRenderPage",pr=>{if(this.destroyed)return;Pr(this,Xe).get(pr.pageIndex)._startRenderPage(pr.transparency,pr.cacheKey)}),ar.on("commonobj",([pr,tr,nr])=>{var hr;if(!this.destroyed&&!this.commonObjs.has(pr))switch(tr){case"Font":const sr=this._params;if("error"in nr){const br=nr.error;(0,_util.warn)(`Error during font loading: ${br}`),this.commonObjs.resolve(pr,br);break}const xr=sr.pdfBug&&((hr=globalThis.FontInspector)!=null&&hr.enabled)?(br,wr)=>
3986globalThis.FontInspector.fontAdded(br,wr):null,Rr=new _font_loader.FontFaceObject(nr,{isEvalSupported:sr.isEvalSupported,disableFontFace:sr.disableFontFace,ignoreErrors:sr.ignoreErrors,inspectFont:xr});this.fontLoader.bind(Rr).catch(br=>ar.sendWithPromise("FontFallback",{id:pr})).finally(()=>{!sr.fontExtraProperties&&Rr.data&&(Rr.data=null),this.commonObjs.resolve(pr,Rr)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(pr,nr);break;default:throw new Error(`Got unknown common object type ${tr}`)}}),ar.on("obj",([pr,tr,nr,hr])=>{var xr;if(this.destroyed)return;const sr=Pr(this,Xe).get(tr);if(!sr.objs.has(pr))switch(nr){case"Image":if(sr.objs.resolve(pr,hr),hr){let Rr;if(hr.bitmap){const{width:br,height:wr}=hr;Rr=br*wr*4}else Rr=((xr=hr.data)==null?void 0:xr.length)||0;Rr>_util.MAX_IMAGE_SIZE_TO_CACHE&&(sr._maybeCleanupAfterRender=!0)}break;case"Pattern":sr.objs.resolve(pr,hr);break;default:throw new Error(`Got unknown object type ${nr}`)}}),ar.on("DocProgress",pr=>{var tr;this.destroyed||(tr=or.onProgress)==null||tr.call(or,{loaded:pr.loaded,total:pr.total})}),ar.on("FetchBuiltInCMap",pr=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(pr):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),ar.on("FetchStandardFontData",pr=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(pr):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var pr;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:ar,transfers:or}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:ar,filename:((pr=this._fullReader)==null?void 0:pr.filename)??null},or).finally(()=>{this.annotationStorage.resetModified()})}getPage(ar){if(!Number.isInteger(ar)||ar<=0||ar>this._numPages)return Promise.reject(new Error("Invalid page request."));const or=ar-1,pr=Pr(this,He).get(or);if(pr)return pr;const tr=this.messageHandler.sendWithPromise("GetPage",{pageIndex:or}).then(nr=>{if(this.destroyed)throw new Error("Transport destroyed");
3986const hr=new PDFPageProxy(or,nr,this,this._params.pdfBug);return Pr(this,Xe).set(or,hr),hr});return Pr(this,He).set(or,tr),tr}getPageIndex(ar){return typeof ar!="object"||ar===null||!Number.isInteger(ar.num)||ar.num<0||!Number.isInteger(ar.gen)||ar.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:ar.num,gen:ar.gen})}getAnnotations(ar,or){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:ar,intent:or})}getFieldObjects(){return vn(this,Ge,jl).call(this,"GetFieldObjects")}hasJSActions(){return vn(this,Ge,jl).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(ar){return typeof ar!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:ar})}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 vn(this,Ge,jl).call(this,"GetDocJSActions")}getPageJSActions(ar){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:ar})}getStructTree(ar){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:ar})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(ar=>new _optional_content_config.OptionalContentConfig(ar))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const ar="GetMetadata",or=Pr(this,We).get(ar);if(or)return or;const pr=this.messageHandler.sendWithPromise(ar,null).then(tr=>{var nr,hr;return{info:tr[0],metadata:tr[1]?new _metadata.Metadata(tr[1]):null,contentDispositionFilename:((nr=this._fullReader)==null?void 0:nr.filename)??null,contentLength:((hr=this._fullReader)==null?void 0:hr.contentLength)??null}});return Pr(this,We).set(ar,pr),pr}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(ar=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const or of Pr(this,Xe).values())if(!or.cleanup())throw new Error(`startCleanup: Page ${or.pageNumber} is currently rendering.`);this.commonObjs.clear(),ar||this.fontLoader.clear(),Pr(this,We).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:ar,enableXfa:or}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:ar,enableXfa:or})}}We=new WeakMap,Xe=new WeakMap,He=new WeakMap,qe=new WeakMap,Ge=new WeakSet,jl=function(ar,or=null){const pr=Pr(this,We).get(ar);if(pr)return pr;const tr=this.messageHandler.sendWithPromise(ar,or);return Pr(this,We).set(ar,tr),tr};class PDFObjects{constructor(){Pn(this,Ke);Pn(this,Ve,Object.create(null))}get(ar,or=null){if(or){const tr=vn(this,Ke,cc).call(this,ar);return tr.capability.promise.then(()=>or(tr.data)),null}const pr=Pr(this,Ve)[ar];if(!(pr!=null&&pr.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${ar}.`);return pr.data}has(ar){const or=Pr(this,Ve)[ar];return(or==null?void 0:or.capability.settled)||!1}resolve(ar,or=null){const pr=vn(this,Ke,cc).call(this,ar);pr.data=or,pr.capability.resolve()}clear(){var ar;for(const or in Pr(this,Ve)){const{data:pr}=Pr(this,Ve)[or];(ar=pr==null?void 0:pr.bitmap)==null||ar.close()}kn(this,Ve,Object.create(null))}}Ve=new WeakMap,Ke=new WeakSet,cc=function(ar){var or;return(or=Pr(this,Ve))[ar]||(or[ar]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(ar){Pn(this,Ze,null);kn(this,Ze,ar),this.onContinue=null}get promise(){return Pr(this,Ze).capability.promise}cancel(ar=0){Pr(this,Ze).cancel(null,ar)}get separateAnnots(){const{separateAnnots:ar}=Pr(this,Ze).operatorList;if(!ar)return!1;const{annotationCanvasMap:or}=Pr(this,Ze);return ar.form||ar.canvas&&(or==null?void 0:or.size)>0}}Ze=new WeakMap,exports$1.RenderTask=RenderTask;const ir=class ir{constructor({callback:ar,params:or,objs:pr,commonObjs:tr,annotationCanvasMap:nr,operatorList:hr,pageIndex:sr,canvasFactory:xr,filterFactory:Rr,useRequestAnimationFrame:br=!1,pdfBug:wr=!1,pageColors:vr=null}){this.callback=ar,this.params=or,this.objs=pr,this.commonObjs=tr,this.annotationCanvasMap=nr,this.operatorListIdx=null,this.operatorList=hr,this._pageIndex=sr,this.canvasFactory=xr,this.filterFactory=Rr,this._pdfBug=wr,this.pageColors=vr,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=br===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(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=or.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:ar=!1,optionalContentConfig:or}){var sr,xr;if(this.cancelled)return;
3986if(this._canvas){if(Pr(ir,Je).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.");Pr(ir,Je).add(this._canvas)}this._pdfBug&&((sr=globalThis.StepperManager)!=null&&sr.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:pr,viewport:tr,transform:nr,background:hr}=this.params;this.gfx=new _canvas.CanvasGraphics(pr,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:or},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:nr,viewport:tr,transparency:ar,background:hr}),this.operatorListIdx=0,this.graphicsReady=!0,(xr=this.graphicsReadyCallback)==null||xr.call(this)}cancel(ar=null,or=0){var pr;this.running=!1,this.cancelled=!0,(pr=this.gfx)==null||pr.endDrawing(),Pr(ir,Je).delete(this._canvas),this.callback(ar||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,or))}operatorListChanged(){var ar;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(ar=this.stepper)==null||ar.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?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(),Pr(ir,Je).delete(this._canvas),this.callback())))}};Je=new WeakMap,Pn(ir,Je,new WeakSet);let InternalRenderTask=ir;const version="3.11.174";exports$1.version=version;const build="ce8716743";exports$1.build=build},(Ee,Re,Te)=>{var Ue,ze,We,Ru,He;Object.defineProperty(Re,"__esModule",{value:!0}),Re.SerializableEmpty=Re.PrintAnnotationStorage=Re.AnnotationStorage=void 0;var je=Te(1),Oe=Te(4),Me=Te(8);const De=Object.freeze({map:null,hash:"",transfers:void 0});Re.SerializableEmpty=De;class $e{constructor(){Pn(this,We);Pn(this,Ue,!1);Pn(this,ze,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(Ge,Ye){const Ve=Pr(this,ze).get(Ge);return Ve===void 0?Ye:Object.assign(Ye,Ve)}getRawValue(Ge){return Pr(this,ze).get(Ge)}remove(Ge){if(Pr(this,ze).delete(Ge),Pr(this,ze).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const Ye of Pr(this,ze).values())if(Ye instanceof Oe.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(Ge,Ye){const Ve=Pr(this,ze).get(Ge);let Ke=!1;if(Ve!==void 0)for(const[Qe,Ze]of Object.entries(Ye))Ve[Qe]!==Ze&&(Ke=!0,Ve[Qe]=Ze);else Ke=!0,Pr(this,ze).set(Ge,Ye);Ke&&vn(this,We,Ru).call(this),Ye instanceof Oe.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(Ye.constructor._type)}has(Ge){return Pr(this,ze).has(Ge)}getAll(){return Pr(this,ze).size>0?(0,je.objectFromMap)(Pr(this,ze)):null}setAll(Ge){for(const[Ye,Ve]of Object.entries(Ge))this.setValue(Ye,Ve)}get size(){return Pr(this,ze).size}resetModified(){Pr(this,Ue)&&(kn(this,Ue,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Be(this)}get serializable(){if(Pr(this,ze).size===0)return De;const Ge=new Map,Ye=new Me.MurmurHash3_64,Ve=[],Ke=Object.create(null);let Qe=!1;for(const[Ze,Je]of Pr(this,ze)){const ir=Je instanceof Oe.AnnotationEditor?Je.serialize(!1,Ke):Je;ir&&(Ge.set(Ze,ir),Ye.update(`${Ze}:${JSON.stringify(ir)}`),Qe||(Qe=!!ir.bitmap))}if(Qe)for(const Ze of Ge.values())Ze.bitmap&&Ve.push(Ze.bitmap);return Ge.size>0?{map:Ge,hash:Ye.hexdigest(),transfers:Ve}:De}}Ue=new WeakMap,ze=new WeakMap,We=new WeakSet,Ru=function(){Pr(this,Ue)||(kn(this,Ue,!0),typeof this.onSetModified=="function"&&this.onSetModified())},Re.AnnotationStorage=$e;class Be extends $e{constructor(Ye){super();Pn(this,He);const{map:Ve,hash:Ke,transfers:Qe}=Ye.serializable,Ze=structuredClone(Ve,Qe?{transfer:Qe}:null);kn(this,He,{map:Ze,hash:Ke,transfers:Qe})}get print(){(0,je.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return Pr(this,He)}}He=new WeakMap,Re.PrintAnnotationStorage=Be},(Ee,Re,Te)=>{var Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze,Je,ir,uc,dc,or,pc,hc,Pu,Tu,ku,fc,ju;
3986Object.defineProperty(Re,"__esModule",{value:!0}),Re.AnnotationEditor=void 0;var je=Te(5),Oe=Te(1),Me=Te(6);const br=class br{constructor(vr){Pn(this,ir);Pn(this,Be,"");Pn(this,Ue,!1);Pn(this,ze,null);Pn(this,We,null);Pn(this,Xe,null);Pn(this,He,!1);Pn(this,qe,null);Pn(this,Ge,this.focusin.bind(this));Pn(this,Ye,this.focusout.bind(this));Pn(this,Ve,!1);Pn(this,Ke,!1);Pn(this,Qe,!1);Es(this,"_initialOptions",Object.create(null));Es(this,"_uiManager",null);Es(this,"_focusEventsAllowed",!0);Es(this,"_l10nPromise",null);Pn(this,Ze,!1);Pn(this,Je,br._zIndex++);this.constructor===br&&(0,Oe.unreachable)("Cannot initialize AnnotationEditor."),this.parent=vr.parent,this.id=vr.id,this.width=this.height=null,this.pageIndex=vr.parent.pageIndex,this.name=vr.name,this.div=null,this._uiManager=vr.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=vr.isCentered,this._structTreeParentId=null;const{rotation:Dr,rawDims:{pageWidth:kr,pageHeight:cr,pageX:dr,pageY:ur}}=this.parent.viewport;this.rotation=Dr,this.pageRotation=(360+Dr-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[kr,cr],this.pageTranslation=[dr,ur];const[gr,_r]=this.parentDimensions;this.x=vr.x/gr,this.y=vr.y/_r,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,Oe.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(vr){const Dr=new $e({id:vr.parent.getNextId(),parent:vr.parent,uiManager:vr._uiManager});Dr.annotationElementId=vr.annotationElementId,Dr.deleted=!0,Dr._uiManager.addToAnnotationStorage(Dr)}static initialize(vr,Dr=null){if(br._l10nPromise||(br._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(cr=>[cr,vr.get(cr)]))),Dr!=null&&Dr.strings)for(const cr of Dr.strings)br._l10nPromise.set(cr,vr.get(cr));if(br._borderLineWidth!==-1)return;const kr=getComputedStyle(document.documentElement);br._borderLineWidth=parseFloat(kr.getPropertyValue("--outline-width"))||0}static updateDefaultParams(vr,Dr){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(vr){return!1}static paste(vr,Dr){(0,Oe.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return Pr(this,Ze)}set _isDraggable(vr){var Dr;kn(this,Ze,vr),(Dr=this.div)==null||Dr.classList.toggle("draggable",vr)}center(){const[vr,Dr]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*Dr/(vr*2),this.y+=this.width*vr/(Dr*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*Dr/(vr*2),this.y-=this.width*vr/(Dr*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(vr){this._uiManager.addCommands(vr)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=Pr(this,Je)}setParent(vr){vr!==null&&(this.pageIndex=vr.pageIndex,this.pageDimensions=vr.pageDimensions),this.parent=vr}focusin(vr){this._focusEventsAllowed&&(Pr(this,Ve)?kn(this,Ve,!1):this.parent.setSelected(this))}focusout(vr){var kr;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const Dr=vr.relatedTarget;Dr!=null&&Dr.closest(`#${this.id}`)||(vr.preventDefault(),(kr=this.parent)!=null&&kr.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(vr,Dr,kr,cr){const[dr,ur]=this.parentDimensions;[kr,cr]=this.screenToPageTranslation(kr,cr),this.x=(vr+kr)/dr,this.y=(Dr+cr)/ur,this.fixAndSetPosition()}translate(vr,Dr){vn(this,ir,uc).call(this,this.parentDimensions,vr,Dr)}translateInPage(vr,Dr){vn(this,ir,uc).call(this,this.pageDimensions,vr,Dr),this.div.scrollIntoView({block:"nearest"})}drag(vr,Dr){const[kr,cr]=this.parentDimensions;if(this.x+=vr/kr,this.y+=Dr/cr,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Ir,y:Ar}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Ir,Ar)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:dr,y:ur}=this;const[gr,_r]=vn(this,ir,dc).call(this);dr+=gr,ur+=_r,this.div.style.left=`${(100*dr).toFixed(2)}%`,this.div.style.top=`${(100*ur).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[vr,Dr]=this.pageDimensions;let{x:kr,y:cr,width:dr,height:ur}=this;switch(dr*=vr,ur*=Dr,kr*=vr,cr*=Dr,this.rotation){case 0:kr=Math.max(0,Math.min(vr-dr,kr)),cr=Math.max(0,Math.min(Dr-ur,cr));break;case 90:kr=Math.max(0,Math.min(vr-ur,kr)),cr=Math.min(Dr,Math.max(dr,cr));break;case 180:kr=Math.min(vr,Math.max(dr,kr)),cr=Math.min(Dr,Math.max(ur,cr));break;case 270:kr=Math.min(vr,Math.max(ur,kr)),cr=Math.max(0,Math.min(Dr-dr,cr));break}this.x=kr/=vr,this.y=cr/=Dr;const[gr,_r]=vn(this,ir,dc).call(this);
3986kr+=gr,cr+=_r;const{style:Ir}=this.div;Ir.left=`${(100*kr).toFixed(2)}%`,Ir.top=`${(100*cr).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(vr,Dr){var kr;return vn(kr=br,or,pc).call(kr,vr,Dr,this.parentRotation)}pageTranslationToScreen(vr,Dr){var kr;return vn(kr=br,or,pc).call(kr,vr,Dr,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:vr,pageDimensions:[Dr,kr]}=this,cr=Dr*vr,dr=kr*vr;return Oe.FeatureTest.isCSSRoundSupported?[Math.round(cr),Math.round(dr)]:[cr,dr]}setDims(vr,Dr){var dr;const[kr,cr]=this.parentDimensions;this.div.style.width=`${(100*vr/kr).toFixed(2)}%`,Pr(this,He)||(this.div.style.height=`${(100*Dr/cr).toFixed(2)}%`),(dr=Pr(this,ze))==null||dr.classList.toggle("small",vr<br.SMALL_EDITOR_SIZE||Dr<br.SMALL_EDITOR_SIZE)}fixDims(){const{style:vr}=this.div,{height:Dr,width:kr}=vr,cr=kr.endsWith("%"),dr=!Pr(this,He)&&Dr.endsWith("%");if(cr&&dr)return;const[ur,gr]=this.parentDimensions;cr||(vr.width=`${(100*parseFloat(kr)/ur).toFixed(2)}
3986%`),!Pr(this,He)&&!dr&&(vr.height=`${(100*parseFloat(Dr)/gr).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}async addAltTextButton(){if(Pr(this,ze))return;const vr=kn(this,ze,document.createElement("button"));vr.className="altText";const Dr=await br._l10nPromise.get("editor_alt_text_button_label");vr.textContent=Dr,vr.setAttribute("aria-label",Dr),vr.tabIndex="0",vr.addEventListener("contextmenu",Me.noContextMenu),vr.addEventListener("pointerdown",kr=>kr.stopPropagation()),vr.addEventListener("click",kr=>{kr.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),vr.addEventListener("keydown",kr=>{kr.target===vr&&kr.key==="Enter"&&(kr.preventDefault(),this._uiManager.editAltText(this))}),vn(this,ir,fc).call(this),this.div.append(vr),br.SMALL_EDITOR_SIZE||(br.SMALL_EDITOR_SIZE=Math.min(128,Math.round(vr.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:Pr(this,Be),decorative:Pr(this,Ue)}}set altTextData({altText:vr,decorative:Dr}){Pr(this,Be)===vr&&Pr(this,Ue)===Dr||(kn(this,Be,vr),kn(this,Ue,Dr),vn(this,ir,fc).call(this))}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.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",Pr(this,Ge)),this.div.addEventListener("focusout",Pr(this,Ye));const[vr,Dr]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*Dr/vr).toFixed(2)}%`,this.div.style.maxHeight=`${(100*vr/Dr).toFixed(2)}%`);const[kr,cr]=this.getInitialTranslation();return this.translate(kr,cr),(0,je.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(vr){const{isMac:Dr}=Oe.FeatureTest.platform;if(vr.button!==0||vr.ctrlKey&&Dr){vr.preventDefault();return}kn(this,Ve,!0),vn(this,ir,ju).call(this,vr)}moveInDOM(){var vr;(vr=this.parent)==null||vr.moveEditorInDOM(this)}_setParentAndPosition(vr,Dr,kr){vr.changeParent(this),this.x=Dr,this.y=kr,this.fixAndSetPosition()}getRect(vr,Dr){const kr=this.parentScale,[cr,dr]=this.pageDimensions,[ur,gr]=this.pageTranslation,_r=vr/kr,Ir=Dr/kr,Ar=this.x*cr,Tr=this.y*dr,Nr=this.width*cr,Br=this.height*dr;switch(this.rotation){case 0:return[Ar+_r+ur,dr-Tr-Ir-Br+gr,Ar+_r+Nr+ur,dr-Tr-Ir+gr];case 90:return[Ar+Ir+ur,dr-Tr+_r+gr,Ar+Ir+Br+ur,dr-Tr+_r+Nr+gr];case 180:return[Ar-_r-Nr+ur,dr-Tr+Ir+gr,Ar-_r+ur,dr-Tr+Ir+Br+gr];case 270:return[Ar-Ir-Br+ur,dr-Tr-_r-Nr+gr,Ar-Ir+ur,dr-Tr-_r+gr];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(vr,Dr){const[kr,cr,dr,ur]=vr,gr=dr-kr,_r=ur-cr;switch(this.rotation){case 0:return[kr,Dr-ur,gr,_r];case 90:return[kr,Dr-cr,_r,gr];case 180:return[dr,Dr-cr,gr,_r];case 270:return[dr,Dr-ur,_r,gr];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){kn(this,Qe,!0)}disableEditMode(){kn(this,Qe,!1)}isInEditMode(){return Pr(this,Qe)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var vr,Dr;(vr=this.div)==null||vr.addEventListener("focusin",Pr(this,Ge)),(Dr=this.div)==null||Dr.addEventListener("focusout",Pr(this,Ye))}serialize(vr=!1,Dr=null){(0,Oe.unreachable)("An editor must be serializable")}static deserialize(vr,Dr,kr){const cr=new this.prototype.constructor({parent:Dr,id:Dr.getNextId(),uiManager:kr});cr.rotation=vr.rotation;const[dr,ur]=cr.pageDimensions,[gr,_r,Ir,Ar]=cr.getRectInCurrentCoords(vr.rect,ur);return cr.x=gr/dr,cr.y=_r/ur,cr.width=Ir/dr,cr.height=Ar/ur,cr}remove(){var vr;this.div.removeEventListener("focusin",Pr(this,Ge)),this.div.removeEventListener("focusout",Pr(this,Ye)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(vr=Pr(this,ze))==null||vr.remove(),kn(this,ze,null),kn(this,We,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(vn(this,ir,Pu).call(this),Pr(this,qe).classList.remove("hidden"))}select(){var vr;this.makeResizable(),(vr=this.div)==null||vr.classList.add("selectedEditor")}unselect(){var vr,Dr,kr;(vr=Pr(this,qe))==null||vr.classList.add("hidden"),(Dr=this.div)==null||Dr.classList.remove("selectedEditor"),(kr=this.div)!=null&&kr.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(vr,Dr){}disableEditing(){Pr(this,ze)&&(Pr(this,ze).hidden=!0)}enableEditing(){Pr(this,ze)&&(Pr(this,ze).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return Pr(this,Ke)}set isEditing(vr){kn(this,Ke,vr),this.parent&&(vr?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(vr,Dr){kn(this,He,!0);const kr=vr/Dr,{style:cr}=this.div;cr.aspectRatio=kr,cr.height="auto"}static get MIN_SIZE(){return 16}};Be=new WeakMap,Ue=new WeakMap,ze=new WeakMap,We=new WeakMap,Xe=new WeakMap,He=new WeakMap,qe=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,Ve=new WeakMap,Ke=new WeakMap,Qe=new WeakMap,Ze
3986=new WeakMap,Je=new WeakMap,ir=new WeakSet,uc=function([vr,Dr],kr,cr){[kr,cr]=this.screenToPageTranslation(kr,cr),this.x+=kr/vr,this.y+=cr/Dr,this.fixAndSetPosition()},dc=function(){const[vr,Dr]=this.parentDimensions,{_borderLineWidth:kr}=br,cr=kr/vr,dr=kr/Dr;switch(this.rotation){case 90:return[-cr,dr];case 180:return[cr,dr];case 270:return[cr,-dr];default:return[-cr,-dr]}},or=new WeakSet,pc=function(vr,Dr,kr){switch(kr){case 90:return[Dr,-vr];case 180:return[-vr,-Dr];case 270:return[-Dr,vr];default:return[vr,Dr]}},hc=function(vr){switch(vr){case 90:{const[Dr,kr]=this.pageDimensions;return[0,-Dr/kr,kr/Dr,0]}case 180:return[-1,0,0,-1];case 270:{const[Dr,kr]=this.pageDimensions;return[0,Dr/kr,-kr/Dr,0]}default:return[1,0,0,1]}},Pu=function(){if(Pr(this,qe))return;kn(this,qe,document.createElement("div")),Pr(this,qe).classList.add("resizers");const vr=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||vr.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const Dr of vr){const kr=document.createElement("div");Pr(this,qe).append(kr),kr.classList.add("resizer",Dr),kr.addEventListener("pointerdown",vn(this,ir,Tu).bind(this,Dr)),kr.addEventListener("contextmenu",Me.noContextMenu)}this.div.prepend(Pr(this,qe))},Tu=function(vr,Dr){Dr.preventDefault();const{isMac:kr}=Oe.FeatureTest.platform;if(Dr.button!==0||Dr.ctrlKey&&kr)return;const cr=vn(this,ir,ku).bind(this,vr),dr=this._isDraggable;this._isDraggable=!1;const ur={passive:!0,capture:!0};window.addEventListener("pointermove",cr,ur);const gr=this.x,_r=this.y,Ir=this.width,Ar=this.height,Tr=this.parent.div.style.cursor,Nr=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(Dr.target).cursor;const Br=()=>{this._isDraggable=dr,window.removeEventListener("pointerup",Br),window.removeEventListener("blur",Br),window.removeEventListener("pointermove",cr,ur),this.parent.div.style.cursor=Tr,this.div.style.cursor=Nr;const Hr=this.x,Vr=this.y,mr=this.width,Sr=this.height;Hr===gr&&Vr===_r&&mr===Ir&&Sr===Ar||this.addCommands({cmd:()=>{this.width=mr,this.height=Sr,this.x=Hr,this.y=Vr;const[Lr,jr]=this.parentDimensions;this.setDims(Lr*mr,jr*Sr),this.fixAndSetPosition()},undo:()=>{this.width=Ir,this.height=Ar,this.x=gr,this.y=_r;const[Lr,jr]=this.parentDimensions;this.setDims(Lr*Ir,jr*Ar),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",Br),window.addEventListener("blur",Br)},ku=function(vr,Dr){const[kr,cr]=this.parentDimensions,dr=this.x,ur=this.y,gr=this.width,_r=this.height,Ir=br.MIN_SIZE/kr,Ar=br.MIN_SIZE/cr,Tr=gn=>Math.round(gn*1e4)/1e4,Nr=vn(this,ir,hc).call(this,this.rotation),Br=(gn,In)=>[Nr[0]*gn+Nr[2]*In,Nr[1]*gn+Nr[3]*In],Hr=vn(this,ir,hc).call(this,360-this.rotation),Vr=(gn,In)=>[Hr[0]*gn+Hr[2]*In,Hr[1]*gn+Hr[3]*In];let mr,Sr,Lr=!1,jr=!1;switch(vr){case"topLeft":Lr=!0,mr=(gn,In)=>[0,0],Sr=(gn,In)=>[gn,In];break;case"topMiddle":mr=(gn,In)=>[gn/2,0],Sr=(gn,In)=>[gn/2,In];break;case"topRight":Lr=!0,mr=(gn,In)=>[gn,0],Sr=(gn,In)=>[0,In];break;case"middleRight":jr=!0,mr=(gn,In)=>[gn,In/2],Sr=(gn,In)=>[0,In/2];break;case"bottomRight":Lr=!0,mr=(gn,In)=>[gn,In],Sr=(gn,In)=>[0,0];break;case"bottomMiddle":mr=(gn,In)=>[gn/2,In],Sr=(gn,In)=>[gn/2,0];break;case"bottomLeft":Lr=!0,mr=(gn,In)=>[0,In],Sr=(gn,In)=>[gn,0];break;case"middleLeft":jr=!0,mr=(gn,In)=>[0,In/2],Sr=(gn,In)=>[gn,In/2];break}const fr=mr(gr,_r),Cr=Sr(gr,_r);let Mr=Br(...Cr);const $r=Tr(dr+Mr[0]),Fr=Tr(ur+Mr[1]);let Kr=1,an=1,[Wr,hn]=this.screenToPageTranslation(Dr.movementX,Dr.movementY);if([Wr,hn]=Vr(Wr/kr,hn/cr),Lr){const gn=Math.hypot(gr,_r);Kr=an=Math.max(Math.min(Math.hypot(Cr[0]-fr[0]-Wr,Cr[1]-fr[1]-hn)/gn,1/gr,1/_r),Ir/gr,Ar/_r)}else jr?Kr=Math.max(Ir,Math.min(1,Math.abs(Cr[0]-fr[0]-Wr)))/gr:an=Math.max(Ar,Math.min(1,Math.abs(Cr[1]-fr[1]-hn)))/_r;const cn=Tr(gr*Kr),tn=Tr(_r*an);Mr=Br(...Sr(cn,tn));const Qr=$r-Mr[0],wn=Fr-Mr[1];this.width=cn,this.height=tn,this.x=Qr,this.y=wn,this.setDims(kr*cn,cr*tn),this.fixAndSetPosition()},fc=async function(){var kr;const vr=Pr(this,ze);if(!vr)return;if(!Pr(this,Be)&&!Pr(this,Ue)){vr.classList.remove("done"),(kr=Pr(this,We))==null||kr.remove();return}br._l10nPromise.get("editor_alt_text_edit_button_label").then(cr=>{vr.setAttribute("aria-label",cr)});let Dr=Pr(this,We);if(!Dr){kn(this,We,Dr=document.createElement("span")),Dr.className="tooltip",Dr.setAttribute("role","tooltip");const cr=Dr.id=`alt-text-tooltip-${this.id}`;vr.setAttribute("aria-describedby",cr);const dr=100;vr.addEventListener("mouseenter",()=>{kn(this,Xe,setTimeout(()=>{kn(this,Xe,null),Pr(this,We).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},dr))}),vr.addEventListener("mouseleave",()=>{var ur;clearTimeout(Pr(this,Xe)),kn(this,Xe,null),(ur=Pr(this,We))==null||ur.classList.remove("show")})}vr.classList.add("done"),Dr.innerText=Pr(this,Ue)?await br._l10nPromise.get("editor_alt_text_decorative_tooltip"):Pr(this,Be),Dr.parentNode||vr.append(Dr)},ju=function(vr){if(!this._isDraggable)return;const Dr=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let kr,cr;Dr&&(kr={passive:!0,capture:!0},cr=ur=>{const[gr,_r]=this.screenToPageTranslation(ur.movementX,ur.movementY);this._uiManager.dragSelectedEditors(gr,_r)},window.addEventListener("pointermove",cr,kr));const dr=()=>{if(window.removeEventListener("pointerup",dr),window.removeEventListener("blur",dr),Dr&&window.removeEventListener("pointermove",cr,kr),kn(this,Ve,!1),!this._uiManager.endDragSession()){const{isMac:ur}=Oe.FeatureTest.platform;vr.ctrlKey&&!ur||vr.shiftKey||vr.metaKey&&ur?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",dr),window.addEventListener("blur",dr)},Pn(br,or),Es(br,"_borderLineWidth",-1),Es(br,"_colorManager",new je.ColorManager),Es(br,"_zIndex",1),Es(br,"SMALL_EDITOR_SIZE",0);let De=br;Re.AnnotationEditor=De;class $e extends De{constructor(vr){super(vr),this.annotationElementId=vr.annotationElementId,this.deleted=!0}
3986serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(Ee,Re,Te)=>{var He,qe,Ge,Ye,Ve,mc,Ze,Je,ir,rr,ar,Iu,tr,nr,hr,sr,xr,Rr,br,wr,vr,Dr,kr,cr,dr,ur,gr,_r,Ir,Ar,Tr,Nr,Br,Hr,Vr,mr,Sr,Lr,jr,fr,Cr,Mr,$r,Fr,Kr,an,Wr,Lu,gc,xc,Il,yc,bc,ii,Qa,Ou,Mu,vc,Ja,Sc;Object.defineProperty(Re,"__esModule",{value:!0}),Re.KeyboardManager=Re.CommandManager=Re.ColorManager=Re.AnnotationEditorUIManager=void 0,Re.bindEvents=Me,Re.opacityToHex=De;var je=Te(1),Oe=Te(6);function Me(Hn,Zr,xn){for(const An of xn)Zr.addEventListener(An,Hn[An].bind(Hn))}function De(Hn){return Math.round(Math.min(255,Math.max(1,255*Hn))).toString(16).padStart(2,"0")}class $e{constructor(){Pn(this,He,0)}getId(){return`${je.AnnotationEditorPrefix}${Ka(this,He)._++}`}}He=new WeakMap;const Qe=class Qe{constructor(){Pn(this,Ve);Pn(this,qe,(0,je.getUuid)());Pn(this,Ge,0);Pn(this,Ye,null)}static get _isSVGFittingCanvas(){const Zr='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',An=new OffscreenCanvas(1,3).getContext("2d"),Wn=new Image;Wn.src=Zr;const ss=Wn.decode().then(()=>(An.drawImage(Wn,0,0,1,1,0,0,1,3),new Uint32Array(An.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,je.shadow)(this,"_isSVGFittingCanvas",ss)}async getFromFile(Zr){const{lastModified:xn,name:An,size:Wn,type:ss}=Zr;return vn(this,Ve,mc).call(this,`${xn}_${An}_${Wn}_${ss}`,Zr)}async getFromUrl(Zr){return vn(this,Ve,mc).call(this,Zr,Zr)}async getFromId(Zr){Pr(this,Ye)||kn(this,Ye,new Map);const xn=Pr(this,Ye).get(Zr);return xn?xn.bitmap?(xn.refCounter+=1,xn):xn.file?this.getFromFile(xn.file):this.getFromUrl(xn.url):null}getSvgUrl(Zr){const xn=Pr(this,Ye).get(Zr);return xn!=null&&xn.isSvg?xn.svgUrl:null}deleteId(Zr){Pr(this,Ye)||kn(this,Ye,new Map);const xn=Pr(this,Ye).get(Zr);xn&&(xn.refCounter-=1,xn.refCounter===0&&(xn.bitmap=null))}isValidId(Zr){return Zr.startsWith(`image_${Pr(this,qe)}_`)}};qe=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,Ve=new WeakSet,mc=async function(Zr,xn){Pr(this,Ye)||kn(this,Ye,new Map);let An=Pr(this,Ye).get(Zr);if(An===null)return null;if(An!=null&&An.bitmap)return An.refCounter+=1,An;try{An||(An={bitmap:null,id:`image_${Pr(this,qe)}_${Ka(this,Ge)._++}`,refCounter:0,isSvg:!1});let Wn;if(typeof xn=="string"){An.url=xn;const ss=await fetch(xn);if(!ss.ok)throw new Error(ss.statusText);Wn=await ss.blob()}else Wn=An.file=xn;if(Wn.type==="image/svg+xml"){const ss=Qe._isSVGFittingCanvas,Yn=new FileReader,en=new Image,Gr=new Promise((nn,En)=>{en.onload=()=>{An.bitmap=en,An.isSvg=!0,nn()},Yn.onload=async()=>{const Cn=An.svgUrl=Yn.result;en.src=await ss?`${Cn}#svgView(preserveAspectRatio(none))`:Cn},en.onerror=Yn.onerror=En});Yn.readAsDataURL(Wn),await Gr}else An.bitmap=await createImageBitmap(Wn);An.refCounter=1}catch(Wn){console.error(Wn),An=null}return Pr(this,Ye).set(Zr,An),An&&Pr(this,Ye).set(An.id,An),An};let Be=Qe;class Ue{constructor(Zr=128){Pn(this,Ze,[]);Pn(this,Je,!1);Pn(this,ir);Pn(this,rr,-1);kn(this,ir,Zr)}add({cmd:Zr,undo:xn,mustExec:An,type:Wn=NaN,overwriteIfSameType:ss=!1,keepUndo:Yn=!1}){if(An&&Zr(),Pr(this,Je))return;const en={cmd:Zr,undo:xn,type:Wn};if(Pr(this,rr)===-1){Pr(this,Ze).length>0&&(Pr(this,Ze).length=0),kn(this,rr,0),Pr(this,Ze).push(en);return}if(ss&&Pr(this,Ze)[Pr(this,rr)].type===Wn){Yn&&(en.undo=Pr(this,Ze)[Pr(this,rr)].undo),Pr(this,Ze)[Pr(this,rr)]=en;return}const Gr=Pr(this,rr)+1;Gr===Pr(this,ir)?Pr(this,Ze).splice(0,1):(kn(this,rr,Gr),Gr<Pr(this,Ze).length&&Pr(this,Ze).splice(Gr)),Pr(this,Ze).push(en)}undo(){Pr(this,rr)!==-1&&(kn(this,Je,!0),Pr(this,Ze)[Pr(this,rr)].undo(),kn(this,Je,!1),kn(this,rr,Pr(this,rr)-1))}redo(){Pr(this,rr)<Pr(this,Ze).length-1&&(kn(this,rr,Pr(this,rr)+1),kn(this,Je,!0),Pr(this,Ze)[Pr(this,rr)].cmd(),kn(this,Je,!1))}hasSomethingToUndo(){return Pr(this,rr)!==-1}hasSomethingToRedo(){return Pr(this,rr)<Pr(this,Ze).length-1}destroy(){kn(this,Ze,null)}}Ze=new WeakMap,Je=new WeakMap,ir=new WeakMap,rr=new WeakMap,Re.CommandManager=Ue;class ze{constructor(Zr){Pn(this,ar);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:xn}=je.FeatureTest.platform;for(const[An,Wn,ss={}
3986]of Zr)for(const Yn of An){const en=Yn.startsWith("mac+");xn&&en?(this.callbacks.set(Yn.slice(4),{callback:Wn,options:ss}),this.allKeys.add(Yn.split("+").at(-1))):!xn&&!en&&(this.callbacks.set(Yn,{callback:Wn,options:ss}),this.allKeys.add(Yn.split("+").at(-1)))}}exec(Zr,xn){if(!this.allKeys.has(xn.key))return;const An=this.callbacks.get(vn(this,ar,Iu).call(this,xn));if(!An)return;const{callback:Wn,options:{bubbles:ss=!1,args:Yn=[],checker:en=null}}=An;en&&!en(Zr,xn)||(Wn.bind(Zr,...Yn)(),ss||(xn.stopPropagation(),xn.preventDefault()))}}ar=new WeakSet,Iu=function(Zr){Zr.altKey&&this.buffer.push("alt"),Zr.ctrlKey&&this.buffer.push("ctrl"),Zr.metaKey&&this.buffer.push("meta"),Zr.shiftKey&&this.buffer.push("shift"),this.buffer.push(Zr.key);const xn=this.buffer.join("+");return this.buffer.length=0,xn},Re.KeyboardManager=ze;const pr=class pr{get _colors(){const Zr=new Map([["CanvasText",null],["Canvas",null]]);return(0,Oe.getColorValues)(Zr),(0,je.shadow)(this,"_colors",Zr)}convert(Zr){const xn=(0,Oe.getRGB)(Zr);if(!window.matchMedia("(forced-colors: active)").matches)return xn;for(const[An,Wn]of this._colors)if(Wn.every((ss,Yn)=>ss===xn[Yn]))return pr._colorsMapping.get(An);return xn}getHexCode(Zr){const xn=this._colors.get(Zr);return xn?je.Util.makeHexColor(...xn):Zr}};Es(pr,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let We=pr;Re.ColorManager=We;const Bn=class Bn{constructor(Zr,xn,An,Wn,ss,Yn){Pn(this,Wr);Pn(this,tr,null);Pn(this,nr,new Map);Pn(this,hr,new Map);Pn(this,sr,null);Pn(this,xr,null);Pn(this,Rr,new Ue);Pn(this,br,0);Pn(this,wr,new Set);Pn(this,vr,null);Pn(this,Dr,null);Pn(this,kr,new Set);Pn(this,cr,null);Pn(this,dr,new $e);Pn(this,ur,!1);Pn(this,gr,!1);Pn(this,_r,null);Pn(this,Ir,je.AnnotationEditorType.NONE);Pn(this,Ar,new Set);Pn(this,Tr,null);Pn(this,Nr,this.blur.bind(this));Pn(this,Br,this.focus.bind(this));Pn(this,Hr,this.copy.bind(this));Pn(this,Vr,this.cut.bind(this));Pn(this,mr,this.paste.bind(this));Pn(this,Sr,this.keydown.bind(this));Pn(this,Lr,this.onEditingAction.bind(this));Pn(this,jr,this.onPageChanging.bind(this));Pn(this,fr,this.onScaleChanging.bind(this));Pn(this,Cr,this.onRotationChanging.bind(this));Pn(this,Mr,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});Pn(this,$r,[0,0]);Pn(this,Fr,null);Pn(this,Kr,null);Pn(this,an,null);kn(this,Kr,Zr),kn(this,an,xn),kn(this,sr,An),this._eventBus=Wn,this._eventBus._on("editingaction",Pr(this,Lr)),this._eventBus._on("pagechanging",Pr(this,jr)),this._eventBus._on("scalechanging",Pr(this,fr)),this._eventBus._on("rotationchanging",Pr(this,Cr)),kn(this,xr,ss.annotationStorage),kn(this,cr,ss.filterFactory),kn(this,Tr,Yn),this.viewParameters={realScale:Oe.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const Zr=Bn.prototype,xn=ss=>{const{activeElement:Yn}=document;return Yn&&Pr(ss,Kr).contains(Yn)&&ss.hasSomethingToControl()},An=this.TRANSLATE_SMALL,Wn=this.TRANSLATE_BIG;return(0,je.shadow)(this,"_keyboardManager",new ze([[["ctrl+a","mac+meta+a"],Zr.selectAll],[["ctrl+z","mac+meta+z"],Zr.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],Zr.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],Zr.delete],[["Escape","mac+Escape"],Zr.unselectAll],[["ArrowLeft","mac+ArrowLeft"],Zr.translateSelectedEditors,{args:[-An,0],checker:xn}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Zr.translateSelectedEditors,{args:[-Wn,0],checker:xn}],[["ArrowRight","mac+ArrowRight"],Zr.translateSelectedEditors,{args:[An,0],checker:xn}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Zr.translateSelectedEditors,{args:[Wn,0],checker:xn}],[["ArrowUp","mac+ArrowUp"],Zr.translateSelectedEditors,{args:[0,-An],checker:xn}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Zr.translateSelectedEditors,{args:[0,-Wn],checker:xn}],[["ArrowDown","mac+ArrowDown"],Zr.translateSelectedEditors,{args:[0,An],checker:xn}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Zr.translateSelectedEditors,{args:[0,Wn],checker:xn}]]))}destroy(){vn(this,Wr,Il).call(this),vn(this,Wr,gc).call(this),this._eventBus._off("editingaction",Pr(this,Lr)),this._eventBus._off("pagechanging",Pr(this,jr)),this._eventBus._off("scalechanging",Pr(this,fr)),this._eventBus._off("rotationchanging",Pr(this,Cr));for(const Zr of Pr(this,hr).values())Zr.destroy();Pr(this,hr).clear(),Pr(this,nr).clear(),Pr(this,kr).clear(),kn(this,tr,null),Pr(this,Ar).clear(),Pr(this,Rr).destroy(),Pr(this,sr).destroy()}get hcmFilter(){return(0,je.shadow)(this,"hcmFilter",Pr(this,Tr)?Pr(this,cr).addHCMFilter(Pr(this,Tr).foreground,Pr(this,Tr).background):"none")}get direction(){return(0,je.shadow)(this,"direction",getComputedStyle(Pr(this,Kr)).direction)}editAltText(Zr){var xn;(xn=Pr(this,sr))==null||xn.editAltText(this,Zr)}onPageChanging({pageNumber:Zr}){kn(this,br,Zr-1)}focusMainContainer(){Pr(this,Kr).focus()}findParent(Zr,xn){for(const An of Pr(this,hr).values()){const{x:Wn,y:ss,width:Yn,height:en}=An.div.getBoundingClientRect();if(Zr>=Wn&&Zr<=Wn+Yn&&xn>=ss&&xn<=ss+en)return An}return null}disableUserSelect(Zr=!1){Pr(this,an).classList.toggle("noUserSelect",Zr)}addShouldRescale(Zr){Pr(this,kr).add(Zr)}removeShouldRescale(Zr){Pr(this,kr).delete(Zr)}onScaleChanging({scale:Zr}){this.commitOrRemove(),this.viewParameters.realScale=Zr*Oe.PixelsPerInch.PDF_TO_CSS_UNITS;for(const xn of Pr(this,kr))xn.onScaleChanging()}
3986onRotationChanging({pagesRotation:Zr}){this.commitOrRemove(),this.viewParameters.rotation=Zr}addToAnnotationStorage(Zr){!Zr.isEmpty()&&Pr(this,xr)&&!Pr(this,xr).has(Zr.id)&&Pr(this,xr).setValue(Zr.id,Zr)}blur(){if(!this.hasSelection)return;const{activeElement:Zr}=document;for(const xn of Pr(this,Ar))if(xn.div.contains(Zr)){kn(this,_r,[xn,Zr]),xn._focusEventsAllowed=!1;break}}focus(){if(!Pr(this,_r))return;const[Zr,xn]=Pr(this,_r);kn(this,_r,null),xn.addEventListener("focusin",()=>{Zr._focusEventsAllowed=!0},{once:!0}),xn.focus()}addEditListeners(){vn(this,Wr,xc).call(this),vn(this,Wr,yc).call(this)}removeEditListeners(){vn(this,Wr,Il).call(this),vn(this,Wr,bc).call(this)}copy(Zr){var An;if(Zr.preventDefault(),(An=Pr(this,tr))==null||An.commitOrRemove(),!this.hasSelection)return;const xn=[];for(const Wn of Pr(this,Ar)){const ss=Wn.serialize(!0);ss&&xn.push(ss)}xn.length!==0&&Zr.clipboardData.setData("application/pdfjs",JSON.stringify(xn))}cut(Zr){this.copy(Zr),this.delete()}paste(Zr){Zr.preventDefault();const{clipboardData:xn}=Zr;for(const ss of xn.items)for(const Yn of Pr(this,Dr))if(Yn.isHandlingMimeForPasting(ss.type)){Yn.paste(ss,this.currentLayer);return}let An=xn.getData("application/pdfjs");if(!An)return;try{An=JSON.parse(An)}catch(ss){(0,je.warn)(`paste: "${ss.message}".`);return}if(!Array.isArray(An))return;this.unselectAll();const Wn=this.currentLayer;try{const ss=[];for(const Gr of An){const nn=Wn.deserialize(Gr);if(!nn)return;ss.push(nn)}const Yn=()=>{for(const Gr of ss)vn(this,Wr,vc).call(this,Gr);vn(this,Wr,Sc).call(this,ss)},en=()=>{for(const Gr of ss)Gr.remove()};this.addCommands({cmd:Yn,undo:en,mustExec:!0})}catch(ss){(0,je.warn)(`paste: "${ss.message}".`)}}keydown(Zr){var xn;(xn=this.getActive())!=null&&xn.shouldGetKeyboardEvents()||Bn._keyboardManager.exec(this,Zr)}onEditingAction(Zr){["undo","redo","delete","selectAll"].includes(Zr.name)&&this[Zr.name]()}setEditingState(Zr){Zr?(vn(this,Wr,Lu).call(this),vn(this,Wr,xc).call(this),vn(this,Wr,yc).call(this),vn(this,Wr,ii).call(this,{isEditing:Pr(this,Ir)!==je.AnnotationEditorType.NONE,isEmpty:vn(this,Wr,Ja).call(this),hasSomethingToUndo:Pr(this,Rr).hasSomethingToUndo(),hasSomethingToRedo:Pr(this,Rr).hasSomethingToRedo(),hasSelectedEditor:!1})):(vn(this,Wr,gc).call(this),vn(this,Wr,Il).call(this),vn(this,Wr,bc).call(this),vn(this,Wr,ii).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(Zr){if(!Pr(this,Dr)){kn(this,Dr,Zr);for(const xn of Pr(this,Dr))vn(this,Wr,Qa).call(this,xn.defaultPropertiesToUpdate)}}getId(){return Pr(this,dr).getId()}get currentLayer(){return Pr(this,hr).get(Pr(this,br))}getLayer(Zr){return Pr(this,hr).get(Zr)}get currentPageIndex(){return Pr(this,br)}addLayer(Zr){Pr(this,hr).set(Zr.pageIndex,Zr),Pr(this,ur)?Zr.enable():Zr.disable()}removeLayer(Zr){Pr(this,hr).delete(Zr.pageIndex)}updateMode(Zr,xn=null){if(Pr(this,Ir)!==Zr){if(kn(this,Ir,Zr),Zr===je.AnnotationEditorType.NONE){this.setEditingState(!1),vn(this,Wr,Mu).call(this);return}this.setEditingState(!0),vn(this,Wr,Ou).call(this),this.unselectAll();for(const An of Pr(this,hr).values())An.updateMode(Zr);if(xn){for(const An of Pr(this,nr).values())if(An.annotationElementId===xn){this.setSelected(An),An.enterInEditMode();break}}}}updateToolbar(Zr){Zr!==Pr(this,Ir)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:Zr})}updateParams(Zr,xn){if(Pr(this,Dr)){if(Zr===je.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(Zr);return}for(const An of Pr(this,Ar))An.updateParams(Zr,xn);for(const An of Pr(this,Dr))An.updateDefaultParams(Zr,xn)}}enableWaiting(Zr=!1){if(Pr(this,gr)!==Zr){kn(this,gr,Zr);for(const xn of Pr(this,hr).values())Zr?xn.disableClick():xn.enableClick(),xn.div.classList.toggle("waiting",Zr)}}getEditors(Zr){const xn=[];for(const An of Pr(this,nr).values())An.pageIndex===Zr&&xn.push(An);return xn}getEditor(Zr){return Pr(this,nr).get(Zr)}addEditor(Zr){Pr(this,nr).set(Zr.id,Zr)}removeEditor(Zr){var xn;Pr(this,nr).delete(Zr.id),this.unselect(Zr),(!Zr.annotationElementId||!Pr(this,wr).has(Zr.annotationElementId))&&((xn=Pr(this,xr))==null||xn.remove(Zr.id))}addDeletedAnnotationElement(Zr){Pr(this,wr).add(Zr.annotationElementId),Zr.deleted=!0}
3986isDeletedAnnotationElement(Zr){return Pr(this,wr).has(Zr)}removeDeletedAnnotationElement(Zr){Pr(this,wr).delete(Zr.annotationElementId),Zr.deleted=!1}setActiveEditor(Zr){Pr(this,tr)!==Zr&&(kn(this,tr,Zr),Zr&&vn(this,Wr,Qa).call(this,Zr.propertiesToUpdate))}toggleSelected(Zr){if(Pr(this,Ar).has(Zr)){Pr(this,Ar).delete(Zr),Zr.unselect(),vn(this,Wr,ii).call(this,{hasSelectedEditor:this.hasSelection});return}Pr(this,Ar).add(Zr),Zr.select(),vn(this,Wr,Qa).call(this,Zr.propertiesToUpdate),vn(this,Wr,ii).call(this,{hasSelectedEditor:!0})}setSelected(Zr){for(const xn of Pr(this,Ar))xn!==Zr&&xn.unselect();Pr(this,Ar).clear(),Pr(this,Ar).add(Zr),Zr.select(),vn(this,Wr,Qa).call(this,Zr.propertiesToUpdate),vn(this,Wr,ii).call(this,{hasSelectedEditor:!0})}isSelected(Zr){return Pr(this,Ar).has(Zr)}unselect(Zr){Zr.unselect(),Pr(this,Ar).delete(Zr),vn(this,Wr,ii).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return Pr(this,Ar).size!==0}undo(){Pr(this,Rr).undo(),vn(this,Wr,ii).call(this,{hasSomethingToUndo:Pr(this,Rr).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:vn(this,Wr,Ja).call(this)})}redo(){Pr(this,Rr).redo(),vn(this,Wr,ii).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:Pr(this,Rr).hasSomethingToRedo(),isEmpty:vn(this,Wr,Ja).call(this)})}addCommands(Zr){Pr(this,Rr).add(Zr),vn(this,Wr,ii).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:vn(this,Wr,Ja).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const Zr=[...Pr(this,Ar)],xn=()=>{for(const Wn of Zr)Wn.remove()},An=()=>{for(const Wn of Zr)vn(this,Wr,vc).call(this,Wn)};this.addCommands({cmd:xn,undo:An,mustExec:!0})}commitOrRemove(){var Zr;(Zr=Pr(this,tr))==null||Zr.commitOrRemove()}hasSomethingToControl(){return Pr(this,tr)||this.hasSelection}selectAll(){for(const Zr of Pr(this,Ar))Zr.commit();vn(this,Wr,Sc).call(this,Pr(this,nr).values())}unselectAll(){if(Pr(this,tr)){Pr(this,tr).commitOrRemove();return}if(this.hasSelection){for(const Zr of Pr(this,Ar))Zr.unselect();Pr(this,Ar).clear(),vn(this,Wr,ii).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(Zr,xn,An=!1){if(An||this.commitOrRemove(),!this.hasSelection)return;Pr(this,$r)[0]+=Zr,Pr(this,$r)[1]+=xn;const[Wn,ss]=Pr(this,$r),Yn=[...Pr(this,Ar)],en=1e3;Pr(this,Fr)&&clearTimeout(Pr(this,Fr)),kn(this,Fr,setTimeout(()=>{kn(this,Fr,null),Pr(this,$r)[0]=Pr(this,$r)[1]=0,this.addCommands({cmd:()=>{for(const Gr of Yn)Pr(this,nr).has(Gr.id)&&Gr.translateInPage(Wn,ss)},undo:()=>{for(const Gr of Yn)Pr(this,nr).has(Gr.id)&&Gr.translateInPage(-Wn,-ss)},mustExec:!1})},en));for(const Gr of Yn)Gr.translateInPage(Zr,xn)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),kn(this,vr,new Map);for(const Zr of Pr(this,Ar))Pr(this,vr).set(Zr,{savedX:Zr.x,savedY:Zr.y,savedPageIndex:Zr.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!Pr(this,vr))return!1;this.disableUserSelect(!1);const Zr=Pr(this,vr);kn(this,vr,null);let xn=!1;for(const[{x:Wn,y:ss,pageIndex:Yn},en]of Zr)en.newX=Wn,en.newY=ss,en.newPageIndex=Yn,xn||(xn=Wn!==en.savedX||ss!==en.savedY||Yn!==en.savedPageIndex);if(!xn)return!1;const An=(Wn,ss,Yn,en)=>{if(Pr(this,nr).has(Wn.id)){const Gr=Pr(this,hr).get(en);Gr?Wn._setParentAndPosition(Gr,ss,Yn):(Wn.pageIndex=en,Wn.x=ss,Wn.y=Yn)}};return this.addCommands({cmd:()=>{for(const[Wn,{newX:ss,newY:Yn,newPageIndex:en}]of Zr)An(Wn,ss,Yn,en)},undo:()=>{for(const[Wn,{savedX:ss,savedY:Yn,savedPageIndex:en}]of Zr)An(Wn,ss,Yn,en)},mustExec:!0}),!0}dragSelectedEditors(Zr,xn){if(Pr(this,vr))for(const An of Pr(this,vr).keys())An.drag(Zr,xn)}rebuild(Zr){if(Zr.parent===null){const xn=this.getLayer(Zr.pageIndex);xn?(xn.changeParent(Zr),xn.addOrRebuild(Zr)):(this.addEditor(Zr),this.addToAnnotationStorage(Zr),Zr.rebuild())}else Zr.parent.addOrRebuild(Zr)}isActive(Zr){return Pr(this,tr)===Zr}getActive(){return Pr(this,tr)}getMode(){return Pr(this,Ir)}get imageManager(){return(0,je.shadow)(this,"imageManager",new Be)}};tr=new WeakMap,nr=new WeakMap,hr=new WeakMap,sr=new WeakMap,xr=new WeakMap,Rr=new WeakMap,br=new WeakMap,wr=new WeakMap,vr=new WeakMap,Dr=new WeakMap,kr=new WeakMap,cr=new WeakMap,dr=new WeakMap,ur=new WeakMap,gr=new WeakMap,_r=new WeakMap,Ir=new WeakMap,Ar=new WeakMap,Tr=new WeakMap,Nr=new WeakMap,Br=new WeakMap,Hr=new WeakMap,Vr=new WeakMap,mr=new WeakMap,Sr=new WeakMap,Lr=new WeakMap,jr=new WeakMap,fr=new WeakMap,Cr=new WeakMap,Mr=new WeakMap,$r=new WeakMap,Fr=new WeakMap,Kr=new WeakMap,an=new WeakMap,Wr=new WeakSet,Lu=function(){window.addEventListener("focus",Pr(this,Br)),window.addEventListener("blur",Pr(this,Nr))},gc=function(){window.removeEventListener("focus",Pr(this,Br)),window.removeEventListener("blur",Pr(this,Nr))},xc=function(){window.addEventListener("keydown",Pr(this,Sr),{capture:!0})},Il=function(){window.removeEventListener("keydown",Pr(this,Sr),{capture:!0})},yc=function(){document.addEventListener("copy",Pr(this,Hr)),document.addEventListener("cut",Pr(this,Vr)),document.addEventListener("paste",Pr(this,mr))},bc=function(){document.removeEventListener("copy",Pr(this,Hr)),document.removeEventListener("cut",Pr(this,Vr)),document.removeEventListener("paste",Pr(this,mr))},ii=function(Zr){Object.entries(Zr).some(([An,Wn])=>Pr(this,Mr)[An]!==Wn)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(Pr(this,Mr),Zr)})},Qa=function(Zr){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:Zr})},Ou=function(){if(!Pr(this,ur)){kn(this,ur,!0);for(const Zr of Pr(this,hr).values())Zr.enable()}},Mu=function(){if(this.unselectAll(),Pr(this,ur)){kn(this,ur,!1);for(const Zr of Pr(this,hr).values())Zr.disable()}},vc=function(Zr){const xn=Pr(this,hr).get(Zr.pageIndex);xn?xn.addOrRebuild(Zr):this.addEditor(Zr)},Ja=function(){if(Pr(this,nr).size===0)return!0;
3986if(Pr(this,nr).size===1)for(const Zr of Pr(this,nr).values())return Zr.isEmpty();return!1},Sc=function(Zr){Pr(this,Ar).clear();for(const xn of Zr)xn.isEmpty()||(Pr(this,Ar).add(xn),xn.select());vn(this,Wr,ii).call(this,{hasSelectedEditor:!0})},Es(Bn,"TRANSLATE_SMALL",1),Es(Bn,"TRANSLATE_BIG",10);let Xe=Bn;Re.AnnotationEditorUIManager=Xe},(Ee,Re,Te)=>{var br,wr,vr,Dr,kr,cr,dr,ur,gr,_r,Ir,Ar,ja,Ia,wc,Ll,Ol,el,tl;Object.defineProperty(Re,"__esModule",{value:!0}),Re.StatTimer=Re.RenderingCancelledException=Re.PixelsPerInch=Re.PageViewport=Re.PDFDateString=Re.DOMStandardFontDataFactory=Re.DOMSVGFactory=Re.DOMFilterFactory=Re.DOMCanvasFactory=Re.DOMCMapReaderFactory=void 0,Re.deprecated=rr,Re.getColorValues=nr,Re.getCurrentTransform=hr,Re.getCurrentTransformInverse=sr,Re.getFilenameFromUrl=Ve,Re.getPdfFilenameFromUrl=Ke,Re.getRGB=tr,Re.getXfaPageViewport=pr,Re.isDataScheme=Ge,Re.isPdfFile=Ye,Re.isValidFetchUrl=Ze,Re.loadScript=ir,Re.noContextMenu=Je,Re.setLayerDimensions=xr;var je=Te(7),Oe=Te(1);const Me="http://www.w3.org/2000/svg",Rr=class Rr{};Es(Rr,"CSS",96),Es(Rr,"PDF",72),Es(Rr,"PDF_TO_CSS_UNITS",Rr.CSS/Rr.PDF);let De=Rr;Re.PixelsPerInch=De;class $e extends je.BaseFilterFactory{constructor({docId:fr,ownerDocument:Cr=globalThis.document}={}){super();Pn(this,Ar);Pn(this,br);Pn(this,wr);Pn(this,vr);Pn(this,Dr);Pn(this,kr);Pn(this,cr);Pn(this,dr);Pn(this,ur);Pn(this,gr);Pn(this,_r);Pn(this,Ir,0);kn(this,vr,fr),kn(this,Dr,Cr)}addFilter(fr){if(!fr)return"none";let Cr=Pr(this,Ar,ja).get(fr);if(Cr)return Cr;let Mr,$r,Fr,Kr;if(fr.length===1){const cn=fr[0],tn=new Array(256);for(let Qr=0;Qr<256;Qr++)tn[Qr]=cn[Qr]/255;Kr=Mr=$r=Fr=tn.join(",")}else{const[cn,tn,Qr]=fr,wn=new Array(256),gn=new Array(256),In=new Array(256);for(let yn=0;yn<256;yn++)wn[yn]=cn[yn]/255,gn[yn]=tn[yn]/255,In[yn]=Qr[yn]/255;Mr=wn.join(","),$r=gn.join(","),Fr=In.join(","),Kr=`${Mr}${$r}${Fr}`}if(Cr=Pr(this,Ar,ja).get(Kr),Cr)return Pr(this,Ar,ja).set(fr,Cr),Cr;const an=`g_${Pr(this,vr)}_transfer_map_${Ka(this,Ir)._++}`,Wr=`url(#${an})`;Pr(this,Ar,ja).set(fr,Wr),Pr(this,Ar,ja).set(Kr,Wr);const hn=vn(this,Ar,Ll).call(this,an);return vn(this,Ar,el).call(this,Mr,$r,Fr,hn),Wr}addHCMFilter(fr,Cr){var tn;const Mr=`${fr}-${Cr}`;if(Pr(this,cr)===Mr)return Pr(this,dr);if(kn(this,cr,Mr),kn(this,dr,"none"),(tn=Pr(this,kr))==null||tn.remove(),!fr||!Cr)return Pr(this,dr);const $r=vn(this,Ar,tl).call(this,fr);fr=Oe.Util.makeHexColor(...$r);const Fr=vn(this,Ar,tl).call(this,Cr);if(Cr=Oe.Util.makeHexColor(...Fr),Pr(this,Ar,Ia).style.color="",fr==="#000000"&&Cr==="#ffffff"||fr===Cr)return Pr(this,dr);const Kr=new Array(256);for(let Qr=0;Qr<=255;Qr++){const wn=Qr/255;Kr[Qr]=wn<=.03928?wn/12.92:((wn+.055)/1.055)**2.4}const an=Kr.join(","),Wr=`g_${Pr(this,vr)}_hcm_filter`,hn=kn(this,ur,vn(this,Ar,Ll).call(this,Wr));vn(this,Ar,el).call(this,an,an,an,hn),vn(this,Ar,wc).call(this,hn);const cn=(Qr,wn)=>{const gn=$r[Qr]/255,In=Fr[Qr]/255,yn=new Array(wn+1);for(let Mn=0;Mn<=wn;Mn++)yn[Mn]=gn+Mn/wn*(In-gn);return yn.join(",")};return vn(this,Ar,el).call(this,cn(0,5),cn(1,5),cn(2,5),hn),kn(this,dr,`url(#${Wr})`),Pr(this,dr)}addHighlightHCMFilter(fr,Cr,Mr,$r){var In;const Fr=`${fr}-${Cr}-${Mr}-${$r}`;if(Pr(this,gr)===Fr)return Pr(this,_r);if(kn(this,gr,Fr),kn(this,_r,"none"),(In=Pr(this,ur))==null||In.remove(),!fr||!Cr)return Pr(this,_r);const[Kr,an]=[fr,Cr].map(vn(this,Ar,tl).bind(this));let Wr=Math.round(.2126*Kr[0]+.7152*Kr[1]+.0722*Kr[2]),hn=Math.round(.2126*an[0]+.7152*an[1]+.0722*an[2]),[cn,tn]=[Mr,$r].map(vn(this,Ar,tl).bind(this));hn<Wr&&([Wr,hn,cn,tn]=[hn,Wr,tn,cn]),Pr(this,Ar,Ia).style.color="";const Qr=(yn,Mn,on)=>{const Yr=new Array(256),sn=(hn-Wr)/on,On=yn/255,Bn=(Mn-yn)/(255*on);let Hn=0;for(let Zr=0;Zr<=on;Zr++){const xn=Math.round(Wr+Zr*sn),An=On+Zr*Bn;for(let Wn=Hn;Wn<=xn;Wn++)Yr[Wn]=An;Hn=xn+1}for(let Zr=Hn;Zr<256;Zr++)Yr[Zr]=Yr[Hn-1];return Yr.join(",")},wn=`g_${Pr(this,vr)}_hcm_highlight_filter`,gn=kn(this,ur,vn(this,Ar,Ll).call(this,wn));return vn(this,Ar,wc).call(this,gn),vn(this,Ar,el).call(this,Qr(cn[0],tn[0],5),Qr(cn[1],tn[1],5),Qr(cn[2],tn[2],5),gn),kn(this,_r,`url(#${wn})`),Pr(this,_r)}destroy(fr=!1){fr&&(Pr(this,dr)||Pr(this,_r))||(Pr(this,wr)&&(Pr(this,wr).parentNode.parentNode.remove(),kn(this,wr,null)),Pr(this,br)&&(Pr(this,br).clear(),kn(this,br,null)),kn(this,Ir,0))}}br=new WeakMap,wr=new WeakMap,vr=new WeakMap,Dr=new WeakMap,kr=new WeakMap,cr=new WeakMap,dr=new WeakMap,ur=new WeakMap,gr=new WeakMap,_r=new WeakMap,Ir=new WeakMap,Ar=new WeakSet,ja=function(){return Pr(this,br)||kn(this,br,new Map)},Ia=function(){if(!Pr(this,wr)){const fr=Pr(this,Dr).createElement("div"),{style:Cr}=fr;Cr.visibility="hidden",Cr.contain="strict",Cr.width=Cr.height=0,Cr.position="absolute",Cr.top=Cr.left=0,Cr.zIndex=-1;const Mr=Pr(this,Dr).createElementNS(Me,"svg");Mr.setAttribute("width",0),Mr.setAttribute("height",0),kn(this,wr,Pr(this,Dr).createElementNS(Me,"defs")),fr.append(Mr),Mr.append(Pr(this,wr)),Pr(this,Dr).body.append(fr)}return Pr(this,wr)},wc=function(fr){const Cr=Pr(this,Dr).createElementNS(Me,"feColorMatrix");Cr.setAttribute("type","matrix"),Cr.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"),fr.append(Cr)},Ll=function(fr){const Cr=Pr(this,Dr).createElementNS(Me,"filter");return Cr.setAttribute("color-interpolation-filters","sRGB"),Cr.setAttribute("id",fr),Pr(this,Ar,Ia).append(Cr),Cr},Ol=function(fr,Cr,Mr){const $r=Pr(this,Dr).createElementNS(Me,Cr);$r.setAttribute("type","discrete"),$r.setAttribute("tableValues",Mr),fr.append($r)},el=function(fr,Cr,Mr,$r){const Fr=Pr(this,Dr).createElementNS(Me,"feComponentTransfer");$r.append(Fr),vn(this,Ar,Ol).call(this,Fr,"feFuncR",fr),vn(this,Ar,Ol).call(this,Fr,"feFuncG",Cr),vn(this,Ar,Ol).call(this,Fr,"feFuncB",Mr)},tl=function(fr){return Pr(this,Ar,Ia).style.color=fr,tr(getComputedStyle(Pr(this,Ar,Ia)).getPropertyValue("color"))},Re.DOMFilterFactory=$e;class Be extends je.BaseCanvasFactory{constructor({ownerDocument:jr=globalThis.document}={}){super(),this._document=jr}_createCanvas(jr,fr){const Cr=this._document.createElement("canvas");return Cr.width=jr,Cr.height=fr,Cr}}Re.DOMCanvasFactory=Be;async function Ue(Lr,jr=!1){if(Ze(Lr,document.baseURI)){const fr=await fetch(Lr);if(!fr.ok)throw new Error(fr.statusText);return jr?new Uint8Array(await fr.arrayBuffer()):(0,Oe.stringToBytes)(await fr.text())}return new Promise((fr,Cr)=>{const Mr=new XMLHttpRequest;Mr.open("GET",Lr,!0),jr&&(Mr.responseType="arraybuffer"),Mr.onreadystatechange=()=>{if(Mr.readyState===XMLHttpRequest.DONE){if(Mr.status===200||Mr.status===0){let $r;if(jr&&Mr.response?$r=new Uint8Array(Mr.response):!jr&&Mr.responseText&&($r=(0,Oe.
3986stringToBytes)(Mr.responseText)),$r){fr($r);return}}Cr(new Error(Mr.statusText))}},Mr.send(null)})}class ze extends je.BaseCMapReaderFactory{_fetchData(jr,fr){return Ue(jr,this.isCompressed).then(Cr=>({cMapData:Cr,compressionType:fr}))}}Re.DOMCMapReaderFactory=ze;class We extends je.BaseStandardFontDataFactory{_fetchData(jr){return Ue(jr,!0)}}Re.DOMStandardFontDataFactory=We;class Xe extends je.BaseSVGFactory{_createSVG(jr){return document.createElementNS(Me,jr)}}Re.DOMSVGFactory=Xe;class He{constructor({viewBox:jr,scale:fr,rotation:Cr,offsetX:Mr=0,offsetY:$r=0,dontFlip:Fr=!1}){this.viewBox=jr,this.scale=fr,this.rotation=Cr,this.offsetX=Mr,this.offsetY=$r;const Kr=(jr[2]+jr[0])/2,an=(jr[3]+jr[1])/2;let Wr,hn,cn,tn;switch(Cr%=360,Cr<0&&(Cr+=360),Cr){case 180:Wr=-1,hn=0,cn=0,tn=1;break;case 90:Wr=0,hn=1,cn=1,tn=0;break;case 270:Wr=0,hn=-1,cn=-1,tn=0;break;case 0:Wr=1,hn=0,cn=0,tn=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}Fr&&(cn=-cn,tn=-tn);let Qr,wn,gn,In;Wr===0?(Qr=Math.abs(an-jr[1])*fr+Mr,wn=Math.abs(Kr-jr[0])*fr+$r,gn=(jr[3]-jr[1])*fr,In=(jr[2]-jr[0])*fr):(Qr=Math.abs(Kr-jr[0])*fr+Mr,wn=Math.abs(an-jr[1])*fr+$r,gn=(jr[2]-jr[0])*fr,In=(jr[3]-jr[1])*fr),this.transform=[Wr*fr,hn*fr,cn*fr,tn*fr,Qr-Wr*fr*Kr-cn*fr*an,wn-hn*fr*Kr-tn*fr*an],this.width=gn,this.height=In}get rawDims(){const{viewBox:jr}=this;return(0,Oe.shadow)(this,"rawDims",{pageWidth:jr[2]-jr[0],pageHeight:jr[3]-jr[1],pageX:jr[0],pageY:jr[1]})}clone({scale:jr=this.scale,rotation:fr=this.rotation,offsetX:Cr=this.offsetX,offsetY:Mr=this.offsetY,dontFlip:$r=!1}={}){return new He({viewBox:this.viewBox.slice(),scale:jr,rotation:fr,offsetX:Cr,offsetY:Mr,dontFlip:$r})}convertToViewportPoint(jr,fr){return Oe.Util.applyTransform([jr,fr],this.transform)}convertToViewportRectangle(jr){const fr=Oe.Util.applyTransform([jr[0],jr[1]],this.transform),Cr=Oe.Util.applyTransform([jr[2],jr[3]],this.transform);return[fr[0],fr[1],Cr[0],Cr[1]]}convertToPdfPoint(jr,fr){return Oe.Util.applyInverseTransform([jr,fr],this.transform)}}Re.PageViewport=He;class qe extends Oe.BaseException{constructor(jr,fr=0){super(jr,"RenderingCancelledException"),this.extraDelay=fr}}Re.RenderingCancelledException=qe;function Ge(Lr){const jr=Lr.length;let fr=0;for(;fr<jr&&Lr[fr].trim()==="";)fr++;return Lr.substring(fr,fr+5).toLowerCase()==="data:"}function Ye(Lr){return typeof Lr=="string"&&/\.pdf$/i.test(Lr)}function Ve(Lr,jr=!1){return jr||([Lr]=Lr.split(/[#?]/,1)),Lr.substring(Lr.lastIndexOf("/")+1)}function Ke(Lr,jr="document.pdf"){if(typeof Lr!="string")return jr;if(Ge(Lr))return(0,Oe.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),jr;const fr=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,Cr=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,Mr=fr.exec(Lr);let $r=Cr.exec(Mr[1])||Cr.exec(Mr[2])||Cr.exec(Mr[3]);if($r&&($r=$r[0],$r.includes("%")))try{$r=Cr.exec(decodeURIComponent($r))[0]}catch{}return $r||jr}class Qe{constructor(){Es(this,"started",Object.create(null));Es(this,"times",[])}time(jr){jr in this.started&&(0,Oe.warn)(`Timer is already running for ${jr}`),this.started[jr]=Date.now()}timeEnd(jr){jr in this.started||(0,Oe.warn)(`Timer has not been started for ${jr}`),this.times.push({name:jr,start:this.started[jr],end:Date.now()}),delete this.started[jr]}toString(){const jr=[];let fr=0;for(const{name:Cr}of this.times)fr=Math.max(Cr.length,fr);for(const{name:Cr,start:Mr,end:$r}of this.times)jr.push(`${Cr.padEnd(fr)} ${$r-Mr}ms 3987`);return jr.join("")}}Re.StatTimer=Qe;function Ze(Lr,jr){try{const{protocol:fr}=jr?new URL(Lr,jr):new URL(Lr);return fr==="http:"||fr==="https:"}catch{return!1}}function Je(Lr){Lr.preventDefault()}function ir(Lr,jr=!1){return new Promise((fr,Cr)=>{const Mr=document.createElement("script");Mr.src=Lr,Mr.onload=function($r){jr&&Mr.remove(),fr($r)},Mr.onerror=function(){Cr(new Error(`Cannot load script at: ${Mr.src}`))},(document.head||document.documentElement).append(Mr)})}function rr(Lr){console.log("Deprecated API usage: "+Lr)}let ar;class or{static toDateObject(jr){if(!jr||typeof jr!="string")return null;ar||(ar=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const fr=ar.exec(jr);if(!fr)return null;const Cr=parseInt(fr[1],10);let Mr=parseInt(fr[2],10);Mr=Mr>=1&&Mr<=12?Mr-1:0;let $r=parseInt(fr[3],10);$r=$r>=1&&$r<=31?$r:1;let Fr=parseInt(fr[4],10);Fr=Fr>=0&&Fr<=23?Fr:0;let Kr=parseInt(fr[5],10);Kr=Kr>=0&&Kr<=59?Kr:0;let an=parseInt(fr[6],10);an=an>=0&&an<=59?an:0;const Wr=fr[7]||"Z";let hn=parseInt(fr[8],10);hn=hn>=0&&hn<=23?hn:0;let cn=parseInt(fr[9],10)||0;return cn=cn>=0&&cn<=59?cn:0,Wr==="-"?(Fr+=hn,Kr+=cn):Wr==="+"&&(Fr-=hn,Kr-=cn),new Date(Date.UTC(Cr,Mr,$r,Fr,Kr,an))}}
3987Re.PDFDateString=or;function pr(Lr,{scale:jr=1,rotation:fr=0}){const{width:Cr,height:Mr}=Lr.attributes.style,$r=[0,0,parseInt(Cr),parseInt(Mr)];return new He({viewBox:$r,scale:jr,rotation:fr})}function tr(Lr){if(Lr.startsWith("#")){const jr=parseInt(Lr.slice(1),16);return[(jr&16711680)>>16,(jr&65280)>>8,jr&255]}return Lr.startsWith("rgb(")?Lr.slice(4,-1).split(",").map(jr=>parseInt(jr)):Lr.startsWith("rgba(")?Lr.slice(5,-1).split(",").map(jr=>parseInt(jr)).slice(0,3):((0,Oe.warn)(`Not a valid color format: "${Lr}"`),[0,0,0])}function nr(Lr){const jr=document.createElement("span");jr.style.visibility="hidden",document.body.append(jr);for(const fr of Lr.keys()){jr.style.color=fr;const Cr=window.getComputedStyle(jr).color;Lr.set(fr,tr(Cr))}jr.remove()}function hr(Lr){const{a:jr,b:fr,c:Cr,d:Mr,e:$r,f:Fr}=Lr.getTransform();return[jr,fr,Cr,Mr,$r,Fr]}function sr(Lr){const{a:jr,b:fr,c:Cr,d:Mr,e:$r,f:Fr}=Lr.getTransform().invertSelf();return[jr,fr,Cr,Mr,$r,Fr]}function xr(Lr,jr,fr=!1,Cr=!0){if(jr instanceof He){const{pageWidth:Mr,pageHeight:$r}=jr.rawDims,{style:Fr}=Lr,Kr=Oe.FeatureTest.isCSSRoundSupported,an=`var(--scale-factor) * ${Mr}px`,Wr=`var(--scale-factor) * ${$r}px`,hn=Kr?`round(${an}, 1px)`:`calc(${an})`,cn=Kr?`round(${Wr}, 1px)`:`calc(${Wr})`;!fr||jr.rotation%180===0?(Fr.width=hn,Fr.height=cn):(Fr.width=cn,Fr.height=hn)}Cr&&Lr.setAttribute("data-main-rotation",jr.rotation)}},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.BaseStandardFontDataFactory=Re.BaseSVGFactory=Re.BaseFilterFactory=Re.BaseCanvasFactory=Re.BaseCMapReaderFactory=void 0;var je=Te(1);class Oe{constructor(){this.constructor===Oe&&(0,je.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(ze){return"none"}addHCMFilter(ze,We){return"none"}addHighlightHCMFilter(ze,We,Xe,He){return"none"}destroy(ze=!1){}}Re.BaseFilterFactory=Oe;class Me{constructor(){this.constructor===Me&&(0,je.unreachable)("Cannot initialize BaseCanvasFactory.")}create(ze,We){if(ze<=0||We<=0)throw new Error("Invalid canvas size");const Xe=this._createCanvas(ze,We);return{canvas:Xe,context:Xe.getContext("2d")}}reset(ze,We,Xe){if(!ze.canvas)throw new Error("Canvas is not specified");if(We<=0||Xe<=0)throw new Error("Invalid canvas size");ze.canvas.width=We,ze.canvas.height=Xe}destroy(ze){if(!ze.canvas)throw new Error("Canvas is not specified");ze.canvas.width=0,ze.canvas.height=0,ze.canvas=null,ze.context=null}_createCanvas(ze,We){(0,je.unreachable)("Abstract method `_createCanvas` called.")}}Re.BaseCanvasFactory=Me;class De{constructor({baseUrl:ze=null,isCompressed:We=!0}){this.constructor===De&&(0,je.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=ze,this.isCompressed=We}async fetch({name:ze}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!ze)throw new Error("CMap name must be specified.");const We=this.baseUrl+ze+(this.isCompressed?".bcmap":""),Xe=this.isCompressed?je.CMapCompressionType.BINARY:je.CMapCompressionType.NONE;return this._fetchData(We,Xe).catch(He=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${We}`)})}_fetchData(ze,We){(0,je.unreachable)("Abstract method `_fetchData` called.")}}Re.BaseCMapReaderFactory=De;class $e{constructor({baseUrl:ze=null}){this.constructor===$e&&(0,je.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=ze}async fetch({filename:ze}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!ze)throw new Error("Font filename must be specified.");const We=`${this.baseUrl}${ze}`;return this._fetchData(We).catch(Xe=>{throw new Error(`Unable to load font data at: ${We}`)})}_fetchData(ze){(0,je.unreachable)("Abstract method `_fetchData` called.")}}Re.BaseStandardFontDataFactory=$e;class Be{constructor(){this.constructor===Be&&(0,je.unreachable)("Cannot initialize BaseSVGFactory.")}create(ze,We,Xe=!1){if(ze<=0||We<=0)throw new Error("Invalid SVG dimensions");const He=this._createSVG("svg:svg");return He.setAttribute("version","1.1"),Xe||(He.setAttribute("width",`${ze}px`),He.setAttribute("height",`${We}px`)),He.setAttribute("preserveAspectRatio","none"),He.setAttribute("viewBox",`0 0 ${ze} ${We}`),He}createElement(ze){if(typeof ze!="string")throw new Error("Invalid SVG element type");return this._createSVG(ze)}_createSVG(ze){(0,je.unreachable)("Abstract method `_createSVG` called.")}}Re.BaseSVGFactory=Be},(Ee,Re,Te)=>
3987{Object.defineProperty(Re,"__esModule",{value:!0}),Re.MurmurHash3_64=void 0;var je=Te(1);const Oe=3285377520,Me=4294901760,De=65535;class $e{constructor(Ue){this.h1=Ue?Ue&4294967295:Oe,this.h2=Ue?Ue&4294967295:Oe}update(Ue){let ze,We;if(typeof Ue=="string"){ze=new Uint8Array(Ue.length*2),We=0;for(let rr=0,ar=Ue.length;rr<ar;rr++){const or=Ue.charCodeAt(rr);or<=255?ze[We++]=or:(ze[We++]=or>>>8,ze[We++]=or&255)}}else if((0,je.isArrayBuffer)(Ue))ze=Ue.slice(),We=ze.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const Xe=We>>2,He=We-Xe*4,qe=new Uint32Array(ze.buffer,0,Xe);let Ge=0,Ye=0,Ve=this.h1,Ke=this.h2;const Qe=3432918353,Ze=461845907,Je=Qe&De,ir=Ze&De;for(let rr=0;rr<Xe;rr++)rr&1?(Ge=qe[rr],Ge=Ge*Qe&Me|Ge*Je&De,Ge=Ge<<15|Ge>>>17,Ge=Ge*Ze&Me|Ge*ir&De,Ve^=Ge,Ve=Ve<<13|Ve>>>19,Ve=Ve*5+3864292196):(Ye=qe[rr],Ye=Ye*Qe&Me|Ye*Je&De,Ye=Ye<<15|Ye>>>17,Ye=Ye*Ze&Me|Ye*ir&De,Ke^=Ye,Ke=Ke<<13|Ke>>>19,Ke=Ke*5+3864292196);switch(Ge=0,He){case 3:Ge^=ze[Xe*4+2]<<16;case 2:Ge^=ze[Xe*4+1]<<8;case 1:Ge^=ze[Xe*4],Ge=Ge*Qe&Me|Ge*Je&De,Ge=Ge<<15|Ge>>>17,Ge=Ge*Ze&Me|Ge*ir&De,Xe&1?Ve^=Ge:Ke^=Ge}this.h1=Ve,this.h2=Ke}hexdigest(){let Ue=this.h1,ze=this.h2;return Ue^=ze>>>1,Ue=Ue*3981806797&Me|Ue*36045&De,ze=ze*4283543511&Me|((ze<<16|Ue>>>16)*2950163797&Me)>>>16,Ue^=ze>>>1,Ue=Ue*444984403&Me|Ue*60499&De,ze=ze*3301882366&Me|((ze<<16|Ue>>>16)*3120437893&Me)>>>16,Ue^=ze>>>1,(Ue>>>0).toString(16).padStart(8,"0")+(ze>>>0).toString(16).padStart(8,"0")}}Re.MurmurHash3_64=$e},(Ee,Re,Te)=>{var De;Object.defineProperty(Re,"__esModule",{value:!0}),Re.FontLoader=Re.FontFaceObject=void 0;var je=Te(1);class Oe{constructor({ownerDocument:Be=globalThis.document,styleElement:Ue=null}){Pn(this,De,new Set);this._document=Be,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(Be){this.nativeFontFaces.add(Be),this._document.fonts.add(Be)}removeNativeFontFace(Be){this.nativeFontFaces.delete(Be),this._document.fonts.delete(Be)}insertRule(Be){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const Ue=this.styleElement.sheet;Ue.insertRule(Be,Ue.cssRules.length)}clear(){for(const Be of this.nativeFontFaces)this._document.fonts.delete(Be);this.nativeFontFaces.clear(),Pr(this,De).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(Be){if(!(!Be||Pr(this,De).has(Be.loadedName))){if((0,je.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:Ue,src:ze,style:We}=Be,Xe=new FontFace(Ue,ze,We);this.addNativeFontFace(Xe);try{await Xe.load(),Pr(this,De).add(Ue)}catch{(0,je.warn)(`Cannot load system font: ${Be.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(Xe)}return}(0,je.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(Be){if(Be.attached||Be.missingFile&&!Be.systemFontInfo)return;if(Be.attached=!0,Be.systemFontInfo){await this.loadSystemFont(Be.systemFontInfo);return}if(this.isFontLoadingAPISupported){const ze=Be.createNativeFontFace();if(ze){this.addNativeFontFace(ze);try{await ze.loaded}catch(We){throw(0,je.warn)(`Failed to load font '${ze.family}': '${We}'.`),Be.disableFontFace=!0,We}}return}const Ue=Be.createFontFaceRule();if(Ue){if(this.insertRule(Ue),this.isSyncFontLoadingSupported)return;await new Promise(ze=>{const We=this._queueLoadingCallback(ze);this._prepareFontLoadEvent(Be,We)})}}get isFontLoadingAPISupported(){var Ue;const Be=!!((Ue=this._document)!=null&&Ue.fonts);return(0,je.shadow)(this,"isFontLoadingAPISupported",Be)}get isSyncFontLoadingSupported(){let Be=!1;return(je.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(Be=!0),(0,je.shadow)(this,"isSyncFontLoadingSupported",Be)}_queueLoadingCallback(Be){function Ue(){for((0,je.assert)(!We.done,"completeRequest() cannot be called twice."),We.done=!0;ze.length>0&&ze[0].done;){const Xe=ze.shift();setTimeout(Xe.callback,0)}}const{loadingRequests:ze}=this,We={done:!1,complete:Ue,callback:Be};return ze.push(We),We}get _loadTestFont(){const Be=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,je.shadow)(this,"_loadTestFont",Be)}_prepareFontLoadEvent(Be,Ue){function ze(tr,nr){return tr.charCodeAt(nr)<<24|tr.charCodeAt(nr+1)<<16|tr.charCodeAt(nr+2)<<8|tr.charCodeAt(nr+3)&255}function We(tr,nr,hr,sr){const xr=tr.substring(0,nr),Rr=tr.substring(nr+hr);return xr+sr+Rr}let Xe,He;const qe=this._document.createElement("canvas");qe.width=1,qe.height=1;const Ge=qe.getContext("2d");let Ye=0;function Ve(tr,nr){if(++Ye>30){(0,je.warn)("Load test font never loaded."),nr();return}if(Ge.font="30px "+tr,Ge.fillText(".",0,20),Ge.getImageData(0,0,1,1).data[3]>0){nr();return}setTimeout(Ve.bind(null,tr,nr))}const Ke=`lt${Date.now()}${this.loadTestFontId++}`;let Qe=this._loadTestFont;Qe=We(Qe,976,Ke.length,Ke);const Je=16,ir=1482184792;let rr=ze(Qe,Je);for(Xe=0,He=Ke.length-3;Xe<He;Xe+=4)rr=rr-ir+ze(Ke,Xe)|0;Xe<Ke.length&&(rr=rr-ir+ze(Ke+"XXX",Xe)|0),Qe=We(Qe,Je,4,(0,je.string32)(rr));const ar=`url(data:font/opentype;base64,${btoa(Qe)});`,or=`@font-face {font-family:"${Ke}";src:${ar}}`;this.insertRule(or);const pr=this._document.createElement("div");pr.style.visibility="hidden",pr.style.width=pr.style.height="10px",pr.style.position="absolute",pr.style.top=pr.style.left="0px";for(const tr of[Be.loadedName,Ke]){const nr=this._document.createElement("span");nr.textContent="Hi",nr.style.fontFamily=tr,pr.append(nr)}this._document.body.append(pr),Ve(Ke,()=>{pr.remove(),Ue.complete()})}}
3987De=new WeakMap,Re.FontLoader=Oe;class Me{constructor(Be,{isEvalSupported:Ue=!0,disableFontFace:ze=!1,ignoreErrors:We=!1,inspectFont:Xe=null}){this.compiledGlyphs=Object.create(null);for(const He in Be)this[He]=Be[He];this.isEvalSupported=Ue!==!1,this.disableFontFace=ze===!0,this.ignoreErrors=We===!0,this._inspectFont=Xe}createNativeFontFace(){var Ue;if(!this.data||this.disableFontFace)return null;let Be;if(!this.cssFontInfo)Be=new FontFace(this.loadedName,this.data,{});else{const ze={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(ze.style=`oblique ${this.cssFontInfo.italicAngle}deg`),Be=new FontFace(this.cssFontInfo.fontFamily,this.data,ze)}return(Ue=this._inspectFont)==null||Ue.call(this,this),Be}createFontFaceRule(){var We;if(!this.data||this.disableFontFace)return null;const Be=(0,je.bytesToString)(this.data),Ue=`url(data:${this.mimetype};base64,${btoa(Be)});`;let ze;if(!this.cssFontInfo)ze=`@font-face {font-family:"${this.loadedName}";src:${Ue}}`;else{let Xe=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(Xe+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),ze=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${Xe}src:${Ue}}`}return(We=this._inspectFont)==null||We.call(this,this,Ue),ze}getPathGenerator(Be,Ue){if(this.compiledGlyphs[Ue]!==void 0)return this.compiledGlyphs[Ue];let ze;try{ze=Be.get(this.loadedName+"_path_"+Ue)}catch(We){if(!this.ignoreErrors)throw We;return(0,je.warn)(`getPathGenerator - ignoring character: "${We}".`),this.compiledGlyphs[Ue]=function(Xe,He){}}if(this.isEvalSupported&&je.FeatureTest.isEvalSupported){const We=[];for(const Xe of ze){const He=Xe.args!==void 0?Xe.args.join(","):"";We.push("c.",Xe.cmd,"(",He,`); 3988`)}return this.compiledGlyphs[Ue]=new Function("c","size",We.join(""))}return this.compiledGlyphs[Ue]=function(We,Xe){for(const He of ze)He.cmd==="scale"&&(He.args=[Xe,-Xe]),We[He.cmd].apply(We,He.args)}}}Re.FontFaceObject=Me},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.NodeStandardFontDataFactory=Re.NodeFilterFactory=Re.NodeCanvasFactory=Re.NodeCMapReaderFactory=void 0;var je=Te(7);Te(1);const Oe=function(Ue){return new Promise((ze,We)=>{require$$5.readFile(Ue,(He,qe)=>{if(He||!qe){We(new Error(He));return}ze(new Uint8Array(qe))})})};class Me extends je.BaseFilterFactory{}Re.NodeFilterFactory=Me;class De extends je.BaseCanvasFactory{_createCanvas(ze,We){return require$$5.createCanvas(ze,We)}}Re.NodeCanvasFactory=De;class $e extends je.BaseCMapReaderFactory{_fetchData(ze,We){return Oe(ze).then(Xe=>({cMapData:Xe,compressionType:We}))}}Re.NodeCMapReaderFactory=$e;class Be extends je.BaseStandardFontDataFactory{_fetchData(ze){return Oe(ze)}}Re.NodeStandardFontDataFactory=Be},(Ee,Re,Te)=>{var wr,Ec,Cc;Object.defineProperty(Re,"__esModule",{value:!0}),Re.CanvasGraphics=void 0;var je=Te(1),Oe=Te(6),Me=Te(12),De=Te(13);const $e=16,Be=100,Ue=4096,ze=15,We=10,Xe=1e3,He=16;function qe(cr,dr){if(cr._removeMirroring)throw new Error("Context is already forwarding operations.");cr.__originalSave=cr.save,cr.__originalRestore=cr.restore,cr.__originalRotate=cr.rotate,cr.__originalScale=cr.scale,cr.__originalTranslate=cr.translate,cr.__originalTransform=cr.transform,cr.__originalSetTransform=cr.setTransform,cr.__originalResetTransform=cr.resetTransform,cr.__originalClip=cr.clip,cr.__originalMoveTo=cr.moveTo,cr.__originalLineTo=cr.lineTo,cr.__originalBezierCurveTo=cr.bezierCurveTo,cr.__originalRect=cr.rect,cr.__originalClosePath=cr.closePath,cr.__originalBeginPath=cr.beginPath,cr._removeMirroring=()=>{cr.save=cr.__originalSave,cr.restore=cr.__originalRestore,cr.rotate=cr.__originalRotate,cr.scale=cr.__originalScale,cr.translate=cr.__originalTranslate,cr.transform=cr.__originalTransform,cr.setTransform=cr.__originalSetTransform,cr.resetTransform=cr.__originalResetTransform,cr.clip=cr.__originalClip,cr.moveTo=cr.__originalMoveTo,cr.lineTo=cr.__originalLineTo,cr.bezierCurveTo=cr.__originalBezierCurveTo,cr.rect=cr.__originalRect,cr.closePath=cr.__originalClosePath,cr.beginPath=cr.__originalBeginPath,delete cr._removeMirroring},cr.save=function(){dr.save(),this.__originalSave()}
3988,cr.restore=function(){dr.restore(),this.__originalRestore()},cr.translate=function(gr,_r){dr.translate(gr,_r),this.__originalTranslate(gr,_r)},cr.scale=function(gr,_r){dr.scale(gr,_r),this.__originalScale(gr,_r)},cr.transform=function(gr,_r,Ir,Ar,Tr,Nr){dr.transform(gr,_r,Ir,Ar,Tr,Nr),this.__originalTransform(gr,_r,Ir,Ar,Tr,Nr)},cr.setTransform=function(gr,_r,Ir,Ar,Tr,Nr){dr.setTransform(gr,_r,Ir,Ar,Tr,Nr),this.__originalSetTransform(gr,_r,Ir,Ar,Tr,Nr)},cr.resetTransform=function(){dr.resetTransform(),this.__originalResetTransform()},cr.rotate=function(gr){dr.rotate(gr),this.__originalRotate(gr)},cr.clip=function(gr){dr.clip(gr),this.__originalClip(gr)},cr.moveTo=function(ur,gr){dr.moveTo(ur,gr),this.__originalMoveTo(ur,gr)},cr.lineTo=function(ur,gr){dr.lineTo(ur,gr),this.__originalLineTo(ur,gr)},cr.bezierCurveTo=function(ur,gr,_r,Ir,Ar,Tr){dr.bezierCurveTo(ur,gr,_r,Ir,Ar,Tr),this.__originalBezierCurveTo(ur,gr,_r,Ir,Ar,Tr)},cr.rect=function(ur,gr,_r,Ir){dr.rect(ur,gr,_r,Ir),this.__originalRect(ur,gr,_r,Ir)},cr.closePath=function(){dr.closePath(),this.__originalClosePath()},cr.beginPath=function(){dr.beginPath(),this.__originalBeginPath()}}class Ge{constructor(dr){this.canvasFactory=dr,this.cache=Object.create(null)}getCanvas(dr,ur,gr){let _r;return this.cache[dr]!==void 0?(_r=this.cache[dr],this.canvasFactory.reset(_r,ur,gr)):(_r=this.canvasFactory.create(ur,gr),this.cache[dr]=_r),_r}delete(dr){delete this.cache[dr]}clear(){for(const dr in this.cache){const ur=this.cache[dr];this.canvasFactory.destroy(ur),delete this.cache[dr]}}}function Ye(cr,dr,ur,gr,_r,Ir,Ar,Tr,Nr,Br){const[Hr,Vr,mr,Sr,Lr,jr]=(0,Oe.getCurrentTransform)(cr);if(Vr===0&&mr===0){const Mr=Ar*Hr+Lr,$r=Math.round(Mr),Fr=Tr*Sr+jr,Kr=Math.round(Fr),an=(Ar+Nr)*Hr+Lr,Wr=Math.abs(Math.round(an)-$r)||1,hn=(Tr+Br)*Sr+jr,cn=Math.abs(Math.round(hn)-Kr)||1;return cr.setTransform(Math.sign(Hr),0,0,Math.sign(Sr),$r,Kr),cr.drawImage(dr,ur,gr,_r,Ir,0,0,Wr,cn),cr.setTransform(Hr,Vr,mr,Sr,Lr,jr),[Wr,cn]}if(Hr===0&&Sr===0){const Mr=Tr*mr+Lr,$r=Math.round(Mr),Fr=Ar*Vr+jr,Kr=Math.round(Fr),an=(Tr+Br)*mr+Lr,Wr=Math.abs(Math.round(an)-$r)||1,hn=(Ar+Nr)*Vr+jr,cn=Math.abs(Math.round(hn)-Kr)||1;return cr.setTransform(0,Math.sign(Vr),Math.sign(mr),0,$r,Kr),cr.drawImage(dr,ur,gr,_r,Ir,0,0,cn,Wr),cr.setTransform(Hr,Vr,mr,Sr,Lr,jr),[cn,Wr]}cr.drawImage(dr,ur,gr,_r,Ir,Ar,Tr,Nr,Br);const fr=Math.hypot(Hr,Vr),Cr=Math.hypot(mr,Sr);return[fr*Nr,Cr*Br]}function Ve(cr){const{width:dr,height:ur}=cr;if(dr>Xe||ur>Xe)return null;const gr=1e3,_r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),Ir=dr+1;
3988let Ar=new Uint8Array(Ir*(ur+1)),Tr,Nr,Br;const Hr=dr+7&-8;let Vr=new Uint8Array(Hr*ur),mr=0;for(const Cr of cr.data){let Mr=128;for(;Mr>0;)Vr[mr++]=Cr&Mr?0:255,Mr>>=1}let Sr=0;for(mr=0,Vr[mr]!==0&&(Ar[0]=1,++Sr),Nr=1;Nr<dr;Nr++)Vr[mr]!==Vr[mr+1]&&(Ar[Nr]=Vr[mr]?2:1,++Sr),mr++;for(Vr[mr]!==0&&(Ar[Nr]=2,++Sr),Tr=1;Tr<ur;Tr++){mr=Tr*Hr,Br=Tr*Ir,Vr[mr-Hr]!==Vr[mr]&&(Ar[Br]=Vr[mr]?1:8,++Sr);let Cr=(Vr[mr]?4:0)+(Vr[mr-Hr]?8:0);for(Nr=1;Nr<dr;Nr++)Cr=(Cr>>2)+(Vr[mr+1]?4:0)+(Vr[mr-Hr+1]?8:0),_r[Cr]&&(Ar[Br+Nr]=_r[Cr],++Sr),mr++;if(Vr[mr-Hr]!==Vr[mr]&&(Ar[Br+Nr]=Vr[mr]?2:4,++Sr),Sr>gr)return null}for(mr=Hr*(ur-1),Br=Tr*Ir,Vr[mr]!==0&&(Ar[Br]=8,++Sr),Nr=1;Nr<dr;Nr++)Vr[mr]!==Vr[mr+1]&&(Ar[Br+Nr]=Vr[mr]?4:8,++Sr),mr++;if(Vr[mr]!==0&&(Ar[Br+Nr]=4,++Sr),Sr>gr)return null;const Lr=new Int32Array([0,Ir,-1,0,-Ir,0,0,0,1]),jr=new Path2D;for(Tr=0;Sr&&Tr<=ur;Tr++){let Cr=Tr*Ir;const Mr=Cr+dr;for(;Cr<Mr&&!Ar[Cr];)Cr++;if(Cr===Mr)continue;jr.moveTo(Cr%Ir,Tr);const $r=Cr;let Fr=Ar[Cr];do{const Kr=Lr[Fr];do Cr+=Kr;while(!Ar[Cr]);const an=Ar[Cr];an!==5&&an!==10?(Fr=an,Ar[Cr]=0):(Fr=an&51*Fr>>4,Ar[Cr]&=Fr>>2|Fr<<2),jr.lineTo(Cr%Ir,Cr/Ir|0),Ar[Cr]||--Sr}while($r!==Cr);--Tr}return Vr=null,Ar=null,function(Cr){Cr.save(),Cr.scale(1/dr,-1/ur),Cr.translate(0,-ur),Cr.fill(jr),Cr.beginPath(),Cr.restore()}}class Ke{constructor(dr,ur){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=je.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=je.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=je.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,dr,ur])}clone(){const dr=Object.create(this);return dr.clipBox=this.clipBox.slice(),dr}setCurrentPoint(dr,ur){this.x=dr,this.y=ur}updatePathMinMax(dr,ur,gr){[ur,gr]=je.Util.applyTransform([ur,gr],dr),this.minX=Math.min(this.minX,ur),this.minY=Math.min(this.minY,gr),this.maxX=Math.max(this.maxX,ur),this.maxY=Math.max(this.maxY,gr)}updateRectMinMax(dr,ur){const gr=je.Util.applyTransform(ur,dr),_r=je.Util.applyTransform(ur.slice(2),dr);this.minX=Math.min(this.minX,gr[0],_r[0]),this.minY=Math.min(this.minY,gr[1],_r[1]),this.maxX=Math.max(this.maxX,gr[0],_r[0]),this.maxY=Math.max(this.maxY,gr[1],_r[1])}updateScalingPathMinMax(dr,ur){je.Util.scaleMinMax(dr,ur),this.minX=Math.min(this.minX,ur[0]),this.maxX=Math.max(this.maxX,ur[1]),this.minY=Math.min(this.minY,ur[2]),this.maxY=Math.max(this.maxY,ur[3])}updateCurvePathMinMax(dr,ur,gr,_r,Ir,Ar,Tr,Nr,Br,Hr){const Vr=je.Util.bezierBoundingBox(ur,gr,_r,Ir,Ar,Tr,Nr,Br);if(Hr){Hr[0]=Math.min(Hr[0],Vr[0],Vr[2]),Hr[1]=Math.max(Hr[1],Vr[0],Vr[2]),Hr[2]=Math.min(Hr[2],Vr[1],Vr[3]),Hr[3]=Math.max(Hr[3],Vr[1],Vr[3]);return}this.updateRectMinMax(dr,Vr)}getPathBoundingBox(dr=Me.PathType.FILL,ur=null){const gr=[this.minX,this.minY,this.maxX,this.maxY];if(dr===Me.PathType.STROKE){ur||(0,je.unreachable)("Stroke bounding box must include transform.");const _r=je.Util.singularValueDecompose2dScale(ur),Ir=_r[0]*this.lineWidth/2,Ar=_r[1]*this.lineWidth/2;gr[0]-=Ir,gr[1]-=Ar,gr[2]+=Ir,gr[3]+=Ar}return gr}updateClipFromPath(){const dr=je.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(dr||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(dr){this.clipBox=dr,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(dr=Me.PathType.FILL,ur=null){return je.Util.intersect(this.clipBox,this.getPathBoundingBox(dr,ur))}}function Qe(cr,dr){if(typeof ImageData<"u"&&dr instanceof ImageData){cr.putImageData(dr,0,0);return}const ur=dr.height,gr=dr.width,_r=ur%He,Ir=(ur-_r)/He,Ar=_r===0?Ir:Ir+1,Tr=cr.createImageData(gr,He);let Nr=0,Br;const Hr=dr.data,Vr=Tr.data;let mr,Sr,Lr,jr;if(dr.kind===je.ImageKind.GRAYSCALE_1BPP){const fr=Hr.byteLength,Cr=new Uint32Array(Vr.buffer,0,Vr.byteLength>>2),Mr=Cr.length,$r=gr+7>>3,Fr=4294967295,Kr=je.FeatureTest.isLittleEndian?4278190080:255;for(mr=0;mr<Ar;mr++){for(Lr=mr<Ir?He:_r,Br=0,Sr=0;Sr<Lr;Sr++){const an=fr-Nr;let Wr=0;const hn=an>$r?gr:an*8-7,cn=hn&-8;let tn=0,Qr=0;for(;Wr<cn;Wr+=8)Qr=Hr[Nr++],Cr[Br++]=Qr&128?Fr:Kr,Cr[Br++]=Qr&64?Fr:Kr,Cr[Br++]=Qr&32?Fr:Kr,Cr[Br++]=Qr&16?Fr:Kr,Cr[Br++]=Qr&8?Fr:Kr,Cr[Br++]=Qr&4?Fr:Kr,Cr[Br++]=Qr&2?Fr:Kr,Cr[Br++]=Qr&1?Fr:Kr;for(;Wr<hn;Wr++)tn===0&&(Qr=Hr[Nr++],tn=128),Cr[Br++]=Qr&tn?Fr:Kr,tn>>=1}for(;Br<Mr;)Cr[Br++]=0;cr.putImageData(Tr,0,mr*He)}}else if(dr.kind===je.ImageKind.RGBA_32BPP){for(Sr=0,jr=gr*He*4,mr=0;mr<Ir;
3988mr++)Vr.set(Hr.subarray(Nr,Nr+jr)),Nr+=jr,cr.putImageData(Tr,0,Sr),Sr+=He;mr<Ar&&(jr=gr*_r*4,Vr.set(Hr.subarray(Nr,Nr+jr)),cr.putImageData(Tr,0,Sr))}else if(dr.kind===je.ImageKind.RGB_24BPP)for(Lr=He,jr=gr*Lr,mr=0;mr<Ar;mr++){for(mr>=Ir&&(Lr=_r,jr=gr*Lr),Br=0,Sr=jr;Sr--;)Vr[Br++]=Hr[Nr++],Vr[Br++]=Hr[Nr++],Vr[Br++]=Hr[Nr++],Vr[Br++]=255;cr.putImageData(Tr,0,mr*He)}else throw new Error(`bad image kind: ${dr.kind}`)}function Ze(cr,dr){if(dr.bitmap){cr.drawImage(dr.bitmap,0,0);return}const ur=dr.height,gr=dr.width,_r=ur%He,Ir=(ur-_r)/He,Ar=_r===0?Ir:Ir+1,Tr=cr.createImageData(gr,He);let Nr=0;const Br=dr.data,Hr=Tr.data;for(let Vr=0;Vr<Ar;Vr++){const mr=Vr<Ir?He:_r;({srcPos:Nr}=(0,De.convertBlackAndWhiteToRGBA)({src:Br,srcPos:Nr,dest:Hr,width:gr,height:mr,nonBlackColor:0})),cr.putImageData(Tr,0,Vr*He)}}function Je(cr,dr){const ur=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const gr of ur)cr[gr]!==void 0&&(dr[gr]=cr[gr]);cr.setLineDash!==void 0&&(dr.setLineDash(cr.getLineDash()),dr.lineDashOffset=cr.lineDashOffset)}function ir(cr){if(cr.strokeStyle=cr.fillStyle="#000000",cr.fillRule="nonzero",cr.globalAlpha=1,cr.lineWidth=1,cr.lineCap="butt",cr.lineJoin="miter",cr.miterLimit=10,cr.globalCompositeOperation="source-over",cr.font="10px sans-serif",cr.setLineDash!==void 0&&(cr.setLineDash([]),cr.lineDashOffset=0),!je.isNodeJS){const{filter:dr}=cr;dr!=="none"&&dr!==""&&(cr.filter="none")}}function rr(cr,dr,ur,gr){const _r=cr.length;for(let Ir=3;Ir<_r;Ir+=4){const Ar=cr[Ir];if(Ar===0)cr[Ir-3]=dr,cr[Ir-2]=ur,cr[Ir-1]=gr;else if(Ar<255){const Tr=255-Ar;cr[Ir-3]=cr[Ir-3]*Ar+dr*Tr>>8,cr[Ir-2]=cr[Ir-2]*Ar+ur*Tr>>8,cr[Ir-1]=cr[Ir-1]*Ar+gr*Tr>>8}}}function ar(cr,dr,ur){const gr=cr.length,_r=1/255;for(let Ir=3;Ir<gr;Ir+=4){const Ar=ur?ur[cr[Ir]]:cr[Ir];dr[Ir]=dr[Ir]*Ar*_r|0}}function or(cr,dr,ur){const gr=cr.length;for(let _r=3;_r<gr;_r+=4){const Ir=cr[_r-3]*77+cr[_r-2]*152+cr[_r-1]*28;dr[_r]=ur?dr[_r]*ur[Ir>>8]>>8:dr[_r]*Ir>>16}}function pr(cr,dr,ur,gr,_r,Ir,Ar,Tr,Nr,Br,Hr){const Vr=!!Ir,mr=Vr?Ir[0]:0,Sr=Vr?Ir[1]:0,Lr=Vr?Ir[2]:0,jr=_r==="Luminosity"?or:ar,Cr=Math.min(gr,Math.ceil(1048576/ur));for(let Mr=0;Mr<gr;Mr+=Cr){const $r=Math.min(Cr,gr-Mr),Fr=cr.getImageData(Tr-Br,Mr+(Nr-Hr),ur,$r),Kr=dr.getImageData(Tr,Mr+Nr,ur,$r);Vr&&rr(Fr.data,mr,Sr,Lr),jr(Fr.data,Kr.data,Ar),dr.putImageData(Kr,Tr,Mr+Nr)}}function tr(cr,dr,ur,gr){const _r=gr[0],Ir=gr[1],Ar=gr[2]-_r,Tr=gr[3]-Ir;Ar===0||Tr===0||(pr(dr.context,ur,Ar,Tr,dr.subtype,dr.backdrop,dr.transferMap,_r,Ir,dr.offsetX,dr.offsetY),cr.save(),cr.globalAlpha=1,cr.globalCompositeOperation="source-over",cr.setTransform(1,0,0,1,0,0),cr.drawImage(ur.canvas,0,0),cr.restore())}function nr(cr,dr){const ur=je.Util.singularValueDecompose2dScale(cr);ur[0]=Math.fround(ur[0]),ur[1]=Math.fround(ur[1]);const gr=Math.fround((globalThis.devicePixelRatio||1)*Oe.PixelsPerInch.PDF_TO_CSS_UNITS);return dr!==void 0?dr:ur[0]<=gr||ur[1]<=gr}const hr=["butt","round","square"],sr=["miter","round","bevel"],xr={},Rr={},kr=class kr{constructor(dr,ur,gr,_r,Ir,{optionalContentConfig:Ar,markedContentStack:Tr=null},Nr,Br){Pn(this,wr);this.ctx=dr,this.current=new Ke(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=ur,this.objs=gr,this.canvasFactory=_r,this.filterFactory=Ir,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=Tr||[],this.optionalContentConfig=Ar,this.cachedCanvases=new Ge(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=Nr,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=Br,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(dr,ur=null){return typeof dr=="string"?dr.startsWith("g_")?this.commonObjs.get(dr):this.objs.get(dr):ur}beginDrawing({transform:dr,viewport:ur,transparency:gr=!1,background:_r=null}){const Ir=this.ctx.canvas.width,Ar=this.ctx.canvas.height,Tr=this.ctx.fillStyle;if(this.ctx.fillStyle=_r||"#ffffff",this.ctx.fillRect(0,0,Ir,Ar),this.ctx.fillStyle=Tr,gr){const Nr=this.cachedCanvases.getCanvas("transparent",Ir,Ar);this.compositeCtx=this.ctx,this.transparentCanvas=Nr.canvas,this.ctx=Nr.context,this.ctx.save(),this.ctx.transform(...(0,Oe.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),ir(this.ctx),dr&&(this.ctx.transform(...dr),this.outputScaleX=dr[0],this.outputScaleY=dr[0]),this.ctx.transform(...ur.transform),this.viewportScale=ur.scale,this.baseTransform=(0,Oe.getCurrentTransform)(this.ctx)}executeOperatorList(dr,ur,gr,_r){const Ir=dr.argsArray,Ar=dr.fnArray;let Tr=ur||0;const Nr=Ir.length;if(Nr===Tr)return Tr;const Br=Nr-Tr>We&&typeof gr=="function",Hr=Br?Date.now()+ze:0;let Vr=0;const mr=this.commonObjs,Sr=this.objs;let Lr;for(;;){if(_r!==void 0&&Tr===_r.nextBreakPoint)return _r.breakIt(Tr,gr),Tr;if(Lr=Ar[Tr],Lr!==je.OPS.dependency)this[Lr].apply(this,Ir[Tr]);else for(const jr of Ir[Tr]){const fr=jr.startsWith("g_")?mr:Sr;if(!fr.has(jr))return fr.get(jr,gr),Tr}if(Tr++,Tr===Nr)return Tr;if(Br&&++Vr>We){if(Date.now()>Hr)return gr(),Tr;Vr=0}}}endDrawing(){vn(this,wr,Ec).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const dr of this._cachedBitmapsMap.values()){for(const ur of dr.values())typeof HTMLCanvasElement<"u"&&ur instanceof HTMLCanvasElement&&(ur.width=ur.height=0);dr.clear()}this._cachedBitmapsMap.clear(),vn(this,wr,Cc).call(this)}_scaleImage(dr,ur){const gr=dr.width,_r=dr.height;let Ir=Math.max(Math.hypot(ur[0],ur[1]),1),Ar=Math.max(Math.hypot(ur[2],ur[3]),1),Tr=gr,Nr=_r,Br="prescale1",Hr,Vr;
3988for(;Ir>2&&Tr>1||Ar>2&&Nr>1;){let mr=Tr,Sr=Nr;Ir>2&&Tr>1&&(mr=Tr>=16384?Math.floor(Tr/2)-1||1:Math.ceil(Tr/2),Ir/=Tr/mr),Ar>2&&Nr>1&&(Sr=Nr>=16384?Math.floor(Nr/2)-1||1:Math.ceil(Nr)/2,Ar/=Nr/Sr),Hr=this.cachedCanvases.getCanvas(Br,mr,Sr),Vr=Hr.context,Vr.clearRect(0,0,mr,Sr),Vr.drawImage(dr,0,0,Tr,Nr,0,0,mr,Sr),dr=Hr.canvas,Tr=mr,Nr=Sr,Br=Br==="prescale1"?"prescale2":"prescale1"}return{img:dr,paintWidth:Tr,paintHeight:Nr}}_createMaskCanvas(dr){const ur=this.ctx,{width:gr,height:_r}=dr,Ir=this.current.fillColor,Ar=this.current.patternFill,Tr=(0,Oe.getCurrentTransform)(ur);let Nr,Br,Hr,Vr;if((dr.bitmap||dr.data)&&dr.count>1){const Wr=dr.bitmap||dr.data.buffer;Br=JSON.stringify(Ar?Tr:[Tr.slice(0,4),Ir]),Nr=this._cachedBitmapsMap.get(Wr),Nr||(Nr=new Map,this._cachedBitmapsMap.set(Wr,Nr));const hn=Nr.get(Br);if(hn&&!Ar){const cn=Math.round(Math.min(Tr[0],Tr[2])+Tr[4]),tn=Math.round(Math.min(Tr[1],Tr[3])+Tr[5]);return{canvas:hn,offsetX:cn,offsetY:tn}}Hr=hn}Hr||(Vr=this.cachedCanvases.getCanvas("maskCanvas",gr,_r),Ze(Vr.context,dr));let mr=je.Util.transform(Tr,[1/gr,0,0,-1/_r,0,0]);mr=je.Util.transform(mr,[1,0,0,1,0,-_r]);const Sr=je.Util.applyTransform([0,0],mr),Lr=je.Util.applyTransform([gr,_r],mr),jr=je.Util.normalizeRect([Sr[0],Sr[1],Lr[0],Lr[1]]),fr=Math.round(jr[2]-jr[0])||1,Cr=Math.round(jr[3]-jr[1])||1,Mr=this.cachedCanvases.getCanvas("fillCanvas",fr,Cr),$r=Mr.context,Fr=Math.min(Sr[0],Lr[0]),Kr=Math.min(Sr[1],Lr[1]);$r.translate(-Fr,-Kr),$r.transform(...mr),Hr||(Hr=this._scaleImage(Vr.canvas,(0,Oe.getCurrentTransformInverse)($r)),Hr=Hr.img,Nr&&Ar&&Nr.set(Br,Hr)),$r.imageSmoothingEnabled=nr((0,Oe.getCurrentTransform)($r),dr.interpolate),Ye($r,Hr,0,0,Hr.width,Hr.height,0,0,gr,_r),$r.globalCompositeOperation="source-in";const an=je.Util.transform((0,Oe.getCurrentTransformInverse)($r),[1,0,0,1,-Fr,-Kr]);return $r.fillStyle=Ar?Ir.getPattern(ur,this,an,Me.PathType.FILL):Ir,$r.fillRect(0,0,gr,_r),Nr&&!Ar&&(this.cachedCanvases.delete("fillCanvas"),Nr.set(Br,Mr.canvas)),{canvas:Mr.canvas,offsetX:Math.round(Fr),offsetY:Math.round(Kr)}}setLineWidth(dr){dr!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=dr,this.ctx.lineWidth=dr}setLineCap(dr){this.ctx.lineCap=hr[dr]}setLineJoin(dr){this.ctx.lineJoin=sr[dr]}setMiterLimit(dr){this.ctx.miterLimit=dr}setDash(dr,ur){const gr=this.ctx;gr.setLineDash!==void 0&&(gr.setLineDash(dr),gr.lineDashOffset=ur)}setRenderingIntent(dr){}setFlatness(dr){}setGState(dr){for(const[ur,gr]of dr)switch(ur){case"LW":this.setLineWidth(gr);break;case"LC":this.setLineCap(gr);break;case"LJ":this.setLineJoin(gr);break;case"ML":this.setMiterLimit(gr);break;case"D":this.setDash(gr[0],gr[1]);break;case"RI":this.setRenderingIntent(gr);break;case"FL":this.setFlatness(gr);break;case"Font":this.setFont(gr[0],gr[1]);break;case"CA":this.current.strokeAlpha=gr;break;case"ca":this.current.fillAlpha=gr,this.ctx.globalAlpha=gr;break;case"BM":this.ctx.globalCompositeOperation=gr;break;case"SMask":this.current.activeSMask=gr?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(gr);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const dr=this.inSMaskMode;this.current.activeSMask&&!dr?this.beginSMaskMode():!this.current.activeSMask&&dr&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const dr=this.ctx.canvas.width,ur=this.ctx.canvas.height,gr="smaskGroupAt"+this.groupLevel,_r=this.cachedCanvases.getCanvas(gr,dr,ur);this.suspendedCtx=this.ctx,this.ctx=_r.context;const Ir=this.ctx;Ir.setTransform(...(0,Oe.getCurrentTransform)(this.suspendedCtx)),Je(this.suspendedCtx,Ir),qe(Ir,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(),Je(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(dr){if(!this.current.activeSMask)return;dr?(dr[0]=Math.floor(dr[0]),dr[1]=Math.floor(dr[1]),dr[2]=Math.ceil(dr[2]),dr[3]=Math.ceil(dr[3])):dr=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const ur=this.current.activeSMask,gr=this.suspendedCtx;tr(gr,ur,this.ctx,dr),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(
3988)}save(){this.inSMaskMode?(Je(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const dr=this.current;this.stateStack.push(dr),this.current=dr.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Je(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(dr,ur,gr,_r,Ir,Ar){this.ctx.transform(dr,ur,gr,_r,Ir,Ar),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(dr,ur,gr){const _r=this.ctx,Ir=this.current;let Ar=Ir.x,Tr=Ir.y,Nr,Br;const Hr=(0,Oe.getCurrentTransform)(_r),Vr=Hr[0]===0&&Hr[3]===0||Hr[1]===0&&Hr[2]===0,mr=Vr?gr.slice(0):null;for(let Sr=0,Lr=0,jr=dr.length;Sr<jr;Sr++)switch(dr[Sr]|0){case je.OPS.rectangle:Ar=ur[Lr++],Tr=ur[Lr++];const fr=ur[Lr++],Cr=ur[Lr++],Mr=Ar+fr,$r=Tr+Cr;_r.moveTo(Ar,Tr),fr===0||Cr===0?_r.lineTo(Mr,$r):(_r.lineTo(Mr,Tr),_r.lineTo(Mr,$r),_r.lineTo(Ar,$r)),Vr||Ir.updateRectMinMax(Hr,[Ar,Tr,Mr,$r]),_r.closePath();break;case je.OPS.moveTo:Ar=ur[Lr++],Tr=ur[Lr++],_r.moveTo(Ar,Tr),Vr||Ir.updatePathMinMax(Hr,Ar,Tr);break;case je.OPS.lineTo:Ar=ur[Lr++],Tr=ur[Lr++],_r.lineTo(Ar,Tr),Vr||Ir.updatePathMinMax(Hr,Ar,Tr);break;case je.OPS.curveTo:Nr=Ar,Br=Tr,Ar=ur[Lr+4],Tr=ur[Lr+5],_r.bezierCurveTo(ur[Lr],ur[Lr+1],ur[Lr+2],ur[Lr+3],Ar,Tr),Ir.updateCurvePathMinMax(Hr,Nr,Br,ur[Lr],ur[Lr+1],ur[Lr+2],ur[Lr+3],Ar,Tr,mr),Lr+=6;break;case je.OPS.curveTo2:Nr=Ar,Br=Tr,_r.bezierCurveTo(Ar,Tr,ur[Lr],ur[Lr+1],ur[Lr+2],ur[Lr+3]),Ir.updateCurvePathMinMax(Hr,Nr,Br,Ar,Tr,ur[Lr],ur[Lr+1],ur[Lr+2],ur[Lr+3],mr),Ar=ur[Lr+2],Tr=ur[Lr+3],Lr+=4;break;case je.OPS.curveTo3:Nr=Ar,Br=Tr,Ar=ur[Lr+2],Tr=ur[Lr+3],_r.bezierCurveTo(ur[Lr],ur[Lr+1],Ar,Tr,Ar,Tr),Ir.updateCurvePathMinMax(Hr,Nr,Br,ur[Lr],ur[Lr+1],Ar,Tr,Ar,Tr,mr),Lr+=4;break;case je.OPS.closePath:_r.closePath();break}Vr&&Ir.updateScalingPathMinMax(Hr,mr),Ir.setCurrentPoint(Ar,Tr)}closePath(){this.ctx.closePath()}stroke(dr=!0){const ur=this.ctx,gr=this.current.strokeColor;ur.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof gr=="object"&&(gr!=null&&gr.getPattern)?(ur.save(),ur.strokeStyle=gr.getPattern(ur,this,(0,Oe.getCurrentTransformInverse)(ur),Me.PathType.STROKE),this.rescaleAndStroke(!1),ur.restore()):this.rescaleAndStroke(!0)),dr&&this.consumePath(this.current.getClippedPathBoundingBox()),ur.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(dr=!0){const ur=this.ctx,gr=this.current.fillColor,_r=this.current.patternFill;let Ir=!1;_r&&(ur.save(),ur.fillStyle=gr.getPattern(ur,this,(0,Oe.getCurrentTransformInverse)(ur),Me.PathType.FILL),Ir=!0);const Ar=this.current.getClippedPathBoundingBox();this.contentVisible&&Ar!==null&&(this.pendingEOFill?(ur.fill("evenodd"),this.pendingEOFill=!1):ur.fill()),Ir&&ur.restore(),dr&&this.consumePath(Ar)}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=xr}eoClip(){this.pendingClip=Rr}beginText(){this.current.textMatrix=je.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const dr=this.pendingTextPaths,ur=this.ctx;if(dr===void 0){ur.beginPath();return}ur.save(),ur.beginPath();for(const gr of dr)ur.setTransform(...gr.transform),ur.translate(gr.x,gr.y),gr.addToPath(ur,gr.fontSize);ur.restore(),ur.clip(),ur.beginPath(),delete this.pendingTextPaths}setCharSpacing(dr){this.current.charSpacing=dr}setWordSpacing(dr){this.current.wordSpacing=dr}setHScale(dr){this.current.textHScale=dr/100}setLeading(dr){this.current.leading=-dr}setFont(dr,ur){var Hr;const gr=this.commonObjs.get(dr),_r=this.current;if(!gr)throw new Error(`Can't find font for ${dr}`);
3988if(_r.fontMatrix=gr.fontMatrix||je.FONT_IDENTITY_MATRIX,(_r.fontMatrix[0]===0||_r.fontMatrix[3]===0)&&(0,je.warn)("Invalid font matrix for font "+dr),ur<0?(ur=-ur,_r.fontDirection=-1):_r.fontDirection=1,this.current.font=gr,this.current.fontSize=ur,gr.isType3Font)return;const Ir=gr.loadedName||"sans-serif",Ar=((Hr=gr.systemFontInfo)==null?void 0:Hr.css)||`"${Ir}", ${gr.fallbackName}`;let Tr="normal";gr.black?Tr="900":gr.bold&&(Tr="bold");const Nr=gr.italic?"italic":"normal";let Br=ur;ur<$e?Br=$e:ur>Be&&(Br=Be),this.current.fontSizeScale=ur/Br,this.ctx.font=`${Nr} ${Tr} ${Br}px ${Ar}`}setTextRenderingMode(dr){this.current.textRenderingMode=dr}setTextRise(dr){this.current.textRise=dr}moveText(dr,ur){this.current.x=this.current.lineX+=dr,this.current.y=this.current.lineY+=ur}setLeadingMoveText(dr,ur){this.setLeading(-ur),this.moveText(dr,ur)}setTextMatrix(dr,ur,gr,_r,Ir,Ar){this.current.textMatrix=[dr,ur,gr,_r,Ir,Ar],this.current.textMatrixScale=Math.hypot(dr,ur),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(dr,ur,gr,_r){const Ir=this.ctx,Ar=this.current,Tr=Ar.font,Nr=Ar.textRenderingMode,Br=Ar.fontSize/Ar.fontSizeScale,Hr=Nr&je.TextRenderingMode.FILL_STROKE_MASK,Vr=!!(Nr&je.TextRenderingMode.ADD_TO_PATH_FLAG),mr=Ar.patternFill&&!Tr.missingFile;let Sr;(Tr.disableFontFace||Vr||mr)&&(Sr=Tr.getPathGenerator(this.commonObjs,dr)),Tr.disableFontFace||mr?(Ir.save(),Ir.translate(ur,gr),Ir.beginPath(),Sr(Ir,Br),_r&&Ir.setTransform(..._r),(Hr===je.TextRenderingMode.FILL||Hr===je.TextRenderingMode.FILL_STROKE)&&Ir.fill(),(Hr===je.TextRenderingMode.STROKE||Hr===je.TextRenderingMode.FILL_STROKE)&&Ir.stroke(),Ir.restore()):((Hr===je.TextRenderingMode.FILL||Hr===je.TextRenderingMode.FILL_STROKE)&&Ir.fillText(dr,ur,gr),(Hr===je.TextRenderingMode.STROKE||Hr===je.TextRenderingMode.FILL_STROKE)&&Ir.strokeText(dr,ur,gr)),Vr&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,Oe.getCurrentTransform)(Ir),x:ur,y:gr,fontSize:Br,addToPath:Sr})}get isFontSubpixelAAEnabled(){const{context:dr}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);dr.scale(1.5,1),dr.fillText("I",0,10);const ur=dr.getImageData(0,0,10,10).data;let gr=!1;for(let _r=3;_r<ur.length;_r+=4)if(ur[_r]>0&&ur[_r]<255){gr=!0;break}return(0,je.shadow)(this,"isFontSubpixelAAEnabled",gr)}showText(dr){const ur=this.current,gr=ur.font;if(gr.isType3Font)return this.showType3Text(dr);const _r=ur.fontSize;if(_r===0)return;const Ir=this.ctx,Ar=ur.fontSizeScale,Tr=ur.charSpacing,Nr=ur.wordSpacing,Br=ur.fontDirection,Hr=ur.textHScale*Br,Vr=dr.length,mr=gr.vertical,Sr=mr?1:-1,Lr=gr.defaultVMetrics,jr=_r*ur.fontMatrix[0],fr=ur.textRenderingMode===je.TextRenderingMode.FILL&&!gr.disableFontFace&&!ur.patternFill;Ir.save(),Ir.transform(...ur.textMatrix),Ir.translate(ur.x,ur.y+ur.textRise),Br>0?Ir.scale(Hr,-1):Ir.scale(Hr,1);let Cr;if(ur.patternFill){Ir.save();const an=ur.fillColor.getPattern(Ir,this,(0,Oe.getCurrentTransformInverse)(Ir),Me.PathType.FILL);Cr=(0,Oe.getCurrentTransform)(Ir),Ir.restore(),Ir.fillStyle=an}let Mr=ur.lineWidth;const $r=ur.textMatrixScale;if($r===0||Mr===0){const an=ur.textRenderingMode&je.TextRenderingMode.FILL_STROKE_MASK;(an===je.TextRenderingMode.STROKE||an===je.TextRenderingMode.FILL_STROKE)&&(Mr=this.getSinglePixelWidth())}else Mr/=$r;if(Ar!==1&&(Ir.scale(Ar,Ar),Mr/=Ar),Ir.lineWidth=Mr,gr.isInvalidPDFjsFont){const an=[];let Wr=0;for(const hn of dr)an.push(hn.unicode),Wr+=hn.width;Ir.fillText(an.join(""),0,0),ur.x+=Wr*jr*Hr,Ir.restore(),this.compose();return}let Fr=0,Kr;for(Kr=0;Kr<Vr;++Kr){const an=dr[Kr];if(typeof an=="number"){Fr+=Sr*an*_r/1e3;continue}let Wr=!1;const hn=(an.isSpace?Nr:0)+Tr,cn=an.fontChar,tn=an.accent;let Qr,wn,gn=an.width;if(mr){const yn=an.vmetric||Lr,Mn=-(an.vmetric?yn[1]:gn*.5)*jr,on=yn[2]*jr;gn=yn?-yn[0]:gn,Qr=Mn/Ar,wn=(Fr+on)/Ar}else Qr=Fr/Ar,wn=0;if(gr.remeasure&&gn>0){const yn=Ir.measureText(cn).width*1e3/_r*Ar;if(gn<yn&&this.isFontSubpixelAAEnabled){const Mn=gn/yn;Wr=!0,Ir.save(),Ir.scale(Mn,1),Qr/=Mn}else gn!==yn&&(Qr+=(gn-yn)/2e3*_r/Ar)}if(this.contentVisible&&(an.isInFont||gr.missingFile)){if(fr&&!tn)Ir.fillText(cn,Qr,wn);else if(this.paintChar(cn,Qr,wn,Cr),tn){const yn=Qr+_r*tn.offset.x/Ar,Mn=wn-_r*tn.offset.y/Ar;this.paintChar(tn.fontChar,yn,Mn,Cr)}}const In=mr?gn*jr-hn*Br:gn*jr+hn*Br;
3988Fr+=In,Wr&&Ir.restore()}mr?ur.y-=Fr:ur.x+=Fr*Hr,Ir.restore(),this.compose()}showType3Text(dr){const ur=this.ctx,gr=this.current,_r=gr.font,Ir=gr.fontSize,Ar=gr.fontDirection,Tr=_r.vertical?1:-1,Nr=gr.charSpacing,Br=gr.wordSpacing,Hr=gr.textHScale*Ar,Vr=gr.fontMatrix||je.FONT_IDENTITY_MATRIX,mr=dr.length,Sr=gr.textRenderingMode===je.TextRenderingMode.INVISIBLE;let Lr,jr,fr,Cr;if(!(Sr||Ir===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,ur.save(),ur.transform(...gr.textMatrix),ur.translate(gr.x,gr.y),ur.scale(Hr,Ar),Lr=0;Lr<mr;++Lr){if(jr=dr[Lr],typeof jr=="number"){Cr=Tr*jr*Ir/1e3,this.ctx.translate(Cr,0),gr.x+=Cr*Hr;continue}const Mr=(jr.isSpace?Br:0)+Nr,$r=_r.charProcOperatorList[jr.operatorListId];if(!$r){(0,je.warn)(`Type3 character "${jr.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=jr,this.save(),ur.scale(Ir,Ir),ur.transform(...Vr),this.executeOperatorList($r),this.restore()),fr=je.Util.applyTransform([jr.width,0],Vr)[0]*Ir+Mr,ur.translate(fr,0),gr.x+=fr*Hr}ur.restore(),this.processingType3=null}}setCharWidth(dr,ur){}setCharWidthAndBounds(dr,ur,gr,_r,Ir,Ar){this.ctx.rect(gr,_r,Ir-gr,Ar-_r),this.ctx.clip(),this.endPath()}getColorN_Pattern(dr){let ur;if(dr[0]==="TilingPattern"){const gr=dr[1],_r=this.baseTransform||(0,Oe.getCurrentTransform)(this.ctx),Ir={createCanvasGraphics:Ar=>new kr(Ar,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};ur=new Me.TilingPattern(dr,gr,this.ctx,Ir,_r)}else ur=this._getPattern(dr[1],dr[2]);return ur}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(dr,ur,gr){const _r=je.Util.makeHexColor(dr,ur,gr);this.ctx.strokeStyle=_r,this.current.strokeColor=_r}setFillRGBColor(dr,ur,gr){const _r=je.Util.makeHexColor(dr,ur,gr);this.ctx.fillStyle=_r,this.current.fillColor=_r,this.current.patternFill=!1}_getPattern(dr,ur=null){let gr;return this.cachedPatterns.has(dr)?gr=this.cachedPatterns.get(dr):(gr=(0,Me.getShadingPattern)(this.getObject(dr)),this.cachedPatterns.set(dr,gr)),ur&&(gr.matrix=ur),gr}shadingFill(dr){if(!this.contentVisible)return;const ur=this.ctx;this.save();const gr=this._getPattern(dr);ur.fillStyle=gr.getPattern(ur,this,(0,Oe.getCurrentTransformInverse)(ur),Me.PathType.SHADING);const _r=(0,Oe.getCurrentTransformInverse)(ur);if(_r){const{width:Ir,height:Ar}=ur.canvas,[Tr,Nr,Br,Hr]=je.Util.getAxialAlignedBoundingBox([0,0,Ir,Ar],_r);this.ctx.fillRect(Tr,Nr,Br-Tr,Hr-Nr)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,je.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,je.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(dr,ur){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(dr)&&dr.length===6&&this.transform(...dr),this.baseTransform=(0,Oe.getCurrentTransform)(this.ctx),ur)){const gr=ur[2]-ur[0],_r=ur[3]-ur[1];this.ctx.rect(ur[0],ur[1],gr,_r),this.current.updateRectMinMax((0,Oe.getCurrentTransform)(this.ctx),ur),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(dr){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const ur=this.ctx;dr.isolated||(0,je.info)("TODO: Support non-isolated groups."),dr.knockout&&(0,je.warn)("Knockout groups not supported.");const gr=(0,Oe.getCurrentTransform)(ur);if(dr.matrix&&ur.transform(...dr.matrix),!dr.bbox)throw new Error("Bounding box is required.");let _r=je.Util.getAxialAlignedBoundingBox(dr.bbox,(0,Oe.getCurrentTransform)(ur));const Ir=[0,0,ur.canvas.width,ur.canvas.height];_r=je.Util.intersect(_r,Ir)||[0,0,0,0];const Ar=Math.floor(_r[0]),Tr=Math.floor(_r[1]);let Nr=Math.max(Math.ceil(_r[2])-Ar,1),Br=Math.max(Math.ceil(_r[3])-Tr,1),Hr=1,Vr=1;Nr>Ue&&(Hr=Nr/Ue,Nr=Ue),Br>Ue&&(Vr=Br/Ue,Br=Ue),this.current.startNewPathAndClipBox([0,0,Nr,Br]);let mr="groupAt"+this.groupLevel;dr.smask&&(mr+="_smask_"+this.smaskCounter++%2);const Sr=this.cachedCanvases.getCanvas(mr,Nr,Br),Lr=Sr.context;Lr.scale(1/Hr,1/Vr),Lr.translate(-Ar,-Tr),Lr.transform(...gr),dr.smask?this.smaskStack.push({canvas:Sr.canvas,context:Lr,offsetX:Ar,offsetY:Tr,scaleX:Hr,scaleY:Vr,subtype:dr.smask.subtype,backdrop:dr.smask.backdrop,transferMap:dr.smask.transferMap||null,startTransformInverse:null}):(ur.setTransform(1,0,0,1,0,0),ur.translate(Ar,Tr),ur.scale(Hr,Vr),ur.save()),Je(ur,Lr),this.ctx=Lr,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(ur),this.groupLevel++}endGroup(dr){if(!this.contentVisible)return;this.groupLevel--;const ur=this.ctx,gr=this.groupStack.pop();if(this.ctx=gr,this.ctx.imageSmoothingEnabled=!1,dr.smask)this.tempSMask=this.smaskStack.pop(),this.restore(
3988);else{this.ctx.restore();const _r=(0,Oe.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(..._r);const Ir=je.Util.getAxialAlignedBoundingBox([0,0,ur.canvas.width,ur.canvas.height],_r);this.ctx.drawImage(ur.canvas,0,0),this.ctx.restore(),this.compose(Ir)}}beginAnnotation(dr,ur,gr,_r,Ir){if(vn(this,wr,Ec).call(this),ir(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(ur)&&ur.length===4){const Ar=ur[2]-ur[0],Tr=ur[3]-ur[1];if(Ir&&this.annotationCanvasMap){gr=gr.slice(),gr[4]-=ur[0],gr[5]-=ur[1],ur=ur.slice(),ur[0]=ur[1]=0,ur[2]=Ar,ur[3]=Tr;const[Nr,Br]=je.Util.singularValueDecompose2dScale((0,Oe.getCurrentTransform)(this.ctx)),{viewportScale:Hr}=this,Vr=Math.ceil(Ar*this.outputScaleX*Hr),mr=Math.ceil(Tr*this.outputScaleY*Hr);this.annotationCanvas=this.canvasFactory.create(Vr,mr);const{canvas:Sr,context:Lr}=this.annotationCanvas;this.annotationCanvasMap.set(dr,Sr),this.annotationCanvas.savedCtx=this.ctx,this.ctx=Lr,this.ctx.save(),this.ctx.setTransform(Nr,0,0,-Br,0,Tr*Br),ir(this.ctx)}else ir(this.ctx),this.ctx.rect(ur[0],ur[1],Ar,Tr),this.ctx.clip(),this.endPath()}this.current=new Ke(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...gr),this.transform(..._r)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),vn(this,wr,Cc).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(dr){if(!this.contentVisible)return;const ur=dr.count;dr=this.getObject(dr.data,dr),dr.count=ur;const gr=this.ctx,_r=this.processingType3;if(_r&&(_r.compiled===void 0&&(_r.compiled=Ve(dr)),_r.compiled)){_r.compiled(gr);return}const Ir=this._createMaskCanvas(dr),Ar=Ir.canvas;gr.save(),gr.setTransform(1,0,0,1,0,0),gr.drawImage(Ar,Ir.offsetX,Ir.offsetY),gr.restore(),this.compose()}paintImageMaskXObjectRepeat(dr,ur,gr=0,_r=0,Ir,Ar){if(!this.contentVisible)return;dr=this.getObject(dr.data,dr);const Tr=this.ctx;Tr.save();const Nr=(0,Oe.getCurrentTransform)(Tr);Tr.transform(ur,gr,_r,Ir,0,0);const Br=this._createMaskCanvas(dr);Tr.setTransform(1,0,0,1,Br.offsetX-Nr[4],Br.offsetY-Nr[5]);for(let Hr=0,Vr=Ar.length;Hr<Vr;Hr+=2){const mr=je.Util.transform(Nr,[ur,gr,_r,Ir,Ar[Hr],Ar[Hr+1]]),[Sr,Lr]=je.Util.applyTransform([0,0],mr);Tr.drawImage(Br.canvas,Sr,Lr)}Tr.restore(),this.compose()}paintImageMaskXObjectGroup(dr){if(!this.contentVisible)return;const ur=this.ctx,gr=this.current.fillColor,_r=this.current.patternFill;for(const Ir of dr){const{data:Ar,width:Tr,height:Nr,transform:Br}=Ir,Hr=this.cachedCanvases.getCanvas("maskCanvas",Tr,Nr),Vr=Hr.context;Vr.save();const mr=this.getObject(Ar,Ir);Ze(Vr,mr),Vr.globalCompositeOperation="source-in",Vr.fillStyle=_r?gr.getPattern(Vr,this,(0,Oe.getCurrentTransformInverse)(ur),Me.PathType.FILL):gr,Vr.fillRect(0,0,Tr,Nr),Vr.restore(),ur.save(),ur.transform(...Br),ur.scale(1,-1),Ye(ur,Hr.canvas,0,0,Tr,Nr,0,-1,1,1),ur.restore()}this.compose()}paintImageXObject(dr){if(!this.contentVisible)return;const ur=this.getObject(dr);if(!ur){(0,je.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(ur)}paintImageXObjectRepeat(dr,ur,gr,_r){if(!this.contentVisible)return;const Ir=this.getObject(dr);if(!Ir){(0,je.warn)("Dependent image isn't ready yet");return}const Ar=Ir.width,Tr=Ir.height,Nr=[];for(let Br=0,Hr=_r.length;Br<Hr;Br+=2)Nr.push({transform:[ur,0,0,gr,_r[Br],_r[Br+1]],x:0,y:0,w:Ar,h:Tr});this.paintInlineImageXObjectGroup(Ir,Nr)}applyTransferMapsToCanvas(dr){return this.current.transferMaps!=="none"&&(dr.filter=this.current.transferMaps,dr.drawImage(dr.canvas,0,0),dr.filter="none"),dr.canvas}applyTransferMapsToBitmap(dr){if(this.current.transferMaps==="none")return dr.bitmap;const{bitmap:ur,width:gr,height:_r}=dr,Ir=this.cachedCanvases.getCanvas("inlineImage",gr,_r),Ar=Ir.context;return Ar.filter=this.current.transferMaps,Ar.drawImage(ur,0,0),Ar.filter="none",Ir.canvas}paintInlineImageXObject(dr){if(!this.contentVisible)return;const ur=dr.width,gr=dr.height,_r=this.ctx;if(this.save(),!je.isNodeJS){const{filter:Tr}=_r;Tr!=="none"&&Tr!==""&&(_r.filter="none")}_r.scale(1/ur,-1/gr);let Ir;if(dr.bitmap)Ir=this.applyTransferMapsToBitmap(dr);else if(typeof HTMLElement=="function"&&dr instanceof HTMLElement||!dr.data)Ir=dr;else{const Nr=this.cachedCanvases.getCanvas("inlineImage",ur,gr).context;Qe(Nr,dr),Ir=this.applyTransferMapsToCanvas(Nr)}const Ar=this._scaleImage(Ir,(0,Oe.getCurrentTransformInverse)(_r));_r.imageSmoothingEnabled=nr((0,Oe.getCurrentTransform)(_r),dr.interpolate),Ye(_r,Ar.img,0,0,Ar.paintWidth,Ar.paintHeight,0,-gr,ur,gr),this.compose(),this.restore(
3988)}paintInlineImageXObjectGroup(dr,ur){if(!this.contentVisible)return;const gr=this.ctx;let _r;if(dr.bitmap)_r=dr.bitmap;else{const Ir=dr.width,Ar=dr.height,Nr=this.cachedCanvases.getCanvas("inlineImage",Ir,Ar).context;Qe(Nr,dr),_r=this.applyTransferMapsToCanvas(Nr)}for(const Ir of ur)gr.save(),gr.transform(...Ir.transform),gr.scale(1,-1),Ye(gr,_r,Ir.x,Ir.y,Ir.w,Ir.h,0,-1,1,1),gr.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(dr){}markPointProps(dr,ur){}beginMarkedContent(dr){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(dr,ur){dr==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(ur)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(dr){const ur=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(dr);const gr=this.ctx;this.pendingClip&&(ur||(this.pendingClip===Rr?gr.clip("evenodd"):gr.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),gr.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const dr=(0,Oe.getCurrentTransform)(this.ctx);if(dr[1]===0&&dr[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(dr[0]),Math.abs(dr[3]));else{const ur=Math.abs(dr[0]*dr[3]-dr[2]*dr[1]),gr=Math.hypot(dr[0],dr[2]),_r=Math.hypot(dr[1],dr[3]);this._cachedGetSinglePixelWidth=Math.max(gr,_r)/ur}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:dr}=this.current,{a:ur,b:gr,c:_r,d:Ir}=this.ctx.getTransform();let Ar,Tr;if(gr===0&&_r===0){const Nr=Math.abs(ur),Br=Math.abs(Ir);if(Nr===Br)if(dr===0)Ar=Tr=1/Nr;else{const Hr=Nr*dr;Ar=Tr=Hr<1?1/Hr:1}else if(dr===0)Ar=1/Nr,Tr=1/Br;else{const Hr=Nr*dr,Vr=Br*dr;Ar=Hr<1?1/Hr:1,Tr=Vr<1?1/Vr:1}}else{const Nr=Math.abs(ur*Ir-gr*_r),Br=Math.hypot(ur,gr),Hr=Math.hypot(_r,Ir);if(dr===0)Ar=Hr/Nr,Tr=Br/Nr;else{const Vr=dr*Nr;Ar=Hr>Vr?Hr/Vr:1,Tr=Br>Vr?Br/Vr:1}}this._cachedScaleForStroking[0]=Ar,this._cachedScaleForStroking[1]=Tr}return this._cachedScaleForStroking}rescaleAndStroke(dr){const{ctx:ur}=this,{lineWidth:gr}=this.current,[_r,Ir]=this.getScaleForStroking();if(ur.lineWidth=gr||1,_r===1&&Ir===1){ur.stroke();return}const Ar=ur.getLineDash();if(dr&&ur.save(),ur.scale(_r,Ir),Ar.length>0){const Tr=Math.max(_r,Ir);ur.setLineDash(Ar.map(Nr=>Nr/Tr)),ur.lineDashOffset/=Tr}ur.stroke(),dr&&ur.restore()}isContentVisible(){for(let dr=this.markedContentStack.length-1;dr>=0;dr--)if(!this.markedContentStack[dr].visible)return!1;return!0}};wr=new WeakSet,Ec=function(){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)},Cc=function(){if(this.pageColors){const dr=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(dr!=="none"){const ur=this.ctx.filter;this.ctx.filter=dr,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=ur}}};let br=kr;Re.CanvasGraphics=br;for(const cr in je.OPS)br.prototype[cr]!==void 0&&(br.prototype[je.OPS[cr]]=br.prototype[cr])},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.TilingPattern=Re.PathType=void 0,Re.getShadingPattern=He;var je=Te(1),Oe=Te(6);const Me={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};Re.PathType=Me;function De(Ve,Ke){if(!Ke)return;const Qe=Ke[2]-Ke[0],Ze=Ke[3]-Ke[1],Je=new Path2D;Je.rect(Ke[0],Ke[1],Qe,Ze),Ve.clip(Je)}class $e{constructor(){this.constructor===$e&&(0,je.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,je.unreachable)("Abstract method `getPattern` called.")}}class Be extends $e{constructor(Ke){super(),this._type=Ke[1],this._bbox=Ke[2],this._colorStops=Ke[3],this._p0=Ke[4],this._p1=Ke[5],this._r0=Ke[6],this._r1=Ke[7],this.matrix=null}_createGradient(Ke){let Qe;this._type==="axial"?Qe=Ke.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(Qe=Ke.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const Ze of this._colorStops)Qe.addColorStop(Ze[0],Ze[1]);return Qe}getPattern(Ke,Qe,Ze,Je){let ir;if(Je===Me.STROKE||Je===Me.FILL){const rr=Qe.current.getClippedPathBoundingBox(Je,(0,Oe.getCurrentTransform)(Ke))||[0,0,0,0],ar=Math.ceil(rr[2]-rr[0])||1,or=Math.ceil(rr[3]-rr[1])||1,pr=Qe.cachedCanvases.getCanvas("pattern",ar,or,!0),tr=pr.context;tr.clearRect(0,0,tr.canvas.width,tr.canvas.height),tr.beginPath(),tr.rect(0,0,tr.canvas.width,tr.canvas.height),tr.translate(-rr[0],-rr[1]),Ze=je.Util.transform(Ze,[1,0,0,1,rr[0],rr[1]]),tr.transform(...Qe.baseTransform),this.matrix&&tr.transform(...this.matrix
vendor: 4,373 bytes, line 3988
3988),De(tr,this._bbox),tr.fillStyle=this._createGradient(tr),tr.fill(),ir=Ke.createPattern(pr.canvas,"no-repeat");const nr=new DOMMatrix(Ze);ir.setTransform(nr)}else De(Ke,this._bbox),ir=this._createGradient(Ke);return ir}}function Ue(Ve,Ke,Qe,Ze,Je,ir,rr,ar){const or=Ke.coords,pr=Ke.colors,tr=Ve.data,nr=Ve.width*4;let hr;or[Qe+1]>or[Ze+1]&&(hr=Qe,Qe=Ze,Ze=hr,hr=ir,ir=rr,rr=hr),or[Ze+1]>or[Je+1]&&(hr=Ze,Ze=Je,Je=hr,hr=rr,rr=ar,ar=hr),or[Qe+1]>or[Ze+1]&&(hr=Qe,Qe=Ze,Ze=hr,hr=ir,ir=rr,rr=hr);const sr=(or[Qe]+Ke.offsetX)*Ke.scaleX,xr=(or[Qe+1]+Ke.offsetY)*Ke.scaleY,Rr=(or[Ze]+Ke.offsetX)*Ke.scaleX,br=(or[Ze+1]+Ke.offsetY)*Ke.scaleY,wr=(or[Je]+Ke.offsetX)*Ke.scaleX,vr=(or[Je+1]+Ke.offsetY)*Ke.scaleY;if(xr>=vr)return;const Dr=pr[ir],kr=pr[ir+1],cr=pr[ir+2],dr=pr[rr],ur=pr[rr+1],gr=pr[rr+2],_r=pr[ar],Ir=pr[ar+1],Ar=pr[ar+2],Tr=Math.round(xr),Nr=Math.round(vr);let Br,Hr,Vr,mr,Sr,Lr,jr,fr;for(let Cr=Tr;Cr<=Nr;Cr++){if(Cr<br){const an=Cr<xr?0:(xr-Cr)/(xr-br);Br=sr-(sr-Rr)*an,Hr=Dr-(Dr-dr)*an,Vr=kr-(kr-ur)*an,mr=cr-(cr-gr)*an}else{let an;Cr>vr?an=1:br===vr?an=0:an=(br-Cr)/(br-vr),Br=Rr-(Rr-wr)*an,Hr=dr-(dr-_r)*an,Vr=ur-(ur-Ir)*an,mr=gr-(gr-Ar)*an}let Mr;Cr<xr?Mr=0:Cr>vr?Mr=1:Mr=(xr-Cr)/(xr-vr),Sr=sr-(sr-wr)*Mr,Lr=Dr-(Dr-_r)*Mr,jr=kr-(kr-Ir)*Mr,fr=cr-(cr-Ar)*Mr;const $r=Math.round(Math.min(Br,Sr)),Fr=Math.round(Math.max(Br,Sr));let Kr=nr*Cr+$r*4;for(let an=$r;an<=Fr;an++)Mr=(Br-an)/(Br-Sr),Mr<0?Mr=0:Mr>1&&(Mr=1),tr[Kr++]=Hr-(Hr-Lr)*Mr|0,tr[Kr++]=Vr-(Vr-jr)*Mr|0,tr[Kr++]=mr-(mr-fr)*Mr|0,tr[Kr++]=255}}function ze(Ve,Ke,Qe){const Ze=Ke.coords,Je=Ke.colors;let ir,rr;switch(Ke.type){case"lattice":const ar=Ke.verticesPerRow,or=Math.floor(Ze.length/ar)-1,pr=ar-1;for(ir=0;ir<or;ir++){let tr=ir*ar;for(let nr=0;nr<pr;nr++,tr++)Ue(Ve,Qe,Ze[tr],Ze[tr+1],Ze[tr+ar],Je[tr],Je[tr+1],Je[tr+ar]),Ue(Ve,Qe,Ze[tr+ar+1],Ze[tr+1],Ze[tr+ar],Je[tr+ar+1],Je[tr+1],Je[tr+ar])}break;case"triangles":for(ir=0,rr=Ze.length;ir<rr;ir+=3)Ue(Ve,Qe,Ze[ir],Ze[ir+1],Ze[ir+2],Je[ir],Je[ir+1],Je[ir+2]);break;default:throw new Error("illegal figure")}}class We extends $e{constructor(Ke){super(),this._coords=Ke[2],this._colors=Ke[3],this._figures=Ke[4],this._bounds=Ke[5],this._bbox=Ke[7],this._background=Ke[8],this.matrix=null}_createMeshCanvas(Ke,Qe,Ze){const ar=Math.floor(this._bounds[0]),or=Math.floor(this._bounds[1]),pr=Math.ceil(this._bounds[2])-ar,tr=Math.ceil(this._bounds[3])-or,nr=Math.min(Math.ceil(Math.abs(pr*Ke[0]*1.1)),3e3),hr=Math.min(Math.ceil(Math.abs(tr*Ke[1]*1.1)),3e3),sr=pr/nr,xr=tr/hr,Rr={coords:this._coords,colors:this._colors,offsetX:-ar,offsetY:-or,scaleX:1/sr,scaleY:1/xr},br=nr+2*2,wr=hr+2*2,vr=Ze.getCanvas("mesh",br,wr,!1),Dr=vr.context,kr=Dr.createImageData(nr,hr);if(Qe){const dr=kr.data;for(let ur=0,gr=dr.length;ur<gr;ur+=4)dr[ur]=Qe[0],dr[ur+1]=Qe[1],dr[ur+2]=Qe[2],dr[ur+3]=255}for(const dr of this._figures)ze(kr,dr,Rr);return Dr.putImageData(kr,2,2),{canvas:vr.canvas,offsetX:ar-2*sr,offsetY:or-2*xr,scaleX:sr,scaleY:xr}}getPattern(Ke,Qe,Ze,Je){De(Ke,this._bbox);let ir;if(Je===Me.SHADING)ir=je.Util.singularValueDecompose2dScale((0,Oe.getCurrentTransform)(Ke));else if(ir=je.Util.singularValueDecompose2dScale(Qe.baseTransform),this.matrix){const ar=je.Util.singularValueDecompose2dScale(this.matrix);ir=[ir[0]*ar[0],ir[1]*ar[1]]}const rr=this._createMeshCanvas(ir,Je===Me.SHADING?null:this._background,Qe.cachedCanvases);return Je!==Me.SHADING&&(Ke.setTransform(...Qe.baseTransform),this.matrix&&Ke.transform(...this.matrix)),Ke.translate(rr.offsetX,rr.offsetY),Ke.scale(rr.scaleX,rr.scaleY),Ke.createPattern(rr.canvas,"no-repeat")}}class Xe extends $e{getPattern(){return"hotpink"}}function He(Ve){switch(Ve[0]){case"RadialAxial":return new Be(Ve);case"Mesh":return new We(Ve);case"Dummy":return new Xe}throw new Error(`Unknown IR type: ${Ve[0]}`)}const qe={COLORED:1,UNCOLORED:2},Ye=class Ye{constructor(Ke,Qe,Ze,Je,ir){this.operatorList=Ke[2],this.matrix=Ke[3]||[1,0,0,1,0,0],this.bbox=Ke[4],this.xstep=Ke[5],this.ystep=Ke[6],this.paintType=Ke[7],this.tilingType=Ke[8],this.color=Qe,this.ctx=Ze,this.canvasGraphicsFactory=Je,this.baseTransform=ir}createPatternCanvas(Ke){const Qe=this.operatorList,Ze=this.bbox,Je=this.xstep,ir=this.ystep,rr=this.paintType,ar=this.tilingType,or=this.color,pr=this.canvasGraphicsFactory;(0,je.info)("TilingType: "+ar);const tr=Ze[0],nr=Ze[1],hr=Ze[2],sr=Ze[3],xr=je.Util.singularValueDecompose2dScale(this.matrix
3988),Rr=je.Util.singularValueDecompose2dScale(this.baseTransform),br=[xr[0]*Rr[0],xr[1]*Rr[1]],wr=this.getSizeAndScale(Je,this.ctx.canvas.width,br[0]),vr=this.getSizeAndScale(ir,this.ctx.canvas.height,br[1]),Dr=Ke.cachedCanvases.getCanvas("pattern",wr.size,vr.size,!0),kr=Dr.context,cr=pr.createCanvasGraphics(kr);cr.groupLevel=Ke.groupLevel,this.setFillAndStrokeStyleToContext(cr,rr,or);let dr=tr,ur=nr,gr=hr,_r=sr;return tr<0&&(dr=0,gr+=Math.abs(tr)),nr<0&&(ur=0,_r+=Math.abs(nr)),kr.translate(-(wr.scale*dr),-(vr.scale*ur)),cr.transform(wr.scale,0,0,vr.scale,0,0),kr.save(),this.clipBbox(cr,dr,ur,gr,_r),cr.baseTransform=(0,Oe.getCurrentTransform)(cr.ctx),cr.executeOperatorList(Qe),cr.endDrawing(),{canvas:Dr.canvas,scaleX:wr.scale,scaleY:vr.scale,offsetX:dr,offsetY:ur}}getSizeAndScale(Ke,Qe,Ze){Ke=Math.abs(Ke);const Je=Math.max(Ye.MAX_PATTERN_SIZE,Qe);let ir=Math.ceil(Ke*Ze);return ir>=Je?ir=Je:Ze=ir/Ke,{scale:Ze,size:ir}}clipBbox(Ke,Qe,Ze,Je,ir){const rr=Je-Qe,ar=ir-Ze;Ke.ctx.rect(Qe,Ze,rr,ar),Ke.current.updateRectMinMax((0,Oe.getCurrentTransform)(Ke.ctx),[Qe,Ze,Je,ir]),Ke.clip(),Ke.endPath()}setFillAndStrokeStyleToContext(Ke,Qe,Ze){const Je=Ke.ctx,ir=Ke.current;switch(Qe){case qe.COLORED:const rr=this.ctx;Je.fillStyle=rr.fillStyle,Je.strokeStyle=rr.strokeStyle,ir.fillColor=rr.fillStyle,ir.strokeColor=rr.strokeStyle;break;case qe.UNCOLORED:const ar=je.Util.makeHexColor(Ze[0],Ze[1],Ze[2]);Je.fillStyle=ar,Je.strokeStyle=ar,ir.fillColor=ar,ir.strokeColor=ar;break;default:throw new je.FormatError(`Unsupported paint type: ${Qe}`)}}getPattern(Ke,Qe,Ze,Je){let ir=Ze;Je!==Me.SHADING&&(ir=je.Util.transform(ir,Qe.baseTransform),this.matrix&&(ir=je.Util.transform(ir,this.matrix)));const rr=this.createPatternCanvas(Qe);let ar=new DOMMatrix(ir);ar=ar.translate(rr.offsetX,rr.offsetY),ar=ar.scale(1/rr.scaleX,1/rr.scaleY);const or=Ke.createPattern(rr.canvas,"repeat");return or.setTransform(ar),or}};Es(Ye,"MAX_PATTERN_SIZE",3e3);let Ge=Ye;Re.TilingPattern=Ge},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.convertBlackAndWhiteToRGBA=Me,Re.convertToRGBA=Oe,Re.grayToRGBA=$e;var je=Te(1);function Oe(Be){switch(Be.kind){case je.ImageKind.GRAYSCALE_1BPP:return Me(Be);case je.ImageKind.RGB_24BPP:return De(Be)}return null}function Me({src:Be,srcPos:Ue=0,dest:ze,width:We,height:Xe,nonBlackColor:He=4294967295,inverseDecode:qe=!1}){const Ge=je.FeatureTest.isLittleEndian?4278190080:255,[Ye,Ve]=qe?[He,Ge]:[Ge,He],Ke=We>>3,Qe=We&7,Ze=Be.length;ze=new Uint32Array(ze.buffer);let Je=0;for(let ir=0;ir<Xe;ir++){for(const ar=Ue+Ke;Ue<ar;Ue++){const or=Ue<Ze?Be[Ue]:255;ze[Je++]=or&128?Ve:Ye,ze[Je++]=or&64?Ve:Ye,ze[Je++]=or&32?Ve:Ye,ze[Je++]=or&16?Ve:Ye,ze[Je++]=or&8?Ve:Ye,ze[Je++]=or&4?Ve:Ye,ze[Je++]=or&2?Ve:Ye,ze[Je++]=or&1?Ve:Ye}if(Qe===0)continue;const rr=Ue<Ze?Be[Ue++]:255;for(let ar=0;ar<Qe;ar++)ze[Je++]=rr&1<<7-ar?Ve:Ye}return{srcPos:Ue,destPos:Je}}function De({src:Be,srcPos:Ue=0,dest:ze,destPos:We=0,width:Xe,height:He}){let qe=0;const Ge=Be.length>>2,Ye=new Uint32Array(Be.buffer,Ue,Ge);if(je.FeatureTest.isLittleEndian){for(;qe<Ge-2;qe+=3,We+=4){const Ve=Ye[qe],Ke=Ye[qe+1],Qe=Ye[qe+2];ze[We]=Ve|4278190080,ze[We+1]=Ve>>>24|Ke<<8|4278190080,ze[We+2]=Ke>>>16|Qe<<16|4278190080,ze[We+3]=Qe>>>8|4278190080}for(let Ve=qe*4,Ke=Be.length;Ve<Ke;Ve+=3)ze[We++]=Be[Ve]|Be[Ve+1]<<8|Be[Ve+2]<<16|4278190080}else{for(;qe<Ge-2;qe+=3,We+=4){const Ve=Ye[qe],Ke=Ye[qe+1],Qe=Ye[qe+2];ze[We]=Ve|255,ze[We+1]=Ve<<24|Ke>>>8|255,ze[We+2]=Ke<<16|Qe>>>16|255,ze[We+3]=Qe<<8|255}for(let Ve=qe*4,Ke=Be.length;Ve<Ke;Ve+=3)ze[We++]=Be[Ve]<<24|Be[Ve+1]<<16|Be[Ve+2]<<8|255}return{srcPos:Ue,destPos:We}}function $e(Be,Ue){if(je.FeatureTest.isLittleEndian)for(let ze=0,We=Be.length;ze<We;ze++)Ue[ze]=Be[ze]*65793|4278190080;else for(let ze=0,We=Be.length;ze<We;ze++)Ue[ze]=Be[ze]*16843008|255}},(Ee,Re)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.GlobalWorkerOptions=void 0;const Te=Object.create(null);Re.GlobalWorkerOptions=Te,Te.workerPort=null,Te.workerSrc=""},(Ee,Re,Te)=>{var Be,Du,Nu,Ml;Object.defineProperty(Re,"__esModule",{value:!0}),Re.MessageHandler=void 0;var je=Te(1);const Oe={DATA:1,ERROR:2},Me={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function De(Xe){switch(Xe instanceof Error||typeof Xe=="object"&&Xe!==null||(0,je.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),Xe.name){case"AbortException":return new je.AbortException(Xe.message);case"MissingPDFException":return new je.MissingPDFException(Xe.message);case"PasswordException":return new je.PasswordException(Xe.message,Xe.code);case"UnexpectedResponseException":return new je.UnexpectedResponseException(Xe.message,Xe.status);case"UnknownErrorException":return new je.UnknownErrorException(Xe.message,Xe.details);default:return new je.UnknownErrorException(Xe.message,Xe.toString())}}class $e{constructor(He,qe,Ge){Pn(this,Be);this.sourceName=He,this.targetName=qe,this.comObj=Ge,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=Ye=>{const Ve=Ye.data;if(Ve.targetName!==this.sourceName)return;
3988if(Ve.stream){vn(this,Be,Nu).call(this,Ve);return}if(Ve.callback){const Qe=Ve.callbackId,Ze=this.callbackCapabilities[Qe];if(!Ze)throw new Error(`Cannot resolve callback ${Qe}`);if(delete this.callbackCapabilities[Qe],Ve.callback===Oe.DATA)Ze.resolve(Ve.data);else if(Ve.callback===Oe.ERROR)Ze.reject(De(Ve.reason));else throw new Error("Unexpected callback case");return}const Ke=this.actionHandler[Ve.action];if(!Ke)throw new Error(`Unknown action from worker: ${Ve.action}`);if(Ve.callbackId){const Qe=this.sourceName,Ze=Ve.sourceName;new Promise(function(Je){Je(Ke(Ve.data))}).then(function(Je){Ge.postMessage({sourceName:Qe,targetName:Ze,callback:Oe.DATA,callbackId:Ve.callbackId,data:Je})},function(Je){Ge.postMessage({sourceName:Qe,targetName:Ze,callback:Oe.ERROR,callbackId:Ve.callbackId,reason:De(Je)})});return}if(Ve.streamId){vn(this,Be,Du).call(this,Ve);return}Ke(Ve.data)},Ge.addEventListener("message",this._onComObjOnMessage)}on(He,qe){const Ge=this.actionHandler;if(Ge[He])throw new Error(`There is already an actionName called "${He}"`);Ge[He]=qe}send(He,qe,Ge){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:He,data:qe},Ge)}sendWithPromise(He,qe,Ge){const Ye=this.callbackId++,Ve=new je.PromiseCapability;this.callbackCapabilities[Ye]=Ve;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:He,callbackId:Ye,data:qe},Ge)}catch(Ke){Ve.reject(Ke)}return Ve.promise}sendWithStream(He,qe,Ge,Ye){const Ve=this.streamId++,Ke=this.sourceName,Qe=this.targetName,Ze=this.comObj;return new ReadableStream({start:Je=>{const ir=new je.PromiseCapability;return this.streamControllers[Ve]={controller:Je,startCall:ir,pullCall:null,cancelCall:null,isClosed:!1},Ze.postMessage({sourceName:Ke,targetName:Qe,action:He,streamId:Ve,data:qe,desiredSize:Je.desiredSize},Ye),ir.promise},pull:Je=>{const ir=new je.PromiseCapability;return this.streamControllers[Ve].pullCall=ir,Ze.postMessage({sourceName:Ke,targetName:Qe,stream:Me.PULL,streamId:Ve,desiredSize:Je.desiredSize}),ir.promise},cancel:Je=>{(0,je.assert)(Je instanceof Error,"cancel must have a valid reason");const ir=new je.PromiseCapability;return this.streamControllers[Ve].cancelCall=ir,this.streamControllers[Ve].isClosed=!0,Ze.postMessage({sourceName:Ke,targetName:Qe,stream:Me.CANCEL,streamId:Ve,reason:De(Je)}),ir.promise}},Ge)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}Be=new WeakSet,Du=function(He){const qe=He.streamId,Ge=this.sourceName,Ye=He.sourceName,Ve=this.comObj,Ke=this,Qe=this.actionHandler[He.action],Ze={enqueue(Je,ir=1,rr){if(this.isCancelled)return;const ar=this.desiredSize;this.desiredSize-=ir,ar>0&&this.desiredSize<=0&&(this.sinkCapability=new je.PromiseCapability,this.ready=this.sinkCapability.promise),Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.ENQUEUE,streamId:qe,chunk:Je},rr)},close(){this.isCancelled||(this.isCancelled=!0,Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.CLOSE,streamId:qe}),delete Ke.streamSinks[qe])},error(Je){(0,je.assert)(Je instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.ERROR,streamId:qe,reason:De(Je)}))},sinkCapability:new je.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:He.desiredSize,ready:null};Ze.sinkCapability.resolve(),Ze.ready=Ze.sinkCapability.promise,this.streamSinks[qe]=Ze,new Promise(function(Je){Je(Qe(He.data,Ze))}).then(function(){Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.START_COMPLETE,streamId:qe,success:!0})},function(Je){Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.START_COMPLETE,streamId:qe,reason:De(Je)})})},Nu=function(He){const qe=He.streamId,Ge=this.sourceName,Ye=He.sourceName,Ve=this.comObj,Ke=this.streamControllers[qe],Qe=this.streamSinks[qe];switch(He.stream){case Me.START_COMPLETE:He.success?Ke.startCall.resolve():Ke.startCall.reject(De(He.reason));break;case Me.PULL_COMPLETE:He.success?Ke.pullCall.resolve():Ke.pullCall.reject(De(He.reason));break;case Me.PULL:if(!Qe){Ve.postMessage({sourceName:Ge,targetName:Ye,stream
3988:Me.PULL_COMPLETE,streamId:qe,success:!0});break}Qe.desiredSize<=0&&He.desiredSize>0&&Qe.sinkCapability.resolve(),Qe.desiredSize=He.desiredSize,new Promise(function(Ze){var Je;Ze((Je=Qe.onPull)==null?void 0:Je.call(Qe))}).then(function(){Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.PULL_COMPLETE,streamId:qe,success:!0})},function(Ze){Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.PULL_COMPLETE,streamId:qe,reason:De(Ze)})});break;case Me.ENQUEUE:if((0,je.assert)(Ke,"enqueue should have stream controller"),Ke.isClosed)break;Ke.controller.enqueue(He.chunk);break;case Me.CLOSE:if((0,je.assert)(Ke,"close should have stream controller"),Ke.isClosed)break;Ke.isClosed=!0,Ke.controller.close(),vn(this,Be,Ml).call(this,Ke,qe);break;case Me.ERROR:(0,je.assert)(Ke,"error should have stream controller"),Ke.controller.error(De(He.reason)),vn(this,Be,Ml).call(this,Ke,qe);break;case Me.CANCEL_COMPLETE:He.success?Ke.cancelCall.resolve():Ke.cancelCall.reject(De(He.reason)),vn(this,Be,Ml).call(this,Ke,qe);break;case Me.CANCEL:if(!Qe)break;new Promise(function(Ze){var Je;Ze((Je=Qe.onCancel)==null?void 0:Je.call(Qe,De(He.reason)))}).then(function(){Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.CANCEL_COMPLETE,streamId:qe,success:!0})},function(Ze){Ve.postMessage({sourceName:Ge,targetName:Ye,stream:Me.CANCEL_COMPLETE,streamId:qe,reason:De(Ze)})}),Qe.sinkCapability.reject(De(He.reason)),Qe.isCancelled=!0,delete this.streamSinks[qe];break;default:throw new Error("Unexpected stream case")}},Ml=async function(He,qe){var Ge,Ye,Ve;await Promise.allSettled([(Ge=He.startCall)==null?void 0:Ge.promise,(Ye=He.pullCall)==null?void 0:Ye.promise,(Ve=He.cancelCall)==null?void 0:Ve.promise]),delete this.streamControllers[qe]},Re.MessageHandler=$e},(Ee,Re,Te)=>{var Me,De;Object.defineProperty(Re,"__esModule",{value:!0}),Re.Metadata=void 0;var je=Te(1);class Oe{constructor({parsedData:Be,rawData:Ue}){Pn(this,Me);Pn(this,De);
3988kn(this,Me,Be),kn(this,De,Ue)}getRaw(){return Pr(this,De)}get(Be){return Pr(this,Me).get(Be)??null}getAll(){return(0,je.objectFromMap)(Pr(this,Me))}has(Be){return Pr(this,Me).has(Be)}}Me=new WeakMap,De=new WeakMap,Re.Metadata=Oe},(Ee,Re,Te)=>{var Be,Ue,ze,We,Xe,He,_c;Object.defineProperty(Re,"__esModule",{value:!0}),Re.OptionalContentConfig=void 0;var je=Te(1),Oe=Te(8);const Me=Symbol("INTERNAL");class De{constructor(Ye,Ve){Pn(this,Be,!0);this.name=Ye,this.intent=Ve}get visible(){return Pr(this,Be)}_setVisible(Ye,Ve){Ye!==Me&&(0,je.unreachable)("Internal method `_setVisible` called."),kn(this,Be,Ve)}}Be=new WeakMap;class $e{constructor(Ye){Pn(this,He);Pn(this,Ue,null);Pn(this,ze,new Map);Pn(this,We,null);Pn(this,Xe,null);if(this.name=null,this.creator=null,Ye!==null){this.name=Ye.name,this.creator=Ye.creator,kn(this,Xe,Ye.order);for(const Ve of Ye.groups)Pr(this,ze).set(Ve.id,new De(Ve.name,Ve.intent));if(Ye.baseState==="OFF")for(const Ve of Pr(this,ze).values())Ve._setVisible(Me,!1);for(const Ve of Ye.on)Pr(this,ze).get(Ve)._setVisible(Me,!0);for(const Ve of Ye.off)Pr(this,ze).get(Ve)._setVisible(Me,!1);kn(this,We,this.getHash())}}isVisible(Ye){if(Pr(this,ze).size===0)return!0;if(!Ye)return(0,je.warn)("Optional content group not defined."),!0;if(Ye.type==="OCG")return Pr(this,ze).has(Ye.id)?Pr(this,ze).get(Ye.id).visible:((0,je.warn)(`Optional content group not found: ${Ye.id}`),!0);if(Ye.type==="OCMD"){if(Ye.expression)return vn(this,He,_c).call(this,Ye.expression);if(!Ye.policy||Ye.policy==="AnyOn"){for(const Ve of Ye.ids){if(!Pr(this,ze).has(Ve))return(0,je.warn)(`Optional content group not found: ${Ve}`),!0;if(Pr(this,ze).get(Ve).visible)return!0}return!1}else if(Ye.policy==="AllOn"){for(const Ve of Ye.ids){if(!Pr(this,ze).has(Ve))return(0,je.warn)(`Optional content group not found: ${Ve}`),!0;if(!Pr(this,ze).get(Ve).visible)return!1}return!0}else if(Ye.policy==="AnyOff"){for(const Ve of Ye.ids){if(!Pr(this,ze).has(Ve))return(0,je.warn)(`Optional content group not found: ${Ve}`),!0;if(!Pr(this,ze).get(Ve).visible)return!0}return!1}else if(Ye.policy==="AllOff"){for(const Ve of Ye.ids){if(!Pr(this,ze).has(Ve))return(0,je.warn)(`Optional content group not found: ${Ve}`),!0;if(Pr(this,ze).get(Ve).visible)return!1}return!0}return(0,je.warn)(`Unknown optional content policy ${Ye.policy}.`),!0}return(0,je.warn)(`Unknown group type ${Ye.type}.`),!0}setVisibility(Ye,Ve=!0){if(!Pr(this,ze).has(Ye)){(0,je.warn)(`Optional content group not found: ${Ye}`);return}Pr(this,ze).get(Ye)._setVisible(Me,!!Ve),kn(this,Ue,null)}get hasInitialVisibility(){return Pr(this,We)===null||this.getHash()===Pr(this,We)}getOrder(){return Pr(this,ze).size?Pr(this,Xe)?Pr(this,Xe).slice():[...Pr(this,ze).keys()]:null}getGroups(){return Pr(this,ze).size>0?(0,je.objectFromMap)(Pr(this,ze)):null}getGroup(Ye){return Pr(this,ze).get(Ye)||null}getHash(){if(Pr(this,Ue)!==null)return Pr(this,Ue);const Ye=new Oe.MurmurHash3_64;for(const[Ve,Ke]of Pr(this,ze))Ye.update(`${Ve}:${Ke.visible}`);return kn(this,Ue,Ye.hexdigest())}}Ue=new WeakMap,ze=new WeakMap,We=new WeakMap,Xe=new WeakMap,He=new WeakSet,_c=function(Ye){const Ve=Ye.length;if(Ve<2)return!0;const Ke=Ye[0];for(let Qe=1;Qe<Ve;Qe++){const Ze=Ye[Qe];let Je;if(Array.isArray(Ze))Je=vn(this,He,_c).call(this,Ze);else if(Pr(this,ze).has(Ze))Je=Pr(this,ze).get(Ze).visible;else return(0,je.warn)(`Optional content group not found: ${Ze}`),!0;switch(Ke){case"And":if(!Je)return!1;break;case"Or":if(Je)return!0;break;case"Not":return!Je;default:return!0}}return Ke==="And"},Re.OptionalContentConfig=$e},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.PDFDataTransportStream=void 0;var je=Te(1),Oe=Te(6);class Me{constructor({length:Ue,initialData:ze,progressiveDone:We=!1,contentDispositionFilename:Xe=null,disableRange:He=!1,disableStream:qe=!1},Ge){if((0,je.assert)(Ge,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=We,this._contentDispositionFilename=Xe,(ze==null?void 0:ze.length)>0){const Ye=ze instanceof Uint8Array&&ze.byteLength===ze.buffer.byteLength?ze.buffer:new Uint8Array(ze).buffer;this._queuedChunks.push(Ye)}this._pdfDataRangeTransport=Ge,this._isStreamingSupported=!qe,this._isRangeSupported=!He,this._contentLength=Ue,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((Ye,Ve)=>{this._onReceiveData({begin:Ye,chunk:Ve})}),this._pdfDataRangeTransport.addProgressListener((Ye,Ve)=>{this._onProgress({loaded:Ye,total:Ve})}),this._pdfDataRangeTransport.addProgressiveReadListener(Ye=>{this._onReceiveData({chunk:Ye})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData({begin:Ue,chunk:ze}){const We=ze instanceof Uint8Array&&ze.byteLength===ze.buffer.byteLength?ze.buffer:new Uint8Array(ze).buffer;if(Ue===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(We):this._queuedChunks.push(We);else{const Xe=this._rangeReaders.some(function(He){return He._begin!==Ue?!1:(He._enqueue(We),!0)});(0,je.assert)(Xe,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var Ue;return((Ue=this._fullRequestReader)==null?void 0:Ue._loaded)??0}_onProgress(Ue){var ze,We,Xe,He;Ue.total===void 0?(We=(ze=this._rangeReaders[0])==null?void 0:ze.onProgress)==null||We.call(ze,{loaded:Ue.loaded}):(He=(Xe=this._fullRequestReader)==null?void 0:Xe.onProgress)==null||He.call(Xe,{loaded:Ue.loaded,total:Ue.total})}_onProgressiveDone(){var Ue;(Ue=this._fullRequestReader)==null||Ue.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(Ue){const ze=this._rangeReaders.indexOf(Ue);ze>=0&&this._rangeReaders.splice(ze,1)}getFullReader(){(0,je.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const Ue=this._queuedChunks;return this._queuedChunks=null,new De(this,Ue,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(Ue,ze){if(ze<=this._progressiveDataLength)return null;const We=new $e(this,Ue,ze);return this._pdfDataRangeTransport.requestDataRange(Ue,ze),this._rangeReaders.push(We),We}cancelAllRequests(Ue){var ze;(ze=this._fullRequestReader)==null||ze.cancel(Ue);for(const We of this._rangeReaders.slice(0))We.cancel(Ue);this._pdfDataRangeTransport.abort()}}
3988Re.PDFDataTransportStream=Me;class De{constructor(Ue,ze,We=!1,Xe=null){this._stream=Ue,this._done=We||!1,this._filename=(0,Oe.isPdfFile)(Xe)?Xe:null,this._queuedChunks=ze||[],this._loaded=0;for(const He of this._queuedChunks)this._loaded+=He.byteLength;this._requests=[],this._headersReady=Promise.resolve(),Ue._fullRequestReader=this,this.onProgress=null}_enqueue(Ue){this._done||(this._requests.length>0?this._requests.shift().resolve({value:Ue,done:!1}):this._queuedChunks.push(Ue),this._loaded+=Ue.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 Ue=new je.PromiseCapability;return this._requests.push(Ue),Ue.promise}cancel(Ue){this._done=!0;for(const ze of this._requests)ze.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class $e{constructor(Ue,ze,We){this._stream=Ue,this._begin=ze,this._end=We,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(Ue){if(!this._done){if(this._requests.length===0)this._queuedChunk=Ue;else{this._requests.shift().resolve({value:Ue,done:!1});for(const We of this._requests)We.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 ze=this._queuedChunk;return this._queuedChunk=null,{value:ze,done:!1}}if(this._done)return{value:void 0,done:!0};const Ue=new je.PromiseCapability;return this._requests.push(Ue),Ue.promise}cancel(Ue){this._done=!0;for(const ze of this._requests)ze.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.PDFFetchStream=void 0;var je=Te(1),Oe=Te(20);function Me(We,Xe,He){return{method:"GET",headers:We,signal:He.signal,mode:"cors",credentials:Xe?"include":"same-origin",redirect:"follow"}}function De(We){const Xe=new Headers;for(const He in We){const qe=We[He];qe!==void 0&&Xe.append(He,qe)}return Xe}function $e(We){return We instanceof Uint8Array?We.buffer:We instanceof ArrayBuffer?We:((0,je.warn)(`getArrayBuffer - unexpected data format: ${We}`),new Uint8Array(We).buffer)}class Be{constructor(Xe){this.source=Xe,this.isHttp=/^https?:/i.test(Xe.url),this.httpHeaders=this.isHttp&&Xe.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Xe;return((Xe=this._fullRequestReader)==null?void 0:Xe._loaded)??0}getFullReader(){return(0,je.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Ue(this),this._fullRequestReader}getRangeReader(Xe,He){if(He<=this._progressiveDataLength)return null;const qe=new ze(this,Xe,He);return this._rangeRequestReaders.push(qe),qe}cancelAllRequests(Xe){var He;(He=this._fullRequestReader)==null||He.cancel(Xe);for(const qe of this._rangeRequestReaders.slice(0))qe.cancel(Xe)}}Re.PDFFetchStream=Be;class Ue{constructor(Xe){this._stream=Xe,this._reader=null,this._loaded=0,this._filename=null;const He=Xe.source;this._withCredentials=He.withCredentials||!1,this._contentLength=He.length,this._headersCapability=new je.PromiseCapability,this._disableRange=He.disableRange||!1,this._rangeChunkSize=He.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!He.disableStream,this._isRangeSupported=!He.disableRange,this._headers=De(this._stream.httpHeaders);const qe=He.url;fetch(qe,Me(this._headers,this._withCredentials,this._abortController)).then(Ge=>{if(!(0,Oe.validateResponseStatus)(Ge.status))throw(0,Oe.createResponseStatusError)(Ge.status,qe);this._reader=Ge.body.getReader(),this._headersCapability.resolve();const Ye=Qe=>Ge.headers.get(Qe),{allowRangeRequests:Ve,suggestedLength:Ke}=(0,Oe.validateRangeRequestCapabilities)({getResponseHeader:Ye,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=Ve,this._contentLength=Ke||this._contentLength,this._filename=(0,Oe.extractFilenameFromHeader)(Ye),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new je.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 qe;await this._headersCapability.promise;const{value:Xe,done:He}=await this._reader.read();return He?{value:Xe,done:He}:(this._loaded+=Xe.byteLength,(qe=this.onProgress)==null||qe.call(this,{loaded:this._loaded,total:this._contentLength}),{value:$e(Xe),done:!1})}cancel(Xe){var He;(He=this._reader)==null||He.cancel(Xe),this._abortController.abort()}}class ze{constructor(Xe,He,qe){this._stream=Xe,this._reader=null,this._loaded=0;const Ge=Xe.source;this._withCredentials=Ge.withCredentials||!1,this._readCapability=new je.PromiseCapability,this._isStreamingSupported=!Ge.disableStream,this._abortController=new AbortController,this._headers=De(this._stream.httpHeaders),this._headers.append("Range",`bytes=${He}-${qe-1}`);const Ye=Ge.url;fetch(Ye,Me(this._headers,this._withCredentials,this._abortController)).then(Ve=>{if(!(0,Oe.validateResponseStatus)(Ve.status))throw(0,Oe.createResponseStatusError)(Ve.status,Ye);this._readCapability.resolve(),this._reader=Ve.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var qe;await this._readCapability.promise;const{value:Xe,done:He}=await this._reader.read();return He?{value:Xe,done:He}:(this._loaded+=Xe.byteLength,(qe=this.onProgress)==null||qe.call(this,{loaded:this._loaded}),{value:$e(Xe),done:!1})}cancel(Xe){var He;(He=this._reader)==null||He.cancel(Xe),this._abortController.abort()}}},(Ee,Re,Te)=>
3988{Object.defineProperty(Re,"__esModule",{value:!0}),Re.createResponseStatusError=Be,Re.extractFilenameFromHeader=$e,Re.validateRangeRequestCapabilities=De,Re.validateResponseStatus=Ue;var je=Te(1),Oe=Te(21),Me=Te(6);function De({getResponseHeader:ze,isHttp:We,rangeChunkSize:Xe,disableRange:He}){const qe={allowRangeRequests:!1,suggestedLength:void 0},Ge=parseInt(ze("Content-Length"),10);return!Number.isInteger(Ge)||(qe.suggestedLength=Ge,Ge<=2*Xe)||He||!We||ze("Accept-Ranges")!=="bytes"||(ze("Content-Encoding")||"identity")!=="identity"||(qe.allowRangeRequests=!0),qe}function $e(ze){const We=ze("Content-Disposition");if(We){let Xe=(0,Oe.getFilenameFromContentDispositionHeader)(We);if(Xe.includes("%"))try{Xe=decodeURIComponent(Xe)}catch{}if((0,Me.isPdfFile)(Xe))return Xe}return null}function Be(ze,We){return ze===404||ze===0&&We.startsWith("file:")?new je.MissingPDFException('Missing PDF "'+We+'".'):new je.UnexpectedResponseException(`Unexpected server response (${ze}) while retrieving PDF "${We}".`,ze)}function Ue(ze){return ze===200||ze===206}},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.getFilenameFromContentDispositionHeader=Oe;var je=Te(1);function Oe(Me){let De=!0,$e=Be("filename\\*","i").exec(Me);if($e){$e=$e[1];let Ge=Xe($e);return Ge=unescape(Ge),Ge=He(Ge),Ge=qe(Ge),ze(Ge)}if($e=We(Me),$e){const Ge=qe($e);return ze(Ge)}if($e=Be("filename","i").exec(Me),$e){$e=$e[1];let Ge=Xe($e);return Ge=qe(Ge),ze(Ge)}function Be(Ge,Ye){return new RegExp("(?:^|;)\\s*"+Ge+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',Ye)}function Ue(Ge,Ye){if(Ge){if(!/^[\x00-\xFF]+$/.test(Ye))return Ye;
3988try{const Ve=new TextDecoder(Ge,{fatal:!0}),Ke=(0,je.stringToBytes)(Ye);Ye=Ve.decode(Ke),De=!1}catch{}}return Ye}function ze(Ge){return De&&/[\x80-\xff]/.test(Ge)&&(Ge=Ue("utf-8",Ge),De&&(Ge=Ue("iso-8859-1",Ge))),Ge}function We(Ge){const Ye=[];let Ve;const Ke=Be("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(Ve=Ke.exec(Ge))!==null;){let[,Ze,Je,ir]=Ve;if(Ze=parseInt(Ze,10),Ze in Ye){if(Ze===0)break;continue}Ye[Ze]=[Je,ir]}const Qe=[];for(let Ze=0;Ze<Ye.length&&Ze in Ye;++Ze){let[Je,ir]=Ye[Ze];ir=Xe(ir),Je&&(ir=unescape(ir),Ze===0&&(ir=He(ir))),Qe.push(ir)}return Qe.join("")}function Xe(Ge){if(Ge.startsWith('"')){const Ye=Ge.slice(1).split('\\"');for(let Ve=0;Ve<Ye.length;++Ve){const Ke=Ye[Ve].indexOf('"');Ke!==-1&&(Ye[Ve]=Ye[Ve].slice(0,Ke),Ye.length=Ve+1),Ye[Ve]=Ye[Ve].replaceAll(/\\(.)/g,"$1")}Ge=Ye.join('"')}return Ge}function He(Ge){const Ye=Ge.indexOf("'");if(Ye===-1)return Ge;const Ve=Ge.slice(0,Ye),Qe=Ge.slice(Ye+1).replace(/^[^']*'/,"");return Ue(Ve,Qe)}function qe(Ge){return!Ge.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(Ge)?Ge:Ge.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(Ye,Ve,Ke,Qe){if(Ke==="q"||Ke==="Q")return Qe=Qe.replaceAll("_"," "),Qe=Qe.replaceAll(/=([0-9a-fA-F]{2})/g,function(Ze,Je){return String.fromCharCode(parseInt(Je,16))}),Ue(Ve,Qe);try{Qe=atob(Qe)}catch{}return Ue(Ve,Qe)})}return""}},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.PDFNetworkStream=void 0;var je=Te(1),Oe=Te(20);const Me=200,De=206;function $e(Xe){const He=Xe.response;return typeof He!="string"?He:(0,je.stringToBytes)(He).buffer}class Be{constructor(He,qe={}){this.url=He,this.isHttp=/^https?:/i.test(He),this.httpHeaders=this.isHttp&&qe.httpHeaders||Object.create(null),this.withCredentials=qe.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(He,qe,Ge){const Ye={begin:He,end:qe};for(const Ve in Ge)Ye[Ve]=Ge[Ve];return this.request(Ye)}requestFull(He){return this.request(He)}request(He){const qe=new XMLHttpRequest,Ge=this.currXhrId++,Ye=this.pendingRequests[Ge]={xhr:qe};qe.open("GET",this.url),qe.withCredentials=this.withCredentials;for(const Ve in this.httpHeaders){const Ke=this.httpHeaders[Ve];Ke!==void 0&&qe.setRequestHeader(Ve,Ke)}return this.isHttp&&"begin"in He&&"end"in He?(qe.setRequestHeader("Range",`bytes=${He.begin}-${He.end-1}`),Ye.expectedStatus=De):Ye.expectedStatus=Me,qe.responseType="arraybuffer",He.onError&&(qe.onerror=function(Ve){He.onError(qe.status)}),qe.onreadystatechange=this.onStateChange.bind(this,Ge),qe.onprogress=this.onProgress.bind(this,Ge),Ye.onHeadersReceived=He.onHeadersReceived,Ye.onDone=He.onDone,Ye.onError=He.onError,Ye.onProgress=He.onProgress,qe.send(null),Ge}onProgress(He,qe){var Ye;const Ge=this.pendingRequests[He];Ge&&((Ye=Ge.onProgress)==null||Ye.call(Ge,qe))}onStateChange(He,qe){var Ze,Je,ir;const Ge=this.pendingRequests[He];if(!Ge)return;const Ye=Ge.xhr;if(Ye.readyState>=2&&Ge.onHeadersReceived&&(Ge.onHeadersReceived(),delete Ge.onHeadersReceived),Ye.readyState!==4||!(He in this.pendingRequests))return;if(delete this.pendingRequests[He],Ye.status===0&&this.isHttp){(Ze=Ge.onError)==null||Ze.call(Ge,Ye.status);return}const Ve=Ye.status||Me;if(!(Ve===Me&&Ge.expectedStatus===De)&&Ve!==Ge.expectedStatus){(Je=Ge.onError)==null||Je.call(Ge,Ye.status);return}const Qe=$e(Ye);if(Ve===De){const rr=Ye.getResponseHeader("Content-Range"),ar=/bytes (\d+)-(\d+)\/(\d+)/.exec(rr);Ge.onDone({begin:parseInt(ar[1],10),chunk:Qe})}else Qe?Ge.onDone({begin:0,chunk:Qe}):(ir=Ge.onError)==null||ir.call(Ge,Ye.status)}getRequestXhr(He){return this.pendingRequests[He].xhr}isPendingRequest(He){return He in this.pendingRequests}abortRequest(He){const qe=this.pendingRequests[He].xhr;delete this.pendingRequests[He],qe.abort()}}class Ue{constructor(He){this._source=He,this._manager=new Be(He.url,{httpHeaders:He.httpHeaders,withCredentials:He.withCredentials}),this._rangeChunkSize=He.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(He){const qe=this._rangeRequestReaders.indexOf(He);qe>=0&&this._rangeRequestReaders.splice(qe,1)}getFullReader(){return(0,je.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new ze(this._manager,this._source),this._fullRequestReader}getRangeReader(He,qe){const Ge=new We(this._manager,He,qe);return Ge.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(Ge),Ge}cancelAllRequests(He){var qe;(qe=this._fullRequestReader)==null||qe.cancel(He);for(const Ge of this._rangeRequestReaders.slice(0))Ge.cancel(He)}}Re.PDFNetworkStream=Ue;class ze{constructor(He,qe){this._manager=He;const Ge={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=qe.url,this._fullRequestId=He.requestFull(Ge),this._headersReceivedCapability=new je.PromiseCapability,this._disableRange=qe.disableRange||!1,this._contentLength=qe.length,this._rangeChunkSize=qe.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 He=this._fullRequestId,qe=this._manager.getRequestXhr(He),Ge=Ke=>qe.getResponseHeader(Ke),{allowRangeRequests:Ye,suggestedLength:Ve}=(0,Oe.validateRangeRequestCapabilities)({getResponseHeader:Ge,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});Ye&&(this._isRangeSupported=!0),this._contentLength=Ve||this._contentLength,this._filename=(0,Oe.extractFilenameFromHeader)(Ge),this._isRangeSupported&&this._manager.abortRequest
3988(He),this._headersReceivedCapability.resolve()}_onDone(He){if(He&&(this._requests.length>0?this._requests.shift().resolve({value:He.chunk,done:!1}):this._cachedChunks.push(He.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const qe of this._requests)qe.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(He){this._storedError=(0,Oe.createResponseStatusError)(He,this._url),this._headersReceivedCapability.reject(this._storedError);for(const qe of this._requests)qe.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(He){var qe;(qe=this.onProgress)==null||qe.call(this,{loaded:He.loaded,total:He.lengthComputable?He.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 He=new je.PromiseCapability;return this._requests.push(He),He.promise}cancel(He){this._done=!0,this._headersReceivedCapability.reject(He);for(const qe of this._requests)qe.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class We{constructor(He,qe,Ge){this._manager=He;const Ye={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=He.url,this._requestId=He.requestRange(qe,Ge,Ye),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var He;(He=this.onClosed)==null||He.call(this,this)}_onDone(He){const qe=He.chunk;this._requests.length>0?this._requests.shift().resolve({value:qe,done:!1}):this._queuedChunk=qe,this._done=!0;for(const Ge of this._requests)Ge.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(He){this._storedError=(0,Oe.createResponseStatusError)(He,this._url);for(const qe of this._requests)qe.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(He){var qe;this.isStreamingSupported||(qe=this.onProgress)==null||qe.call(this,{loaded:He.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const qe=this._queuedChunk;return this._queuedChunk=null,{value:qe,done:!1}}if(this._done)return{value:void 0,done:!0};const He=new je.PromiseCapability;return this._requests.push(He),He.promise}cancel(He){this._done=!0;for(const qe of this._requests)qe.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.PDFNodeStream=void 0;var je=Te(1),Oe=Te(20);const Me=/^file:\/\/\/[a-zA-Z]:\//;function De(Ge){const Ye=require$$5,Ve=Ye.parse(Ge);return Ve.protocol==="file:"||Ve.host?Ve:/^[a-z]:[/\\]/i.test(Ge)?Ye.parse(`file:///${Ge}`):(Ve.host||(Ve.protocol="file:"),Ve)}class $e{constructor(Ye){this.source=Ye,this.url=De(Ye.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&Ye.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var Ye;return((Ye=this._fullRequestReader)==null?void 0:Ye._loaded)??0}getFullReader(){return(0,je.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new He(this):new We(this),this._fullRequestReader}getRangeReader(Ye,Ve){if(Ve<=this._progressiveDataLength)return null;const Ke=this.isFsUrl?new qe(this,Ye,Ve):new Xe(this,Ye,Ve);return this._rangeRequestReaders.push(Ke),Ke}cancelAllRequests(Ye){var Ve;(Ve=this._fullRequestReader)==null||Ve.cancel(Ye);for(const Ke of this._rangeRequestReaders.slice(0))Ke.cancel(Ye)}}Re.PDFNodeStream=$e;class Be{constructor(Ye){this._url=Ye.url,this._done=!1,this._storedError=null,this.onProgress=null;const Ve=Ye.source;this._contentLength=Ve.length,this._loaded=0,this._filename=null,this._disableRange=Ve.disableRange||!1,this._rangeChunkSize=Ve.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!Ve.disableStream,this._isRangeSupported=!Ve.disableRange,this._readableStream=null,this._readCapability=new je.PromiseCapability,this._headersCapability=new je.PromiseCapability}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 Ke;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Ye=this._readableStream.read();return Ye===null?(this._readCapability=new je.PromiseCapability,this.read()):(this._loaded+=Ye.length,(Ke=this.onProgress)==null||Ke.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(Ye).buffer,done:!1})}cancel(Ye){if(!this._readableStream){this._error(Ye);return}this._readableStream.destroy(Ye)}_error(Ye){this._storedError=Ye,this._readCapability.resolve()}_setReadableStream(Ye){this._readableStream=Ye,Ye.on("readable",()=>{this._readCapability.resolve()}),Ye.on("end",()=>{Ye.destroy(),this._done=!0,this._readCapability.resolve()}),Ye.on("error",Ve=>{this._error(Ve)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new je.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}
3988class Ue{constructor(Ye){this._url=Ye.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new je.PromiseCapability;const Ve=Ye.source;this._isStreamingSupported=!Ve.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var Ke;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const Ye=this._readableStream.read();return Ye===null?(this._readCapability=new je.PromiseCapability,this.read()):(this._loaded+=Ye.length,(Ke=this.onProgress)==null||Ke.call(this,{loaded:this._loaded}),{value:new Uint8Array(Ye).buffer,done:!1})}cancel(Ye){if(!this._readableStream){this._error(Ye);return}this._readableStream.destroy(Ye)}_error(Ye){this._storedError=Ye,this._readCapability.resolve()}_setReadableStream(Ye){this._readableStream=Ye,Ye.on("readable",()=>{this._readCapability.resolve()}),Ye.on("end",()=>{Ye.destroy(),this._done=!0,this._readCapability.resolve()}),Ye.on("error",Ve=>{this._error(Ve)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function ze(Ge,Ye){return{protocol:Ge.protocol,auth:Ge.auth,host:Ge.hostname,port:Ge.port,path:Ge.path,method:"GET",headers:Ye}}class We extends Be{constructor(Ye){super(Ye);const Ve=Ke=>{if(Ke.statusCode===404){const ir=new je.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=ir,this._headersCapability.reject(ir);return}this._headersCapability.resolve(),this._setReadableStream(Ke);const Qe=ir=>this._readableStream.headers[ir.toLowerCase()],{allowRangeRequests:Ze,suggestedLength:Je}=(0,Oe.validateRangeRequestCapabilities)({getResponseHeader:Qe,isHttp:Ye.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=Ze,this._contentLength=Je||this._contentLength,this._filename=(0,Oe.extractFilenameFromHeader)(Qe)};if(this._request=null,this._url.protocol==="http:"){const Ke=require$$5;this._request=Ke.request(ze(this._url,Ye.httpHeaders),Ve)}else{const Ke=require$$5;this._request=Ke.request(ze(this._url,Ye.httpHeaders),Ve)}this._request.on("error",Ke=>{this._storedError=Ke,this._headersCapability.reject(Ke)}),this._request.end()}}class Xe extends Ue{constructor(Ye,Ve,Ke){super(Ye),this._httpHeaders={};for(const Ze in Ye.httpHeaders){const Je=Ye.httpHeaders[Ze];Je!==void 0&&(this._httpHeaders[Ze]=Je)}this._httpHeaders.Range=`bytes=${Ve}-${Ke-1}`;const Qe=Ze=>{if(Ze.statusCode===404){const Je=new je.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=Je;return}this._setReadableStream(Ze)};if(this._request=null,this._url.protocol==="http:"){const Ze=require$$5;this._request=Ze.request(ze(this._url,this._httpHeaders),Qe)}else{const Ze=require$$5;this._request=Ze.request(ze(this._url,this._httpHeaders),Qe)}this._request.on("error",Ze=>{this._storedError=Ze}),this._request.end()}}class He extends Be{constructor(Ye){super(Ye);let Ve=decodeURIComponent(this._url.path);Me.test(this._url.href)&&(Ve=Ve.replace(/^\//,""));const Ke=require$$5;Ke.lstat(Ve,(Qe,Ze)=>{if(Qe){Qe.code==="ENOENT"&&(Qe=new je.MissingPDFException(`Missing PDF "${Ve}".`)),this._storedError=Qe,this._headersCapability.reject(Qe);return}this._contentLength=Ze.size,this._setReadableStream(Ke.createReadStream(Ve)),this._headersCapability.resolve()})}}class qe extends Ue{constructor(Ye,Ve,Ke){super(Ye);let Qe=decodeURIComponent(this._url.path);Me.test(this._url.href)&&(Qe=Qe.replace(/^\//,""));const Ze=require$$5;this._setReadableStream(Ze.createReadStream(Qe,{start:Ve,end:Ke-1}))}}},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.SVGGraphics=void 0;var je=Te(6),Oe=Te(1);const Me={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},De="http://www.w3.org/XML/1998/namespace",$e="http://www.w3.org/1999/xlink",Be=["butt","round","square"],Ue=["miter","round","bevel"],ze=function(Ze,Je="",ir=!1){if(URL.createObjectURL&&typeof Blob<"u"&&!ir)return URL.createObjectURL(new Blob([Ze],{type:Je}));const rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
3988+/=";let ar=`data:${Je};base64,`;for(let or=0,pr=Ze.length;or<pr;or+=3){const tr=Ze[or]&255,nr=Ze[or+1]&255,hr=Ze[or+2]&255,sr=tr>>2,xr=(tr&3)<<4|nr>>4,Rr=or+1<pr?(nr&15)<<2|hr>>6:64,br=or+2<pr?hr&63:64;ar+=rr[sr]+rr[xr]+rr[Rr]+rr[br]}return ar},We=function(){const Ze=new Uint8Array([137,80,78,71,13,10,26,10]),Je=12,ir=new Int32Array(256);for(let hr=0;hr<256;hr++){let sr=hr;for(let xr=0;xr<8;xr++)sr=sr&1?3988292384^sr>>1&2147483647:sr>>1&2147483647;ir[hr]=sr}function rr(hr,sr,xr){let Rr=-1;for(let br=sr;br<xr;br++){const wr=(Rr^hr[br])&255,vr=ir[wr];Rr=Rr>>>8^vr}return Rr^-1}function ar(hr,sr,xr,Rr){let br=Rr;const wr=sr.length;xr[br]=wr>>24&255,xr[br+1]=wr>>16&255,xr[br+2]=wr>>8&255,xr[br+3]=wr&255,br+=4,xr[br]=hr.charCodeAt(0)&255,xr[br+1]=hr.charCodeAt(1)&255,xr[br+2]=hr.charCodeAt(2)&255,xr[br+3]=hr.charCodeAt(3)&255,br+=4,xr.set(sr,br),br+=sr.length;const vr=rr(xr,Rr+4,br);xr[br]=vr>>24&255,xr[br+1]=vr>>16&255,xr[br+2]=vr>>8&255,xr[br+3]=vr&255}function or(hr,sr,xr){let Rr=1,br=0;for(let wr=sr;wr<xr;++wr)Rr=(Rr+(hr[wr]&255))%65521,br=(br+Rr)%65521;return br<<16|Rr}function pr(hr){if(!Oe.isNodeJS)return tr(hr);try{const sr=parseInt(process.versions.node)>=8?hr:Buffer.from(hr),xr=require$$5.deflateSync(sr,{level:9});return xr instanceof Uint8Array?xr:new Uint8Array(xr)}catch(sr){(0,Oe.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+sr)}return tr(hr)}function tr(hr){let sr=hr.length;const xr=65535,Rr=Math.ceil(sr/xr),br=new Uint8Array(2+sr+Rr*5+4);let wr=0;br[wr++]=120,br[wr++]=156;let vr=0;for(;sr>xr;)br[wr++]=0,br[wr++]=255,br[wr++]=255,br[wr++]=0,br[wr++]=0,br.set(hr.subarray(vr,vr+xr),wr),wr+=xr,vr+=xr,sr-=xr;br[wr++]=1,br[wr++]=sr&255,br[wr++]=sr>>8&255,br[wr++]=~sr&65535&255,br[wr++]=(~sr&65535)>>8&255,br.set(hr.subarray(vr),wr),wr+=hr.length-vr;const Dr=or(hr,0,hr.length);return br[wr++]=Dr>>24&255,br[wr++]=Dr>>16&255,br[wr++]=Dr>>8&255,br[wr++]=Dr&255,br}function nr(hr,sr,xr,Rr){const br=hr.width,wr=hr.height;let vr,Dr,kr;const cr=hr.data;switch(sr){case Oe.ImageKind.GRAYSCALE_1BPP:Dr=0,vr=1,kr=br+7>>3;break;case Oe.ImageKind.RGB_24BPP:Dr=2,vr=8,kr=br*3;break;case Oe.ImageKind.RGBA_32BPP:Dr=6,vr=8,kr=br*4;break;default:throw new Error("invalid format")}const dr=new Uint8Array((1+kr)*wr);let ur=0,gr=0;for(let Br=0;Br<wr;++Br)dr[ur++]=0,dr.set(cr.subarray(gr,gr+kr),ur),gr+=kr,ur+=kr;if(sr===Oe.ImageKind.GRAYSCALE_1BPP&&Rr){ur=0;for(let Br=0;Br<wr;Br++){ur++;for(let Hr=0;Hr<kr;Hr++)dr[ur++]^=255}}const _r=new Uint8Array([br>>24&255,br>>16&255,br>>8&255,br&255,wr>>24&255,wr>>16&255,wr>>8&255,wr&255,vr,Dr,0,0,0]),Ir=pr(dr),Ar=Ze.length+Je*3+_r.length+Ir.length,Tr=new Uint8Array(Ar);let Nr=0;return Tr.set(Ze,Nr),Nr+=Ze.length,ar("IHDR",_r,Tr,Nr),Nr+=Je+_r.length,ar("IDATA",Ir,Tr,Nr),Nr+=Je+Ir.length,ar("IEND",new Uint8Array(0),Tr,Nr),ze(Tr,"image/png",xr)}return function(sr,xr,Rr){const br=sr.kind===void 0?Oe.ImageKind.GRAYSCALE_1BPP:sr.kind;return nr(sr,br,xr,Rr)}}();class Xe{constructor(){this.fontSizeScale=1,this.fontWeight=Me.fontWeight,this.fontSize=0,this.textMatrix=Oe.IDENTITY_MATRIX,this.fontMatrix=Oe.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=Oe.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=Me.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(Je,ir){this.x=Je,this.y=ir}}function He(Ze){let Je=[];const ir=[];for(const rr of Ze){if(rr.fn==="save"){Je.push({fnId:92,fn:"group",items:[]}),ir.push(Je),Je=Je.at(-1).items;continue}rr.fn==="restore"?Je=ir.pop():Je.push(rr)}return Je}function qe(Ze){if(Number.isInteger(Ze))return Ze.toString();const Je=Ze.toFixed(10);let ir=Je.length-1;if(Je[ir]!=="0")return Je;do ir--;while(Je[ir]==="0");return Je.substring(0,Je[ir]==="."?ir:ir+1)}function Ge(Ze){if(Ze[4]===0&&Ze[5]===0){if(Ze[1]===0&&Ze[2]===0)return Ze[0]===1&&Ze[3]===1?"":`scale(${qe(Ze[0])} ${qe(Ze[3])})`;if(Ze[0]===Ze[3]&&Ze[1]===-Ze[2]){const Je=Math.acos(Ze[0])*180/Math.PI;return`rotate(${qe(Je)})`}}else if(Ze[0]===1&&Ze[1]===0&&Ze[2]===0&&Ze[3]===1)return`translate(${qe(Ze[4])} ${qe(Ze[5])})`;return`matrix(${qe(Ze[0])} ${qe(Ze[1])} ${qe(Ze[2])} ${qe(Ze[3])} ${qe(Ze[4])} ${qe(Ze[5])})`}let Ye=0,Ve=0,Ke=0;class Qe{constructor(Je,ir,rr=!1){(0,je.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new je.DOMSVGFactory,this.current=ne
vendor: 6,242 bytes, line 3988
3988w Xe,this.transformMatrix=Oe.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=Je,this.objs=ir,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!rr,this._operatorIdMapping=[];for(const ar in Oe.OPS)this._operatorIdMapping[Oe.OPS[ar]]=ar}getObject(Je,ir=null){return typeof Je=="string"?Je.startsWith("g_")?this.commonObjs.get(Je):this.objs.get(Je):ir}save(){this.transformStack.push(this.transformMatrix);const Je=this.current;this.extraStack.push(Je),this.current=Je.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(Je){this.save(),this.executeOpTree(Je),this.restore()}loadDependencies(Je){const ir=Je.fnArray,rr=Je.argsArray;for(let ar=0,or=ir.length;ar<or;ar++)if(ir[ar]===Oe.OPS.dependency)for(const pr of rr[ar]){const tr=pr.startsWith("g_")?this.commonObjs:this.objs,nr=new Promise(hr=>{tr.get(pr,hr)});this.current.dependencies.push(nr)}return Promise.all(this.current.dependencies)}transform(Je,ir,rr,ar,or,pr){const tr=[Je,ir,rr,ar,or,pr];this.transformMatrix=Oe.Util.transform(this.transformMatrix,tr),this.tgrp=null}getSVG(Je,ir){this.viewport=ir;const rr=this._initialize(ir);return this.loadDependencies(Je).then(()=>(this.transformMatrix=Oe.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(Je)),rr))}convertOpList(Je){const ir=this._operatorIdMapping,rr=Je.argsArray,ar=Je.fnArray,or=[];for(let pr=0,tr=ar.length;pr<tr;pr++){const nr=ar[pr];or.push({fnId:nr,fn:ir[nr],args:rr[pr]})}return He(or)}executeOpTree(Je){for(const ir of Je){const rr=ir.fn,ar=ir.fnId,or=ir.args;switch(ar|0){case Oe.OPS.beginText:this.beginText();break;case Oe.OPS.dependency:break;case Oe.OPS.setLeading:this.setLeading(or);break;case Oe.OPS.setLeadingMoveText:this.setLeadingMoveText(or[0],or[1]);break;case Oe.OPS.setFont:this.setFont(or);break;case Oe.OPS.showText:this.showText(or[0]);break;case Oe.OPS.showSpacedText:this.showText(or[0]);break;case Oe.OPS.endText:this.endText();break;case Oe.OPS.moveText:this.moveText(or[0],or[1]);break;case Oe.OPS.setCharSpacing:this.setCharSpacing(or[0]);break;case Oe.OPS.setWordSpacing:this.setWordSpacing(or[0]);break;case Oe.OPS.setHScale:this.setHScale(or[0]);break;case Oe.OPS.setTextMatrix:this.setTextMatrix(or[0],or[1],or[2],or[3],or[4],or[5]);break;case Oe.OPS.setTextRise:this.setTextRise(or[0]);break;case Oe.OPS.setTextRenderingMode:this.setTextRenderingMode(or[0]);break;case Oe.OPS.setLineWidth:this.setLineWidth(or[0]);break;case Oe.OPS.setLineJoin:this.setLineJoin(or[0]);break;case Oe.OPS.setLineCap:this.setLineCap(or[0]);break;case Oe.OPS.setMiterLimit:this.setMiterLimit(or[0]);break;case Oe.OPS.setFillRGBColor:this.setFillRGBColor(or[0],or[1],or[2]);break;case Oe.OPS.setStrokeRGBColor:this.setStrokeRGBColor(or[0],or[1],or[2]);break;case Oe.OPS.setStrokeColorN:this.setStrokeColorN(or);break;case Oe.OPS.setFillColorN:this.setFillColorN(or);break;case Oe.OPS.shadingFill:this.shadingFill(or[0]);break;case Oe.OPS.setDash:this.setDash(or[0],or[1]);break;case Oe.OPS.setRenderingIntent:this.setRenderingIntent(or[0]);break;case Oe.OPS.setFlatness:this.setFlatness(or[0]);break;case Oe.OPS.setGState:this.setGState(or[0]);break;case Oe.OPS.fill:this.fill();break;case Oe.OPS.eoFill:this.eoFill();break;case Oe.OPS.stroke:this.stroke();break;case Oe.OPS.fillStroke:this.fillStroke();break;case Oe.OPS.eoFillStroke:this.eoFillStroke();break;case Oe.OPS.clip:this.clip("nonzero");break;case Oe.OPS.eoClip:this.clip("evenodd");break;case Oe.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case Oe.OPS.paintImageXObject:this.paintImageXObject(or[0]);break;case Oe.OPS.paintInlineImageXObject:this.paintInlineImageXObject(or[0]);break;case Oe.OPS.paintImageMaskXObject:this.paintImageMaskXObject(or[0]);break;case Oe.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(or[0],or[1]);break;case Oe.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case Oe.OPS.closePath:this.closePath();break;case Oe.OPS.closeStroke:this.closeStroke();break;case Oe.OPS.closeFillStroke:this.closeFillStroke();break;case Oe.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case Oe.OPS.nextLine:this.nextLine();break;case Oe.OPS.transform:this.transform(or[0],or[1],or[2],or[3],or[4],or[5]);break;case Oe.OPS.constructPath:this.constructPath(or[0],or[1]);break;case Oe.OPS.endPath:this.endPath();break;case 92:this.group(ir.items);break;default:(0,Oe.warn)(`Unimplemented operator ${rr}`);break}}}setWordSpacing(Je){this.current.wordSpacing=Je}setCharSpacing(Je){this.current.charSpacing=Je}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(Je,ir,rr,ar,or,pr){const tr=this.current;tr.textMatrix=tr.lineMatrix=[Je,ir,rr,ar,or,pr],tr.textMatrixScale=Math.hypot(Je,ir),tr.x=tr.lineX=0,tr.y=tr.lineY=0,tr.xcoords=[],tr.ycoords=[],tr.tspan=this.svgFactory.createElement("svg:tspan"),tr.tspan.setAttributeNS(null,"font-family",tr.fontFamily),tr.tspan.setAttributeNS(null,"font-size",`${qe(tr.fontSize)}px`),tr.tspan.setAttributeNS(null,"y",qe(-tr.y)),tr.txtElement=this.svgFactory.createElement("svg:text"),tr.txtElement.append(tr.tspan)}beginText(){const Je=this.current;Je.x=Je.lineX=0,Je.y=Je.lineY=0,Je.textMatrix=Oe.IDENTITY_MATRIX,Je.lineMatrix=Oe.IDENTITY_MATRIX,Je.textMatrixScale=1,Je.tspan=this.svgFactory.createElement("svg:tspan"),Je.txtElement=this.svgFactory.createElement("svg:text"),Je.txtgrp=this.svgFactory.createElement("svg:g"),Je.xcoords=[],Je.ycoords=[]}moveText(Je,ir){const rr=this.current;rr.x=rr.lineX+=Je,rr.y=rr.lineY+=ir,rr.xcoords=[],rr.ycoords=[],rr.tspan=this.svgFactory.createElement("svg:tspan"),rr.tspan.setAttributeNS(null,"font-family",rr.fontFamily),rr.tspan.setAttributeNS(null,"font-size",`${qe(rr.fontSize)}px`),rr.tspan.setAttributeNS(null,"y",qe(-rr.y))}showText(Je){const ir=this.current,rr=ir.font,ar=ir.fontSize;if(ar===0)return;const or=ir.fontSizeScale,pr=ir.charSpacing,tr=ir.wordSpacing,nr=ir.fontDirection,hr=ir.textHScale*nr,sr=rr.vertical,xr=sr?1:-1,Rr=rr.defaultVMetrics,br=ar*ir.fontMatrix[0];let wr=0;for(const kr of Je){if(kr===null){wr+=nr*tr;continue}else if(typeof kr=="number"){wr+=xr*kr*ar/1e3;
3988continue}const cr=(kr.isSpace?tr:0)+pr,dr=kr.fontChar;let ur,gr,_r=kr.width;if(sr){let Ar;const Tr=kr.vmetric||Rr;Ar=kr.vmetric?Tr[1]:_r*.5,Ar=-Ar*br;const Nr=Tr[2]*br;_r=Tr?-Tr[0]:_r,ur=Ar/or,gr=(wr+Nr)/or}else ur=wr/or,gr=0;(kr.isInFont||rr.missingFile)&&(ir.xcoords.push(ir.x+ur),sr&&ir.ycoords.push(-ir.y+gr),ir.tspan.textContent+=dr);const Ir=sr?_r*br-cr*nr:_r*br+cr*nr;wr+=Ir}ir.tspan.setAttributeNS(null,"x",ir.xcoords.map(qe).join(" ")),sr?ir.tspan.setAttributeNS(null,"y",ir.ycoords.map(qe).join(" ")):ir.tspan.setAttributeNS(null,"y",qe(-ir.y)),sr?ir.y-=wr:ir.x+=wr*hr,ir.tspan.setAttributeNS(null,"font-family",ir.fontFamily),ir.tspan.setAttributeNS(null,"font-size",`${qe(ir.fontSize)}px`),ir.fontStyle!==Me.fontStyle&&ir.tspan.setAttributeNS(null,"font-style",ir.fontStyle),ir.fontWeight!==Me.fontWeight&&ir.tspan.setAttributeNS(null,"font-weight",ir.fontWeight);const vr=ir.textRenderingMode&Oe.TextRenderingMode.FILL_STROKE_MASK;if(vr===Oe.TextRenderingMode.FILL||vr===Oe.TextRenderingMode.FILL_STROKE?(ir.fillColor!==Me.fillColor&&ir.tspan.setAttributeNS(null,"fill",ir.fillColor),ir.fillAlpha<1&&ir.tspan.setAttributeNS(null,"fill-opacity",ir.fillAlpha)):ir.textRenderingMode===Oe.TextRenderingMode.ADD_TO_PATH?ir.tspan.setAttributeNS(null,"fill","transparent"):ir.tspan.setAttributeNS(null,"fill","none"),vr===Oe.TextRenderingMode.STROKE||vr===Oe.TextRenderingMode.FILL_STROKE){const kr=1/(ir.textMatrixScale||1);this._setStrokeAttributes(ir.tspan,kr)}let Dr=ir.textMatrix;ir.textRise!==0&&(Dr=Dr.slice(),Dr[5]+=ir.textRise),ir.txtElement.setAttributeNS(null,"transform",`${Ge(Dr)} scale(${qe(hr)}, -1)`),ir.txtElement.setAttributeNS(De,"xml:space","preserve"),ir.txtElement.append(ir.tspan),ir.txtgrp.append(ir.txtElement),this._ensureTransformGroup().append(ir.txtElement)}setLeadingMoveText(Je,ir){this.setLeading(-ir),this.moveText(Je,ir)}addFontStyle(Je){if(!Je.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));const ir=ze(Je.data,Je.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${Je.loadedName}"; src: url(${ir}); } 3989`}setFont(Je){const ir=this.current,rr=this.commonObjs.get(Je[0]);let ar=Je[1];ir.font=rr,this.embedFonts&&!rr.missingFile&&!this.embeddedFonts[rr.loadedName]&&(this.addFontStyle(rr),this.embeddedFonts[rr.loadedName]=rr),ir.fontMatrix=rr.fontMatrix||Oe.FONT_IDENTITY_MATRIX;let or="normal";rr.black?or="900":rr.bold&&(or="bold");const pr=rr.italic?"italic":"normal";ar<0?(ar=-ar,ir.fontDirection=-1):ir.fontDirection=1,ir.fontSize=ar,ir.fontFamily=rr.loadedName,ir.fontWeight=or,ir.fontStyle=pr,ir.tspan=this.svgFactory.createElement("svg:tspan"),ir.tspan.setAttributeNS(null,"y",qe(-ir.y)),ir.xcoords=[],ir.ycoords=[]}endText(){var ir;const Je=this.current;Je.textRenderingMode&Oe.TextRenderingMode.ADD_TO_PATH_FLAG&&((ir=Je.txtElement)!=null&&ir.hasChildNodes())&&(Je.element=Je.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(Je){Je>0&&(this.current.lineWidth=Je)}setLineCap(Je){this.current.lineCap=Be[Je]}setLineJoin(Je){this.current.lineJoin=Ue[Je]}setMiterLimit(Je){this.current.miterLimit=Je}setStrokeAlpha(Je){this.current.strokeAlpha=Je}setStrokeRGBColor(Je,ir,rr){this.current.strokeColor=Oe.Util.makeHexColor(Je,ir,rr)}setFillAlpha(Je){this.current.fillAlpha=Je}setFillRGBColor(Je,ir,rr){this.current.fillColor=Oe.Util.makeHexColor(Je,ir,rr),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(Je){this.current.strokeColor=this._makeColorN_Pattern(Je)}setFillColorN(Je){this.current.fillColor=this._makeColorN_Pattern(Je)}shadingFill(Je){const{width:ir,height:rr}=this.viewport,ar=Oe.Util.inverseTransform(this.transformMatrix),[or,pr,tr,nr]=Oe.Util.getAxialAlignedBoundingBox([0,0,ir,rr],ar),hr=this.svgFactory.createElement("svg:rect");hr.setAttributeNS(null,"x",or),hr.setAttributeNS(null,"y",pr),hr.setAttributeNS(null,"width",tr-or),hr.setAttributeNS(null,"height",nr-pr),hr.setAttributeNS(null,"fill",this._makeShadingPattern(Je)),this.current.fillAlpha<1&&hr.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(hr)}_makeColorN_Pattern(Je){return Je[0]==="TilingPattern"?this._makeTilingPattern(Je):this._makeShadingPattern(Je)}_makeTilingPattern(Je){const ir=Je[1],rr=Je[2],ar=Je[3]||Oe.IDENTITY_MATRIX,[or,pr,tr,nr]=Je[4],hr=Je[5],sr=Je[6],xr=Je[7],Rr=`shading${Ke++}`,[br,wr,vr,Dr]=Oe.Util.normalizeRect([...Oe.Util.applyTransform([or,pr],ar),...Oe.Util.applyTransform([tr,nr],ar)]),[kr,cr]=Oe.Util.singularValueDecompose2dScale(ar),dr=hr*kr,ur=sr*cr,gr=this.svgFactory.createElement("svg:pattern");gr.setAttributeNS(null,"id",Rr),gr.setAttributeNS(null,"patternUnits","userSpaceOnUse"),gr.setAttributeNS(null,"width",dr),gr.setAttributeNS(null,"height",ur),gr.setAttributeNS(null,"x",`${br}`),gr.setAttributeNS(null,"y",`${wr}`);const _r=this.svg,Ir=this.transformMatrix,Ar=this.current.fillColor,Tr=this.current.strokeColor,Nr=this.svgFactory.create(vr-br,Dr-wr);if(this.svg=Nr,this.transformMatrix=ar,xr===2){const Br=Oe.Util.makeHexColor(...ir);this.current.fillColor=Br,this.current.strokeColor=Br}return this.executeOpTree(this.convertOpList(rr)),this.svg=_r,this.transformMatrix=Ir,this.current.fillColor=Ar,this.current.strokeColor=Tr,gr.append(Nr.childNodes[0]),this.defs.append(gr),`url(#${Rr})`}_makeShadingPattern(Je){switch(typeof Je=="string"&&(Je=this.objs.get(Je)),Je[0]){case"RadialAxial":const ir=`shading${Ke++}`,rr=Je[3];let ar;switch(Je[1]){case"axial":const or=Je[4],pr=Je[5];ar=this.svgFactory.createElement("svg:linearGradient"),ar.setAttributeNS(null,"id",ir),ar.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),ar.setAttributeNS(null,"x1",or[0]),ar.setAttributeNS(null,"y1",or[1]),ar.setAttributeNS(null,"x2",pr[0]),ar.setAttributeNS(null,"y2",pr[1]);break;case"radial":const tr=Je[4],nr=Je[5],hr=Je[6],sr=Je[7];ar=this.svgFactory.createElement("svg:radialGradient"),ar.setAttributeNS(null,"id",ir),ar.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),ar.setAttributeNS(null,"cx",nr[0]),ar.setAttributeNS(null,"cy",nr[1]),ar.setAttributeNS(null,"r",sr),ar.setAttributeNS(null,"fx",tr[0]),ar.setAttributeNS(null,"fy",tr[1]),ar.setAttributeNS(null,"fr",hr);break;default:throw new Error(`Unknown RadialAxial type: ${Je[1]}`)}for(const or of rr){const pr=this.svgFactory.createElement("svg:stop");
vendor: 6,993 bytes, line 3989
3989pr.setAttributeNS(null,"offset",or[0]),pr.setAttributeNS(null,"stop-color",or[1]),ar.append(pr)}return this.defs.append(ar),`url(#${ir})`;case"Mesh":return(0,Oe.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${Je[0]}`)}}setDash(Je,ir){this.current.dashArray=Je,this.current.dashPhase=ir}constructPath(Je,ir){const rr=this.current;let ar=rr.x,or=rr.y,pr=[],tr=0;for(const nr of Je)switch(nr|0){case Oe.OPS.rectangle:ar=ir[tr++],or=ir[tr++];const hr=ir[tr++],sr=ir[tr++],xr=ar+hr,Rr=or+sr;pr.push("M",qe(ar),qe(or),"L",qe(xr),qe(or),"L",qe(xr),qe(Rr),"L",qe(ar),qe(Rr),"Z");break;case Oe.OPS.moveTo:ar=ir[tr++],or=ir[tr++],pr.push("M",qe(ar),qe(or));break;case Oe.OPS.lineTo:ar=ir[tr++],or=ir[tr++],pr.push("L",qe(ar),qe(or));break;case Oe.OPS.curveTo:ar=ir[tr+4],or=ir[tr+5],pr.push("C",qe(ir[tr]),qe(ir[tr+1]),qe(ir[tr+2]),qe(ir[tr+3]),qe(ar),qe(or)),tr+=6;break;case Oe.OPS.curveTo2:pr.push("C",qe(ar),qe(or),qe(ir[tr]),qe(ir[tr+1]),qe(ir[tr+2]),qe(ir[tr+3])),ar=ir[tr+2],or=ir[tr+3],tr+=4;break;case Oe.OPS.curveTo3:ar=ir[tr+2],or=ir[tr+3],pr.push("C",qe(ir[tr]),qe(ir[tr+1]),qe(ar),qe(or),qe(ar),qe(or)),tr+=4;break;case Oe.OPS.closePath:pr.push("Z");break}pr=pr.join(" "),rr.path&&Je.length>0&&Je[0]!==Oe.OPS.rectangle&&Je[0]!==Oe.OPS.moveTo?pr=rr.path.getAttributeNS(null,"d")+pr:(rr.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(rr.path)),rr.path.setAttributeNS(null,"d",pr),rr.path.setAttributeNS(null,"fill","none"),rr.element=rr.path,rr.setCurrentPoint(ar,or)}endPath(){const Je=this.current;if(Je.path=null,!this.pendingClip)return;if(!Je.element){this.pendingClip=null;return}const ir=`clippath${Ye++}`,rr=this.svgFactory.createElement("svg:clipPath");rr.setAttributeNS(null,"id",ir),rr.setAttributeNS(null,"transform",Ge(this.transformMatrix));const ar=Je.element.cloneNode(!0);if(this.pendingClip==="evenodd"?ar.setAttributeNS(null,"clip-rule","evenodd"):ar.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,rr.append(ar),this.defs.append(rr),Je.activeClipUrl){Je.clipGroup=null;for(const or of this.extraStack)or.clipGroup=null;rr.setAttributeNS(null,"clip-path",Je.activeClipUrl)}Je.activeClipUrl=`url(#${ir})`,this.tgrp=null}clip(Je){this.pendingClip=Je}closePath(){const Je=this.current;if(Je.path){const ir=`${Je.path.getAttributeNS(null,"d")}Z`;Je.path.setAttributeNS(null,"d",ir)}}setLeading(Je){this.current.leading=-Je}setTextRise(Je){this.current.textRise=Je}setTextRenderingMode(Je){this.current.textRenderingMode=Je}setHScale(Je){this.current.textHScale=Je/100}setRenderingIntent(Je){}setFlatness(Je){}setGState(Je){for(const[ir,rr]of Je)switch(ir){case"LW":this.setLineWidth(rr);break;case"LC":this.setLineCap(rr);break;case"LJ":this.setLineJoin(rr);break;case"ML":this.setMiterLimit(rr);break;case"D":this.setDash(rr[0],rr[1]);break;case"RI":this.setRenderingIntent(rr);break;case"FL":this.setFlatness(rr);break;case"Font":this.setFont(rr);break;case"CA":this.setStrokeAlpha(rr);break;case"ca":this.setFillAlpha(rr);break;default:(0,Oe.warn)(`Unimplemented graphic state operator ${ir}`);break}}fill(){const Je=this.current;Je.element&&(Je.element.setAttributeNS(null,"fill",Je.fillColor),Je.element.setAttributeNS(null,"fill-opacity",Je.fillAlpha),this.endPath())}stroke(){const Je=this.current;Je.element&&(this._setStrokeAttributes(Je.element),Je.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(Je,ir=1){const rr=this.current;let ar=rr.dashArray;ir!==1&&ar.length>0&&(ar=ar.map(function(or){return ir*or})),Je.setAttributeNS(null,"stroke",rr.strokeColor),Je.setAttributeNS(null,"stroke-opacity",rr.strokeAlpha),Je.setAttributeNS(null,"stroke-miterlimit",qe(rr.miterLimit)),Je.setAttributeNS(null,"stroke-linecap",rr.lineCap),Je.setAttributeNS(null,"stroke-linejoin",rr.lineJoin),Je.setAttributeNS(null,"stroke-width",qe(ir*rr.lineWidth)+"px"),Je.setAttributeNS(null,"stroke-dasharray",ar.map(qe).join(" ")),Je.setAttributeNS(null,"stroke-dashoffset",qe(ir*rr.dashPhase)+"px")}eoFill(){var Je;(Je=this.current.element)==null||Je.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var Je;(Je=this.current.element)==null||Je.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const Je=this.svgFactory.createElement("svg:rect");Je.setAttributeNS(null,"x","0"),Je.setAttributeNS(null,"y","0"),Je.setAttributeNS(null,"width","1px"),Je.setAttributeNS(null,"height","1px"),Je.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(Je)}paintImageXObject(Je){const ir=this.getObject(Je);if(!ir){(0,Oe.warn)(`Dependent image with object ID ${Je} is not ready yet`);return}this.paintInlineImageXObject(ir)}paintInlineImageXObject(Je,ir){const rr=Je.width,ar=Je.height,or=We(Je,this.forceDataSchema,!!ir),pr=this.svgFactory.createElement("svg:rect");pr.setAttributeNS(null,"x","0"),pr.setAttributeNS(null,"y","0"),pr.setAttributeNS(null,"width",qe(rr)),pr.setAttributeNS(null,"height",qe(ar)),this.current.element=pr,this.clip("nonzero");const tr=this.svgFactory.createElement("svg:image");tr.setAttributeNS($e,"xlink:href",or),tr.setAttributeNS(null,"x","0"),tr.setAttributeNS(null,"y",qe(-ar)),tr.setAttributeNS(null,"width",qe(rr)+"px"),tr.setAttributeNS(null,"height",qe(ar)+"px"),tr.setAttributeNS(null,"transform",`scale(${qe(1/rr)} ${qe(-1/ar)})`),ir?ir.append(tr):this._ensureTransformGroup().append(tr)}paintImageMaskXObject(Je){const ir=this.getObject(Je.data,Je);if(ir.bitmap){(0,Oe.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const rr=this.current,ar=ir.width,or=ir.height,pr=rr.fillColor;rr.maskId=`mask${Ve++}`;const tr=this.svgFactory.createElement("svg:mask");tr.setAttributeNS(null,"id",rr.maskId);const nr=this.svgFactory.createElement("svg:rect");nr.setAttributeNS(null,"x","0"),nr.setAttributeNS(null,"y","0"),nr.setAttributeNS(null,"width",qe(ar)),nr.setAttributeNS(null,"height",qe(or)),nr.setAttributeNS(null,"fill",pr),nr.setAttributeNS(null,"mask",`url(#${rr.maskId})`),this.defs.append(tr),this._ensureTransformGroup().append(nr),this.paintInlineImageXObject(ir,tr)}paintFormXObjectBegin(Je,ir){if(Array.isArray(Je)&&Je.length===6&&this.transform(Je[0],Je[1],Je[2],Je[3],Je[4],Je[5]),ir){const rr=ir[2]-ir[0],ar=ir[3]-ir[1],or=this.svgFactory.createElement("svg:rect");or.setAttributeNS(null,"x",ir[0]),or.setAttributeNS(null,"y",ir[1]),or.setAttributeNS(null,"width",qe(rr)),or.setAttributeNS(null,"height",qe(ar)),this.current.element=or,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(Je){const ir=this.svgFactory.create(Je.width,Je.height),rr=this.svgFactory.createElement("svg:defs");
3989ir.append(rr),this.defs=rr;const ar=this.svgFactory.createElement("svg:g");return ar.setAttributeNS(null,"transform",Ge(Je.transform)),ir.append(ar),this.svg=ar,ir}_ensureClipGroup(){if(!this.current.clipGroup){const Je=this.svgFactory.createElement("svg:g");Je.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(Je),this.current.clipGroup=Je}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",Ge(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}Re.SVGGraphics=Qe},(Ee,Re)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.XfaText=void 0;class Te{static textContent(Oe){const Me=[],De={items:Me,styles:Object.create(null)};function $e(Be){var We;if(!Be)return;let Ue=null;const ze=Be.name;if(ze==="#text")Ue=Be.value;else if(Te.shouldBuildText(ze))(We=Be==null?void 0:Be.attributes)!=null&&We.textContent?Ue=Be.attributes.textContent:Be.value&&(Ue=Be.value);else return;if(Ue!==null&&Me.push({str:Ue}),!!Be.children)for(const Xe of Be.children)$e(Xe)}return $e(Oe),De}static shouldBuildText(Oe){return!(Oe==="textarea"||Oe==="input"||Oe==="option"||Oe==="select")}}Re.XfaText=Te},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.TextLayerRenderTask=void 0,Re.renderTextLayer=Ge,Re.updateTextLayer=Ye;var je=Te(1),Oe=Te(6);const Me=1e5,De=30,$e=.8,Be=new Map;function Ue(Ve,Ke){let Qe;if(Ke&&je.FeatureTest.isOffscreenCanvasSupported)Qe=new OffscreenCanvas(Ve,Ve).getContext("2d",{alpha:!1});else{const Ze=document.createElement("canvas");Ze.width=Ze.height=Ve,Qe=Ze.getContext("2d",{alpha:!1})}return Qe}function ze(Ve,Ke){const Qe=Be.get(Ve);if(Qe)return Qe;const Ze=Ue(De,Ke);Ze.font=`${De}px ${Ve}`;const Je=Ze.measureText("");let ir=Je.fontBoundingBoxAscent,rr=Math.abs(Je.fontBoundingBoxDescent);if(ir){const or=ir/(ir+rr);return Be.set(Ve,or),Ze.canvas.width=Ze.canvas.height=0,or}Ze.strokeStyle="red",Ze.clearRect(0,0,De,De),Ze.strokeText("g",0,0);let ar=Ze.getImageData(0,0,De,De).data;rr=0;for(let or=ar.length-1-3;or>=0;or-=4)if(ar[or]>0){rr=Math.ceil(or/4/De);break}Ze.clearRect(0,0,De,De),Ze.strokeText("A",0,De),ar=Ze.getImageData(0,0,De,De).data,ir=0;for(let or=0,pr=ar.length;or<pr;or+=4)if(ar[or]>0){ir=De-Math.floor(or/4/De);break}if(Ze.canvas.width=Ze.canvas.height=0,ir){const or=ir/(ir+rr);return Be.set(Ve,or),or}return Be.set(Ve,$e),$e}function We(Ve,Ke,Qe){const Ze=document.createElement("span"),Je={angle:0,canvasWidth:0,hasText:Ke.str!=="",hasEOL:Ke.hasEOL,fontSize:0};Ve._textDivs.push(Ze);const ir=je.Util.transform(Ve._transform,Ke.transform);let rr=Math.atan2(ir[1],ir[0]);const ar=Qe[Ke.fontName];ar.vertical&&(rr+=Math.PI/2);const or=Math.hypot(ir[2],ir[3]),pr=or*ze(ar.fontFamily,Ve._isOffscreenCanvasSupported);let tr,nr;rr===0?(tr=ir[4],nr=ir[5]-pr):(tr=ir[4]+pr*Math.sin(rr),nr=ir[5]-pr*Math.cos(rr));const hr="calc(var(--scale-factor)*",sr=Ze.style;Ve._container===Ve._rootContainer?(sr.left=`${(100*tr/Ve._pageWidth).toFixed(2)}%`,sr.top=`${(100*nr/Ve._pageHeight).toFixed(2)}%`):(sr.left=`${hr}${tr.toFixed(2)}px)`,sr.top=`${hr}${nr.toFixed(2)}px)`),sr.fontSize=`${hr}${or.toFixed(2)}px)`,sr.fontFamily=ar.fontFamily,Je.fontSize=or,Ze.setAttribute("role","presentation"),Ze.textContent=Ke.str,Ze.dir=Ke.dir,Ve._fontInspectorEnabled&&(Ze.dataset.fontName=Ke.fontName),rr!==0&&(Je.angle=rr*(180/Math.PI));let xr=!1;if(Ke.str.length>1)xr=!0;else if(Ke.str!==" "&&Ke.transform[0]!==Ke.transform[3]){const Rr=Math.abs(Ke.transform[0]),br=Math.abs(Ke.transform[3]);Rr!==br&&Math.max(Rr,br)/Math.min(Rr,br)>1.5&&(xr=!0)}xr&&(Je.canvasWidth=ar.vertical?Ke.height:Ke.width),Ve._textDivProperties.set(Ze,Je),Ve._isReadableStream&&Ve._layoutText(Ze)}function Xe(Ve){const{div:Ke,scale:Qe,properties:Ze,ctx:Je,prevFontSize:ir,prevFontFamily:rr}=Ve,{style:ar}=Ke;let or="";if(Ze.canvasWidth!==0&&Ze.hasText){const{fontFamily:pr}=ar,{canvasWidth:tr,fontSize:nr}=Ze;(ir!==nr||rr!==pr)&&(Je.font=`${nr*Qe}px ${pr}`,Ve.prevFontSize=nr,Ve.prevFontFamily=pr);const{width:hr}=Je.measureText(Ke.textContent);hr>0&&(or=`scaleX(${tr*Qe/hr})`)}Ze.angle!==0&&(or=`rotate(${Ze.angle}deg) ${or}`),or.length>0&&(ar.transform=or)}function He(Ve){if(Ve._canceled)return;const Ke=Ve._textDivs,Qe=Ve._capability;if(Ke.length>Me){Qe.resolve();return}if(!Ve._isReadableStream)for(const Je of Ke)Ve._layoutText(Je);Qe.resolve()}class qe{constructor({textContentSource:Ke,container:Qe,viewport:Ze,textDivs:Je,textDivProperties:ir,textContentItemsStr:rr,isOffscreenCanvasSupported:ar}){var hr;this._textContentSource=Ke,this._isReadableStream=Ke instanceof ReadableStream,this._container=this._rootContainer=Qe,this._textDivs=Je||[],this._textContentItemsStr=rr||[],this._isOffscreenCanvasSupported=ar,this._fontInspectorEnabled=!!((hr=globalThis.FontInspector)!=null&&hr.enabled),this._reader=null,this._textDivProperties=ir||new WeakMap,this._canceled=!1,this._capability=new je.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:Ze.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:Ue(0,ar)};const{pageWidth:or,pageHeight:pr,pageX:tr,pageY:nr}=Ze.rawDims;this._transform=[1,0,0,-1,-tr,nr+pr],this._pageWidth=or,this._pageHeight=pr,(0,Oe.setLayerDimensions)(Qe,Ze),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new je.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new je.AbortException("TextLayer task cancelled."))}_processItems(Ke,Qe){for(const Ze of Ke){if(Ze.str===void 0){if(Ze.type==="beginMarkedContentProps"||Ze.type==="beginMarkedContent"){const Je=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),Ze.id!==null&&this._container.setAttribute("id",`${Ze.id}`),Je.append(this._container)}else Ze.type==="endMarkedContent"&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(Ze.str),We(this,Ze,Qe)}}_layoutText(Ke){const Qe=this._layoutTextParams.properties=this._textDivProperties.get(Ke);if(this._layoutTextParams.div=Ke,Xe(this._layoutTextParams),Qe.hasText&&this._container.append(Ke),Qe.hasEOL){const Ze=document.createElement("br");Ze.setAttribute("role","presentation"),this._container.append(Ze)}}_render(){const Ke=new je.PromiseCapability;let Qe=Object.create(null);if(this._isReadableStream){const Ze=()=>{this._reader.read().then(({value:Je,done:ir})=>{if(ir){Ke.resolve();return}Object.assign(Qe,Je.styles),this._processItems(Je.items,Qe),Ze()},Ke.reject)};this._reader=this._textContentSource.getReader(),Ze()}else if(this._textContentSource){const{items:Ze,styles:Je}=this._textContentSource;this._processItems(Ze,Je),Ke.resolve()}else throw new Error('No "textContentSource" parameter specified.');Ke.promise.then(()=>{Qe=null,He(this)},this._capability.reject)}}Re.TextLayerRenderTask=qe;function Ge(Ve){!Ve.textContentSource&&(Ve.textContent||Ve.textContentStream)&&((0,Oe.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),Ve.textContentSource=Ve.textContent||Ve.textContentStream);const{container:Ke,viewport:Qe}=Ve,Ze=getComputedStyle(Ke),Je=Ze.getPropertyValue("visibility"),ir=parseFloat(Ze.getPropertyValue("--scale-factor"));Je==="visible"&&(!ir||Math.abs(ir-Qe.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const rr=new qe(Ve);return rr._render(),rr}function Ye({container:Ve,viewport:Ke,textDivs:Qe,textDivProperties:Ze,isOffscreenCanvasSupported:Je,mustRotate:ir=!0,mustRescale:rr=!0}){if(ir&&(0,Oe.setLayerDimensions)(Ve,{rotation:Ke.rotation}),rr){const ar=Ue(0,Je),pr={prevFontSize:null,prevFontFamily:null,div:null,scale:Ke.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:ar};for(const tr of Qe)pr.properties=Ze.get(tr),pr.div=tr,Xe(pr)}}},(Ee,Re,Te)=>{var ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze,Ac,Dl,Rc,Pc;
3989Object.defineProperty(Re,"__esModule",{value:!0}),Re.AnnotationEditorLayer=void 0;var je=Te(1),Oe=Te(4),Me=Te(28),De=Te(33),$e=Te(6),Be=Te(34);const or=class or{constructor({uiManager:tr,pageIndex:nr,div:hr,accessibilityManager:sr,annotationLayer:xr,viewport:Rr,l10n:br}){Pn(this,Ze);Pn(this,ze);Pn(this,We,!1);Pn(this,Xe,null);Pn(this,He,this.pointerup.bind(this));Pn(this,qe,this.pointerdown.bind(this));Pn(this,Ge,new Map);Pn(this,Ye,!1);Pn(this,Ve,!1);Pn(this,Ke,!1);Pn(this,Qe);const wr=[Me.FreeTextEditor,De.InkEditor,Be.StampEditor];if(!or._initialized){or._initialized=!0;for(const vr of wr)vr.initialize(br)}tr.registerEditorTypes(wr),kn(this,Qe,tr),this.pageIndex=nr,this.div=hr,kn(this,ze,sr),kn(this,Xe,xr),this.viewport=Rr,Pr(this,Qe).addLayer(this)}get isEmpty(){return Pr(this,Ge).size===0}updateToolbar(tr){Pr(this,Qe).updateToolbar(tr)}updateMode(tr=Pr(this,Qe).getMode()){vn(this,Ze,Pc).call(this),tr===je.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),tr!==je.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",tr===je.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",tr===je.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",tr===je.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(tr){if(!tr&&Pr(this,Qe).getMode()!==je.AnnotationEditorType.INK)return;if(!tr){for(const hr of Pr(this,Ge).values())if(hr.isEmpty()){hr.setInBackground();return}}vn(this,Ze,Dl).call(this,{offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(tr){Pr(this,Qe).setEditingState(tr)}addCommands(tr){Pr(this,Qe).addCommands(tr)}enable(){this.div.style.pointerEvents="auto";const tr=new Set;for(const hr of Pr(this,Ge).values())hr.enableEditing(),hr.annotationElementId&&tr.add(hr.annotationElementId);if(!Pr(this,Xe))return;const nr=Pr(this,Xe).getEditableAnnotations();for(const hr of nr){if(hr.hide(),Pr(this,Qe).isDeletedAnnotationElement(hr.data.id)||tr.has(hr.data.id))continue;const sr=this.deserialize(hr);sr&&(this.addOrRebuild(sr),sr.enableEditing())}}disable(){var nr;kn(this,Ke,!0),this.div.style.pointerEvents="none";const tr=new Set;for(const hr of Pr(this,Ge).values()){if(hr.disableEditing(),!hr.annotationElementId||hr.serialize()!==null){tr.add(hr.annotationElementId);continue}(nr=this.getEditableAnnotation(hr.annotationElementId))==null||nr.show(),hr.remove()}if(Pr(this,Xe)){const hr=Pr(this,Xe).getEditableAnnotations();for(const sr of hr){const{id:xr}=sr.data;tr.has(xr)||Pr(this,Qe).isDeletedAnnotationElement(xr)||sr.show()}}vn(this,Ze,Pc).call(this),this.isEmpty&&(this.div.hidden=!0),kn(this,Ke,!1)}getEditableAnnotation(tr){var nr;return((nr=Pr(this,Xe))==null?void 0:nr.getEditableAnnotation(tr))||null}setActiveEditor(tr){Pr(this,Qe).getActive()!==tr&&Pr(this,Qe).setActiveEditor(tr)}enableClick(){this.div.addEventListener("pointerdown",Pr(this,qe)),this.div.addEventListener("pointerup",Pr(this,He))}disableClick(){this.div.removeEventListener("pointerdown",Pr(this,qe)),this.div.removeEventListener("pointerup",Pr(this,He))}attach(tr){Pr(this,Ge).set(tr.id,tr);const{annotationElementId:nr}=tr;nr&&Pr(this,Qe).isDeletedAnnotationElement(nr)&&Pr(this,Qe).removeDeletedAnnotationElement(tr)}detach(tr){var nr;Pr(this,Ge).delete(tr.id),(nr=Pr(this,ze))==null||nr.removePointerInTextLayer(tr.contentDiv),!Pr(this,Ke)&&tr.annotationElementId&&Pr(this,Qe).addDeletedAnnotationElement(tr)}remove(tr){this.detach(tr),Pr(this,Qe).removeEditor(tr),tr.div.contains(document.activeElement)&&setTimeout(()=>{Pr(this,Qe).focusMainContainer()},0),tr.div.remove(),tr.isAttachedToDOM=!1,Pr(this,Ve)||this.addInkEditorIfNeeded(!1)}changeParent(tr){var nr;tr.parent!==this&&(tr.annotationElementId&&(Pr(this,Qe).addDeletedAnnotationElement(tr.annotationElementId),Oe.AnnotationEditor.deleteAnnotationElement(tr),tr.annotationElementId=null),this.attach(tr),(nr=tr.parent)==null||nr.detach(tr),tr.setParent(this),tr.div&&tr.isAttachedToDOM&&(tr.div.remove(),this.div.append(tr.div)))}add(tr){if(this.changeParent(tr),Pr(this,Qe).addEditor(tr),this.attach(tr),!tr.isAttachedToDOM){const nr=tr.render();this.div.append(nr),tr.isAttachedToDOM=!0}tr.fixAndSetPosition(),tr.onceAdded(),Pr(this,Qe).addToAnnotationStorage(tr)}moveEditorInDOM(tr){var hr;if(!tr.isAttachedToDOM)return;const{activeElement:nr}=document;tr.div.contains(nr)&&(tr._focusEventsAllowed=!1,setTimeout(()=>{tr.div.contains(document.activeElement)?tr._focusEventsAllowed=!0:(tr.div.addEventListener("focusin",()=>{tr._focusEventsAllowed=!0},{once:!0}),nr.focus())},0)),tr._structTreeParentId=(hr=Pr(this,ze))==null?void 0:hr.moveElementInDOM(this.div,tr.div,tr.contentDiv,!0)}addOrRebuild(tr){tr.needsToBeRebuilt()?tr.rebuild():this.add(tr)}addUndoableEditor(tr){const nr=()=>
3989tr._uiManager.rebuild(tr),hr=()=>{tr.remove()};this.addCommands({cmd:nr,undo:hr,mustExec:!1})}getNextId(){return Pr(this,Qe).getId()}pasteEditor(tr,nr){Pr(this,Qe).updateToolbar(tr),Pr(this,Qe).updateMode(tr);const{offsetX:hr,offsetY:sr}=vn(this,Ze,Rc).call(this),xr=this.getNextId(),Rr=vn(this,Ze,Ac).call(this,{parent:this,id:xr,x:hr,y:sr,uiManager:Pr(this,Qe),isCentered:!0,...nr});Rr&&this.add(Rr)}deserialize(tr){switch(tr.annotationType??tr.annotationEditorType){case je.AnnotationEditorType.FREETEXT:return Me.FreeTextEditor.deserialize(tr,this,Pr(this,Qe));case je.AnnotationEditorType.INK:return De.InkEditor.deserialize(tr,this,Pr(this,Qe));case je.AnnotationEditorType.STAMP:return Be.StampEditor.deserialize(tr,this,Pr(this,Qe))}return null}addNewEditor(){vn(this,Ze,Dl).call(this,vn(this,Ze,Rc).call(this),!0)}setSelected(tr){Pr(this,Qe).setSelected(tr)}toggleSelected(tr){Pr(this,Qe).toggleSelected(tr)}isSelected(tr){return Pr(this,Qe).isSelected(tr)}unselect(tr){Pr(this,Qe).unselect(tr)}pointerup(tr){const{isMac:nr}=je.FeatureTest.platform;if(!(tr.button!==0||tr.ctrlKey&&nr)&&tr.target===this.div&&Pr(this,Ye)){if(kn(this,Ye,!1),!Pr(this,We)){kn(this,We,!0);return}if(Pr(this,Qe).getMode()===je.AnnotationEditorType.STAMP){Pr(this,Qe).unselectAll();return}vn(this,Ze,Dl).call(this,tr,!1)}}pointerdown(tr){if(Pr(this,Ye)){kn(this,Ye,!1);return}const{isMac:nr}=je.FeatureTest.platform;if(tr.button!==0||tr.ctrlKey&&nr||tr.target!==this.div)return;kn(this,Ye,!0);const hr=Pr(this,Qe).getActive();kn(this,We,!hr||hr.isEmpty())}findNewParent(tr,nr,hr){const sr=Pr(this,Qe).findParent(nr,hr);return sr===null||sr===this?!1:(sr.changeParent(tr),!0)}destroy(){var tr,nr;((tr=Pr(this,Qe).getActive())==null?void 0:tr.parent)===this&&(Pr(this,Qe).commitOrRemove(),Pr(this,Qe).setActiveEditor(null));for(const hr of Pr(this,Ge).values())(nr=Pr(this,ze))==null||nr.removePointerInTextLayer(hr.contentDiv),hr.setParent(null),hr.isAttachedToDOM=!1,hr.div.remove();this.div=null,Pr(this,Ge).clear(),Pr(this,Qe).removeLayer(this)}render({viewport:tr}){this.viewport=tr,(0,$e.setLayerDimensions)(this.div,tr);for(const nr of Pr(this,Qe).getEditors(this.pageIndex))this.add(nr);this.updateMode()}update({viewport:tr}){Pr(this,Qe).commitOrRemove(),this.viewport=tr,(0,$e.setLayerDimensions)(this.div,{rotation:tr.rotation}),this.updateMode()}get pageDimensions(){const{pageWidth:tr,pageHeight:nr}=this.viewport.rawDims;return[tr,nr]}};ze=new WeakMap,We=new WeakMap,Xe=new WeakMap,He=new WeakMap,qe=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,Ve=new WeakMap,Ke=new WeakMap,Qe=new WeakMap,Ze=new WeakSet,Ac=function(tr){switch(Pr(this,Qe).getMode()){case je.AnnotationEditorType.FREETEXT:return new Me.FreeTextEditor(tr);case je.AnnotationEditorType.INK:return new De.InkEditor(tr);case je.AnnotationEditorType.STAMP:return new Be.StampEditor(tr)}return null},Dl=function(tr,nr){const hr=this.getNextId(),sr=vn(this,Ze,Ac).call(this,{parent:this,id:hr,x:tr.offsetX,y:tr.offsetY,uiManager:Pr(this,Qe),isCentered:nr});return sr&&this.add(sr),sr},Rc=function(){const{x:tr,y:nr,width:hr,height:sr}=this.div.getBoundingClientRect(),xr=Math.max(0,tr),Rr=Math.max(0,nr),br=Math.min(window.innerWidth,tr+hr),wr=Math.min(window.innerHeight,nr+sr),vr=(xr+br)/2-tr,Dr=(Rr+wr)/2-nr,[kr,cr]=this.viewport.rotation%180===0?[vr,Dr]:[Dr,vr];return{offsetX:kr,offsetY:cr}},Pc=function(){kn(this,Ve,!0);for(const tr of Pr(this,Ge).values())tr.isEmpty()&&tr.remove();kn(this,Ve,!1)},Es(or,"_initialized",!1);let Ue=or;Re.AnnotationEditorLayer=Ue},(Ee,Re,Te)=>{var Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,$u,Fu,Bu,rl,Tc,Uu,kc;Object.defineProperty(Re,"__esModule",{value:!0}),Re.FreeTextEditor=void 0;var je=Te(1),Oe=Te(5),Me=Te(4),De=Te(29);const or=class or extends Me.AnnotationEditor{constructor(nr){super({...nr,name:"freeTextEditor"});Pn(this,Ve);Pn(this,Be,this.editorDivBlur.bind(this));Pn(this,Ue,this.editorDivFocus.bind(this));Pn(this,ze,this.editorDivInput.bind(this));Pn(this,We,this.editorDivKeydown.bind(this));Pn(this,Xe);Pn(this,He,"");Pn(this,qe,`${this.id}-editor`);Pn(this,Ge);Pn(this,Ye,null);kn(this,Xe,nr.color||or._defaultColor||Me.AnnotationEditor._defaultLineColor),kn(this,Ge,nr.fontSize||or._defaultFontSize)}static get _keyboardManager(){const nr=or.prototype,hr=Rr=>Rr.isEmpty(),sr=Oe.AnnotationEditorUIManager.TRANSLATE_SMALL,xr=Oe.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,je.shadow)(this,"_keyboardManager",new Oe.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],nr.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],nr.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],nr._translateEmpty,{args:[-sr,0],checker:hr}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],nr._translateEmpty,{args:[-xr,0],checker:hr}],[["ArrowRight","mac+ArrowRight"],nr._translateEmpty,{args:[sr,0],checker:hr}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],nr._translateEmpty,{args:[xr,0],checker:hr}],[["ArrowUp","mac+ArrowUp"],nr._translateEmpty,{args:[0,-sr],checker:hr}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],nr._translateEmpty,{args:[0,-xr],checker:hr}],[["ArrowDown","mac+ArrowDown"],nr._translateEmpty,{args:[0,sr],checker:hr}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],nr._translateEmpty,{args:[0,xr],checker:hr}]]))}static initialize(nr){Me.AnnotationEditor.initialize(nr,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const hr=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(hr.getPropertyValue("--freetext-padding"))}static updateDefaultParams(nr,hr){switch(nr){case je.AnnotationEditorParamsType.FREETEXT_S
3989IZE:or._defaultFontSize=hr;break;case je.AnnotationEditorParamsType.FREETEXT_COLOR:or._defaultColor=hr;break}}updateParams(nr,hr){switch(nr){case je.AnnotationEditorParamsType.FREETEXT_SIZE:vn(this,Ve,$u).call(this,hr);break;case je.AnnotationEditorParamsType.FREETEXT_COLOR:vn(this,Ve,Fu).call(this,hr);break}}static get defaultPropertiesToUpdate(){return[[je.AnnotationEditorParamsType.FREETEXT_SIZE,or._defaultFontSize],[je.AnnotationEditorParamsType.FREETEXT_COLOR,or._defaultColor||Me.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[je.AnnotationEditorParamsType.FREETEXT_SIZE,Pr(this,Ge)],[je.AnnotationEditorParamsType.FREETEXT_COLOR,Pr(this,Xe)]]}_translateEmpty(nr,hr){this._uiManager.translateSelectedEditors(nr,hr,!0)}getInitialTranslation(){const nr=this.parentScale;return[-or._internalPadding*nr,-(or._internalPadding+Pr(this,Ge))*nr]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(je.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",Pr(this,We)),this.editorDiv.addEventListener("focus",Pr(this,Ue)),this.editorDiv.addEventListener("blur",Pr(this,Be)),this.editorDiv.addEventListener("input",Pr(this,ze)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",Pr(this,qe)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",Pr(this,We)),this.editorDiv.removeEventListener("focus",Pr(this,Ue)),this.editorDiv.removeEventListener("blur",Pr(this,Be)),this.editorDiv.removeEventListener("input",Pr(this,ze)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(nr){this._focusEventsAllowed&&(super.focusin(nr),nr.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var nr;if(this.width){vn(this,Ve,kc).call(this);return}this.enableEditMode(),this.editorDiv.focus(),(nr=this._initialOptions)!=null&&nr.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 nr=Pr(this,He),hr=kn(this,He,vn(this,Ve,Bu).call(this).trimEnd());if(nr===hr)return;const sr=xr=>{if(kn(this,He,xr),!xr){this.remove();return}vn(this,Ve,Tc).call(this),this._uiManager.rebuild(this),vn(this,Ve,rl).call(this)};this.addCommands({cmd:()=>{sr(hr)},undo:()=>{sr(nr)},mustExec:!1}),vn(this,Ve,rl).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(nr){this.enterInEditMode()}keydown(nr){nr.target===this.div&&nr.key==="Enter"&&(this.enterInEditMode(),nr.preventDefault())}editorDivKeydown(nr){or._keyboardManager.exec(this,nr)}editorDivFocus(nr){this.isEditing=!0}editorDivBlur(nr){this.isEditing=!1}editorDivInput(nr){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 nr,hr;this.width&&(nr=this.x,hr=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",Pr(this,qe)),this.enableEditing(),Me.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(xr=>{var Rr;return(Rr=this.editorDiv)==null?void 0:Rr.setAttribute("aria-label",xr)}),Me.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(xr=>{var Rr;return(Rr=this.editorDiv)==null?void 0:Rr.setAttribute("default-content",xr)}),this.editorDiv.contentEditable=!0;const{style:sr}=this.editorDiv;if(sr.fontSize=`calc(${Pr(this,Ge)}px * var(--scale-factor))`,sr.color=Pr(this,Xe),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,Oe.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[xr,Rr]=this.parentDimensions;
3989if(this.annotationElementId){const{position:br}=Pr(this,Ye);let[wr,vr]=this.getInitialTranslation();[wr,vr]=this.pageTranslationToScreen(wr,vr);const[Dr,kr]=this.pageDimensions,[cr,dr]=this.pageTranslation;let ur,gr;switch(this.rotation){case 0:ur=nr+(br[0]-cr)/Dr,gr=hr+this.height-(br[1]-dr)/kr;break;case 90:ur=nr+(br[0]-cr)/Dr,gr=hr-(br[1]-dr)/kr,[wr,vr]=[vr,-wr];break;case 180:ur=nr-this.width+(br[0]-cr)/Dr,gr=hr-(br[1]-dr)/kr,[wr,vr]=[-wr,-vr];break;case 270:ur=nr+(br[0]-cr-this.height*kr)/Dr,gr=hr+(br[1]-dr-this.width*Dr)/kr,[wr,vr]=[-vr,wr];break}this.setAt(ur*xr,gr*Rr,wr,vr)}else this.setAt(nr*xr,hr*Rr,this.width*xr,this.height*Rr);vn(this,Ve,Tc).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}get contentDiv(){return this.editorDiv}static deserialize(nr,hr,sr){let xr=null;if(nr instanceof De.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:br,fontColor:wr},rect:vr,rotation:Dr,id:kr},textContent:cr,textPosition:dr,parent:{page:{pageNumber:ur}}}=nr;if(!cr||cr.length===0)return null;xr=nr={annotationType:je.AnnotationEditorType.FREETEXT,color:Array.from(wr),fontSize:br,value:cr.join(` 3990`),position:dr,pageIndex:ur-1,rect:vr,rotation:Dr,id:kr,deleted:!1}}const Rr=super.deserialize(nr,hr,sr);return kn(Rr,Ge,nr.fontSize),kn(Rr,Xe,je.Util.makeHexColor(...nr.color)),kn(Rr,He,nr.value),Rr.annotationElementId=nr.id||null,kn(Rr,Ye,xr),Rr}serialize(nr=!1){if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const hr=or._internalPadding*this.parentScale,sr=this.getRect(hr,hr),xr=Me.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:Pr(this,Xe)),Rr={annotationType:je.AnnotationEditorType.FREETEXT,color:xr,fontSize:Pr(this,Ge),value:Pr(this,He),pageIndex:this.pageIndex,rect:sr,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return nr?Rr:this.annotationElementId&&!vn(this,Ve,Uu).call(this,Rr)?null:(Rr.id=this.annotationElementId,Rr)}};Be=new WeakMap,Ue=new WeakMap,ze=new WeakMap,We=new WeakMap,Xe=new WeakMap,He=new WeakMap,qe=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,Ve=new WeakSet,$u=function(nr){const hr=xr=>{this.editorDiv.style.fontSize=`calc(${xr}px * var(--scale-factor))`,this.translate(0,-(xr-Pr(this,Ge))*this.parentScale),kn(this,Ge,xr),vn(this,Ve,rl).call(this)},sr=Pr(this,Ge);this.addCommands({cmd:()=>{hr(nr)},undo:()=>{hr(sr)},mustExec:!0,type:je.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},Fu=function(nr){const hr=Pr(this,Xe);this.addCommands({cmd:()=>{kn(this,Xe,this.editorDiv.style.color=nr)},undo:()=>{kn(this,Xe,this.editorDiv.style.color=hr)},mustExec:!0,type:je.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Bu=function(){const nr=this.editorDiv.getElementsByTagName("div");if(nr.length===0)return this.editorDiv.innerText;const hr=[];for(const sr of nr)hr.push(sr.innerText.replace(/\r\n?|\n/,""));return hr.join(` 3991`)},rl=function(){const[nr,hr]=this.parentDimensions;let sr;if(this.isAttachedToDOM)sr=this.div.getBoundingClientRect();else{const{currentLayer:xr,div:Rr}=this,br=Rr.style.display;Rr.style.display="hidden",xr.div.append(this.div),sr=Rr.getBoundingClientRect(),Rr.remove(),Rr.style.display=br}this.rotation%180===this.parentRotation%180?(this.width=sr.width/nr,this.height=sr.height/hr):(this.width=sr.height/nr,this.height=sr.width/hr),this.fixAndSetPosition()},Tc=function(){if(this.editorDiv.replaceChildren(),!!Pr(this,He))for(const nr of Pr(this,He).split(` 3992`)){const hr=document.createElement("div");hr.append(nr?document.createTextNode(nr):document.createElement("br")),this.editorDiv.append(hr)}},Uu=function(nr){const{value:hr,fontSize:sr,color:xr,rect:Rr,pageIndex:br}=Pr(this,Ye);return nr.value!==hr||nr.fontSize!==sr||nr.rect.some((wr,vr)=>Math.abs(wr-Rr[vr])>=1)||nr.color.some((wr,vr)=>wr!==xr[vr])||nr.pageIndex!==br},kc=function(nr=!1){if(!this.annotationElementId)return;if(vn(this,Ve,rl).call(this),!nr&&(this.width===0||this.height===0)){setTimeout(()=>vn(this,Ve,kc).call(this,!0),0);return}const hr=or._internalPadding*this.parentScale;Pr(this,Ye).rect=this.getRect(hr,hr)},Es(or,"_freeTextDefaultContent",""),Es(or,"_internalPadding",0),Es(or,"_defaultColor",null),Es(or,"_defaultFontSize",10),Es(or,"_type","freetext");let $e=or;Re.FreeTextEditor=$e},(Ee,Re,Te)=>{var gr,Ir,ca,zu,Nr,Br,Hr,Vr,mr,Sr,Lr,jr,fr,Cr,Mr,$r,Fr,Kr,an,Wr,hn,cn,Hu,Nl,jc,Ic,In,yn,Mn,on,Yr,sn,On,Lc,Hn,Zr,xn,An,Wu,Oc;
3992Object.defineProperty(Re,"__esModule",{value:!0}),Re.StampAnnotationElement=Re.InkAnnotationElement=Re.FreeTextAnnotationElement=Re.AnnotationLayer=void 0;var je=Te(1),Oe=Te(6),Me=Te(3),De=Te(30),$e=Te(31),Be=Te(32);const Ue=1e3,ze=9,We=new WeakSet;function Xe(Yn){return{width:Yn[2]-Yn[0],height:Yn[3]-Yn[1]}}class He{static create(en){switch(en.data.annotationType){case je.AnnotationType.LINK:return new Ge(en);case je.AnnotationType.TEXT:return new Ye(en);case je.AnnotationType.WIDGET:switch(en.data.fieldType){case"Tx":return new Ke(en);case"Btn":return en.data.radioButton?new Je(en):en.data.checkBox?new Ze(en):new ir(en);case"Ch":return new rr(en);case"Sig":return new Qe(en)}return new Ve(en);case je.AnnotationType.POPUP:return new ar(en);case je.AnnotationType.FREETEXT:return new pr(en);case je.AnnotationType.LINE:return new tr(en);case je.AnnotationType.SQUARE:return new nr(en);case je.AnnotationType.CIRCLE:return new hr(en);case je.AnnotationType.POLYLINE:return new sr(en);case je.AnnotationType.CARET:return new Rr(en);case je.AnnotationType.INK:return new br(en);case je.AnnotationType.POLYGON:return new xr(en);case je.AnnotationType.HIGHLIGHT:return new wr(en);case je.AnnotationType.UNDERLINE:return new vr(en);case je.AnnotationType.SQUIGGLY:return new Dr(en);case je.AnnotationType.STRIKEOUT:return new kr(en);case je.AnnotationType.STAMP:return new cr(en);case je.AnnotationType.FILEATTACHMENT:return new dr(en);default:return new qe(en)}}}const _r=class _r{constructor(en,{isRenderable:Gr=!1,ignoreBorder:nn=!1,createQuadrilaterals:En=!1}={}){Pn(this,gr,!1);this.isRenderable=Gr,this.data=en.data,this.layer=en.layer,this.linkService=en.linkService,this.downloadManager=en.downloadManager,this.imageResourcesPath=en.imageResourcesPath,this.renderForms=en.renderForms,this.svgFactory=en.svgFactory,this.annotationStorage=en.annotationStorage,this.enableScripting=en.enableScripting,this.hasJSActions=en.hasJSActions,this._fieldObjects=en.fieldObjects,this.parent=en.parent,Gr&&(this.container=this._createContainer(nn)),En&&this._createQuadrilaterals()}static _hasPopupData({titleObj:en,contentsObj:Gr,richText:nn}){return!!(en!=null&&en.str||Gr!=null&&Gr.str||nn!=null&&nn.str)}get hasPopupData(){return _r._hasPopupData(this.data)}_createContainer(en){const{data:Gr,parent:{page:nn,viewport:En}}=this,Cn=document.createElement("section");Cn.setAttribute("data-annotation-id",Gr.id),this instanceof Ve||(Cn.tabIndex=Ue),Cn.style.zIndex=this.parent.zIndex++,this.data.popupRef&&Cn.setAttribute("aria-haspopup","dialog"),Gr.noRotate&&Cn.classList.add("norotate");const{pageWidth:jn,pageHeight:$n,pageX:Vn,pageY:Qn}=En.rawDims;if(!Gr.rect||this instanceof ar){const{rotation:cs}=Gr;return!Gr.hasOwnCanvas&&cs!==0&&this.setRotation(cs,Cn),Cn}const{width:Un,height:fs}=Xe(Gr.rect),Jn=je.Util.normalizeRect([Gr.rect[0],nn.view[3]-Gr.rect[1]+nn.view[1],Gr.rect[2],nn.view[3]-Gr.rect[3]+nn.view[1]]);if(!en&&Gr.borderStyle.width>0){Cn.style.borderWidth=`${Gr.borderStyle.width}px`;const cs=Gr.borderStyle.horizontalCornerRadius,Sn=Gr.borderStyle.verticalCornerRadius;if(cs>0||Sn>0){const zn=`calc(${cs}px * var(--scale-factor)) / calc(${Sn}px * var(--scale-factor))`;Cn.style.borderRadius=zn}else if(this instanceof Je){const zn=`calc(${Un}px * var(--scale-factor)) / calc(${fs}px * var(--scale-factor))`;Cn.style.borderRadius=zn}switch(Gr.borderStyle.style){case je.AnnotationBorderStyleType.SOLID:Cn.style.borderStyle="solid";break;case je.AnnotationBorderStyleType.DASHED:Cn.style.borderStyle="dashed";break;case je.AnnotationBorderStyleType.BEVELED:(0,je.warn)("Unimplemented border style: beveled");break;case je.AnnotationBorderStyleType.INSET:(0,je.warn)("Unimplemented border style: inset");break;case je.AnnotationBorderStyleType.UNDERLINE:Cn.style.borderBottomStyle="solid";break}const mn=Gr.borderColor||null;mn?(kn(this,gr,!0),Cn.style.borderColor=je.Util.makeHexColor(mn[0]|0,mn[1]|0,mn[2]|0)):Cn.style.borderWidth=0}Cn.style.left=`${100*(Jn[0]-Vn)/jn}%`,Cn.style.top=`${100*(Jn[1]-Qn)/$n}%`;const{rotation:ts}=Gr;return Gr.hasOwnCanvas||ts===0?(Cn.style.width=`${100*Un/jn}%`,Cn.style.height=`${100*fs/$n}%`):this.setRotation(ts,Cn),Cn}setRotation(en,Gr=this.container){if(!this.data.rect)return;const{pageWidth:nn,pageHeight:En}=this.parent.viewport.rawDims,{width:Cn,height:jn}=Xe(this.data.rect);let $n,Vn;en%180===0?($n=100*Cn/nn,Vn=100*jn/En):($n=100*jn/nn,Vn=100*Cn/En),Gr.style.width=`${$n}%`,Gr.style.height=`${Vn}%`,Gr.setAttribute("data-main-rotation",(360-en)%360)}get _commonActions(){const en=(Gr,nn,En)=>{const Cn=En.detail[Gr],jn=Cn[0],$n=Cn.slice(1);En.target.style[nn]=De.ColorConverters[`${jn}_HTML`]($n),this.annotationStorage.setValue(this.data.id,{[nn]:De.ColorConverters[`${jn}_rgb`]($n)})};return(0,je.shadow)(this,"_commonActions",{display:Gr=>{const{display:nn}=Gr.detail,En=nn%2===1;this.container.style.visibility=En?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:En,noPrint:nn===1||nn===2})},print:Gr=>{this.annotationStorage.setValue(this.data.id,{noPrint:!Gr.detail.print})},hidden:Gr=>{const{hidden:nn}=Gr.detail;this.container.style.visibility=nn?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:nn,noView:nn})},focus:Gr=>{setTimeout(()=>
3992Gr.target.focus({preventScroll:!1}),0)},userName:Gr=>{Gr.target.title=Gr.detail.userName},readonly:Gr=>{Gr.target.disabled=Gr.detail.readonly},required:Gr=>{this._setRequired(Gr.target,Gr.detail.required)},bgColor:Gr=>{en("bgColor","backgroundColor",Gr)},fillColor:Gr=>{en("fillColor","backgroundColor",Gr)},fgColor:Gr=>{en("fgColor","color",Gr)},textColor:Gr=>{en("textColor","color",Gr)},borderColor:Gr=>{en("borderColor","borderColor",Gr)},strokeColor:Gr=>{en("strokeColor","borderColor",Gr)},rotation:Gr=>{const nn=Gr.detail.rotation;this.setRotation(nn),this.annotationStorage.setValue(this.data.id,{rotation:nn})}})}_dispatchEventFromSandbox(en,Gr){const nn=this._commonActions;for(const En of Object.keys(Gr.detail)){const Cn=en[En]||nn[En];Cn==null||Cn(Gr)}}_setDefaultPropertiesFromJS(en){if(!this.enableScripting)return;const Gr=this.annotationStorage.getRawValue(this.data.id);if(!Gr)return;const nn=this._commonActions;for(const[En,Cn]of Object.entries(Gr)){const jn=nn[En];if(jn){const $n={detail:{[En]:Cn},target:en};jn($n),delete Gr[En]}}}
3992_createQuadrilaterals(){if(!this.container)return;const{quadPoints:en}=this.data;if(!en)return;const[Gr,nn,En,Cn]=this.data.rect;if(en.length===1){const[,{x:Sn,y:mn},{x:zn,y:os}]=en[0];if(En===Sn&&Cn===mn&&Gr===zn&&nn===os)return}const{style:jn}=this.container;let $n;if(Pr(this,gr)){const{borderColor:Sn,borderWidth:mn}=jn;jn.borderWidth=0,$n=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${Sn}" stroke-width="${mn}">`],this.container.classList.add("hasBorder")}const Vn=En-Gr,Qn=Cn-nn,{svgFactory:Un}=this,fs=Un.createElement("svg");fs.classList.add("quadrilateralsContainer"),fs.setAttribute("width",0),fs.setAttribute("height",0);const Jn=Un.createElement("defs");fs.append(Jn);const ts=Un.createElement("clipPath"),cs=`clippath_${this.data.id}`;ts.setAttribute("id",cs),ts.setAttribute("clipPathUnits","objectBoundingBox"),Jn.append(ts);for(const[,{x:Sn,y:mn},{x:zn,y:os}]of en){const ls=Un.createElement("rect"),hs=(zn-Gr)/Vn,Cs=(Cn-mn)/Qn,Ds=(Sn-zn)/Vn,ho=(mn-os)/Qn;ls.setAttribute("x",hs),ls.setAttribute("y",Cs),ls.setAttribute("width",Ds),ls.setAttribute("height",ho),ts.append(ls),$n==null||$n.push(`<rect vector-effect="non-scaling-stroke" x="${hs}" y="${Cs}" width="${Ds}" height="${ho}"/>`)}Pr(this,gr)&&($n.push("</g></svg>')"),jn.backgroundImage=$n.join("")),this.container.append(fs),this.container.style.clipPath=`url(#${cs})`}_createPopup(){const{container:en,data:Gr}=this;en.setAttribute("aria-haspopup","dialog");const nn=new ar({data:{color:Gr.color,titleObj:Gr.titleObj,modificationDate:Gr.modificationDate,contentsObj:Gr.contentsObj,richText:Gr.richText,parentRect:Gr.rect,borderStyle:0,id:`popup_${Gr.id}`,rotation:Gr.rotation},parent:this.parent,elements:[this]});this.parent.div.append(nn.render())}render(){(0,je.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(en,Gr=null){const nn=[];if(this._fieldObjects){const En=this._fieldObjects[en];if(En)for(const{page:Cn,id:jn,exportValues:$n}of En){if(Cn===-1||jn===Gr)continue;const Vn=typeof $n=="string"?$n:null,Qn=document.querySelector(`[data-element-id="${jn}"]`);if(Qn&&!We.has(Qn)){(0,je.warn)(`_getElementsByName - element not allowed: ${jn}`);continue}nn.push({id:jn,exportValue:Vn,domElement:Qn})}return nn}for(const En of document.getElementsByName(en)){const{exportValue:Cn}=En,jn=En.getAttribute("data-element-id");jn!==Gr&&We.has(En)&&nn.push({id:jn,exportValue:Cn,domElement:En})}return nn}show(){var en;this.container&&(this.container.hidden=!1),(en=this.popup)==null||en.maybeShow()}hide(){var en;this.container&&(this.container.hidden=!0),(en=this.popup)==null||en.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const en=this.getElementsToTriggerPopup();if(Array.isArray(en))for(const Gr of en)Gr.classList.add("highlightArea");else en.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:en,data:{id:Gr}}=this;this.container.addEventListener("dblclick",()=>{var nn;(nn=this.linkService.eventBus)==null||nn.dispatch("switchannotationeditormode",{source:this,mode:en,editId:Gr})})}};gr=new WeakMap;let qe=_r;class Ge extends qe{constructor(Gr,nn=null){super(Gr,{isRenderable:!0,ignoreBorder:!!(nn!=null&&nn.ignoreBorder),createQuadrilaterals:!0});Pn(this,Ir);this.isTooltipOnly=Gr.data.isTooltipOnly}render(){const{data:Gr,linkService:nn}=this,En=document.createElement("a");En.setAttribute("data-element-id",Gr.id);let Cn=!1;return Gr.url?(nn.addLinkAttributes(En,Gr.url,Gr.newWindow),Cn=!0):Gr.action?(this._bindNamedAction(En,Gr.action),Cn=!0):Gr.attachment?(this._bindAttachment(En,Gr.attachment),Cn=!0):Gr.setOCGState?(vn(this,Ir,zu).call(this,En,Gr.setOCGState),Cn=!0):Gr.dest?(this._bindLink(En,Gr.dest),Cn=!0):(Gr.actions&&(Gr.actions.Action||Gr.actions["Mouse Up"]||Gr.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(En,Gr),Cn=!0),Gr.resetForm?(this._bindResetFormAction(En,Gr.resetForm),Cn=!0):this.isTooltipOnly&&!Cn&&(this._bindLink(En,""),Cn=!0)),this.container.classList.add("linkA
3992nnotation"),Cn&&this.container.append(En),this.container}_bindLink(Gr,nn){Gr.href=this.linkService.getDestinationHash(nn),Gr.onclick=()=>(nn&&this.linkService.goToDestination(nn),!1),(nn||nn==="")&&vn(this,Ir,ca).call(this)}_bindNamedAction(Gr,nn){Gr.href=this.linkService.getAnchorUrl(""),Gr.onclick=()=>(this.linkService.executeNamedAction(nn),!1),vn(this,Ir,ca).call(this)}_bindAttachment(Gr,nn){Gr.href=this.linkService.getAnchorUrl(""),Gr.onclick=()=>{var En;return(En=this.downloadManager)==null||En.openOrDownloadData(this.container,nn.content,nn.filename),!1},vn(this,Ir,ca).call(this)}_bindJSAction(Gr,nn){Gr.href=this.linkService.getAnchorUrl("");const En=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const Cn of Object.keys(nn.actions)){const jn=En.get(Cn);jn&&(Gr[jn]=()=>{var $n;return($n=this.linkService.eventBus)==null||$n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:nn.id,name:Cn}}),!1})}Gr.onclick||(Gr.onclick=()=>!1),vn(this,Ir,ca).call(this)}_bindResetFormAction(Gr,nn){const En=Gr.onclick;if(En||(Gr.href=this.linkService.getAnchorUrl("")),vn(this,Ir,ca).call(this),!this._fieldObjects){(0,je.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),En||(Gr.onclick=()=>!1);return}Gr.onclick=()=>{var fs;En==null||En();const{fields:Cn,refs:jn,include:$n}=nn,Vn=[];if(Cn.length!==0||jn.length!==0){const Jn=new Set(jn);for(const ts of Cn){const cs=this._fieldObjects[ts]||[];for(const{id:Sn}of cs)Jn.add(Sn)}for(const ts of Object.values(this._fieldObjects))for(const cs of ts)Jn.has(cs.id)===$n&&Vn.push(cs)}else for(const Jn of Object.values(this._fieldObjects))Vn.push(...Jn);const Qn=this.annotationStorage,Un=[];for(const Jn of Vn){const{id:ts}=Jn;switch(Un.push(ts),Jn.type){case"text":{const Sn=Jn.defaultValue||"";Qn.setValue(ts,{value:Sn});break}case"checkbox":case"radiobutton":{const Sn=Jn.defaultValue===Jn.exportValues;Qn.setValue(ts,{value:Sn});break}case"combobox":case"listbox":{const Sn=Jn.defaultValue||"";Qn.setValue(ts,{value:Sn});break}default:continue}const cs=document.querySelector(`[data-element-id="${ts}"]`);if(cs){if(!We.has(cs)){(0,je.warn)(`_bindResetFormAction - element not allowed: ${ts}`);continue}}else continue;cs.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((fs=this.linkService.eventBus)==null||fs.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:Un,name:"ResetForm"}})),!1}}}Ir=new WeakSet,ca=function(){this.container.setAttribute("data-internal-link","")},zu=function(Gr,nn){Gr.href=this.linkService.getAnchorUrl(""),Gr.onclick=()=>(this.linkService.executeSetOCGState(nn),!1),vn(this,Ir,ca).call(this)};class Ye extends qe{constructor(en){super(en,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const en=document.createElement("img");return en.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",en.alt="[{{type}} Annotation]",en.dataset.l10nId="text_annotation_type",en.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(en),this.container}}class Ve extends qe{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(en){var Gr;this.data.hasOwnCanvas&&(((Gr=en.previousSibling)==null?void 0:Gr.nodeName)==="CANVAS"&&(en.previousSibling.hidden=!0),en.hidden=!1)}_getKeyModifier(en){const{isWin:Gr,isMac:nn}=je.FeatureTest.platform;return Gr&&en.ctrlKey||nn&&en.metaKey}_setEventListener(en,Gr,nn,En,Cn){nn.includes("mouse")?en.addEventListener(nn,jn=>{var $n;($n=this.linkService.eventBus)==null||$n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:En,value:Cn(jn),shift:jn.shiftKey,modifier:this._getKeyModifier(jn)}})}):en.addEventListener(nn,jn=>{var $n;if(nn==="blur"){if(!Gr.focused||!jn.relatedTarget)return;Gr.focused=!1}else if(nn==="focus"){if(Gr.focused)return;Gr.focused=!0}Cn&&(($n=this.linkService.eventBus)==null||$n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:En,value:Cn(jn)}}))})}_setEventListeners(en,Gr,nn,En){var Cn,jn,$n;for(const[Vn,Qn]of nn)(Qn==="Action"||(Cn=this.data.actions)!=null&&Cn[Qn])&&((Qn==="Focus"||Qn==="Blur")&&(Gr||(Gr={focused:!1})),this._setEventListener(en,Gr,Vn,Qn,En),Qn==="Focus"&&!((jn=this.data.actions)!=null&&jn.Blur)?this._setEventListener(en,Gr,"blur","Blur",null):Qn==="Blur"&&!(($n=this.data.actions)!=null&&$n.Focus)&&this._setEventListener(en,Gr,"focus","Focus",null))}
3992_setBackgroundColor(en){const Gr=this.data.backgroundColor||null;en.style.backgroundColor=Gr===null?"transparent":je.Util.makeHexColor(Gr[0],Gr[1],Gr[2])}_setTextStyle(en){const Gr=["left","center","right"],{fontColor:nn}=this.data.defaultAppearanceData,En=this.data.defaultAppearanceData.fontSize||ze,Cn=en.style;let jn;const $n=2,Vn=Qn=>Math.round(10*Qn)/10;if(this.data.multiLine){const Qn=Math.abs(this.data.rect[3]-this.data.rect[1]-$n),Un=Math.round(Qn/(je.LINE_FACTOR*En))||1,fs=Qn/Un;jn=Math.min(En,Vn(fs/je.LINE_FACTOR))}else{const Qn=Math.abs(this.data.rect[3]-this.data.rect[1]-$n);jn=Math.min(En,Vn(Qn/je.LINE_FACTOR))}Cn.fontSize=`calc(${jn}px * var(--scale-factor))`,Cn.color=je.Util.makeHexColor(nn[0],nn[1],nn[2]),this.data.textAlignment!==null&&(Cn.textAlign=Gr[this.data.textAlignment])}_setRequired(en,Gr){Gr?en.setAttribute("required",!0):en.removeAttribute("required"),en.setAttribute("aria-required",Gr)}}class Ke extends Ve{constructor(en){const Gr=en.renderForms||!en.data.hasAppearance&&!!en.data.fieldValue;super(en,{isRenderable:Gr})}setPropertyOnSiblings(en,Gr,nn,En){const Cn=this.annotationStorage;
3992for(const jn of this._getElementsByName(en.name,en.id))jn.domElement&&(jn.domElement[Gr]=nn),Cn.setValue(jn.id,{[En]:nn})}render(){var En,Cn;const en=this.annotationStorage,Gr=this.data.id;this.container.classList.add("textWidgetAnnotation");let nn=null;if(this.renderForms){const jn=en.getValue(Gr,{value:this.data.fieldValue});let $n=jn.value||"";const Vn=en.getValue(Gr,{charLimit:this.data.maxLen}).charLimit;Vn&&$n.length>Vn&&($n=$n.slice(0,Vn));let Qn=jn.formattedValue||((En=this.data.textContent)==null?void 0:En.join(` 3993`))||null;Qn&&this.data.comb&&(Qn=Qn.replaceAll(/\s+/g,""));const Un={userValue:$n,formattedValue:Qn,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(nn=document.createElement("textarea"),nn.textContent=Qn??$n,this.data.doNotScroll&&(nn.style.overflowY="hidden")):(nn=document.createElement("input"),nn.type="text",nn.setAttribute("value",Qn??$n),this.data.doNotScroll&&(nn.style.overflowX="hidden")),this.data.hasOwnCanvas&&(nn.hidden=!0),We.add(nn),nn.setAttribute("data-element-id",Gr),nn.disabled=this.data.readOnly,nn.name=this.data.fieldName,nn.tabIndex=Ue,this._setRequired(nn,this.data.required),Vn&&(nn.maxLength=Vn),nn.addEventListener("input",Jn=>{en.setValue(Gr,{value:Jn.target.value}),this.setPropertyOnSiblings(nn,"value",Jn.target.value,"value"),Un.formattedValue=null}),nn.addEventListener("resetform",Jn=>{const ts=this.data.defaultFieldValue??"";nn.value=Un.userValue=ts,Un.formattedValue=null});let fs=Jn=>{const{formattedValue:ts}=Un;ts!=null&&(Jn.target.value=ts),Jn.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){nn.addEventListener("focus",ts=>{if(Un.focused)return;const{target:cs}=ts;Un.userValue&&(cs.value=Un.userValue),Un.lastCommittedValue=cs.value,Un.commitKey=1,Un.focused=!0}),nn.addEventListener("updatefromsandbox",ts=>{this.showElementAndHideCanvas(ts.target);const cs={value(Sn){Un.userValue=Sn.detail.value??"",en.setValue(Gr,{value:Un.userValue.toString()}),Sn.target.value=Un.userValue},formattedValue(Sn){const{formattedValue:mn}=Sn.detail;Un.formattedValue=mn,mn!=null&&Sn.target!==document.activeElement&&(Sn.target.value=mn),en.setValue(Gr,{formattedValue:mn})},selRange(Sn){Sn.target.setSelectionRange(...Sn.detail.selRange)},charLimit:Sn=>{var ls;const{charLimit:mn}=Sn.detail,{target:zn}=Sn;if(mn===0){zn.removeAttribute("maxLength");return}zn.setAttribute("maxLength",mn);let os=Un.userValue;!os||os.length<=mn||(os=os.slice(0,mn),zn.value=Un.userValue=os,en.setValue(Gr,{value:os}),(ls=this.linkService.eventBus)==null||ls.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Gr,name:"Keystroke",value:os,willCommit:!0,commitKey:1,selStart:zn.selectionStart,selEnd:zn.selectionEnd}}))}};this._dispatchEventFromSandbox(cs,ts)}),nn.addEventListener("keydown",ts=>{var mn;Un.commitKey=1;let cs=-1;if(ts.key==="Escape"?cs=0:ts.key==="Enter"&&!this.data.multiLine?cs=2:ts.key==="Tab"&&(Un.commitKey=3),cs===-1)return;const{value:Sn}=ts.target;Un.lastCommittedValue!==Sn&&(Un.lastCommittedValue=Sn,Un.userValue=Sn,(mn=this.linkService.eventBus)==null||mn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Gr,name:"Keystroke",value:Sn,willCommit:!0,commitKey:cs,selStart:ts.target.selectionStart,selEnd:ts.target.selectionEnd}}))});const Jn=fs;fs=null,nn.addEventListener("blur",ts=>{var Sn;if(!Un.focused||!ts.relatedTarget)return;Un.focused=!1;const{value:cs}=ts.target;Un.userValue=cs,Un.lastCommittedValue!==cs&&((Sn=this.linkService.eventBus)==null||Sn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Gr,name:"Keystroke",value:cs,willCommit:!0,commitKey:Un.commitKey,selStart:ts.target.selectionStart,selEnd:ts.target.selectionEnd}})),Jn(ts)}),(Cn=this.data.actions)!=null&&Cn.Keystroke&&nn.addEventListener("beforeinput",ts=>{var Cs;Un.lastCommittedValue=null;const{data:cs,target:Sn}=ts,{value:mn,selectionStart:zn,selectionEnd:os}=Sn;let ls=zn,hs=os;switch(ts.inputType){case"deleteWordBackward":{const Ds=mn.substring(0,zn).match(/\w*[^\w]*$/);Ds&&(ls-=Ds[0].length);break}
vendor: 4,231 bytes, line 3993
3993case"deleteWordForward":{const Ds=mn.substring(zn).match(/^[^\w]*\w*/);Ds&&(hs+=Ds[0].length);break}case"deleteContentBackward":zn===os&&(ls-=1);break;case"deleteContentForward":zn===os&&(hs+=1);break}ts.preventDefault(),(Cs=this.linkService.eventBus)==null||Cs.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Gr,name:"Keystroke",value:mn,change:cs||"",willCommit:!1,selStart:ls,selEnd:hs}})}),this._setEventListeners(nn,Un,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],ts=>ts.target.value)}if(fs&&nn.addEventListener("blur",fs),this.data.comb){const ts=(this.data.rect[2]-this.data.rect[0])/Vn;nn.classList.add("comb"),nn.style.letterSpacing=`calc(${ts}px * var(--scale-factor) - 1ch)`}}else nn=document.createElement("div"),nn.textContent=this.data.fieldValue,nn.style.verticalAlign="middle",nn.style.display="table-cell";return this._setTextStyle(nn),this._setBackgroundColor(nn),this._setDefaultPropertiesFromJS(nn),this.container.append(nn),this.container}}class Qe extends Ve{constructor(en){super(en,{isRenderable:!!en.data.hasOwnCanvas})}}class Ze extends Ve{constructor(en){super(en,{isRenderable:en.renderForms})}render(){const en=this.annotationStorage,Gr=this.data,nn=Gr.id;let En=en.getValue(nn,{value:Gr.exportValue===Gr.fieldValue}).value;typeof En=="string"&&(En=En!=="Off",en.setValue(nn,{value:En})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const Cn=document.createElement("input");return We.add(Cn),Cn.setAttribute("data-element-id",nn),Cn.disabled=Gr.readOnly,this._setRequired(Cn,this.data.required),Cn.type="checkbox",Cn.name=Gr.fieldName,En&&Cn.setAttribute("checked",!0),Cn.setAttribute("exportValue",Gr.exportValue),Cn.tabIndex=Ue,Cn.addEventListener("change",jn=>{const{name:$n,checked:Vn}=jn.target;for(const Qn of this._getElementsByName($n,nn)){const Un=Vn&&Qn.exportValue===Gr.exportValue;Qn.domElement&&(Qn.domElement.checked=Un),en.setValue(Qn.id,{value:Un})}en.setValue(nn,{value:Vn})}),Cn.addEventListener("resetform",jn=>{const $n=Gr.defaultFieldValue||"Off";jn.target.checked=$n===Gr.exportValue}),this.enableScripting&&this.hasJSActions&&(Cn.addEventListener("updatefromsandbox",jn=>{const $n={value(Vn){Vn.target.checked=Vn.detail.value!=="Off",en.setValue(nn,{value:Vn.target.checked})}};this._dispatchEventFromSandbox($n,jn)}),this._setEventListeners(Cn,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],jn=>jn.target.checked)),this._setBackgroundColor(Cn),this._setDefaultPropertiesFromJS(Cn),this.container.append(Cn),this.container}}class Je extends Ve{constructor(en){super(en,{isRenderable:en.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const en=this.annotationStorage,Gr=this.data,nn=Gr.id;let En=en.getValue(nn,{value:Gr.fieldValue===Gr.buttonValue}).value;typeof En=="string"&&(En=En!==Gr.buttonValue,en.setValue(nn,{value:En}));const Cn=document.createElement("input");if(We.add(Cn),Cn.setAttribute("data-element-id",nn),Cn.disabled=Gr.readOnly,this._setRequired(Cn,this.data.required),Cn.type="radio",Cn.name=Gr.fieldName,En&&Cn.setAttribute("checked",!0),Cn.tabIndex=Ue,Cn.addEventListener("change",jn=>{const{name:$n,checked:Vn}=jn.target;for(const Qn of this._getElementsByName($n,nn))en.setValue(Qn.id,{value:!1});en.setValue(nn,{value:Vn})}),Cn.addEventListener("resetform",jn=>{const $n=Gr.defaultFieldValue;jn.target.checked=$n!=null&&$n===Gr.buttonValue}),this.enableScripting&&this.hasJSActions){const jn=Gr.buttonValue;Cn.addEventListener("updatefromsandbox",$n=>{const Vn={value:Qn=>{const Un=jn===Qn.detail.value;for(const fs of this._getElementsByName(Qn.target.name)){const Jn=Un&&fs.id===nn;fs.domElement&&(fs.domElement.checked=Jn),en.setValue(fs.id,{value:Jn})}}};this._dispatchEventFromSandbox(Vn,$n)}),this._setEventListeners(Cn,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],$n=>$n.target.checked)}
3993return this._setBackgroundColor(Cn),this._setDefaultPropertiesFromJS(Cn),this.container.append(Cn),this.container}}class ir extends Ge{constructor(en){super(en,{ignoreBorder:en.data.hasAppearance})}render(){const en=super.render();en.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(en.title=this.data.alternativeText);const Gr=en.lastChild;return this.enableScripting&&this.hasJSActions&&Gr&&(this._setDefaultPropertiesFromJS(Gr),Gr.addEventListener("updatefromsandbox",nn=>{this._dispatchEventFromSandbox({},nn)})),en}}class rr extends Ve{constructor(en){super(en,{isRenderable:en.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const en=this.annotationStorage,Gr=this.data.id,nn=en.getValue(Gr,{value:this.data.fieldValue}),En=document.createElement("select");We.add(En),En.setAttribute("data-element-id",Gr),En.disabled=this.data.readOnly,this._setRequired(En,this.data.required),En.name=this.data.fieldName,En.tabIndex=Ue;let Cn=this.data.combo&&this.data.options.length>0;this.data.combo||(En.size=this.data.options.length,this.data.multiSelect&&(En.multiple=!0)),En.addEventListener("resetform",Un=>{const fs=this.data.defaultFieldValue;for(const Jn of En.options)Jn.selected=Jn.value===fs});for(const Un of this.data.options){const fs=document.createElement("option");fs.textContent=Un.displayValue,fs.value=Un.exportValue,nn.value.includes(Un.exportValue)&&(fs.setAttribute("selected",!0),Cn=!1),En.append(fs)}let jn=null;if(Cn){const Un=document.createElement("option");Un.value=" ",Un.setAttribute("hidden",!0),Un.setAttribute("selected",!0),En.prepend(Un),jn=()=>{Un.remove(),En.removeEventListener("input",jn),jn=null},En.addEventListener("input",jn)}const $n=Un=>{const fs=Un?"value":"textContent",{options:Jn,multiple:ts}=En;return ts?Array.prototype.filter.call(Jn,cs=>cs.selected).map(cs=>cs[fs]):Jn.selectedIndex===-1?null:Jn[Jn.selectedIndex][fs]};let Vn=$n(!1);const Qn=Un=>{const fs=Un.target.options;return Array.prototype.map.call(fs,Jn=>({displayValue:Jn.textContent,exportValue:Jn.value}))};return this.enableScripting&&this.hasJSActions?(En.addEventListener("updatefromsandbox",Un=>{const fs={value(Jn){jn==null||jn();const ts=Jn.detail.value,cs=new Set(Array.isArray(ts)?ts:[ts]);for(const Sn of En.options)Sn.selected=cs.has(Sn.value);en.setValue(Gr,{value:$n(!0)}),Vn=$n(!1)},multipleSelection(Jn){En.multiple=!0},remove(Jn){const ts=En.options,cs=Jn.detail.remove;ts[cs].selected=!1,En.remove(cs),ts.length>0&&Array.prototype.findIndex.call(ts,mn=>mn.selected)===-1&&(ts[0].selected=!0),en.setValue(Gr,{value:$n(!0),items:Qn(Jn)}),Vn=$n(!1)},clear(Jn){for(;En.length!==0;)En.remove(0);en.setValue(Gr,{value:null,items:[]}),Vn=$n(!1)},insert(Jn){const{index:ts,displayValue:cs,exportValue:Sn}=Jn.detail.insert,mn=En.children[ts],zn=document.createElement("option");zn.textContent=cs,zn.value=Sn,mn?mn.before(zn):En.append(zn),en.setValue(Gr,{value:$n(!0),items:Qn(Jn)}),Vn=$n(!1)},items(Jn){const{items:ts}=Jn.detail;for(;En.length!==0;)En.remove(0);for(const cs of ts){const{displayValue:Sn,exportValue:mn}=cs,zn=document.createElement("option");zn.textContent=Sn,zn.value=mn,En.append(zn)}En.options.length>0&&(En.options[0].selected=!0),en.setValue(Gr,{value:$n(!0),items:Qn(Jn)}),Vn=$n(!1)},indices(Jn){const ts=new Set(Jn.detail.indices);for(const cs of Jn.target.options)cs.selected=ts.has(cs.index);en.setValue(Gr,{value:$n(!0)}),Vn=$n(!1)},editable(Jn){Jn.target.disabled=!Jn.detail.editable}};this._dispatchEventFromSandbox(fs,Un)}),En.addEventListener("input",Un=>{var Jn;const fs=$n(!0);en.setValue(Gr,{value:fs}),Un.preventDefault(),(Jn=this.linkService.eventBus)==null||Jn.dispatch("dispatcheventinsandbox",{source:this,detail:{id:Gr,name:"Keystroke",value:Vn,changeEx:fs,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(En,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],Un=>Un.target.value)):En.addEventListener("input",function(Un){en.setValue(Gr,{value:$n(!0)})}
3993),this.data.combo&&this._setTextStyle(En),this._setBackgroundColor(En),this._setDefaultPropertiesFromJS(En),this.container.append(En),this.container}}class ar extends qe{constructor(en){const{data:Gr,elements:nn}=en;super(en,{isRenderable:qe._hasPopupData(Gr)}),this.elements=nn}render(){this.container.classList.add("popupAnnotation");const en=new or({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}),Gr=[];for(const nn of this.elements)nn.popup=en,Gr.push(nn.data.id),nn.addHighlightArea();return this.container.setAttribute("aria-controls",Gr.map(nn=>`${je.AnnotationPrefix}${nn}`).join(",")),this.container}}class or{constructor({container:en,color:Gr,elements:nn,titleObj:En,modificationDate:Cn,contentsObj:jn,richText:$n,parent:Vn,rect:Qn,parentRect:Un,open:fs}){Pn(this,cn);Pn(this,Nr,null);Pn(this,Br,vn(this,cn,Hu).bind(this));Pn(this,Hr,vn(this,cn,Ic).bind(this));Pn(this,Vr,vn(this,cn,jc).bind(this));Pn(this,mr,vn(this,cn,Nl).bind(this));Pn(this,Sr,null);Pn(this,Lr,null);Pn(this,jr,null);Pn(this,fr,null);Pn(this,Cr,null);Pn(this,Mr,null);Pn(this,$r,!1);Pn(this,Fr,null);Pn(this,Kr,null);Pn(this,an,null);Pn(this,Wr,null);Pn(this,hn,!1);var ts;kn(this,Lr,en),kn(this,Wr,En),kn(this,jr,jn),kn(this,an,$n),kn(this,Cr,Vn),kn(this,Sr,Gr),kn(this,Kr,Qn),kn(this,Mr,Un),kn(this,fr,nn);const Jn=Oe.PDFDateString.toDateObject(Cn);Jn&&kn(this,Nr,Vn.l10n.get("annotation_date_string",{date:Jn.toLocaleDateString(),time:Jn.toLocaleTimeString()})),this.trigger=nn.flatMap(cs=>cs.getElementsToTriggerPopup());for(const cs of this.trigger)cs.addEventListener("click",Pr(this,mr)),cs.addEventListener("mouseenter",Pr(this,Vr)),cs.addEventListener("mouseleave",Pr(this,Hr)),cs.classList.add("popupTriggerArea");for(const cs of nn)(ts=cs.container)==null||ts.addEventListener("keydown",Pr(this,Br));Pr(this,Lr).hidden=!0,fs&&vn(this,cn,Nl).call(this)}render(){if(Pr(this,Fr))return;const{page:{view:en},viewport:{rawDims:{pageWidth:Gr,pageHeight:nn,pageX:En,pageY:Cn}}}=Pr(this,Cr),jn=kn(this,Fr,document.createElement("div"));if(jn.className="popup",Pr(this,Sr)){const ls=jn.style.outlineColor=je.Util.makeHexColor(...Pr(this,Sr));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?jn.style.backgroundColor=`color-mix(in srgb, ${ls} 30%, white)`:jn.style.backgroundColor=je.Util.makeHexColor(...Pr(this,Sr).map(Cs=>Math.floor(.7*(255-Cs)+Cs)))}const $n=document.createElement("span");$n.className="header";const Vn=document.createElement("h1");if($n.append(Vn),{dir:Vn.dir,str:Vn.textContent}=Pr(this,Wr),jn.append($n),Pr(this,Nr)){const ls=document.createElement("span");ls.classList.add("popupDate"),Pr(this,Nr).then(hs=>{ls.textContent=hs}),$n.append(ls)}const Qn=Pr(this,jr),Un=Pr(this,an);if(Un!=null&&Un.str&&(!(Qn!=null&&Qn.str)||Qn.str===Un.str))Be.XfaLayer.render({xfaHtml:Un.html,intent:"richText",div:jn}),jn.lastChild.classList.add("richText","popupContent");else{const ls=this._formatContents(Qn);jn.append(ls)}let fs=!!Pr(this,Mr),Jn=fs?Pr(this,Mr):Pr(this,Kr);for(const ls of Pr(this,fr))if(!Jn||je.Util.intersect(ls.data.rect,Jn)!==null){Jn=ls.data.rect,fs=!0;break}const ts=je.Util.normalizeRect([Jn[0],en[3]-Jn[1]+en[1],Jn[2],en[3]-Jn[3]+en[1]]),Sn=fs?Jn[2]-Jn[0]+5:0,mn=ts[0]+Sn,zn=ts[1],{style:os}=Pr(this,Lr);os.left=`${100*(mn-En)/Gr}%`,os.top=`${100*(zn-Cn)/nn}%`,Pr(this,Lr).append(jn)}_formatContents({str:en,dir:Gr}){const nn=document.createElement("p");nn.classList.add("popupContent"),nn.dir=Gr;const En=en.split(/(?:\r\n?|\n)/);for(let Cn=0,jn=En.length;Cn<jn;++Cn){const $n=En[Cn];nn.append(document.createTextNode($n)),Cn<jn-1&&nn.append(document.createElement("br"))}return nn}forceHide(){kn(this,hn,this.isVisible),Pr(this,hn)&&(Pr(this,Lr).hidden=!0)}maybeShow(){Pr(this,hn)&&(kn(this,hn,!1),Pr(this,Lr).hidden=!1)}get isVisible(){return Pr(this,Lr).hidden===!1}}Nr=new WeakMap,Br=new WeakMap,Hr=new WeakMap,Vr=new WeakMap,mr=new WeakMap,Sr=new WeakMap,Lr=new WeakMap,jr=new WeakMap,fr=new WeakMap,Cr=new WeakMap,Mr=new WeakMap,$r=new WeakMap,Fr=new WeakMap,Kr=new WeakMap,an=new WeakMap,Wr=new WeakMap,hn=new WeakMap,cn=new WeakSet,Hu=function(en){en.altKey||en.shiftKey||en.ctrlKey||en.metaKey||(en.key==="Enter"||en.key==="Escape"&&Pr(this,$r))&&vn(this,cn,Nl).call(this)},Nl=function(){kn(this,$r,!Pr(this,$r)),Pr(this,$r)?(vn(this,cn,jc).call(this),Pr(this,Lr).addEventListener("click",Pr(this,mr)),Pr(this,Lr).addEventListener("keydown",Pr(this,Br))):(vn(this,cn,Ic).call(this),Pr(this,Lr).removeEventListener("click",Pr(this,mr)),Pr(this,Lr).removeEventListener("keydown",Pr(this,Br)))},jc=function(){Pr(this,Fr)||this.render(),this.isVisible?Pr(this,$r)&&Pr(this,Lr).classList.add("focused"):(Pr(this,Lr).hidden=!1,Pr(this,Lr).style.zIndex=parseInt(Pr(this,Lr).style.zIndex)+1e3)},Ic=function(){Pr(this,Lr).classList.remove("focused"),!(Pr(this,$r)||!this.isVisible)&&(Pr(this,Lr).hidden=!0,Pr(this,Lr).style.zIndex=parseInt(Pr(this,Lr).style.zIndex)-1e3)};class pr extends qe{constructor(en){super(en,{isRenderable:!0,ignoreBorder:!0}),this.textContent=en.data.textContent,this.textPosition=en.data.textPosition,this.annotationEditorType=je.AnnotationEditorType.FREETEXT}
3993render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const en=document.createElement("div");en.classList.add("annotationTextContent"),en.setAttribute("role","comment");for(const Gr of this.textContent){const nn=document.createElement("span");nn.textContent=Gr,en.append(nn)}this.container.append(en)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}Re.FreeTextAnnotationElement=pr;class tr extends qe{constructor(Gr){super(Gr,{isRenderable:!0,ignoreBorder:!0});Pn(this,In,null)}render(){this.container.classList.add("lineAnnotation");const Gr=this.data,{width:nn,height:En}=Xe(Gr.rect),Cn=this.svgFactory.create(nn,En,!0),jn=kn(this,In,this.svgFactory.createElement("svg:line"));return jn.setAttribute("x1",Gr.rect[2]-Gr.lineCoordinates[0]),jn.setAttribute("y1",Gr.rect[3]-Gr.lineCoordinates[1]),jn.setAttribute("x2",Gr.rect[2]-Gr.lineCoordinates[2]),jn.setAttribute("y2",Gr.rect[3]-Gr.lineCoordinates[3]),jn.setAttribute("stroke-width",Gr.borderStyle.width||1),jn.setAttribute("stroke","transparent"),jn.setAttribute("fill","transparent"),Cn.append(jn),this.container.append(Cn),!Gr.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Pr(this,In)}addHighlightArea(){this.container.classList.add("highlightArea")}}In=new WeakMap;class nr extends qe{constructor(Gr){super(Gr,{isRenderable:!0,ignoreBorder:!0});Pn(this,yn,null)}render(){this.container.classList.add("squareAnnotation");const Gr=this.data,{width:nn,height:En}=Xe(Gr.rect),Cn=this.svgFactory.create(nn,En,!0),jn=Gr.borderStyle.width,$n=kn(this,yn,this.svgFactory.createElement("svg:rect"));return $n.setAttribute("x",jn/2),$n.setAttribute("y",jn/2),$n.setAttribute("width",nn-jn),$n.setAttribute("height",En-jn),$n.setAttribute("stroke-width",jn||1),$n.setAttribute("stroke","transparent"),$n.setAttribute("fill","transparent"),Cn.append($n),this.container.append(Cn),!Gr.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Pr(this,yn)}addHighlightArea(){this.container.classList.add("highlightArea")}}yn=new WeakMap;class hr extends qe{constructor(Gr){super(Gr,{isRenderable:!0,ignoreBorder:!0});Pn(this,Mn,null)}render(){this.container.classList.add("circleAnnotation");const Gr=this.data,{width:nn,height:En}=Xe(Gr.rect),Cn=this.svgFactory.create(nn,En,!0),jn=Gr.borderStyle.width,$n=kn(this,Mn,this.svgFactory.createElement("svg:ellipse"));return $n.setAttribute("cx",nn/2),$n.setAttribute("cy",En/2),$n.setAttribute("rx",nn/2-jn/2),$n.setAttribute("ry",En/2-jn/2),$n.setAttribute("stroke-width",jn||1),$n.setAttribute("stroke","transparent"),$n.setAttribute("fill","transparent"),Cn.append($n),this.container.append(Cn),!Gr.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Pr(this,Mn)}addHighlightArea(){this.container.classList.add("highlightArea")}}Mn=new WeakMap;class sr extends qe{constructor(Gr){super(Gr,{isRenderable:!0,ignoreBorder:!0});Pn(this,on,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const Gr=this.data,{width:nn,height:En}=Xe(Gr.rect),Cn=this.svgFactory.create(nn,En,!0);let jn=[];for(const Vn of Gr.vertices){const Qn=Vn.x-Gr.rect[0],Un=Gr.rect[3]-Vn.y;jn.push(Qn+","+Un)}jn=jn.join(" ");const $n=kn(this,on,this.svgFactory.createElement(this.svgElementName));return $n.setAttribute("points",jn),$n.setAttribute("stroke-width",Gr.borderStyle.width||1),$n.setAttribute("stroke","transparent"),$n.setAttribute("fill","transparent"),Cn.append($n),this.container.append(Cn),!Gr.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return Pr(this,on)}addHighlightArea(){this.container.classList.add("highlightArea")}}on=new WeakMap;class xr extends sr{constructor(en){super(en),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Rr extends qe{constructor(en){super(en,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}
3993class br extends qe{constructor(Gr){super(Gr,{isRenderable:!0,ignoreBorder:!0});Pn(this,Yr,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=je.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const Gr=this.data,{width:nn,height:En}=Xe(Gr.rect),Cn=this.svgFactory.create(nn,En,!0);for(const jn of Gr.inkLists){let $n=[];for(const Qn of jn){const Un=Qn.x-Gr.rect[0],fs=Gr.rect[3]-Qn.y;$n.push(`${Un},${fs}`)}$n=$n.join(" ");const Vn=this.svgFactory.createElement(this.svgElementName);Pr(this,Yr).push(Vn),Vn.setAttribute("points",$n),Vn.setAttribute("stroke-width",Gr.borderStyle.width||1),Vn.setAttribute("stroke","transparent"),Vn.setAttribute("fill","transparent"),!Gr.popupRef&&this.hasPopupData&&this._createPopup(),Cn.append(Vn)}return this.container.append(Cn),this.container}getElementsToTriggerPopup(){return Pr(this,Yr)}addHighlightArea(){this.container.classList.add("highlightArea")}}Yr=new WeakMap,Re.InkAnnotationElement=br;class wr extends qe{constructor(en){super(en,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class vr extends qe{constructor(en){super(en,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Dr extends qe{constructor(en){super(en,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class kr extends qe{constructor(en){super(en,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class cr extends qe{constructor(en){super(en,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}Re.StampAnnotationElement=cr;class dr extends qe{constructor(Gr){var Cn;super(Gr,{isRenderable:!0});Pn(this,On);Pn(this,sn,null);const{filename:nn,content:En}=this.data.file;this.filename=(0,Oe.getFilenameFromUrl)(nn,!0),this.content=En,(Cn=this.linkService.eventBus)==null||Cn.dispatch("fileattachmentannotation",{source:this,filename:nn,content:En})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:Gr,data:nn}=this;let En;nn.hasAppearance||nn.fillAlpha===0?En=document.createElement("div"):(En=document.createElement("img"),En.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(nn.name)?"paperclip":"pushpin"}.svg`,nn.fillAlpha&&nn.fillAlpha<1&&(En.style=`filter: opacity(${Math.round(nn.fillAlpha*100)}%);`)),En.addEventListener("dblclick",vn(this,On,Lc).bind(this)),kn(this,sn,En);const{isMac:Cn}=je.FeatureTest.platform;return Gr.addEventListener("keydown",jn=>{jn.key==="Enter"&&(Cn?jn.metaKey:jn.ctrlKey)&&vn(this,On,Lc).call(this)}),!nn.popupRef&&this.hasPopupData?this._createPopup():En.classList.add("popupTriggerArea"),Gr.append(En),Gr}getElementsToTriggerPopup(){return Pr(this,sn)}addHighlightArea(){this.container.classList.add("highlightArea")}}sn=new WeakMap,On=new WeakSet,Lc=function(){var Gr;(Gr=this.downloadManager)==null||Gr.openOrDownloadData(this.container,this.content,this.filename)};class ur{constructor({div:en,accessibilityManager:Gr,annotationCanvasMap:nn,l10n:En,page:Cn,viewport:jn}){Pn(this,An);Pn(this,Hn,null);Pn(this,Zr,null);Pn(this,xn,new Map);this.div=en,kn(this,Hn,Gr),kn(this,Zr,nn),this.l10n=En,this.page=Cn,this.viewport=jn,this.zIndex=0,this.l10n||(this.l10n=$e.NullL10n)}async render(en){const{annotations:Gr}=en,nn=this.div;(0,Oe.setLayerDimensions)(nn,this.viewport);const En=new Map,Cn={data:null,layer:nn,linkService:en.linkService,downloadManager:en.downloadManager,imageResourcesPath:en.imageResourcesPath||"",renderForms:en.renderForms!==!1,svgFactory:new Oe.DOMSVGFactory,annotationStorage:en.annotationStorage||new Me.AnnotationStorage,enableScripting:en.enableScripting===!0,hasJSActions:en.hasJSActions,fieldObjects:en.fieldObjects,parent:this,elements:null};for(const jn of Gr){if(jn.noHTML)continue;const $n=jn.annotationType===je.AnnotationType.POPUP;if($n){const Un=En.get(jn.id);if(!Un)continue;Cn.elements=Un}else{const{width:Un,height:fs}=Xe(jn.rect);if(Un<=0||fs<=0)continue}Cn.data=jn;const Vn=He.create(Cn);if(!Vn.isRenderable)continue;if(!$n&&jn.popupRef){const Un=En.get(jn.popupRef);Un?Un.push(Vn):En.set(jn.popupRef,[Vn])}Vn.annotationEditorType>0&&Pr(this,xn).set(Vn.data.id,Vn);const Qn=Vn.render();jn.hidden&&(Qn.style.visibility="hidden"),vn(this,An,Wu).call(this,Qn,jn.id)}vn(this,An,Oc).call(this),await this.l10n.translate(nn)}update({viewport:en}){const Gr=this.div;this.viewport=en,(0,Oe.setLayerDimensions)(Gr,{rotation:en.rotation}),vn(this,An,Oc).call(this),Gr.hidden=!1}getEditableAnnotations(){return Array.from(Pr(this,xn).values())}getEditableAnnotation(en){return Pr(this,xn).get(en)}}
3993Hn=new WeakMap,Zr=new WeakMap,xn=new WeakMap,An=new WeakSet,Wu=function(en,Gr){var En;const nn=en.firstChild||en;nn.id=`${je.AnnotationPrefix}${Gr}`,this.div.append(en),(En=Pr(this,Hn))==null||En.moveElementInDOM(this.div,en,nn,!1)},Oc=function(){if(!Pr(this,Zr))return;const en=this.div;for(const[Gr,nn]of Pr(this,Zr)){const En=en.querySelector(`[data-annotation-id="${Gr}"]`);if(!En)continue;const{firstChild:Cn}=En;Cn?Cn.nodeName==="CANVAS"?Cn.replaceWith(nn):Cn.before(nn):En.append(nn)}Pr(this,Zr).clear()},Re.AnnotationLayer=ur},(Ee,Re)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.ColorConverters=void 0;function Te(Me){return Math.floor(Math.max(0,Math.min(1,Me))*255).toString(16).padStart(2,"0")}function je(Me){return Math.max(0,Math.min(255,255*Me))}class Oe{static CMYK_G([De,$e,Be,Ue]){return["G",1-Math.min(1,.3*De+.59*Be+.11*$e+Ue)]}static G_CMYK([De]){return["CMYK",0,0,0,1-De]}static G_RGB([De]){return["RGB",De,De,De]}static G_rgb([De]){return De=je(De),[De,De,De]}static G_HTML([De]){const $e=Te(De);return`#${$e}${$e}${$e}`}static RGB_G([De,$e,Be]){return["G",.3*De+.59*$e+.11*Be]}static RGB_rgb(De){return De.map(je)}static RGB_HTML(De){return`#${De.map(Te).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([De,$e,Be,Ue]){return["RGB",1-Math.min(1,De+Ue),1-Math.min(1,Be+Ue),1-Math.min(1,$e+Ue)]}static CMYK_rgb([De,$e,Be,Ue]){return[je(1-Math.min(1,De+Ue)),je(1-Math.min(1,Be+Ue)),je(1-Math.min(1,$e+Ue))]}static CMYK_HTML(De){const $e=this.CMYK_RGB(De).slice(1);return this.RGB_HTML($e)}static RGB_CMYK([De,$e,Be]){const Ue=1-De,ze=1-$e,We=1-Be,Xe=Math.min(Ue,ze,We);return["CMYK",Ue,ze,We,Xe]}}Re.ColorConverters=Oe}
3993,(Ee,Re)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.NullL10n=void 0,Re.getL10nFallback=je;const Te={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} à {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} à {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typingâ¦",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};Te.print_progress_percent="{{progress}}%";function je(De,$e){switch(De){case"find_match_count":De=`find_match_count[${$e.total===1?"one":"other"}]`;break;case"find_match_count_limit":De=`find_match_count_limit[${$e.limit===1?"one":"other"}]`;break}return Te[De]||""}function Oe(De,$e){return $e?De.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(Be,Ue)=>Ue in $e?$e[Ue]:"{{"+Ue+"}}"):De}const Me={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(De,$e=null,Be=je(De,$e)){return Oe(Be,$e)},async translate(De){}};Re.NullL10n=Me},(Ee,Re,Te)=>{Object.defineProperty(Re,"__esModule",{value:!0}),Re.XfaLayer=void 0;var je=Te(25);class Oe{static setupStorage(De,$e,Be,Ue,ze){const We=Ue.getValue($e,{value:null});switch(Be.name){case"textarea":if(We.value!==null&&(De.textContent=We.value),ze==="print")break;De.addEventListener("input",Xe=>{Ue.setValue($e,{value:Xe.target.value})});break;case"input":if(Be.attributes.type==="radio"||Be.attributes.type==="checkbox"){if(We.value===Be.attributes.xfaOn?De.setAttribute("checked",!0):We.value===Be.attributes.xfaOff&&De.removeAttribute("checked"),ze==="print")break;De.addEventListener("change",Xe=>{Ue.setValue($e,{value:Xe.target.checked?Xe.target.getAttribute("xfaOn"):Xe.target.getAttribute("xfaOff")})})}else{if(We.value!==null&&De.setAttribute("value",We.value),ze==="print")break;De.addEventListener("input",Xe=>{Ue.setValue($e,{value:Xe.target.value})})}break;case"select":if(We.value!==null){De.setAttribute("value",We.value);for(const Xe of Be.children)Xe.attributes.value===We.value?Xe.attributes.selected=!0:Xe.attributes.hasOwnProperty("selected")&&delete Xe.attributes.selected}De.addEventListener("input",Xe=>{const He=Xe.target.options,qe=He.selectedIndex===-1?"":He[He.selectedIndex].value;Ue.setValue($e,{value:qe})});break}}static setAttributes({html:De,element:$e,storage:Be=null,intent:Ue,linkService:ze}){const{attributes:We}=$e,Xe=De instanceof HTMLAnchorElement;We.type==="radio"&&(We.name=`${We.name}-${Ue}`);for(const[He,qe]of Object.entries(We))if(qe!=null)switch(He){case"class":qe.length&&De.setAttribute(He,qe.join(" "));break;case"dataId":break;case"id":De.setAttribute("data-element-id",qe);break;case"style":Object.assign(De.style,qe);break;case"textContent":De.textContent=qe;break;default:(!Xe||He!=="href"&&He!=="newWindow")&&De.setAttribute(He,qe)}Xe&&ze.addLinkAttributes(De,We.href,We.newWindow),Be&&We.dataId&&this.setupStorage(De,We.dataId,$e,Be)}static render(De){var Ge;const $e=De.annotationStorage,Be=De.linkService,Ue=De.xfaHtml,ze=De.intent||"display",We=document.createElement(Ue.name);Ue.attributes&&this.setAttributes({html:We,element:Ue,intent:ze,linkService:Be});const Xe=[[Ue,-1,We]],He=De.div;if(He.append(We),De.viewport){const Ye=`matrix(${De.viewport.transform.join(",")})`;He.style.transform=Ye}ze!=="richText"&&He.setAttribute("class","xfaLayer xfaFont");const qe=[];for(;Xe.length>0;){const[Ye,Ve,Ke]=Xe.at(-1);if(Ve+1===Ye.children.length){Xe.pop();continue}const Qe=Ye.children[++Xe.at(-1)[1]];if(Qe===null)continue;const{name:Ze}=Qe;if(Ze==="#text"){const ir=document.createTextNode(Qe.value);qe.push(ir),Ke.append(ir);continue}const Je=(Ge=Qe==null?void 0:Qe.attributes)!=null&&Ge.xmlns?document.createElementNS(Qe.attributes.xmlns,Ze):document.createElement(Ze);if(Ke.append(Je),Qe.attributes&&this.setAttributes({html:Je,element:Qe,storage:$e,intent:ze,linkService:Be}),Qe.children&&Qe.children.length>0)Xe.push([Qe,-1,Je]);else if(Qe.value){const ir=document.createTextNode(Qe.value);je.XfaText.shouldBuildText(Ze)&&qe.push(ir),Je.append(ir)}}for(const Ye of He.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))Ye.setAttribute("readOnly",!0);return{textDivs:qe}}static update(De){const $e=`matrix(${De.viewport.transform.join(",")})`;De.div.style.transform=$e,De.div.hidden=!1}}Re.XfaLayer=Oe},(Ee,Re,Te)=>{var Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze,Je,ir,rr,Gu,qu,Vu,Xu,Mc,Yu,Dc,Ku,Zu,Qu,Ju,ed,Oi,Nc,$l,Fl,La,$c,Bl,Ir,rd,Fc,nd,sd,Bc,Ul,Oa;
3993Object.defineProperty(Re,"__esModule",{value:!0}),Re.InkEditor=void 0;var je=Te(1),Oe=Te(4),Me=Te(29),De=Te(6),$e=Te(5);const Sr=class Sr extends Oe.AnnotationEditor{constructor(fr){super({...fr,name:"inkEditor"});Pn(this,rr);Pn(this,Ue,0);Pn(this,ze,0);Pn(this,We,this.canvasPointermove.bind(this));Pn(this,Xe,this.canvasPointerleave.bind(this));Pn(this,He,this.canvasPointerup.bind(this));Pn(this,qe,this.canvasPointerdown.bind(this));Pn(this,Ge,new Path2D);Pn(this,Ye,!1);Pn(this,Ve,!1);Pn(this,Ke,!1);Pn(this,Qe,null);Pn(this,Ze,0);Pn(this,Je,0);Pn(this,ir,null);this.color=fr.color||null,this.thickness=fr.thickness||null,this.opacity=fr.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(fr){Oe.AnnotationEditor.initialize(fr,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(fr,Cr){switch(fr){case je.AnnotationEditorParamsType.INK_THICKNESS:Sr._defaultThickness=Cr;break;case je.AnnotationEditorParamsType.INK_COLOR:Sr._defaultColor=Cr;break;case je.AnnotationEditorParamsType.INK_OPACITY:Sr._defaultOpacity=Cr/100;break}}updateParams(fr,Cr){switch(fr){case je.AnnotationEditorParamsType.INK_THICKNESS:vn(this,rr,Gu).call(this,Cr);break;case je.AnnotationEditorParamsType.INK_COLOR:vn(this,rr,qu).call(this,Cr);break;case je.AnnotationEditorParamsType.INK_OPACITY:vn(this,rr,Vu).call(this,Cr);break}}static get defaultPropertiesToUpdate(){return[[je.AnnotationEditorParamsType.INK_THICKNESS,Sr._defaultThickness],[je.AnnotationEditorParamsType.INK_COLOR,Sr._defaultColor||Oe.AnnotationEditor._defaultLineColor],[je.AnnotationEditorParamsType.INK_OPACITY,Math.round(Sr._defaultOpacity*100)]]}get propertiesToUpdate(){return[[je.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||Sr._defaultThickness],[je.AnnotationEditorParamsType.INK_COLOR,this.color||Sr._defaultColor||Oe.AnnotationEditor._defaultLineColor],[je.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??Sr._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(vn(this,rr,$l).call(this),vn(this,rr,Fl).call(this)),this.isAttachedToDOM||(this.parent.add(this),vn(this,rr,La).call(this)),vn(this,rr,Oa).call(this)))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,Pr(this,Qe).disconnect(),kn(this,Qe,null),super.remove())}setParent(fr){!this.parent&&fr?this._uiManager.removeShouldRescale(this):this.parent&&fr===null&&this._uiManager.addShouldRescale(this),super.setParent(fr)}onScaleChanging(){const[fr,Cr]=this.parentDimensions,Mr=this.width*fr,$r=this.height*Cr;this.setDimensions(Mr,$r)}enableEditMode(){Pr(this,Ye)||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",Pr(this,qe)))}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",Pr(this,qe)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}commit(){Pr(this,Ye)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),kn(this,Ye,!0),this.div.classList.add("disabled"),vn(this,rr,Oa).call(this,!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(fr){this._focusEventsAllowed&&(super.focusin(fr),this.enableEditMode())}canvasPointerdown(fr){fr.button!==0||!this.isInEditMode()||Pr(this,Ye)||(this.setInForeground(),fr.preventDefault(),fr.type!=="mouse"&&this.div.focus(),vn(this,rr,Yu).call(this,fr.offsetX,fr.offsetY))}canvasPointermove(fr){fr.preventDefault(),vn(this,rr,Dc).call(this,fr.offsetX,fr.offsetY)}canvasPointerup(fr){fr.preventDefault(),vn(this,rr,Nc).call(this,fr)}canvasPointerleave(fr){vn(this,rr,Nc).call(this,fr)}get isResizable(){return!this.isEmpty()&&Pr(this,Ye)}
3993render(){if(this.div)return this.div;let fr,Cr;this.width&&(fr=this.x,Cr=this.y),super.render(),Oe.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(an=>{var Wr;return(Wr=this.div)==null?void 0:Wr.setAttribute("aria-label",an)});const[Mr,$r,Fr,Kr]=vn(this,rr,Xu).call(this);if(this.setAt(Mr,$r,0,0),this.setDims(Fr,Kr),vn(this,rr,$l).call(this),this.width){const[an,Wr]=this.parentDimensions;this.setAspectRatio(this.width*an,this.height*Wr),this.setAt(fr*an,Cr*Wr,this.width*an,this.height*Wr),kn(this,Ke,!0),vn(this,rr,La).call(this),this.setDims(this.width*an,this.height*Wr),vn(this,rr,Oi).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return vn(this,rr,Fl).call(this),this.div}setDimensions(fr,Cr){const Mr=Math.round(fr),$r=Math.round(Cr);if(Pr(this,Ze)===Mr&&Pr(this,Je)===$r)return;kn(this,Ze,Mr),kn(this,Je,$r),this.canvas.style.visibility="hidden";const[Fr,Kr]=this.parentDimensions;this.width=fr/Fr,this.height=Cr/Kr,this.fixAndSetPosition(),Pr(this,Ye)&&vn(this,rr,$c).call(this,fr,Cr),vn(this,rr,La).call(this),vn(this,rr,Oi).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(fr,Cr,Mr){var In,yn,Mn;if(fr instanceof Me.InkAnnotationElement)return null;const $r=super.deserialize(fr,Cr,Mr);$r.thickness=fr.thickness,$r.color=je.Util.makeHexColor(...fr.color),$r.opacity=fr.opacity;const[Fr,Kr]=$r.pageDimensions,an=$r.width*Fr,Wr=$r.height*Kr,hn=$r.parentScale,cn=fr.thickness/2;kn($r,Ye,!0),kn($r,Ze,Math.round(an)),kn($r,Je,Math.round(Wr));const{paths:tn,rect:Qr,rotation:wn}=fr;for(let{bezier:on}of tn){on=vn(In=Sr,Ir,nd).call(In,on,Qr,wn);const Yr=[];$r.paths.push(Yr);let sn=hn*(on[0]-cn),On=hn*(on[1]-cn);for(let Hn=2,Zr=on.length;Hn<Zr;Hn+=6){const xn=hn*(on[Hn]-cn),An=hn*(on[Hn+1]-cn),Wn=hn*(on[Hn+2]-cn),ss=hn*(on[Hn+3]-cn),Yn=hn*(on[Hn+4]-cn),en=hn*(on[Hn+5]-cn);Yr.push([[sn,On],[xn,An],[Wn,ss],[Yn,en]]),sn=Yn,On=en}const Bn=vn(this,Ir,rd).call(this,Yr);$r.bezierPath2D.push(Bn)}const gn=vn(yn=$r,rr,Bc).call(yn);return kn($r,ze,Math.max(Oe.AnnotationEditor.MIN_SIZE,gn[2]-gn[0])),kn($r,Ue,Math.max(Oe.AnnotationEditor.MIN_SIZE,gn[3]-gn[1])),vn(Mn=$r,rr,$c).call(Mn,an,Wr),$r}serialize(){if(this.isEmpty())return null;const fr=this.getRect(0,0),Cr=Oe.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:je.AnnotationEditorType.INK,color:Cr,thickness:this.thickness,opacity:this.opacity,paths:vn(this,rr,sd).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,fr),pageIndex:this.pageIndex,rect:fr,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}};Ue=new WeakMap,ze=new WeakMap,We=new WeakMap,Xe=new WeakMap,He=new WeakMap,qe=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,Ve=new WeakMap,Ke=new WeakMap,Qe=new WeakMap,Ze=new WeakMap,Je=new WeakMap,ir=new WeakMap,rr=new WeakSet,Gu=function(fr){const Cr=this.thickness;this.addCommands({cmd:()=>{this.thickness=fr,vn(this,rr,Oa).call(this)},undo:()=>{this.thickness=Cr,vn(this,rr,Oa).call(this)},mustExec:!0,type:je.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})},qu=function(fr){const Cr=this.color;this.addCommands({cmd:()=>{this.color=fr,vn(this,rr,Oi).call(this)},undo:()=>{this.color=Cr,vn(this,rr,Oi).call(this)},mustExec:!0,type:je.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})},Vu=function(fr){fr/=100;const Cr=this.opacity;this.addCommands({cmd:()=>{this.opacity=fr,vn(this,rr,Oi).call(this)},undo:()=>{this.opacity=Cr,vn(this,rr,Oi).call(this)},mustExec:!0,type:je.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})},Xu=function(){const{parentRotation:fr,parentDimensions:[Cr,Mr]}=this;switch(fr){case 90:return[0,Mr,Mr,Cr];case 180:return[Cr,Mr,Cr,Mr];case 270:return[Cr,0,Mr,Cr];default:return[0,0,Cr,Mr]}},Mc=function(){const{ctx:fr,color:Cr,opacity:Mr,thickness:$r,parentScale:Fr,scaleFactor:Kr}=this;fr.lineWidth=$r*Fr/Kr,fr.lineCap="round",fr.lineJoin="round",fr.miterLimit=10,fr.strokeStyle=`${Cr}${(0,$e.opacityToHex)(Mr)}`},Yu=function(fr,Cr){this.canvas.addEventListener("contextmenu",De.noContextMenu),this.canvas.addEventListener("pointerleave",Pr(this,Xe)),this.canvas.addEventListener("pointermove",Pr(this,We)),this.canvas.addEventListener("pointerup",Pr(this,He)),this.canvas.removeEventListener("pointerdown",Pr(this,qe)),this.isEditing=!0,Pr(this,Ke)||(kn(this,Ke,!0),vn(this,rr,La).call(this),this.thickness||(this.thickness=Sr._defaultThickness),this.color||(this.color=Sr._defaultColor||Oe.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=Sr._defaultOpacity)),this.currentPath.push([fr,Cr]),kn(this,Ve,!1),vn(this,rr,Mc).call(this),kn(this,ir,()=>{vn(this,rr,Qu).call(this),Pr(this,ir)&&window.requestAnimationFrame(Pr(this,ir))}),window.requestAnimationFrame(Pr(this,ir))},Dc=function(fr,Cr){const[Mr,$r]=this.currentPath.at(-1);if(this.currentPath.length>1&&fr===Mr&&Cr===$r)return;const Fr=this.currentPath;let Kr=Pr(this,Ge);if(Fr.push([fr,Cr]),kn(this,Ve,!0),Fr.length<=2){Kr.moveTo(...Fr[0]),Kr.lineTo(fr,Cr);return}
3993Fr.length===3&&(kn(this,Ge,Kr=new Path2D),Kr.moveTo(...Fr[0])),vn(this,rr,Ju).call(this,Kr,...Fr.at(-3),...Fr.at(-2),fr,Cr)},Ku=function(){if(this.currentPath.length===0)return;const fr=this.currentPath.at(-1);Pr(this,Ge).lineTo(...fr)},Zu=function(fr,Cr){kn(this,ir,null),fr=Math.min(Math.max(fr,0),this.canvas.width),Cr=Math.min(Math.max(Cr,0),this.canvas.height),vn(this,rr,Dc).call(this,fr,Cr),vn(this,rr,Ku).call(this);let Mr;if(this.currentPath.length!==1)Mr=vn(this,rr,ed).call(this);else{const Wr=[fr,Cr];Mr=[[Wr,Wr.slice(),Wr.slice(),Wr]]}const $r=Pr(this,Ge),Fr=this.currentPath;this.currentPath=[],kn(this,Ge,new Path2D);const Kr=()=>{this.allRawPaths.push(Fr),this.paths.push(Mr),this.bezierPath2D.push($r),this.rebuild()},an=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(vn(this,rr,$l).call(this),vn(this,rr,Fl).call(this)),vn(this,rr,Oa).call(this))};this.addCommands({cmd:Kr,undo:an,mustExec:!0})},Qu=function(){if(!Pr(this,Ve))return;kn(this,Ve,!1);const fr=Math.ceil(this.thickness*this.parentScale),Cr=this.currentPath.slice(-3),Mr=Cr.map(Kr=>Kr[0]),$r=Cr.map(Kr=>Kr[1]);Math.min(...Mr)-fr,Math.max(...Mr)+fr,Math.min(...$r)-fr,Math.max(...$r)+fr;const{ctx:Fr}=this;Fr.save(),Fr.clearRect(0,0,this.canvas.width,this.canvas.height);for(const Kr of this.bezierPath2D)Fr.stroke(Kr);Fr.stroke(Pr(this,Ge)),Fr.restore()},Ju=function(fr,Cr,Mr,$r,Fr,Kr,an){const Wr=(Cr+$r)/2,hn=(Mr+Fr)/2,cn=($r+Kr)/2,tn=(Fr+an)/2;fr.bezierCurveTo(Wr+2*($r-Wr)/3,hn+2*(Fr-hn)/3,cn+2*($r-cn)/3,tn+2*(Fr-tn)/3,cn,tn)},ed=function(){const fr=this.currentPath;if(fr.length<=2)return[[fr[0],fr[0],fr.at(-1),fr.at(-1)]];const Cr=[];let Mr,[$r,Fr]=fr[0];for(Mr=1;Mr<fr.length-2;Mr++){const[Qr,wn]=fr[Mr],[gn,In]=fr[Mr+1],yn=(Qr+gn)/2,Mn=(wn+In)/2,on=[$r+2*(Qr-$r)/3,Fr+2*(wn-Fr)/3],Yr=[yn+2*(Qr-yn)/3,Mn+2*(wn-Mn)/3];Cr.push([[$r,Fr],on,Yr,[yn,Mn]]),[$r,Fr]=[yn,Mn]}const[Kr,an]=fr[Mr],[Wr,hn]=fr[Mr+1],cn=[$r+2*(Kr-$r)/3,Fr+2*(an-Fr)/3],tn=[Wr+2*(Kr-Wr)/3,hn+2*(an-hn)/3];return Cr.push([[$r,Fr],cn,tn,[Wr,hn]]),Cr},Oi=function(){if(this.isEmpty()){vn(this,rr,Bl).call(this);return}vn(this,rr,Mc).call(this);const{canvas:fr,ctx:Cr}=this;Cr.setTransform(1,0,0,1,0,0),Cr.clearRect(0,0,fr.width,fr.height),vn(this,rr,Bl).call(this);for(const Mr of this.bezierPath2D)Cr.stroke(Mr)},Nc=function(fr){this.canvas.removeEventListener("pointerleave",Pr(this,Xe)),this.canvas.removeEventListener("pointermove",Pr(this,We)),this.canvas.removeEventListener("pointerup",Pr(this,He)),this.canvas.addEventListener("pointerdown",Pr(this,qe)),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",De.noContextMenu)},10),vn(this,rr,Zu).call(this,fr.offsetX,fr.offsetY),this.addToAnnotationStorage(),this.setInBackground()},$l=function(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",Oe.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(fr=>{var Cr;return(Cr=this.canvas)==null?void 0:Cr.setAttribute("aria-label",fr)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")},Fl=function(){kn(this,Qe,new ResizeObserver(fr=>{const Cr=fr[0].contentRect;Cr.width&&Cr.height&&this.setDimensions(Cr.width,Cr.height)})),Pr(this,Qe).observe(this.div)},La=function(){if(!Pr(this,Ke))return;const[fr,Cr]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*fr),this.canvas.height=Math.ceil(this.height*Cr),vn(this,rr,Bl).call(this)},$c=function(fr,Cr){const Mr=vn(this,rr,Ul).call(this),$r=(fr-Mr)/Pr(this,ze),Fr=(Cr-Mr)/Pr(this,Ue);this.scaleFactor=Math.min($r,Fr)},Bl=function(){const fr=vn(this,rr,Ul).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+fr,this.translationY*this.scaleFactor+fr)},Ir=new WeakSet,rd=function(fr){const Cr=new Path2D;for(let Mr=0,$r=fr.length;Mr<$r;Mr++){const[Fr,Kr,an,Wr]=fr[Mr];Mr===0&&Cr.moveTo(...Fr),Cr.bezierCurveTo(Kr[0],Kr[1],an[0],an[1],Wr[0],Wr[1])}return Cr},Fc=function(fr,Cr,Mr){const[$r,Fr,Kr,an]=Cr;switch(Mr){case 0:for(let Wr=0,hn=fr.length;Wr<hn;Wr+=2)fr[Wr]+=$r,fr[Wr+1]=an-fr[Wr+1];break;case 90:for(let Wr=0,hn=fr.length;Wr<hn;Wr+=2){const cn=fr[Wr];fr[Wr]=fr[Wr+1]+$r,fr[Wr+1]=cn+Fr}break;case 180:for(let Wr=0,hn=fr.length;Wr<hn;Wr+=2)fr[Wr]=Kr-fr[Wr],fr[Wr+1]+=Fr;break;case 270:for(let Wr=0,hn=fr.length;Wr<hn;Wr+=2){const cn=fr[Wr];fr[Wr]=Kr-fr[Wr+1],fr[Wr+1]=an-cn}break;default:throw new Error("Invalid rotation")}return fr},nd=function(fr,Cr,Mr){const[$r,Fr,Kr,an]=Cr;switch(Mr){case 0:for(let Wr=0,hn=fr.length;Wr<hn;Wr+=2)fr[Wr]-=$r,fr[Wr+1]=an-fr[Wr+1];break;case 90:for(let Wr=0,hn=fr.length;Wr<hn;Wr+=2){const cn=fr[Wr];fr[Wr]=fr[Wr+1]-Fr,fr[Wr+1]=cn-$r}break;case 180:for(let Wr=0,hn=fr.length;Wr<hn;Wr+=2)fr[Wr]=Kr-fr[Wr],fr[Wr+1]-=Fr;break;case 270:for(let Wr=0,hn=fr.length;Wr<hn;Wr+=2){const cn=fr[Wr];fr[Wr]=an-fr[Wr+1],fr[Wr+1]=Kr-cn}break;default:throw new Error("Invalid rotation")}return fr},sd=function(fr,Cr,Mr,$r){var hn,cn;const Fr=[],Kr=this.thickness/2,an=fr*Cr+Kr,Wr=fr*Mr+Kr;for(const tn of this.paths){const Qr=[],wn=[];for(let gn=0,In=tn.length;gn<In;gn++){const[yn,Mn,on,Yr]=tn[gn],sn=fr*yn[0]+an,On=fr*yn[1]+Wr,Bn=fr*Mn[0]+an,Hn=fr*Mn[1]+Wr,Zr=fr*on[0]+an,xn=fr*on[1]+Wr,An=fr*Yr[0]+an,Wn=fr*Yr[1]+Wr;gn===0&&(Qr.push(sn,On),wn.push(sn,On)),Qr.push(Bn,Hn,Zr,xn,An,Wn),wn.push(Bn,Hn),gn===In-1&&wn.push(An,Wn)}Fr.push({bezier:vn(hn=Sr,Ir,Fc).call(hn,Qr,$r,this.rotation),points:vn(cn=Sr,Ir,Fc).call(cn,wn,$r,this.rotation)})}return Fr},Bc=function(){let fr=1/0,Cr=-1/0,Mr=1/0,$r=-1/0;for(const Fr of this.paths)for(const[Kr,an,Wr,hn]of Fr){const cn=je.Util.bezierBoundingBox(...Kr,...an,...Wr,...hn);fr=Math.min(fr,cn[0]),Mr=Math.min(Mr,cn[1]),Cr=Math.max(Cr,cn[2]),$r=Math.max($r,cn[3])}return[fr,Mr,Cr,$r]},Ul=function(){return Pr(this,Ye)?Math.ceil(this.thickness*this.parentScale):0}
3993,Oa=function(fr=!1){if(this.isEmpty())return;if(!Pr(this,Ye)){vn(this,rr,Oi).call(this);return}const Cr=vn(this,rr,Bc).call(this),Mr=vn(this,rr,Ul).call(this);kn(this,ze,Math.max(Oe.AnnotationEditor.MIN_SIZE,Cr[2]-Cr[0])),kn(this,Ue,Math.max(Oe.AnnotationEditor.MIN_SIZE,Cr[3]-Cr[1]));const $r=Math.ceil(Mr+Pr(this,ze)*this.scaleFactor),Fr=Math.ceil(Mr+Pr(this,Ue)*this.scaleFactor),[Kr,an]=this.parentDimensions;this.width=$r/Kr,this.height=Fr/an,this.setAspectRatio($r,Fr);const Wr=this.translationX,hn=this.translationY;this.translationX=-Cr[0],this.translationY=-Cr[1],vn(this,rr,La).call(this),vn(this,rr,Oi).call(this),kn(this,Ze,$r),kn(this,Je,Fr),this.setDims($r,Fr);const cn=fr?Mr/this.scaleFactor/2:0;this.translate(Wr-this.translationX-cn,hn-this.translationY-cn)},Pn(Sr,Ir),Es(Sr,"_defaultColor",null),Es(Sr,"_defaultOpacity",1),Es(Sr,"_defaultThickness",1),Es(Sr,"_type","ink");let Be=Sr;Re.InkEditor=Be},(Ee,Re,Te)=>{var Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,nl,sl,zl,Uc,od,id,zc,Hl,ad;Object.defineProperty(Re,"__esModule",{value:!0}),Re.StampEditor=void 0;var je=Te(1),Oe=Te(4),Me=Te(6),De=Te(29);const nr=class nr extends Oe.AnnotationEditor{constructor(xr){super({...xr,name:"stampEditor"});Pn(this,Ke);Pn(this,Be,null);Pn(this,Ue,null);Pn(this,ze,null);Pn(this,We,null);Pn(this,Xe,null);Pn(this,He,null);Pn(this,qe,null);Pn(this,Ge,null);Pn(this,Ye,!1);Pn(this,Ve,!1);kn(this,We,xr.bitmapUrl),kn(this,Xe,xr.bitmapFile)}static initialize(xr){Oe.AnnotationEditor.initialize(xr)}static get supportedTypes(){const xr=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,je.shadow)(this,"supportedTypes",xr.map(Rr=>`image/${Rr}`))}static get supportedTypesStr(){return(0,je.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(xr){return this.supportedTypes.includes(xr)}static paste(xr,Rr){Rr.pasteEditor(je.AnnotationEditorType.STAMP,{bitmapFile:xr.getAsFile()})}remove(){var xr,Rr;Pr(this,Ue)&&(kn(this,Be,null),this._uiManager.imageManager.deleteId(Pr(this,Ue)),(xr=Pr(this,He))==null||xr.remove(),kn(this,He,null),(Rr=Pr(this,qe))==null||Rr.disconnect(),kn(this,qe,null)),super.remove()}rebuild(){if(!this.parent){Pr(this,Ue)&&vn(this,Ke,zl).call(this);return}super.rebuild(),this.div!==null&&(Pr(this,Ue)&&vn(this,Ke,zl).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(Pr(this,ze)||Pr(this,Be)||Pr(this,We)||Pr(this,Xe))}get isResizable(){return!0}render(){if(this.div)return this.div;let xr,Rr;if(this.width&&(xr=this.x,Rr=this.y),super.render(),this.div.hidden=!0,Pr(this,Be)?vn(this,Ke,Uc).call(this):vn(this,Ke,zl).call(this),this.width){const[br,wr]=this.parentDimensions;this.setAt(xr*br,Rr*wr,this.width*br,this.height*wr)}return this.div}static deserialize(xr,Rr,br){if(xr instanceof De.StampAnnotationElement)return null;const wr=super.deserialize(xr,Rr,br),{rect:vr,bitmapUrl:Dr,bitmapId:kr,isSvg:cr,accessibilityData:dr}=xr;kr&&br.imageManager.isValidId(kr)?kn(wr,Ue,kr):kn(wr,We,Dr),kn(wr,Ye,cr);const[ur,gr]=wr.pageDimensions;return wr.width=(vr[2]-vr[0])/ur,wr.height=(vr[3]-vr[1])/gr,dr&&(wr.altTextData=dr),wr}serialize(xr=!1,Rr=null){if(this.isEmpty())return null;const br={annotationType:je.AnnotationEditorType.STAMP,bitmapId:Pr(this,Ue),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:Pr(this,Ye),structTreeParentId:this._structTreeParentId};if(xr)return br.bitmapUrl=vn(this,Ke,Hl).call(this,!0),br.accessibilityData=this.altTextData,br;const{decorative:wr,altText:vr}=this.altTextData;if(!wr&&vr&&(br.accessibilityData={type:"Figure",alt:vr}),Rr===null)return br;Rr.stamps||(Rr.stamps=new Map);const Dr=Pr(this,Ye)?(br.rect[2]-br.rect[0])*(br.rect[3]-br.rect[1]):null;if(!Rr.stamps.has(Pr(this,Ue)))Rr.stamps.set(Pr(this,Ue),{area:Dr,serialized:br}),br.bitmap=vn(this,Ke,Hl).call(this,!1);else if(Pr(this,Ye)){const kr=Rr.stamps.get(Pr(this,Ue));Dr>kr.area&&(kr.area=Dr,kr.serialized.bitmap.close(),kr.serialized.bitmap=vn(this,Ke,Hl).call(this,!1))}return br}};Be=new WeakMap,Ue=new WeakMap,ze=new WeakMap,We=new WeakMap,Xe=new WeakMap,He=new WeakMap,qe=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,Ve=new WeakMap,Ke=new WeakSet,nl=function(xr,Rr=!1){if(!xr){this.remove();return}kn(this,Be,xr.bitmap),Rr||(kn(this,Ue,xr.id),kn(this,Ye,xr.isSvg)),vn(this,Ke,Uc).call(this)},sl=function(){kn(this,ze,null),this._uiManager.enableWaiting(!1),Pr(this,He)&&this.div.focus()},zl=function(){if(Pr(this,Ue)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(Pr(this,Ue)).then(Rr=>vn(this,Ke,nl).call(this,Rr,!0)).finally(()=>vn(this,Ke,sl).call(this));return}if(Pr(this,We)){const Rr=Pr(this,We);kn(this,We,null),this._uiManager.enableWaiting(!0),kn(this,ze,this._uiManager.imageManager.getFromUrl(Rr).then(br=>vn(this,Ke,nl).call(this,br)).finally(()=>vn(this,Ke,sl).call(this)));return}if(Pr(this,Xe)){const Rr=Pr(this,Xe);kn(this,Xe,null),this._uiManager.enableWaiting(!0),kn(this,ze,this._uiManager.imageManager.getFromFile(Rr).then(br=>vn(this,Ke,nl).call(this,br)).finally(()=>vn(this,Ke,sl).call(this)));return}const xr=document.createElement("input");
3993xr.type="file",xr.accept=nr.supportedTypesStr,kn(this,ze,new Promise(Rr=>{xr.addEventListener("change",async()=>{if(!xr.files||xr.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);const br=await this._uiManager.imageManager.getFromFile(xr.files[0]);vn(this,Ke,nl).call(this,br)}Rr()}),xr.addEventListener("cancel",()=>{this.remove(),Rr()})}).finally(()=>vn(this,Ke,sl).call(this))),xr.click()},Uc=function(){const{div:xr}=this;let{width:Rr,height:br}=Pr(this,Be);const[wr,vr]=this.pageDimensions,Dr=.75;if(this.width)Rr=this.width*wr,br=this.height*vr;else if(Rr>Dr*wr||br>Dr*vr){const ur=Math.min(Dr*wr/Rr,Dr*vr/br);Rr*=ur,br*=ur}const[kr,cr]=this.parentDimensions;this.setDims(Rr*kr/wr,br*cr/vr),this._uiManager.enableWaiting(!1);const dr=kn(this,He,document.createElement("canvas"));xr.append(dr),xr.hidden=!1,vn(this,Ke,zc).call(this,Rr,br),vn(this,Ke,ad).call(this),Pr(this,Ve)||(this.parent.addUndoableEditor(this),kn(this,Ve,!0)),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()},od=function(xr,Rr){var Dr;const[br,wr]=this.parentDimensions;this.width=xr/br,this.height=Rr/wr,this.setDims(xr,Rr),(Dr=this._initialOptions)!=null&&Dr.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,Pr(this,Ge)!==null&&clearTimeout(Pr(this,Ge)),kn(this,Ge,setTimeout(()=>{kn(this,Ge,null),vn(this,Ke,zc).call(this,xr,Rr)},200))},id=function(xr,Rr){const{width:br,height:wr}=Pr(this,Be);let vr=br,Dr=wr,kr=Pr(this,Be);for(;vr>2*xr||Dr>2*Rr;){const cr=vr,dr=Dr;vr>2*xr&&(vr=vr>=16384?Math.floor(vr/2)-1:Math.ceil(vr/2)),Dr>2*Rr&&(Dr=Dr>=16384?Math.floor(Dr/2)-1:Math.ceil(Dr/2));const ur=new OffscreenCanvas(vr,Dr);ur.getContext("2d").drawImage(kr,0,0,cr,dr,0,0,vr,Dr),kr=ur.transferToImageBitmap()}return kr},zc=function(xr,Rr){xr=Math.ceil(xr),Rr=Math.ceil(Rr);const br=Pr(this,He);if(!br||br.width===xr&&br.height===Rr)return;br.width=xr,br.height=Rr;const wr=Pr(this,Ye)?Pr(this,Be):vn(this,Ke,id).call(this,xr,Rr),vr=br.getContext("2d");vr.filter=this._uiManager.hcmFilter,vr.drawImage(wr,0,0,wr.width,wr.height,0,0,xr,Rr)},Hl=function(xr){if(xr){if(Pr(this,Ye)){const wr=this._uiManager.imageManager.getSvgUrl(Pr(this,Ue));if(wr)return wr}const Rr=document.createElement("canvas");return{width:Rr.width,height:Rr.height}=Pr(this,Be),Rr.getContext("2d").drawImage(Pr(this,Be),0,0),Rr.toDataURL()}if(Pr(this,Ye)){const[Rr,br]=this.pageDimensions,wr=Math.round(this.width*Rr*Me.PixelsPerInch.PDF_TO_CSS_UNITS),vr=Math.round(this.height*br*Me.PixelsPerInch.PDF_TO_CSS_UNITS),Dr=new OffscreenCanvas(wr,vr);return Dr.getContext("2d").drawImage(Pr(this,Be),0,0,Pr(this,Be).width,Pr(this,Be).height,0,0,wr,vr),Dr.transferToImageBitmap()}return structuredClone(Pr(this,Be))},ad=function(){kn(this,qe,new ResizeObserver(xr=>{const Rr=xr[0].contentRect;Rr.width&&Rr.height&&vn(this,Ke,od).call(this,Rr.width,Rr.height)})),Pr(this,qe).observe(this.div)},Es(nr,"_type","stamp");let $e=nr;Re.StampEditor=$e}],__webpack_module_cache__={};function __w_pdfjs_require__(Ee){var Re=__webpack_module_cache__[Ee];if(Re!==void 0)return Re.exports;var Te=__webpack_module_cache__[Ee]={exports:{}};return __webpack_modules__[Ee](Te,Te.exports,__w_pdfjs_require__),Te.exports}var __webpack_exports__={};return(()=>{var Ee=__webpack_exports__;Object.defineProperty(Ee,"__esModule",{value:!0}),Object.defineProperty(Ee,"AbortException",{enumerable:!0,get:function(){return Re.AbortException}}),Object.defineProperty(Ee,"AnnotationEditorLayer",{enumerable:!0,get:function(){return Me.AnnotationEditorLayer}}),Object.defineProperty(Ee,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return Re.AnnotationEditorParamsType}}),Object.defineProperty(Ee,"AnnotationEditorType",{enumerable:!0,get:function(){return Re.AnnotationEditorType}}),Object.defineProperty(Ee,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return De.AnnotationEditorUIManager}}),Object.defineProperty(Ee,"AnnotationLayer",{enumerable:!0,get:function(){return $e.AnnotationLayer}}),Object.defineProperty(Ee,"AnnotationMode",{enumerable:!0,get:function(){return Re.AnnotationMode}}),Object.defineProperty(Ee,"CMapCompressionType",{enumerable:!0,get:function(){return Re.C
3993MapCompressionType}}),Object.defineProperty(Ee,"DOMSVGFactory",{enumerable:!0,get:function(){return je.DOMSVGFactory}}),Object.defineProperty(Ee,"FeatureTest",{enumerable:!0,get:function(){return Re.FeatureTest}}),Object.defineProperty(Ee,"GlobalWorkerOptions",{enumerable:!0,get:function(){return Be.GlobalWorkerOptions}}),Object.defineProperty(Ee,"ImageKind",{enumerable:!0,get:function(){return Re.ImageKind}}),Object.defineProperty(Ee,"InvalidPDFException",{enumerable:!0,get:function(){return Re.InvalidPDFException}}),Object.defineProperty(Ee,"MissingPDFException",{enumerable:!0,get:function(){return Re.MissingPDFException}}),Object.defineProperty(Ee,"OPS",{enumerable:!0,get:function(){return Re.OPS}}),Object.defineProperty(Ee,"PDFDataRangeTransport",{enumerable:!0,get:function(){return Te.PDFDataRangeTransport}}),Object.defineProperty(Ee,"PDFDateString",{enumerable:!0,get:function(){return je.PDFDateString}}),Object.defineProperty(Ee,"PDFWorker",{enumerable:!0,get:function(){return Te.PDFWorker}}),Object.defineProperty(Ee,"PasswordResponses",{enumerable:!0,get:function(){return Re.PasswordResponses}}),Object.defineProperty(Ee,"PermissionFlag",{enumerable:!0,get:function(){return Re.PermissionFlag}}),Object.defineProperty(Ee,"PixelsPerInch",{enumerable:!0,get:function(){return je.PixelsPerInch}}),Object.defineProperty(Ee,"PromiseCapability",{enumerable:!0,get:function(){return Re.PromiseCapability}}),Object.defineProperty(Ee,"RenderingCancelledException",{enumerable:!0,get:function(){return je.RenderingCancelledException}}),Object.defineProperty(Ee,"SVGGraphics",{enumerable:!0,get:function(){return Te.SVGGraphics}}),Object.defineProperty(Ee,"UnexpectedResponseException",{enumerable:!0,get:function(){return Re.UnexpectedResponseException}}),Object.defineProperty(Ee,"Util",{enumerable:!0,get:function(){return Re.Util}}),Object.defineProperty(Ee,"VerbosityLevel",{enumerable:!0,get:function(){return Re.VerbosityLevel}}),Object.defineProperty(Ee,"XfaLayer",{enumerable:!0,get:function(){return Ue.XfaLayer}}),Object.defineProperty(Ee,"build",{enumerable:!0,get:function(){return Te.build}}),Object.defineProperty(Ee,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return Re.createValidAbsoluteUrl}}),Object.defineProperty(Ee,"getDocument",{enumerable:!0,get:function(){return Te.getDocument}}),Object.defineProperty(Ee,"getFilenameFromUrl",{enumerable:!0,get:function(){return je.getFilenameFromUrl}}),Object.defineProperty(Ee,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return je.getPdfFilenameFromUrl}}),Object.defineProperty(Ee,"getXfaPageViewport",{enumerable:!0,get:function(){return je.getXfaPageViewport}}),Object.defineProperty(Ee,"isDataScheme",{enumerable:!0,get:function(){return je.isDataScheme}}),Object.defineProperty(Ee,"isPdfFile",{enumerable:!0,get:function(){return je.isPdfFile}}),Object.defineProperty(Ee,"loadScript",{enumerable:!0,get:function(){return je.loadScript}}),Object.defineProperty(Ee,"noContextMenu",{enumerable:!0,get:function(){return je.noContextMenu}}),Object.defineProperty(Ee,"normalizeUnicode",{enumerable:!0,get:function(){return Re.normalizeUnicode}}),Object.defineProperty(Ee,"renderTextLayer",{enumerable:!0,get:function(){return Oe.renderTextLayer}}),Object.defineProperty(Ee,"setLayerDimensions",{enumerable:!0,get:function(){return je.setLayerDimensions}}),Object.defineProperty(Ee,"shadow",{enumerable:!0,get:function(){return Re.shadow}}),Object.defineProperty(Ee,"updateTextLayer",{enumerable:!0,get:function(){return Oe.updateTextLayer}}),Object.defineProperty(Ee,"version",{enumerable:!0,get:function(){return Te.version}});var Re=__w_pdfjs_require__(1),Te=__w_pdfjs_require__(2),je=__w_pdfjs_require__(6),Oe=__w_pdfjs_require__(26),Me=__w_pdfjs_require__(27),De=__w_pdfjs_require__(5),$e=__w_pdfjs_require__(29),Be=__w_pdfjs_require__(14),Ue=__w_pdfjs_require__(32)})(),__webpack_exports__})())})(pdf);var pdfExports=pdf.exports;const pdf_default=getDefaultExportFromCjs(pdfExports),pdfjs=pdf_default;var __spreadArray=function(Ee,Re,Te){if(Te||arguments.length===2)for(var je=0,Oe=Re.length,Me;je<Oe;je++)(Me||!(je in Re))&&(Me||(Me=Array.prototype.slice.call(Re,0,je)),Me[je]=Re[je]);return Ee.concat(Me||Array.prototype.slice.call(Re))},clipboardEvents=["onCopy","onCut","onPaste"],compositionEvents=["onCompositionEnd","onCompositionStart","onCompositionUpdate"],focusEvents=["onFocus","onBlur"],formEvents=["onInput","onInvalid","onReset","onSubmit"],imageEvents=["onLoad","onError"],keyboardEvents=["onKeyDown","onKeyPress","onKeyUp"],mediaEvents=["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],mou
3993seEvents=["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],dragEvents=["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],selectionEvents=["onSelect"],touchEvents=["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],pointerEvents=["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],uiEvents=["onScroll"],wheelEvents=["onWheel"],animationEvents=["onAnimationStart","onAnimationEnd","onAnimationIteration"],transitionEvents=["onTransitionEnd"],otherEvents=["onToggle"],changeEvents=["onChange"],allEvents=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],clipboardEvents,!0),compositionEvents,!0),focusEvents,!0),formEvents,!0),imageEvents,!0),keyboardEvents,!0),mediaEvents,!0),mouseEvents,!0),dragEvents,!0),selectionEvents,!0),touchEvents,!0),pointerEvents,!0),uiEvents,!0),wheelEvents,!0),animationEvents,!0),transitionEvents,!0),changeEvents,!0),otherEvents,!0);function makeEventProps(Ee,Re){var Te={};return allEvents.forEach(function(je){var Oe=Ee[je];Oe&&(Re?Te[je]=function(Me){return Oe(Me,Re(je))}:Te[je]=Oe)}),Te}function makeCancellablePromise(Ee){var Re=!1,Te=new Promise(function(je,Oe){Ee.then(function(Me){return!Re&&je(Me)}
3993).catch(function(Me){return!Re&&Oe(Me)})});return{promise:Te,cancel:function(){Re=!0}}}var prefix="Invariant failed";function invariant(Ee,Re){if(!Ee)throw new Error(prefix)}var warning=function(){},warning_1=warning;const warning$1=getDefaultExportFromCjs(warning_1);var has=Object.prototype.hasOwnProperty;function find(Ee,Re,Te){for(Te of Ee.keys())if(dequal(Te,Re))return Te}function dequal(Ee,Re){var Te,je,Oe;if(Ee===Re)return!0;if(Ee&&Re&&(Te=Ee.constructor)===Re.constructor){if(Te===Date)return Ee.getTime()===Re.getTime();if(Te===RegExp)return Ee.toString()===Re.toString();if(Te===Array){if((je=Ee.length)===Re.length)for(;je--&&dequal(Ee[je],Re[je]););return je===-1}if(Te===Set){if(Ee.size!==Re.size)return!1;for(je of Ee)if(Oe=je,Oe&&typeof Oe=="object"&&(Oe=find(Re,Oe),!Oe)||!Re.has(Oe))return!1;return!0}if(Te===Map){if(Ee.size!==Re.size)return!1;for(je of Ee)if(Oe=je[0],Oe&&typeof Oe=="object"&&(Oe=find(Re,Oe),!Oe)||!dequal(je[1],Re.get(Oe)))return!1;return!0}if(Te===ArrayBuffer)Ee=new Uint8Array(Ee),Re=new Uint8Array(Re);else if(Te===DataView){if((je=Ee.byteLength)===Re.byteLength)for(;je--&&Ee.getInt8(je)===Re.getInt8(je););return je===-1}if(ArrayBuffer.isView(Ee)){if((je=Ee.byteLength)===Re.byteLength)for(;je--&&Ee[je]===Re[je];);return je===-1}if(!Te||typeof Ee=="object"){je=0;for(Te in Ee)if(has.call(Ee,Te)&&++je&&!has.call(Re,Te)||!(Te in Re)||!dequal(Ee[Te],Re[Te]))return!1;return Object.keys(Re).length===je}}return Ee!==Ee&&Re!==Re}const DocumentContext=reactExports.createContext(null);function Message({children:Ee,type:Re}){return React$3.createElement("div",{className:`react-pdf__message react-pdf__message--${Re}`},Ee)}const DEFAULT_LINK_REL="noopener noreferrer nofollow";class LinkService{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(Re){this.pdfDocument=Re}setViewer(Re){this.pdfViewer=Re}setExternalLinkRel(Re){this.externalLinkRel=Re}setExternalLinkTarget(Re){this.externalLinkTarget=Re}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return invariant(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(Re){invariant(this.pdfViewer),this.pdfViewer.currentPageNumber=Re}get rotation(){return 0}set rotation(Re){}goToDestination(Re){return new Promise(Te=>{invariant(this.pdfDocument),invariant(Re),typeof Re=="string"?this.pdfDocument.getDestination(Re).then(Te):Array.isArray(Re)?Te(Re):Re.then(Te)}).then(Te=>{invariant(Array.isArray(Te));const je=Te[0];new Promise(Oe=>{invariant(this.pdfDocument),je instanceof Object?this.pdfDocument.getPageIndex(je).then(Me=>{Oe(Me)}).catch(()=>{invariant(!1)}):typeof je=="number"?Oe(je):invariant(!1)}).then(Oe=>{const Me=Oe+1;invariant(this.pdfViewer),invariant(Me>=1&&Me<=this.pagesCount),this.pdfViewer.scrollPageIntoView({dest:Te,pageIndex:Oe,pageNumber:Me})})})}navigateTo(Re){this.goToDestination(Re)}goToPage(Re){const Te=Re-1;invariant(this.pdfViewer),invariant(Re>=1&&Re<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:Te,pageNumber:Re})}addLinkAttributes(Re,Te,je){Re.href=Te,Re.rel=this.externalLinkRel||DEFAULT_LINK_REL,Re.target=je?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},isBrowser=typeof document<"u",isLocalFileSystem=isBrowser&&window.location.protocol==="file:";function isDefined(Ee){return typeof Ee<"u"}function isProvided(Ee){return isDefined(Ee)&&Ee!==null}function isString$1(Ee){return typeof Ee=="string"}function isArrayBuffer(Ee){return Ee instanceof ArrayBuffer}function isBlob(Ee){return invariant(isBrowser),Ee instanceof Blob}function isDataURI(Ee){return isString$1(Ee)&&/^data:/.test(Ee)}function dataURItoByteString(Ee){invariant(isDataURI(Ee));const[Re="",Te=""]=Ee.split(",");return Re.split(";").indexOf("base64")!==-1?atob(Te):unescape(Te)}function getDevicePixelRatio(){return isBrowser&&window.devicePixelRatio||1}const allowFileAccessFromFilesTip="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function displayCORSWarning(){warning$1(!isLocalFileSystem,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${allowFileAccessFromFilesTip}`)}function displayWorkerWarning(){warning$1(!isLocalFileSystem,`Loading PDF.js
3993worker may not work on protocols other than HTTP/HTTPS. ${allowFileAccessFromFilesTip}`)}function cancelRunningTask(Ee){Ee&&Ee.cancel&&Ee.cancel()}function makePageCallback(Ee,Re){return Object.defineProperty(Ee,"width",{get(){return this.view[2]*Re},configurable:!0}),Object.defineProperty(Ee,"height",{get(){return this.view[3]*Re},configurable:!0}),Object.defineProperty(Ee,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(Ee,"originalHeight",{get(){return this.view[3]},configurable:!0}),Ee}function isCancelException(Ee){return Ee.name==="RenderingCancelledException"}function loadFromFile(Ee){return new Promise((Re,Te)=>{const je=new FileReader;je.onload=()=>{if(!je.result)return Te(new Error("Error while reading a file."));Re(je.result)},je.onerror=Oe=>{if(!Oe.target)return Te(new Error("Error while reading a file."));const{error:Me}=Oe.target;if(!Me)return Te(new Error("Error while reading a file."));switch(Me.code){case Me.NOT_FOUND_ERR:return Te(new Error("Error while reading a file: File not found."));case Me.SECURITY_ERR:return Te(new Error("Error while reading a file: Security error."));case Me.ABORT_ERR:return Te(new Error("Error while reading a file: Aborted."));default:return Te(new Error("Error while reading a file."))}},je.readAsArrayBuffer(Ee)})}function reducer(Ee,Re){switch(Re.type){case"RESOLVE":return{value:Re.value,error:void 0};case"REJECT":return{value:!1,error:Re.error};case"RESET":return{value:void 0,error:void 0};default:return Ee}}function useResolver(){return reactExports.useReducer(reducer,{value:void 0,error:void 0})}const{PDFDataRangeTransport:PDFDataRangeTransport$1}=pdfjs,eventProps=(()=>{const Ee={};return allEvents.forEach(Re=>{Ee[Re]=PropTypes.func}),Ee})(),isTypedArray=PropTypes.oneOfType([PropTypes.instanceOf(Int8Array),PropTypes.instanceOf(Uint8Array),PropTypes.instanceOf(Uint8ClampedArray),PropTypes.instanceOf(Int16Array),PropTypes.instanceOf(Uint16Array),PropTypes.instanceOf(Int32Array),PropTypes.instanceOf(Uint32Array),PropTypes.instanceOf(Float32Array),PropTypes.instanceOf(Float64Array)]),fileTypes=[PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.shape({data:PropTypes.oneOfType([PropTypes.string,PropTypes.instanceOf(ArrayBuffer),PropTypes.arrayOf(PropTypes.number.isRequired),isTypedArray]).isRequired}),PropTypes.shape({range:PropTypes.instanceOf(PDFDataRangeTransport$1).isRequired}),PropTypes.shape({url:PropTypes.string.isRequired})];typeof Blob<"u"&&fileTypes.push(PropTypes.instanceOf(Blob));const isClassName=PropTypes.oneOfType([PropTypes.string,PropTypes.arrayOf(PropTypes.string)]),isFile=PropTypes.oneOfType(fileTypes);PropTypes.instanceOf(LinkService);PropTypes.oneOf(["_self","_blank","_parent","_top"]);PropTypes.shape({commonObjs:PropTypes.shape({}).isRequired,getAnnotations:PropTypes.func.isRequired,getTextContent:PropTypes.func.isRequired,getViewport:PropTypes.func.isRequired,render:PropTypes.func.isRequired});const isPageIndex=function Ee(Re,Te,je){const{[Te]:Oe,pageNumber:Me,pdf:De}=Re;if(!isDefined(De))return null;if(isDefined(Oe)){if(typeof Oe!="number")return new Error(`\`${Te}\` of type \`${typeof Oe}\` supplied to \`${je}\`, expected \`number\`.`);if(Oe<0)return new Error(`Expected \`${Te}\` to be greater or equal to 0.`);const{numPages:$e}=De;if(Oe+1>$e)return new Error(`Expected \`${Te}\` to be less or equal to ${$e-1}.`)}else if(!isDefined(Me))return new Error(`\`${Te}\` not supplied. Either pageIndex or pageNumber must be supplied to \`${je}\`.`);return null},isPageNumber=function Ee(Re,Te,je){const{[Te]:Oe,pageIndex:Me,pdf:De}=Re;if(!isDefined(De))return null;if(isDefined(Oe)){if(typeof Oe!="number")return new Error(`\`${Te}\` of type \`${typeof Oe}\` supplied to \`${je}\`, expected \`number\`.`);if(Oe<1)return new Error(`Expected \`${Te}\` to be greater or equal to 1.`);const{numPages:$e}=De;if(Oe>$e)return new Error(`Expected \`${Te}\` to be less or equal to ${$e}.`)}else if(!isDefined(Me))return new Error(`\`${Te}\` not supplied. Either pageIndex or pageNumber must be supplied to \`${je}\`.`);return null}
3993,isPdf=PropTypes.oneOfType([PropTypes.any,PropTypes.oneOf([!1])]),isRef=PropTypes.oneOfType([PropTypes.func,PropTypes.exact({current:PropTypes.any})]),isRenderMode=PropTypes.oneOf(["canvas","custom","none","svg"]),isRotate=PropTypes.oneOf([0,90,180,270]);var __awaiter=function(Ee,Re,Te,je){function Oe(Me){return Me instanceof Te?Me:new Te(function(De){De(Me)})}return new(Te||(Te=Promise))(function(Me,De){function $e(ze){try{Ue(je.next(ze))}catch(We){De(We)}}function Be(ze){try{Ue(je.throw(ze))}catch(We){De(We)}}function Ue(ze){ze.done?Me(ze.value):Oe(ze.value).then($e,Be)}Ue((je=je.apply(Ee,Re||[])).next())})},__rest$1=function(Ee,Re){var Te={};for(var je in Ee)Object.prototype.hasOwnProperty.call(Ee,je)&&Re.indexOf(je)<0&&(Te[je]=Ee[je]);if(Ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,je=Object.getOwnPropertySymbols(Ee);Oe<je.length;Oe++)Re.indexOf(je[Oe])<0&&Object.prototype.propertyIsEnumerable.call(Ee,je[Oe])&&(Te[je[Oe]]=Ee[je[Oe]]);return Te};const{PDFDataRangeTransport}=pdfjs,defaultOnPassword=(Ee,Re)=>{switch(Re){case PasswordResponses.NEED_PASSWORD:{const Te=prompt("Enter the password to open this PDF file.");Ee(Te);break}case PasswordResponses.INCORRECT_PASSWORD:{const Te=prompt("Invalid password. Please try again.");Ee(Te);break}}};function isParameterObject(Ee){return typeof Ee=="object"&&Ee!==null&&("data"in Ee||"range"in Ee||"url"in Ee)}const Document=reactExports.forwardRef(function Ee(Re,Te){var{children:je,className:Oe,error:Me="Failed to load PDF file.",externalLinkRel:De,externalLinkTarget:$e,file:Be,inputRef:Ue,imageResourcesPath:ze,loading:We="Loading PDFâ¦",noData:Xe="No PDF file specified.",onItemClick:He,onLoadError:qe,onLoadProgress:Ge,onLoadSuccess:Ye,onPassword:Ve=defaultOnPassword,onSourceError:Ke,onSourceSuccess:Qe,options:Ze,renderMode:Je,rotate:ir}=Re,rr=__rest$1(Re,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[ar,or]=useResolver(),{value:pr,error:tr}=ar,[nr,hr]=useResolver(),{value:sr,error:xr}=nr,Rr=reactExports.useRef(new LinkService),br=reactExports.useRef([]),wr=reactExports.useRef(),vr=reactExports.useRef();reactExports.useEffect(()=>{Be&&Be!==wr.current&&isParameterObject(Be)&&(warning$1(!dequal(Be,wr.current),`File prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.`),wr.current=Be)},[Be]),reactExports.useEffect(()=>{Ze&&Ze!==vr.current&&(warning$1(!dequal(Ze,vr.current),`Options prop passed to <Document /> changed, but it's equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.`),vr.current=Ze)},[Ze]);const Dr=reactExports.useRef({scrollPageIntoView:Lr=>{const{dest:jr,pageNumber:fr,pageIndex:Cr=fr-1}=Lr;if(He){He({dest:jr,pageIndex:Cr,pageNumber:fr});return}const Mr=br.current[Cr];if(Mr){Mr.scrollIntoView();return}warning$1(!1,`An internal link leading to page ${fr} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});reactExports.useImperativeHandle(Te,()=>({linkService:Rr,pages:br,viewer:Dr}),[]);function kr(){Qe&&Qe()}function cr(){tr&&(warning$1(!1,tr.toString()),Ke&&Ke(tr))}function dr(){or({type:"RESET"})}reactExports.useEffect(dr,[Be,or]);const ur=reactExports.useCallback(()=>__awaiter(this,void 0,void 0,function*(){if(!Be)return null;if(typeof Be=="string")return isDataURI(Be)?{data:dataURItoByteString(Be)}:(displayCORSWarning(),{url:Be});if(Be instanceof PDFDataRangeTransport)return{range:Be};if(isArrayBuffer(Be))return{data:Be};if(isBrowser&&isBlob(Be))return{data:yield loadFromFile(Be)};if(invariant(typeof Be=="object"),invariant(isParameterObject(Be)),"url"in Be&&typeof Be.url=="string"){if(isDataURI(Be.url)){const{url:Lr}=Be,jr=__rest$1(Be,["url"]),fr=dataURItoByteString(Lr);return Object.assign({data:fr},jr)}displayCORSWarning()}return Be}),[Be]);reactExports.useEffect(()=>{const Lr=makeCancellablePromise(ur());return Lr.promise.then(jr=>{or({type:"RESOLVE",value:jr})}).catch(jr=>{or({type:"REJECT",error:jr})}),()=>{cancelRunningTask(Lr)}},[ur,or]),reactExports.useEffect(()=>{if(!(typeof pr>"u")){if(pr===!1){cr();return}kr()}},[pr]);
3993function gr(){sr&&(Ye&&Ye(sr),br.current=new Array(sr.numPages),Rr.current.setDocument(sr))}function _r(){xr&&(warning$1(!1,xr.toString()),qe&&qe(xr))}function Ir(){hr({type:"RESET"})}reactExports.useEffect(Ir,[hr,pr]);function Ar(){if(!pr)return;const Lr=Object.assign(Object.assign({},Ze),{isEvalSupported:!1}),jr=Object.assign(Object.assign({},pr),Lr),fr=pdfjs.getDocument(jr);Ge&&(fr.onProgress=Ge),Ve&&(fr.onPassword=Ve);const Cr=fr;return Cr.promise.then(Mr=>{hr({type:"RESOLVE",value:Mr})}).catch(Mr=>{Cr.destroyed||hr({type:"REJECT",error:Mr})}),()=>{Cr.destroy()}}reactExports.useEffect(Ar,[Ze,hr,pr]),reactExports.useEffect(()=>{if(!(typeof sr>"u")){if(sr===!1){_r();return}gr()}},[sr]);function Tr(){Rr.current.setViewer(Dr.current),Rr.current.setExternalLinkRel(De),Rr.current.setExternalLinkTarget($e)}reactExports.useEffect(Tr,[De,$e]);function Nr(Lr,jr){br.current[Lr]=jr}function Br(Lr){delete br.current[Lr]}const Hr=reactExports.useMemo(()=>({imageResourcesPath:ze,linkService:Rr.current,onItemClick:He,pdf:sr,registerPage:Nr,renderMode:Je,rotate:ir,unregisterPage:Br}),[ze,He,sr,Je,ir]),Vr=reactExports.useMemo(()=>makeEventProps(rr,()=>sr),[rr,sr]);function mr(){return React$3.createElement(DocumentContext.Provider,{value:Hr},je)}function Sr(){return Be?sr==null?React$3.createElement(Message,{type:"loading"},typeof We=="function"?We():We):sr===!1?React$3.createElement(Message,{type:"error"},typeof Me=="function"?Me():Me):mr():React$3.createElement(Message,{type:"no-data"},typeof Xe=="function"?Xe():Xe)}return React$3.createElement("div",Object.assign({className:clsx("react-pdf__Document",Oe),ref:Ue,style:{"--scale-factor":"1"}},Vr),Sr())}),isFunctionOrNode$1=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Document.propTypes=Object.assign(Object.assign({},eventProps),{children:PropTypes.node,className:isClassName,error:isFunctionOrNode$1,externalLinkRel:PropTypes.string,externalLinkTarget:PropTypes.oneOf(["_self","_blank","_parent","_top"]),file:isFile,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode$1,noData:isFunctionOrNode$1,onItemClick:PropTypes.func,onLoadError:PropTypes.func,onLoadProgress:PropTypes.func,onLoadSuccess:PropTypes.func,onPassword:PropTypes.func,onSourceError:PropTypes.func,onSourceSuccess:PropTypes.func,options:PropTypes.shape({canvasFactory:PropTypes.any,canvasMaxAreaInBytes:PropTypes.number,cMapPacked:PropTypes.bool,CMapReaderFactory:PropTypes.any,cMapUrl:PropTypes.string,disableAutoFetch:PropTypes.bool,disableFontFace:PropTypes.bool,disableRange:PropTypes.bool,disableStream:PropTypes.bool,docBaseUrl:PropTypes.string,enableXfa:PropTypes.bool,filterFactory:PropTypes.any,fontExtraProperties:PropTypes.bool,httpHeaders:PropTypes.object,isEvalSupported:PropTypes.bool,isOffscreenCanvasSupported:PropTypes.bool,length:PropTypes.number,maxImageSize:PropTypes.number,ownerDocument:PropTypes.any,password:PropTypes.string,pdfBug:PropTypes.bool,rangeChunkSize:PropTypes.number,StandardFontDataFactory:PropTypes.any,standardFontDataUrl:PropTypes.string,stopAtErrors:PropTypes.bool,useSystemFonts:PropTypes.bool,useWorkerFetch:PropTypes.bool,verbosity:PropTypes.number,withCredentials:PropTypes.bool,worker:PropTypes.any}),rotate:PropTypes.number});function useDocumentContext(){return reactExports.useContext(DocumentContext)}function mergeRefs(){for(var Ee=[],Re=0;Re<arguments.length;Re++)Ee[Re]=arguments[Re];var Te=Ee.filter(Boolean);if(Te.length<=1){var je=Te[0];return je||null}return function(Me){Te.forEach(function(De){typeof De=="function"?De(Me):De&&(De.current=Me)})}}const PageContext=reactExports.createContext(null),PDF_ROLE_TO_HTML_ROLE={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},HEADING_PATTERN=/^H(\d+)$/;function isPdfRole(Ee){return Ee in PDF_ROLE_TO_HTML_ROLE}function isStructTreeNode(Ee){return"children"in Ee}function isStructTreeNodeWithOnlyContentChild(Ee){return isStructTreeNode(Ee)?Ee.children.length===1&&0 in Ee.children&&"id"in Ee.children[0]:!1}function getRoleAttributes(Ee){const Re={};if(isStructTreeNode(Ee)){const{role:Te}=Ee,je=Te.match(HEADING_PATTERN);if(je)Re.role="heading",Re["aria-level"]=Number(je[1]);else if(isPdfRole(Te)){const Oe=PDF_ROLE_TO_HTML_ROLE[Te];Oe&&(Re.role=Oe)}}return Re}function getBaseAttributes(Ee){const Re={};if(isStructTreeNode(Ee)){if(Ee.alt!==void 0&&(Re["aria-label"]=Ee.alt),Ee.lang!==void 0&&(Re.lang=Ee.lang),isStru
3993ctTreeNodeWithOnlyContentChild(Ee)){const[Te]=Ee.children;if(Te){const je=getBaseAttributes(Te);return Object.assign(Object.assign({},Re),je)}}}else"id"in Ee&&(Re["aria-owns"]=Ee.id);return Re}function getAttributes(Ee){return Ee?Object.assign(Object.assign({},getRoleAttributes(Ee)),getBaseAttributes(Ee)):null}function StructTreeItem({className:Ee,node:Re}){const Te=reactExports.useMemo(()=>getAttributes(Re),[Re]),je=reactExports.useMemo(()=>!isStructTreeNode(Re)||isStructTreeNodeWithOnlyContentChild(Re)?null:Re.children.map((Oe,Me)=>React$3.createElement(StructTreeItem,{key:Me,node:Oe})),[Re]);return React$3.createElement("span",Object.assign({className:Ee},Te),je)}function usePageContext(){return reactExports.useContext(PageContext)}function StructTree(){const Ee=usePageContext();invariant(Ee);const{onGetStructTreeError:Re,onGetStructTreeSuccess:Te}=Ee,[je,Oe]=useResolver(),{value:Me,error:De}=je,{customTextRenderer:$e,page:Be}=Ee;function Ue(){Me&&Te&&Te(Me)}function ze(){De&&(warning$1(!1,De.toString()),Re&&Re(De))}function We(){Oe({type:"RESET"})}reactExports.useEffect(We,[Oe,Be]);
3993function Xe(){if($e||!Be)return;const He=makeCancellablePromise(Be.getStructTree()),qe=He;return He.promise.then(Ge=>{Oe({type:"RESOLVE",value:Ge})}).catch(Ge=>{Oe({type:"REJECT",error:Ge})}),()=>cancelRunningTask(qe)}return reactExports.useEffect(Xe,[$e,Be,Oe]),reactExports.useEffect(()=>{if(Me!==void 0){if(Me===!1){ze();return}Ue()}},[Me]),Me?React$3.createElement(StructTreeItem,{className:"react-pdf__Page__structTree structTree",node:Me}):null}const ANNOTATION_MODE=pdfjs.AnnotationMode;function PageCanvas(Ee){const Re=usePageContext();invariant(Re);const Te=Object.assign(Object.assign({},Re),Ee),{_className:je,canvasBackground:Oe,devicePixelRatio:Me=getDevicePixelRatio(),onRenderError:De,onRenderSuccess:$e,page:Be,renderForms:Ue,renderTextLayer:ze,rotate:We,scale:Xe}=Te,{canvasRef:He}=Ee;invariant(Be);const qe=reactExports.useRef(null);function Ge(){Be&&$e&&$e(makePageCallback(Be,Xe))}function Ye(Je){isCancelException(Je)||(warning$1(!1,Je.toString()),De&&De(Je))}const Ve=reactExports.useMemo(()=>Be.getViewport({scale:Xe*Me,rotation:We}),[Me,Be,We,Xe]),Ke=reactExports.useMemo(()=>Be.getViewport({scale:Xe,rotation:We}),[Be,We,Xe]);function Qe(){if(!Be)return;Be.cleanup();const{current:Je}=qe;if(!Je)return;Je.width=Ve.width,Je.height=Ve.height,Je.style.width=`${Math.floor(Ke.width)}px`,Je.style.height=`${Math.floor(Ke.height)}px`,Je.style.visibility="hidden";const ir={annotationMode:Ue?ANNOTATION_MODE.ENABLE_FORMS:ANNOTATION_MODE.ENABLE,canvasContext:Je.getContext("2d",{alpha:!1}),viewport:Ve};Oe&&(ir.background=Oe);const rr=Be.render(ir),ar=rr;return rr.promise.then(()=>{Je.style.visibility="",Ge()}).catch(Ye),()=>cancelRunningTask(ar)}reactExports.useEffect(Qe,[Oe,qe,Me,Be,Ue,Ve,Ke]);const Ze=reactExports.useCallback(()=>{const{current:Je}=qe;Je&&(Je.width=0,Je.height=0)},[qe]);return reactExports.useEffect(()=>Ze,[Ze]),React$3.createElement("canvas",{className:`${je}__canvas`,dir:"ltr",ref:mergeRefs(He,qe),style:{display:"block",userSelect:"none"}},ze?React$3.createElement(StructTree,null):null)}function PageSVG(){const Ee=usePageContext();invariant(Ee);const{_className:Re,onRenderSuccess:Te,onRenderError:je,page:Oe,rotate:Me,scale:De}=Ee;invariant(Oe);const[$e,Be]=useResolver(),{value:Ue,error:ze}=$e;function We(){Oe&&Te&&Te(makePageCallback(Oe,De))}function Xe(){ze&&(isCancelException(ze)||(warning$1(!1,ze.toString()),je&&je(ze)))}const He=reactExports.useMemo(()=>Oe.getViewport({scale:De,rotation:Me}),[Oe,Me,De]);function qe(){Be({type:"RESET"})}reactExports.useEffect(qe,[Oe,Be,He]);function Ge(){if(!Oe)return;const Qe=makeCancellablePromise(Oe.getOperatorList());return Qe.promise.then(Ze=>{new pdfjs.SVGGraphics(Oe.commonObjs,Oe.objs).getSVG(Ze,He).then(ir=>{if(!(ir instanceof SVGElement))throw new Error("getSVG returned unexpected result.");Be({type:"RESOLVE",value:ir})}).catch(ir=>{Be({type:"REJECT",error:ir})})}).catch(Ze=>{Be({type:"REJECT",error:Ze})}),()=>cancelRunningTask(Qe)}reactExports.useEffect(Ge,[Oe,Be,He]),reactExports.useEffect(()=>{if(Ue!==void 0){if(Ue===!1){Xe();return}We()}},[Ue]);function Ye(Qe){if(!Qe||!Ue)return;Qe.firstElementChild||Qe.appendChild(Ue);const{width:Ze,height:Je}=He;Ue.setAttribute("width",`${Ze}`),Ue.setAttribute("height",`${Je}`)}const{width:Ve,height:Ke}=He;return React$3.createElement("div",{className:`${Re}__svg`,ref:Qe=>Ye(Qe),style:{display:"block",backgroundColor:"white",overflow:"hidden",width:Ve,height:Ke,userSelect:"none"}})}function isTextItem(Ee){return"str"in Ee}function TextLayer(){const Ee=usePageContext();invariant(Ee);const{customTextRenderer:Re,onGetTextError:Te,onGetTextSuccess:je,onRenderTextLayerError:Oe,onRenderTextLayerSuccess:Me,page:De,pageIndex:$e,pageNumber:Be,rotate:Ue,scale:ze}=Ee;invariant(De);const[We,Xe]=useResolver(),{value:He,error:qe}=We,Ge=reactExports.useRef(null),Ye=reactExports.useRef();warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10)===1,"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer");function Ve(){He&&je&&je(He)}function Ke(){qe&&(warning$1(!1,qe.toString()),Te&&Te(qe))}function Qe(){Xe({type:"RESET"})}reactExports.useEffect(Qe,[De,Xe]);function Ze(){if(!De)return;const tr=makeCancellablePromise(De.getTextContent()),nr=tr;return tr.promise.then(hr=>{Xe({type:"RESOLVE",value:hr})}).catch(hr=>{Xe({type:"REJECT",error:hr})}),()=>cancelRunningTask(nr)}reactExports.useEffect(Ze,[De,Xe]),reactExports.useEffect(()=>{if(He!==void 0){if(He===!1){Ke();return}Ve()}},[He]);const Je=reactExports.useCallback(()=>{Me&&Me()},[Me]),ir=reactExports.useCallback(tr=>{warning$1(!1,tr.toString()),Oe&&Oe(tr)},[Oe]);function rr(){const tr=Ye.current;tr&&tr.classList.add("active")}function ar(){const tr=Ye.current;tr&&tr.classList.remove("active")}const or=reactExports.useMemo(()=>De.getViewport({scale:ze,rotation:Ue}),[De,Ue,ze]);function pr(){if(!De||!He)return;const{current:tr}=Ge;if(!tr)return;tr.innerHTML="";const nr=De.streamTextContent({includeMarkedContent:!0}),hr={container:tr,textContentSource:nr,viewport:or},sr=pdfjs.renderTextLayer(hr),xr=sr;return sr.promise.then(()=>{const Rr=document.createElement("div");Rr.className="endOfContent",tr.append(Rr),Ye.current=Rr;const br=tr.querySelectorAll('[role="presentation"]');if(Re){let wr=0;
3993He.items.forEach((vr,Dr)=>{if(!isTextItem(vr))return;const kr=br[wr];if(!kr)return;const cr=Re(Object.assign({pageIndex:$e,pageNumber:Be,itemIndex:Dr},vr));kr.innerHTML=cr,wr+=vr.str&&vr.hasEOL?2:1})}Je()}).catch(ir),()=>cancelRunningTask(xr)}return reactExports.useLayoutEffect(pr,[Re,ir,Je,De,$e,Be,He,or]),React$3.createElement("div",{className:clsx("react-pdf__Page__textContent","textLayer"),onMouseUp:ar,onMouseDown:rr,ref:Ge})}function AnnotationLayer(){const Ee=useDocumentContext(),Re=usePageContext();invariant(Re);const Te=Object.assign(Object.assign({},Ee),Re),{imageResourcesPath:je,linkService:Oe,onGetAnnotationsError:Me,onGetAnnotationsSuccess:De,onRenderAnnotationLayerError:$e,onRenderAnnotationLayerSuccess:Be,page:Ue,pdf:ze,renderForms:We,rotate:Xe,scale:He=1}=Te;invariant(ze),invariant(Ue),invariant(Oe);const[qe,Ge]=useResolver(),{value:Ye,error:Ve}=qe,Ke=reactExports.useRef(null);warning$1(parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10)===1,"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations");function Qe(){Ye&&De&&De(Ye)}function Ze(){Ve&&(warning$1(!1,Ve.toString()),Me&&Me(Ve))}function Je(){Ge({type:"RESET"})}reactExports.useEffect(Je,[Ge,Ue]);function ir(){if(!Ue)return;const tr=makeCancellablePromise(Ue.getAnnotations()),nr=tr;return tr.promise.then(hr=>{Ge({type:"RESOLVE",value:hr})}).catch(hr=>{Ge({type:"REJECT",error:hr})}),()=>{cancelRunningTask(nr)}}reactExports.useEffect(ir,[Ge,Ue,We]),reactExports.useEffect(()=>{if(Ye!==void 0){if(Ye===!1){Ze();return}Qe()}},[Ye]);function rr(){Be&&Be()}function ar(tr){warning$1(!1,`${tr}`),$e&&$e(tr)}const or=reactExports.useMemo(()=>Ue.getViewport({scale:He,rotation:Xe}),[Ue,Xe,He]);function pr(){if(!ze||!Ue||!Oe||!Ye)return;const{current:tr}=Ke;if(!tr)return;const nr=or.clone({dontFlip:!0}),hr={accessibilityManager:null,annotationCanvasMap:null,div:tr,l10n:null,page:Ue,viewport:nr},sr={annotations:Ye,annotationStorage:ze.annotationStorage,div:tr,downloadManager:null,imageResourcesPath:je,linkService:Oe,page:Ue,renderForms:We,viewport:nr};tr.innerHTML="";try{new pdfjs.AnnotationLayer(hr).render(sr),rr()}catch(xr){ar(xr)}return()=>{}}return reactExports.useEffect(pr,[Ye,je,Oe,Ue,We,or]),React$3.createElement("div",{className:clsx("react-pdf__Page__annotations","annotationLayer"),ref:Ke})}var __rest=function(Ee,Re){var Te={};for(var je in Ee)Object.prototype.hasOwnProperty.call(Ee,je)&&Re.indexOf(je)<0&&(Te[je]=Ee[je]);if(Ee!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Oe=0,je=Object.getOwnPropertySymbols(Ee);Oe<je.length;Oe++)Re.indexOf(je[Oe])<0&&Object.prototype.propertyIsEnumerable.call(Ee,je[Oe])&&(Te[je[Oe]]=Ee[je[Oe]]);return Te};const defaultScale=1,Page=function Ee(Re){const Te=useDocumentContext(),je=Object.assign(Object.assign({},Te),Re),{_className:Oe="react-pdf__Page",_enableRegisterUnregisterPage:Me=!0,canvasBackground:De,canvasRef:$e,children:Be,className:Ue,customRenderer:ze,customTextRenderer:We,devicePixelRatio:Xe,error:He="Failed to load the page.",height:qe,inputRef:Ge,loading:Ye="Loading pageâ¦",noData:Ve="No page specified.",onGetAnnotationsError:Ke,onGetAnnotationsSuccess:Qe,onGetStructTreeError:Ze,onGetStructTreeSuccess:Je,onGetTextError:ir,onGetTextSuccess:rr,onLoadError:ar,onLoadSuccess:or,onRenderAnnotationLayerError:pr,onRenderAnnotationLayerSuccess:tr,onRenderError:nr,onRenderSuccess:hr,onRenderTextLayerError:sr,onRenderTextLayerSuccess:xr,pageIndex:Rr,pageNumber:br,pdf:wr,registerPage:vr,renderAnnotationLayer:Dr=!0,renderForms:kr=!1,renderMode:cr="canvas",renderTextLayer:dr=!0,rotate:ur,scale:gr=defaultScale,unregisterPage:_r,width:Ir}=je,Ar=__rest(je,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[Tr,Nr]=useResolver(),{value:Br,error:Hr}=Tr,Vr=reactExports.useRef(null);invariant(wr);const mr=isProvided(br)?br-1:Rr??null,Sr=br??(isProvided(Rr)?Rr+1:null),Lr=ur??(Br?Br.rotate:null),jr=reactExports.useMemo(()=>
3993{if(!Br)return null;let In=1;const yn=gr??defaultScale;if(Ir||qe){const Mn=Br.getViewport({scale:1,rotation:Lr});Ir?In=Ir/Mn.width:qe&&(In=qe/Mn.height)}return yn*In},[qe,Br,Lr,gr,Ir]);function fr(){return()=>{isProvided(mr)&&Me&&_r&&_r(mr)}}reactExports.useEffect(fr,[Me,wr,mr,_r]);function Cr(){if(or){if(!Br||!jr)return;or(makePageCallback(Br,jr))}if(Me&&vr){if(!isProvided(mr)||!Vr.current)return;vr(mr,Vr.current)}}function Mr(){Hr&&(warning$1(!1,Hr.toString()),ar&&ar(Hr))}function $r(){Nr({type:"RESET"})}reactExports.useEffect($r,[Nr,wr,mr]);function Fr(){if(!wr||!Sr)return;const In=makeCancellablePromise(wr.getPage(Sr)),yn=In;return In.promise.then(Mn=>{Nr({type:"RESOLVE",value:Mn})}).catch(Mn=>{Nr({type:"REJECT",error:Mn})}),()=>cancelRunningTask(yn)}reactExports.useEffect(Fr,[Nr,wr,mr,Sr,vr]),reactExports.useEffect(()=>{if(Br!==void 0){if(Br===!1){Mr();return}Cr()}},[Br,jr]);const Kr=reactExports.useMemo(()=>Br&&isProvided(mr)&&Sr&&isProvided(Lr)&&isProvided(jr)?{_className:Oe,canvasBackground:De,customTextRenderer:We,devicePixelRatio:Xe,onGetAnnotationsError:Ke,onGetAnnotationsSuccess:Qe,onGetStructTreeError:Ze,onGetStructTreeSuccess:Je,onGetTextError:ir,onGetTextSuccess:rr,onRenderAnnotationLayerError:pr,onRenderAnnotationLayerSuccess:tr,onRenderError:nr,onRenderSuccess:hr,onRenderTextLayerError:sr,onRenderTextLayerSuccess:xr,page:Br,pageIndex:mr,pageNumber:Sr,renderForms:kr,renderTextLayer:dr,rotate:Lr,scale:jr}:null,[Oe,De,We,Xe,Ke,Qe,Ze,Je,ir,rr,pr,tr,nr,hr,sr,xr,Br,mr,Sr,kr,dr,Lr,jr]),an=reactExports.useMemo(()=>makeEventProps(Ar,()=>Br&&(jr?makePageCallback(Br,jr):void 0)),[Ar,Br,jr]),Wr=`${mr}@${jr}/${Lr}`,hn=`${mr}/${Lr}`;function cn(){switch(cr){case"custom":return invariant(ze),React$3.createElement(ze,{key:`${Wr}_custom`});case"none":return null;case"svg":return React$3.createElement(PageSVG,{key:`${hn}_svg`});case"canvas":default:return React$3.createElement(PageCanvas,{key:`${Wr}_canvas`,canvasRef:$e})}}function tn(){return dr?React$3.createElement(TextLayer,{key:`${Wr}_text`}):null}function Qr(){return Dr?React$3.createElement(AnnotationLayer,{key:`${Wr}_annotations`}):null}function wn(){return React$3.createElement(PageContext.Provider,{value:Kr},cn(),tn(),Qr(),Be)}function gn(){return Sr?wr===null||Br===void 0||Br===null?React$3.createElement(Message,{type:"loading"},typeof Ye=="function"?Ye():Ye):wr===!1||Br===!1?React$3.createElement(Message,{type:"error"},typeof He=="function"?He():He):wn():React$3.createElement(Message,{type:"no-data"},typeof Ve=="function"?Ve():Ve)}return React$3.createElement("div",Object.assign({className:clsx(Oe,Ue),"data-page-number":Sr,ref:mergeRefs(Ge,Vr),style:{"--scale-factor":`${jr}`,backgroundColor:De||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},an),gn())},isFunctionOrNode=PropTypes.oneOfType([PropTypes.func,PropTypes.node]);Page.propTypes=Object.assign(Object.assign({},eventProps),{canvasBackground:PropTypes.string,canvasRef:isRef,children:PropTypes.node,className:isClassName,customRenderer:PropTypes.func,customTextRenderer:PropTypes.func,devicePixelRatio:PropTypes.number,error:isFunctionOrNode,height:PropTypes.number,imageResourcesPath:PropTypes.string,inputRef:isRef,loading:isFunctionOrNode,noData:isFunctionOrNode,onGetTextError:PropTypes.func,onGetTextSuccess:PropTypes.func,onLoadError:PropTypes.func,onLoadSuccess:PropTypes.func,onRenderError:PropTypes.func,onRenderSuccess:PropTypes.func,onRenderTextLayerError:PropTypes.func,onRenderTextLayerSuccess:PropTypes.func,pageIndex:isPageIndex,pageNumber:isPageNumber,pdf:isPdf,renderAnnotationLayer:PropTypes.bool,renderForms:PropTypes.bool,renderMode:isRenderMode,renderTextLayer:PropTypes.bool,rotate:isRotate,scale:PropTypes.number,width:PropTypes.number});displayWorkerWarning();pdfjs.GlobalWorkerOptions.workerSrc="pdf.worker.js";var jszip_min={exports:{}};/*! 3994 3995JSZip v3.10.1 - A JavaScript class for generating and reading zip files 3996<http://stuartk.com/jszip> 3997 3998(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com> 3999Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. 4000 4001JSZip uses the library pako released under the MIT license : 4002https://github.com/nodeca/pako/blob/main/LICENSE 4003*/(function(Ee,Re){(function(Te){Ee.exports=Te()})(function(){return function Te(je,Oe,Me){function De(Ue,ze){if(!Oe[Ue]){if(!je[Ue]){var We=typeof commonjsRequire=="function"&&commonjsRequire;if(!ze&&We)return We(Ue,!0);if($e)return $e(Ue,!0);var Xe=new Error("Cannot find module '"+Ue+"'");throw Xe.code="MODULE_NOT_FOUND",Xe}var He=Oe[Ue]={exports:{}};je[Ue][0].call(He.exports,function(qe){var Ge=je[Ue][1][qe];return De(Ge||qe)},He,He.exports,Te,je,Oe,Me)}return Oe[Ue].exports}for(var $e=typeof commonjsRequire=="function"&&commonjsRequire,Be=0;Be<Me.length;Be++)De(Me[Be]);return De}({1:[function(Te,je,Oe){var Me=Te("./utils"),De=Te("./support"),$e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 2,883 bytes, line 4003
4003+/=";Oe.encode=function(Be){for(var Ue,ze,We,Xe,He,qe,Ge,Ye=[],Ve=0,Ke=Be.length,Qe=Ke,Ze=Me.getTypeOf(Be)!=="string";Ve<Be.length;)Qe=Ke-Ve,We=Ze?(Ue=Be[Ve++],ze=Ve<Ke?Be[Ve++]:0,Ve<Ke?Be[Ve++]:0):(Ue=Be.charCodeAt(Ve++),ze=Ve<Ke?Be.charCodeAt(Ve++):0,Ve<Ke?Be.charCodeAt(Ve++):0),Xe=Ue>>2,He=(3&Ue)<<4|ze>>4,qe=1<Qe?(15&ze)<<2|We>>6:64,Ge=2<Qe?63&We:64,Ye.push($e.charAt(Xe)+$e.charAt(He)+$e.charAt(qe)+$e.charAt(Ge));return Ye.join("")},Oe.decode=function(Be){var Ue,ze,We,Xe,He,qe,Ge=0,Ye=0,Ve="data:";if(Be.substr(0,Ve.length)===Ve)throw new Error("Invalid base64 input, it looks like a data url.");var Ke,Qe=3*(Be=Be.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(Be.charAt(Be.length-1)===$e.charAt(64)&&Qe--,Be.charAt(Be.length-2)===$e.charAt(64)&&Qe--,Qe%1!=0)throw new Error("Invalid base64 input, bad content length.");for(Ke=De.uint8array?new Uint8Array(0|Qe):new Array(0|Qe);Ge<Be.length;)Ue=$e.indexOf(Be.charAt(Ge++))<<2|(Xe=$e.indexOf(Be.charAt(Ge++)))>>4,ze=(15&Xe)<<4|(He=$e.indexOf(Be.charAt(Ge++)))>>2,We=(3&He)<<6|(qe=$e.indexOf(Be.charAt(Ge++))),Ke[Ye++]=Ue,He!==64&&(Ke[Ye++]=ze),qe!==64&&(Ke[Ye++]=We);return Ke}},{"./support":30,"./utils":32}],2:[function(Te,je,Oe){var Me=Te("./external"),De=Te("./stream/DataWorker"),$e=Te("./stream/Crc32Probe"),Be=Te("./stream/DataLengthProbe");function Ue(ze,We,Xe,He,qe){this.compressedSize=ze,this.uncompressedSize=We,this.crc32=Xe,this.compression=He,this.compressedContent=qe}Ue.prototype={getContentWorker:function(){var ze=new De(Me.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Be("data_length")),We=this;return ze.on("end",function(){if(this.streamInfo.data_length!==We.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),ze},getCompressedWorker:function(){return new De(Me.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},Ue.createWorkerFrom=function(ze,We,Xe){return ze.pipe(new $e).pipe(new Be("uncompressedSize")).pipe(We.compressWorker(Xe)).pipe(new Be("compressedSize")).withStreamInfo("compression",We)},je.exports=Ue},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(Te,je,Oe){var Me=Te("./stream/GenericWorker");Oe.STORE={magic:"\0\0",compressWorker:function(){return new Me("STORE compression")},uncompressWorker:function(){return new Me("STORE decompression")}},Oe.DEFLATE=Te("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(Te,je,Oe){var Me=Te("./utils"),De=function(){for(var $e,Be=[],Ue=0;Ue<256;Ue++){$e=Ue;for(var ze=0;ze<8;ze++)$e=1&$e?3988292384^$e>>>1:$e>>>1;Be[Ue]=$e}return Be}();je.exports=function($e,Be){return $e!==void 0&&$e.length?Me.getTypeOf($e)!=="str
4003ing"?function(Ue,ze,We,Xe){var He=De,qe=Xe+We;Ue^=-1;for(var Ge=Xe;Ge<qe;Ge++)Ue=Ue>>>8^He[255&(Ue^ze[Ge])];return-1^Ue}(0|Be,$e,$e.length,0):function(Ue,ze,We,Xe){var He=De,qe=Xe+We;Ue^=-1;for(var Ge=Xe;Ge<qe;Ge++)Ue=Ue>>>8^He[255&(Ue^ze.charCodeAt(Ge))];return-1^Ue}(0|Be,$e,$e.length,0):0}},{"./utils":32}],5:[function(Te,je,Oe){Oe.base64=!1,Oe.binary=!1,Oe.dir=!1,Oe.createFolders=!0,Oe.date=null,Oe.compression=null,Oe.compressionOptions=null,Oe.comment=null,Oe.unixPermissions=null,Oe.dosPermissions=null},{}],6:[function(Te,je,Oe){var Me=null;Me=typeof Promise<"u"?Promise:Te("lie"),je.exports={Promise:Me}},{lie:37}],7:[function(Te,je,Oe){var Me=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",De=Te("pako"),$e=Te("./utils"),Be=Te("./stream/GenericWorker"),Ue=Me?"uint8array":"array";function ze(We,Xe){Be.call(this,"FlateWorker/"+We),this._pako=null,this._pakoAction=We,this._pakoOptions=Xe,this.meta={}}Oe.magic="\b\0",$e.inherits(ze,Be),ze.prototype.processChunk=function(We){this.meta=We.meta,this._pako===null&&this._createPako(),this._pako.push($e.transformTo(Ue,We.data),!1)},ze.prototype.flush=function(){Be.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},ze.prototype.cleanUp=function(){Be.prototype.cleanUp.call(this),this._pako=null},ze.prototype._createPako=function(){this._pako=new De[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var We=this;this._pako.onData=function(Xe){We.push({data:Xe,meta:We.meta})}},Oe.compressWorker=function(We){return new ze("Deflate",We)},Oe.uncompressWorker=function(){return new ze("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(Te,je,Oe){function Me(He,qe){var Ge,Ye="";for(Ge=0;Ge<qe;Ge++)Ye+=String.fromCharCode(255&He),He>>>=8;return Ye}function De(He,qe,Ge,Ye,Ve,Ke){var Qe,Ze,Je=He.file,ir=He.compression,rr=Ke!==Ue.utf8encode,ar=$e.transformTo("string",Ke(Je.name)),or=$e.transformTo("string",Ue.utf8encode(Je.name)),pr=Je.comment,tr=$e.transformTo("string",Ke(pr)),nr=$e.transformTo("string",Ue.utf8encode(pr)),hr=or.length!==Je.name.length,sr=nr.length!==pr.length,xr="",Rr="",br="",wr=Je.dir,vr=Je.date,Dr={crc32:0,compressedSize:0,uncompressedSize:0};qe&&!Ge||(Dr.crc32=He.crc32,Dr.compressedSize=He.compressedSize,Dr.uncompressedSize=He.uncompressedSize);var kr=0;qe&&(kr|=8),rr||!hr&&!sr||(kr|=2048);var cr=0,dr=0;wr&&(cr|=16),Ve==="UNIX"?(dr=798,cr|=function(gr,_r){var Ir=gr;return gr||(Ir=_r?16893:33204),(65535&Ir)<<16}(Je.unixPermissions,wr)):(dr=20,cr|=function(gr){return 63&(gr||0)}(Je.dosPermissions)),Qe=vr.getUTCHours(),Qe<<=6,Qe|=vr.getUTCMinutes(),Qe<<=5,Qe|=vr.getUTCSeconds()/2,Ze=vr.getUTCFullYear()-1980,Ze<<=4,Ze|=vr.getUTCMonth()+1,Ze<<=5,Ze|=vr.getUTCDate(),hr&&(Rr=Me(1,1)+Me(ze(ar),4)+or,xr+="up"+Me(Rr.length,2)+Rr),sr&&(br=Me(1,1)+Me(ze(tr),4)+nr,xr+="uc"+Me(br.length,2)+br);var ur="";return ur+=` 4004\0`,ur+=Me(kr,2),ur+=ir.magic,ur+=Me(Qe,2),ur+=Me(Ze,2),ur+=Me(Dr.crc32,4),ur+=Me(Dr.compressedSize,4),ur+=Me(Dr.uncompressedSize,4),ur+=Me(ar.length,2),ur+=Me(xr.length,2),{fileRecord:We.LOCAL_FILE_HEADER+ur+ar+xr,dirRecord:We.CENTRAL_FILE_HEADER+Me(dr,2)+ur+Me(tr.length,2)+"\0\0\0\0"+Me(cr,4)+Me(Ye,4)+ar+xr+tr}}var $e=Te("../utils"),Be=Te("../stream/GenericWorker"),Ue=Te("../utf8"),ze=Te("../crc32"),We=Te("../signature");function Xe(He,qe,Ge,Ye){Be.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=qe,this.zipPlatform=Ge,this.encodeFileName=Ye,this.streamFiles=He,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}$e.inherits(Xe,Be),Xe.prototype.push=function(He){var qe=He.meta.percent||0,Ge=this.entriesCount,Ye=this._sources.length;this.accumulate?this.contentBuffer.push(He):(this.bytesWritten+=He.data.length,Be.prototype.push.call(this,{data:He.data,meta:{currentFile:this.currentFile,percent:Ge?(qe+100*(Ge-Ye-1))/Ge:100}}))},Xe.prototype.openedSource=function(He){this.currentSourceOffset=this.bytesWritten,this.currentFile=He.file.name;var qe=this.streamFiles&&!He.file.dir;if(qe){var Ge=De(He,qe,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Ge.fileRecord,meta:{percent:0}})}else this.accumulate=!0},Xe.prototype.closedSource=function(He){this.accumulate=!1;var qe=this.streamFiles&&!He.file.dir,Ge=De(He,qe,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(Ge.dirRecord),qe)this.push({data:function(Ye){return We.DATA_DESCRIPTOR+Me(Ye.crc32,4)+Me(Ye.compressedSize,4)+Me(Ye.uncompressedSize,4)}(He),meta:{percent:100}});else for(this.push({data:Ge.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},Xe.prototype.flush=function(){for(var He=this.bytesWritten,qe=0;qe<this.dirRecords.length;qe++)this.push({data:this.dirRecords[qe],meta:{percent:100}});var Ge=this.bytesWritten-He,Ye=function(Ve,Ke,Qe,Ze,Je){var ir=$e.transformTo("string",Je(Ze));return We.CENTRAL_DIRECTORY_END+"\0\0\0\0"+Me(Ve,2)+Me(Ve,2)+Me(Ke,4)+Me(Qe,4)+Me(ir.length,2)+ir}(this.dirRecords.length,Ge,He,this.zipComment,this.encodeFileName);this.push({data:Ye,meta:{percent:100}})},Xe.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},Xe.prototype.registerPrevious=function(He){this._sources.push(He);var qe=this;return He.on("data",function(Ge){qe.processChunk(Ge)}),He.on("end",function(){qe.closedSource(qe.previous.streamInfo),qe._sources.length?qe.prepareNextSource():qe.end()}),He.on("error",function(Ge){qe.error(Ge)}),this},Xe.prototype.resume=function(){return!!Be.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},Xe.prototype.error=function(He){var qe=this._sources;if(!Be.prototype.error.call(this,He))return!1;for(var Ge=0;Ge<qe.length;Ge++)try{qe[Ge].error(He)}catch{}return!0},Xe.prototype.lock=function(){Be.prototype.lock.call(this);for(var He=this._sources,qe=0;qe<He.length;qe++)He[qe].lock()}
vendor: 13,137 bytes, line 4004
4004,je.exports=Xe},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(Te,je,Oe){var Me=Te("../compressions"),De=Te("./ZipFileWorker");Oe.generateWorker=function($e,Be,Ue){var ze=new De(Be.streamFiles,Ue,Be.platform,Be.encodeFileName),We=0;try{$e.forEach(function(Xe,He){We++;var qe=function(Ke,Qe){var Ze=Ke||Qe,Je=Me[Ze];if(!Je)throw new Error(Ze+" is not a valid compression method !");return Je}(He.options.compression,Be.compression),Ge=He.options.compressionOptions||Be.compressionOptions||{},Ye=He.dir,Ve=He.date;He._compressWorker(qe,Ge).withStreamInfo("file",{name:Xe,dir:Ye,date:Ve,comment:He.comment||"",unixPermissions:He.unixPermissions,dosPermissions:He.dosPermissions}).pipe(ze)}),ze.entriesCount=We}catch(Xe){ze.error(Xe)}return ze}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(Te,je,Oe){function Me(){if(!(this instanceof Me))return new Me;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var De=new Me;for(var $e in this)typeof this[$e]!="function"&&(De[$e]=this[$e]);return De}}(Me.prototype=Te("./object")).loadAsync=Te("./load"),Me.support=Te("./support"),Me.defaults=Te("./defaults"),Me.version="3.10.1",Me.loadAsync=function(De,$e){return new Me().loadAsync(De,$e)},Me.external=Te("./external"),je.exports=Me},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(Te,je,Oe){var Me=Te("./utils"),De=Te("./external"),$e=Te("./utf8"),Be=Te("./zipEntries"),Ue=Te("./stream/Crc32Probe"),ze=Te("./nodejsUtils");function We(Xe){return new De.Promise(function(He,qe){var Ge=Xe.decompressed.getContentWorker().pipe(new Ue);Ge.on("error",function(Ye){qe(Ye)}).on("end",function(){Ge.streamInfo.crc32!==Xe.decompressed.crc32?qe(new Error("Corrupted zip : CRC32 mismatch")):He()}).resume()})}je.exports=function(Xe,He){var qe=this;return He=Me.extend(He||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:$e.utf8decode}),ze.isNode&&ze.isStream(Xe)?De.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):Me.prepareContent("the loaded zip file",Xe,!0,He.optimizedBinaryString,He.base64).then(function(Ge){var Ye=new Be(He);return Ye.load(Ge),Ye}).then(function(Ge){var Ye=[De.Promise.resolve(Ge)],Ve=Ge.files;if(He.checkCRC32)for(var Ke=0;Ke<Ve.length;Ke++)Ye.push(We(Ve[Ke]));return De.Promise.all(Ye)}).then(function(Ge){for(var Ye=Ge.shift(),Ve=Ye.files,Ke=0;Ke<Ve.length;Ke++){var Qe=Ve[Ke],Ze=Qe.fileNameStr,Je=Me.resolve(Qe.fileNameStr);qe.file(Je,Qe.decompressed,{binary:!0,optimizedBinaryString:!0,date:Qe.date,dir:Qe.dir,comment:Qe.fileCommentStr.length?Qe.fileCommentStr:null,unixPermissions:Qe.unixPermissions,dosPermissions:Qe.dosPermissions,createFolders:He.createFolders}),Qe.dir||(qe.file(Je).unsafeOriginalName=Ze)}return Ye.zipComment.length&&(qe.comment=Ye.zipComment),qe})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(Te,je,Oe){var Me=Te("../utils"),De=Te("../stream/GenericWorker");function $e(Be,Ue){De.call(this,"Nodejs stream input adapter for "+Be),this._upstreamEnded=!1,this._bindStream(Ue)}Me.inherits($e,De),$e.prototype._bindStream=function(Be){var Ue=this;(this._stream=Be).pause(),Be.on("data",function(ze){Ue.push({data:ze,meta:{percent:0}})}).on("error",function(ze){Ue.isPaused?this.generatedError=ze:Ue.error(ze)}).on("end",function(){Ue.isPaused?Ue._upstreamEnded=!0:Ue.end()})},$e.prototype.pause=function(){return!!De.prototype.pause.call(this)&&(this._stream.pause(),!0)},$e.prototype.resume=function(){return!!De.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},je.exports=$e},{"../stream/GenericWorker":28,"../utils":32}],13:[function(Te,je,Oe){var Me=Te("readable-stream").Readable;function De($e,Be,Ue){Me.call(this,Be),this._helper=$e;var ze=this;$e.on("data",function(We,Xe){ze.push(We)||ze._helper.pause(),Ue&&Ue(Xe)}).on("error",function(We){ze.emit("error",We)}).on("end",function(){ze.push(null)})}Te("../utils").inherits(De,Me),De.prototype._read=function(){this._helper.resume()},je.exports=De},{"../utils":32,"readable-stream":16}],14:[function(Te,je,Oe){je.exports={isNode:typeof Buffer<"u",newBufferFrom:function(Me,De){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(Me,De);if(typeof Me=="number")throw new Error('The "data" argument must not be a number');return new Buffer(Me,De)},allocBuffer:function(Me){if(Buffer.alloc)return Buffer.alloc(Me);var De=new Buffer(Me);return De.fill(0),De},isBuffer:function(Me){return Buffer.isBuffer(Me)},isStream:function(Me){return Me&&typeof Me.on=="function"&&typeof Me.pause=="function"&&typeof Me.resume=="function"}}},{}],15:[function(Te,je,Oe){function Me(Je,ir,rr){var ar,or=$e.getTypeOf(ir),pr=$e.extend(rr||{},ze);pr.date=pr.date||new Date,pr.compression!==null&&(pr.compression=pr.compression.toUpperCase()),typeof pr.unixPermissions=="string"&&(pr.unixPermissions=parseInt(pr.unixPermissions,8)),pr.unixPermissions&&16384&pr.unixPermissions&&(pr.dir=!0),pr.dosPermissions&&16&pr.dosPermissions&&(pr.dir=!0),pr.dir&&(Je=Ve(Je)),pr.createFolders&&(ar=Ye(Je))&&Ke.call(this,ar,!0);var tr=or==="string"&&pr.binary===!1&&pr.base64===!1;rr&&rr.binary!==void 0||(pr.binary=!tr),(ir instanceof We&&ir.uncompressedSize===0||pr.dir||!ir||ir.length===0)&&(pr.base64=!1,pr.binary=!0,ir="",pr.compression="STORE",or="string");var nr=null;nr=ir instanceof We||ir instanceof Be?ir:qe.isNode&&qe.isStream(ir)?new Ge(Je,ir):$e.prepareContent(Je,ir,pr.binary,pr.optimizedBinaryString,pr.base64);var hr=new Xe(Je,nr,pr);this.files[Je]=hr}var De=Te("./utf8"),$e=Te("./utils"),Be=Te("./stream/GenericWorker"),Ue=Te("./stream/StreamHelper"),ze=Te("./defaults"),We=Te("./compressedObject"),Xe=Te("./zipObject"),He=Te("./generate"),qe=Te("./nodejsUtils"),Ge=Te("./nodejs/NodejsStreamInputAdapter"),Ye=function(Je){Je.slice(-1)==="/"&&(Je=Je.substring(0,Je.length-1));var ir=Je.lastIndexOf("/");return 0<ir?Je.substring(0,ir):""},Ve=function(Je){return Je.slice(-1)!=="/"&&(Je+="/"),Je},Ke=function(Je,ir){return ir=ir!==void 0?ir:ze.createFolders,Je=Ve(Je),this.files[Je]||Me.call(this,Je,null,{dir:!0,createFolders:ir}),this.files[Je]};function Qe(Je){return Object.prototype.toString.call(Je)==="[object RegExp]"}var Ze={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(Je){var ir,rr,ar;for(ir in this.files)ar=this.files[ir],(rr=ir.slice(this.root.length,ir.length))&&ir.slice(0,this.root.length)===this.root&&Je(rr,ar)},filter:function(Je){var ir=[];return this.forEach(function(rr,ar){Je(rr,ar)&&ir.push(ar)}),ir},file:function(Je,ir,rr){if(arguments.length!==1)return Je=this.root+Je,Me.call(this,Je,ir,rr),this;if(Qe(Je)){var ar=Je;return this.filter(function(pr,tr){return!tr.dir&&ar.test(pr)})}var or=this.files[this.root+Je];return or&&!or.dir?or:null},folder:function(Je){if(!Je)return this;if(Qe(Je))return this.filter(function(or,pr){return pr.dir&&Je.test(or)});var ir=this.root+Je,rr=Ke.call(this,ir),ar=this.clone();return ar.root=rr.name,ar},remove:function(Je){Je=this.root+Je;var ir=this.files[Je];if(ir||(Je.slice(-1)!=="/"&&(Je+="/"),ir=this.files[Je]),ir&&!ir.dir)delete this.files[Je];else for(var rr=this.filter(function(or,pr){return pr.name.slice(0,Je.length)===Je}),ar=0;ar<rr.length;ar++)delete this.files[rr[ar].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(Je){var ir,rr={};try{if((rr=$e.extend(Je||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:De.utf8encode})).type=rr.type.toLowerCase(),rr.compression=rr.compression.toUpperCase(),rr.type==="binarystring"&&(rr.type="string"),!rr.type)throw new Error("No output type specified.");$e.checkSupport(rr.type),rr.platform!=="darwin"&&rr.platform!=="freebsd"&&rr.platform!=="linux"&&rr.platform!=="sunos"||(rr.platform="UNIX"),rr.platform==="win32"&&(rr.platform="DOS");var ar=rr.comment||this.comment||"";ir=He.generateWorker(this,rr,ar)}catch(or){(ir=new Be("error")).error(or)}return new Ue(ir,rr.type||"string",rr.mimeType)},generateAsync:function(Je,ir){return this.generateInternalStream(Je).accumulate(ir)},generateNodeStream:function(Je,ir){return(Je=Je||{}).type||(Je.type="nodebuffer"),this.generateInternalStream(Je).toNodejsStream(ir)}};je.exports=Ze},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(Te,je,Oe){je.exports=Te("stream")},{stream:void 0}],17:[function(Te,je,Oe){var Me=Te("./DataReader");function De($e){Me.call(this,$e);for(var Be=0;Be<this.data.length;Be++)$e[Be]=255&$e[Be]}Te("../utils").inherits(De,Me),De.prototype.byteAt=function($e){return this.data[this.zero+$e]},De.prototype.lastIndexOfSignature=function($e){for(var Be=$e.charCodeAt(0),Ue=$e.charCodeAt(1),ze=$e.charCodeAt(2),We=$e.charCodeAt(3),Xe=this.length-4;0<=Xe;--Xe)if(this.data[Xe]===Be&&this.data[Xe+1]===Ue&&this.data[Xe+2]===ze&&this.data[Xe+3]===We)return Xe-this.zero;return-1},De.prototype.readAndCheckSignature=function($e){var Be=$e.charCodeAt(0),Ue=$e.charCodeAt(1),ze=$e.charCodeAt(2),We=$e.charCodeAt(3),Xe=this.readData(4);return Be===Xe[0]&&Ue===Xe[1]&&ze===Xe[2]&&We===Xe[3]},De.prototype.readData=function($e){if(this.checkOffset($e),$e===0)return[];var Be=this.data.slice(this.zero+this.index,this.zero+this.index+$e);return this.index+=$e,Be},je.exports=De},{"../utils":32,"./DataReader":18}],18:[function(Te,je,Oe){var Me=Te("../utils");function De($e){this.data=$e,this.length=$e.length,this.index=0,this.zero=0}De.prototype={checkOffset:function($e){this.checkIndex(this.index+$e)},checkIndex:function($e){if(this.length<this.zero+$e||$e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+$e+"). Corrupted zip ?")},setIndex:function($e){this.checkIndex($e),this.index=$e},skip:function($e){this.setIndex(this.index+$e)},byteAt:function(){},readInt:function($e){var Be,Ue=0;for(this.checkOffset($e),Be=this.index+$e-1;Be>=this.index;Be--)Ue=(Ue<<8)+this.byteAt(Be);return this.index+=$e,Ue},readString:function($e){return Me.transformTo("string",this.readData($e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var $e=this.readInt(4);return new Date(Date.UTC(1980+($e>>25&127),($e>>21&15)-1,$e>>16&31,$e>>11&31,$e>>5&63,(31&$e)<<1))}},je.exports=De},{"../utils":32}],19:[function(Te,je,Oe){var Me=Te("./Uint8ArrayReader");function De($e){Me.call(this,$e)}Te("../utils").inherits(De,Me),De.prototype.readData=function($e){this.checkOffset($e);var Be=this.data.slice(this.zero+this.index,this.zero+this.index+$e);return this.index+=$e,Be},je.exports=De},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(Te,je,Oe){var Me=Te("./DataReader");function De($e){Me.call(this,$e)}Te("../utils").inherits(De,Me),De.prototype.byteAt=function($e){return this.data.charCodeAt(this.zero+$e)},De.prototype.lastIndexOfSignature=function($e){return this.data.lastIndexOf($e)-this.zero},De.prototype.readAndCheckSignature=function($e){return $e===this.readData(4)},De.prototype.readData=function($e){this.checkOffset($e);var Be=this.data.slice(this.zero+this.index,this.zero+this.index+$e);return this.index+=$e,Be},je.exports=De},{"../utils":32,"./DataReader":18}],21:[function(Te,je,Oe){var Me=Te("./ArrayReader");function De($e){Me.call(this,$e)}Te("../utils").inherits(De,Me),De.prototype.readData=function($e){if(this.checkOffset($e),$e===0)return new Uint8Array(0);var Be=this.data.subarray(this.zero+this.index,this.zero+this.index+$e);return this.index+=$e,Be},je.exports=De},{"../utils":32,"./ArrayReader":17}],22:[function(Te,je,Oe){var Me=Te("../utils"),De=Te("../support"),$e=Te("./ArrayReader"),Be=Te("./StringReader"),Ue=Te("./NodeBufferReader"),ze=Te("./Uint8ArrayReader");je.exports=function(We){var Xe=Me.getTypeOf(We);return Me.checkSupport(Xe),Xe!=="string"||De.uint8array?Xe==="nodebuffer"?new Ue(We):De.uint8array?new ze(Me.transformTo("uint8array",We)):new $e(Me.transformTo("array",We)):new Be(We)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(Te,je,Oe){Oe.LOCAL_FILE_HEADER="PK��",Oe.CENTRAL_FILE_HEADER="PK��",Oe.CENTRAL_DIRECTORY_END="PK��",Oe.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK�\x07",Oe.ZIP64_CENTRAL_DIRECTORY_END="PK��",Oe.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(Te,je,Oe){var Me=Te("./GenericWorker"),De=Te("../utils");function $e(Be){Me.call(this,"ConvertWorker to "+Be),this.destType=Be}De.inherits($e,Me),$e.prototype.processChunk=function(Be){this.push({data:De.transformTo(this.destType,Be.data),meta:Be.meta})}
vendor: 4,383 bytes, line 4004
4004,je.exports=$e},{"../utils":32,"./GenericWorker":28}],25:[function(Te,je,Oe){var Me=Te("./GenericWorker"),De=Te("../crc32");function $e(){Me.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Te("../utils").inherits($e,Me),$e.prototype.processChunk=function(Be){this.streamInfo.crc32=De(Be.data,this.streamInfo.crc32||0),this.push(Be)},je.exports=$e},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(Te,je,Oe){var Me=Te("../utils"),De=Te("./GenericWorker");function $e(Be){De.call(this,"DataLengthProbe for "+Be),this.propName=Be,this.withStreamInfo(Be,0)}Me.inherits($e,De),$e.prototype.processChunk=function(Be){if(Be){var Ue=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=Ue+Be.data.length}De.prototype.processChunk.call(this,Be)},je.exports=$e},{"../utils":32,"./GenericWorker":28}],27:[function(Te,je,Oe){var Me=Te("../utils"),De=Te("./GenericWorker");function $e(Be){De.call(this,"DataWorker");var Ue=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,Be.then(function(ze){Ue.dataIsReady=!0,Ue.data=ze,Ue.max=ze&&ze.length||0,Ue.type=Me.getTypeOf(ze),Ue.isPaused||Ue._tickAndRepeat()},function(ze){Ue.error(ze)})}Me.inherits($e,De),$e.prototype.cleanUp=function(){De.prototype.cleanUp.call(this),this.data=null},$e.prototype.resume=function(){return!!De.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,Me.delay(this._tickAndRepeat,[],this)),!0)},$e.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(Me.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},$e.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var Be=null,Ue=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":Be=this.data.substring(this.index,Ue);break;case"uint8array":Be=this.data.subarray(this.index,Ue);break;case"array":case"nodebuffer":Be=this.data.slice(this.index,Ue)}return this.index=Ue,this.push({data:Be,meta:{percent:this.max?this.index/this.max*100:0}})},je.exports=$e},{"../utils":32,"./GenericWorker":28}],28:[function(Te,je,Oe){function Me(De){this.name=De||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}Me.prototype={push:function(De){this.emit("data",De)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(De){this.emit("error",De)}return!0},error:function(De){return!this.isFinished&&(this.isPaused?this.generatedError=De:(this.isFinished=!0,this.emit("error",De),this.previous&&this.previous.error(De),this.cleanUp()),!0)},on:function(De,$e){return this._listeners[De].push($e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(De,$e){if(this._listeners[De])for(var Be=0;Be<this._listeners[De].length;Be++)this._listeners[De][Be].call(this,$e)},pipe:function(De){return De.registerPrevious(this)},registerPrevious:function(De){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=De.streamInfo,this.mergeStreamInfo(),this.previous=De;var $e=this;return De.on("data",function(Be){$e.processChunk(Be)}),De.on("end",function(){$e.end()}),De.on("error",function(Be){$e.error(Be)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var De=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),De=!0),this.previous&&this.previous.resume(),!De},flush:function(){},processChunk:function(De){this.push(De)},withStreamInfo:function(De,$e){return this.extraStreamInfo[De]=$e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var De in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,De)&&(this.streamInfo[De]=this.extraStreamInfo[De])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var De="Worker "+this.name;return this.previous?this.previous+" -> "+De:De}}
vendor: 13,507 bytes, line 4004
4004,je.exports=Me},{}],29:[function(Te,je,Oe){var Me=Te("../utils"),De=Te("./ConvertWorker"),$e=Te("./GenericWorker"),Be=Te("../base64"),Ue=Te("../support"),ze=Te("../external"),We=null;if(Ue.nodestream)try{We=Te("../nodejs/NodejsStreamOutputAdapter")}catch{}function Xe(qe,Ge){return new ze.Promise(function(Ye,Ve){var Ke=[],Qe=qe._internalType,Ze=qe._outputType,Je=qe._mimeType;qe.on("data",function(ir,rr){Ke.push(ir),Ge&&Ge(rr)}).on("error",function(ir){Ke=[],Ve(ir)}).on("end",function(){try{var ir=function(rr,ar,or){switch(rr){case"blob":return Me.newBlob(Me.transformTo("arraybuffer",ar),or);case"base64":return Be.encode(ar);default:return Me.transformTo(rr,ar)}}(Ze,function(rr,ar){var or,pr=0,tr=null,nr=0;for(or=0;or<ar.length;or++)nr+=ar[or].length;switch(rr){case"string":return ar.join("");case"array":return Array.prototype.concat.apply([],ar);case"uint8array":for(tr=new Uint8Array(nr),or=0;or<ar.length;or++)tr.set(ar[or],pr),pr+=ar[or].length;return tr;case"nodebuffer":return Buffer.concat(ar);default:throw new Error("concat : unsupported type '"+rr+"'")}}(Qe,Ke),Je);Ye(ir)}catch(rr){Ve(rr)}Ke=[]}).resume()})}function He(qe,Ge,Ye){var Ve=Ge;switch(Ge){case"blob":case"arraybuffer":Ve="uint8array";break;case"base64":Ve="string"}try{this._internalType=Ve,this._outputType=Ge,this._mimeType=Ye,Me.checkSupport(Ve),this._worker=qe.pipe(new De(Ve)),qe.lock()}catch(Ke){this._worker=new $e("error"),this._worker.error(Ke)}}He.prototype={accumulate:function(qe){return Xe(this,qe)},on:function(qe,Ge){var Ye=this;return qe==="data"?this._worker.on(qe,function(Ve){Ge.call(Ye,Ve.data,Ve.meta)}):this._worker.on(qe,function(){Me.delay(Ge,arguments,Ye)}),this},resume:function(){return Me.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(qe){if(Me.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new We(this,{objectMode:this._outputType!=="nodebuffer"},qe)}},je.exports=He},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(Te,je,Oe){if(Oe.base64=!0,Oe.array=!0,Oe.string=!0,Oe.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Oe.nodebuffer=typeof Buffer<"u",Oe.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")Oe.blob=!1;else{var Me=new ArrayBuffer(0);try{Oe.blob=new Blob([Me],{type:"application/zip"}).size===0}catch{try{var De=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);De.append(Me),Oe.blob=De.getBlob("application/zip").size===0}catch{Oe.blob=!1}}}try{Oe.nodestream=!!Te("readable-stream").Readable}catch{Oe.nodestream=!1}},{"readable-stream":16}],31:[function(Te,je,Oe){for(var Me=Te("./utils"),De=Te("./support"),$e=Te("./nodejsUtils"),Be=Te("./stream/GenericWorker"),Ue=new Array(256),ze=0;ze<256;ze++)Ue[ze]=252<=ze?6:248<=ze?5:240<=ze?4:224<=ze?3:192<=ze?2:1;Ue[254]=Ue[254]=1;function We(){Be.call(this,"utf-8 decode"),this.leftOver=null}function Xe(){Be.call(this,"utf-8 encode")}Oe.utf8encode=function(He){return De.nodebuffer?$e.newBufferFrom(He,"utf-8"):function(qe){var Ge,Ye,Ve,Ke,Qe,Ze=qe.length,Je=0;for(Ke=0;Ke<Ze;Ke++)(64512&(Ye=qe.charCodeAt(Ke)))==55296&&Ke+1<Ze&&(64512&(Ve=qe.charCodeAt(Ke+1)))==56320&&(Ye=65536+(Ye-55296<<10)+(Ve-56320),Ke++),Je+=Ye<128?1:Ye<2048?2:Ye<65536?3:4;for(Ge=De.uint8array?new Uint8Array(Je):new Array(Je),Ke=Qe=0;Qe<Je;Ke++)(64512&(Ye=qe.charCodeAt(Ke)))==55296&&Ke+1<Ze&&(64512&(Ve=qe.charCodeAt(Ke+1)))==56320&&(Ye=65536+(Ye-55296<<10)+(Ve-56320),Ke++),Ye<128?Ge[Qe++]=Ye:(Ye<2048?Ge[Qe++]=192|Ye>>>6:(Ye<65536?Ge[Qe++]=224|Ye>>>12:(Ge[Qe++]=240|Ye>>>18,Ge[Qe++]=128|Ye>>>12&63),Ge[Qe++]=128|Ye>>>6&63),Ge[Qe++]=128|63&Ye);return Ge}(He)},Oe.utf8decode=function(He){return De.nodebuffer?Me.transformTo("nodebuffer",He).toString("utf-8"):function(qe){var Ge,Ye,Ve,Ke,Qe=qe.length,Ze=new Array(2*Qe);for(Ge=Ye=0;Ge<Qe;)if((Ve=qe[Ge++])<128)Ze[Ye++]=Ve;else if(4<(Ke=Ue[Ve]))Ze[Ye++]=65533,Ge+=Ke-1;else{for(Ve&=Ke===2?31:Ke===3?15:7;1<Ke&&Ge<Qe;)Ve=Ve<<6|63&qe[Ge++],Ke--;1<Ke?Ze[Ye++]=65533:Ve<65536?Ze[Ye++]=Ve:(Ve-=65536,Ze[Ye++]=55296|Ve>>10&1023,Ze[Ye++]=56320|1023&Ve)}return Ze.length!==Ye&&(Ze.subarray?Ze=Ze.subarray(0,Ye):Ze.length=Ye),Me.applyFromCharCode(Ze)}(He=Me.transformTo(De.uint8array?"uint8array":"array",He))},Me.inherits(We,Be),We.prototype.processChunk=function(He){var qe=Me.transformTo(De.uint8array?"uint8array":"array",He.data);if(this.leftOver&&this.leftOver.length){if(De.uint8array){var Ge=qe;(qe=new Uint8Array(Ge.length+this.leftOver.length)).set(this.leftOver,0),qe.set(Ge,this.leftOver.length)}else qe=this.leftOver.concat(qe);this.leftOver=null}var Ye=function(Ke,Qe){var Ze;for((Qe=Qe||Ke.length)>Ke.length&&(Qe=Ke.length),Ze=Qe-1;0<=Ze&&(192&Ke[Ze])==128;)Ze--;return Ze<0||Ze===0?Qe:Ze+Ue[Ke[Ze]]>Qe?Ze:Qe}(qe),Ve=qe;Ye!==qe.length&&(De.uint8array?(Ve=qe.subarray(0,Ye),this.leftOver=qe.subarray(Ye,qe.length)):(Ve=qe.slice(0,Ye),this.leftOver=qe.slice(Ye,qe.length))),this.push({data:Oe.utf8decode(Ve),meta:He.meta})},We.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:Oe.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},Oe.Utf8DecodeWorker=We,Me.inherits(Xe,Be),Xe.prototype.processChunk=function(He){this.push({data:Oe.utf8encode(He.data),meta:He.meta})},Oe.Utf8EncodeWorker=Xe},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(Te,je,Oe){var Me=Te("./support"),De=Te("./base64"),$e=Te("./nodejsUtils"),Be=Te("./external");function Ue(Ge){return Ge}function ze(Ge,Ye){for(var Ve=0;Ve<Ge.length;++Ve)Ye[Ve]=255&Ge.charCodeAt(Ve);return Ye}Te("setimmediate"),Oe.newBlob=function(Ge,Ye){Oe.checkSupport("blob");try{return new Blob([Ge],{type:Ye})}catch{try{var Ve=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return Ve.append(Ge),Ve.getBlob(Ye)}catch{throw new Error("Bug : can't construct the Blob.")}}};var We={stringifyByChunk:function(Ge,Ye,Ve){var Ke=[],Qe=0,Ze=Ge.length;if(Ze<=Ve)return String.fromCharCode.apply(null,Ge);for(;Qe<Ze;)Ye==="array"||Ye==="nodebuffer"?Ke.push(String.fromCharCode.apply(null,Ge.slice(Qe,Math.min(Qe+Ve,Ze)))):Ke.push(String.fromCharCode.apply(null,Ge.subarray(Qe,Math.min(Qe+Ve,Ze)))),Qe+=Ve;return Ke.join("")},stringifyByChar:function(Ge){for(var Ye="",Ve=0;Ve<Ge.length;Ve++)Ye+=String.fromCharCode(Ge[Ve]);return Ye},applyCanBeUsed:{uint8array:function(){try{return Me.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return Me.nodebuffer&&String.fromCharCode.apply(null,$e.allocBuffer(1)).length===1}catch{return!1}}()}};function Xe(Ge){var Ye=65536,Ve=Oe.getTypeOf(Ge),Ke=!0;if(Ve==="uint8array"?Ke=We.applyCanBeUsed.uint8array:Ve==="nodebuffer"&&(Ke=We.applyCanBeUsed.nodebuffer),Ke)for(;1<Ye;)try{return We.stringifyByChunk(Ge,Ve,Ye)}catch{Ye=Math.floor(Ye/2)}return We.stringifyByChar(Ge)}function He(Ge,Ye){for(var Ve=0;Ve<Ge.length;Ve++)Ye[Ve]=Ge[Ve];return Ye}Oe.applyFromCharCode=Xe;var qe={};qe.string={string:Ue,array:function(Ge){return ze(Ge,new Array(Ge.length))},arraybuffer:function(Ge){return qe.string.uint8array(Ge).buffer},uint8array:function(Ge){return ze(Ge,new Uint8Array(Ge.length))},nodebuffer:function(Ge){return ze(Ge,$e.allocBuffer(Ge.length))}},qe.array={string:Xe,array:Ue,arraybuffer:function(Ge){return new Uint8Array(Ge).buffer},uint8array:function(Ge){return new Uint8Array(Ge)},nodebuffer:function(Ge){return $e.newBufferFrom(Ge)}},qe.arraybuffer={string:function(Ge){return Xe(new Uint8Array(Ge))},array:function(Ge){return He(new Uint8Array(Ge),new Array(Ge.byteLength))},arraybuffer:Ue,uint8array:function(Ge){return new Uint8Array(Ge)},nodebuffer:function(Ge){return $e.newBufferFrom(new Uint8Array(Ge))}},qe.uint8array={string:Xe,array:function(Ge){return He(Ge,new Array(Ge.length))},arraybuffer:function(Ge){return Ge.buffer},uint8array:Ue,nodebuffer:function(Ge){return $e.newBufferFrom(Ge)}},qe.nodebuffer={string:Xe,array:function(Ge){return He(Ge,new Array(Ge.length))},arraybuffer:function(Ge){return qe.nodebuffer.uint8array(Ge).buffer},uint8array:function(Ge){return He(Ge,new Uint8Array(Ge.length))},nodebuffer:Ue},Oe.transformTo=function(Ge,Ye){if(Ye=Ye||"",!Ge)return Ye;Oe.checkSupport(Ge);var Ve=Oe.getTypeOf(Ye);return qe[Ve][Ge](Ye)},Oe.resolve=function(Ge){for(var Ye=Ge.split("/"),Ve=[],Ke=0;Ke<Ye.length;Ke++){var Qe=Ye[Ke];Qe==="."||Qe===""&&Ke!==0&&Ke!==Ye.length-1||(Qe===".."?Ve.pop():Ve.push(Qe))}return Ve.join("/")},Oe.getTypeOf=function(Ge){return typeof Ge=="string"?"string":Object.prototype.toString.call(Ge)==="[object Array]"?"array":Me.nodebuffer&&$e.isBuffer(Ge)?"nodebuffer":Me.uint8array&&Ge instanceof Uint8Array?"uint8array":Me.arraybuffer&&Ge instanceof ArrayBuffer?"arraybuffer":void 0},Oe.checkSupport=function(Ge){if(!Me[Ge.toLowerCase()])throw new Error(Ge+" is not supported by this platform")},Oe.MAX_VALUE_16BITS=65535,Oe.MAX_VALUE_32BITS=-1,Oe.pretty=function(Ge){var Ye,Ve,Ke="";for(Ve=0;Ve<(Ge||"").length;Ve++)Ke+="\\x"+((Ye=Ge.charCodeAt(Ve))<16?"0":"")+Ye.toString(16).toUpperCase();return Ke},Oe.delay=function(Ge,Ye,Ve){setImmediate(function(){Ge.apply(Ve||null,Ye||[])})},Oe.inherits=function(Ge,Ye){function Ve(){}Ve.prototype=Ye.prototype,Ge.prototype=new Ve},Oe.extend=function(){var Ge,Ye,Ve={};for(Ge=0;Ge<arguments.length;Ge++)for(Ye in arguments[Ge])Object.prototype.hasOwnProperty.call(arguments[Ge],Ye)&&Ve[Ye]===void 0&&(Ve[Ye]=arguments[Ge][Ye]);return Ve},Oe.prepareContent=function(Ge,Ye,Ve,Ke,Qe){return Be.Promise.resolve(Ye).then(function(Ze){return Me.blob&&(Ze instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(Ze))!==-1)&&typeof FileReader<"u"?new Be.Promise(function(Je,ir){var rr=new FileReader;rr.onload=function(ar){Je(ar.target.result)},rr.onerror=function(ar){ir(ar.target.error)},rr.readAsArrayBuffer(Ze)}):Ze}).then(function(Ze){var Je=Oe.getTypeOf(Ze);return Je?(Je==="arraybuffer"?Ze=Oe.transformTo("uint8array",Ze):Je==="string"&&(Qe?Ze=De.decode(Ze):Ve&&Ke!==!0&&(Ze=function(ir){return ze(ir,Me.uint8array?new Uint8Array(ir.length):new Array(ir.length))}(Ze))),Ze):Be.Promise.reject(new Error("Can't read the data of '"+Ge+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(Te,je,Oe){var Me=Te("./reader/readerFor"),De=Te("./utils"),$e=Te("./signature"),Be=Te("./zipEntry"),Ue=Te("./support");function ze(We){this.files=[],this.loadOptions=We}ze.prototype={checkSignature:function(We){if(!this.reader.readAndCheckSignature(We)){this.reader.index-=4;var Xe=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+De.pretty(Xe)+", expected "+De.pretty(We)+")")}},isSignature:function(We,Xe){var He=this.reader.index;this.reader.setIndex(We);var qe=this.reader.readString(4)===Xe;return this.reader.setIndex(He),qe},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var We=this.reader.readData(this.zipCommentLength),Xe=Ue.uint8array?"uint8array":"array",He=De.transformTo(Xe,We);this.zipComment=this.loadOptions.decodeFileName(He)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var We,Xe,He,qe=this.zip64EndOfCentralSize-44;0<qe;)We=this.reader.readInt(2),Xe=this.reader.readInt(4),He=this.reader.readData(Xe),this.zip64ExtensibleData[We]={id:We,length:Xe,value:He}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var We,Xe;for(We=0;We<this.files.length;We++)Xe=this.files[We],this.reader.setIndex(Xe.localHeaderOffset),this.checkSignature($e.LOCAL_FILE_HEADER),Xe.readLocalPart(this.reader),Xe.handleUTF8(),Xe.processAttributes()},readCentralDir:function(){var We;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature($e.CENTRAL_FILE_HEADER);)(We=new Be({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(We);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var We=this.reader.lastIndexOfSignature($e.CENTRAL_DIRECTORY_END);if(We<0)throw this.isSignature(0,$e.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip f
4004ile ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(We);var Xe=We;if(this.checkSignature($e.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===De.MAX_VALUE_16BITS||this.diskWithCentralDirStart===De.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===De.MAX_VALUE_16BITS||this.centralDirRecords===De.MAX_VALUE_16BITS||this.centralDirSize===De.MAX_VALUE_32BITS||this.centralDirOffset===De.MAX_VALUE_32BITS){if(this.zip64=!0,(We=this.reader.lastIndexOfSignature($e.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(We),this.checkSignature($e.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,$e.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature($e.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature($e.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var He=this.centralDirOffset+this.centralDirSize;this.zip64&&(He+=20,He+=12+this.zip64EndOfCentralSize);var qe=Xe-He;if(0<qe)this.isSignature(Xe,$e.CENTRAL_FILE_HEADER)||(this.reader.zero=qe);else if(qe<0)throw new Error("Corrupted zip: missing "+Math.abs(qe)+" bytes.")},prepareReader:function(We){this.reader=Me(We)},load:function(We){this.prepareReader(We),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},je.exports=ze},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(Te,je,Oe){var Me=Te("./reader/readerFor"),De=Te("./utils"),$e=Te("./compressedObject"),Be=Te("./crc32"),Ue=Te("./utf8"),ze=Te("./compressions"),We=Te("./support");function Xe(He,qe){this.options=He,this.loadOptions=qe}Xe.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(He){var qe,Ge;if(He.skip(22),this.fileNameLength=He.readInt(2),Ge=He.readInt(2),this.fileName=He.readData(this.fileNameLength),He.skip(Ge),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((qe=function(Ye){for(var Ve in ze)if(Object.prototype.hasOwnProperty.call(ze,Ve)&&ze[Ve].magic===Ye)return ze[Ve];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+De.pretty(this.compressionMethod)+" unknown (inner file : "+De.transformTo("string",this.fileName)+")");this.decompressed=new $e(this.compressedSize,this.uncompressedSize,this.crc32,qe,He.readData(this.compressedSize))},readCentralPart:function(He){this.versionMadeBy=He.readInt(2),He.skip(2),this.bitFlag=He.readInt(2),this.compressionMethod=He.readString(2),this.date=He.readDate(),this.crc32=He.readInt(4),this.compressedSize=He.readInt(4),this.uncompressedSize=He.readInt(4);var qe=He.readInt(2);if(this.extraFieldsLength=He.readInt(2),this.fileCommentLength=He.readInt(2),this.diskNumberStart=He.readInt(2),this.internalFileAttributes=He.readInt(2),this.externalFileAttributes=He.readInt(4),this.localHeaderOffset=He.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");He.skip(qe),this.readExtraFields(He),this.parseZIP64ExtraField(He),this.fileComment=He.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var He=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),He==0&&(this.dosPermissions=63&this.externalFileAttributes),He==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var He=Me(this.extraFields[1].value);
vendor: 8,014 bytes, line 4004
4004this.uncompressedSize===De.MAX_VALUE_32BITS&&(this.uncompressedSize=He.readInt(8)),this.compressedSize===De.MAX_VALUE_32BITS&&(this.compressedSize=He.readInt(8)),this.localHeaderOffset===De.MAX_VALUE_32BITS&&(this.localHeaderOffset=He.readInt(8)),this.diskNumberStart===De.MAX_VALUE_32BITS&&(this.diskNumberStart=He.readInt(4))}},readExtraFields:function(He){var qe,Ge,Ye,Ve=He.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});He.index+4<Ve;)qe=He.readInt(2),Ge=He.readInt(2),Ye=He.readData(Ge),this.extraFields[qe]={id:qe,length:Ge,value:Ye};He.setIndex(Ve)},handleUTF8:function(){var He=We.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=Ue.utf8decode(this.fileName),this.fileCommentStr=Ue.utf8decode(this.fileComment);else{var qe=this.findExtraFieldUnicodePath();if(qe!==null)this.fileNameStr=qe;else{var Ge=De.transformTo(He,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(Ge)}var Ye=this.findExtraFieldUnicodeComment();if(Ye!==null)this.fileCommentStr=Ye;else{var Ve=De.transformTo(He,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(Ve)}}},findExtraFieldUnicodePath:function(){var He=this.extraFields[28789];if(He){var qe=Me(He.value);return qe.readInt(1)!==1||Be(this.fileName)!==qe.readInt(4)?null:Ue.utf8decode(qe.readData(He.length-5))}return null},findExtraFieldUnicodeComment:function(){var He=this.extraFields[25461];if(He){var qe=Me(He.value);return qe.readInt(1)!==1||Be(this.fileComment)!==qe.readInt(4)?null:Ue.utf8decode(qe.readData(He.length-5))}return null}},je.exports=Xe},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(Te,je,Oe){function Me(qe,Ge,Ye){this.name=qe,this.dir=Ye.dir,this.date=Ye.date,this.comment=Ye.comment,this.unixPermissions=Ye.unixPermissions,this.dosPermissions=Ye.dosPermissions,this._data=Ge,this._dataBinary=Ye.binary,this.options={compression:Ye.compression,compressionOptions:Ye.compressionOptions}}var De=Te("./stream/StreamHelper"),$e=Te("./stream/DataWorker"),Be=Te("./utf8"),Ue=Te("./compressedObject"),ze=Te("./stream/GenericWorker");Me.prototype={internalStream:function(qe){var Ge=null,Ye="string";try{if(!qe)throw new Error("No output type specified.");var Ve=(Ye=qe.toLowerCase())==="string"||Ye==="text";Ye!=="binarystring"&&Ye!=="text"||(Ye="string"),Ge=this._decompressWorker();var Ke=!this._dataBinary;Ke&&!Ve&&(Ge=Ge.pipe(new Be.Utf8EncodeWorker)),!Ke&&Ve&&(Ge=Ge.pipe(new Be.Utf8DecodeWorker))}catch(Qe){(Ge=new ze("error")).error(Qe)}return new De(Ge,Ye,"")},async:function(qe,Ge){return this.internalStream(qe).accumulate(Ge)},nodeStream:function(qe,Ge){return this.internalStream(qe||"nodebuffer").toNodejsStream(Ge)},_compressWorker:function(qe,Ge){if(this._data instanceof Ue&&this._data.compression.magic===qe.magic)return this._data.getCompressedWorker();var Ye=this._decompressWorker();return this._dataBinary||(Ye=Ye.pipe(new Be.Utf8EncodeWorker)),Ue.createWorkerFrom(Ye,qe,Ge)},_decompressWorker:function(){return this._data instanceof Ue?this._data.getContentWorker():this._data instanceof ze?this._data:new $e(this._data)}};for(var We=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Xe=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},He=0;He<We.length;He++)Me.prototype[We[He]]=Xe;je.exports=Me},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(Te,je,Oe){(function(Me){var De,$e,Be=Me.MutationObserver||Me.WebKitMutationObserver;if(Be){var Ue=0,ze=new Be(qe),We=Me.document.createTextNode("");ze.observe(We,{characterData:!0}),De=function(){We.data=Ue=++Ue%2}}else if(Me.setImmediate||Me.MessageChannel===void 0)De="document"in Me&&"onreadystatechange"in Me.document.createElement("script")?function(){var Ge=Me.document.createElement("script");Ge.onreadystatechange=function(){qe(),Ge.onreadystatechange=null,Ge.parentNode.removeChild(Ge),Ge=null},Me.document.documentElement.appendChild(Ge)}:function(){setTimeout(qe,0)};else{var Xe=new Me.MessageChannel;Xe.port1.onmessage=qe,De=function(){Xe.port2.postMessage(0)}}var He=[];function qe(){var Ge,Ye;$e=!0;for(var Ve=He.length;Ve;){for(Ye=He,He=[],Ge=-1;++Ge<Ve;)Ye[Ge]();Ve=He.length}$e=!1}je.exports=function(Ge){He.push(Ge)!==1||$e||De()}}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(Te,je,Oe){var Me=Te("immediate");function De(){}var $e={},Be=["REJECTED"],Ue=["FULFILLED"],ze=["PENDING"];function We(Ve){if(typeof Ve!="function")throw new TypeError("resolver must be a function");this.state=ze,this.queue=[],this.outcome=void 0,Ve!==De&&Ge(this,Ve)}function Xe(Ve,Ke,Qe){this.promise=Ve,typeof Ke=="function"&&(this.onFulfilled=Ke,this.callFulfilled=this.otherCallFulfilled),typeof Qe=="function"&&(this.onRejected=Qe,this.callRejected=this.otherCallRejected)}function He(Ve,Ke,Qe){Me(function(){var Ze;try{Ze=Ke(Qe)}catch(Je){return $e.reject(Ve,Je)}Ze===Ve?$e.reject(Ve,new TypeError("Cannot resolve promise with itself")):$e.resolve(Ve,Ze)})}function qe(Ve){var Ke=Ve&&Ve.then;if(Ve&&(typeof Ve=="object"||typeof Ve=="function")&&typeof Ke=="function")return function(){Ke.apply(Ve,arguments)}}function Ge(Ve,Ke){var Qe=!1;function Ze(rr){Qe||(Qe=!0,$e.reject(Ve,rr))}function Je(rr){Qe||(Qe=!0,$e.resolve(Ve,rr))}var ir=Ye(function(){Ke(Je,Ze)});ir.status==="error"&&Ze(ir.value)}function Ye(Ve,Ke){var Qe={};try{Qe.value=Ve(Ke),Qe.status="success"}catch(Ze){Qe.status="error",Qe.value=Ze}return Qe}(je.exports=We).prototype.finally=function(Ve){if(typeof Ve!="function")return this;var Ke=this.constructor;return this.then(function(Qe){return Ke.resolve(Ve()).then(function(){return Qe})},function(Qe){return Ke.resolve(Ve()).then(function(){throw Qe})})},We.prototype.catch=function(Ve){return this.then(null,Ve)},We.prototype.then=function(Ve,Ke){if(typeof Ve!="function"&&this.state===Ue||typeof Ke!="function"&&this.state===Be)return this;var Qe=new this.constructor(De);return this.state!==ze?He(Qe,this.state===Ue?Ve:Ke,this.outcome):this.queue.push(new Xe(Qe,Ve,Ke)),Qe},Xe.prototype.callFulfilled=function(Ve){$e.resolve(this.promise,Ve)},Xe.prototype.otherCallFulfilled=function(Ve){He(this.promise,this.onFulfilled,Ve)},Xe.prototype.callRejected=function(Ve){$e.reject(this.promise,Ve)},Xe.prototype.otherCallRejected=function(Ve){He(this.promise,this.onRejected,Ve)},$e.resolve=function(Ve,Ke){var Qe=Ye(qe,Ke);if(Qe.status==="error")return $e.reject(Ve,Qe.value);var Ze=Qe.value;if(Ze)Ge(Ve,Ze);else{Ve.state=Ue,Ve.outcome=Ke;for(var Je=-1,ir=Ve.queue.length;++Je<ir;)Ve.queue[Je].callFulfilled(Ke)}return Ve},$e.reject=function(Ve,Ke){Ve.state=Be,Ve.outcome=Ke;for(var Qe=-1,Ze=Ve.queue.length;++Qe<Ze;)Ve.queue[Qe].callRejected(Ke);return Ve},We.resolve=function(Ve){return Ve instanceof this?Ve:$e.resolve(new this(De),Ve)},We.reject=function(Ve){var Ke=new this(De);return $e.reject(Ke,Ve)},We.all=function(Ve){var Ke=this;if(Object.prototype.toString.call(Ve)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Qe=Ve.length,Ze=!1;if(!Qe)return this.resolve([]);for(var Je=new Array(Qe),ir=0,rr=-1,ar=new this(De);++rr<Qe;)or(Ve[rr],rr);return ar;function or(pr,tr){Ke.resolve(pr).then(function(nr){Je[tr]=nr,++ir!==Qe||Ze||(Ze=!0,$e.resolve(ar,Je))},function(nr){Ze||(Ze=!0,$e.reject(ar,nr))})}},We.race=function(Ve){var Ke=this;if(Object.prototype.toString.call(Ve)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Qe=Ve.length,Ze=!1;if(!Qe)return this.resolve([]);for(var Je=-1,ir=new this(De);++Je<Qe;)rr=Ve[Je],Ke.resolve(rr).then(function(ar){Ze||(Ze=!0,$e.resolve(ir,ar))},function(ar){Ze||(Ze=!0,$e.reject(ir,ar))});var rr;return ir}},{immediate:36}],38:[function(Te,je,Oe){var Me={};(0,Te("./lib/utils/common").assign)(Me,Te("./lib/deflate"),Te("./lib/inflate"),Te("./lib/zlib/constants")),je.exp
vendor: 4,249 bytes, line 4004
4004orts=Me},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(Te,je,Oe){var Me=Te("./zlib/deflate"),De=Te("./utils/common"),$e=Te("./utils/strings"),Be=Te("./zlib/messages"),Ue=Te("./zlib/zstream"),ze=Object.prototype.toString,We=0,Xe=-1,He=0,qe=8;function Ge(Ve){if(!(this instanceof Ge))return new Ge(Ve);this.options=De.assign({level:Xe,method:qe,chunkSize:16384,windowBits:15,memLevel:8,strategy:He,to:""},Ve||{});var Ke=this.options;Ke.raw&&0<Ke.windowBits?Ke.windowBits=-Ke.windowBits:Ke.gzip&&0<Ke.windowBits&&Ke.windowBits<16&&(Ke.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ue,this.strm.avail_out=0;var Qe=Me.deflateInit2(this.strm,Ke.level,Ke.method,Ke.windowBits,Ke.memLevel,Ke.strategy);if(Qe!==We)throw new Error(Be[Qe]);if(Ke.header&&Me.deflateSetHeader(this.strm,Ke.header),Ke.dictionary){var Ze;if(Ze=typeof Ke.dictionary=="string"?$e.string2buf(Ke.dictionary):ze.call(Ke.dictionary)==="[object ArrayBuffer]"?new Uint8Array(Ke.dictionary):Ke.dictionary,(Qe=Me.deflateSetDictionary(this.strm,Ze))!==We)throw new Error(Be[Qe]);this._dict_set=!0}}function Ye(Ve,Ke){var Qe=new Ge(Ke);if(Qe.push(Ve,!0),Qe.err)throw Qe.msg||Be[Qe.err];return Qe.result}Ge.prototype.push=function(Ve,Ke){var Qe,Ze,Je=this.strm,ir=this.options.chunkSize;if(this.ended)return!1;Ze=Ke===~~Ke?Ke:Ke===!0?4:0,typeof Ve=="string"?Je.input=$e.string2buf(Ve):ze.call(Ve)==="[object ArrayBuffer]"?Je.input=new Uint8Array(Ve):Je.input=Ve,Je.next_in=0,Je.avail_in=Je.input.length;do{if(Je.avail_out===0&&(Je.output=new De.Buf8(ir),Je.next_out=0,Je.avail_out=ir),(Qe=Me.deflate(Je,Ze))!==1&&Qe!==We)return this.onEnd(Qe),!(this.ended=!0);Je.avail_out!==0&&(Je.avail_in!==0||Ze!==4&&Ze!==2)||(this.options.to==="string"?this.onData($e.buf2binstring(De.shrinkBuf(Je.output,Je.next_out))):this.onData(De.shrinkBuf(Je.output,Je.next_out)))}while((0<Je.avail_in||Je.avail_out===0)&&Qe!==1);return Ze===4?(Qe=Me.deflateEnd(this.strm),this.onEnd(Qe),this.ended=!0,Qe===We):Ze!==2||(this.onEnd(We),!(Je.avail_out=0))},Ge.prototype.onData=function(Ve){this.chunks.push(Ve)},Ge.prototype.onEnd=function(Ve){Ve===We&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=De.flattenChunks(this.chunks)),this.chunks=[],this.err=Ve,this.msg=this.strm.msg},Oe.Deflate=Ge,Oe.deflate=Ye,Oe.deflateRaw=function(Ve,Ke){return(Ke=Ke||{}).raw=!0,Ye(Ve,Ke)},Oe.gzip=function(Ve,Ke){return(Ke=Ke||{}).gzip=!0,Ye(Ve,Ke)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(Te,je,Oe){var Me=Te("./zlib/inflate"),De=Te("./utils/common"),$e=Te("./utils/strings"),Be=Te("./zlib/constants"),Ue=Te("./zlib/messages"),ze=Te("./zlib/zstream"),We=Te("./zlib/gzheader"),Xe=Object.prototype.toString;function He(Ge){if(!(this instanceof He))return new He(Ge);this.options=De.assign({chunkSize:16384,windowBits:0,to:""},Ge||{});var Ye=this.options;Ye.raw&&0<=Ye.windowBits&&Ye.windowBits<16&&(Ye.windowBits=-Ye.windowBits,Ye.windowBits===0&&(Ye.windowBits=-15)),!(0<=Ye.windowBits&&Ye.windowBits<16)||Ge&&Ge.windowBits||(Ye.windowBits+=32),15<Ye.windowBits&&Ye.windowBits<48&&!(15&Ye.windowBits)&&(Ye.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ze,this.strm.avail_out=0;var Ve=Me.inflateInit2(this.strm,Ye.windowBits);if(Ve!==Be.Z_OK)throw new Error(Ue[Ve]);this.header=new We,Me.inflateGetHeader(this.strm,this.header)}function qe(Ge,Ye){var Ve=new He(Ye);if(Ve.push(Ge,!0),Ve.err)throw Ve.msg||Ue[Ve.err];return Ve.result}He.prototype.push=function(Ge,Ye){var Ve,Ke,Qe,Ze,Je,ir,rr=this.strm,ar=this.options.chunkSize,or=this.options.dictionary,pr=!1;if(this.ended)return!1;Ke=Ye===~~Ye?Ye:Ye===!0?Be.Z_FINISH:Be.Z_NO_FLUSH,typeof Ge=="string"?rr.input=$e.binstring2buf(Ge):Xe.call(Ge)==="[object ArrayBuffer]"?rr.input=new Uint8Array(Ge):rr.input=Ge,rr.next_in=0,rr.avail_in=rr.input.length;do{if(rr.avail_out===0&&(rr.output=new De.Buf8(ar),rr.next_out=0,rr.avail_out=ar),(Ve=Me.inflate(rr,Be.Z_NO_FLUSH))===Be.Z_NEED_DICT&&or&&(ir=typeof or=="string"?$e.string2buf(or):Xe.call(or)==="[object ArrayBuffer]"?new Uint8Array(or):or,Ve=Me.inflateSetDictionary(this.strm,ir)),Ve===Be.Z_BUF_ER
vendor: 4,728 bytes, line 4004
4004ROR&&pr===!0&&(Ve=Be.Z_OK,pr=!1),Ve!==Be.Z_STREAM_END&&Ve!==Be.Z_OK)return this.onEnd(Ve),!(this.ended=!0);rr.next_out&&(rr.avail_out!==0&&Ve!==Be.Z_STREAM_END&&(rr.avail_in!==0||Ke!==Be.Z_FINISH&&Ke!==Be.Z_SYNC_FLUSH)||(this.options.to==="string"?(Qe=$e.utf8border(rr.output,rr.next_out),Ze=rr.next_out-Qe,Je=$e.buf2string(rr.output,Qe),rr.next_out=Ze,rr.avail_out=ar-Ze,Ze&&De.arraySet(rr.output,rr.output,Qe,Ze,0),this.onData(Je)):this.onData(De.shrinkBuf(rr.output,rr.next_out)))),rr.avail_in===0&&rr.avail_out===0&&(pr=!0)}while((0<rr.avail_in||rr.avail_out===0)&&Ve!==Be.Z_STREAM_END);return Ve===Be.Z_STREAM_END&&(Ke=Be.Z_FINISH),Ke===Be.Z_FINISH?(Ve=Me.inflateEnd(this.strm),this.onEnd(Ve),this.ended=!0,Ve===Be.Z_OK):Ke!==Be.Z_SYNC_FLUSH||(this.onEnd(Be.Z_OK),!(rr.avail_out=0))},He.prototype.onData=function(Ge){this.chunks.push(Ge)},He.prototype.onEnd=function(Ge){Ge===Be.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=De.flattenChunks(this.chunks)),this.chunks=[],this.err=Ge,this.msg=this.strm.msg},Oe.Inflate=He,Oe.inflate=qe,Oe.inflateRaw=function(Ge,Ye){return(Ye=Ye||{}).raw=!0,qe(Ge,Ye)},Oe.ungzip=qe},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(Te,je,Oe){var Me=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";Oe.assign=function(Be){for(var Ue=Array.prototype.slice.call(arguments,1);Ue.length;){var ze=Ue.shift();if(ze){if(typeof ze!="object")throw new TypeError(ze+"must be non-object");for(var We in ze)ze.hasOwnProperty(We)&&(Be[We]=ze[We])}}return Be},Oe.shrinkBuf=function(Be,Ue){return Be.length===Ue?Be:Be.subarray?Be.subarray(0,Ue):(Be.length=Ue,Be)};var De={arraySet:function(Be,Ue,ze,We,Xe){if(Ue.subarray&&Be.subarray)Be.set(Ue.subarray(ze,ze+We),Xe);else for(var He=0;He<We;He++)Be[Xe+He]=Ue[ze+He]},flattenChunks:function(Be){var Ue,ze,We,Xe,He,qe;for(Ue=We=0,ze=Be.length;Ue<ze;Ue++)We+=Be[Ue].length;for(qe=new Uint8Array(We),Ue=Xe=0,ze=Be.length;Ue<ze;Ue++)He=Be[Ue],qe.set(He,Xe),Xe+=He.length;return qe}},$e={arraySet:function(Be,Ue,ze,We,Xe){for(var He=0;He<We;He++)Be[Xe+He]=Ue[ze+He]},flattenChunks:function(Be){return[].concat.apply([],Be)}};Oe.setTyped=function(Be){Be?(Oe.Buf8=Uint8Array,Oe.Buf16=Uint16Array,Oe.Buf32=Int32Array,Oe.assign(Oe,De)):(Oe.Buf8=Array,Oe.Buf16=Array,Oe.Buf32=Array,Oe.assign(Oe,$e))},Oe.setTyped(Me)},{}],42:[function(Te,je,Oe){var Me=Te("./common"),De=!0,$e=!0;try{String.fromCharCode.apply(null,[0])}catch{De=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{$e=!1}for(var Be=new Me.Buf8(256),Ue=0;Ue<256;Ue++)Be[Ue]=252<=Ue?6:248<=Ue?5:240<=Ue?4:224<=Ue?3:192<=Ue?2:1;function ze(We,Xe){if(Xe<65537&&(We.subarray&&$e||!We.subarray&&De))return String.fromCharCode.apply(null,Me.shrinkBuf(We,Xe));for(var He="",qe=0;qe<Xe;qe++)He+=String.fromCharCode(We[qe]);return He}Be[254]=Be[254]=1,Oe.string2buf=function(We){var Xe,He,qe,Ge,Ye,Ve=We.length,Ke=0;for(Ge=0;Ge<Ve;Ge++)(64512&(He=We.charCodeAt(Ge)))==55296&&Ge+1<Ve&&(64512&(qe=We.charCodeAt(Ge+1)))==56320&&(He=65536+(He-55296<<10)+(qe-56320),Ge++),Ke+=He<128?1:He<2048?2:He<65536?3:4;for(Xe=new Me.Buf8(Ke),Ge=Ye=0;Ye<Ke;Ge++)(64512&(He=We.charCodeAt(Ge)))==55296&&Ge+1<Ve&&(64512&(qe=We.charCodeAt(Ge+1)))==56320&&(He=65536+(He-55296<<10)+(qe-56320),Ge++),He<128?Xe[Ye++]=He:(He<2048?Xe[Ye++]=192|He>>>6:(He<65536?Xe[Ye++]=224|He>>>12:(Xe[Ye++]=240|He>>>18,Xe[Ye++]=128|He>>>12&63),Xe[Ye++]=128|He>>>6&63),Xe[Ye++]=128|63&He);return Xe},Oe.buf2binstring=function(We){return ze(We,We.length)},Oe.binstring2buf=function(We){for(var Xe=new Me.Buf8(We.length),He=0,qe=Xe.length;He<qe;He++)Xe[He]=We.charCodeAt(He);return Xe},Oe.buf2string=function(We,Xe){var He,qe,Ge,Ye,Ve=Xe||We.length,Ke=new Array(2*Ve);for(He=qe=0;He<Ve;)if((Ge=We[He++])<128)Ke[qe++]=Ge;else if(4<(Ye=Be[Ge]))Ke[qe++]=65533,He+=Ye-1;else{for(Ge&=Ye===2?31:Ye===3?15:7;1<Ye&&He<Ve;)Ge=Ge<<6|63&We[He++],Ye--;1<Ye?Ke[qe++]=65533:Ge<65536?Ke[qe++]=Ge:(Ge-=65536,Ke[qe++]=55296|Ge>>10&1023,Ke[qe++]=56320|1023&Ge)}return ze(Ke,qe)},Oe.utf8border=function(We,Xe){var He;for((Xe=Xe||We.length)>We.length&&(Xe=We.length),He=Xe-1;0<=He&&(192&We[He])==128;)He--;return He<0||He===0?Xe:He+Be[We[He]]>Xe?He:Xe}},{"./common":41}],43:[function(Te,je,Oe){je.exports=function(Me,De,$e,Be){for(var Ue=65535&Me|0,ze=Me>>>16&65535|0,We=0;$e!==0;){for($e-=We=2e3<$e?2e3:$e;ze=ze+(Ue=Ue+De[Be++]|0)|0,--We;);Ue%=65521,ze%=65521}return Ue|ze<<16|0}},{}],44:[function(Te,je,Oe){je.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ER
vendor: 4,795 bytes, line 4004
4004ROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(Te,je,Oe){var Me=function(){for(var De,$e=[],Be=0;Be<256;Be++){De=Be;for(var Ue=0;Ue<8;Ue++)De=1&De?3988292384^De>>>1:De>>>1;$e[Be]=De}return $e}();je.exports=function(De,$e,Be,Ue){var ze=Me,We=Ue+Be;De^=-1;for(var Xe=Ue;Xe<We;Xe++)De=De>>>8^ze[255&(De^$e[Xe])];return-1^De}},{}],46:[function(Te,je,Oe){var Me,De=Te("../utils/common"),$e=Te("./trees"),Be=Te("./adler32"),Ue=Te("./crc32"),ze=Te("./messages"),We=0,Xe=4,He=0,qe=-2,Ge=-1,Ye=4,Ve=2,Ke=8,Qe=9,Ze=286,Je=30,ir=19,rr=2*Ze+1,ar=15,or=3,pr=258,tr=pr+or+1,nr=42,hr=113,sr=1,xr=2,Rr=3,br=4;function wr(mr,Sr){return mr.msg=ze[Sr],Sr}function vr(mr){return(mr<<1)-(4<mr?9:0)}function Dr(mr){for(var Sr=mr.length;0<=--Sr;)mr[Sr]=0}function kr(mr){var Sr=mr.state,Lr=Sr.pending;Lr>mr.avail_out&&(Lr=mr.avail_out),Lr!==0&&(De.arraySet(mr.output,Sr.pending_buf,Sr.pending_out,Lr,mr.next_out),mr.next_out+=Lr,Sr.pending_out+=Lr,mr.total_out+=Lr,mr.avail_out-=Lr,Sr.pending-=Lr,Sr.pending===0&&(Sr.pending_out=0))}function cr(mr,Sr){$e._tr_flush_block(mr,0<=mr.block_start?mr.block_start:-1,mr.strstart-mr.block_start,Sr),mr.block_start=mr.strstart,kr(mr.strm)}function dr(mr,Sr){mr.pending_buf[mr.pending++]=Sr}function ur(mr,Sr){mr.pending_buf[mr.pending++]=Sr>>>8&255,mr.pending_buf[mr.pending++]=255&Sr}function gr(mr,Sr){var Lr,jr,fr=mr.max_chain_length,Cr=mr.strstart,Mr=mr.prev_length,$r=mr.nice_match,Fr=mr.strstart>mr.w_size-tr?mr.strstart-(mr.w_size-tr):0,Kr=mr.window,an=mr.w_mask,Wr=mr.prev,hn=mr.strstart+pr,cn=Kr[Cr+Mr-1],tn=Kr[Cr+Mr];mr.prev_length>=mr.good_match&&(fr>>=2),$r>mr.lookahead&&($r=mr.lookahead);do if(Kr[(Lr=Sr)+Mr]===tn&&Kr[Lr+Mr-1]===cn&&Kr[Lr]===Kr[Cr]&&Kr[++Lr]===Kr[Cr+1]){Cr+=2,Lr++;do;while(Kr[++Cr]===Kr[++Lr]&&Kr[++Cr]===Kr[++Lr]&&Kr[++Cr]===Kr[++Lr]&&Kr[++Cr]===Kr[++Lr]&&Kr[++Cr]===Kr[++Lr]&&Kr[++Cr]===Kr[++Lr]&&Kr[++Cr]===Kr[++Lr]&&Kr[++Cr]===Kr[++Lr]&&Cr<hn);if(jr=pr-(hn-Cr),Cr=hn-pr,Mr<jr){if(mr.match_start=Sr,$r<=(Mr=jr))break;cn=Kr[Cr+Mr-1],tn=Kr[Cr+Mr]}}while((Sr=Wr[Sr&an])>Fr&&--fr!=0);return Mr<=mr.lookahead?Mr:mr.lookahead}function _r(mr){var Sr,Lr,jr,fr,Cr,Mr,$r,Fr,Kr,an,Wr=mr.w_size;do{if(fr=mr.window_size-mr.lookahead-mr.strstart,mr.strstart>=Wr+(Wr-tr)){for(De.arraySet(mr.window,mr.window,Wr,Wr,0),mr.match_start-=Wr,mr.strstart-=Wr,mr.block_start-=Wr,Sr=Lr=mr.hash_size;jr=mr.head[--Sr],mr.head[Sr]=Wr<=jr?jr-Wr:0,--Lr;);for(Sr=Lr=Wr;jr=mr.prev[--Sr],mr.prev[Sr]=Wr<=jr?jr-Wr:0,--Lr;);fr+=Wr}if(mr.strm.avail_in===0)break;if(Mr=mr.strm,$r=mr.window,Fr=mr.strstart+mr.lookahead,Kr=fr,an=void 0,an=Mr.avail_in,Kr<an&&(an=Kr),Lr=an===0?0:(Mr.avail_in-=an,De.arraySet($r,Mr.input,Mr.next_in,an,Fr),Mr.state.wrap===1?Mr.adler=Be(Mr.adler,$r,an,Fr):Mr.state.wrap===2&&(Mr.adler=Ue(Mr.adler,$r,an,Fr)),Mr.next_in+=an,Mr.total_in+=an,an),mr.lookahead+=Lr,mr.lookahead+mr.insert>=or)for(Cr=mr.strstart-mr.insert,mr.ins_h=mr.window[Cr],mr.ins_h=(mr.ins_h<<mr.hash_shift^mr.window[Cr+1])&mr.hash_mask;mr.insert&&(mr.ins_h=(mr.ins_h<<mr.hash_shift^mr.window[Cr+or-1])&mr.hash_mask,mr.prev[Cr&mr.w_mask]=mr.head[mr.ins_h],mr.head[mr.ins_h]=Cr,Cr++,mr.insert--,!(mr.lookahead+mr.insert<or)););}while(mr.lookahead<tr&&mr.strm.avail_in!==0)}function Ir(mr,Sr){for(var Lr,jr;;){if(mr.lookahead<tr){if(_r(mr),mr.lookahead<tr&&Sr===We)return sr;if(mr.lookahead===0)break}if(Lr=0,mr.lookahead>=or&&(mr.ins_h=(mr.ins_h<<mr.hash_shift^mr.window[mr.strstart+or-1])&mr.hash_mask,Lr=mr.prev[mr.strstart&mr.w_mask]=mr.head[mr.ins_h],mr.head[mr.ins_h]=mr.strstart),Lr!==0&&mr.strstart-Lr<=mr.w_size-tr&&(mr.match_length=gr(mr,Lr)),mr.match_length>=or)if(jr=$e._tr_tally(mr,mr.strstart-mr.match_start,mr.match_length-or),mr.lookahead-=mr.match_length,mr.match_length<=mr.max_lazy_match&&mr.lookahead>=or){for(mr.match_length--;mr.strstart++,mr.ins_h=(mr.ins_h<<mr.hash_shift^mr.window[mr.strstart+or-1])&mr.hash_mask,Lr=mr.prev[mr.strstart&mr.w_mask]=mr.head[mr.ins_h],mr.head[mr.ins_h]=mr.strstart,--mr.match_length!=0;);mr.strstart++}else mr.strstart+=mr.match_length,mr.match_length=0,mr.ins_h=mr.window[mr.strstart],mr.ins_h=(mr.ins_h<<mr.hash_shift^mr.window[mr.strstart+1])&mr.hash_mask;else jr=$e._tr_tally(mr,0,mr.window[mr.strstart]),mr.lookahead--,mr.strstart++;if(jr&&(cr(mr,!1),mr.strm.avail_out===0))return sr}return mr.insert=mr.strstart<or-1?mr.strstart:or-1,Sr===Xe?(cr(mr,!0),mr.strm.avail_out===0?Rr:br):mr.last_lit&&(cr(mr,!1),mr.strm.avail_out===0)?sr:xr}function Ar(mr,Sr){for(var Lr,jr,fr;;){if(mr.lookahead<tr){if(_r(mr),mr.lookahead<tr&&Sr===We)return sr;if(mr.lookahead===0)break}if(Lr=0,mr.lookahead>=or&&(mr.ins_h=(mr.ins_h<<mr.hash_shift^mr.window[mr.strstart+or-1
vendor: 10,621 bytes, line 4004
4004])&mr.hash_mask,Lr=mr.prev[mr.strstart&mr.w_mask]=mr.head[mr.ins_h],mr.head[mr.ins_h]=mr.strstart),mr.prev_length=mr.match_length,mr.prev_match=mr.match_start,mr.match_length=or-1,Lr!==0&&mr.prev_length<mr.max_lazy_match&&mr.strstart-Lr<=mr.w_size-tr&&(mr.match_length=gr(mr,Lr),mr.match_length<=5&&(mr.strategy===1||mr.match_length===or&&4096<mr.strstart-mr.match_start)&&(mr.match_length=or-1)),mr.prev_length>=or&&mr.match_length<=mr.prev_length){for(fr=mr.strstart+mr.lookahead-or,jr=$e._tr_tally(mr,mr.strstart-1-mr.prev_match,mr.prev_length-or),mr.lookahead-=mr.prev_length-1,mr.prev_length-=2;++mr.strstart<=fr&&(mr.ins_h=(mr.ins_h<<mr.hash_shift^mr.window[mr.strstart+or-1])&mr.hash_mask,Lr=mr.prev[mr.strstart&mr.w_mask]=mr.head[mr.ins_h],mr.head[mr.ins_h]=mr.strstart),--mr.prev_length!=0;);if(mr.match_available=0,mr.match_length=or-1,mr.strstart++,jr&&(cr(mr,!1),mr.strm.avail_out===0))return sr}else if(mr.match_available){if((jr=$e._tr_tally(mr,0,mr.window[mr.strstart-1]))&&cr(mr,!1),mr.strstart++,mr.lookahead--,mr.strm.avail_out===0)return sr}else mr.match_available=1,mr.strstart++,mr.lookahead--}return mr.match_available&&(jr=$e._tr_tally(mr,0,mr.window[mr.strstart-1]),mr.match_available=0),mr.insert=mr.strstart<or-1?mr.strstart:or-1,Sr===Xe?(cr(mr,!0),mr.strm.avail_out===0?Rr:br):mr.last_lit&&(cr(mr,!1),mr.strm.avail_out===0)?sr:xr}function Tr(mr,Sr,Lr,jr,fr){this.good_length=mr,this.max_lazy=Sr,this.nice_length=Lr,this.max_chain=jr,this.func=fr}function Nr(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ke,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new De.Buf16(2*rr),this.dyn_dtree=new De.Buf16(2*(2*Je+1)),this.bl_tree=new De.Buf16(2*(2*ir+1)),Dr(this.dyn_ltree),Dr(this.dyn_dtree),Dr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new De.Buf16(ar+1),this.heap=new De.Buf16(2*Ze+1),Dr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new De.Buf16(2*Ze+1),Dr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Br(mr){var Sr;return mr&&mr.state?(mr.total_in=mr.total_out=0,mr.data_type=Ve,(Sr=mr.state).pending=0,Sr.pending_out=0,Sr.wrap<0&&(Sr.wrap=-Sr.wrap),Sr.status=Sr.wrap?nr:hr,mr.adler=Sr.wrap===2?0:1,Sr.last_flush=We,$e._tr_init(Sr),He):wr(mr,qe)}function Hr(mr){var Sr=Br(mr);return Sr===He&&function(Lr){Lr.window_size=2*Lr.w_size,Dr(Lr.head),Lr.max_lazy_match=Me[Lr.level].max_lazy,Lr.good_match=Me[Lr.level].good_length,Lr.nice_match=Me[Lr.level].nice_length,Lr.max_chain_length=Me[Lr.level].max_chain,Lr.strstart=0,Lr.block_start=0,Lr.lookahead=0,Lr.insert=0,Lr.match_length=Lr.prev_length=or-1,Lr.match_available=0,Lr.ins_h=0}(mr.state),Sr}function Vr(mr,Sr,Lr,jr,fr,Cr){if(!mr)return qe;var Mr=1;if(Sr===Ge&&(Sr=6),jr<0?(Mr=0,jr=-jr):15<jr&&(Mr=2,jr-=16),fr<1||Qe<fr||Lr!==Ke||jr<8||15<jr||Sr<0||9<Sr||Cr<0||Ye<Cr)return wr(mr,qe);jr===8&&(jr=9);var $r=new Nr;return(mr.state=$r).strm=mr,$r.wrap=Mr,$r.gzhead=null,$r.w_bits=jr,$r.w_size=1<<$r.w_bits,$r.w_mask=$r.w_size-1,$r.hash_bits=fr+7,$r.hash_size=1<<$r.hash_bits,$r.hash_mask=$r.hash_size-1,$r.hash_shift=~~(($r.hash_bits+or-1)/or),$r.window=new De.Buf8(2*$r.w_size),$r.head=new De.Buf16($r.hash_size),$r.prev=new De.Buf16($r.w_size),$r.lit_bufsize=1<<fr+6,$r.pending_buf_size=4*$r.lit_bufsize,$r.pending_buf=new De.Buf8($r.pending_buf_size),$r.d_buf=1*$r.lit_bufsize,$r.l_buf=3*$r.lit_bufsize,$r.level=Sr,$r.strategy=Cr,$r.method=Lr,Hr(mr)}Me=[new Tr(0,0,0,0,function(mr,Sr){var Lr=65535;for(Lr>mr.pending_buf_size-5&&(Lr=mr.pending_buf_size-5);;){if(mr.lookahead<=1){if(_r(mr),mr.lookahead===0&&Sr===We)return sr;if(mr.lookahead===0)break}mr.strstart+=mr.lookahead,mr.lookahead=0;var jr=mr.block_start+Lr;if((mr.strstart===0||mr.strstart>=jr)&&(mr.lookahead=mr.strstart-jr,mr.strstart=jr,cr(mr,!1),mr.strm.avail_out===0)||mr.strstart-mr.block_start>=mr.w_size-tr&&(cr(mr,!1),mr.strm.avail_out===0))return sr}return mr.insert=0,Sr===Xe?(cr(mr,!0),mr.strm.avail_out===0?Rr:br):(mr.strstart>mr.block_start&&(cr(mr,!1),mr.strm.avail_out),sr)}),new Tr(4,4,8,4,Ir),new Tr(4,5,16,8,Ir),new Tr(4,6,32,32,Ir),new Tr(4,4,16,16,Ar),new Tr(8,16,32,32,Ar),new Tr(8,16,128,128,Ar),new Tr(8,32,128,256,Ar),new Tr(32,128,258,1024,Ar),new Tr(32,258,258,4096,Ar)],Oe.deflateInit=function(mr,Sr){return Vr(mr,Sr,Ke,15,8,0)},Oe.deflateInit2=Vr,Oe.deflateReset=Hr,Oe.deflateResetKeep=Br,Oe.deflateSetHeader=function(mr,Sr){return mr&&mr.state?mr.state.wrap!==2?qe:(mr.state.gzhead=Sr,He):qe},Oe.deflate=function(mr,Sr){var Lr,jr,fr,Cr;if(!mr||!mr.state||5<Sr||Sr<0)return mr?wr(mr,qe):qe;if(jr=mr.state,!mr.output||!mr.input&&mr.avail_in!==0||jr.status===666&&Sr!==Xe)return wr(mr,mr.avail_out===0?-5:qe);if(jr.strm=mr,Lr=jr.last_flush,jr.last_flush=Sr,jr.status===nr)if(jr.wrap===2)mr.adler=0,dr(jr,31),dr(jr,139),dr(jr,8),jr.gzhead?(dr(jr,(jr.gzhead.text?1:0)+(jr.gzhead.hcrc?2:0)+(jr.gzhead.extra?4:0)+(jr.gzhead.name?8:0)+(jr.gzhead.comment?16:0)),dr(jr,255&jr.gzhead.time),dr(jr,jr.gzhead.time>>8&255),dr(jr,jr.gzhead.time>>16&255),dr(jr,jr.gzhead.time>>24&255),dr(jr,jr.level===9?2:2<=jr.strategy||jr.level<2?4:0),dr(jr,255&jr.gzhead.os),jr.gzhead.extra&&jr.gzhead.extra.length&&(dr(jr,255&jr.gzhead.extra.length),dr(jr,jr.gzhead.extra.length>>8&255)),jr.gzhead.hcrc&&(mr.adler=Ue(mr.adler,jr.pending_buf,jr.pending,0)),jr.gzindex=0,jr.status=69):(dr(jr,0),dr(jr,0),dr(jr,0),dr(jr,0),dr(jr,0),dr(jr,jr.level===9?2:2<=jr.strategy||jr.level<2?4:0),dr(jr,3),jr.status=hr);else{var Mr=Ke+(jr.w_bits-8<<4)<<8;Mr|=(2<=jr.strategy||jr.level<2?0:jr.level<6?1:jr.level===6?2:3)<<6,jr.strstart!==0&&(Mr|=32),Mr+=31-Mr%31,jr.status=hr,ur(jr,Mr),jr.strstart!==0&&(ur(jr,mr.adler>>>16),ur(jr,65535&mr.adler)),mr.adler=1}if(jr.status===69)if(jr.gzhead.extra){for(fr=jr.pending;jr.gzindex<(65535&jr.gzhead.extra.length)&&(jr.pending!==jr.pending_buf_size||(jr.gzhead.hcrc&&jr.pending>fr&&(mr.adler=Ue(mr.adler,jr.pending_buf,jr.pending-fr,fr)),kr(mr),fr=jr.pending,jr.pending!==jr.pending_buf_size));)dr(jr,255&jr.gzhead.extra[jr.gzindex]),jr.gzindex++;jr.gzhead.hcrc&&jr.pending>fr&&(mr.adler=Ue(mr.adler,jr.pending_buf,jr.pending-fr,fr)),jr.gzindex===jr.gzhead.extra.length&&(jr.gzindex=0,jr.status=73)}else jr.status=73;if(jr.status===73)if(jr.gzhead.name){fr=jr.pending;do{if(jr.pending===jr.pending_buf_size&&(jr.gzhead.hcrc&&jr.pending>fr&&(mr.adler=Ue(mr.adler,jr.pending_buf,jr.pending-fr,fr)),kr(mr),fr=jr.pending,jr.pending===jr.pending_buf_size)){Cr=1;break}Cr=jr.gzindex<jr.gzhead.name.length?255&jr.gzhead.name.charCodeAt(jr.gzindex++):0,dr(jr,Cr)}while(Cr!==0);jr.gzhead.hcrc&&jr.pending>fr&&(mr.adler=Ue(mr.adler,jr.pending_buf,jr.pending-fr,fr)),Cr===0&&(jr.gzindex=0,jr.status=91)}else jr.status=91;if(jr.status===91)if(jr.gzhead.comment){fr=jr.pending;do{if(jr.pending===jr.pending_buf_size&&(jr.gzhead.hcrc&&jr.pending>fr&&(mr.adler=Ue(mr.adler,jr.pending_buf,jr.pending-fr,fr)),kr(mr),fr=jr.pending,jr.pending===jr.pending_buf_size)){Cr=1;break}Cr=jr.gzindex<jr.gzhead.comment.length?255&jr.gzhead.comment.charCodeAt(jr.gzindex++):0,dr(jr,Cr)}while(Cr!==0);jr.gzhead.hcrc&&jr.pending>fr&&(mr.adler=Ue(mr.adler,jr.pending_buf,jr.pending-fr,fr)),Cr===0&&(jr.status=103)}else jr.status=103;if(jr.status===103&&(jr.gzhead.hcrc?(jr.pending+2>jr.pending_buf_size&&kr(mr),jr.pending+2<=jr.pending_buf_size&&(dr(jr,255&mr.adler),dr(jr,mr.adler>>8&255),mr.adler=0,jr.status=hr)):jr.status=hr),jr.pending!==0){if(kr(mr),mr.avail_out===0)return jr.last_flush=-1,He}else if(mr.avail_in===0&&vr(Sr)<=vr(Lr)&&Sr!==Xe)return wr(mr,-5);if(jr.status===666&&mr.avail_in!==0)return wr(mr,-5);if(mr.avail_in!==0||jr.lookahead!==0||Sr!==We&&jr.status!==666){var $r=jr.strategy===2?function(Fr,Kr){for(var an;;){if(Fr.lookahead===0&&(_r(Fr),Fr.lookahead===0)){if(Kr===We)return sr;break}if(Fr.match_length=0,an=$e._tr_tally(Fr,0,Fr.window[Fr.strstart]),Fr.lookahead--,Fr.strstart++,an&&(cr(Fr,!1),Fr.strm.avail_out===0))return sr}return Fr.insert=0,Kr===Xe?(cr(Fr,!0),Fr.strm.avail_out===0?Rr:br):Fr.last_lit&&(cr(Fr,!1),Fr.strm.avail_out===0)?sr:xr}(jr,Sr):jr.strategy===3?function(Fr,Kr){for(var an,Wr,hn,cn,tn=Fr.window;;){if(Fr.lookahead<=pr){if(_r(Fr),Fr.lookahead<=pr&&Kr===We)return sr;if(Fr.lookahead===0)break}if(Fr.match_length=0,Fr.lookahead>=or&&0<Fr.strstart&&(Wr=tn[hn=Fr.strstart-1])===tn[++hn]&&Wr===tn[++hn]&&Wr===tn[++hn]){cn=Fr.strstart+pr;do;while(Wr===tn[++hn]&&Wr===tn[++hn]&&Wr===tn[++hn]&&Wr===tn[++hn]&&Wr===tn[++hn]&&Wr===tn[++hn]&&Wr===tn[++hn]&&Wr===tn[++hn]&&hn<cn);Fr.match_length=pr-(cn-hn),Fr.match_length>Fr.lookahead&&(Fr.match_length=Fr.lookahead)}if(Fr.match_length>=or?(an=$e._tr_tally(Fr,1,Fr.match_length-or),Fr.lookahead-=Fr.match_length,Fr.strstart+=Fr.match_length,Fr.match_length=0):(an=$e._tr_tally(Fr,0,Fr.window[Fr.strstart]),Fr.lookahead--,Fr.strstart++),an&&(cr(Fr,!1),Fr.strm.avail_out===0))return sr}return Fr.insert=0,Kr===Xe?(cr(Fr,!0),Fr.strm.avail_out===0?Rr:br):Fr.last_lit&&(cr(Fr,!1),Fr.strm.avail_out===0)?sr:xr}(jr,Sr):Me[jr.level].func(jr,Sr);if($r!==Rr&&$r!==br||(jr.status=666),$r===sr||$r===Rr)return mr.avail_out===0&&(jr.last_flush=-1),He;if($r===xr&&(Sr===1?$e._tr_align(jr):Sr!==5&&($e._tr_stored_block(jr,0,0,!1),Sr===3&&(Dr(jr.head),jr.lookahead===0&&(jr.strstart=0,jr.block_start=0,jr.insert=0))),kr(mr),mr.avail_out===0))return jr.last_flush=-1,He}return Sr!==Xe?He:jr.wrap<=0?1:(jr.wrap===2?(dr(jr,255&mr.adler),dr(jr,mr.adler>>8&255),dr(jr,mr.adler>>16&255),dr(jr,mr.adler>>24&255),dr(jr,255&mr.total_in),dr(jr,mr.total_in>>8&255),dr(jr,mr.total_in>>16&255),dr(jr,mr.total_in>>24&255)):(ur(jr,mr.adler>>>16),ur(jr,65535&mr.adler)),kr(mr),0<jr.wrap&&(jr.wrap=-jr.wrap),jr.pending!==0?He:1)},Oe.deflateEnd=function(mr){var Sr;return mr&&mr.state?(Sr=mr.state.status)!==nr&&Sr!==69&&Sr!==73&&Sr!==91&&Sr!==103&&Sr!==hr&&Sr!==666?wr(mr,qe):(mr.state=null,Sr===hr?wr(mr,-3):He):qe},Oe.deflateSetDictionary=function(mr,Sr){var Lr,jr,fr,Cr,Mr,$r,Fr,Kr,an=Sr.length;if(!mr||!mr.state||(Cr=(Lr=mr.state).wrap)===2||Cr===1&&Lr.status!==nr||Lr.lookahead)return qe;
vendor: 4,239 bytes, line 4004
4004for(Cr===1&&(mr.adler=Be(mr.adler,Sr,an,0)),Lr.wrap=0,an>=Lr.w_size&&(Cr===0&&(Dr(Lr.head),Lr.strstart=0,Lr.block_start=0,Lr.insert=0),Kr=new De.Buf8(Lr.w_size),De.arraySet(Kr,Sr,an-Lr.w_size,Lr.w_size,0),Sr=Kr,an=Lr.w_size),Mr=mr.avail_in,$r=mr.next_in,Fr=mr.input,mr.avail_in=an,mr.next_in=0,mr.input=Sr,_r(Lr);Lr.lookahead>=or;){for(jr=Lr.strstart,fr=Lr.lookahead-(or-1);Lr.ins_h=(Lr.ins_h<<Lr.hash_shift^Lr.window[jr+or-1])&Lr.hash_mask,Lr.prev[jr&Lr.w_mask]=Lr.head[Lr.ins_h],Lr.head[Lr.ins_h]=jr,jr++,--fr;);Lr.strstart=jr,Lr.lookahead=or-1,_r(Lr)}return Lr.strstart+=Lr.lookahead,Lr.block_start=Lr.strstart,Lr.insert=Lr.lookahead,Lr.lookahead=0,Lr.match_length=Lr.prev_length=or-1,Lr.match_available=0,mr.next_in=$r,mr.input=Fr,mr.avail_in=Mr,Lr.wrap=Cr,He},Oe.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(Te,je,Oe){je.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(Te,je,Oe){je.exports=function(Me,De){var $e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze,Je,ir,rr,ar,or,pr,tr,nr,hr,sr,xr;$e=Me.state,Be=Me.next_in,sr=Me.input,Ue=Be+(Me.avail_in-5),ze=Me.next_out,xr=Me.output,We=ze-(De-Me.avail_out),Xe=ze+(Me.avail_out-257),He=$e.dmax,qe=$e.wsize,Ge=$e.whave,Ye=$e.wnext,Ve=$e.window,Ke=$e.hold,Qe=$e.bits,Ze=$e.lencode,Je=$e.distcode,ir=(1<<$e.lenbits)-1,rr=(1<<$e.distbits)-1;e:do{Qe<15&&(Ke+=sr[Be++]<<Qe,Qe+=8,Ke+=sr[Be++]<<Qe,Qe+=8),ar=Ze[Ke&ir];t:for(;;){if(Ke>>>=or=ar>>>24,Qe-=or,(or=ar>>>16&255)===0)xr[ze++]=65535&ar;else{if(!(16&or)){if(!(64&or)){ar=Ze[(65535&ar)+(Ke&(1<<or)-1)];continue t}if(32&or){$e.mode=12;break e}Me.msg="invalid literal/length code",$e.mode=30;break e}pr=65535&ar,(or&=15)&&(Qe<or&&(Ke+=sr[Be++]<<Qe,Qe+=8),pr+=Ke&(1<<or)-1,Ke>>>=or,Qe-=or),Qe<15&&(Ke+=sr[Be++]<<Qe,Qe+=8,Ke+=sr[Be++]<<Qe,Qe+=8),ar=Je[Ke&rr];r:for(;;){if(Ke>>>=or=ar>>>24,Qe-=or,!(16&(or=ar>>>16&255))){if(!(64&or)){ar=Je[(65535&ar)+(Ke&(1<<or)-1)];continue r}Me.msg="invalid distance code",$e.mode=30;break e}if(tr=65535&ar,Qe<(or&=15)&&(Ke+=sr[Be++]<<Qe,(Qe+=8)<or&&(Ke+=sr[Be++]<<Qe,Qe+=8)),He<(tr+=Ke&(1<<or)-1)){Me.msg="invalid distance too far back",$e.mode=30;break e}if(Ke>>>=or,Qe-=or,(or=ze-We)<tr){if(Ge<(or=tr-or)&&$e.sane){Me.msg="invalid distance too far back",$e.mode=30;break e}if(hr=Ve,(nr=0)===Ye){if(nr+=qe-or,or<pr){for(pr-=or;xr[ze++]=Ve[nr++],--or;);nr=ze-tr,hr=xr}}else if(Ye<or){if(nr+=qe+Ye-or,(or-=Ye)<pr){for(pr-=or;xr[ze++]=Ve[nr++],--or;);if(nr=0,Ye<pr){for(pr-=or=Ye;xr[ze++]=Ve[nr++],--or;);nr=ze-tr,hr=xr}}}else if(nr+=Ye-or,or<pr){for(pr-=or;xr[ze++]=Ve[nr++],--or;);nr=ze-tr,hr=xr}for(;2<pr;)xr[ze++]=hr[nr++],xr[ze++]=hr[nr++],xr[ze++]=hr[nr++],pr-=3;pr&&(xr[ze++]=hr[nr++],1<pr&&(xr[ze++]=hr[nr++]))}else{for(nr=ze-tr;xr[ze++]=xr[nr++],xr[ze++]=xr[nr++],xr[ze++]=xr[nr++],2<(pr-=3););pr&&(xr[ze++]=xr[nr++],1<pr&&(xr[ze++]=xr[nr++]))}break}}break}}while(Be<Ue&&ze<Xe);Be-=pr=Qe>>3,Ke&=(1<<(Qe-=pr<<3))-1,Me.next_in=Be,Me.next_out=ze,Me.avail_in=Be<Ue?Ue-Be+5:5-(Be-Ue),Me.avail_out=ze<Xe?Xe-ze+257:257-(ze-Xe),$e.hold=Ke,$e.bits=Qe}},{}],49:[function(Te,je,Oe){var Me=Te("../utils/common"),De=Te("./adler32"),$e=Te("./crc32"),Be=Te("./inffast"),Ue=Te("./inftrees"),ze=1,We=2,Xe=0,He=-2,qe=1,Ge=852,Ye=592;function Ve(nr){return(nr>>>24&255)+(nr>>>8&65280)+((65280&nr)<<8)+((255&nr)<<24)}function Ke(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Me.Buf16(320),this.work=new Me.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Qe(nr){var hr;return nr&&nr.state?(hr=nr.state,nr.total_in=nr.total_out=hr.total=0,nr.msg="",hr.wrap&&(nr.adler=1&hr.wrap),hr.mode=qe,hr.last=0,hr.havedict=0,hr.dmax=32768,hr.head=null,hr.hold=0,hr.bits=0,hr.lencode=hr.lendyn=new Me.Buf32(Ge),hr.distc
vendor: 5,569 bytes, line 4004
4004ode=hr.distdyn=new Me.Buf32(Ye),hr.sane=1,hr.back=-1,Xe):He}function Ze(nr){var hr;return nr&&nr.state?((hr=nr.state).wsize=0,hr.whave=0,hr.wnext=0,Qe(nr)):He}function Je(nr,hr){var sr,xr;return nr&&nr.state?(xr=nr.state,hr<0?(sr=0,hr=-hr):(sr=1+(hr>>4),hr<48&&(hr&=15)),hr&&(hr<8||15<hr)?He:(xr.window!==null&&xr.wbits!==hr&&(xr.window=null),xr.wrap=sr,xr.wbits=hr,Ze(nr))):He}function ir(nr,hr){var sr,xr;return nr?(xr=new Ke,(nr.state=xr).window=null,(sr=Je(nr,hr))!==Xe&&(nr.state=null),sr):He}var rr,ar,or=!0;function pr(nr){if(or){var hr;for(rr=new Me.Buf32(512),ar=new Me.Buf32(32),hr=0;hr<144;)nr.lens[hr++]=8;for(;hr<256;)nr.lens[hr++]=9;for(;hr<280;)nr.lens[hr++]=7;for(;hr<288;)nr.lens[hr++]=8;for(Ue(ze,nr.lens,0,288,rr,0,nr.work,{bits:9}),hr=0;hr<32;)nr.lens[hr++]=5;Ue(We,nr.lens,0,32,ar,0,nr.work,{bits:5}),or=!1}nr.lencode=rr,nr.lenbits=9,nr.distcode=ar,nr.distbits=5}function tr(nr,hr,sr,xr){var Rr,br=nr.state;return br.window===null&&(br.wsize=1<<br.wbits,br.wnext=0,br.whave=0,br.window=new Me.Buf8(br.wsize)),xr>=br.wsize?(Me.arraySet(br.window,hr,sr-br.wsize,br.wsize,0),br.wnext=0,br.whave=br.wsize):(xr<(Rr=br.wsize-br.wnext)&&(Rr=xr),Me.arraySet(br.window,hr,sr-xr,Rr,br.wnext),(xr-=Rr)?(Me.arraySet(br.window,hr,sr-xr,xr,0),br.wnext=xr,br.whave=br.wsize):(br.wnext+=Rr,br.wnext===br.wsize&&(br.wnext=0),br.whave<br.wsize&&(br.whave+=Rr))),0}Oe.inflateReset=Ze,Oe.inflateReset2=Je,Oe.inflateResetKeep=Qe,Oe.inflateInit=function(nr){return ir(nr,15)},Oe.inflateInit2=ir,Oe.inflate=function(nr,hr){var sr,xr,Rr,br,wr,vr,Dr,kr,cr,dr,ur,gr,_r,Ir,Ar,Tr,Nr,Br,Hr,Vr,mr,Sr,Lr,jr,fr=0,Cr=new Me.Buf8(4),Mr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!nr||!nr.state||!nr.output||!nr.input&&nr.avail_in!==0)return He;(sr=nr.state).mode===12&&(sr.mode=13),wr=nr.next_out,Rr=nr.output,Dr=nr.avail_out,br=nr.next_in,xr=nr.input,vr=nr.avail_in,kr=sr.hold,cr=sr.bits,dr=vr,ur=Dr,Sr=Xe;e:for(;;)switch(sr.mode){case qe:if(sr.wrap===0){sr.mode=13;break}for(;cr<16;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(2&sr.wrap&&kr===35615){Cr[sr.check=0]=255&kr,Cr[1]=kr>>>8&255,sr.check=$e(sr.check,Cr,2,0),cr=kr=0,sr.mode=2;break}if(sr.flags=0,sr.head&&(sr.head.done=!1),!(1&sr.wrap)||(((255&kr)<<8)+(kr>>8))%31){nr.msg="incorrect header check",sr.mode=30;break}if((15&kr)!=8){nr.msg="unknown compression method",sr.mode=30;break}if(cr-=4,mr=8+(15&(kr>>>=4)),sr.wbits===0)sr.wbits=mr;else if(mr>sr.wbits){nr.msg="invalid window size",sr.mode=30;break}sr.dmax=1<<mr,nr.adler=sr.check=1,sr.mode=512&kr?10:12,cr=kr=0;break;case 2:for(;cr<16;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(sr.flags=kr,(255&sr.flags)!=8){nr.msg="unknown compression method",sr.mode=30;break}if(57344&sr.flags){nr.msg="unknown header flags set",sr.mode=30;break}sr.head&&(sr.head.text=kr>>8&1),512&sr.flags&&(Cr[0]=255&kr,Cr[1]=kr>>>8&255,sr.check=$e(sr.check,Cr,2,0)),cr=kr=0,sr.mode=3;case 3:for(;cr<32;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}sr.head&&(sr.head.time=kr),512&sr.flags&&(Cr[0]=255&kr,Cr[1]=kr>>>8&255,Cr[2]=kr>>>16&255,Cr[3]=kr>>>24&255,sr.check=$e(sr.check,Cr,4,0)),cr=kr=0,sr.mode=4;case 4:for(;cr<16;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}sr.head&&(sr.head.xflags=255&kr,sr.head.os=kr>>8),512&sr.flags&&(Cr[0]=255&kr,Cr[1]=kr>>>8&255,sr.check=$e(sr.check,Cr,2,0)),cr=kr=0,sr.mode=5;case 5:if(1024&sr.flags){for(;cr<16;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}sr.length=kr,sr.head&&(sr.head.extra_len=kr),512&sr.flags&&(Cr[0]=255&kr,Cr[1]=kr>>>8&255,sr.check=$e(sr.check,Cr,2,0)),cr=kr=0}else sr.head&&(sr.head.extra=null);sr.mode=6;case 6:if(1024&sr.flags&&(vr<(gr=sr.length)&&(gr=vr),gr&&(sr.head&&(mr=sr.head.extra_len-sr.length,sr.head.extra||(sr.head.extra=new Array(sr.head.extra_len)),Me.arraySet(sr.head.extra,xr,br,gr,mr)),512&sr.flags&&(sr.check=$e(sr.check,xr,gr,br)),vr-=gr,br+=gr,sr.length-=gr),sr.length))break e;sr.length=0,sr.mode=7;case 7:if(2048&sr.flags){if(vr===0)break e;for(gr=0;mr=xr[br+gr++],sr.head&&mr&&sr.length<65536&&(sr.head.name+=String.fromCharCode(mr)),mr&&gr<vr;);if(512&sr.flags&&(sr.check=$e(sr.check,xr,gr,br)),vr-=gr,br+=gr,mr)break e}else sr.head&&(sr.head.name=null);sr.length=0,sr.mode=8;case 8:if(4096&sr.flags){if(vr===0)break e;for(gr=0;mr=xr[br+gr++],sr.head&&mr&&sr.length<65536&&(sr.head.comment+=String.fromCharCode(mr)),mr&&gr<vr;);if(512&sr.flags&&(sr.check=$e(sr.check,xr,gr,br)),vr-=gr,br+=gr,mr)break e}else sr.head&&(sr.head.comment=null);sr.mode=9;case 9:if(512&sr.flags){for(;cr<16;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(kr!==(65535&sr.check)){nr.msg="header crc mismatch",sr.mode=30;break}cr=kr=0}sr.head&&(sr.head.hcrc=sr.flags>>9&1,sr.head.done=!0),nr.adler=sr.check=0,sr.mode=12;break;case 10:for(;cr<32;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}nr.adler=sr.check=Ve(kr),cr=kr=0,sr.mode=11;case 11:if(sr.havedict===0)return nr.next_out=wr,nr.avail_out=Dr,nr.next_in=br,nr.avail_in=vr,sr.hold=kr,sr.bits=cr,2;nr.adler=sr.check=1,sr.mode=12;case 12:if(hr===5||hr===6)break e;case 13:if(sr.last){kr>>>=7&cr,cr-=7&cr,sr.mode=27;break}for(;cr<3;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}switch(sr.last=1&kr,cr-=1,3&(kr>>>=1)){case 0:sr.mode=14;break;case 1:if(pr(sr),sr.mode=20,hr!==6)break;kr>>>=2,cr-=2;break e;case 2:sr.mode=17;break;case 3:nr.msg="invalid block type",sr.mode=30}kr>>>=2,cr-=2;break;case 14:for(kr>>>=7&cr,cr-=7&cr;cr<32;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if((65535&kr)!=(kr>>>16^65535)){nr.msg="invalid stored block lengths",sr.mode=30;break}if(sr.length=65535&kr,cr=kr=0,sr.mode=15,hr===6)break e;case 15:sr.mode=16;
vendor: 6,502 bytes, line 4004
4004case 16:if(gr=sr.length){if(vr<gr&&(gr=vr),Dr<gr&&(gr=Dr),gr===0)break e;Me.arraySet(Rr,xr,br,gr,wr),vr-=gr,br+=gr,Dr-=gr,wr+=gr,sr.length-=gr;break}sr.mode=12;break;case 17:for(;cr<14;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(sr.nlen=257+(31&kr),kr>>>=5,cr-=5,sr.ndist=1+(31&kr),kr>>>=5,cr-=5,sr.ncode=4+(15&kr),kr>>>=4,cr-=4,286<sr.nlen||30<sr.ndist){nr.msg="too many length or distance symbols",sr.mode=30;break}sr.have=0,sr.mode=18;case 18:for(;sr.have<sr.ncode;){for(;cr<3;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}sr.lens[Mr[sr.have++]]=7&kr,kr>>>=3,cr-=3}for(;sr.have<19;)sr.lens[Mr[sr.have++]]=0;if(sr.lencode=sr.lendyn,sr.lenbits=7,Lr={bits:sr.lenbits},Sr=Ue(0,sr.lens,0,19,sr.lencode,0,sr.work,Lr),sr.lenbits=Lr.bits,Sr){nr.msg="invalid code lengths set",sr.mode=30;break}sr.have=0,sr.mode=19;case 19:for(;sr.have<sr.nlen+sr.ndist;){for(;Tr=(fr=sr.lencode[kr&(1<<sr.lenbits)-1])>>>16&255,Nr=65535&fr,!((Ar=fr>>>24)<=cr);){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(Nr<16)kr>>>=Ar,cr-=Ar,sr.lens[sr.have++]=Nr;else{if(Nr===16){for(jr=Ar+2;cr<jr;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(kr>>>=Ar,cr-=Ar,sr.have===0){nr.msg="invalid bit length repeat",sr.mode=30;break}mr=sr.lens[sr.have-1],gr=3+(3&kr),kr>>>=2,cr-=2}else if(Nr===17){for(jr=Ar+3;cr<jr;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}cr-=Ar,mr=0,gr=3+(7&(kr>>>=Ar)),kr>>>=3,cr-=3}else{for(jr=Ar+7;cr<jr;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}cr-=Ar,mr=0,gr=11+(127&(kr>>>=Ar)),kr>>>=7,cr-=7}if(sr.have+gr>sr.nlen+sr.ndist){nr.msg="invalid bit length repeat",sr.mode=30;break}for(;gr--;)sr.lens[sr.have++]=mr}}if(sr.mode===30)break;if(sr.lens[256]===0){nr.msg="invalid code -- missing end-of-block",sr.mode=30;break}if(sr.lenbits=9,Lr={bits:sr.lenbits},Sr=Ue(ze,sr.lens,0,sr.nlen,sr.lencode,0,sr.work,Lr),sr.lenbits=Lr.bits,Sr){nr.msg="invalid literal/lengths set",sr.mode=30;break}if(sr.distbits=6,sr.distcode=sr.distdyn,Lr={bits:sr.distbits},Sr=Ue(We,sr.lens,sr.nlen,sr.ndist,sr.distcode,0,sr.work,Lr),sr.distbits=Lr.bits,Sr){nr.msg="invalid distances set",sr.mode=30;break}if(sr.mode=20,hr===6)break e;case 20:sr.mode=21;case 21:if(6<=vr&&258<=Dr){nr.next_out=wr,nr.avail_out=Dr,nr.next_in=br,nr.avail_in=vr,sr.hold=kr,sr.bits=cr,Be(nr,ur),wr=nr.next_out,Rr=nr.output,Dr=nr.avail_out,br=nr.next_in,xr=nr.input,vr=nr.avail_in,kr=sr.hold,cr=sr.bits,sr.mode===12&&(sr.back=-1);break}for(sr.back=0;Tr=(fr=sr.lencode[kr&(1<<sr.lenbits)-1])>>>16&255,Nr=65535&fr,!((Ar=fr>>>24)<=cr);){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(Tr&&!(240&Tr)){for(Br=Ar,Hr=Tr,Vr=Nr;Tr=(fr=sr.lencode[Vr+((kr&(1<<Br+Hr)-1)>>Br)])>>>16&255,Nr=65535&fr,!(Br+(Ar=fr>>>24)<=cr);){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}kr>>>=Br,cr-=Br,sr.back+=Br}if(kr>>>=Ar,cr-=Ar,sr.back+=Ar,sr.length=Nr,Tr===0){sr.mode=26;break}if(32&Tr){sr.back=-1,sr.mode=12;break}if(64&Tr){nr.msg="invalid literal/length code",sr.mode=30;break}sr.extra=15&Tr,sr.mode=22;case 22:if(sr.extra){for(jr=sr.extra;cr<jr;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}sr.length+=kr&(1<<sr.extra)-1,kr>>>=sr.extra,cr-=sr.extra,sr.back+=sr.extra}sr.was=sr.length,sr.mode=23;case 23:for(;Tr=(fr=sr.distcode[kr&(1<<sr.distbits)-1])>>>16&255,Nr=65535&fr,!((Ar=fr>>>24)<=cr);){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(!(240&Tr)){for(Br=Ar,Hr=Tr,Vr=Nr;Tr=(fr=sr.distcode[Vr+((kr&(1<<Br+Hr)-1)>>Br)])>>>16&255,Nr=65535&fr,!(Br+(Ar=fr>>>24)<=cr);){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}kr>>>=Br,cr-=Br,sr.back+=Br}if(kr>>>=Ar,cr-=Ar,sr.back+=Ar,64&Tr){nr.msg="invalid distance code",sr.mode=30;break}sr.offset=Nr,sr.extra=15&Tr,sr.mode=24;case 24:if(sr.extra){for(jr=sr.extra;cr<jr;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}sr.offset+=kr&(1<<sr.extra)-1,kr>>>=sr.extra,cr-=sr.extra,sr.back+=sr.extra}if(sr.offset>sr.dmax){nr.msg="invalid distance too far back",sr.mode=30;break}sr.mode=25;case 25:if(Dr===0)break e;if(gr=ur-Dr,sr.offset>gr){if((gr=sr.offset-gr)>sr.whave&&sr.sane){nr.msg="invalid distance too far back",sr.mode=30;break}_r=gr>sr.wnext?(gr-=sr.wnext,sr.wsize-gr):sr.wnext-gr,gr>sr.length&&(gr=sr.length),Ir=sr.window}else Ir=Rr,_r=wr-sr.offset,gr=sr.length;for(Dr<gr&&(gr=Dr),Dr-=gr,sr.length-=gr;Rr[wr++]=Ir[_r++],--gr;);sr.length===0&&(sr.mode=21);break;case 26:if(Dr===0)break e;Rr[wr++]=sr.length,Dr--,sr.mode=21;break;case 27:if(sr.wrap){for(;cr<32;){if(vr===0)break e;vr--,kr|=xr[br++]<<cr,cr+=8}if(ur-=Dr,nr.total_out+=ur,sr.total+=ur,ur&&(nr.adler=sr.check=sr.flags?$e(sr.check,Rr,ur,wr-ur):De(sr.check,Rr,ur,wr-ur)),ur=Dr,(sr.flags?kr:Ve(kr))!==sr.check){nr.msg="incorrect data check",sr.mode=30;break}cr=kr=0}sr.mode=28;case 28:if(sr.wrap&&sr.flags){for(;cr<32;){if(vr===0)break e;vr--,kr+=xr[br++]<<cr,cr+=8}if(kr!==(4294967295&sr.total)){nr.msg="incorrect length check",sr.mode=30;break}cr=kr=0}sr.mode=29;case 29:Sr=1;break e;case 30:Sr=-3;break e;case 31:return-4;case 32:default:return He}return nr.next_out=wr,nr.avail_out=Dr,nr.next_in=br,nr.avail_in=vr,sr.hold=kr,sr.bits=cr,(sr.wsize||ur!==nr.avail_out&&sr.mode<30&&(sr.mode<27||hr!==4))&&tr(nr,nr.output,nr.next_out,ur-nr.avail_out)?(sr.mode=31,-4):(dr-=nr.avail_in,ur-=nr.avail_out,nr.total_in+=dr,nr.total_out+=ur,sr.total+=ur,sr.wrap&&ur&&(nr.adler=sr.check=sr.flags?$e(sr.check,Rr,ur,nr.next_out-ur):De(sr.check,Rr,ur,nr.next_out-ur)),nr.data_type=sr.bits+(sr.last?64:0)+(sr.mode===12?128:0)+(sr.mode===20||sr.mode===15?256:0),(dr==0&&ur===0||hr===4)&&Sr===Xe&&(Sr=-5),Sr)},Oe.inflateEnd=function(nr){if(!nr||!nr.state)return He;var hr=nr.state;return hr.window&&(hr.window=null),nr.state=null,Xe},Oe.inflateGetHeader=function(nr,hr){var sr;return nr&&nr.state&&2&(sr=nr.state).wrap?((sr.head=hr).done=!1,Xe):He},Oe.inflateSetDictionary=function(nr,hr){var sr,xr=hr.length;return nr&&nr.state?(sr=nr.state).wrap!==0&&sr.mode!==11?He:sr.mode===11&&De(1,hr,xr,0)!==sr.check?-3:tr(nr,hr,xr,xr)?(sr.mode=31,-4):(sr.havedict=1,Xe):He},Oe.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(Te,je,Oe){var Me=Te("../utils/common"),De=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],$e=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Be=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Ue=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];
vendor: 11,022 bytes, line 4004
4004je.exports=function(ze,We,Xe,He,qe,Ge,Ye,Ve){var Ke,Qe,Ze,Je,ir,rr,ar,or,pr,tr=Ve.bits,nr=0,hr=0,sr=0,xr=0,Rr=0,br=0,wr=0,vr=0,Dr=0,kr=0,cr=null,dr=0,ur=new Me.Buf16(16),gr=new Me.Buf16(16),_r=null,Ir=0;for(nr=0;nr<=15;nr++)ur[nr]=0;for(hr=0;hr<He;hr++)ur[We[Xe+hr]]++;for(Rr=tr,xr=15;1<=xr&&ur[xr]===0;xr--);if(xr<Rr&&(Rr=xr),xr===0)return qe[Ge++]=20971520,qe[Ge++]=20971520,Ve.bits=1,0;for(sr=1;sr<xr&&ur[sr]===0;sr++);for(Rr<sr&&(Rr=sr),nr=vr=1;nr<=15;nr++)if(vr<<=1,(vr-=ur[nr])<0)return-1;if(0<vr&&(ze===0||xr!==1))return-1;for(gr[1]=0,nr=1;nr<15;nr++)gr[nr+1]=gr[nr]+ur[nr];for(hr=0;hr<He;hr++)We[Xe+hr]!==0&&(Ye[gr[We[Xe+hr]]++]=hr);if(rr=ze===0?(cr=_r=Ye,19):ze===1?(cr=De,dr-=257,_r=$e,Ir-=257,256):(cr=Be,_r=Ue,-1),nr=sr,ir=Ge,wr=hr=kr=0,Ze=-1,Je=(Dr=1<<(br=Rr))-1,ze===1&&852<Dr||ze===2&&592<Dr)return 1;for(;;){for(ar=nr-wr,pr=Ye[hr]<rr?(or=0,Ye[hr]):Ye[hr]>rr?(or=_r[Ir+Ye[hr]],cr[dr+Ye[hr]]):(or=96,0),Ke=1<<nr-wr,sr=Qe=1<<br;qe[ir+(kr>>wr)+(Qe-=Ke)]=ar<<24|or<<16|pr|0,Qe!==0;);for(Ke=1<<nr-1;kr&Ke;)Ke>>=1;if(Ke!==0?(kr&=Ke-1,kr+=Ke):kr=0,hr++,--ur[nr]==0){if(nr===xr)break;nr=We[Xe+Ye[hr]]}if(Rr<nr&&(kr&Je)!==Ze){for(wr===0&&(wr=Rr),ir+=sr,vr=1<<(br=nr-wr);br+wr<xr&&!((vr-=ur[br+wr])<=0);)br++,vr<<=1;if(Dr+=1<<br,ze===1&&852<Dr||ze===2&&592<Dr)return 1;qe[Ze=kr&Je]=Rr<<24|br<<16|ir-Ge|0}}return kr!==0&&(qe[ir+kr]=nr-wr<<24|64<<16|0),Ve.bits=Rr,0}},{"../utils/common":41}],51:[function(Te,je,Oe){je.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(Te,je,Oe){var Me=Te("../utils/common"),De=0,$e=1;function Be(fr){for(var Cr=fr.length;0<=--Cr;)fr[Cr]=0}var Ue=0,ze=29,We=256,Xe=We+1+ze,He=30,qe=19,Ge=2*Xe+1,Ye=15,Ve=16,Ke=7,Qe=256,Ze=16,Je=17,ir=18,rr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ar=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],or=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],pr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],tr=new Array(2*(Xe+2));Be(tr);var nr=new Array(2*He);Be(nr);var hr=new Array(512);Be(hr);var sr=new Array(256);Be(sr);var xr=new Array(ze);Be(xr);var Rr,br,wr,vr=new Array(He);function Dr(fr,Cr,Mr,$r,Fr){this.static_tree=fr,this.extra_bits=Cr,this.extra_base=Mr,this.elems=$r,this.max_length=Fr,this.has_stree=fr&&fr.length}function kr(fr,Cr){this.dyn_tree=fr,this.max_code=0,this.stat_desc=Cr}function cr(fr){return fr<256?hr[fr]:hr[256+(fr>>>7)]}function dr(fr,Cr){fr.pending_buf[fr.pending++]=255&Cr,fr.pending_buf[fr.pending++]=Cr>>>8&255}function ur(fr,Cr,Mr){fr.bi_valid>Ve-Mr?(fr.bi_buf|=Cr<<fr.bi_valid&65535,dr(fr,fr.bi_buf),fr.bi_buf=Cr>>Ve-fr.bi_valid,fr.bi_valid+=Mr-Ve):(fr.bi_buf|=Cr<<fr.bi_valid&65535,fr.bi_valid+=Mr)}function gr(fr,Cr,Mr){ur(fr,Mr[2*Cr],Mr[2*Cr+1])}function _r(fr,Cr){for(var Mr=0;Mr|=1&fr,fr>>>=1,Mr<<=1,0<--Cr;);return Mr>>>1}function Ir(fr,Cr,Mr){var $r,Fr,Kr=new Array(Ye+1),an=0;for($r=1;$r<=Ye;$r++)Kr[$r]=an=an+Mr[$r-1]<<1;for(Fr=0;Fr<=Cr;Fr++){var Wr=fr[2*Fr+1];Wr!==0&&(fr[2*Fr]=_r(Kr[Wr]++,Wr))}}function Ar(fr){var Cr;for(Cr=0;Cr<Xe;Cr++)fr.dyn_ltree[2*Cr]=0;for(Cr=0;Cr<He;Cr++)fr.dyn_dtree[2*Cr]=0;for(Cr=0;Cr<qe;Cr++)fr.bl_tree[2*Cr]=0;fr.dyn_ltree[2*Qe]=1,fr.opt_len=fr.static_len=0,fr.last_lit=fr.matches=0}function Tr(fr){8<fr.bi_valid?dr(fr,fr.bi_buf):0<fr.bi_valid&&(fr.pending_buf[fr.pending++]=fr.bi_buf),fr.bi_buf=0,fr.bi_valid=0}function Nr(fr,Cr,Mr,$r){var Fr=2*Cr,Kr=2*Mr;return fr[Fr]<fr[Kr]||fr[Fr]===fr[Kr]&&$r[Cr]<=$r[Mr]}function Br(fr,Cr,Mr){for(var $r=fr.heap[Mr],Fr=Mr<<1;Fr<=fr.heap_len&&(Fr<fr.heap_len&&Nr(Cr,fr.heap[Fr+1],fr.heap[Fr],fr.depth)&&Fr++,!Nr(Cr,$r,fr.heap[Fr],fr.depth));)fr.heap[Mr]=fr.heap[Fr],Mr=Fr,Fr<<=1;fr.heap[Mr]=$r}function Hr(fr,Cr,Mr){var $r,Fr,Kr,an,Wr=0;if(fr.last_lit!==0)for(;$r=fr.pending_buf[fr.d_buf+2*Wr]<<8|fr.pending_buf[fr.d_buf+2*Wr+1],Fr=fr.pending_buf[fr.l_buf+Wr],Wr++,$r===0?gr(fr,Fr,Cr):(gr(fr,(Kr=sr[Fr])+We+1,Cr),(an=rr[Kr])!==0&&ur(fr,Fr-=xr[Kr],an),gr(fr,Kr=cr(--$r),Mr),(an=ar[Kr])!==0&&ur(fr,$r-=vr[Kr],an)),Wr<fr.last_lit;);gr(fr,Qe,Cr)}function Vr(fr,Cr){var Mr,$r,Fr,Kr=Cr.dyn_tree,an=Cr.stat_desc.static_tree,Wr=Cr.stat_desc.has_stree,hn=Cr.stat_desc.elems,cn=-1;for(fr.heap_len=0,fr.heap_max=Ge,Mr=0;Mr<hn;Mr++)Kr[2*Mr]!==0?(fr.heap[++fr.heap_len]=cn=Mr,fr.depth[Mr]=0):Kr[2*Mr+1]=0;for(;fr.heap_len<2;)Kr[2*(Fr=fr.heap[++fr.heap_len]=cn<2?++cn:0)]=1,fr.depth[Fr]=0,fr.opt_len--,Wr&&(fr.static_len-=an[2*Fr+1]);for(Cr.max_code=cn,Mr=fr.heap_len>>1;1<=Mr;Mr--)Br(fr,Kr,Mr);for(Fr=hn;Mr=fr.heap[1],fr.heap[1]=fr.heap[fr.heap_len--],Br(fr,Kr,1),$r=fr.heap[1],fr.heap[--fr.heap_max]=Mr,fr.heap[--fr.heap_max]=$r,Kr[2*Fr]=Kr[2*Mr]+Kr[2*$r],fr.depth[Fr]=(fr.depth[Mr]>=fr.depth[$r]?fr.depth[Mr]:fr.depth[$r])+1,Kr[2*Mr+1]=Kr[2*$r+1]=Fr,fr.heap[1]=Fr++,Br(fr,Kr,1),2<=fr.heap_len;);fr.heap[--fr.heap_max]=fr.heap[1],function(tn,Qr){var wn,gn,In,yn,Mn,on,Yr=Qr.dyn_tree,sn=Qr.max_code,On=Qr.stat_desc.static_tree,Bn=Qr.stat_desc.has_stree,Hn=Qr.stat_desc.extra_bits,Zr=Qr.stat_desc.extra_base,xn=Qr.stat_desc.max_length,An=0;for(yn=0;yn<=Ye;yn++)tn.bl_count[yn]=0;for(Yr[2*tn.heap[tn.heap_max]+1]=0,wn=tn.heap_max+1;wn<Ge;wn++)xn<(yn=Yr[2*Yr[2*(gn=tn.heap[wn])+1]+1]+1)&&(yn=xn,An++),Yr[2*gn+1]=yn,sn<gn||(tn.bl_count[yn]++,Mn=0,Zr<=gn&&(Mn=Hn[gn-Zr]),on=Yr[2*gn],tn.opt_len+=on*(yn+Mn),Bn&&(tn.static_len+=on*(On[2*gn+1]+Mn)));if(An!==0){do{for(yn=xn-1;tn.bl_count[yn]===0;)yn--;tn.bl_count[yn]--,tn.bl_count[yn+1]+=2,tn.bl_count[xn]--,An-=2}while(0<An);for(yn=xn;yn!==0;yn--)for(gn=tn.bl_count[yn];gn!==0;)sn<(In=tn.heap[--wn])||(Yr[2*In+1]!==yn&&(tn.opt_len+=(yn-Yr[2*In+1])*Yr[2*In],Yr[2*In+1]=yn),gn--)}}(fr,Cr),Ir(Kr,cn,fr.bl_count)}function mr(fr,Cr,Mr){var $r,Fr,Kr=-1,an=Cr[1],Wr=0,hn=7,cn=4;for(an===0&&(hn=138,cn=3),Cr[2*(Mr+1)+1]=65535,$r=0;$r<=Mr;$r++)Fr=an,an=Cr[2*($r+1)+1],++Wr<hn&&Fr===an||(Wr<cn?fr.bl_tree[2*Fr]+=Wr:Fr!==0?(Fr!==Kr&&fr.bl_tree[2*Fr]++,fr.bl_tree[2*Ze]++):Wr<=10?fr.bl_tree[2*Je]++:fr.bl_tree[2*ir]++,Kr=Fr,cn=(Wr=0)===an?(hn=138,3):Fr===an?(hn=6,3):(hn=7,4))}function Sr(fr,Cr,Mr){var $r,Fr,Kr=-1,an=Cr[1],Wr=0,hn=7,cn=4;for(an===0&&(hn=138,cn=3),$r=0;$r<=Mr;$r++)if(Fr=an,an=Cr[2*($r+1)+1],!(++Wr<hn&&Fr===an)){if(Wr<cn)for(;gr(fr,Fr,fr.bl_tree),--Wr!=0;);else Fr!==0?(Fr!==Kr&&(gr(fr,Fr,fr.bl_tree),Wr--),gr(fr,Ze,fr.bl_tree),ur(fr,Wr-3,2)):Wr<=10?(gr(fr,Je,fr.bl_tree),ur(fr,Wr-3,3)):(gr(fr,ir,fr.bl_tree),ur(fr,Wr-11,7));Kr=Fr,cn=(Wr=0)===an?(hn=138,3):Fr===an?(hn=6,3):(hn=7,4)}}Be(vr);var Lr=!1;function jr(fr,Cr,Mr,$r){ur(fr,(Ue<<1)+($r?1:0),3),function(Fr,Kr,an,Wr){Tr(Fr),dr(Fr,an),dr(Fr,~an),Me.arraySet(Fr.pending_buf,Fr.window,Kr,an,Fr.pending),Fr.pending+=an}(fr,Cr,Mr)}Oe._tr_init=function(fr){Lr||(function(){var Cr,Mr,$r,Fr,Kr,an=new Array(Ye+1);for(Fr=$r=0;Fr<ze-1;Fr++)for(xr[Fr]=$r,Cr=0;Cr<1<<rr[Fr];Cr++)sr[$r++]=Fr;for(sr[$r-1]=Fr,Fr=Kr=0;Fr<16;Fr++)for(vr[Fr]=Kr,Cr=0;Cr<1<<ar[Fr];Cr++)hr[Kr++]=Fr;for(Kr>>=7;Fr<He;Fr++)for(vr[Fr]=Kr<<7,Cr=0;Cr<1<<ar[Fr]-7;Cr++)hr[256+Kr++]=Fr;for(Mr=0;Mr<=Ye;Mr++)an[Mr]=0;for(Cr=0;Cr<=143;)tr[2*Cr+1]=8,Cr++,an[8]++;for(;Cr<=255;)tr[2*Cr+1]=9,Cr++,an[9]++;for(;Cr<=279;)tr[2*Cr+1]=7,Cr++,an[7]++;for(;Cr<=287;)tr[2*Cr+1]=8,Cr++,an[8]++;for(Ir(tr,Xe+1,an),Cr=0;Cr<He;Cr++)nr[2*Cr+1]=5,nr[2*Cr]=_r(Cr,5);Rr=new Dr(tr,rr,We+1,Xe,Ye),br=new Dr(nr,ar,0,He,Ye),wr=new Dr(new Array(0),or,0,qe,Ke)}(),Lr=!0),fr.l_desc=new kr(fr.dyn_ltree,Rr),fr.d_desc=new kr(fr.dyn_dtree,br),fr.bl_desc=new kr(fr.bl_tree,wr),fr.bi_buf=0,fr.bi_valid=0,Ar(fr)},Oe._tr_stored_block=jr,Oe._tr_flush_block=function(fr,Cr,Mr,$r){var Fr,Kr,an=0;0<fr.level?(fr.strm.data_type===2&&(fr.strm.data_type=function(Wr){var hn,cn=4093624447;for(hn=0;hn<=31;hn++,cn>>>=1)if(1&cn&&Wr.dyn_ltree[2*hn]!==0)return De;if(Wr.dyn_ltree[18]!==0||Wr.dyn_ltree[20]!==0||Wr.dyn_ltree[26]!==0)return $e;for(hn=32;hn<We;hn++)if(Wr.dyn_ltree[2*hn]!==0)return $e;return De}(fr)),Vr(fr,fr.l_desc),Vr(fr,fr.d_desc),an=function(Wr){var hn;for(mr(Wr,Wr.dyn_ltree,Wr.l_desc.max_code),mr(Wr,Wr.dyn_dtree,Wr.d_desc.max_code),Vr(Wr,Wr.bl_desc),hn=qe-1;3<=hn&&Wr.bl_tree[2*pr[hn]+1]===0;hn--);return Wr.opt_len+=3*(hn+1)+5+5+4,hn}(fr),Fr=fr.opt_len+3+7>>>3,(Kr=fr.static_len+3+7>>>3)<=Fr&&(Fr=Kr)):Fr=Kr=Mr+5,Mr+4<=Fr&&Cr!==-1?jr(fr,Cr,Mr,$r):fr.strategy===4||Kr===Fr?(ur(fr,2+($r?1:0),3),Hr(fr,tr,nr)):(ur(fr,4+($r?1:0),3),function(Wr,hn,cn,tn){var Qr;for(ur(Wr,hn-257,5),ur(Wr,cn-1,5),ur(Wr,tn-4,4),Qr=0;Qr<tn;Qr++)ur(Wr,Wr.bl_tree[2*pr[Qr]+1],3);Sr(Wr,Wr.dyn_ltree,hn-1),Sr(Wr,Wr.dyn_dtree,cn-1)}(fr,fr.l_desc.max_code+1,fr.d_desc.max_code+1,an+1),Hr(fr,fr.dyn_ltree,fr.dyn_dtree)),Ar(fr),$r&&Tr(fr)},Oe._tr_tally=function(fr,Cr,Mr){return fr.pending_buf[fr.d_buf+2*fr.last_lit]=Cr>>>8&255,fr.pending_buf[fr.d_buf+2*fr.last_lit+1]=255&Cr,fr.pending_buf[fr.l_buf+fr.last_lit]=255&Mr,fr.last_lit++,Cr===0?fr.dyn_ltree[2*Mr]++:(fr.matches++,Cr--,fr.dyn_ltree[2*(sr[Mr]+We+1)]++,fr.dyn_dtree[2*cr(Cr)]++),fr.last_lit===fr.lit_bufsize-1},Oe._tr_align=function(fr){ur(fr,2,3),gr(fr,Qe,tr),function(Cr){Cr.bi_valid===16?(dr(Cr,Cr.bi_buf),Cr.bi_buf=0,Cr.bi_valid=0):8<=Cr.bi_valid&&(Cr.pending_buf[Cr.pending++]=255&Cr.bi_buf,Cr.bi_buf>>=8,Cr.bi_valid-=8)}(fr)}},{"../utils/common":41}],53:[function(Te,je,Oe){je.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(Te,je,Oe){(function(Me){(function(De,$e){if(!De.setImmediate){var Be,Ue,ze,We,Xe=1,He={},qe=!1,Ge=De.document,Ye=Object.getPrototypeOf&&Object.getPrototypeOf(De);Ye=Ye&&Ye.setTimeout?Ye:De,Be={}.toString.call(De.process)==="[object process]"?function(Ze){process.nextTick(function(){Ke(Ze)})}:function(){if(De.postMessage&&!De.importScripts){var Ze=!0,Je=De.onmessage;return De.onmessage=function(){Ze=!1},De.postMessage("","*"),De.onmessage=Je,Ze}}()?(We="setImmediate$"+Math.random()+"$",De.addEventListener?De.addEventListener("message",Qe,!1):De.attachEvent("onmessage",Qe),function(Ze){De.postMessage(We+Ze,"*")}):De.MessageChannel?((ze=new MessageChannel).port1.onmessage=function(Ze){Ke(Ze.data)},function(Ze){ze.port2.postMessage(Ze)}):Ge&&"onreadystatechange"in Ge.createElement("script")?(Ue=Ge.documentElement,function(Ze){var Je=Ge.createElement("script");Je.onreadystatechange=function(){Ke(Ze),Je.onreadystatechange=null,Ue.removeChild(Je),Je=null},Ue.appendChild(Je)}):function(Ze){setTimeout(Ke,0,Ze)},Ye.setImmediate=function(Ze){typeof Ze!="function"&&(Ze=new Function(""+Ze));for(var Je=new Array(arguments.length-1),ir=0;ir<Je.length;ir++)Je[ir]=arguments[ir+1];var rr={callback:Ze,args:Je};return He[Xe]=rr,Be(Xe),Xe++},Ye.clearImmediate=Ve}function Ve(Ze){delete He[Ze]}function Ke(Ze){if(qe)setTimeout(Ke,0,Ze);else{var Je=He[Ze];if(Je){qe=!0;try{(function(ir){var rr=ir.callback,ar=ir.args;switch(ar.length){case 0:rr();break;case 1:rr(ar[0]);break;case 2:rr(ar[0],ar[1]);break;case 3:rr(ar[0],ar[1],ar[2]);break;default:rr.apply($e,ar)}})(Je)}finally{Ve(Ze),qe=!1}}}}
4004function Qe(Ze){Ze.source===De&&typeof Ze.data=="string"&&Ze.data.indexOf(We)===0&&Ke(+Ze.data.slice(We.length))}})(typeof self>"u"?Me===void 0?this:Me:self)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(jszip_min);var jszip_minExports=jszip_min.exports;const JSZip=getDefaultExportFromCjs(jszip_minExports);/* 4005 * @license 4006 * docx-preview <https://github.com/VolodymyrBaydalka/docxjs> 4007 * Released under Apache License 2.0 <https://github.com/VolodymyrBaydalka/docxjs/blob/master/LICENSE> 4008 * Copyright Volodymyr Baydalka 4009 */var RelationshipTypes;(function(Ee){Ee.OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",Ee.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",Ee.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Ee.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",Ee.Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Ee.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",Ee.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",Ee.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",Ee.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",Ee.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",Ee.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",Ee.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",Ee.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",Ee.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",Ee.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",Ee.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",Ee.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties",Ee.Comments="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",Ee.CommentsExtended="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",Ee.AltChunk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk"})(RelationshipTypes||(RelationshipTypes={}));function parseRelationships(Ee,Re){return Re.elements(Ee).map(Te=>({id:Re.attr(Te,"Id"),type:Re.attr(Te,"Type"),target:Re.attr(Te,"Target"),targetMode:Re.attr(Te,"TargetMode")}))}function escapeClassName(Ee){return Ee==null?void 0:Ee.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}function encloseFontFamily(Ee){return/^[^"'].*\s.*[^"']$/.test(Ee)?`'${Ee}'`:Ee}function splitPath(Ee){let Re=Ee.lastIndexOf("/")+1,Te=Re==0?"":Ee.substring(0,Re),je=Re==0?Ee:Ee.substring(Re);return[Te,je]}function resolvePath(Ee,Re){try{const Te="http://docx/";return new URL(Ee,Te+Re).toString().substring(Te.length)}catch{return`${Re}${Ee}`}}function keyBy(Ee,Re){return Ee.reduce((Te,je)=>(Te[Re(je)]=je,Te),{})}function blobToBase64(Ee){return new Promise((Re,Te)=>{const je=new FileReader;je.onloadend=()=>Re(je.result),je.onerror=()=>Te(),je.readAsDataURL(Ee)})}function isObject(Ee){return Ee&&typeof Ee=="object"&&!Array.isArray(Ee)}function isString(Ee){return typeof Ee=="string"||Ee instanceof String}function mergeDeep(Ee,...Re){if(!Re.length)return Ee;const Te=Re.shift();if(isObject(Ee)&&isObject(Te))for(const je in Te)if(isObject(Te[je])){const Oe=Ee[je]??(Ee[je]={});mergeDeep(Oe,Te[je])}else Ee[je]=Te[je];return mergeDeep(Ee,...Re)}function asArray(Ee){return Array.isArray(Ee)?Ee:[Ee]}function clamp(Ee,Re,Te){return Re>Ee?Re:Te<Ee?Te:Ee}const ns$1={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},LengthUsage={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt",min:.25,max:12},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"}};function convertLength(Ee,Re=LengthUsage.Dxa){if(Ee==null||/.+(p[xt]|[%])$/.test(Ee))return Ee;var Te=parseInt(Ee)*Re.mul;return Re.min&&Re.max&&(Te=clamp(Te,Re.min,Re.max)),`${Te.toFixed(2)}${Re.unit}`}function convertBoolean(Ee,Re=!1){switch(Ee){case"1":return!0;case"0":return!1;case"on":return!0;case"off":return!1;case"true":return!0;case"false":return!1;default:return Re}}function parseCommonProperty(Ee,Re,Te){if(Ee.namespaceURI!=ns$1.wordml)return!1;switch(Ee.localName){case"color":Re.color=Te.attr(Ee,"val");break;case"sz":Re.fontSize=Te.lengthAttr(Ee,"val",LengthUsage.FontSize);break;default:return!1}return!0}function parseXmlString(Ee,Re=!1){Re&&(Ee=Ee.replace(/<[?].*[?]>/,"")),Ee=removeUTF8BOM(Ee);const Te=new DOMParser().parseFromString(Ee,"application/xml"),je=hasXmlParserError(Te);if(je)throw new Error(je);return Te}function hasXmlParserError(Ee){var Re;return(Re=Ee.getElementsByTagName("parsererror")[0])==null?void 0:Re.textContent}function removeUTF8BOM(Ee){return Ee.charCodeAt(0)===65279?Ee.substring(1):Ee}
4009function serializeXmlString(Ee){return new XMLSerializer().serializeToString(Ee)}class XmlParser{elements(Re,Te=null){const je=[];for(let Oe=0,Me=Re.childNodes.length;Oe<Me;Oe++){let De=Re.childNodes.item(Oe);De.nodeType==Node.ELEMENT_NODE&&(Te==null||De.localName==Te)&&je.push(De)}return je}element(Re,Te){for(let je=0,Oe=Re.childNodes.length;je<Oe;je++){let Me=Re.childNodes.item(je);if(Me.nodeType==1&&Me.localName==Te)return Me}return null}elementAttr(Re,Te,je){var Oe=this.element(Re,Te);return Oe?this.attr(Oe,je):void 0}attrs(Re){return Array.from(Re.attributes)}attr(Re,Te){for(let je=0,Oe=Re.attributes.length;je<Oe;je++){let Me=Re.attributes.item(je);if(Me.localName==Te)return Me.value}return null}intAttr(Re,Te,je=null){var Oe=this.attr(Re,Te);return Oe?parseInt(Oe):je}hexAttr(Re,Te,je=null){var Oe=this.attr(Re,Te);return Oe?parseInt(Oe,16):je}floatAttr(Re,Te,je=null){var Oe=this.attr(Re,Te);return Oe?parseFloat(Oe):je}boolAttr(Re,Te,je=null){return convertBoolean(this.attr(Re,Te),je)}lengthAttr(Re,Te,je=LengthUsage.Dxa){return convertLength(this.attr(Re,Te),je)}}const globalXmlParser=new XmlParser;class Part{constructor(Re,Te){this._package=Re,this.path=Te}async load(){this.rels=await this._package.loadRelationships(this.path);const Re=await this._package.load(this.path),Te=this._package.parseXmlDocument(Re);this._package.options.keepOrigin&&(this._xmlDocument=Te),this.parseXml(Te.firstElementChild)}save(){this._package.update(this.path,serializeXmlString(this._xmlDocument))}parseXml(Re){}}const embedFontTypeMap={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function parseFonts(Ee,Re){return Re.elements(Ee).map(Te=>parseFont(Te,Re))}function parseFont(Ee,Re){let Te={name:Re.attr(Ee,"name"),embedFontRefs:[]};for(let je of Re.elements(Ee))switch(je.localName){case"family":Te.family=Re.attr(je,"val");break;case"altName":Te.altName=Re.attr(je,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":Te.embedFontRefs.push(parseEmbedFontRef(je,Re));break}return Te}function parseEmbedFontRef(Ee,Re){return{id:Re.attr(Ee,"id"),key:Re.attr(Ee,"fontKey"),type:embedFontTypeMap[Ee.localName]}}class FontTablePart extends Part{parseXml(Re){this.fonts=parseFonts(Re,this._package.xmlParser)}}class OpenXmlPackage{constructor(Re,Te){this._zip=Re,this.options=Te,this.xmlParser=new XmlParser}get(Re){const Te=normalizePath(Re);return this._zip.files[Te]??this._zip.files[Te.replace(/\//g,"\\")]}update(Re,Te){this._zip.file(Re,Te)}static async load(Re,Te){const je=await JSZip.loadAsync(Re);return new OpenXmlPackage(je,Te)}save(Re="blob"){return this._zip.generateAsync({type:Re})}load(Re,Te="string"){var je;return((je=this.get(Re))==null?void 0:je.async(Te))??Promise.resolve(null)}async loadRelationships(Re=null){let Te="_rels/.rels";if(Re!=null){const[Oe,Me]=splitPath(Re);Te=`${Oe}_rels/${Me}.rels`}const je=await this.load(Te);return je?parseRelationships(this.parseXmlDocument(je).firstElementChild,this.xmlParser):null}parseXmlDocument(Re){return parseXmlString(Re,this.options.trimXmlDeclaration)}}function normalizePath(Ee){return Ee.startsWith("/")?Ee.substr(1):Ee}class DocumentPart extends Part{constructor(Re,Te,je){super(Re,Te),this._documentParser=je}parseXml(Re){this.body=this._documentParser.parseDocumentFile(Re)}}function parseBorder(Ee,Re){return{type:Re.attr(Ee,"val"),color:Re.attr(Ee,"color"),size:Re.lengthAttr(Ee,"sz",LengthUsage.Border),offset:Re.lengthAttr(Ee,"space",LengthUsage.Point),frame:Re.boolAttr(Ee,"frame"),shadow:Re.boolAttr(Ee,"shadow")}}function parseBorders(Ee,Re){var Te={};for(let je of Re.elements(Ee))switch(je.localName){case"left":Te.left=parseBorder(je,Re);break;case"top":Te.top=parseBorder(je,Re);break;case"right":Te.right=parseBorder(je,Re);break;case"bottom":Te.bottom=parseBorder(je,Re);break}return Te}var SectionType;(function(Ee){Ee.Continuous="continuous",Ee.NextPage="nextPage",Ee.NextColumn="nextColumn",Ee.EvenPage="evenPage",Ee.OddPage="oddPage"})(SectionType||(SectionType={}));function parseSectionProperties(Ee,Re=globalXmlParser){var Te={};for(let je of Re.elements(Ee))switch(je.localName){case"pgSz":Te.pageSize={
4009width:Re.lengthAttr(je,"w"),height:Re.lengthAttr(je,"h"),orientation:Re.attr(je,"orient")};break;case"type":Te.type=Re.attr(je,"val");break;case"pgMar":Te.pageMargins={left:Re.lengthAttr(je,"left"),right:Re.lengthAttr(je,"right"),top:Re.lengthAttr(je,"top"),bottom:Re.lengthAttr(je,"bottom"),header:Re.lengthAttr(je,"header"),footer:Re.lengthAttr(je,"footer"),gutter:Re.lengthAttr(je,"gutter")};break;case"cols":Te.columns=parseColumns(je,Re);break;case"headerReference":(Te.headerRefs??(Te.headerRefs=[])).push(parseFooterHeaderReference(je,Re));break;case"footerReference":(Te.footerRefs??(Te.footerRefs=[])).push(parseFooterHeaderReference(je,Re));break;case"titlePg":Te.titlePage=Re.boolAttr(je,"val",!0);break;case"pgBorders":Te.pageBorders=parseBorders(je,Re);break;case"pgNumType":Te.pageNumber=parsePageNumber(je,Re);break}return Te}function parseColumns(Ee,Re){return{numberOfColumns:Re.intAttr(Ee,"num"),space:Re.lengthAttr(Ee,"space"),separator:Re.boolAttr(Ee,"sep"),equalWidth:Re.boolAttr(Ee,"equalWidth",!0),columns:Re.elements(Ee,"col").map(Te=>({width:Re.lengthAttr(Te,"w"),space:Re.lengthAttr(Te,"space")}))}}function parsePageNumber(Ee,Re){return{chapSep:Re.attr(Ee,"chapSep"),chapStyle:Re.attr(Ee,"chapStyle"),format:Re.attr(Ee,"fmt"),start:Re.intAttr(Ee,"start")}}function parseFooterHeaderReference(Ee,Re){return{id:Re.attr(Ee,"id"),type:Re.attr(Ee,"type")}}function parseLineSpacing(Ee,Re){return{before:Re.lengthAttr(Ee,"before"),after:Re.lengthAttr(Ee,"after"),line:Re.intAttr(Ee,"line"),lineRule:Re.attr(Ee,"lineRule")}}function parseRunProperties(Ee,Re){let Te={};for(let je of Re.elements(Ee))parseRunProperty(je,Te,Re);return Te}function parseRunProperty(Ee,Re,Te){return!!parseCommonProperty(Ee,Re,Te)}function parseParagraphProperties(Ee,Re){let Te={};for(let je of Re.elements(Ee))parseParagraphProperty(je,Te,Re);return Te}function parseParagraphProperty(Ee,Re,Te){if(Ee.namespaceURI!=ns$1.wordml)return!1;if(parseCommonProperty(Ee,Re,Te))return!0;switch(Ee.localName){case"tabs":Re.tabs=parseTabs(Ee,Te);break;case"sectPr":Re.sectionProps=parseSectionProperties(Ee,Te);break;case"numPr":Re.numbering=parseNumbering$1(Ee,Te);break;case"spacing":return Re.lineSpacing=parseLineSpacing(Ee,Te),!1;case"textAlignment":return Re.textAlignment=Te.attr(Ee,"val"),!1;case"keepLines":Re.keepLines=Te.boolAttr(Ee,"val",!0);break;case"keepNext":Re.keepNext=Te.boolAttr(Ee,"val",!0);break;case"pageBreakBefore":Re.pageBreakBefore=Te.boolAttr(Ee,"val",!0);break;case"outlineLvl":Re.outlineLevel=Te.intAttr(Ee,"val");break;case"pStyle":Re.styleName=Te.attr(Ee,"val");break;case"rPr":Re.runProps=parseRunProperties(Ee,Te);break;default:return!1}return!0}function parseTabs(Ee,Re){return Re.elements(Ee,"tab").map(Te=>({position:Re.lengthAttr(Te,"pos"),leader:Re.attr(Te,"leader"),style:Re.attr(Te,"val")}))}function parseNumbering$1(Ee,Re){var Te={};for(let je of Re.elements(Ee))switch(je.localName){case"numId":Te.id=Re.attr(je,"val");break;case"ilvl":Te.level=Re.intAttr(je,"val");break}return Te}function parseNumberingPart(Ee,Re){let Te={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let je of Re.elements(Ee))switch(je.localName){case"num":Te.numberings.push(parseNumbering(je,Re));break;case"abstractNum":Te.abstractNumberings.push(parseAbstractNumbering(je,Re));break;case"numPicBullet":Te.bulletPictures.push(parseNumberingBulletPicture(je,Re));break}return Te}function parseNumbering(Ee,Re){let Te={id:Re.attr(Ee,"numId"),overrides:[]};for(let je of Re.elements(Ee))switch(je.localName){case"abstractNumId":Te.abstractId=Re.attr(je,"val");break;case"lvlOverride":Te.overrides.push(parseNumberingLevelOverrride(je,Re));break}return Te}function parseAbstractNumbering(Ee,Re){let Te={id:Re.attr(Ee,"abstractNumId"),levels:[]};for(let je of Re.elements(Ee))switch(je.localName){case"name":Te.name=Re.attr(je,"val");break;case"multiLevelType":Te.multiLevelType=Re.attr(je,"val");break;case"numStyleLink":Te.numberingStyleLink=Re.attr(je,"val");break;case"styleLink":Te.styleLink=Re.attr(je,"val");break;case"lvl":Te.levels.push(parseNumberingLevel(je,Re));break}return Te}function parseNumberingLevel(Ee,Re){let Te={level:Re.intAttr(Ee,"ilvl")};for(let je of Re.elements(Ee))switch(je.localName){case"start":Te.start=Re.attr(je,"val");break;case"lvlRestart":Te.restart=Re.intAttr(je,"val");break;case"numFmt":Te.format=Re.attr(je,"val");break;case"lvlText":Te.text=Re.attr(je,"val");break;case"lvlJc":Te.justification=Re.attr(je,"val");break;case"lvlPicBulletId":Te.bulletPictureId=Re.attr(je,"val");break;case"pStyle":Te.paragraphStyle=Re.attr(je,"val");break;case"pPr":Te.paragraphProps=parseParagraphProperties(je,Re);break;case"rPr":Te.runProps=parseRunProperties(je,Re);break}return Te}function parseNumberingLevelOverrride(Ee,Re){let Te={level:Re.intAttr(Ee,"ilvl")};for(let je of Re.elements(Ee))switch(je.localName){case"startOverride":Te.start=Re.intAttr(je,"val");break;case"lvl":Te.numberingLevel=parseNumberingLevel(je,Re);break}return Te}
4009function parseNumberingBulletPicture(Ee,Re){var Te=Re.element(Ee,"pict"),je=Te&&Re.element(Te,"shape"),Oe=je&&Re.element(je,"imagedata");return Oe?{id:Re.attr(Ee,"numPicBulletId"),referenceId:Re.attr(Oe,"id"),style:Re.attr(je,"style")}:null}class NumberingPart extends Part{constructor(Re,Te,je){super(Re,Te),this._documentParser=je}parseXml(Re){Object.assign(this,parseNumberingPart(Re,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(Re)}}class StylesPart extends Part{constructor(Re,Te,je){super(Re,Te),this._documentParser=je}parseXml(Re){this.styles=this._documentParser.parseStylesFile(Re)}}var DomType;(function(Ee){Ee.Document="document",Ee.Paragraph="paragraph",Ee.Run="run",Ee.Break="break",Ee.NoBreakHyphen="noBreakHyphen",Ee.Table="table",Ee.Row="row",Ee.Cell="cell",Ee.Hyperlink="hyperlink",Ee.SmartTag="smartTag",Ee.Drawing="drawing",Ee.Image="image",Ee.Text="text",Ee.Tab="tab",Ee.Symbol="symbol",Ee.BookmarkStart="bookmarkStart",Ee.BookmarkEnd="bookmarkEnd",Ee.Footer="footer",Ee.Header="header",Ee.FootnoteReference="footnoteReference",Ee.EndnoteReference="endnoteReference",Ee.Footnote="footnote",Ee.Endnote="endnote",Ee.SimpleField="simpleField",Ee.ComplexField="complexField",Ee.Instruction="instruction",Ee.VmlPicture="vmlPicture",Ee.MmlMath="mmlMath",Ee.MmlMathParagraph="mmlMathParagraph",Ee.MmlFraction="mmlFraction",Ee.MmlFunction="mmlFunction",Ee.MmlFunctionName="mmlFunctionName",Ee.MmlNumerator="mmlNumerator",Ee.MmlDenominator="mmlDenominator",Ee.MmlRadical="mmlRadical",Ee.MmlBase="mmlBase",Ee.MmlDegree="mmlDegree",Ee.MmlSuperscript="mmlSuperscript",Ee.MmlSubscript="mmlSubscript",Ee.MmlPreSubSuper="mmlPreSubSuper",Ee.MmlSubArgument="mmlSubArgument",Ee.MmlSuperArgument="mmlSuperArgument",Ee.MmlNary="mmlNary",Ee.MmlDelimiter="mmlDelimiter",Ee.MmlRun="mmlRun",Ee.MmlEquationArray="mmlEquationArray",Ee.MmlLimit="mmlLimit",Ee.MmlLimitLower="mmlLimitLower",Ee.MmlMatrix="mmlMatrix",Ee.MmlMatrixRow="mmlMatrixRow",Ee.MmlBox="mmlBox",Ee.MmlBar="mmlBar",Ee.MmlGroupChar="mmlGroupChar",Ee.VmlElement="vmlElement",Ee.Inserted="inserted",Ee.Deleted="deleted",Ee.DeletedText="deletedText",Ee.Comment="comment",Ee.CommentReference="commentReference",Ee.CommentRangeStart="commentRangeStart",Ee.CommentRangeEnd="commentRangeEnd",Ee.AltChunk="altChunk"})(DomType||(DomType={}));class OpenXmlElementBase{constructor(){this.children=[],this.cssStyle={}}}class WmlHeader extends OpenXmlElementBase{constructor(){super(...arguments),this.type=DomType.Header}}class WmlFooter extends OpenXmlElementBase{constructor(){super(...arguments),this.type=DomType.Footer}}class BaseHeaderFooterPart extends Part{constructor(Re,Te,je){super(Re,Te),this._documentParser=je}parseXml(Re){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(Re)}}class HeaderPart extends BaseHeaderFooterPart{createRootElement(){return new WmlHeader}}class FooterPart extends BaseHeaderFooterPart{createRootElement(){return new WmlFooter}}function parseExtendedProps(Ee,Re){const Te={};for(let je of Re.elements(Ee))switch(je.localName){case"Template":Te.template=je.textContent;break;case"Pages":Te.pages=safeParseToInt(je.textContent);break;case"Words":Te.words=safeParseToInt(je.textContent);break;case"Characters":Te.characters=safeParseToInt(je.textContent);break;case"Application":Te.application=je.textContent;break;case"Lines":Te.lines=safeParseToInt(je.textContent);break;case"Paragraphs":Te.paragraphs=safeParseToInt(je.textContent);break;case"Company":Te.company=je.textContent;break;case"AppVersion":Te.appVersion=je.textContent;break}return Te}function safeParseToInt(Ee){if(!(typeof Ee>"u"))return parseInt(Ee)}class ExtendedPropsPart extends Part{parseXml(Re){this.props=parseExtendedProps(Re,this._package.xmlParser)}}function parseCoreProps(Ee,Re){const Te={};for(let je of Re.elements(Ee))switch(je.localName){case"title":Te.title=je.textContent;break;case"description":Te.description=je.textContent;break;case"subject":Te.subject=je.textContent;break;case"creator":Te.creator=je.textContent;break;case"keywords":Te.keywords=je.textContent;break;case"language":Te.language=je.textContent;break;case"lastModifiedBy":Te.lastModifiedBy=je.textContent;break;case"revision":je.textContent&&(Te.revision=parseInt(je.textContent));break}return Te}class CorePropsPart extends Part{parseXml(Re){this.props=parseCoreProps(Re,this._package.xmlParser)}}class DmlTheme{}function parseTheme(Ee,Re){var Te=new DmlTheme,je=Re.element(Ee,"themeElements");for(let Oe of Re.elements(je))switch(Oe.localName){case"clrScheme":Te.colorScheme=parseColorScheme(Oe,Re);break;case"fontScheme":Te.fontScheme=parseFontScheme(Oe,Re);break}return Te}function parseColorScheme(Ee,Re){var Te={name:Re.attr(Ee,"name"),colors:{}};for(let Me of Re.elements(Ee)){var je=Re.element(Me,"srgbClr"),Oe=Re.element(Me,"sysClr");je?Te.colors[Me.localName]=Re.attr(je,"val"):Oe&&(Te.colors[Me.localName]=Re.attr(Oe,"lastClr"))}return Te}function parseFontScheme(Ee,Re){var Te={name:Re.attr(Ee,"name")};for(let je of Re.elements(Ee))switch(je.localName){case"majorFont":Te.majorFont=parseFontInfo(je,Re);break;case"minorFont":Te.minorFont=parseFontInfo(je,Re);break}return Te}function parseFontInfo(Ee,Re){return{latinTypeface:Re.elementAttr(Ee,"latin","typeface"),eaTypeface:Re.elementAttr(Ee,"ea","typeface"),csTypeface:Re.elementAttr(Ee,"cs","typeface")}}class ThemePart extends Part{constructor(Re,Te){super(Re,Te)}parseXml(Re){this.theme=parseTheme(Re,this._package.xmlParser)}}class WmlBaseNote{}class WmlFootnote extends WmlBaseNote{constructor(){super(...arguments),this.type=DomType.Footnote}}class WmlEndnote extends WmlBaseNote{constructor(){super(...arguments),this.type=DomType.Endnote}}class BaseNotePart extends Part{constructor(Re,Te,je){super(Re,Te),this._documentParser=je}}class FootnotesPart extends BaseNotePart{constructor(Re,Te,je){super(Re,Te,je)}parseXml(Re){this.notes=this._documentParser.parseNotes(Re,"footnote",WmlFootnote)}}class EndnotesPart extends BaseNotePart{constructor(Re,Te,je){super(Re,Te,je)}parseXml(Re){this.notes=this._documentParser.parseNotes(Re,"endnote",WmlEndnote)}}function parseSettings(Ee,Re){var Te={};for(let je of Re.elements(Ee))switch(je.localName){case"defaultTabStop":Te.defaultTabStop=Re.lengthAttr(je,"val");break;case"footnotePr":Te.footnoteProps=parseNoteProperties(je,Re);break;case"endnotePr":Te.endnoteProps=parseNoteProperties(je,Re);break;case"autoHyphenation":Te.autoHyphenation=Re.boolAttr(je,"val");break}return Te}function parseNoteProperties(Ee,Re){var Te={defaultNoteIds:[]};for(let je of Re.elements(Ee))switch(je.localName){case"numFmt":Te.nummeringFormat=Re.attr(je,"val");break;case"footnote":case"endnote":Te.defaultNoteIds.push(Re.attr(je,"id"));break}return Te}class SettingsPart extends Part{constructor(Re,Te){super(Re,Te)}parseXml(Re){this.settings=parseSettings(Re,this._package.xmlParser)}}function parseCustomProps(Ee,Re){return Re.elements(Ee,"property").map(Te=>{const je=Te.firstChild;return{formatId:Re.attr(Te,"fmtid"),name:Re.attr(Te,"name"),type:je.nodeName,value:je.textContent}})}class CustomPropsPart extends Part{parseXml(Re){this.props=parseCustomProps(Re,this._package.xmlParser)}}class CommentsPart extends Part{constructor(Re,Te,je){super(Re,Te),this._documentParser=je}parseXml(Re){this.comments=this._documentParser.parseComments(Re),this.commentMap=keyBy(this.comments,Te=>Te.id)}}class CommentsExtendedPart extends Part{constructor(Re,Te){super(Re,Te),this.comments=[]}parseXml(Re){const Te=this._package.xmlParser;for(let je of Te.elements(Re,"commentEx"))this.comments.push({paraId:Te.attr(je,"paraId"),paraIdParent:Te.attr(je,"paraIdParent"),done:Te.boolAttr(je,"done")});this.commentMap=keyBy(this.comments,je=>je.paraId)}}const topLevelRels=[{type:RelationshipTypes.OfficeDocument,target:"word/document.xml"},{type:RelationshipTypes.ExtendedProperties,target:"docProps/app.xml"},{type:RelationshipTypes.CoreProperties,target:"docProps/core.xml"},{type:RelationshipTypes.CustomProperties,target:"docProps/custom.xml"}];class WordDocument{constructor(){this.parts=[],this.partsMap={}}static async load(Re,Te,je){var Oe=new WordDocument;return Oe._options=je,Oe._parser=Te,Oe._package=await OpenXmlPackage.load(Re,je),Oe.rels=await Oe._package.loadRelationships(),await Promise.all(topLevelRels.map(Me=>{const De=Oe.rels.find($e=>$e.type===Me.type)??Me;return Oe.loadRelationshipPart(De.target,De.type)})),Oe}save(Re="blob"){return this._package.save(Re)}async loadRelationshipPart(Re,Te){var Oe;if(this.partsMap[Re])return this.partsMap[Re];if(!this._package.get(Re))return null;let je=null;switch(Te){case RelationshipTypes.OfficeDocument:this.documentPart=je=new DocumentPart(this._package,Re,this._parser);break;case RelationshipTypes.FontTable:this.fontTablePart=je=new FontTablePart(this._package,Re);break;case RelationshipTypes.Numbering:this.numberingPart=je=new NumberingPart(this._package,Re,this._parser);break;case RelationshipTypes.Styles:this.stylesPart=je=new StylesPart(this._package,Re,this._parser);break;case RelationshipTypes.Theme:this.themePart=je=new ThemePart(this._package,Re);break;case RelationshipTypes.Footnotes:this.footnotesPart=je=new FootnotesPart(this._package,Re,this._parser);break;case RelationshipTypes.Endnotes:this.endnotesPart=je=new EndnotesPart(this._package,Re,this._parser);break;case RelationshipTypes.Footer:je=new FooterPart(this._package,Re,this._parser);break;case RelationshipTypes.Header:je=new HeaderPart(this._package,Re,this._parser);break;case RelationshipTypes.CoreProperties:this.corePropsPart=je=new CorePropsPart(this._package,Re);break;case RelationshipTypes.ExtendedProperties:this.extendedPropsPart=je=new ExtendedPropsPart(this._package,Re);break;case RelationshipTypes.CustomProperties:je=new CustomPropsPart(this._package,Re);break;case RelationshipTypes.Settings:this.settingsPart=je=new SettingsPart(this._package,Re);break;case RelationshipTypes.Comments:this.commentsPart=je=new CommentsPart(this._package,Re,this._parser);break;case RelationshipTypes.CommentsExtended:this.commentsExtendedPart=je=new CommentsExtendedPart(this._package,Re);break}if(je==null)return Promise.resolve(null);if(this.partsMap[Re]=je,this.parts.push(je),await je.load(),((Oe=je.rels)==null?void 0:Oe.length)>0){const[Me]=splitPath(je.path);await Promise.all(je.rels.map(De=>this.loadRelationshipPart(resolvePath(De.target,Me),De.type)))}return je}async loadDocumentImage(Re,Te){const je=await this.loadResource(Te??this.documentPart,Re,"blob");return this.blobToURL(je)}async loadNumberingImage(Re){const Te=await this.loadResource(this.numberingPart,Re,"blob");return this.blobToURL(Te)}async loadFont(Re,Te){const je=await this.loadResource(this.fontTablePart,Re,"uint8array");return je&&this.blobToURL(new Blob([deobfuscate(je,Te)]))}async loadAltChunk(Re,Te){return await this.loadResource(Te??this.documentPart,Re,"string")}blobToURL(Re){return Re?this._options.useBase64URL?blobToBase64(Re):URL.createObjectURL(Re):null}findPartByRelId(Re,Te=null){var je=(Te.rels??this.rels).find(Me=>Me.id==Re);const Oe=Te?splitPath(Te.path)[0]:"";return je?this.partsMap[resolvePath(je.target,Oe)]:null}getPathById(Re,Te){const je=Re.rels.find(Me=>Me.id==Te),[Oe]=splitPath(Re.path);return je?resolvePath(je.target,Oe):null}loadResource(Re,Te,je){const Oe=this.getPathById(Re,Te);return Oe?this._package.load(Oe,je):Promise.resolve(null)}}function deobfuscate(Ee,Re){const je=Re.replace(/{|}|-/g,""),Oe=new Array(16);for(let Me=0;Me<16;Me++)Oe[16-Me-1]=parseInt(je.substring(Me*2,Me*2+2),16);for(let Me=0;Me<32;Me++)Ee[Me]=Ee[Me]^Oe[Me%16];return Ee}function parseBookmarkStart(Ee,Re){return{type:DomType.BookmarkStart,id:Re.attr(Ee,"id"),name:Re.attr(Ee,"name"),colFirst:Re.intAttr(Ee,"colFirst"),colLast:Re.intAttr(Ee,"colLast")}}function parseBookmarkEnd(Ee,Re){return{type:DomType.BookmarkEnd,id:Re.attr(Ee,"id")}}class VmlElement extends OpenXmlElementBase{constructor(){super(...arguments),this.type=DomType.VmlElement,this.attrs={}}}function parseVmlElement(Ee,Re){var Te=new VmlElement;
vendor: 8,443 bytes, line 4009
4009switch(Ee.localName){case"rect":Te.tagName="rect",Object.assign(Te.attrs,{width:"100%",height:"100%"});break;case"oval":Te.tagName="ellipse",Object.assign(Te.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":Te.tagName="line";break;case"shape":Te.tagName="g";break;case"textbox":Te.tagName="foreignObject",Object.assign(Te.attrs,{width:"100%",height:"100%"});break;default:return null}for(const je of globalXmlParser.attrs(Ee))switch(je.localName){case"style":Te.cssStyleText=je.value;break;case"fillcolor":Te.attrs.fill=je.value;break;case"from":const[Oe,Me]=parsePoint(je.value);Object.assign(Te.attrs,{x1:Oe,y1:Me});break;case"to":const[De,$e]=parsePoint(je.value);Object.assign(Te.attrs,{x2:De,y2:$e});break}for(const je of globalXmlParser.elements(Ee))switch(je.localName){case"stroke":Object.assign(Te.attrs,parseStroke(je));break;case"fill":Object.assign(Te.attrs,parseFill());break;case"imagedata":Te.tagName="image",Object.assign(Te.attrs,{width:"100%",height:"100%"}),Te.imageHref={id:globalXmlParser.attr(je,"id"),title:globalXmlParser.attr(je,"title")};break;case"txbxContent":Te.children.push(...Re.parseBodyElements(je));break;default:const Oe=parseVmlElement(je,Re);Oe&&Te.children.push(Oe);break}return Te}function parseStroke(Ee){return{stroke:globalXmlParser.attr(Ee,"color"),"stroke-width":globalXmlParser.lengthAttr(Ee,"weight",LengthUsage.Emu)??"1px"}}function parseFill(Ee){return{}}function parsePoint(Ee){return Ee.split(",")}class WmlComment extends OpenXmlElementBase{constructor(){super(...arguments),this.type=DomType.Comment}}class WmlCommentReference extends OpenXmlElementBase{constructor(Re){super(),this.id=Re,this.type=DomType.CommentReference}}class WmlCommentRangeStart extends OpenXmlElementBase{constructor(Re){super(),this.id=Re,this.type=DomType.CommentRangeStart}}class WmlCommentRangeEnd extends OpenXmlElementBase{constructor(Re){super(),this.id=Re,this.type=DomType.CommentRangeEnd}}var autos={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};const supportedNamespaceURIs=[],mmlTagMap={oMath:DomType.MmlMath,oMathPara:DomType.MmlMathParagraph,f:DomType.MmlFraction,func:DomType.MmlFunction,fName:DomType.MmlFunctionName,num:DomType.MmlNumerator,den:DomType.MmlDenominator,rad:DomType.MmlRadical,deg:DomType.MmlDegree,e:DomType.MmlBase,sSup:DomType.MmlSuperscript,sSub:DomType.MmlSubscript,sPre:DomType.MmlPreSubSuper,sup:DomType.MmlSuperArgument,sub:DomType.MmlSubArgument,d:DomType.MmlDelimiter,nary:DomType.MmlNary,eqArr:DomType.MmlEquationArray,lim:DomType.MmlLimit,limLow:DomType.MmlLimitLower,m:DomType.MmlMatrix,mr:DomType.MmlMatrixRow,box:DomType.MmlBox,bar:DomType.MmlBar,groupChr:DomType.MmlGroupChar};class DocumentParser{constructor(Re){this.options={ignoreWidth:!1,debug:!1,...Re}}parseNotes(Re,Te,je){var Oe=[];for(let Me of globalXmlParser.elements(Re,Te)){const De=new je;De.id=globalXmlParser.attr(Me,"id"),De.noteType=globalXmlParser.attr(Me,"type"),De.children=this.parseBodyElements(Me),Oe.push(De)}return Oe}parseComments(Re){var Te=[];for(let je of globalXmlParser.elements(Re,"comment")){const Oe=new WmlComment;Oe.id=globalXmlParser.attr(je,"id"),Oe.author=globalXmlParser.attr(je,"author"),Oe.initials=globalXmlParser.attr(je,"initials"),Oe.date=globalXmlParser.attr(je,"date"),Oe.children=this.parseBodyElements(je),Te.push(Oe)}return Te}parseDocumentFile(Re){var Te=globalXmlParser.element(Re,"body"),je=globalXmlParser.element(Re,"background"),Oe=globalXmlParser.element(Te,"sectPr");return{type:DomType.Document,children:this.parseBodyElements(Te),props:Oe?parseSectionProperties(Oe,globalXmlParser):{},cssStyle:je?this.parseBackground(je):{}}}parseBackground(Re){var Te={},je=xmlUtil.colorAttr(Re,"color");return je&&(Te["background-color"]=je),Te}parseBodyElements(Re){var Te=[];for(const je of globalXmlParser.elements(Re))switch(je.localName){case"p":Te.push(this.parseParagraph(je));break;case"altChunk":Te.push(this.parseAltChunk(je));break;case"tbl":Te.push(this.parseTable(je));break;case"sdt":Te.push(...this.parseSdt(je,Oe=>this.parseBodyElements(Oe)));break}return Te}parseStylesFile(Re){var Te=[];for(const je of globalXmlParser.elements(Re))switch(je.localName){case"style":Te.push(this.parseStyle(je));break;case"docDefaults":Te.push(this.parseDefaultStyles(je));break}return Te}parseDefaultStyles(Re){var Te={id:null,name:null,target:null,basedOn:null,styles:[]};for(const Me of globalXmlParser.elements(Re))switch(Me.localName){case"rPrDefault":var je=globalXmlParser.element(Me,"rPr");je&&Te.styles.push({target:"span",values:this.parseDefaultProperties(je,{})});break;case"pPrDefault":var Oe=globalXmlParser.element(Me,"pPr");Oe&&Te.styles.push({target:"p",values:this.parseDefaultProperties(Oe,{})});break}return Te}parseStyle(Re){var Te={id:globalXmlParser.attr(Re,"styleId"),isDefault:globalXmlParser.boolAttr(Re,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(globalXmlParser.attr(Re,"type")){case"paragraph":Te.target="p";break;case"table":Te.target="table";break;case"character":Te.target="span";break}for(const je of globalXmlParser.elements(Re))switch(je.localName){case"basedOn":Te.basedOn=globalXmlParser.attr(je,"val");break;case"name":Te.name=globalXmlParser.attr(je,"val");break;case"link":Te.linked=globalXmlParser.attr(je,"val");break;case"next":Te.next=globalXmlParser.attr(je,"val");break;case"aliases":Te.aliases=globalXmlParser.attr(je,"val").split(",");break;case"pPr":Te.styles.push({target:"p",values:this.parseDefaultProperties(je,{})}),Te.paragraphProps=parseParagraphProperties(je,globalXmlParser);break;case"rPr":Te.styles.push({target:"span",values:this.parseDefaultProperties(je,{})}),Te.runProps=parseRunProperties(je,globalXmlParser);break;case"tblPr":case"tcPr":Te.styles.push({target:"td",values:this.parseDefaultProperties(je,{})});break;case"tblStylePr":for(let Oe of this.parseTableStyle(je))Te.styles.push(Oe);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${je.localName}`)}return Te}parseTableStyle(Re){var Te=[],je=globalXmlParser.attr(Re,"type"),Oe="",Me="";switch(je){case"firstRow":Me=".first-row",Oe="tr.first-row td";break;case"lastRow":Me=".last-row",Oe="tr.last-row td";break;case"firstCol":Me=".first-col",Oe="td.first-col";break;case"lastCol":Me=".last-col",Oe="td.last-col";break;case"band1Vert":Me=":not(.no-vband)",Oe="td.odd-col";break;case"band2Vert":Me=":not(.no-vband)",Oe="td.even-col";break;case"band1Horz":Me=":not(.no-hband)",Oe="tr.odd-row";break;case"band2Horz":Me=":not(.no-hband)",Oe="tr.even-row";break;default:return[]}for(const De of globalXmlParser.elements(Re))switch(De.localName){case"pPr":Te.push({target:`${Oe} p`,mod:Me,values:this.parseDefaultProperties(De,{})});break;case"rPr":Te.push({target:`${Oe} span`,mod:Me,values:this.parseDefaultProperties(De,{})});break;case"tblPr":case"tcPr":Te.push({target:Oe,mod:Me,values:this.parseDefaultProperties(De,{})});break}return Te}parseNumberingFile(Re){var Te=[],je={},Oe=[];for(const $e of globalXmlParser.elements(Re))switch($e.localName){case"abstractNum":this.parseAbstractNumbering($e,Oe).forEach(Be=>Te.push(Be));break;case"numPicBullet":Oe.push(this.parseNumberingPicBullet($e));break;case"num":var Me=globalXmlParser.attr($e,"numId"),De=globalXmlParser.elementAttr($e,"abstractNumId","val");je[De]=Me;break}return Te.forEach($e=>$e.id=je[$e.id]),Te}parseNumberingPicBullet(Re){var Te=globalXmlParser.element(Re,"pict"),je=Te&&globalXmlParser.element(Te,"shape"),Oe=je&&globalXmlParser.element(je,"imagedata");return Oe?{id:globalXmlParser.intAttr(Re,"numPicBulletId"),src:globalXmlParser.attr(Oe,"id"),style:globalXmlParser.attr(je,"style")}:null}parseAbstractNumbering(Re,Te){var je=[],Oe=globalXmlParser.attr(Re,"abstractNumId");for(const Me of globalXmlParser.elements(Re))switch(Me.localName){case"lvl":je.push(this.parseNumberingLevel(Oe,Me,Te));break}return je}parseNumberingLevel(Re,Te,je){var Oe={id:Re,level:globalXmlParser.intAttr(Te,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(const De of globalXmlParser.elements(Te))switch(De.localName){case"start":Oe.start=globalXmlParser.intAttr(De,"val");break;case"pPr":this.parseDefaultProperties(De,Oe.pStyle);break;case"rPr":this.parseDefaultProperties(De,Oe.rStyle);break;case"lvlPicBulletId":var Me=globalXmlParser.intAttr(De,"val");
4009Oe.bullet=je.find($e=>($e==null?void 0:$e.id)==Me);break;case"lvlText":Oe.levelText=globalXmlParser.attr(De,"val");break;case"pStyle":Oe.pStyleName=globalXmlParser.attr(De,"val");break;case"numFmt":Oe.format=globalXmlParser.attr(De,"val");break;case"suff":Oe.suff=globalXmlParser.attr(De,"val");break}return Oe}parseSdt(Re,Te){const je=globalXmlParser.element(Re,"sdtContent");return je?Te(je):[]}parseInserted(Re,Te){var je;return{type:DomType.Inserted,children:((je=Te(Re))==null?void 0:je.children)??[]}}parseDeleted(Re,Te){var je;return{type:DomType.Deleted,children:((je=Te(Re))==null?void 0:je.children)??[]}}parseAltChunk(Re){return{type:DomType.AltChunk,children:[],id:globalXmlParser.attr(Re,"id")}}parseParagraph(Re){var Te={type:DomType.Paragraph,children:[]};for(let je of globalXmlParser.elements(Re))switch(je.localName){case"pPr":this.parseParagraphProperties(je,Te);break;case"r":Te.children.push(this.parseRun(je,Te));break;case"hyperlink":Te.children.push(this.parseHyperlink(je,Te));break;case"smartTag":Te.children.push(this.parseSmartTag(je,Te));break;case"bookmarkStart":Te.children.push(parseBookmarkStart(je,globalXmlParser));break;case"bookmarkEnd":Te.children.push(parseBookmarkEnd(je,globalXmlParser));break;case"commentRangeStart":Te.children.push(new WmlCommentRangeStart(globalXmlParser.attr(je,"id")));break;case"commentRangeEnd":Te.children.push(new WmlCommentRangeEnd(globalXmlParser.attr(je,"id")));break;case"oMath":case"oMathPara":Te.children.push(this.parseMathElement(je));break;case"sdt":Te.children.push(...this.parseSdt(je,Oe=>this.parseParagraph(Oe).children));break;case"ins":Te.children.push(this.parseInserted(je,Oe=>this.parseParagraph(Oe)));break;case"del":Te.children.push(this.parseDeleted(je,Oe=>this.parseParagraph(Oe)));break}return Te}parseParagraphProperties(Re,Te){this.parseDefaultProperties(Re,Te.cssStyle={},null,je=>{if(parseParagraphProperty(je,Te,globalXmlParser))return!0;switch(je.localName){case"pStyle":Te.styleName=globalXmlParser.attr(je,"val");break;case"cnfStyle":Te.className=values.classNameOfCnfStyle(je);break;case"framePr":this.parseFrame(je,Te);break;case"rPr":break;default:return!1}return!0})}parseFrame(Re,Te){var je=globalXmlParser.attr(Re,"dropCap");je=="drop"&&(Te.cssStyle.float="left")}parseHyperlink(Re,Te){var je={type:DomType.Hyperlink,parent:Te,children:[]};je.anchor=globalXmlParser.attr(Re,"anchor"),je.id=globalXmlParser.attr(Re,"id");for(const Oe of globalXmlParser.elements(Re))switch(Oe.localName){case"r":je.children.push(this.parseRun(Oe,je));break}return je}parseSmartTag(Re,Te){var je={type:DomType.SmartTag,parent:Te,children:[]},Oe=globalXmlParser.attr(Re,"uri"),Me=globalXmlParser.attr(Re,"element");Oe&&(je.uri=Oe),Me&&(je.element=Me);for(const De of globalXmlParser.elements(Re))switch(De.localName){case"r":je.children.push(this.parseRun(De,je));break}return je}parseRun(Re,Te){var je={type:DomType.Run,parent:Te,children:[]};for(let Oe of globalXmlParser.elements(Re))switch(Oe=this.checkAlternateContent(Oe),Oe.localName){case"t":je.children.push({type:DomType.Text,text:Oe.textContent});break;case"delText":je.children.push({type:DomType.DeletedText,text:Oe.textContent});break;case"commentReference":je.children.push(new WmlCommentReference(globalXmlParser.attr(Oe,"id")));break;case"fldSimple":je.children.push({type:DomType.SimpleField,instruction:globalXmlParser.attr(Oe,"instr"),lock:globalXmlParser.boolAttr(Oe,"lock",!1),dirty:globalXmlParser.boolAttr(Oe,"dirty",!1)});break;case"instrText":je.fieldRun=!0,je.children.push({type:DomType.Instruction,text:Oe.textContent});break;case"fldChar":je.fieldRun=!0,je.children.push({type:DomType.ComplexField,charType:globalXmlParser.attr(Oe,"fldCharType"),lock:globalXmlParser.boolAttr(Oe,"lock",!1),dirty:globalXmlParser.boolAttr(Oe,"dirty",!1)});break;case"noBreakHyphen":je.children.push({type:DomType.NoBreakHyphen});break;case"br":je.children.push({type:DomType.Break,break:globalXmlParser.attr(Oe,"type")||"textWrapping"});break;case"lastRenderedPageBreak":je.children.push({type:DomType.Break,break:"lastRenderedPageBreak"});break;case"sym":je.children.push({type:DomType.Symbol,font:encloseFontFamily(globalXmlParser.attr(Oe,"font")),char:globalXmlParser.attr(Oe,"char")});break;case"tab":je.children.push({type:DomType.Tab});break;case"footnoteReference":je.children.push({type:DomType.FootnoteReference,id:globalXmlParser.attr(Oe,"id")});break;case"endnoteReference":je.children.push({type:DomType.EndnoteReference,id:globalXmlParser.attr(Oe,"id")});break;case"drawing":let Me=this.parseDrawing(Oe);Me&&(je.children=[Me]);break;case"pict":je.children.push(this.parseVmlPicture(Oe));break;case"rPr":this.parseRunProperties(Oe,je);break}return je}parseMathElement(Re){const Te=`${Re.localName}Pr`,je={type:mmlTagMap[Re.localName],children:[]};for(const Me of globalXmlParser.elements(Re))if(mmlTagMap[Me.localName])je.children.push(this.parseMathElement(Me));else if(Me.localName=="r"){var Oe=this.parseRun(Me);Oe.type=DomType.MmlRun,je.children.push(Oe)}else Me.localName==Te&&(je.props=this.parseMathProperies(Me));return je}parseMathProperies(Re){const Te={};for(const je of globalXmlParser.elements(Re))switch(je.localName){case"chr":Te.char=globalXmlParser.attr(je,"val");break;case"vertJc":Te.verticalJustification=globalXmlParser.attr(je,"val");break;case"pos":Te.position=globalXmlParser.attr(je,"val");break;case"degHide":Te.hideDegree=globalXmlParser.boolAttr(je,"val");break;case"begChr":Te.beginChar=globalXmlParser.attr(je,"val");break;case"endChr":Te.endChar=globalXmlParser.attr(je,"val");break}return Te}parseRunProperties(Re,Te){this.parseDefaultProperties(Re,Te.cssStyle={}
4009,null,je=>{switch(je.localName){case"rStyle":Te.styleName=globalXmlParser.attr(je,"val");break;case"vertAlign":Te.verticalAlign=values.valueOfVertAlign(je,!0);break;default:return!1}return!0})}parseVmlPicture(Re){const Te={type:DomType.VmlPicture,children:[]};for(const je of globalXmlParser.elements(Re)){const Oe=parseVmlElement(je,this);Oe&&Te.children.push(Oe)}return Te}checkAlternateContent(Re){var Me;if(Re.localName!="AlternateContent")return Re;var Te=globalXmlParser.element(Re,"Choice");if(Te){var je=globalXmlParser.attr(Te,"Requires"),Oe=Re.lookupNamespaceURI(je);if(supportedNamespaceURIs.includes(Oe))return Te.firstElementChild}return(Me=globalXmlParser.element(Re,"Fallback"))==null?void 0:Me.firstElementChild}parseDrawing(Re){for(var Te of globalXmlParser.elements(Re))switch(Te.localName){case"inline":case"anchor":return this.parseDrawingWrapper(Te)}}parseDrawingWrapper(Re){var Te={type:DomType.Drawing,children:[],cssStyle:{}},je=Re.localName=="anchor";let Oe=null,Me=globalXmlParser.boolAttr(Re,"simplePos");globalXmlParser.boolAttr(Re,"behindDoc");let De={relative:"page",align:"left",offset:"0"},$e={relative:"page",align:"top",offset:"0"};for(var Be of globalXmlParser.elements(Re))switch(Be.localName){case"simplePos":Me&&(De.offset=globalXmlParser.lengthAttr(Be,"x",LengthUsage.Emu),$e.offset=globalXmlParser.lengthAttr(Be,"y",LengthUsage.Emu));break;case"extent":Te.cssStyle.width=globalXmlParser.lengthAttr(Be,"cx",LengthUsage.Emu),Te.cssStyle.height=globalXmlParser.lengthAttr(Be,"cy",LengthUsage.Emu);break;case"positionH":case"positionV":if(!Me){let Xe=Be.localName=="positionH"?De:$e;var Ue=globalXmlParser.element(Be,"align"),ze=globalXmlParser.element(Be,"posOffset");Xe.relative=globalXmlParser.attr(Be,"relativeFrom")??Xe.relative,Ue&&(Xe.align=Ue.textContent),ze&&(Xe.offset=convertLength(ze.textContent,LengthUsage.Emu))}break;case"wrapTopAndBottom":Oe="wrapTopAndBottom";break;case"wrapNone":Oe="wrapNone";break;case"graphic":var We=this.parseGraphic(Be);We&&Te.children.push(We);break}return Oe=="wrapTopAndBottom"?(Te.cssStyle.display="block",De.align&&(Te.cssStyle["text-align"]=De.align,Te.cssStyle.width="100%")):Oe=="wrapNone"?(Te.cssStyle.display="block",Te.cssStyle.position="relative",Te.cssStyle.width="0px",Te.cssStyle.height="0px",De.offset&&(Te.cssStyle.left=De.offset),$e.offset&&(Te.cssStyle.top=$e.offset)):je&&(De.align=="left"||De.align=="right")&&(Te.cssStyle.float=De.align),Te}parseGraphic(Re){var Te=globalXmlParser.element(Re,"graphicData");for(let je of globalXmlParser.elements(Te))switch(je.localName){case"pic":return this.parsePicture(je)}return null}parsePicture(Re){var Te={type:DomType.Image,src:"",cssStyle:{}},je=globalXmlParser.element(Re,"blipFill"),Oe=globalXmlParser.element(je,"blip"),Me=globalXmlParser.element(je,"srcRect");Te.src=globalXmlParser.attr(Oe,"embed"),Me&&(Te.srcRect=[globalXmlParser.intAttr(Me,"l",0)/1e5,globalXmlParser.intAttr(Me,"t",0)/1e5,globalXmlParser.intAttr(Me,"r",0)/1e5,globalXmlParser.intAttr(Me,"b",0)/1e5]);var De=globalXmlParser.element(Re,"spPr"),$e=globalXmlParser.element(De,"xfrm");if(Te.cssStyle.position="relative",$e){Te.rotation=globalXmlParser.intAttr($e,"rot",0)/6e4;for(var Be of globalXmlParser.elements($e))switch(Be.localName){case"ext":Te.cssStyle.width=globalXmlParser.lengthAttr(Be,"cx",LengthUsage.Emu),Te.cssStyle.height=globalXmlParser.lengthAttr(Be,"cy",LengthUsage.Emu);break;case"off":Te.cssStyle.left=globalXmlParser.lengthAttr(Be,"x",LengthUsage.Emu),Te.cssStyle.top=globalXmlParser.lengthAttr(Be,"y",LengthUsage.Emu);break}}return Te}parseTable(Re){var Te={type:DomType.Table,children:[]};for(const je of globalXmlParser.elements(Re))switch(je.localName){case"tr":Te.children.push(this.parseTableRow(je));break;case"tblGrid":Te.columns=this.parseTableColumns(je);break;case"tblPr":this.parseTableProperties(je,Te);break}return Te}parseTableColumns(Re){var Te=[];for(const je of globalXmlParser.elements(Re))switch(je.localName){case"gridCol":Te.push({width:globalXmlParser.lengthAttr(je,"w")});break}return Te}parseTableProperties(Re,Te){switch(Te.cssStyle={},Te.cellStyle={},this.parseDefaultProperties(Re,Te.cssStyle,Te.cellStyle,je=>{switch(je.localName){case"tblStyle":Te.styleName=globalXmlParser.attr(je,"val");break;case"tblLook":Te.className=values.classNameOftblLook(je);break;case"tblpPr":this.parseTablePosition(je,Te);break;case"tblStyleColBandSize":Te.colBandSize=globalXmlParser.intAttr(je,"val");break;case"tblStyleRowBandSize":Te.rowBandSize=globalXmlParser.intAttr(je,"val");break;case"hidden":Te.cssStyle.display="none";break;default:return!1}return!0}),Te.cssStyle["text-align"]){case"center":delete Te.cssStyle["text-align"],Te.cssStyle["margin-left"]="auto",Te.cssStyle["margin-right"]="auto";break;case"right":delete Te.cssStyle["text-align"],Te.cssStyle["margin-left"]="auto";break}}parseTablePosition(Re,Te){var je=globalXmlParser.lengthAttr(Re,"topFromText"),Oe=globalXmlParser.lengthAttr(Re,"bottomFromText"),Me=globalXmlParser.lengthAttr(Re,"rightFromText"),De=globalXmlParser.lengthAttr(Re,"leftFromText");Te.cssStyle.float="left",Te.cssStyle["margin-bottom"]=values.addSize(Te.cssStyle["margin-bottom"],Oe),Te.cssStyle["margin-left"]=values.addSize(Te.cssStyle["margin-left"],De),Te.cssStyle["margin-right"]=values.addSize(Te.cssStyle["margin-right"],Me),Te.cssStyle["margin-top"]=values.addSize(Te.cssStyle["margin-top"],je)}parseTableRow(Re){var Te={type:DomType.Row,children:[]};for(const je of globalXmlParser.elements(Re))switch(je.localName){case"tc":Te.children.push(this.parseTableCell(je));break;case"trPr":case"tblPrEx":this.parseTableRowProperties(je,Te);break}return Te}parseTableRowProperties(Re,Te){Te.cssStyle=this.parseDefaultProperties(Re,{},null,je=>{switch(je.localName){case"cnfStyle":Te.className=values.classNameOfCnfStyle(je);break;case"tblHeader":Te.isHeader=globalXmlParser.boolAttr(je,"val");break;case"gridBefore":Te.gridBefore=globalXmlParser.intAttr(je,"val");break;case"gridAfter":Te.gridAfter=globalXmlParser.intAttr(je,"val");break;default:return!1}return!0})}parseTableCell(Re){var Te={type:DomType.Cell,children:[]};for(const je of globalXmlParser.elements(Re))switch(je.localName){case"tbl":Te.children.push(this.parseTable(je));break;case"p":Te.children.push(this.parseParagraph(je));break;case"tcPr":this.parseTableCellProperties(je,Te);break}return Te}parseTableCellProperties(Re,Te){Te.cssStyle=this.parseDefaultProperties(Re,{},null,je=>{switch(je.localName){case"gridSpan":Te.span=globalXmlParser.intAttr(je,"val",null);break;case"vMerge":Te.verticalMerge=globalXmlParser.attr(je,"val")??"continue";break;case"cnfStyle":Te.className=values.classNameOfCnfStyle(je);break;default:return!1}return!0}),this.parseTableCellVerticalText(Re,Te)}parseTableCellVerticalText(Re,Te){const je={btLr:{writingMode:"vertical-rl",transform:"rotate(180deg)"},lrTb:{writingMode:"vertical-lr",transform:"none"},tbRl:{writingMode:"vertical-rl",transform:"none"}};for(const Oe of globalXmlParser.elements(Re))if(Oe.localName==="textDirection"){const Me=globalXmlParser.attr(Oe,"val"),De=je[Me]||{writingMode:"horizontal-tb"};Te.cssStyle["writing-mode"]=De.writingMode,Te.cssStyle.transform=De.transform}}parseDefaultProperties(Re,Te=null,je=null,Oe=null){Te=Te||{};for(const Me of globalXmlParser.elements(Re))if(!(Oe!=null&&Oe(Me)))switch(Me.localName){case"jc":Te["text-align"]=values.valueOfJc(Me);break;case"textAlignment":Te["vertical-align"]=values.valueOfTextAlignment(Me);break;case"color":Te.color=xmlUtil.colorAttr(Me,"val",null,autos.color);break;case"sz":Te["font-size"]=Te["min-height"]=globalXmlParser.lengthAttr(Me,"val",LengthUsage.FontSize);break;case"shd":Te["background-color"]=xmlUtil.colorAttr(Me,"fill",null,autos.shd);break;case"highlight":Te["background-color"]=xmlUtil.colorAttr(Me,"val",null,autos.highlight);break;case"vertAlign":break;case"position":Te.verticalAlign=globalXmlParser.lengthAttr(Me,"val",LengthUsage.FontSize);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":Te.width=values.valueOfSize(Me,"w");break;case"trHeight":this.parseTrHeight(Me,Te);break;case"strike":Te["text-decoration"]=globalXmlParser.boolAttr(Me,"val",!0)?"line-through":"none";break;case"b":Te["font-weight"]=globalXmlParser.boolAttr(Me,"val",!0)?"bold":"normal";break;case"i":Te["font-style"]=globalXmlParser.boolAttr(Me,"val",!0)?"italic":"normal";break;case"caps":Te["text-transform"]=globalXmlParser.boolAttr(Me,"val",!0)?"uppercase":"none";break;case"smallCaps":Te["font-variant"]=globalXmlParser.boolAttr(Me,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(Me,Te);break;case"ind":case"tblInd":this.parseIndentation(Me,Te);break;case"rFonts":this.parseFont(Me,Te);break;case"tblBorders":this.parseBorderProperties(Me,je||Te);break;case"tblCellSpacing":Te["border-spacing"]=values.valueOfMargin(Me),Te["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(Me,Te);break;case"bdr":Te.border=values.valueOfBorder(Me);break;case"tcBorders":this.parseBorderProperties(Me,Te);break;case"vanish":globalXmlParser.boolAttr(Me,"val",!0)&&(Te.display="none");break;case"kern":break;case"noWrap":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(Me,je||Te);break;case"tblLayout":Te["table-layout"]=values.valueOfTblLayout(Me);break;case"vAlign":Te["vertical-align"]=values.valueOfTextAlignment(Me);break;case"spacing":Re.localName=="pPr"&&this.parseSpacing(Me,Te);break;case"wordWrap":globalXmlParser.boolAttr(Me,"val")&&(Te["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":Te.hyphens=globalXmlParser.boolAttr(Me,"val",!0)?"none":"auto";break;case"lang":Te.$lang=globalXmlParser.attr(Me,"val");break;case"rtl":case"bidi":globalXmlParser.boolAttr(Me,"val",!0)&&(Te.direction="rtl");break;case"bCs":case"iCs":case"szCs":case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"webHidden":case"pageBreakBefore":case"suppressLineNumbers":case"keepLines":case"keepNext":case"widowControl":case"bidi":case"rtl":case"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${Re.localName}.${Me.localName}`);break}return Te}parseUnderline(Re,Te){var je=globalXmlParser.attr(Re,"val");if(je!=null){switch(je){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":Te["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":Te["text-decoration"]="underline dotted";break;case"double":Te["text-decoration"]="underline double";break;case"single":case"thick":Te["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":Te["text-decoration"]="underline wavy";break;case"words":Te["text-decoration"]="underline";break;case"none":Te["text-decoration"]="none";break}var Oe=xmlUtil.colorAttr(Re,"color");Oe&&(Te["text-decoration-color"]=Oe)}}parseFont(Re,Te){var je=globalXmlParser.attr(Re,"ascii"),Oe=values.themeValue(Re,"asciiTheme"),Me=globalXmlParser.attr(Re,"eastAsia"),De=[je,Oe,Me].filter($e=>$e).map($e=>encloseFontFamily($e));De.length>0&&(Te["font-family"]=[...new Set(De)].join(", "))}parseIndentation(Re,Te){var je=globalXmlParser.lengthAttr(Re,"firstLine"),Oe=globalXmlParser.lengthAttr(Re,"hanging"),Me=globalXmlParser.lengthAttr(Re,"left"),De=globalXmlParser.lengthAttr(Re,"start"),$e=globalXmlParser.lengthAttr(Re,"right"),Be=globalXmlParser.lengthAttr(Re,"end");je&&(Te["text-indent"]=je),Oe&&(Te["text-indent"]=`-${Oe}`),(Me||De)&&(Te["margin-inline-start"]=Me||De),($e||Be)&&(Te["margin-inline-end"]=$e||Be)}parseSpacing(Re,Te){var je=globalXmlParser.lengthAttr(Re,"before"),Oe=globalXmlParser.lengthAttr(Re,"after"),Me=globalXmlParser.intAttr(Re,"line",null),De=globalXmlParser.attr(Re,"lineRule");if(je&&(Te["margin-top"]=je),Oe&&(Te["margin-bottom"]=Oe),Me!==null)switch(De){case"auto":Te["line-height"]=`${(Me/240).toFixed(2)}`;break;case"atLeast":Te["line-height"]=`calc(100% + ${Me/20}pt)`;break;default:Te["line-height"]=Te["min-height"]=`${Me/20}pt`;break}}parseMarginProperties(Re,Te){for(const je of globalXmlParser.elements(Re))switch(je.localName){case"left":Te["padding-left"]=values.valueOfMargin(je);break;case"right":Te["padding-right"]=values.valueOfMargin(je);break;case"top":Te["padding-top"]=values.valueOfMargin(je);break;case"bottom":Te["padding-bottom"]=values.valueOfMargin(je);break}}parseTrHeight(Re,Te){switch(globalXmlParser.attr(Re,"hRule")){case"exact":Te.height=globalXmlParser.lengthAttr(Re,"val");break;case"atLeast":default:Te.height=globalXmlParser.lengthAttr(Re,"val");break}}parseBorderProperties(Re,Te){for(const je of globalXmlParser.elements(Re))switch(je.localName){case"start":case"left":Te["border-left"]=values.valueOfBorder(je);break;case"end":case"right":Te["border-right"]=values.valueOfBorder(je);break;case"top":Te["border-top"]=values.valueOfBorder(je);break;case"bottom":Te["border-bottom"]=values.valueOfBorder(je);break}}}const knownColors=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class xmlUtil{static colorAttr(Re,Te,je=null,Oe="black"){var Me=globalXmlParser.attr(Re,Te);if(Me)return Me=="auto"?Oe:knownColors.includes(Me)?Me:`#${Me}`;var De=globalXmlParser.attr(Re,"themeColor");return De?`var(--docx-${De}-color)`:je}}class values{static themeValue(Re,Te){var je=globalXmlParser.attr(Re,Te);return je?`var(--docx-${je}-font)`:null}static valueOfSize(Re,Te){var je=LengthUsage.Dxa;switch(globalXmlParser.attr(Re,"type")){case"dxa":break;case"pct":je=LengthUsage.Percent;break;case"auto":return"auto"}return globalXmlParser.lengthAttr(Re,Te,je)}static valueOfMargin(Re){return globalXmlParser.lengthAttr(Re,"w")}static valueOfBorder(Re){var Te=values.parseBorderType(globalXmlParser.attr(Re,"val"));if(Te=="none")return"none";var je=xmlUtil.colorAttr(Re,"color"),Oe=globalXmlParser.lengthAttr(Re,"sz",LengthUsage.Border);return`${Oe} ${Te} ${je=="auto"?autos.borderColor:je}`}static parseBorderType(Re){switch(Re){case"single":return"solid";case"dashDotStroked":return"solid";case"dashed":return"dashed";case"dashSmallGap":return"dashed";case"dotDash":return"dotted";case"dotDotDash":return"dotted";case"dotted":return"dotted";case"double":return"double";case"doubleWave":return"double";case"inset":return"inset";case"nil":return"none";case"none":return"none";case"outset":return"outset";case"thick":return"solid";case"thickThinLargeGap":return"solid";case"thickThinMediumGap":return"solid";case"thickThinSmallGap":return"solid";case"thinThickLargeGap":return"solid";case"thinThickMediumGap":return"solid";case"thinThickSmallGap":return"solid";case"thinThickThinLargeGap":return"solid";case"thinThickThinMediumGap":return"solid";case"thinThickThinSmallGap":return"solid";case"threeDEmboss":return"solid";case"threeDEngrave":return"solid";case"triple":return"double";case"wave":return"solid"}return"solid"}static valueOfTblLayout(Re){var Te=globalXmlParser.attr(Re,"val");return Te=="fixed"?"fixed":"auto"}static classNameOfCnfStyle(Re){const Te=globalXmlParser.attr(Re,"val");return["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"].filter((Oe,Me)=>Te[Me]=="1").join(" ")}static valueOfJc(Re){var Te=globalXmlParser.attr(Re,"val");switch(Te){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return Te}static valueOfVertAlign(Re,Te=!1){var je=globalXmlParser.attr(Re,"val");switch(je){case"subscript":return"sub";case"superscript":return Te?"sup":"super"}return Te?null:je}static valueOfTextAlignment(Re){var Te=globalXmlParser.attr(Re,"val");switch(Te){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return Te}static addSize(Re,Te){return Re==null?Te:Te==null?Re:`calc(${Re} + ${Te})`}static classNameOftblLook(Re){const Te=globalXmlParser.hexAttr(Re,"val",0);let je="";return(globalXmlParser.boolAttr(Re,"firstRow")||Te&32)&&(je+=" first-row"),(globalXmlParser.boolAttr(Re,"lastRow")||Te&64)&&(je+=" last-row"),(globalXmlParser.boolAttr(Re,"firstColumn")||Te&128)&&(je+=" first-col"),(globalXmlParser.boolAttr(Re,"lastColumn")||Te&256)&&(je+=" last-col"),(globalXmlParser.boolAttr(Re,"noHBand")||Te&512
4009)&&(je+=" no-hband"),(globalXmlParser.boolAttr(Re,"noVBand")||Te&1024)&&(je+=" no-vband"),je.trim()}}const defaultTab={pos:0,leader:"none",style:"left"},maxTabs=50;function computePixelToPoint(Ee=document.body){const Re=document.createElement("div");Re.style.width="100pt",Ee.appendChild(Re);const Te=100/Re.offsetWidth;return Ee.removeChild(Re),Te}function updateTabStop(Ee,Re,Te,je=72/96){const Oe=Ee.closest("p"),Me=Ee.getBoundingClientRect(),De=Oe.getBoundingClientRect(),$e=getComputedStyle(Oe),Be=(Re==null?void 0:Re.length)>0?Re.map(Ke=>({pos:lengthToPoint(Ke.position),leader:Ke.leader,style:Ke.style})).sort((Ke,Qe)=>Ke.pos-Qe.pos):[defaultTab],Ue=Be[Be.length-1],ze=De.width*je,We=lengthToPoint(Te);let Xe=Ue.pos+We;if(Xe<ze)for(;Xe<ze&&Be.length<maxTabs;Xe+=We)Be.push({...defaultTab,pos:Xe});const He=parseFloat($e.marginLeft),qe=De.left+He,Ge=(Me.left-qe)*je,Ye=Be.find(Ke=>Ke.style!="clear"&&Ke.pos>Ge);if(Ye==null)return;let Ve=1;if(Ye.style=="right"||Ye.style=="center"){const Ke=Array.from(Oe.querySelectorAll(`.${Ee.className}`)),Qe=Ke.indexOf(Ee)+1,Ze=document.createRange();Ze.setStart(Ee,1),Qe<Ke.length?Ze.setEndBefore(Ke[Qe]):Ze.setEndAfter(Oe);const Je=Ye.style=="center"?.5:1,ir=Ze.getBoundingClientRect(),rr=ir.left+Je*ir.width-(De.left-He);Ve=Ye.pos-rr*je}else Ve=Ye.pos-Ge;switch(Ee.innerHTML=" ",Ee.style.textDecoration="inherit",Ee.style.wordSpacing=`${Ve.toFixed(0)}pt`,Ye.leader){case"dot":case"middleDot":Ee.style.textDecoration="underline",Ee.style.textDecorationStyle="dotted";break;case"hyphen":case"heavy":case"underscore":Ee.style.textDecoration="underline";break}}function lengthToPoint(Ee){return parseFloat(Ee)}const ns={svg:"http://www.w3.org/2000/svg",mathML:"http://www.w3.org/1998/Math/MathML"};class HtmlRenderer{constructor(Re){this.htmlDocument=Re,this.className="docx",this.styleMap={},this.currentPart=null,this.tableVerticalMerges=[],this.currentVerticalMerge=null,this.tableCellPositions=[],this.currentCellPosition=null,this.footnoteMap={},this.endnoteMap={},this.currentEndnoteIds=[],this.usedHederFooterParts=[],this.currentTabs=[],this.commentMap={},this.tasks=[],this.postRenderTasks=[]}async render(Re,Te,je=null,Oe){var De;this.document=Re,this.options=Oe,this.className=Oe.className,this.rootSelector=Oe.inWrapper?`.${this.className}-wrapper`:":root",this.styleMap=null,this.tasks=[],this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight),je=je||Te,removeAllElements(je),removeAllElements(Te),je.appendChild(this.createComment("docxjs library predefined styles")),je.appendChild(this.renderDefaultStyle()),Re.themePart&&(je.appendChild(this.createComment("docxjs document theme values")),this.renderTheme(Re.themePart,je)),Re.stylesPart!=null&&(this.styleMap=this.processStyles(Re.stylesPart.styles),je.appendChild(this.createComment("docxjs document styles")),je.appendChild(this.renderStyles(Re.stylesPart.styles))),Re.numberingPart&&(this.prodessNumberings(Re.numberingPart.domNumberings),je.appendChild(this.createComment("docxjs document numbering styles")),je.appendChild(this.renderNumbering(Re.numberingPart.domNumberings,je))),Re.footnotesPart&&(this.footnoteMap=keyBy(Re.footnotesPart.notes,$e=>$e.id)),Re.endnotesPart&&(this.endnoteMap=keyBy(Re.endnotesPart.notes,$e=>$e.id)),Re.settingsPart&&(this.defaultTabSize=(De=Re.settingsPart.settings)==null?void 0:De.defaultTabStop),!Oe.ignoreFonts&&Re.fontTablePart&&this.renderFontTable(Re.fontTablePart,je);var Me=this.renderSections(Re.documentPart.body);this.options.inWrapper?Te.appendChild(this.renderWrapper(Me)):appendChildren(Te,Me),this.commentHighlight&&Oe.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.postRenderTasks.forEach($e=>$e()),await Promise.allSettled(this.tasks),this.refreshTabStops()}renderTheme(Re,Te){var $e,Be;const je={},Oe=($e=Re.theme)==null?void 0:$e.fontScheme;Oe&&(Oe.majorFont&&(je["--docx-majorHAnsi-font"]=Oe.majorFont.latinTypeface),Oe.minorFont&&(je["--docx-minorHAnsi-font"]=Oe.minorFont.latinTypeface));const Me=(Be=Re.theme)==null?void 0:Be.colorScheme;if(Me)for(let[Ue,ze]of Object.entries(Me.colors))je[`--docx-${Ue}-color`]=`#${ze}`;const De=this.styleToString(`.${this.className}`,je);Te.appendChild(this.createStyleElement(De))}renderFontTable(Re,Te){for(let je of Re.fonts)for(let Oe of je.embedFontRefs)this.tasks.push(this.document.loadFont(Oe.id,Oe.key).then(Me=>{const De={"font-family":encloseFontFamily(je.name),src:`url(${Me})`};(Oe.type=="bold"||Oe.type=="boldItalic")&&(De["font-weight"]="bold"),(Oe.type=="italic"||Oe.type=="boldItalic")&&(De["font-style"]="italic");const $e=this.styleToString("@font-face",De);Te.appendChild(this.createComment(`docxjs ${je.name} font`)),Te.appendChild(this.createStyleElement($e))}))}processStyleName(Re){return Re?`${this.className}_${escapeClassName(Re)}`:this.className}processStyles(Re){const Te=keyBy(Re.filter(Oe=>Oe.id!=null),Oe=>Oe.id);for(const Oe of Re.filter(Me=>Me.basedOn)){var je=Te[Oe.basedOn];if(je){Oe.paragraphProps=mergeDeep(Oe.paragraphProps,je.paragraphProps),Oe.runProps=mergeDeep(Oe.runProps,je.runProps);for(const Me of je.styles){const De=Oe.styles.find($e=>$e.target==Me.target);De?this.copyStyleProperties(Me.values,De.values):Oe.styles.push({...Me,values:{...Me.values}})}}else this.options.debug&&console.warn(`Can't find base style ${Oe.basedOn}`)}for(let Oe of Re)Oe.cssName=this.processStyleName(Oe.id);return Te}prodessNumberings(Re){var Te;
4009for(let je of Re.filter(Oe=>Oe.pStyleName)){const Oe=this.findStyle(je.pStyleName);(Te=Oe==null?void 0:Oe.paragraphProps)!=null&&Te.numbering&&(Oe.paragraphProps.numbering.level=je.level)}}processElement(Re){if(Re.children)for(var Te of Re.children)Te.parent=Re,Te.type==DomType.Table?this.processTable(Te):this.processElement(Te)}processTable(Re){for(var Te of Re.children)for(var je of Te.children)je.cssStyle=this.copyStyleProperties(Re.cellStyle,je.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(je)}copyStyleProperties(Re,Te,je=null){if(!Re)return Te;Te==null&&(Te={}),je==null&&(je=Object.getOwnPropertyNames(Re));for(var Oe of je)Re.hasOwnProperty(Oe)&&!Te.hasOwnProperty(Oe)&&(Te[Oe]=Re[Oe]);return Te}createPageElement(Re,Te){var je=this.createElement("section",{className:Re});return Te&&(Te.pageMargins&&(je.style.paddingLeft=Te.pageMargins.left,je.style.paddingRight=Te.pageMargins.right,je.style.paddingTop=Te.pageMargins.top,je.style.paddingBottom=Te.pageMargins.bottom),Te.pageSize&&(this.options.ignoreWidth||(je.style.width=Te.pageSize.width),this.options.ignoreHeight||(je.style.minHeight=Te.pageSize.height))),je}createSectionContent(Re){var Te=this.createElement("article");return Re.columns&&Re.columns.numberOfColumns&&(Te.style.columnCount=`${Re.columns.numberOfColumns}`,Te.style.columnGap=Re.columns.space,Re.columns.separator&&(Te.style.columnRule="1px solid black")),Te}renderSections(Re){const Te=[];this.processElement(Re);const je=this.splitBySection(Re.children,Re.props),Oe=this.groupByPageBreaks(je);let Me=null;for(let $e=0,Be=Oe.length;$e<Be;$e++){this.currentFootnoteIds=[];let ze=Oe[$e][0].sectProps;const We=this.createPageElement(this.className,ze);this.renderStyleValues(Re.cssStyle,We),this.options.renderHeaders&&this.renderHeaderFooter(ze.headerRefs,ze,Te.length,Me!=ze,We);for(const Xe of Oe[$e]){var De=this.createSectionContent(Xe.sectProps);this.renderElements(Xe.elements,De),We.appendChild(De),ze=Xe.sectProps}this.options.renderFootnotes&&this.renderNotes(this.currentFootnoteIds,this.footnoteMap,We),this.options.renderEndnotes&&$e==Be-1&&this.renderNotes(this.currentEndnoteIds,this.endnoteMap,We),this.options.renderFooters&&this.renderHeaderFooter(ze.footerRefs,ze,Te.length,Me!=ze,We),Te.push(We),Me=ze}return Te}renderHeaderFooter(Re,Te,je,Oe,Me){if(Re){var De=(Te.titlePage&&Oe?Re.find(Be=>Be.type=="first"):null)??(je%2==1?Re.find(Be=>Be.type=="even"):null)??Re.find(Be=>Be.type=="default"),$e=De&&this.document.findPartByRelId(De.id,this.document.documentPart);if($e){this.currentPart=$e,this.usedHederFooterParts.includes($e.path)||(this.processElement($e.rootElement),this.usedHederFooterParts.push($e.path));const[Be]=this.renderElements([$e.rootElement],Me);Te!=null&&Te.pageMargins&&($e.rootElement.type===DomType.Header?(Be.style.marginTop=`calc(${Te.pageMargins.header} - ${Te.pageMargins.top})`,Be.style.minHeight=`calc(${Te.pageMargins.top} - ${Te.pageMargins.header})`):$e.rootElement.type===DomType.Footer&&(Be.style.marginBottom=`calc(${Te.pageMargins.footer} - ${Te.pageMargins.bottom})`,Be.style.minHeight=`calc(${Te.pageMargins.bottom} - ${Te.pageMargins.footer})`)),this.currentPart=null}}}isPageBreakElement(Re){return Re.type!=DomType.Break?!1:Re.break=="lastRenderedPageBreak"?!this.options.ignoreLastRenderedPageBreak:Re.break=="page"}isPageBreakSection(Re,Te){var je,Oe,Me,De,$e,Be;return!Re||!Te?!1:((je=Re.pageSize)==null?void 0:je.orientation)!=((Oe=Te.pageSize)==null?void 0:Oe.orientation)||((Me=Re.pageSize)==null?void 0:Me.width)!=((De=Te.pageSize)==null?void 0:De.width)||(($e=Re.pageSize)==null?void 0:$e.height)!=((Be=Te.pageSize)==null?void 0:Be.height)}splitBySection(Re,Te){var We;var je={sectProps:null,elements:[],pageBreak:!1},Oe=[je];for(let Xe of Re){if(Xe.type==DomType.Paragraph){const He=this.findStyle(Xe.styleName);(We=He==null?void 0:He.paragraphProps)!=null&&We.pageBreakBefore&&(je.sectProps=Me,je.pageBreak=!0,je={sectProps:null,elements:[],pageBreak:!1},Oe.push(je))}if(je.elements.push(Xe),Xe.type==DomType.Paragraph){const He=Xe;var Me=He.sectionProps,De=-1,$e=-1;if(this.options.breakPages&&He.children&&(De=He.children.findIndex(qe=>{var Ge;return $e=((Ge=qe.children)==null?void 0:Ge.findIndex(this.isPageBreakElement.bind(this)))??-1,$e!=-1})),(Me||De!=-1)&&(je.sectProps=Me,je.pageBreak=De!=-1,je={sectProps:null,elements:[],pageBreak:!1},Oe.push(je)),De!=-1){let qe=He.children[De],Ge=$e<qe.children.length-1;if(De<He.children.length-1||Ge){var Be=Xe.children,Ue={...Xe,children:Be.slice(De)};if(Xe.children=Be.slice(0,De),je.elements.push(Ue),Ge){let Ye=qe.children,Ve={...qe,children:Ye.slice(0,$e)};Xe.children.push(Ve),qe.children=Ye.slice($e)}}}}}let ze=null;for(let Xe=Oe.length-1;Xe>=0;Xe--)Oe[Xe].sectProps==null?Oe[Xe].sectProps=ze??Te:ze=Oe[Xe].sectProps;return Oe}groupByPageBreaks(Re){let Te=[],je;const Oe=[Te];for(let Me of Re)Te.push(Me),(this.options.ignoreLastRenderedPageBreak||Me.pageBreak||this.isPageBreakSection(je,Me.sectProps))&&Oe.push(Te=[]),je=Me.sectProps;return Oe.filter(Me=>Me.length>0)}renderWrapper(Re){return this.createElement("div",{className:`${this.className}-wrapper`},Re)}renderDefaultStyle(){var Re=this.className,Te=` 4010.${Re}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; } 4011.${Re}-wrapper>section.${Re} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; }`;this.options.hideWrapperOnPrint&&(Te=`@media not print { ${Te} }`);var je=`${Te} 4012.${Re} { color: black; hyphens: auto; text-underline-position: from-font; } 4013section.${Re} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; } 4014section.${Re}>article { margin-bottom: auto; z-index: 1; } 4015section.${Re}>footer { z-index: 1; } 4016.${Re} table { border-collapse: collapse; } 4017.${Re} table td, .${Re} table th { vertical-align: top; } 4018.${Re} p { margin: 0pt; min-height: 1em; } 4019.${Re} span { white-space: pre-wrap; overflow-wrap: break-word; } 4020.${Re} a { color: inherit; text-decoration: inherit; } 4021.${Re} svg { fill: transparent; } 4022`;return this.options.renderComments&&(je+=` 4023.${Re}-comment-ref { cursor: default; } 4024.${Re}-comment-popover { display: none; z-index: 1000; padding: 0.5rem; background: white; position: absolute; box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.25); width: 30ch; } 4025.${Re}-comment-ref:hover~.${Re}-comment-popover { display: block; } 4026.${Re}-comment-author,.${Re}-comment-date { font-size: 0.875rem; color: #888; } 4027`),this.createStyleElement(je)}renderNumbering(Re,Te){var je="",Oe=[];for(var Me of Re){var De=`p.${this.numberingClass(Me.id,Me.level)}`,$e="none";if(Me.bullet){let Be=`--${this.className}-${Me.bullet.src}`.toLowerCase();je+=this.styleToString(`${De}:before`,{content:"' '",display:"inline-block",background:`var(${Be})`},Me.bullet.style),this.tasks.push(this.document.loadNumberingImage(Me.bullet.src).then(Ue=>{var ze=`${this.rootSelector} { ${Be}: url(${Ue}) }`;Te.appendChild(this.createStyleElement(ze))}))}else if(Me.levelText){let Be=this.numberingCounter(Me.id,Me.level);const Ue=Be+" "+(Me.start-1);Me.level>0&&(je+=this.styleToString(`p.${this.numberingClass(Me.id,Me.level-1)}`,{"counter-set":Ue})),Oe.push(Ue),je+=this.styleToString(`${De}:before`,{content:this.levelTextToContent(Me.levelText,Me.suff,Me.id,this.numFormatToCssValue(Me.format)),"counter-increment":Be,...Me.rStyle})}else $e=this.numFormatToCssValue(Me.format);je+=this.styleToString(De,{display:"list-item","list-style-position":"inside","list-style-type":$e,...Me.pStyle})}return Oe.length>0&&(je+=this.styleToString(this.rootSelector,{"counter-reset":Oe.join(" ")})),this.createStyleElement(je)}renderStyles(Re){var Te="";const je=this.styleMap,Oe=keyBy(Re.filter(Be=>Be.isDefault),Be=>Be.target);for(const Be of Re){var Me=Be.styles;if(Be.linked){var De=Be.linked&&je[Be.linked];De?Me=Me.concat(De.styles):this.options.debug&&console.warn(`Can't find linked style ${Be.linked}`)}for(const Ue of Me){var $e=`${Be.target??""}.${Be.cssName}`;Be.target!=Ue.target&&($e+=` ${Ue.target}`),Oe[Be.target]==Be&&($e=`.${this.className} ${Be.target}, `+$e),Te+=this.styleToString($e,Ue.values)}}return this.createStyleElement(Te)}renderNotes(Re,Te,je){var Oe=Re.map(De=>Te[De]).filter(De=>De);
4027if(Oe.length>0){var Me=this.createElement("ol",null,this.renderElements(Oe));je.appendChild(Me)}}renderElement(Re){switch(Re.type){case DomType.Paragraph:return this.renderParagraph(Re);case DomType.BookmarkStart:return this.renderBookmarkStart(Re);case DomType.BookmarkEnd:return null;case DomType.Run:return this.renderRun(Re);case DomType.Table:return this.renderTable(Re);case DomType.Row:return this.renderTableRow(Re);case DomType.Cell:return this.renderTableCell(Re);case DomType.Hyperlink:return this.renderHyperlink(Re);case DomType.SmartTag:return this.renderSmartTag(Re);case DomType.Drawing:return this.renderDrawing(Re);case DomType.Image:return this.renderImage(Re);case DomType.Text:return this.renderText(Re);case DomType.Text:return this.renderText(Re);case DomType.DeletedText:return this.renderDeletedText(Re);case DomType.Tab:return this.renderTab(Re);case DomType.Symbol:return this.renderSymbol(Re);case DomType.Break:return this.renderBreak(Re);case DomType.Footer:return this.renderContainer(Re,"footer");case DomType.Header:return this.renderContainer(Re,"header");case DomType.Footnote:case DomType.Endnote:return this.renderContainer(Re,"li");case DomType.FootnoteReference:return this.renderFootnoteReference(Re);case DomType.EndnoteReference:return this.renderEndnoteReference(Re);case DomType.NoBreakHyphen:return this.createElement("wbr");case DomType.VmlPicture:return this.renderVmlPicture(Re);case DomType.VmlElement:return this.renderVmlElement(Re);case DomType.MmlMath:return this.renderContainerNS(Re,ns.mathML,"math",{xmlns:ns.mathML});case DomType.MmlMathParagraph:return this.renderContainer(Re,"span");case DomType.MmlFraction:return this.renderContainerNS(Re,ns.mathML,"mfrac");case DomType.MmlBase:return this.renderContainerNS(Re,ns.mathML,Re.parent.type==DomType.MmlMatrixRow?"mtd":"mrow");case DomType.MmlNumerator:case DomType.MmlDenominator:case DomType.MmlFunction:case DomType.MmlLimit:case DomType.MmlBox:return this.renderContainerNS(Re,ns.mathML,"mrow");case DomType.MmlGroupChar:return this.renderMmlGroupChar(Re);case DomType.MmlLimitLower:return this.renderContainerNS(Re,ns.mathML,"munder");case DomType.MmlMatrix:return this.renderContainerNS(Re,ns.mathML,"mtable");case DomType.MmlMatrixRow:return this.renderContainerNS(Re,ns.mathML,"mtr");case DomType.MmlRadical:return this.renderMmlRadical(Re);case DomType.MmlSuperscript:return this.renderContainerNS(Re,ns.mathML,"msup");case DomType.MmlSubscript:return this.renderContainerNS(Re,ns.mathML,"msub");case DomType.MmlDegree:case DomType.MmlSuperArgument:case DomType.MmlSubArgument:return this.renderContainerNS(Re,ns.mathML,"mn");case DomType.MmlFunctionName:return this.renderContainerNS(Re,ns.mathML,"ms");case DomType.MmlDelimiter:return this.renderMmlDelimiter(Re);case DomType.MmlRun:return this.renderMmlRun(Re);case DomType.MmlNary:return this.renderMmlNary(Re);case DomType.MmlPreSubSuper:return this.renderMmlPreSubSuper(Re);case DomType.MmlBar:return this.renderMmlBar(Re);case DomType.MmlEquationArray:return this.renderMllList(Re);case DomType.Inserted:return this.renderInserted(Re);case DomType.Deleted:return this.renderDeleted(Re);case DomType.CommentRangeStart:return this.renderCommentRangeStart(Re);case DomType.CommentRangeEnd:return this.renderCommentRangeEnd(Re);case DomType.CommentReference:return this.renderCommentReference(Re);case DomType.AltChunk:return this.renderAltChunk(Re)}return null}renderElements(Re,Te){if(Re==null)return null;var je=Re.flatMap(Oe=>this.renderElement(Oe)).filter(Oe=>Oe!=null);return Te&&appendChildren(Te,je),je}renderContainer(Re,Te,je){return this.createElement(Te,je,this.renderElements(Re.children))}renderContainerNS(Re,Te,je,Oe){return this.createElementNS(Te,je,Oe,this.renderElements(Re.children))}renderParagraph(Re){var Me,De;var Te=this.renderContainer(Re,"p");const je=this.findStyle(Re.styleName);Re.tabs??(Re.tabs=(Me=je==null?void 0:je.paragraphProps)==null?void 0:Me.tabs),this.renderClass(Re,Te),this.renderStyleValues(Re.cssStyle,Te),this.renderCommonProperties(Te.style,Re);const Oe=Re.numbering??((De=je==null?void 0:je.paragraphProps)==null?void 0:De.numbering);return Oe&&Te.classList.add(this.numberingClass(Oe.id,Oe.level)),Te}renderRunProperties(Re,Te){this.renderCommonProperties(Re,Te)}renderCommonProperties(Re,Te){Te!=null&&(Te.color&&(Re.color=Te.color),Te.fontSize&&(Re["font-size"]=Te.fontSize))}renderHyperlink(Re){var Te=this.renderContainer(Re,"a");this.renderStyleValues(Re.cssStyle,Te);let je="";if(Re.id){const Oe=this.document.documentPart.rels.find(Me=>Me.id==Re.id&&Me.targetMode==="External");je=(Oe==null?void 0:Oe.target)??je}return Re.anchor&&(je+=`#${Re.anchor}`),Te.href=je,Te}renderSmartTag(Re){return this.renderContainer(Re,"span")}renderCommentRangeStart(Re){var Oe;if(!this.options.renderComments)return null;const Te=new Range;(Oe=this.commentHighlight)==null||Oe.add(Te);const je=this.createComment(`start of comment #${Re.id}`);return this.later(()=>Te.setStart(je,0)),this.commentMap[Re.id]=Te,je}renderCommentRangeEnd(Re){if(!this.options.renderComments)return null;const Te=this.commentMap[Re.id],je=this.createComment(`end of comment #${Re.id}`);return this.later(()=>Te==null?void 0:Te.setEnd(je,0)),je}renderCommentReference(Re){var De;if(!this.options.renderComments)return null;var Te=(De=this.document.commentsPart)==null?void 0:De.commentMap[Re.id];if(!Te)return null;const je=new DocumentFragment,Oe=this.createElement("span",{className:`${this.className}-comment-ref`},["ð¬"]),Me=this.createElement("div",{className:`${this.className}-comment-popover`});return this.renderCommentContent(Te,Me),je.appendChild(this.createComment(`comment #${Te.id} by ${Te.author} on ${Te.date}`)),je.appendChild(Oe),je.appendChild(Me),je}renderAltChunk(Re){if(!this.options.renderAltChunks)return null;var Te=this.createElement("iframe");return this.tasks.push(this.document.loadAltChunk(Re.id,this.currentPart).then(je=>{Te.srcdoc=je})),Te}renderCommentContent(Re,Te){Te.appendChild(this.createElement("div",{className:`${this.className}-comment-author`},[Re.author])),Te.appendChild(this.createElement("div",{className:`${this.className}-comment-date`}
4027,[new Date(Re.date).toLocaleString()])),this.renderElements(Re.children,Te)}renderDrawing(Re){var Te=this.renderContainer(Re,"div");return Te.style.display="inline-block",Te.style.position="relative",Te.style.textIndent="0px",this.renderStyleValues(Re.cssStyle,Te),Te}renderImage(Re){var Be;let Te=this.createElement("img"),je=(Be=Re.cssStyle)==null?void 0:Be.transform;if(this.renderStyleValues(Re.cssStyle,Te),Re.srcRect&&Re.srcRect.some(Ue=>Ue!=0)){var[Oe,Me,De,$e]=Re.srcRect;je=`scale(${1/(1-Oe-De)}, ${1/(1-Me-$e)})`,Te.style["clip-path"]=`rect(${(100*Me).toFixed(2)}% ${(100*(1-De)).toFixed(2)}% ${(100*(1-$e)).toFixed(2)}% ${(100*Oe).toFixed(2)}%)`}return Re.rotation&&(je=`rotate(${Re.rotation}deg) ${je??""}`),Te.style.transform=je==null?void 0:je.trim(),this.document&&this.tasks.push(this.document.loadDocumentImage(Re.src,this.currentPart).then(Ue=>{Te.src=Ue})),Te}renderText(Re){return this.htmlDocument.createTextNode(Re.text)}renderDeletedText(Re){return this.options.renderChanges?this.renderText(Re):null}renderBreak(Re){return Re.break=="textWrapping"?this.createElement("br"):null}renderInserted(Re){return this.options.renderChanges?this.renderContainer(Re,"ins"):this.renderElements(Re.children)}renderDeleted(Re){return this.options.renderChanges?this.renderContainer(Re,"del"):null}renderSymbol(Re){var Te=this.createElement("span");return Te.style.fontFamily=Re.font,Te.innerHTML=`&#x${Re.char};`,Te}renderFootnoteReference(Re){var Te=this.createElement("sup");return this.currentFootnoteIds.push(Re.id),Te.textContent=`${this.currentFootnoteIds.length}`,Te}renderEndnoteReference(Re){var Te=this.createElement("sup");return this.currentEndnoteIds.push(Re.id),Te.textContent=`${this.currentEndnoteIds.length}`,Te}renderTab(Re){var Oe;var Te=this.createElement("span");if(Te.innerHTML=" ",this.options.experimental){Te.className=this.tabStopClass();var je=(Oe=findParent(Re,DomType.Paragraph))==null?void 0:Oe.tabs;this.currentTabs.push({stops:je,span:Te})}return Te}renderBookmarkStart(Re){return this.createElement("span",{id:Re.name})}renderRun(Re){if(Re.fieldRun)return null;const Te=this.createElement("span");if(Re.id&&(Te.id=Re.id),this.renderClass(Re,Te),this.renderStyleValues(Re.cssStyle,Te),Re.verticalAlign){const je=this.createElement(Re.verticalAlign);this.renderElements(Re.children,je),Te.appendChild(je)}else this.renderElements(Re.children,Te);return Te}renderTable(Re){let Te=this.createElement("table");return this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0},Re.columns&&Te.appendChild(this.renderTableColumns(Re.columns)),this.renderClass(Re,Te),this.renderElements(Re.children,Te),this.renderStyleValues(Re.cssStyle,Te),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),Te}renderTableColumns(Re){let Te=this.createElement("colgroup");for(let je of Re){let Oe=this.createElement("col");je.width&&(Oe.style.width=je.width),Te.appendChild(Oe)}return Te}renderTableRow(Re){let Te=this.createElement("tr");return this.currentCellPosition.col=0,Re.gridBefore&&Te.appendChild(this.renderTableCellPlaceholder(Re.gridBefore)),this.renderClass(Re,Te),this.renderElements(Re.children,Te),this.renderStyleValues(Re.cssStyle,Te),Re.gridAfter&&Te.appendChild(this.renderTableCellPlaceholder(Re.gridAfter)),this.currentCellPosition.row++,Te}renderTableCellPlaceholder(Re){const Te=this.createElement("td",{colSpan:Re});return Te.style.border="none",Te}renderTableCell(Re){let Te=this.renderContainer(Re,"td");const je=this.currentCellPosition.col;return Re.verticalMerge?Re.verticalMerge=="restart"?(this.currentVerticalMerge[je]=Te,Te.rowSpan=1):this.currentVerticalMerge[je]&&(this.currentVerticalMerge[je].rowSpan+=1,Te.style.display="none"):this.currentVerticalMerge[je]=null,this.renderClass(Re,Te),this.renderStyleValues(Re.cssStyle,Te),Re.span&&(Te.colSpan=Re.span),this.currentCellPosition.col+=Te.colSpan,Te}renderVmlPicture(Re){return this.renderContainer(Re,"div")}renderVmlElement(Re){var Oe,Me;var Te=this.createSvgElement("svg");Te.setAttribute("style",Re.cssStyleText);const je=this.renderVmlChildElement(Re);return(Oe=Re.imageHref)!=null&&Oe.id&&this.tasks.push((Me=this.document)==null?void 0:Me.loadDocumentImage(Re.imageHref.id,this.currentPart).then(De=>je.setAttribute("href",De))),Te.appendChild(je),requestAnimationFrame(()=>{const De=Te.firstElementChild.getBBox();Te.setAttribute("width",`${Math.ceil(De.x+De.width)}`),Te.setAttribute("height",`${Math.ceil(De.y+De.height)}`)}),Te}renderVmlChildElement(Re){const Te=this.createSvgElement(Re.tagName);
4027Object.entries(Re.attrs).forEach(([je,Oe])=>Te.setAttribute(je,Oe));for(let je of Re.children)je.type==DomType.VmlElement?Te.appendChild(this.renderVmlChildElement(je)):Te.appendChild(...asArray(this.renderElement(je)));return Te}renderMmlRadical(Re){var Oe;const Te=Re.children.find(Me=>Me.type==DomType.MmlBase);if((Oe=Re.props)!=null&&Oe.hideDegree)return this.createElementNS(ns.mathML,"msqrt",null,this.renderElements([Te]));const je=Re.children.find(Me=>Me.type==DomType.MmlDegree);return this.createElementNS(ns.mathML,"mroot",null,this.renderElements([Te,je]))}renderMmlDelimiter(Re){const Te=[];return Te.push(this.createElementNS(ns.mathML,"mo",null,[Re.props.beginChar??"("])),Te.push(...this.renderElements(Re.children)),Te.push(this.createElementNS(ns.mathML,"mo",null,[Re.props.endChar??")"])),this.createElementNS(ns.mathML,"mrow",null,Te)}renderMmlNary(Re){var Ue;const Te=[],je=keyBy(Re.children,ze=>ze.type),Oe=je[DomType.MmlSuperArgument],Me=je[DomType.MmlSubArgument],De=Oe?this.createElementNS(ns.mathML,"mo",null,asArray(this.renderElement(Oe))):null,$e=Me?this.createElementNS(ns.mathML,"mo",null,asArray(this.renderElement(Me))):null,Be=this.createElementNS(ns.mathML,"mo",null,[((Ue=Re.props)==null?void 0:Ue.char)??"â«"]);return De||$e?Te.push(this.createElementNS(ns.mathML,"munderover",null,[Be,$e,De])):De?Te.push(this.createElementNS(ns.mathML,"mover",null,[Be,De])):$e?Te.push(this.createElementNS(ns.mathML,"munder",null,[Be,$e])):Te.push(Be),Te.push(...this.renderElements(je[DomType.MmlBase].children)),this.createElementNS(ns.mathML,"mrow",null,Te)}renderMmlPreSubSuper(Re){const Te=[],je=keyBy(Re.children,Ue=>Ue.type),Oe=je[DomType.MmlSuperArgument],Me=je[DomType.MmlSubArgument],De=Oe?this.createElementNS(ns.mathML,"mo",null,asArray(this.renderElement(Oe))):null,$e=Me?this.createElementNS(ns.mathML,"mo",null,asArray(this.renderElement(Me))):null,Be=this.createElementNS(ns.mathML,"mo",null);return Te.push(this.createElementNS(ns.mathML,"msubsup",null,[Be,$e,De])),Te.push(...this.renderElements(je[DomType.MmlBase].children)),this.createElementNS(ns.mathML,"mrow",null,Te)}renderMmlGroupChar(Re){const Te=Re.props.verticalJustification==="bot"?"mover":"munder",je=this.renderContainerNS(Re,ns.mathML,Te);return Re.props.char&&je.appendChild(this.createElementNS(ns.mathML,"mo",null,[Re.props.char])),je}renderMmlBar(Re){const Te=this.renderContainerNS(Re,ns.mathML,"mrow");switch(Re.props.position){case"top":Te.style.textDecoration="overline";break;case"bottom":Te.style.textDecoration="underline";break}return Te}renderMmlRun(Re){const Te=this.createElementNS(ns.mathML,"ms",null,this.renderElements(Re.children));return this.renderClass(Re,Te),this.renderStyleValues(Re.cssStyle,Te),Te}renderMllList(Re){const Te=this.createElementNS(ns.mathML,"mtable");this.renderClass(Re,Te),this.renderStyleValues(Re.cssStyle,Te);for(let je of this.renderElements(Re.children))Te.appendChild(this.createElementNS(ns.mathML,"mtr",null,[this.createElementNS(ns.mathML,"mtd",null,[je])]));return Te}renderStyleValues(Re,Te){for(let je in Re)je.startsWith("$")?Te.setAttribute(je.slice(1),Re[je]):Te.style[je]=Re[je]}renderClass(Re,Te){Re.className&&(Te.className=Re.className),Re.styleName&&Te.classList.add(this.processStyleName(Re.styleName))}findStyle(Re){var Te;return Re&&((Te=this.styleMap)==null?void 0:Te[Re])}numberingClass(Re,Te){return`${this.className}-num-${Re}-${Te}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(Re,Te,je=null){let Oe=`${Re} {\r 4028`;for(const Me in Te)Me.startsWith("$")||(Oe+=` ${Me}: ${Te[Me]};\r 4029`);return je&&(Oe+=je),Oe+`}\r 4030`}numberingCounter(Re,Te){return`${this.className}-num-${Re}-${Te}`}levelTextToContent(Re,Te,je,Oe){const Me={tab:"\\9",space:"\\a0"};var De=Re.replace(/%\d*/g,$e=>{let Be=parseInt($e.substring(1),10)-1;return`"counter(${this.numberingCounter(je,Be)}, ${Oe})"`});return`"${De}${Me[Te]??""}"`}numFormatToCssValue(Re){var Te={none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"};return Te[Re]??Re}refreshTabStops(){this.options.experimental&&setTimeout(()=>{const Re=computePixelToPoint();for(let Te of this.currentTabs)updateTabStop(Te.span,Te.stops,this.defaultTabSize,Re)},500)}createElementNS(Re,Te,je,Oe){var Me=Re?this.htmlDocument.createElementNS(Re,Te):this.htmlDocument.createElement(Te);return Object.assign(Me,je),Oe&&appendChildren(Me,Oe),Me}createElement(Re,Te,je){return this.createElementNS(void 0,Re,Te,je)}createSvgElement(Re,Te,je){return this.createElementNS(ns.svg,Re,Te,je)}createStyleElement(Re){return this.createElement("style",{innerHTML:Re})}createComment(Re){return this.htmlDocument.createComment(Re)}later(Re){this.postRenderTasks.push(Re)}}function removeAllElements(Ee){Ee.innerHTML=""}function appendChildren(Ee,Re){Re.forEach(Te=>Ee.appendChild(isString(Te)?document.createTextNode(Te):Te))}function findParent(Ee,Re){for(var Te=Ee.parent;Te!=null&&Te.type!=Re;)Te=Te.parent;return Te}const defaultOptions={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0};function parseAsync(Ee,Re){const Te={...defaultOptions,...Re};return WordDocument.load(Ee,new DocumentParser(Te),Te)}async function renderDocument(Ee,Re,Te,je){const Oe={...defaultOptions,...je};return await new HtmlRenderer(window.document).render(Ee,Re,Te,Oe)}async function renderAsync(Ee,Re,Te,je){const Oe=await parseAsync(Ee,je);return await renderDocument(Oe,Re,Te,je),Oe}pdfjs.GlobalWorkerOptions.workerSrc=`//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.min.js`;const SOURCE_BLOCK_MARKER_REGEX=/\[Page \d+\]\s*\[Block \d+\]|\[Page \d+\]|\[Block \d+\]/g,HIGHLIGHT_SETTLE_DELAY_MS=250,HIGHLIGHT_INITIAL_DELAY_MS=700,HIGHLIGHT_FAILURE_GRACE_MS=3e3,cleanSourceBlockText=Ee=>Ee?Ee.replace(SOURCE_BLOCK_MARKER_REGEX," ").replace(/[\u2018\u2019]/g,"'").replace(/[\u201c\u201d]/g,'"').replace(/\u00a0/g," ").replace(/\n/g," ").replace(/\s+/g," ").trim():"",normalizeSearchText=Ee=>cleanSourceBlockText(Ee).toLowerCase().replace(/[^a-z0-9\s]/g," ").replace(/\s+/g," ").trim(),tokenizeNormalizedText=Ee=>
4030normalizeSearchText(Ee).split(" ").filter(Boolean),findBestTokenSequenceMatch=(Ee,Re)=>{if(Ee.length===0||Re.length===0)return null;let Te=null;for(let Oe=0;Oe<Ee.length;Oe+=1)for(let Me=0;Me<Re.length;Me+=1){if(Ee[Oe]!==Re[Me])continue;let De=0;for(;Oe+De<Ee.length&&Me+De<Re.length&&Ee[Oe+De]===Re[Me+De];)De+=1;if(De===0)continue;const $e={pageStart:Oe,pageEnd:Oe+De-1,highlightStart:Me,highlightEnd:Me+De-1,matchLength:De};(!Te||$e.matchLength>Te.matchLength||$e.matchLength===Te.matchLength&&$e.highlightStart<Te.highlightStart||$e.matchLength===Te.matchLength&&$e.highlightStart===Te.highlightStart&&$e.pageStart<Te.pageStart)&&(Te=$e)}if(!Te)return null;const je=Re.length>=4?2:Math.min(2,Re.length);return Te.matchLength<je?null:Te},clearPageHighlights=Ee=>{Ee&&Ee.querySelectorAll(".source-highlight-text").forEach(Re=>{Re.classList.remove("source-highlight-text")})},applyTextHighlight=(Ee,Re)=>{if(!Ee||!Re)return!1;const Te=Array.from(Ee.querySelectorAll(".react-pdf__Page__textContent span"));if(Te.length===0)return!1;clearPageHighlights(Ee);const je=[],Oe=[];if(Te.forEach($e=>{const Be=tokenizeNormalizedText($e.textContent||"");if(Be.length===0)return;const Ue=Oe.length;Oe.push(...Be),je.push({span:$e,start:Ue,end:Oe.length-1})}),Oe.length===0)return!1;const Me=tokenizeNormalizedText(Re),De=findBestTokenSequenceMatch(Oe,Me);return De?(je.forEach(({span:$e,start:Be,end:Ue})=>{Be<=De.pageEnd&&Ue>=De.pageStart&&$e.classList.add("source-highlight-text")}),!0):!1},normalizeRectCoordinate=Ee=>{const Re=Number(Ee);return Number.isFinite(Re)?Re>=0&&Re<=1?Re:Re>=0&&Re<=100?Re/100:null:null},normalizeHighlightRect=(Ee,Re)=>{if(!Ee||typeof Ee!="object")return null;const Te=normalizeRectCoordinate(Ee.x0??Ee.left),je=normalizeRectCoordinate(Ee.y0??Ee.top),Oe=normalizeRectCoordinate(Ee.x1??Ee.right),Me=normalizeRectCoordinate(Ee.y1??Ee.bottom);if([Te,je,Oe,Me].some($e=>$e==null)||Oe<=Te||Me<=je)return null;const De=Number(Ee.page??Ee.page_number??Ee.pageNum??Re??1);return{page:Number.isFinite(De)?De:Re||1,x0:Te,y0:je,x1:Oe,y1:Me}},getPageHighlightRects=(Ee,Re,Te)=>(Array.isArray(Ee)?Ee:[]).map(je=>normalizeHighlightRect(je,Te)).filter(je=>je&&je.page===Re),getFirstHighlightRectPage=Ee=>{if(!Array.isArray(Ee))return null;for(const Re of Ee){const Te=Number((Re==null?void 0:Re.page)??(Re==null?void 0:Re.page_number)??(Re==null?void 0:Re.pageNum));if(Number.isFinite(Te)&&Te>0)return Te}return null},DocumentPreviewModal=({document:Ee,open:Re,onClose:Te,user:je=null,subscription:Oe=null,onApprove:Me=null,onReject:De=null,highlightText:$e=null,highlightRects:Be=null,initialPage:Ue=null,onHighlightStatusChange:ze=null})=>{const[We,Xe]=reactExports.useState(!0),[He,qe]=reactExports.useState(null),[Ge,Ye]=reactExports.useState(null),[Ve,Ke]=reactExports.useState(null),[Qe,Ze]=reactExports.useState(null),[Je,ir]=reactExports.useState(1),[rr,ar]=reactExports.useState(!1),[or,pr]=reactExports.useState(""),[tr,nr]=reactExports.useState(!1),[hr,sr]=reactExports.useState(null),[xr,Rr]=reactExports.useState(0),br=reactExports.useRef([]),wr=Array.isArray(Be)?Be:Array.isArray(Ee==null?void 0:Ee.highlight_rects)?Ee.highlight_rects:Array.isArray(Ee==null?void 0:Ee.citation_rects)?Ee.citation_rects:[],vr=Ue||getFirstHighlightRectPage(wr)||null,Dr=!!$e||wr.length>0;reactExports.useEffect(()=>{Re||br.current.forEach(Mr=>clearPageHighlights(Mr))},[Re]),reactExports.useEffect(()=>{Re&&He&&Dr&&typeof ze=="function"&&ze({status:"unavailable",reason:"preview_load_error",page:vr||1})},[vr,He,Dr,ze,Re]),reactExports.useEffect(()=>{Re&&wr.length>0&&typeof ze=="function"&&ze({status:"shown",reason:"highlight_rects",page:vr||1})},[wr.length,vr,ze,Re]),reactExports.useEffect(()=>{if(!vr||!Qe)return;const Mr=Math.min(Math.max(vr-1,0),Qe-1),$r=setTimeout(()=>{var Fr;(Fr=br.current[Mr])==null||Fr.scrollIntoView({behavior:"smooth",block:"start"})},400);return()=>clearTimeout($r)},[vr,Qe]),reactExports.useEffect(()=>{if(!Re||!Qe||!$e)return;const Mr=Math.min(Math.max((vr||1)-1,0),Qe-1),$r=br.current[Mr];if(!$r)return;let Fr=null,Kr=null,an=!1,Wr=!1,hn=!1;const cn=(wn,gn=null)=>{typeof ze=="function"&&ze({status:wn,reason:gn,page:vr||1})},tn=(wn=HIGHLIGHT_SETTLE_DELAY_MS)=>{Fr&&clearTimeout(Fr),Fr=setTimeout(()=>{applyTextHighlight($r,$e)&&(an=!0,Kr&&clearTimeout(Kr),Wr||(Wr=!0,cn("shown")))},wn)};wr.length===0&&(Kr=setTimeout(()=>{!an&&!hn&&(hn=!0,cn("unavailable","text_not_found"))},HIGHLIGHT_FAILURE_GRACE_MS));const Qr=new MutationObserver(()=>{tn()});return Qr.observe($r,{childList:!0,subtree:!0,characterData:!0}
4030),tn(HIGHLIGHT_INITIAL_DELAY_MS),()=>{Fr&&clearTimeout(Fr),Kr&&clearTimeout(Kr),Qr.disconnect()}},[wr.length,vr,$e,Qe,ze,Re]);const kr=(Ee==null?void 0:Ee.id)||(Ee==null?void 0:Ee.FileID),cr=(Ee==null?void 0:Ee.displayFilename)||(Ee==null?void 0:Ee.filename)||(Ee==null?void 0:Ee.FileName)||(Ee==null?void 0:Ee.Filename)||(Ee==null?void 0:Ee.OriginalFilename)||(Ee==null?void 0:Ee.fileName)||"document",dr=(Ee==null?void 0:Ee.FileSize)||(Ee==null?void 0:Ee.fileSize)||(Ee==null?void 0:Ee.file_size)||(Ee==null?void 0:Ee.Size)||(Ee==null?void 0:Ee.size)||0,ur=((Ee==null?void 0:Ee.status)||(Ee==null?void 0:Ee.Status)||"").toLowerCase(),gr=ur==="pending",_r=30*1024,Ir=je&&Me&&canApproveDocuments(je,Ee,Oe)&&gr,Ar=je&&canViewDocument(je,Ee,Oe),Tr=je&&canDownloadDocument(je,Ee,Oe),Br=Ee!=null&&Ee.FileType?Ee.FileType.toLowerCase().replace(".",""):Ee!=null&&Ee.fileType?Ee.fileType.toLowerCase().replace(".",""):Ee!=null&&Ee.file_type?Ee.file_type.toLowerCase().replace(".",""):cr.includes(".")?cr.split(".").pop().toLowerCase():"unknown";reactExports.useEffect(()=>{if(Re&&kr){if(!Ar){qe("You do not have permission to view this document"),Xe(!1);return}Hr()}return()=>{Ve&&URL.revokeObjectURL(Ve)}},[Re,kr,Ar]);const Hr=async()=>{var Mr;Xe(!0),qe(null),Ye(null),Ke(null);try{const $r=await documentService.viewDocument(kr),Fr=await $r.arrayBuffer(),Kr=new Uint8Array(Fr.slice(0,8)),Wr=String.fromCharCode(...Kr.slice(0,5)).startsWith("%PDF-"),hn=Kr[0]===80&&Kr[1]===75;if(Wr){const cn=new Blob([Fr],{type:"application/pdf"}),tn=URL.createObjectURL(cn);Ye(cn),Ke(tn)}else if(hn&&["docx","doc"].includes(Br)){const cn=new Blob([Fr],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"});Ye(cn),Ke(URL.createObjectURL(cn))}else if(["doc","docx","xls","xlsx","ppt","pptx"].includes(Br)){const cn=URL.createObjectURL($r);Ye($r),Ke(cn)}else if(["jpg","jpeg","png","gif","bmp","webp"].includes(Br)){const cn=URL.createObjectURL($r);Ye($r),Ke(cn)}else if(["txt","md","csv","json","xml","html","css","js","py","java","cpp","c","h"].includes(Br)){const tn=new TextDecoder().decode(Fr);Ye(new Blob([tn],{type:"text/plain"})),Ke(tn)}else{const cn=URL.createObjectURL($r);Ye($r),Ke(cn)}Xe(!1)}catch($r){console.error("Document preview error:",$r);const Fr=$r.message||"",Kr=((Mr=$r.response)==null?void 0:Mr.status)===404||Fr.toLowerCase().includes("not found")||Fr.toLowerCase().includes("404");qe(Kr?"File Deleted - This document has been deleted and is no longer available.":Fr||"Failed to load document"),Xe(!1)}},Vr=()=>{if(Ve){const Mr=document.createElement("a");Mr.href=Ve,Mr.download=cr,document.body.appendChild(Mr),Mr.click(),document.body.removeChild(Mr)}},mr=async()=>{if(Me){nr(!0),sr(null);try{await Me(Ee),Te()}catch(Mr){sr(Mr.message||"Failed to approve document")}finally{nr(!1)}}},Sr=()=>{ar(!0),pr(""),sr(null)},Lr=async()=>{if(!(!De||!or.trim())){nr(!0),sr(null);try{await De(Ee,or),ar(!1),Te()}catch(Mr){sr(Mr.message||"Failed to reject document")}finally{nr(!1)}}};reactExports.useEffect(()=>{(async()=>{if(Br==="docx"&&Ge&&!We){const $r=document.getElementById("docx-preview-container");if($r)try{$r.innerHTML='<div style="padding: 20px; text-align: center; color: #6b7280;">Loading document preview...</div>';const Fr=await Ge.arrayBuffer();await renderAsync(Fr,$r,null,{className:"docx-preview-wrapper",inWrapper:!0,ignoreWidth:!1,ignoreHeight:!1,ignoreFonts:!1,breakPages:!0,ignoreLastRenderedPageBreak:!0,experimental:!1,trimXmlDeclaration:!0,useBase64URL:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0})}catch(Fr){console.error("Error rendering docx:",Fr),$r&&($r.innerHTML=` 4031 <div style="padding: 40px; text-align: center;"> 4032 <div style="color: #dc2626; margin-bottom: 16px;"> 4033 <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="margin: 0 auto;"> 4034 <circle cx="12" cy="12" r="10"/> 4035 <line x1="12" y1="8" x2="12" y2="12"/>
4036 <line x1="12" y1="16" x2="12.01" y2="16"/> 4037 </svg> 4038 </div> 4039 <p style="color: #dc2626; font-weight: 500; margin-bottom: 8px;">Unable to preview this document</p> 4040 <p style="color: #6b7280; font-size: 14px;">The file may be corrupted or in an unsupported format.</p> 4041 <p style="color: #6b7280; font-size: 14px;">Please use the Download button to view the file.</p> 4042 </div> 4043 `)}}})()},[Br,Ge,We]);const jr=({numPages:Mr})=>{Ze(Mr),Rr(0)},fr=(Mr,$r)=>{if($r===1){const Fr=prompt("Enter the password to open this PDF file:");if(Fr===null){qe("Password required to view this document"),Xe(!1);return}Mr(Fr)}else if($r===2){if(Rr(Kr=>Kr+1),xr>=2){qe("Failed to open password-protected document after multiple attempts"),Xe(!1);return}const Fr=prompt("Incorrect password. Please try again:");if(Fr===null){qe("Password required to view this document"),Xe(!1);return}Mr(Fr)}},Cr=()=>{if(We)return jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:400},children:jsxRuntimeExports.jsx(CircularProgress,{})});if(He)return jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:400},children:jsxRuntimeExports.jsx(Typography,{color:"error",children:He})});if(Br==="pdf"||Ve&&(Ge==null?void 0:Ge.type)==="application/pdf"){const Mr=cleanSourceBlockText($e)||null,$r=Math.min(window.innerWidth*.6,1e3);return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center","& .source-highlight-text":{backgroundColor:"rgba(250, 204, 21, 0.45)",boxShadow:"0 0 0 1px rgba(202, 138, 4, 0.18)",borderRadius:"2px"}},children:[Mr&&jsxRuntimeExports.jsxs(Box,{sx:{px:2,py:1.25,mb:1,bgcolor:"rgba(15, 23, 42, 0.03)",border:"1px solid",borderColor:"divider",borderRadius:2,textAlign:"left",width:"100%",maxWidth:900},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:.5},children:"Selected source block"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{lineHeight:1.6},children:Mr}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1},children:[cr,vr?` | p. ${vr}`:""]})]}),jsxRuntimeExports.jsx(Document,{file:Ve,onLoadSuccess:jr,onPassword:fr,loading:jsxRuntimeExports.jsx(CircularProgress,{}),error:jsxRuntimeExports.jsx(Typography,{color:"error",children:"Failed to load PDF"}),children:Array.from(new Array(Qe),(Fr,Kr)=>{const an=Kr+1,Wr=getPageHighlightRects(wr,an,vr||1);return jsxRuntimeExports.jsx(Box,{ref:hn=>{br.current[Kr]=hn},sx:{display:"flex",justifyContent:"center",mb:2},children:jsxRuntimeExports.jsxs(Box,{sx:{position:"relative",width:$r,lineHeight:0},children:[jsxRuntimeExports.jsx(Page,{pageNumber:an,renderTextLayer:!0,renderAnnotationLayer:!0,width:$r}),Wr.map((hn,cn)=>jsxRuntimeExports.jsx(Box,{sx:{position:"absolute",pointerEvents:"none",left:`${hn.x0*100}%`,top:`${hn.y0*100}%`,width:`${(hn.x1-hn.x0)*100}%`,height:`${(hn.y1-hn.y0)*100}%`,bgcolor:"rgba(250, 204, 21, 0.35)",boxShadow:"0 0 0 1px rgba(202, 138, 4, 0.22)",borderRadius:"2px",zIndex:3}},`rect_${an}_${cn}`))]})},`page_wrapper_${an}`)})})]})}if(Br==="docx"&&Ge)return jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",width:"100%"},children:jsxRuntimeExports.jsx(Box,{id:"docx-preview-container",sx:{p:1,bgcolor:"white",border:"1px solid",borderColor:"divider",borderRadius:1,width:"100%",maxWidth:900,"& .docx-preview-wrapper":{maxWidth:"100%"}}})});if(["jpg","jpeg","png","gif","bmp","webp"].includes(Br)&&Ve)return jsxRuntimeExports.jsx(Box,{sx:{textAlign:"center"},children:jsxRuntimeExports.jsx("img",{src:Ve,alt:cr,style:{maxWidth:"100%",height:"auto"}})});if(["txt","md","csv","json","xml","html","css","js","py","java","cpp","c","h"].includes(Br)&&typeof Ve=="string"){const Mr=typeof dr=="number"?dr:parseInt(dr,10)||0,$r=Br==="csv"&&Mr>_r;return jsxRuntimeExports.jsxs(Box,{children:[$r&&jsxRuntimeExports.jsx(Alert,{severity:"info",sx:{mb:2},children:"This CSV file is larger than 30MB. The preview below shows partial content. Please download the file to view the complete data."}),jsxRuntimeExports.jsx("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',fontSize:"13px",lineHeight:"1.6",color:"#1F2937",margin:"5px 30px",padding:"10px",backgroundColor:"#FFFFFF",borderRadius:"6px",border:"1px solid #E5E7EB"},children:Ve})]})}return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,py:4},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",color:"text.secondary",children:"Preview not available for this file type"}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:"text.secondary",children:["File type: ",Br.toUpperCase()]}),jsxRuntimeExports.jsx(Button,{variant:"contained",startIcon:jsxRuntimeExports.jsx(DownloadIcon,{}
4043),onClick:Vr,children:"Download to View"})]})};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Dialog,{open:Re&&!rr,onClose:Te,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{height:"90vh"}},children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[jsxRuntimeExports.jsxs(Box,{sx:{flex:1,mr:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",component:"div",sx:{whiteSpace:"normal",wordBreak:"break-all",overflowWrap:"break-word",maxWidth:"100%"},children:cr}),gr&&Ir&&jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"warning.main",children:"Pending Approval"}),ur==="rejected"&&(Ee==null?void 0:Ee.rejection_reason)&&jsxRuntimeExports.jsxs(Box,{sx:{mt:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"error.main",fontWeight:"bold",children:"Rejection Reason:"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:Ee==null?void 0:Ee.rejection_reason})]})]}),jsxRuntimeExports.jsx(IconButton,{onClick:Te,size:"small",children:jsxRuntimeExports.jsx(Close$1,{})})]}),jsxRuntimeExports.jsxs(DialogContent,{dividers:!0,children:[hr&&jsxRuntimeExports.jsx(Alert,{severity:"error",sx:{mb:2},onClose:()=>sr(null),children:hr}),Cr()]}),jsxRuntimeExports.jsxs(DialogActions,{sx:{justifyContent:"space-between",px:3,py:2},children:[jsxRuntimeExports.jsx(Box,{children:Br==="pdf"&&Qe&&jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:"text.secondary",children:[Qe," page",Qe>1?"s":""]})}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1},children:[Ir&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{variant:"contained",color:"success",startIcon:jsxRuntimeExports.jsx(CheckCircle,{}),onClick:mr,disabled:tr||We,children:"Approve"}),jsxRuntimeExports.jsx(Button,{variant:"contained",color:"error",startIcon:jsxRuntimeExports.jsx(CancelIcon,{}),onClick:Sr,disabled:tr||We,children:"Reject"})]}),Tr&&jsxRuntimeExports.jsx(Button,{startIcon:jsxRuntimeExports.jsx(DownloadIcon,{}),onClick:Vr,disabled:!Ve,children:"Download"}),jsxRuntimeExports.jsx(Button,{onClick:Te,children:"Close"})]})]})]}),jsxRuntimeExports.jsxs(Dialog,{open:rr,onClose:()=>ar(!1),maxWidth:"sm",fullWidth:!0,sx:{overflow:"hidden"},children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Reject Document"}),jsxRuntimeExports.jsxs(DialogContent,{sx:{overflow:"hidden"},children:[hr&&jsxRuntimeExports.jsx(Alert,{severity:"error",sx:{mb:2},children:hr}),jsxRuntimeExports.jsxs(Typography,{gutterBottom:!0,sx:{whiteSpace:"normal",wordBreak:"break-all",overflowWrap:"break-word",maxWidth:"100%"},children:['Are you sure you want to reject "',cr,'"?']}),jsxRuntimeExports.jsx(TextField,{autoFocus:!0,margin:"dense",label:"Rejection Reason",type:"text",fullWidth:!0,multiline:!0,rows:4,value:or,onChange:Mr=>pr(Mr.target.value),placeholder:"Please provide a reason for rejection...",required:!0,disabled:tr})]}),jsxRuntimeExports.jsxs(DialogActions,{sx:{overflow:"hidden"},children:[jsxRuntimeExports.jsx(Button,{onClick:()=>ar(!1),disabled:tr,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Lr,color:"error",variant:"contained",disabled:!or.trim()||tr,children:tr?"Rejecting...":"Reject"})]})]})]})},_truthyFlag=Ee=>Ee===!0||Ee===1||Ee==="true"||Ee==="t"||Ee==="1"||Ee==="True"||Ee==="TRUE",isTenantAllowedTool=Ee=>{if(!Ee)return!1;const Re=Ee.AllowedForTenants??Ee.allowed_for_tenants;return Re===!1||Re===0||Re==="false"||Re==="False"||Re==="FALSE"||Re==="f"||Re==null?!1:_truthyFlag(Re)},filterTenantAllowedTools=Ee=>(Array.isArray(Ee)?Ee:[]).map(Re=>({...Re,Id:Re.Id??Re.id,Name:Re.Name??Re.name,Description:Re.Description??Re.description,SideEffectClass:Re.SideEffectClass??Re.side_effect_class,IsEnabled:Re.IsEnabled??Re.is_enabled,AllowedForTenants:Re.AllowedForTenants??Re.allowed_for_tenants})).filter(isTenantAllowedTool),agentService={listAgents:async(Ee=!1)=>(await cachedAxios.get("/agents",{...Ee&&{cache:!1,params:{_ts:Date.now()}}})).data,getAgentSchema:async Ee=>(await cachedAxios.get(`/agents/${Ee}/schema`)).data,invokeAgent:async(Ee,Re)=>(await cachedAxios.post(`/agents/${Ee}/invoke`,{input:Re})).data,uploadTransientInput:async(Ee,Re="agent_input")=>{const Te=new FormData;return Te.append("file",Ee),Te.append("purpose",Re),(await cachedAxios.post("/agents/transient-inputs",Te,{headers:{"Content-Type":"multipart/form-data"}})).data},getInvocation:async Ee=>(await cachedAxios.get(`/agents/invocations/${Ee}`)).data,startAnalyticalReport:async Ee=>(await cachedAxios.post("/agents/analytical-report/runs",Ee)).data,cancelInvocation:async Ee=>(await cachedAxios.post(`/agents/invocations/${Ee}/cancel`)).data,getActivity:async(Ee={})=>(await cachedAxios.get("/agents/activity",{cache:!1,params:{...Ee,_ts:Date.now()}})).data,getRunningActivity:async()=>(await cachedAxios.get("/agents/activity/running",{cache:!1,params:{_ts:Date.now()}})).data,confirmInvocation:async(Ee,{action_token:Re,decision:Te})=>(await cachedAxios.post(`/agents/invocations/${Ee}/confirm`,{action_token:Re,decision:Te})).data,selectInvocationOption:async(Ee,{action_token:Re,base_document_id:Te})=>(await cachedAxios.post(`/agents/invocations/${Ee}/select`,{action_token:Re,base_document_id:Te})).data,credentials:{list:async Ee=>{const Re=Ee?{tenant_id:Ee}:{};return(await cachedAxios.get("/tenant/credentials",{params:Re})).data},create:async({tenant_id:Ee,provider:Re,label:Te,value:je,scopes:Oe})=>(await cachedAxios.post("/tenant/credentials",{tenant_id:Ee,provider:Re,label:Te,value:je,scopes:Oe})).data,delete:async(Ee,Re)=>{const Te=Re?{tenant_id:Re}:{};return(await cachedAxios.delete(`/tenant/credentials/${Ee}`,{params:Te})).data}},tenantAgents:{list:async Ee=>{const Re={...Ee?{tenant_id:Ee}:{},_ts:Date.now()};return(await cachedAxios.get("/tenant/agents",{cache:!1,params:Re})).data},get:async Ee=>(await cachedAxios.get(`/tenant/agents/${Ee}`,{cache:!1,params:{_ts:Date.now()}})).data,create:async Ee=>(await cachedAxios.post("/tenant/agents",Ee)).data,listTools:async()=>{const Re=(await cachedAxios.get("/tenant/tools",{cache:!1,params:{_ts:Date.now()}})).data||{};return{...Re,tools:filterTenantAllowedTools(Re.tools)}},dryRun:async(Ee,Re)=>(await cachedAxios.post(`/tenant/agents/${Ee}/dry-run`,Re)).data,listInvocations:async Ee=>(await cachedAxios.get(`/tenant/agents/${Ee}/invocations`)).data,listEvalCases:async Ee=>(await cachedAxios.get(`/tenant/agents/${Ee}/eval-cases`)).data,createEvalCase:async(Ee,Re)=>(await cachedAxios.post(`/tenant/agents/${Ee}/eval-cases`,Re)).data,deleteEvalCase:async Ee=>(await cachedAxios.delete(`/tenant/eval-cases/${Ee}`)).data,runEvalSuite:async Ee=>(await cachedAxios.post(`/tenant/agents/${Ee}/eval-run`)).data,getQuestionnaireOptions:async Ee=>{const Re=Ee?{tenant_id:Ee}:{};return(await cachedAxios.get("/tenant/agents/questionnaire-options",{params:Re})).data},getSireVettingConfig:async Ee=>{const Re=Ee?{tenant_id:Ee}:{};return(await cachedAxios.get("/tenant/agents/sire-vetting-response/config",{params:Re})).data},saveSireVettingConfig:async Ee=>(await cachedAxios.put("/tenant/agents/sire-vetting-response/config",Ee)).data,createSireVettingAgent:async Ee=>(await cachedAxios.post("/tenant/agents/sire-vetting-response",Ee)).data,createVendorAuditAgent:async Ee=>(await cachedAxios.post("/tenant/agents/vendor-audit-response",Ee)).data,createTitleCommitmentReviewAgent:async Ee=>(await cachedAxios.post("/tenant/agents/title-commitment-review",Ee)).data,updateAgent:async(Ee,Re)=>(await cachedAxios.patch(`/tenant/agents/${Ee}`,Re)).data,deleteAgent:async(Ee,Re)=>{const Te=Re?{tenant_id:Re}:{};return(await cachedAxios.delete(`/tenant/agents/${Ee}`,{params:Te})).data}},schedules:{list:async()=>(await cachedAxios.get("/agents/schedules",{cache:!1,params:{_ts:Date.now()}})).data,create:async({agent_id:Ee,schedule_type:Re,cron_expression:Te,label:je,fixed_input:Oe,document_ids:Me,timezone:De})=>(await cachedAxios.post("/agents/schedules",{agent_id:Ee,schedule_type:Re,cron_expression:Te,label:je,fixed_input:Oe,document_ids:Me||[],timezone:De||Intl.DateTimeFormat().resolvedOptions().timeZone})).data,update:async(Ee,Re)=>(await cachedAxios.put(`/agents/schedules/${Ee}`,Re)).data,delete:async Ee=>(await cachedAxios.delete(`/agents/schedules/${Ee}`)).data,getResult:async Ee=>(await cachedAxios.get(`/agents/schedules/${Ee}/result`,{cache:!1,params:{_ts:Date.now()}})).data},downloadArtifact:async Ee=>(await cachedAxios.get(`/agents/artifacts/${Ee}`,{responseType:"blob"})).data,superadmin:{listAgents:async()=>(await cachedAxios.get("/superadmin/agents")).data,getAgent:async Ee=>(await cachedAxios.get(`/superadmin/agents/${Ee}`)).data,createAgent:async Ee=>(await cachedAxios.post("/superadmin/agents",Ee)).data,updateAgent:async(Ee,Re)=>(await cachedAxios.put(`/superadmin/agents/${Ee}`,Re)).data,deleteAgent:async Ee=>(await cachedAxios.delete(`/superadmin/agents/${Ee}`)).data,publishAgent:async Ee=>(await cachedAxios.post(`/superadmin/agents/${Ee}/publish`)).data,unpublishAgent:async Ee=>(await cachedAxios.post(`/superadmin/agents/${Ee}/unpublish`)).data,listInvocations:async Ee=>(await cachedAxios.get(`/superadmin/agents/${Ee}/invocations`)).data,dryRun:async(Ee,Re)=>(await cachedAxios.post(`/superadmin/agents/${Ee}/dry-run`,Re)).data,listEvalCases:async Ee=>(await cachedAxios.get(`/superadmin/agents/${Ee}/eval-cases`)).data,createEvalCase:async(Ee,Re)=>(await cachedAxios.post(`/superadmin/agents/${Ee}/eval-cases`,Re)).data,updateEvalCase:async(Ee,Re)=>(await cachedAxios.put(`/superadmin/eval-cases/${Ee}`,Re)).data,deleteEvalCase:async Ee=>(await cachedAxios.delete(`/superadmin/eval-cases/${Ee}`)).data,runEvalSuite:async Ee=>(await cachedAxios.post(`/superadmin/agents/${Ee}/eval-run`)).data,listTools:async()=>(await cachedAxios.get("/superadmin/tools")).data,getQuestionnaireOptions:async Ee=>{const Re=Ee?{tenant_id:Ee}:{};return(await cachedAxios.get("/superadmin/agents/questionnaire-options",{params:Re})).data},getTool:async Ee=>(await cachedAxios.get(`/superadmin/tools/${Ee}`)).data}},resolveMarkdownHref=Ee=>{if(!Ee||typeof Ee!="string"||/^(https?:|mailto:|tel:|#)/i.test(Ee))return Ee;if(Ee.startsWith("/api")){const Re=(API_BASE_URL||"").replace(/\/$/,"");if(!Re)return Ee;const Te=Ee.replace(/^\/api(?=\/|$)/,"")||"/";return Re.endsWith("/api")?`${Re}${Te}`:`${Re}${Ee}`}return Ee},shouldOpenMarkdownLinkInNewWindow=Ee=>!!(Ee&&typeof Ee=="string"&&!Ee.startsWith("#")),MARKDOWN_API_LINK_RE=/\]\((\/api\/[^)\s]+)\)/g,rewriteApiMarkdownLinks=Ee=>!Ee||typeof Ee!="string"?Ee:Ee.replace(MARKDOWN_API_LINK_RE,(Re,Te)=>`](${resolveMarkdownHref(Te)})`),CITATION_MARKER=/\[\d+\]/g,normalizeCell=Ee=>
4043(Ee==null?"":String(Ee)).replace(CITATION_MARKER,"").replace(/\s+/g," ").trim(),extractNodeText=Ee=>Ee?Ee.type==="text"?Ee.value||"":Array.isArray(Ee.children)?Ee.children.map(extractNodeText).join(""):"":"",extractTableFromHast=Ee=>{const Re=[],Te=[];for(const je of(Ee==null?void 0:Ee.children)||[]){if(je.type!=="element")continue;const Oe=je.tagName==="thead";for(const Me of je.children||[]){if(Me.type!=="element"||Me.tagName!=="tr")continue;const De=(Me.children||[]).filter($e=>$e.type==="element").map($e=>normalizeCell(extractNodeText($e)));De.length!==0&&((Oe||!Re.length&&!Te.length)&&!Re.length?Re.push(...De):Te.push(De))}}return{headers:Re,rows:Te}},extractTableFromDbData=(Ee,Re)=>({headers:(Ee||[]).map(normalizeCell),rows:(Re||[]).map(Te=>(Ee||[]).map(je=>normalizeCell(Te==null?void 0:Te[je])))}),escapeHtml=Ee=>String(Ee).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),CELL_STYLE="border:1px solid #9aa4b2;padding:6px 10px;text-align:left;vertical-align:top;",HEADER_STYLE=`${CELL_STYLE}background-color:#eef1f5;font-weight:bold;`,toHtmlTable=({headers:Ee=[],rows:Re=[]})=>{const Te=(De,$e,Be)=>`<${$e} style="${Be}">${escapeHtml(De)||" "}</${$e}>`,je=Ee.length?`<thead><tr>${Ee.map(De=>Te(De,"th",HEADER_STYLE)).join("")}</tr></thead>`:"",Oe=Ee.length,Me=Re.length?`<tbody>${Re.map(De=>`<tr>${(Oe>De.length?[...De,...Array(Oe-De.length).fill("")]:De).map(Be=>Te(Be,"td",CELL_STYLE)).join("")}</tr>`).join("")}</tbody>`:"";return`<table border="1" cellspacing="0" cellpadding="4" style="border-collapse:collapse;font-family:Arial,Helvetica,sans-serif;font-size:13px;">${je}${Me}</table>`},escapeTsvCell=Ee=>String(Ee??"").replace(/[\t\r\n]+/g," "),toTsv=({headers:Ee=[],rows:Re=[]})=>[...Ee.length?[Ee]:[],...Re].map(Te=>Te.map(escapeTsvCell).join(" ")).join(` 4044`),escapeCsvCell=Ee=>{const Re=Ee==null?"":String(Ee);return/[",\n\r]/.test(Re)?`"${Re.replace(/"/g,'""')}"`:Re},toCsv=({headers:Ee=[],rows:Re=[]})=>[...Ee.length?[Ee]:[],...Re].map(Te=>Te.map(escapeCsvCell).join(",")).join(` 4045`),copyViaSelection=(Ee,Re)=>{if(typeof document>"u"||!document.body)return!1;const Te=document.createElement("div");Te.setAttribute("aria-hidden","true"),Te.style.position="fixed",Te.style.left="-99999px",Te.style.top="0",Te.innerHTML=Ee,document.body.appendChild(Te);const je=$e=>{$e.clipboardData&&($e.clipboardData.setData("text/html",Ee),$e.clipboardData.setData("text/plain",Re),$e.preventDefault())},Oe=typeof window<"u"?window.getSelection():null,Me=[];if(Oe)for(let $e=0;$e<Oe.rangeCount;$e+=1)Me.push(Oe.getRangeAt($e));let De=!1;try{if(Oe){const $e=document.createRange();$e.selectNodeContents(Te),Oe.removeAllRanges(),Oe.addRange($e)}document.addEventListener("copy",je),De=document.execCommand("copy")}catch{De=!1}finally{document.removeEventListener("copy",je),Oe&&(Oe.removeAllRanges(),Me.forEach($e=>Oe.addRange($e))),Te.remove()}return De},copyHtmlWithPlainText=async(Ee,Re)=>{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.write=="function"&&typeof window<"u"&&typeof window.ClipboardItem=="function")try{return await navigator.clipboard.write([new window.ClipboardItem({"text/html":new Blob([Ee],{type:"text/html"}),"text/plain":new Blob([Re],{type:"text/plain"})})]),!0}catch{}if(copyViaSelection(Ee,Re))return!0;try{return await navigator.clipboard.writeText(Re),!0}catch{return!1}},copyTableToClipboard=Ee=>copyHtmlWithPlainText(toHtmlTable(Ee),toTsv(Ee)),EMPTY_SOURCE_STATUS$1={},hasItems=Ee=>Array.isArray(Ee)&&Ee.length>0,isWebSource=Ee=>!!(Ee&&(Ee.source_type==="web"||Ee.file_id==null)),isDatabaseSource=Ee=>!!(Ee&&Ee.source_type==="database"),hasUsableCitationLocator=Ee=>!Ee||isWebSource(Ee)?!1:hasItems(Ee.highlight_rects)||hasItems(Ee.citation_rects)||Ee.page!=null||!!(typeof Ee.chunk_text=="string"&&Ee.chunk_text.trim()),shouldRenderCitationLink=(Ee,Re,Te=EMPTY_SOURCE_STATUS$1)=>{if(!hasUsableCitationLocator(Ee))return!1;const je=Te==null?void 0:Te[Re];return!(je!=null&&je.hidden||je!=null&&je.deleted)},extractCitedIndices=Ee=>{if(!Ee||typeof Ee!="string")return[];const Re=Ee.match(/\[(\d+)\]/g);if(!Re)return[];const Te=new Set;return Re.forEach(je=>{Te.add(parseInt(je.slice(1,-1),10)-1)}),Array.from(Te).sort((je,Oe)=>je-Oe)},getVisibleCitedIndices=(Ee,Re,Te=EMPTY_SOURCE_STATUS$1)=>!Array.isArray(Re)||Re.length===0?[]:extractCitedIndices(Ee).filter(je=>je<0||je>=Re.length?!1:shouldRenderCitationLink(Re[je],je,Te)),getDisplaySourceIndices=(Ee,Re,Te=EMPTY_SOURCE_STATUS$1)=>{if(!Array.isArray(Re)||Re.length===0)return[];if(extractCitedIndices(Ee).length===0)return Re.map((Me,De)=>De);const je=getVisibleCitedIndices(Ee,Re,Te),Oe=Re.map((Me,De)=>De).filter(Me=>!hasUsableCitationLocator(Re[Me]));return Array.from(new Set([...je,...Oe])).sort((Me,De)=>Me-De)},VOICE_STORAGE_KEY="doculens_tts_voice",STAGE_ORDER=["preparing","searching","ranking","thinking","generating","verifying","finalizing"],EMPTY_SOURCES=[],EMPTY_SOURCE_STATUS={},STAGE_COPY={preparing:{label:"Preparing",shortLabel:"Prepare",detail:"Loading the conversation and request settings."},searching:{label:"Searching documents",shortLabel:"Search",detail
4045:"Looking through the most relevant document sections."},ranking:{label:"Ranking matches",shortLabel:"Rank",detail:"Sorting the strongest supporting passages."},thinking:{label:"Thinking",shortLabel:"Think",detail:"Combining the selected evidence into a response."},generating:{label:"Drafting answer",shortLabel:"Draft",detail:"Writing the answer as it streams back."},verifying:{label:"Checking answer",shortLabel:"Check",detail:"Making sure the answer stays grounded in the documents."},finalizing:{label:"Finalizing",shortLabel:"Finish",detail:"Applying citations and final formatting."},error:{label:"Response interrupted",shortLabel:"Issue",detail:"The live response stopped before completion."}},getStageDisplay=Ee=>STAGE_COPY[Ee]||{label:"Working",shortLabel:"Work",detail:"Processing your request."};let documentsCache=null,documentsCachePromise=null,isListeningToRoute=!1;const clearDocumentsCache=()=>{documentsCache=null,documentsCachePromise=null};if(typeof window<"u"&&!isListeningToRoute){isListeningToRoute=!0;let Ee=window.location.pathname;const Re=window.history.pushState,Te=window.history.replaceState,je=()=>{const Oe=window.location.pathname;Oe!==Ee&&(Ee=Oe,Oe.includes("/chat")&&clearDocumentsCache())};window.history.pushState=function(...Oe){Re.apply(this,Oe),je()},window.history.replaceState=function(...Oe){Te.apply(this,Oe),je()},window.addEventListener("popstate",je)}const getDocumentsOnce=async()=>documentsCache||documentsCachePromise||(documentsCachePromise=documentService.getDocuments(!0).then(Ee=>(documentsCache=Array.isArray(Ee)?Ee:Ee.files||[],documentsCachePromise=null,documentsCache)).catch(Ee=>{throw documentsCachePromise=null,Ee}),documentsCachePromise),renderTextWithCitations=(Ee,Re,Te,je=EMPTY_SOURCE_STATUS)=>
4045{if(!Ee||typeof Ee!="string"||!Array.isArray(Re)||Re.length===0)return Ee;const Oe=Ee.split(/(\[\d+\])/g);return Oe.length===1?Ee:Oe.map((Me,De)=>{const $e=Me.match(/^\[(\d+)\]$/);if($e){const Be=parseInt($e[1],10)-1,Ue=Re==null?void 0:Re[Be];return Ue&&(Ue.source_type==="web"||Ue.file_id==null)||!shouldRenderCitationLink(Ue,Be,je)?null:jsxRuntimeExports.jsx(Box,{component:"span",onClick:()=>Ue&&Te(Be),title:Ue?`Source: ${Ue.filename}`:void 0,sx:{color:"primary.main",cursor:Ue?"pointer":"default",fontWeight:700,fontSize:"0.72em",verticalAlign:"super",px:.3,borderRadius:.5,lineHeight:1,"&:hover":Ue?{bgcolor:"primary.main",color:"white",textDecoration:"none"}:{}},children:Me},De)}return Me})},formatToolSuccessReply=(Ee,Re)=>{if(!Ee||typeof Ee!="object")return null;const Te=Ee.workflow_label||(Re==null?void 0:Re.tool_name)||"workflow";Ee.status_code;const je=Ee.triggered,Oe=Ee.response;if(typeof Ee.sent=="boolean"){const Me=Ee.warnings||[];if(Ee.sent){const De=(Ee.delivered_to||[]).join(", ");return[`**Email sent${De?` to ${De}`:""}.**`].concat(Me.map($e=>`- â ï¸ ${$e}`)).join(` 4046`)}return`**Email not sent.** ${Ee.error||"unknown error"}`}if(je===!0){const Me=[`**Workflow \`${Te}\` triggered successfully.**`];if(!(typeof Oe=="string"&&Oe.trim())){if(Oe&&typeof Oe=="object"){const De=JSON.stringify(Oe).slice(0,200);Me.push(`- Response: \`${De}\``)}}return Me.join(` 4047`)}return je===!1?`**Workflow \`${Te}\` failed.** ${Ee.error||""}`.trim():null},processChildren=(Ee,Re,Te,je=EMPTY_SOURCE_STATUS)=>React$3.Children.map(Ee,Oe=>typeof Oe=="string"?renderTextWithCitations(Oe,Re,Te,je):React$3.isValidElement(Oe)&&Oe.props.children?React$3.cloneElement(Oe,{children:processChildren(Oe.props.children,Re,Te,je)}):Oe),MarkdownTableBlock=({children:Ee,node:Re,dbColumns:Te,dbRows:je})=>{const[Oe,Me]=reactExports.useState("idle"),De=reactExports.useRef(null);reactExports.useEffect(()=>()=>clearTimeout(De.current),[]);const $e=extractTableFromHast(Re),Be=Array.isArray(Te)&&Te.length>0&&Array.isArray(je)&&je.length>0,Ue=Be?extractTableFromDbData(Te,je):$e,We=Be&&je.length>$e.rows.length?` (${je.length} rows)`:"",Xe=async()=>{clearTimeout(De.current);const Ye=await copyTableToClipboard(Ue);Me(Ye?"copied":"error"),De.current=setTimeout(()=>Me("idle"),2e3)},He=()=>{const Ye=new Blob([toCsv(Ue)],{type:"text/csv;charset=utf-8;"}),Ve=URL.createObjectURL(Ye),Ke=document.createElement("a");Ke.href=Ve,Ke.download="table_export.csv",Ke.click(),URL.revokeObjectURL(Ve)},qe={copied:"Copied!",error:"Copy failed",idle:`Copy table${We}`}[Oe],Ge={cursor:"pointer",color:"primary.main",textDecoration:"underline","&:hover":{color:"primary.dark"}};return jsxRuntimeExports.jsxs(Box,{sx:{overflowX:"auto",maxWidth:"100%",my:1},children:[jsxRuntimeExports.jsx("table",{style:{minWidth:"max-content",width:"100%"},children:Ee}),jsxRuntimeExports.jsxs(Box,{className:"table-actions",sx:{mt:.5,display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[jsxRuntimeExports.jsx(Tooltip,{title:"Copy as a table you can paste into Excel, Word or Google Docs",children:jsxRuntimeExports.jsxs(Typography,{component:"span",variant:"caption",onClick:Xe,sx:{...Ge,display:"inline-flex",alignItems:"center",gap:.4,color:Oe==="error"?"error.main":"primary.main"},children:[jsxRuntimeExports.jsx(ContentCopy,{sx:{fontSize:"0.9rem"}}),qe]})}),jsxRuntimeExports.jsx(Typography,{component:"span",variant:"caption",onClick:He,sx:Ge,children:`Export to CSV${We}`})]})]})},MessageBubble=({message:Ee,sourceActivationId:Re=null,isStreaming:Te=!1,sessionId:je,onEditMessage:Oe,readOnly:Me=!1,isSourceActive:De=!1,onActivateSources:$e,autoSpeakOnComplete:Be=!1,onAutoSpeakComplete:Ue,onSuggestionClick:ze})=>{var Ds,ho,Mo,Po,wo,ri,go,Vo,Nn,Kn,ds,xs,js,Ws,Gs,qs,Ns;const We=useDispatch(),He=useTheme$1().palette.mode==="dark",{user:qe}=useSelector(ps=>ps.auth),Ge=useSelector(ps=>{var us;return(us=ps.subscription)==null?void 0:us.subscription}),Ye=useSelector(ps=>{var us;return(us=ps.customInstructions)==null?void 0:us.selectedInstructions}),Ve=Ee.role==="user",Ke=Array.isArray(Ee.sources)?Ee.sources:EMPTY_SOURCES,Qe=typeof(Ye==null?void 0:Ye.citationStyle)=="str
4047ing"?Ye.citationStyle.trim().toLowerCase():"",Ze=!Ve&&Ke.length>0&&Qe!=="none"&&Qe!=="no citations",Je=Ze?Ke:EMPTY_SOURCES,ir=!!(Te||Ee.streaming);Array.isArray(Ee.streamingStages)&&Ee.streamingStages;const rr=Ee.currentStage||null,ar=!!(rr&&(ir||rr.stage==="error")),or=rr?getStageDisplay(rr.stage):null,pr=rr&&STAGE_ORDER.includes(rr.stage)?STAGE_ORDER.indexOf(rr.stage):-1,tr=pr>=0?STAGE_ORDER.slice(0,pr+1):[],{available:nr,voices:hr,defaultVoice:sr,playingId:xr,loadingId:Rr,speak:br,stop:wr}=useTTS(),vr=!ir&&!!((Ds=Ee.content)!=null&&Ds.trim()),[Dr,kr]=reactExports.useState(!1),[cr,dr]=reactExports.useState(""),[ur,gr]=reactExports.useState(""),[_r,Ir]=reactExports.useState(!1),[Ar,Tr]=reactExports.useState(null),[Nr,Br]=reactExports.useState("Copy"),[Hr,Vr]=reactExports.useState(!1),[mr,Sr]=reactExports.useState(""),[Lr,jr]=reactExports.useState(!1),[fr,Cr]=reactExports.useState(null),[Mr,$r]=reactExports.useState({}),[Fr,Kr]=reactExports.useState({}),[an,Wr]=reactExports.useState(!1),[hn,cn]=reactExports.useState(!1),[tn,Qr]=reactExports.useState(!1),[wn,gn]=reactExports.useState(null),[In,yn]=reactExports.useState(!1),[Mn,on]=reactExports.useState(null),[Yr,sn]=reactExports.useState(!1),[On,Bn]=reactExports.useState(null),[Hn,Zr]=reactExports.useState(!1),xn=Re||Ee.id||Ee.message_id||null,An=reactExports.useRef(!1);reactExports.useEffect(()=>{var us,Ts;if(!Be){An.current=!1;return}if(Ve||ir||An.current||!((us=Ee.content)!=null&&us.trim()))return;if(!nr){Ue==null||Ue();return}An.current=!0;const ps=localStorage.getItem(VOICE_STORAGE_KEY)||sr||((Ts=hr[0])==null?void 0:Ts.name)||"";br(xn,Ee.content,ps),Ue==null||Ue()},[Be,ir,Ve,Ee.content,xn,nr,sr,hr,br,Ue]);const Wn=!Ve&&((ho=Ee.meta)==null?void 0:ho.pending_confirmation),ss=!Ve&&((Mo=Ee.meta)==null?void 0:Mo.pending_selection),Yn=(Po=Ee.meta)==null?void 0:Po.agent_invocation_id;reactExports.useEffect(()=>{Kr(EMPTY_SOURCE_STATUS)},[xn,Ee.content]);const en=async ps=>{var us,Ts;if(!(!Wn||!Yn||tn||In)){Qr(!0),gn(null);try{const As=await agentService.confirmInvocation(Yn,{action_token:Wn.args_token,decision:ps}),Fs=As.status==="failed"||As.result&&As.result.triggered===!1||As.result&&As.result.sent===!1,Co=((us=As.result)==null?void 0:us.error)||null;if(Fs){gn(`Action failed: ${Co||"unknown error"}`),Qr(!1);return}yn(!0);const Eo=ps==="reject"?"Action rejected.":As.reply&&As.reply.trim()||formatToolSuccessReply(As.result,Wn)||"Action completed.";We(injectMessage({id:`agent-confirm-${Yn}-${Date.now()}`,role:"assistant",content:Eo,timestamp:new Date().toISOString(),sources:((Ts=As.meta)==null?void 0:Ts.sources)||[],meta:As.meta||{},streaming:!1}))}catch(As){gn((As==null?void 0:As.message)||"Failed to process confirmation.")}finally{Qr(!1)}}},Gr=async()=>{var ps;if(!(!ss||!Yn||Yr||Hn||!Mn)){sn(!0),Bn(null);try{const us=await agentService.selectInvocationOption(Yn,{action_token:ss.args_token,base_document_id:Mn});Zr(!0),We(injectMessage({id:`agent-select-${Yn}-${Date.now()}`,role:"assistant",content:us.reply||"Base document selected.",timestamp:new Date().toISOString(),sources:((ps=us.meta)==null?void 0:ps.sources)||[],meta:us.meta||{},streaming:!1}))}catch(us){Bn((us==null?void 0:us.message)||"Failed to submit selection.")}finally{sn(!1)}}};reactExports.useEffect(()=>{(async()=>{if(Ze){cn(!0);const us={};try{const Ts=await getDocumentsOnce();Je.forEach((As,Fs)=>{if(As&&As.file_id){const Co=Ts.some(Eo=>Eo.id===As.file_id);us[Fs]=!Co}})}catch(Ts){console.error("Error checking document existence:",Ts),Je.forEach((As,Fs)=>{us[Fs]=!1})}$r(us),cn(!1);return}$r(EMPTY_SOURCE_STATUS),cn(!1)})()},[Je,Ze]);const nn=Je.reduce((ps,us,Ts)=>{const As=!hasUsableCitationLocator(us);return(Mr[Ts]||Fr[Ts]||As)&&(ps[Ts]={deleted:!!Mr[Ts],hidden:!!Fr[Ts]||As}),ps},{}),Cn=getDisplaySourceIndices(Ee.content,Je,nn).map(ps=>Je[ps]),jn=()=>{Ve&&kr(!0)},$n=async()=>{if(cr.trim()&&Ve)try{await We(saveFavorite({prompt:Ee.content,name:cr.trim()})).unwrap(),Ir(!0),kr(!1),dr(""),gr(""),We(fetchFavorites(!0))}catch(ps){gr(typeof ps=="string"?ps:(ps==null?void 0:ps.message)||"Failed to save favorite")}},Vn=()=>{kr(!1),dr(""),gr("")},Qn=ps=>{Tr(ps.currentTarget)},Un=()=>{Tr(null)},fs=async()=>{try{await navigator.clipboard.writeText(Ee.content),Br("Copied!"),setTimeout(()=>Br("Copy"),2e3)}catch(ps){console.error("Failed to copy:",ps)}Un()},Jn=()=>{Me||(navigator.share?navigator.share({title:"Chat Message",text:Ee.content}).catch(ps=>console.error("Failed to share:",ps)):(navigator.clipboard.writeText(Ee.content),Br("Link copied!"),setTimeout(()=>Br("Copy"),2e3)),Un())},ts=()=>{Me||(Sr(Ee.content),Vr(!0),Un())},cs=async()=>
4047{if(Me){Vr(!1);return}mr.trim()&&mr!==Ee.content&&Oe&&Oe(mr.trim()),Vr(!1)},Sn=()=>{Vr(!1),Sr("")},mn=ps=>{const us=Je[ps];if(shouldRenderCitationLink(us,ps,nn)){if(Mr[ps]){Wr(!0);return}us&&us.file_id&&(Cr({id:us.file_id,FileID:us.file_id,filename:us.filename||us,FileName:us.filename||us,displayFilename:us.filename||us,chunk_text:us.chunk_text||null,initialPage:us.page||null,node_id:us.node_id||null,sourceIndex:ps,highlight_rects:us.highlight_rects||us.citation_rects||null,anchor_ids:us.anchor_ids||null}),jr(!0))}},zn=reactExports.useCallback(({children:ps,node:us})=>{var Ts,As;return jsxRuntimeExports.jsx(MarkdownTableBlock,{node:us,dbColumns:(Ts=Ee.meta)==null?void 0:Ts.db_columns,dbRows:(As=Ee.meta)==null?void 0:As.db_rows,children:ps})},[(wo=Ee.meta)==null?void 0:wo.db_columns,(ri=Ee.meta)==null?void 0:ri.db_rows]),os=reactExports.useCallback(ps=>{const us=fr==null?void 0:fr.sourceIndex;if(us!=null){if((ps==null?void 0:ps.status)==="shown"){Kr(Ts=>{if(!Ts[us])return Ts;const As={...Ts};return delete As[us],As});return}(ps==null?void 0:ps.status)==="unavailable"&&Kr(Ts=>({...Ts,[us]:!0}))}},[fr==null?void 0:fr.sourceIndex]),ls=()=>
4047{!xn||Cn.length===0||$e==null||$e(xn,Ee)},hs=()=>qe!=null&&qe.first_name&&(qe!=null&&qe.last_name)?qe.first_name.charAt(0).toUpperCase()+qe.last_name.charAt(0).toUpperCase():qe!=null&&qe.first_name?qe.first_name.charAt(0).toUpperCase():qe!=null&&qe.email?qe.email.split("@")[0].substring(0,2).toUpperCase():"U",Cs=()=>{jr(!1),Cr(null)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",justifyContent:Ve?"flex-end":"flex-start",mb:2,gap:1,position:"relative","&:hover .message-actions":{opacity:1}},children:[!Ve&&jsxRuntimeExports.jsx(Avatar,{sx:{bgcolor:"primary.main",width:36,height:36},children:jsxRuntimeExports.jsx(CustomRobotIcon,{fontSize:"small"})}),jsxRuntimeExports.jsxs(Box,{sx:{maxWidth:Hr&&Ve?"60%":"70%",width:Hr&&Ve?"50%":"auto",position:"relative",transition:"max-width 0.3s ease, width 0.3s ease"},children:[jsxRuntimeExports.jsxs(Box,{className:"message-actions",sx:{position:"absolute",top:-8,right:-8,display:"flex",gap:.5,opacity:0,transition:"opacity 0.2s",zIndex:1},children:[vr&&jsxRuntimeExports.jsx(SpeakButton,{messageId:xn,text:Ee.content,available:nr,voices:hr,defaultVoice:sr,playingId:xr,loadingId:Rr,onSpeak:br,onStop:wr}),Ve&&jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:jn,sx:{bgcolor:"background.paper",boxShadow:1,"&:hover":{bgcolor:"warning.light"}},children:_r?jsxRuntimeExports.jsx(Star,{fontSize:"small",color:"warning"}):jsxRuntimeExports.jsx(StarBorder,{fontSize:"small"})}),jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:Qn,sx:{bgcolor:"background.paper",boxShadow:1,"&:hover":{bgcolor:"warning.light"}},children:jsxRuntimeExports.jsx(MoreVertIcon,{fontSize:"small"})})]}),jsxRuntimeExports.jsxs(Paper,{elevation:1,sx:{p:2,bgcolor:Ve?"#002D79":"background.paper",color:Ve?"white":"text.primary",borderRadius:2,border:Ve?"none":"1px solid",borderColor:Ve?"transparent":"divider",...ir&&{opacity:.8}},children:[!Ve&&((go=Ee.meta)==null?void 0:go.has_conflict)&&jsxRuntimeExports.jsx(Alert,{severity:"warning",sx:{mb:1.5},children:"The selected sources disagree on this â see below for which source said what."}),Hr&&Ve?jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(TextField,{fullWidth:!0,multiline:!0,rows:4,value:mr,onChange:ps=>{ps.target.value.length<=4e3&&Sr(ps.target.value)},variant:"outlined",size:"small",autoFocus:!0,sx:{"& .MuiOutlinedInput-root":{bgcolor:"background.paper"}},maxLength:4e3}),jsxRuntimeExports.jsxs("div",{style:{fontSize:"12px",color:mr.length>4e3?"#ef4444":"#6b7280",marginTop:"4px",textAlign:"right"},children:[mr.length,"/4000 characters"]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:2,mt:3,justifyContent:"flex-end",alignItems:"center"},children:[jsxRuntimeExports.jsx(Button,{size:"medium",onClick:Sn,variant:"outlined",sx:{minWidth:"100px",height:"40px",fontSize:"14px",fontWeight:600,textTransform:"none",borderColor:"#d1d5db",color:"#374151",border:"2px solid",paddingX:3,"&:hover":{border:"2px solid",borderColor:"#9ca3af",backgroundColor:"#f9fafb"}},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{size:"medium",variant:"contained",onClick:cs,disabled:!mr.trim()||mr===Ee.content,sx:{minWidth:"100px",height:"40px",fontSize:"14px",fontWeight:600,textTransform:"none",bgcolor:"#f97316",color:"white",paddingX:3,border:"2px solid #374151",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.1)","&:hover":{bgcolor:"#ea630e",border:"2px solid #fb9248",boxShadow:"0 4px 12px rgba(249, 115, 22, 0.4)"},"&:disabled":{bgcolor:"#e5e7eb",color:"#9ca3af",border:"2px solid #e5e7eb",cursor:"not-allowed",boxShadow:"none"}},children:"Save"})]})]}):Ve?jsxRuntimeExports.jsx(Typography,{variant:"body1",sx:{whiteSpace:"pre-wrap"},children:Ee.content}):jsxRuntimeExports.jsxs(Box,{sx:{whiteSpace:"pre-wrap","& p":{m:0,mb:1},"& p:last-child":{mb:0},"& pre":{bgcolor:He?"#0f172a":"grey.800",color:He?"#e2e8f0":"white",border:He?"1px solid":"none",borderColor:He?"#475569":"transparent",p:1.5,borderRadius:1,overflow:"auto",fontSize:"0.875rem"},"& code":{bgcolor:He?"#334155":"grey.200",color:He?"#f1f5f9":"grey.900",border:He?"1px solid":"none",borderColor:He?"#475569":"transparent",px:.5,py:.25,borderRadius:.5,fontSize:"0.875rem"},"& pre code":{bgcolor:"transparent",color:"inherit",border:"none",p:0},"& a":{color:He?"#7dd3fc":"primary.main",textDecorationColor:He?"rgba(125, 211, 252, 0.45)":void 0,"&:hover":{color:He?"#bae6fd":"primary.dark"}},"& ul, & ol":{mt:.5,mb:.5,pl:3},"& li":{mb:.5},"& blockquote":{borderLeft:"4px solid",borderColor:"primary.main",pl:2,ml:0,fontStyle:"italic"},"& table":{borderCollapse:"collapse",width:"100%",mt:1,mb:1,minWidth:"max-content"},"& th, & td":{border:"1px solid",borderColor:"divider",p:1,textAlign:"left",whiteSpace:"nowrap"},"& th":{bgcolor:He?"#334155":"grey.200",color:He?"#f8fafc":"text.primary",fontWeight:"bold"}},children:[ar&&or&&jsxRuntimeExports.jsxs(Box,{sx:{mb:Ee.content?1.5:.5,display:"flex",flexDirection:"column",gap:1},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[rr.stage==="error"?jsxRuntimeExports.jsx(Box,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:"error.main",flexShrink:0}}):jsxRuntimeExports.jsx(CircularProgress,{size:14,thickness:5}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{fontWeight:700,color:"text.secondary"},children:rr.label||or.label})]}),(rr.detail||or.detail)&&jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"text.secondary",lineHeight:1.4},children:rr.detail||or.detail}),tr.length>1&&jsxRuntimeExports.jsx(Box,{sx:{display:"flex",gap:.75,flexWrap:"wrap"},children:tr.map(ps=>{const us=getStageDisplay(ps),Ts=STAGE_ORDER.indexOf(ps),As=rr.stage===ps,Fs=
4047pr>Ts;return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.75,px:1,py:.5,borderRadius:999,bgcolor:As?"rgba(37, 99, 235, 0.12)":"background.default",border:"1px solid",borderColor:As?"primary.main":Fs?"rgba(37, 99, 235, 0.28)":"divider"},children:[jsxRuntimeExports.jsx(Box,{sx:{width:7,height:7,borderRadius:"50%",bgcolor:As?"primary.main":Fs?"rgba(37, 99, 235, 0.55)":"divider"}}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{fontWeight:As?700:600,color:"text.secondary"},children:us.shortLabel})]},ps)})})]}),!ir&&((Vo=Ee.meta)==null?void 0:Vo.low_confidence)&&((Kn=(Nn=Ee.meta)==null?void 0:Nn.alternate_questions)==null?void 0:Kn.length)>0&&jsxRuntimeExports.jsxs(Box,{sx:{mt:1.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"text.secondary",mb:.75,display:"block",fontWeight:500},children:"Try asking instead:"}),jsxRuntimeExports.jsx(Box,{sx:{display:"flex",flexDirection:"column",gap:.75},children:Ee.meta.alternate_questions.map((ps,us)=>jsxRuntimeExports.jsx(Chip,{label:ps,variant:"outlined",size:"small",clickable:!0,onClick:()=>ze==null?void 0:ze(ps),sx:{height:"auto",py:.75,borderRadius:1.5,justifyContent:"flex-start",borderColor:He?"primary.dark":"primary.light",color:He?"primary.light":"primary.dark","& .MuiChip-label":{whiteSpace:"normal",textAlign:"left",fontSize:"0.8rem"}}},us))})]}),jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],components:{p:({children:ps})=>jsxRuntimeExports.jsx("p",{children:processChildren(ps,Je,mn,nn)}),li:({children:ps})=>jsxRuntimeExports.jsx("li",{children:processChildren(ps,Je,mn,nn)}),td:({children:ps})=>jsxRuntimeExports.jsx("td",{children:processChildren(ps,Je,mn,nn)}),th:({children:ps})=>jsxRuntimeExports.jsx("th",{children:processChildren(ps,Je,mn,nn)}),table:zn,blockquote:({children:ps})=>jsxRuntimeExports.jsx("blockquote",{children:processChildren(ps,Je,mn,nn)}),a:({href:ps,children:us,...Ts})=>{const As=resolveMarkdownHref(ps),Fs=shouldOpenMarkdownLinkInNewWindow(As);return jsxRuntimeExports.jsx("a",{...Ts,href:As,target:Fs?"_blank":void 0,rel:Fs?"noopener noreferrer":void 0,children:processChildren(us,Je,mn,nn)})}},children:Ee.content}),Wn&&jsxRuntimeExports.jsxs(Box,{sx:{mt:1.5,p:1.5,borderRadius:2,border:"1px solid",borderColor:"warning.light",bgcolor:"rgba(251, 191, 36, 0.06)"},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{display:"block",fontWeight:700,color:"warning.dark",mb:1},children:"Action requires your approval"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{display:"block",color:"text.secondary",fontFamily:"monospace",mb:1.5},children:Wn.summary}),wn&&jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{display:"block",color:"error.main",mb:1},children:wn}),In?jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"success.main",fontWeight:600},children:"â Decision sent"}):jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1},children:[jsxRuntimeExports.jsx(Button,{size:"small",variant:"contained",startIcon:tn?jsxRuntimeExports.jsx(CircularProgress,{size:14,color:"inherit"}):jsxRuntimeExports.jsx(CheckCircleOutline,{fontSize:"small"}),disabled:tn,onClick:()=>en("approve"),sx:{bgcolor:"#16a34a",textTransform:"none",fontWeight:600,fontSize:13,"&:hover":{bgcolor:"#15803d"},"&:disabled":{bgcolor:"action.disabledBackground"}},children:"Approve"}),jsxRuntimeExports.jsx(Button,{size:"small",variant:"outlined",startIcon:jsxRuntimeExports.jsx(CancelOutlined,{fontSize:"small"}),disabled:tn,onClick:()=>en("reject"),sx:{borderColor:"#dc2626",color:"#dc2626",textTransform:"none",fontWeight:600,fontSize:13,"&:hover":{borderColor:"#b91c1c",color:"#b91c1c",bgcolor:"rgba(220,38,38,0.05)"}},children:"Reject"})]})]}),ss&&jsxRuntimeExports.jsxs(Box,{sx:{mt:1.5,p:1.5,borderRadius:2,border:"1px solid",borderColor:"info.light",bgcolor:"rgba(37, 99, 235, 0.06)"},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{display:"block",fontWeight:700,color:"info.dark",mb:1},children:"Select the base document"}),On&&jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{dis
4047play:"block",color:"error.main",mb:1},children:On}),Hn?jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"success.main",fontWeight:600},children:"â Selection sent"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(RadioGroup,{value:Mn??"",onChange:ps=>on(Number(ps.target.value)),sx:{mb:1.5},children:(ss.candidates||[]).map(ps=>jsxRuntimeExports.jsx(FormControlLabel,{value:ps.file_id,sx:{ml:0},disabled:Yr,control:jsxRuntimeExports.jsx(Radio,{size:"small"}),label:jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"text.primary"},children:ps.filename})},ps.file_id))}),jsxRuntimeExports.jsx(Button,{size:"small",variant:"contained",startIcon:Yr?jsxRuntimeExports.jsx(CircularProgress,{size:14,color:"inherit"}):jsxRuntimeExports.jsx(CheckCircleOutline,{fontSize:"small"}),disabled:Yr||!Mn,onClick:Gr,sx:{bgcolor:"#2563eb",textTransform:"none",fontWeight:600,fontSize:13,"&:hover":{bgcolor:"#1d4ed8"},"&:disabled":{bgcolor:"action.disabledBackground"}},children:"Done"})]})]})]})]}),!Ve&&!ir&&!Wn&&!ss&&jsxRuntimeExports.jsx(Box,{sx:{mt:.25},children:jsxRuntimeExports.jsx(MessageFeedback,{messageId:Ee.id||((ds=Ee.meta)==null?void 0:ds.message_id),initialFeedback:Ee.feedback||null,modelVersion:((js=(xs=Ee.meta)==null?void 0:xs.selected_model)==null?void 0:js.label)||((Ws=Ee.meta)==null?void 0:Ws.model)||null,disabled:Me})}),!Ve&&!ir&&((Gs=Ee.meta)==null?void 0:Gs.needs_clarification)&&((qs=Ee.meta)==null?void 0:qs.clarifying_question)&&jsxRuntimeExports.jsxs(Box,{sx:{mt:1.5,p:1.5,borderRadius:1.5,border:"1px solid",borderColor:"warning.light",bgcolor:He?"rgba(251,191,36,0.08)":"rgba(254,243,199,0.8)",display:"flex",alignItems:"flex-start",gap:1},children:[jsxRuntimeExports.jsx(Avatar,{sx:{bgcolor:"primary.main",width:22,height:22,flexShrink:0},children:jsxRuntimeExports.jsx(CustomRobotIcon,{sx:{fontSize:13}})}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:He?"warning.light":"warning.dark",fontWeight:500,lineHeight:1.5},children:Ee.meta.clarifying_question})]}),Ze&&jsxRuntimeExports.jsx(Box,{sx:{mt:1,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:1},children:jsxRuntimeExports.jsx(ButtonBase,{onClick:ls,sx:{borderRadius:999},children:jsxRuntimeExports.jsx(Box,{sx:{px:1.25,py:.6,borderRadius:999,border:"1px solid",borderColor:De?"#002D79":"rgba(0, 45, 121, 0.25)",bgcolor:De?"rgba(0, 45, 121, 0.12)":"rgba(0, 45, 121, 0.06)",color:"#002D79",transition:"all 0.2s ease","&:hover":{borderColor:"#002D79",bgcolor:"rgba(0, 45, 121, 0.12)",color:"#002D79"}},children:jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{fontWeight:700},children:De?`Showing ${Cn.length} source block${Cn.length>1?"s":""}`:`Show ${Cn.length} source block${Cn.length>1?"s":""}`})})})}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",sx:{display:"block",mt:.5,color:"text.secondary",textAlign:Ve?"right":"left",px:1},children:[Ee.timestamp&&formatTime(Ee.timestamp),ir&&" Streaming...",!ir&&(rr==null?void 0:rr.stage)==="error"&&"",Ee.edited&&" (edited)"]})]}),Ve&&(qe!=null&&qe.photo_url?jsxRuntimeExports.jsx("img",{src:qe==null?void 0:qe.photo_url,alt:"Profile",className:"topbar-avatar-image"}):jsxRuntimeExports.jsx(Avatar,{sx:{bgcolor:"#002D79",width:36,height:36,fontSize:"14px",fontWeight:600},children:hs()}))]}),jsxRuntimeExports.jsxs(Menu,{anchorEl:Ar,open:!!Ar,onClose:Un,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[Ve&&jsxRuntimeExports.jsxs(MenuItem,{onClick:ts,disabled:Me,children:[jsxRuntimeExports.jsx(EditIcon,{fontSize:"small",sx:{mr:1}}),"Edit"]}),jsxRuntimeExports.jsxs(MenuItem,{onClick:fs,children:[jsxRuntimeExports.jsx(ContentCopy,{fontSize:"small",sx:{mr:1}}),"Copy"]}),jsxRuntimeExports.jsxs(MenuItem,{onClick:Jn,disabled:Me,children:[jsxRuntimeExports.jsx(Share,{fontSize:"small",sx:{mr:1}}),"Share"]})]}),jsxRuntimeExports.jsxs(Dialog,{open:Dr,onClose:(ps,us)=>{us==="backdropClick"||us==="escapeKeyDown"||Vn()},maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Save to Favorites"}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(TextField,{autoFocus:!0,fullWidth:!0,label:"Title Name",placeholder:"e.g. Summarize contract",value:cr,onChange:ps=>{ps.target.value.length<=50&&dr(ps.target.value)},sx:{mt:1},maxLength:50}),jsxRuntimeExports.jsxs("div",{style:{fontSize:"12px",color:cr.length>50?"#ef4444":"#6b7280",marginTop:"4px",textAlign:"right"},children:[cr.length,"/50 characters"]}),ur&&jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"error",sx:{dis
4047play:"block",mt:1},children:ur}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:2},children:["Preview: ",((Ns=Ee==null?void 0:Ee.content)==null?void 0:Ns.substring(0,100))||"",(Ee==null?void 0:Ee.content)&&Ee.content.length>100&&"..."]})]}),jsxRuntimeExports.jsxs(DialogActions,{sx:{padding:"16px 24px",gap:1.5},children:[jsxRuntimeExports.jsx(Button,{onClick:Vn,variant:"outlined",sx:{minWidth:"100px",height:"40px",fontSize:"14px",fontWeight:500,textTransform:"none",borderWidth:"1.5px",borderColor:"divider",color:"text.primary","&:hover":{borderWidth:"1.5px",borderColor:"text.secondary",backgroundColor:"action.hover"}},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:$n,variant:"contained",disabled:!cr.trim(),sx:{minWidth:"100px",height:"40px",fontSize:"14px",fontWeight:600,textTransform:"none",boxShadow:"none","&:hover":{boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},"&:disabled":{backgroundColor:"action.disabledBackground",color:"action.disabled",cursor:"not-allowed"}},children:"Save"})]})]}),fr&&jsxRuntimeExports.jsx(DocumentPreviewModal,{document:fr,open:Lr,onClose:Cs,user:qe,subscription:Ge,highlightText:(fr==null?void 0:fr.chunk_text)||null,highlightRects:(fr==null?void 0:fr.highlight_rects)||null,initialPage:(fr==null?void 0:fr.initialPage)||null,onHighlightStatusChange:os}),jsxRuntimeExports.jsxs(Dialog,{open:an,onClose:()=>Wr(!1),maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:"File Deleted"}),jsxRuntimeExports.jsx(DialogContent,{children:jsxRuntimeExports.jsx(Typography,{children:"This document has been deleted and is no longer available."})}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:()=>Wr(!1),variant:"contained",children:"OK"})})]})]})},MessageList=({messages:Ee,loading:Re,sendingMessage:Te,sessionId:je,onEditMessage:Oe,readOnly:Me=!1,activeSourceMessageId:De,isSourcePanelOpen:$e,onActivateSources:Be,awaitingVoiceReply:Ue=!1,voiceReplyAfterIndex:ze=null,onVoiceReplySpoken:We,onSuggestionClick:Xe})=>{const He=reactExports.useRef(null),qe=reactExports.useRef(null),[Ge,Ye]=reactExports.useState(!0),Ve=reactExports.useRef(!0),[Ke,Qe]=reactExports.useState(20),[Ze,Je]=reactExports.useState(!1),ir=reactExports.useRef(null),rr=reactExports.useRef(!1),ar=reactExports.useRef(20),or=reactExports.useRef(0),pr=reactExports.useRef(0),tr=reactExports.useRef(null),nr=reactExports.useRef(!1),hr=reactExports.useRef(0),sr=reactExports.useRef(!1),xr=Array.isArray(Ee)&&Ee.length>0?Ee.slice(-Math.max(Ke,0)):[],Rr=Array.isArray(Ee)&&Ke<Ee.length,br=xr.some(kr=>!!(kr!=null&&kr.streaming)),wr=Array.isArray(Ee)?Ee.findLastIndex(kr=>(kr==null?void 0:kr.role)==="assistant"):-1,vr=(kr=!1)=>{try{const cr=qe.current;cr&&He.current&&(kr?cr.scrollTop=cr.scrollHeight:He.current.scrollIntoView({behavior:"smooth",block:"end"}))}catch(cr){console.error("Error scrolling to bottom:",cr)}},Dr=reactExports.useCallback(()=>{try{const kr=qe.current;if(!kr||rr.current||Ve.current)return;const cr=kr.scrollTop||0,dr=kr.scrollHeight||0,ur=kr.clientHeight||0;if(dr===0||ur===0)return;cr<200&&cr>=0&&Rr&&Array.isArray(Ee)&&(tr.current&&clearTimeout(tr.current),tr.current=setTimeout(()=>{if(!rr.current&&!Ve.current){rr.current=!0,Je(!0);const Ir=qe.current;Ir&&(or.current=Ir.scrollTop,pr.current=Ir.scrollHeight),setTimeout(()=>{Qe(Ar=>Math.min(Math.max(Ar+10,0),Ee.length))},600)}},50));const _r=dr-cr-ur<100;Ye(_r)}catch(kr){console.error("Error in handleScroll:",kr),rr.current=!1}},[Rr,Ee]);return reactExports.useEffect(()=>{ir.current!==null&&ir.current!==void 0&&ir.current!==je&&(qe.current&&(qe.current.scrollTop=0),Qe(20),Je(!1),Ve.current=!0,sr.current=!1,nr.current=!1,Ye(!0),ar.current=20,rr.current=!1,or.current=0,pr.current=0,hr.current=0,tr.current&&clearTimeout(tr.current)),ir.current=je},[je]),reactExports.useLayoutEffect(()=>{const kr=qe.current;if(Ke!==ar.current&&rr.current&&kr&&!Ve.current){try{const dr=kr.scrollHeight-pr.current;dr>0&&or.current>=0&&(kr.scrollTop=or.current+dr),rr.current=!1,Je(!1)}catch(cr){console.error("Error in scroll position restore:",cr),rr.current=!1,Je(!1)}ar.current=Ke}else Ke!==ar.current&&(ar.current=Ke)},[Ke]),reactExports.useLayoutEffect(()=>{const kr=qe.current;if(Ve.current&&!nr.current&&xr.length>0&&kr){const cr=()=>{try{return kr.scrollHeight>kr.clientHeight?(kr.scrollTop=kr.scrollHeight,nr.current=!0,Ve.current=!1,rr.current=!1,hr.current=Ee.length,sr.current=!0,!0):!1}catch(dr){return console.error("Error in initial scroll:",dr),!1}};if(!cr()){const dr=requestAnimationFrame(()=>{cr()||setTimeout(()=>cr(),10)});return()=>cancelAnimationFrame(dr)}}},[xr.length,Ee.length]),reactExports.useEffect(()=>{!Ve.current&&Ge&&!rr.current&&vr(!1)},[Ee.length,Ge]),reactExports.useEffect(()=>{try{if(!Ve.current&&sr.current&&Array.isArray(Ee)&&Ee.length>0&&Ee.length>hr.current&&!rr.current){const kr=Ee.length-hr.current;Qe(cr=>cr+kr),ar.current=Ke+kr}hr.current=Ee.length}catch(kr){console.error("Error updating display count:",kr)}},[Ee.length,Ke]),reactExports.useEffect(()=>{Te&&vr(!1)},[Te]),reactExports.useEffect(()=>()=>{tr.current&&clearTimeout(tr.current)},[]),Re?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:jsxRuntimeExports.jsx(CircularProgress,{})}):!Array.isArray(Ee)||Ee.length===0?jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%",color:"text.secondary",textAlign:"center",px:3},children:[jsxRuntimeExports.jsx(Typography,{variant:"h5",gutterBottom:!0,sx:{fontWeight:500},children:"Start a Conversation"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:"Ask me anything about your data sources or get help with your work."}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mt:2,color:"text.disabled"},children:"Tip: You can attach data sources to provide context for your questions."})]}):jsxRuntimeExports.jsxs(Box,{ref:qe,onScroll:Dr,sx:{flex:1,overflowY:"auto",overflowX:"hidden",p:3,display:"flex",flexDirection:"column",scrollBehavior:"auto",willChange:"scroll-position",minHeight:0},children:[Ze&&Rr&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:2,gap:1},children:[jsxRuntimeExports.jsx(CircularProgress,{size:20}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Loading messages..."})]}),Array.isArray(xr)&&xr.length>0&&xr.map((kr,cr)=>{if(!kr||typeof kr!="object")return null;const dr=kr.id||kr.message_id||`msg-${cr}`,ur=Array.isArray(Ee)&&Ee.length>0?Math.max(0,Ee.length-xr.length+cr):-1,gr=!!(Ue&&ze!==null&&wr>ze&&ur===wr&&kr.role==="assistant");return kr.role==="system"&&kr.scopeChange?null:jsxRuntimeExports.jsx(MessageBubble,{message:kr,sourceActivationId:dr,isStreaming:!!kr.streaming,sessionId:je,onEditMessage:Oe,readOnly:Me,isSourceActive:!!($e&&De===dr),onActivateSources:Be,autoSpeakOnComplete:gr,onAutoSpeakComplete:We,onSuggestionClick:Xe},dr)}),Te&&!br&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:2,mt:2,ml:5},children:[jsxRuntimeExports.jsx(CircularProgress,{size:20}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Generating response..."})]}),jsxRuntimeExports.jsx("div",{ref:He})]})},cleanBlockText=Ee=>!Ee||typeof Ee!="string"?"":Ee.replace(/\[Page\s+\d+\]\s*\[Block\s+\d+\]\s*/gi," ").replace(/\[Page\s+\d+\]/gi," ").replace(/\[Block\s+\d+\]/gi," ").replace(/\s+/g," ").trim(),getSourceFootnote=Ee=>{const Re=[];return Ee!=null&&Ee.filename&&Re.push(Ee.filename),Ee!=null&&Ee.page&&Re.push(`p. ${Ee.page}`),Re.join(" | ")},getBlockKind=Ee=>(Array.isArray(Ee==null?void 0:Ee.block_sources)?Ee.block_sources:Ee!=null&&Ee.block_source?[Ee.block_source]:[]).map(je=>
4047String(je||"").trim().toLowerCase()).filter(Boolean).some(je=>je==="image"||je==="image_ocr"||je==="ocr")?{label:"Image",icon:jsxRuntimeExports.jsx(ImageIcon,{sx:{fontSize:14}}),color:"secondary"}:{label:"Text",icon:jsxRuntimeExports.jsx(Article,{sx:{fontSize:14}}),color:"default"},SourceBlocksSidebar=({activeMessage:Ee,open:Re=!1,onClose:Te,onOpenSource:je})=>{const Oe=Array.isArray(Ee==null?void 0:Ee.sources)?Ee.sources:[],De=getDisplaySourceIndices(Ee==null?void 0:Ee.content,Oe).map($e=>({source:Oe[$e],originalIndex:$e}));return jsxRuntimeExports.jsxs(Drawer,{open:Re,anchor:"right",onClose:Te,transitionDuration:220,ModalProps:{keepMounted:!0},PaperProps:{sx:{width:{xs:"min(100vw, 420px)",md:440},maxWidth:"100vw",height:"100vh",boxShadow:"-10px 0 40px rgba(15, 23, 42, 0.18)",bgcolor:"background.paper",display:"flex",flexDirection:"column",overflow:"hidden"}},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1,px:2.25,py:1.75,borderBottom:"1px solid",borderColor:"divider",bgcolor:"rgba(15, 23, 42, 0.03)"},children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700},children:"Selected Blocks"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Final source blocks used for this answer"})]}),jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:Te,"aria-label":"Close source blocks",children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})})]}),jsxRuntimeExports.jsx(Box,{sx:{p:1.5,display:"flex",flexDirection:"column",gap:1.25,overflowY:"auto",flex:1,minHeight:0,bgcolor:"background.default"},children:De.length===0?jsxRuntimeExports.jsxs(Box,{sx:{border:"1px dashed",borderColor:"divider",borderRadius:2,px:1.5,py:2,bgcolor:"background.paper"},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:600,mb:.5},children:"No source blocks yet"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Send a question with document context and the final selected blocks will appear here."})]}):De.map(({source:$e,originalIndex:Be})=>{const Ue=($e==null?void 0:$e.source_type)==="web",ze=isDatabaseSource($e),Xe=cleanBlockText($e==null?void 0:$e.chunk_text)||(Ue?"No preview available.":"This source did not include a stored block preview. Open the document to review it."),He=getBlockKind($e);if(ze){const qe=Number($e==null?void 0:$e.row_count)>0;return jsxRuntimeExports.jsxs(Box,{sx:{width:"100%",p:1.5,border:"1px solid",borderColor:"divider",borderRadius:2,bgcolor:"background.paper"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.75,mb:.5},children:[jsxRuntimeExports.jsx(DatabaseIcon,{sx:{fontSize:14,color:"primary.main"}}),jsxRuntimeExports.jsxs(Typography,{variant:"overline",sx:{color:"primary.main",letterSpacing:"0.08em",lineHeight:1},children:["Database Source ",Be+1]})]}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:600,mb:.5},children:($e==null?void 0:$e.connection_name)||($e==null?void 0:$e.filename)||"Database"}),$e!=null&&$e.error?jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"error.main",children:$e.error}):qe?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[($e==null?void 0:$e.query)&&jsxRuntimeExports.jsx(Box,{sx:{maxHeight:100,overflowY:"auto",mb:.75},children:jsxRuntimeExports.jsx(Typography,{variant:"caption",component:"pre",sx:{whiteSpace:"pre-wrap",color:"text.secondary",fontFamily:"monospace"},children:$e.query})}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",children:[$e.row_count," row",Number($e.row_count)===1?"":"s",Array.isArray($e==null?void 0:$e.columns)&&$e.columns.length>0?` â columns: ${$e.columns.join(", ")}`:""]})]}):jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Checked â no matching rows."})]},`db-${($e==null?void 0:$e.connection_id)||Be}-${Be}`)}return Ue?jsxRuntimeExports.jsxs(Box,{sx:{width:"100%",p:1.5,border:"1px solid",borderColor:"divider",borderRadius:2,bgcolor:"background.paper"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.75,mb:.5},children:[jsxRuntimeExports.jsx(Language,{sx:{fontSize:14,color:"primary.main"}}),jsxRuntimeExports.jsxs(Typography,{variant:"overline",sx:{color:"primary.main",letterSpacing:"0.08em",lineHeight:1},children:["Web Source ",Be+1]})]}),jsxRuntimeExports.jsx(Box,{sx:{maxHeight:148,overflowY:"auto",pr:.5},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{lineHeight:1.6,whiteSpace:"pre-wrap",color:"text.primary"},children:Xe})}),jsxRuntimeExports.jsxs(Box,{sx:{mt:1.25,pt:1,borderTop:"1px solid",borderColor:"divider",display:"flex",alignItems:"center",gap:.5},children:[jsxRuntimeExports.jsx(Language,{sx:{fontSize:13,color:"text.secondary",flexShrink:0}}),jsxRuntimeExports.jsx(Link,{href:$e.url,target:"_blank",rel:"noopener noreferrer",variant:"caption",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block",maxWidth:"100%"},title:$e.url,children:$e.title&&$e.title!==$e.url?$e.title:($e.url||"").replace(/^https?:\/\//,"")})]})]},`web-${($e==null?void 0:$e.url)||Be}-${Be}`):jsxRuntimeExports.jsx(ButtonBase,{onClick:()=>je==null?void 0:je($e),sx:{width:"100%",textAlign:"left",borderRadius:2,alignItems:"stretch"},children:jsxRuntimeExports.jsxs(Box,{sx:{width:"100%",p:1.5,border:"1px solid",borderColor:"divider",borderRadius:2,bgcolor:"background.paper",transition:"border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease","&:hover":{borderColor:"primary.main",boxShadow:"0 10px 24px rgba(15, 23, 42, 0.08)",transform:"translateY(-1px)"}},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1,mb:.5},children:[jsxRuntimeExports.jsxs(Typography,{variant:"overline",sx:{dis
4047play:"block",color:"text.secondary",letterSpacing:"0.08em",lineHeight:1.3},children:["Block ",Be+1]}),jsxRuntimeExports.jsx(Chip,{size:"small",icon:He.icon,label:He.label,color:He.color,variant:He.color==="default"?"outlined":"filled",sx:{height:22,flexShrink:0,"& .MuiChip-label":{px:.75,fontSize:"0.68rem",fontWeight:700},"& .MuiChip-icon":{ml:.5,mr:-.25}}})]}),jsxRuntimeExports.jsx(Box,{sx:{maxHeight:148,overflowY:"auto",pr:.5},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{lineHeight:1.6,whiteSpace:"pre-wrap",color:"text.primary"},children:Xe})}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:1.25,pt:1,borderTop:"1px solid",borderColor:"divider"},children:getSourceFootnote($e)||"Source document"})]})},`${($e==null?void 0:$e.node_id)||($e==null?void 0:$e.file_id)||"source"}-${Be}`)})})]})},DEFAULT_MODELS=[{id:"default",label:"Default"}],ModelSelector=({availableModels:Ee=DEFAULT_MODELS,selectedModel:Re="default",onChange:Te,loading:je=!1,disabled:Oe=!1,ariaLabel:Me="Chat model",sx:De})=>{const $e=Array.isArray(Ee)&&Ee.length>0?Ee:DEFAULT_MODELS,Be=$e.find(Ue=>Ue.id===(Re||"default"));return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.25,minWidth:0,maxWidth:"100%"},children:[jsxRuntimeExports.jsx(Select,{variant:"standard",disableUnderline:!0,value:Re||"default",onChange:Ue=>Te==null?void 0:Te(Ue.target.value),disabled:Oe||je,displayEmpty:!0,renderValue:()=>(Be==null?void 0:Be.label)||"Default",MenuProps:{PaperProps:{sx:{maxWidth:340}}},inputProps:{"aria-label":Me},sx:{maxWidth:{xs:110,sm:160},minWidth:72,color:"text.secondary",fontSize:"0.8125rem",fontWeight:600,lineHeight:1.2,verticalAlign:"middle","& .MuiSelect-select":{py:.5,pr:"22px !important",pl:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"& .MuiSelect-icon":{right:2,color:"text.secondary",fontSize:18},"&.Mui-disabled":{color:"text.disabled"},...De},children:$e.map(Ue=>jsxRuntimeExports.jsx(MenuItem,{value:Ue.id,children:jsxRuntimeExports.jsxs(Box,{sx:{minWidth:0},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",noWrap:!0,children:Ue.label}),Ue.description&&jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{display:"block",maxWidth:280},children:Ue.description})]})},Ue.id))}),je&&jsxRuntimeExports.jsx(CircularProgress,{size:14,sx:{flex:"0 0 auto"}})]})},COMMAND_QUERY_RE=/^\/([A-Za-z0-9_-]*)$/,COMMAND_SLUG_RE=/^\/([A-Za-z0-9_-]+)(?:\s|$)/,SOURCE_TAG_RE=/^@(docs?|database|db|website|web|group|grp)(?:\s+([\s\S]*))?$/i,SOURCE_TAG_KIND={doc:"document",docs:"document",db:"database",database:"database",web:"website",website:"website",grp:"group",group:"group"},SOURCE_TAG_MISSING_MESSAGE={document:"Select at least one document first to use @docs.",group:"Select at least one group first to use @grp.",website:"Select a website connection first to use @web.",database:"Select a database connection first to use @db."},SOURCE_TAG_LIVE_RE=/^@(docs?|database|db|website|web|group|grp)\s([\s\S]*)$/i,SOURCE_TAG_META={document:{label:"Documents only",icon:jsxRuntimeExports.jsx(AttachFile,{fontSize:"small"})},group:{label:"Groups only",icon:jsxRuntimeExports.jsx(Group,{fontSize:"small"})},website:{label:"Website only",icon:jsxRuntimeExports.jsx(Language,{fontSize:"small"})},database:{label:"Database only",icon:jsxRuntimeExports.jsx(DatabaseIcon,{fontSize:"small"})}},COMMAND_REQUIREMENTS={"compare-diff":{minDocs:2,label:"Requires 2 documents"},extraction:{minDocs:1,label:"Requires documents"},"title-commitment-compliance":{minDocs:1,label:"Requires title notes"}}
4047,COMMAND_APP_BADGES={"title-commitment-compliance":"Advanced app"},DEFAULT_AGENT_COMMANDS=[{slug:"extraction",name:"Structured Extraction",description:"Pull structured records from selected documents into a downloadable XLSX.",trigger_examples:["extract invoice line items","build an xlsx from document 12"],minDocs:1},{slug:"compare-diff",name:"Compare & Diff",description:"Compare two document versions and report what changed.",trigger_examples:["compare 17 vs 23","what changed between these two contracts"],minDocs:2},{slug:"title-commitment-compliance",name:"Title Commitment Compliance Review",description:"Review uploaded title commitment requirements against selected title notes/evidence and generate a Word report.",trigger_examples:["review title commitment requirements","generate title compliance report"],minDocs:1,label:"Requires title notes",appBadge:"Advanced app"}],getCommandQuery=Ee=>{const Re=(Ee||"").trimStart().match(COMMAND_QUERY_RE);return Re?Re[1].toLowerCase():null},getCommandSlug=Ee=>{const Re=(Ee||"").trimStart().match(COMMAND_SLUG_RE);return Re?Re[1]:null},getCommandRequirement=Ee=>{var Te,je,Oe,Me,De;const Re=typeof Ee=="string"?Ee:Ee==null?void 0:Ee.slug;if(Ee&&typeof Ee!="string"){const $e=Number(((Te=Ee.launch_requirements)==null?void 0:Te.min_selected_documents)??((je=Ee.document_selection)==null?void 0:je.min_selected_documents)??((Oe=COMMAND_REQUIREMENTS[Re])==null?void 0:Oe.minDocs)??0),Be=((Me=Ee.document_selection)==null?void 0:Me.accepted_document_hint)||((De=COMMAND_REQUIREMENTS[Re])==null?void 0:De.label)||"";return{minDocs:Number.isFinite($e)?$e:0,label:Be}}return COMMAND_REQUIREMENTS[Re]||{minDocs:0,label:""}},normalizeCommands=Ee=>(Ee||[]).filter(Re=>Re==null?void 0:Re.slug).map(Re=>({slug:Re.slug,name:Re.name||Re.slug,description:Re.description||"Run this agent command.",trigger_examples:Array.isArray(Re.trigger_examples)?Re.trigger_examples:[],appBadge:Re.app_badge||Re.appBadge||COMMAND_APP_BADGES[Re.slug]||"",...getCommandRequirement(Re)})),CommandMenu=({commands:Ee,highlightedIndex:Re,loading:Te,error:je,onSelect:Oe,onHighlight:Me})=>jsxRuntimeExports.jsxs(Paper,{elevation:8,sx:{position:"absolute",left:0,right:0,bottom:"calc(100% + 8px)",zIndex:20,maxHeight:{xs:300,sm:360},overflowY:"auto",border:"1px solid",borderColor:"divider",borderRadius:2,p:.75,bgcolor:"background.paper"},onMouseDown:De=>De.preventDefault(),children:[jsxRuntimeExports.jsx(Box,{sx:{px:1,py:.75,borderBottom:"1px solid",borderColor:"divider"},children:jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"text.secondary",fontWeight:700,textTransform:"uppercase"},children:"Agent commands"})}),Te&&jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{px:1.25,py:1.5,color:"text.secondary"},children:"Loading commands..."}),!Te&&je&&jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{px:1.25,py:1.5,color:"warning.main"},children:je}),!Te&&Ee.length===0&&jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{px:1.25,py:1.5,color:"text.secondary"},children:"No matching commands"}),!Te&&Ee.map((De,$e)=>{const Be=$e===Re,Ue=De.trigger_examples.slice(0,2),ze=De.minDocs>0?`/${De.slug} [instructions] [docs]`:`/${De.slug} [instructions]`;return jsxRuntimeExports.jsxs(Box,{role:"button",tabIndex:-1,onMouseEnter:()=>Me($e),onClick:()=>Oe(De),sx:{px:1.25,py:1.1,cursor:"pointer",borderRadius:1,bgcolor:Be?"action.selected":"transparent","&:hover":{bgcolor:"action.hover"}},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:1.5},children:[jsxRuntimeExports.jsxs(Typography,{sx:{fontFamily:"monospace",fontWeight:700,color:"primary.main",whiteSpace:"nowrap"},children:["/",De.slug]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{fontFamily:"monospace",color:"text.secondary",textAlign:"right"},children:ze})]}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mt:.5,color:"text.primary"},children:De.description}),(De.appBadge||De.minDocs>0||Ue.length>0)&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:.75,flexWrap:"wrap",mt:.75},children:[De.appBadge&&jsxRuntimeExports.jsx(Box,{component:"span",sx:{px:.75,py:.25,borderRadius:1,bgcolor:"primary.main",color:"primary.contrastText",fontSize:12,fontWeight:700},children:De.appBadge}),De.minDocs>0&&jsxRuntimeExports.jsx(Box,{component:"span",sx:{px:.75,py:.25,borderRadius:1,bgcolor:"action.selected",color:"primary.main",fontSize:12,fontWeight:600},children:De.label||`Requires ${De.minDocs} docs`}),Ue.map(We=>jsxRuntimeExports.jsx(Box,{component:"span",sx:{px:.75,py:.25,borderRadius:1,bgcolor:"action.hover",color:"text.secondary",fontSize:12,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:We},We))]})]},De.slug)})]}),ChatInput=reactExports.forwardRef(({onSendMessage:Ee,disabled:Re=!1,readOnlyReason:Te=null,onAttachDocuments:je,initialMessage:Oe="",onMessageSet:Me,availableModels:De=[{id:"default",label:"Default"}],selectedModel:$e="default",onSelectedModelChange:Be,modelsLoading:Ue=!1,selectedDocuments:ze=[],selectedGroups:We=[],selectedWebsites:Xe=[],selectedDbConnection:He=null},qe)=>{const Ge=useDispatch(),Ye=useTheme$1(),Ve=useMediaQuery(Ye.breakpoints.down("sm")),[Ke,Qe]=reactExports.useState(""),Ze=reactExports.useRef(null),Je=reactExports.useRef(!1),[ir,rr]=reactExports.useState(!1),ar=reactExports.useRef(null),or=reactExports.useRef(()=>!1),[pr,tr]=reactExports.useState({open:!1,message:"",severity:"info"}),[nr,hr]=reactExports.useState(!1),[sr,xr]=reactExports.useState(!1),[Rr,br]=reactExports.useState(""),[wr,vr]=reactExports.useState([]),[Dr,kr]=reactExports.useState(!1),[cr,dr]=reactExports.useState(""),[ur,gr]=reactExports.useState(0),[_r,Ir]=reactExports.useState(!1),[Ar,Tr]=reactExports.useState(null),Nr=getCommandQuery(Ke),Br=!Re&&!_r&&Nr!==null,Hr=reactExports.useMemo(()=>Nr===null?[]:(wr.length>0?wr:DEFAULT_AGENT_COMMANDS).filter(tn=>`${tn.slug} ${tn.name} ${tn.description}`.toLowerCase().includes(Nr)),[Nr,wr]),Vr=(cn,tn="info")=>{tr({open:!0,message:cn,severity:tn})},mr=()=>{tr({...pr,open:!1})};reactExports.useImperativeHandle(qe,()=>({focus:()=>{Ze.current&&Ze.current.focus()},send:Cr,setMessageOnly:cn=>{const tn=(cn||"").trim();tn&&!Re&&(Qe(tn),setTimeout(()=>{Ze.current&&Ze.current.focus()},50))},setMessageAndSend:cn=>{const tn=(cn||"").trim();tn&&!Re&&(Qe(tn),setTimeout(()=>{Ze.current&&Ze.current.focus()},50),setTimeout(()=>{Ee(tn),Qe("")},300))}})),reactExports.useEffect(()=>{Ze.current&&!Re&&Ze.current.focus()},[Re]),reactExports.useEffect(()=>{if(!Br||Je.current)return;let cn=!1;return kr(!0),dr(""),(async()=>{try{const tn=await agentService.listAgents(),Qr=normalizeCommands(tn==null?void 0:tn.agents);cn||(vr(Qr),Je.current=!0)}catch{cn||(vr(DEFAULT_AGENT_COMMANDS),dr("Using default commands while the live command list is unavailable."),Je.current=!0)}finally{cn||kr(!1)}})(),()=>{cn=!0}},[Br]),reactExports.useEffect(()=>{gr(0),Nr===null&&Ir(!1)},[Nr]),reactExports.useEffect(()=>{ur>=Hr.length&&gr(0)},[Hr.length,ur]),reactExports.useEffect(()=>{if(!Re&&Ze.current){const cn=setTimeout(()=>{Ze.current.focus()},100);return()=>clearTimeout(cn)}},[Re]),reactExports.useEffect(()=>{Oe&&(Qe(Oe),Me&&Me(),setTimeout(()=>{Ze.current&&Ze.current.focus()},50))},[Oe,Me]),reactExports.useEffect(()=>{Ke.trim()||hr(!1)},[Ke]);const Sr=()=>{const cn=Ke.trim();
4047if(!cn){Vr("Please type a message to save as favorite","warning");return}if(cn.length>4e3){Vr("Prompt must not exceed 4000 characters","error");return}xr(!0)},Lr=async()=>{if(Rr.trim())try{await Ge(saveFavorite({prompt:Ke.trim(),name:Rr.trim()})).unwrap(),hr(!0),xr(!1),br(""),await Ge(fetchFavorites(!0)),Vr("Saved to favorites!","success")}catch(cn){const tn=typeof cn=="string"?cn:(cn==null?void 0:cn.message)||"Failed to save favorite";Vr(tn,"error")}},jr=()=>{xr(!1),br("")},fr=reactExports.useCallback((cn,{fromVoice:tn=!1}={})=>{var on;if(!cn||Re)return!1;if(Ar){const Yr=Ar.kind;return{document:(ze||[]).length>0,group:(We||[]).length>0,website:(Xe||[]).length>0,database:!!He}[Yr]?(Ee(cn,{fromVoice:tn,sourceOverride:Yr}),Qe(""),Tr(null),hr(!1),setTimeout(()=>{Ze.current&&Ze.current.focus()},100),!0):(Vr(SOURCE_TAG_MISSING_MESSAGE[Yr],"warning"),!1)}const Qr=cn.match(SOURCE_TAG_RE),wn=(on=Qr==null?void 0:Qr[2])==null?void 0:on.trim();if(Qr&&wn){const Yr=SOURCE_TAG_KIND[Qr[1].toLowerCase()];return{document:(ze||[]).length>0,group:(We||[]).length>0,website:(Xe||[]).length>0,database:!!He}[Yr]?(Ee(wn,{fromVoice:tn,sourceOverride:Yr}),Qe(""),hr(!1),setTimeout(()=>{Ze.current&&Ze.current.focus()},100),!0):(Vr(SOURCE_TAG_MISSING_MESSAGE[Yr],"warning"),!1)}const gn=getCommandSlug(cn),In=gn?wr.find(Yr=>Yr.slug===gn)||DEFAULT_AGENT_COMMANDS.find(Yr=>Yr.slug===gn):null,yn=getCommandRequirement(In||gn),Mn=(ze||[]).length;return yn.minDocs>Mn&&je?(Vr(`${cn.split(/\s+/)[0]} needs ${yn.minDocs===1?"a selected document":`at least ${yn.minDocs} selected documents`}.`,"info"),je({commandSlug:gn,minDocuments:yn.minDocs}),!1):(Ee(cn,{fromVoice:tn}),Qe(""),hr(!1),setTimeout(()=>{Ze.current&&Ze.current.focus()},100),!0)},[wr,Re,je,Ee,ze,We,Xe,He,Ar]);reactExports.useEffect(()=>{or.current=fr},[fr]);const Cr=()=>{fr(Ke.trim())},Mr=cn=>{Qe(`/${cn.slug} `),Ir(!0),cn.minDocs>(ze||[]).length&&je&&je({commandSlug:cn.slug,minDocuments:cn.minDocs}),setTimeout(()=>{Ze.current&&Ze.current.focus()},50)},$r=cn=>{if(Ar&&Ke===""&&cn.key==="Backspace"){cn.preventDefault(),Tr(null);return}if(Br){if(cn.key==="ArrowDown"){cn.preventDefault(),gr(tn=>Hr.length?(tn+1)%Hr.length:0);return}if(cn.key==="ArrowUp"){cn.preventDefault(),gr(tn=>Hr.length?(tn-1+Hr.length)%Hr.length:0);return}if((cn.key==="Enter"||cn.key==="Tab")&&Hr.length>0){cn.preventDefault(),Mr(Hr[ur]||Hr[0]);return}if(cn.key==="Escape"){cn.preventDefault(),Ir(!0);return}}cn.key==="Enter"&&!cn.shiftKey&&(cn.preventDefault(),Cr())},Fr=()=>{const cn=window.SpeechRecognition||window.webkitSpeechRecognition;if(!cn){Vr("Speech recognition is not supported in your browser. Please use Chrome, Edge, or Safari.","error");return}if(!ar.current){const Qr=new cn;Qr.continuous=!1,Qr.interimResults=!1,Qr.lang="en-US",Qr.onstart=()=>{rr(!0),Vr("Listening...","info")},Qr.onresult=wn=>{const gn=(wn.results[0][0].transcript||"").trim();if(!gn)return;or.current(gn,{fromVoice:!0})&&Vr("Message sent","success")},Qr.onerror=wn=>{console.error("Speech recognition error:",wn.error),rr(!1);let gn="Speech recognition error. ";wn.error==="no-speech"?gn="No speech detected. Please try again.":wn.error==="audio-capture"?gn="No microphone found. Please check your microphone settings.":wn.error==="not-allowed"?gn="Microphone permission denied. Please allow microphone access.":gn+=wn.error,Vr(gn,"error")},Qr.onend=()=>{rr(!1)},ar.current=Qr}const tn=ar.current;if(ir)tn.stop(),rr(!1);else try{tn.start()}catch(Qr){Qr.name==="InvalidStateError"?(tn.stop(),setTimeout(()=>tn.start(),100)):(console.error("Error starting recognition:",Qr),Vr("Failed to start voice recognition","error"))}},Kr=Ke.length,an=4e3,Wr=Kr>an*.8,hn=Kr>an;return jsxRuntimeExports.jsxs(Paper,{elevation:3,sx:{p:{xs:1.25,sm:2},borderTop:"1px solid",borderColor:"divider"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"flex-end",gap:1},children:[je&&jsxRuntimeExports.jsx(IconButton,{color:"primary",onClick:je,disabled:Re,sx:{mb:.5},title:"Select source",children:jsxRuntimeExports.jsx(AttachFile,{})}),jsxRuntimeExports.jsxs(Box,{sx:{flex:1,position:"relative"},children:[Br&&jsxRuntimeExports.jsx(CommandMenu,{commands:Hr,highlightedIndex:ur,loading:Dr,error:cr,onSelect:Mr,onHighlight:gr}),jsxRuntimeExports.jsx(TextField,{inputRef:Ze,fullWidth:!0,multiline:!0,maxRows:6,value:Ke,onChange:cn=>{const tn=cn.target.value;if(!(tn.length>4e3)){if(!Ar){const Qr=tn.match(SOURCE_TAG_LIVE_RE);if(Qr){const wn=SOURCE_TAG_KIND[Qr[1].toLowerCase()];Tr({kind:wn}),Qe(Qr[2]||"");return}}Qe(tn),getCommandQuery(tn)!==null&&Ir(!1)}},onKeyDown:$r,placeholder:Ar?"Ask your question...":"Type your message... (Shift+Enter for new line)",disabled:Re,variant:"outlined",inputProps:{"data-tour":"chat-input"},InputProps:{startAdornment:Ar?jsxRuntimeExports.jsx(InputAdornment,{position:"start",sx:{alignSelf:"flex-start",mt:1.25,ml:.25},children:jsxRuntimeExports.jsx(Chip,{size:"small",color:"primary",variant:"filled",icon:SOURCE_TAG_META[Ar.kind].icon,label:SOURCE_TAG_META[Ar.kind].label,onDelete:()=>Tr(null)})}):void 0,endAdornment:Ve?null:jsxRuntimeExports.jsxs(InputAdornment,{position:"end",sx:{mr:1,gap:.5,alignSelf:"center",maxHeight:"none",flexShrink:0},children:[jsxRuntimeExports.jsx(Box,{sx:{display:"flex",alignItems:"center",gap:.5,minWidth:0,flexShrink:1},children:jsxRuntimeExports.jsx(ModelSelector,{availableModels:De,selectedModel:$e,onChange:Be,loading:Ue,disabled:Re,sx:{maxWidth:160,"& .MuiSelect-select":{py:.25,pr:"22px !important",pl:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})}),jsxRuntimeExports.jsx(IconButton,{color:nr?"warning":"default",onClick:Sr,disabled:Re||!Ke.trim()||hn,edge:"end",size:"small",title:nr?"Saved as favorite":"Save as favorite",sx:{flex:"0 0 auto"},children:nr?jsxRuntimeExports.jsx(Favorite,{}):jsxRuntimeExports.jsx(FavoriteBorder,{})}),jsxRuntimeExports.jsx(IconButton,{color:ir?"error":"primary",onClick:Fr,disabled:Re||hn,size:"small",sx:{flex:"0 0 auto",transition:"all 0.2s",bgcolor:ir?"error.light":"transparent","&:hover":{bgcolor:ir?"error.light":"action.hover"}},title:ir?"Stop recording":"Start voice input",children:ir?jsxRuntimeExports.jsx(MicOff,{}):jsxRuntimeExports.jsx(Mic,{})}),jsxRuntimeExports.jsx(IconButton,{color:"primary",onClick:Cr,disabled:Re||!Ke.trim()||hn,size:"small",sx:{flex:"0 0 auto",bgcolor:"#002D79",color:"white","&:hover":{bgcolor:"#001D52"}
4047,"&.Mui-disabled":{bgcolor:"action.disabledBackground",color:"action.disabled"}},title:"Send message",children:jsxRuntimeExports.jsx(Send,{})})]})},sx:{"& .MuiOutlinedInput-root":{borderRadius:2,alignItems:"center",py:0,"& textarea":{fontSize:{xs:"0.95rem",sm:"1rem"},lineHeight:1.35},"& .MuiOutlinedInput-input":{padding:{xs:"12px 12px",sm:void 0}},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#002D79"}},"& .MuiInputLabel-root.Mui-focused":{color:"#002D79"}}}),Ve&&jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:.5,flexWrap:"wrap",rowGap:.75,width:"100%",mt:.5,px:.25},children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,flexWrap:"wrap",flex:"1 1 auto",minWidth:0},children:[jsxRuntimeExports.jsx(Box,{sx:{display:"flex",alignItems:"center",gap:.25,minWidth:0,maxWidth:"100%"},children:jsxRuntimeExports.jsx(ModelSelector,{availableModels:De,selectedModel:$e,onChange:Be,loading:Ue,disabled:Re})}),jsxRuntimeExports.jsx(IconButton,{color:nr?"warning":"default",onClick:Sr,disabled:Re||!Ke.trim()||hn,size:"small",title:nr?"Saved as favorite":"Save as favorite",sx:{flex:"0 0 auto"},children:nr?jsxRuntimeExports.jsx(Favorite,{}):jsxRuntimeExports.jsx(FavoriteBorder,{})}),jsxRuntimeExports.jsx(IconButton,{color:ir?"error":"primary",onClick:Fr,disabled:Re||hn,size:"small",sx:{flex:"0 0 auto",transition:"all 0.2s",bgcolor:ir?"error.light":"transparent","&:hover":{bgcolor:ir?"error.light":"action.hover"}},title:ir?"Stop recording":"Start voice input",children:ir?jsxRuntimeExports.jsx(MicOff,{}):jsxRuntimeExports.jsx(Mic,{})}),jsxRuntimeExports.jsx(IconButton,{color:"primary",onClick:Cr,disabled:Re||!Ke.trim()||hn,size:"small",sx:{flex:"0 0 auto",bgcolor:"#002D79",color:"white","&:hover":{bgcolor:"#001D52"},"&.Mui-disabled":{bgcolor:"action.disabledBackground",color:"action.disabled"}},title:"Send message",children:jsxRuntimeExports.jsx(Send,{})})]})}),(Wr||hn)&&jsxRuntimeExports.jsxs(Typography,{variant:"caption",sx:{display:"block",mt:-.25,color:hn?"error.main":"warning.main",textAlign:"right"},children:[Kr," / ",an," characters"]})]})]}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{display:"block",mt:1,color:Te?"warning.main":"text.secondary",textAlign:"center",fontSize:{xs:"0.8rem",md:"0.9rem"}},children:Te||(Re?"Waiting for response...":"")}),jsxRuntimeExports.jsx(Snackbar,{open:pr.open,autoHideDuration:6e3,onClose:mr,anchorOrigin:{vertical:"top",horizontal:"right"},children:jsxRuntimeExports.jsx(Alert,{onClose:mr,severity:pr.severity,sx:{width:"100%"},children:pr.message})}),jsxRuntimeExports.jsxs(Dialog,{open:sr,onClose:(cn,tn)=>{tn==="backdropClick"||tn==="escapeKeyDown"||jr()},maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Save to Favorites"}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(TextField,{autoFocus:!0,fullWidth:!0,label:"Title Name",placeholder:"e.g. Summarize contract",value:Rr,onChange:cn=>{cn.target.value.length<=50&&br(cn.target.value)},sx:{mt:1}}),jsxRuntimeExports.jsxs("div",{style:{fontSize:"12px",color:Rr.length>50?"#ef4444":"#6b7280",marginTop:"4px",textAlign:"right"},children:[Rr.length,"/50 characters"]}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:2},children:["Preview: ",Ke.substring(0,100),Ke.length>100&&"..."]})]}),jsxRuntimeExports.jsxs(DialogActions,{sx:{padding:"16px 24px",gap:1.5},children:[jsxRuntimeExports.jsx(Button,{onClick:jr,variant:"outlined",sx:{minWidth:"100px",height:"40px",fontSize:"14px",fontWeight:500,textTransform:"none",borderWidth:"1.5px",borderColor:"divider",color:"text.primary","&:hover":{borderWidth:"1.5px",borderColor:"text.secondary",backgroundColor:"action.hover"}},children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Lr,variant:"contained",disabled:!Rr.trim(),sx:{minWidth:"100px",height:"40px",fontSize:"14px",fontWeight:500,textTransform:"none",backgroundColor:"primary.main","&:hover":{backgroundColor:"primary.dark"}},children:"Save"})]})]})]})});ChatInput.displayName="ChatInput";const ShareChatDialog=({open:Ee,session:Re,onClose:Te,onShared:je})=>{const Oe=useDispatch(),Me=(Re==null?void 0:Re.session_id)??(Re==null?void 0:Re.id)??null,De=useSelector(selectSessionShares(Me)),$e=useSelector(selectShareRecipients),Be=useSelector(selectShareRecipientsLoading),Ue=useSelector(selectSharingInProgress),[ze,We]=reactExports.useState([]),[Xe,He]=reactExports.useState("view"),[qe,Ge]=reactExports.useState(""),[Ye,Ve]=reactExports.useState([]),[Ke,Qe]=reactExports.useState(null);reactExports.useEffect(()=>{Ee&&Me&&(We([]),He("view"),Ge(""),Ve([]),Oe(fetchShareRecipients()),Oe(fetchSessionShares(Me)))},[Ee,Me,Oe]);const Ze=new Set(De.filter(pr=>pr.grantee_type==="user").map(pr=>String(pr.grantee_id))),Je=($e.users||[]).filter(pr=>!Ze.has(String(pr.id))),ir=async()=>
4047{if(Ue||!ze.length)return;Ge(""),Ve([]);const pr=await Oe(shareSession({sessionId:Me,userIds:ze.map(tr=>tr.id),groupIds:[],permission:Xe}));shareSession.fulfilled.match(pr)?(We([]),Ve(pr.payload.warnings||[]),je==null||je(pr.payload)):Ge(pr.payload||"Failed to share chat session")},rr=async pr=>{const tr=`${pr.grantee_type}-${pr.grantee_id}`;Qe(tr);try{await Oe(revokeSessionShare({sessionId:Me,userId:pr.grantee_type==="user"?pr.grantee_id:void 0,groupId:pr.grantee_type==="group"?pr.grantee_id:void 0}))}finally{Qe(null)}},ar=()=>{Ge(""),Ve([]),Te()},or=(pr,tr)=>{tr==="backdropClick"||tr==="escapeKeyDown"||ar()};return Re?jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:or,maxWidth:"sm",fullWidth:!0,children:[jsxRuntimeExports.jsxs(DialogTitle,{children:['Share "',Re.name||Re.title||"this chat",'"']}),jsxRuntimeExports.jsx(DialogContent,{dividers:!0,children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:2},children:[qe&&jsxRuntimeExports.jsx(Alert,{severity:"error",onClose:()=>Ge(""),children:qe}),Ye.length>0&&jsxRuntimeExports.jsx(Alert,{severity:"warning",onClose:()=>Ve([]),children:Ye.map((pr,tr)=>jsxRuntimeExports.jsx("div",{children:pr},tr))}),Be?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",py:2},children:jsxRuntimeExports.jsx(CircularProgress,{size:24})}):jsxRuntimeExports.jsx(Autocomplete,{multiple:!0,options:Je,loading:Be,getOptionLabel:pr=>`${pr.name}${pr.email?` (${pr.email})`:""}`,value:ze,onChange:(pr,tr)=>We(tr),renderInput:pr=>jsxRuntimeExports.jsx(TextField,{...pr,label:"Share with users",placeholder:"Search users..."}),renderOption:(pr,tr)=>reactExports.createElement(Box,{component:"li",...pr,key:tr.id,sx:{display:"flex",alignItems:"center",gap:1.5}},jsxRuntimeExports.jsx(UserAvatar,{userId:tr.id,displayName:tr.name,size:"small"}),jsxRuntimeExports.jsxs(Box,{sx:{overflow:"hidden"},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",noWrap:!0,children:tr.name}),tr.email&&jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",noWrap:!0,component:"div",children:tr.email})]})),renderTags:(pr,tr)=>pr.map((nr,hr)=>jsxRuntimeExports.jsx(Chip,{label:nr.name,...tr({index:hr}),size:"small",color:"primary"},nr.id)),noOptionsText:Je.length===0?"No users available in your groups. You may need to be added to a group first.":"No users found"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mb:1},children:"Permission"}),jsxRuntimeExports.jsxs(ToggleButtonGroup,{value:Xe,exclusive:!0,size:"small",onChange:(pr,tr)=>tr&&He(tr),children:[jsxRuntimeExports.jsx(ToggleButton,{value:"view",children:"View Only"}),jsxRuntimeExports.jsx(ToggleButton,{value:"edit",children:"Can Edit"})]})]}),jsxRuntimeExports.jsx(Button,{variant:"contained",onClick:ir,disabled:Ue||!ze.length,startIcon:Ue?jsxRuntimeExports.jsx(CircularProgress,{size:16,color:"inherit"}):null,children:Ue?"Sharing...":"Share"}),jsxRuntimeExports.jsx(Divider,{}),jsxRuntimeExports.jsxs(Typography,{variant:"subtitle2",children:["Currently shared with ",De.length>0?`(${De.length})`:""]}),De.length===0?jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Not shared with anyone yet."}):jsxRuntimeExports.jsx(List,{dense:!0,children:De.filter(pr=>pr.grantee_type==="user").map(pr=>{const tr=`${pr.grantee_type}-${pr.grantee_id}`;return jsxRuntimeExports.jsxs(ListItem,{secondaryAction:jsxRuntimeExports.jsx(IconButton,{edge:"end",size:"small",onClick:()=>rr(pr),disabled:Ke===tr,"aria-label":"Revoke share",children:Ke===tr?jsxRuntimeExports.jsx(CircularProgress,{size:16}):jsxRuntimeExports.jsx(DeleteIcon,{fontSize:"small"})}),children:[jsxRuntimeExports.jsx(UserAvatar,{userId:pr.grantee_id,displayName:pr.grantee_name,size:"small",sx:{mr:1.5}}),jsxRuntimeExports.jsx(ListItemText,{primary:pr.grantee_name,secondary:pr.grantee_email}),jsxRuntimeExports.jsx(Chip,{label:pr.permission==="edit"?"Can edit":"View",size:"small",color:pr.permission==="edit"?"primary":"default",sx:{mr:1}})]},tr)})})]})}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:ar,children:"Close"})})]}):null},SOURCE_CHIP_TYPES={DOCUMENT:"document",GROUP:"group",WEBSITE:"website",DATABASE:"database"},TYPE_LABELS={[SOURCE_CHIP_TYPES.DOCUMENT]:"Document",[SOURCE_CHIP_TYPES.GROUP]:"Group",[SOURCE_CHIP_TYPES.WEBSITE]:"Website",[SOURCE_CHIP_TYPES.DATABASE]:"Database"};function getSourceSupplementaryLines(Ee){if(!Ee)return[];const Re=(Ee.tooltipTitle||Ee.name||"").trim().toLowerCase(),Te=(TYPE_LABELS[Ee.type]||"").toLowerCase(),je=new Set([Re,Te].filter(
4047Boolean));return[Ee.detail,...Array.isArray(Ee.tooltipLines)?Ee.tooltipLines:[]].map(Me=>typeof Me=="string"?Me.trim():"").filter(Boolean).filter(Me=>{const De=Me.toLowerCase();return je.has(De)?!1:(je.add(De),!0)})}const getDocumentName=(Ee,Re={})=>{const Te=String(Ee);return Re[Ee]||Re[Te]||Re[Number(Te)]||null},getGroupId=Ee=>(Ee==null?void 0:Ee.GroupID)??(Ee==null?void 0:Ee.id)??(Ee==null?void 0:Ee.group_id),getGroupName=Ee=>(Ee==null?void 0:Ee.GroupName)||(Ee==null?void 0:Ee.name)||"",getGroupDescription=Ee=>((Ee==null?void 0:Ee.description)??(Ee==null?void 0:Ee.Description)??"").trim(),formatRelativeTime=Ee=>{if(!Ee)return null;const Re=new Date(Ee);if(Number.isNaN(Re.getTime()))return null;const Te=Date.now()-Re.getTime(),je=Math.floor(Te/(1e3*60*60));return je<1?"Last synced less than 1h ago":je<24?`Last synced ${je}h ago`:`Last synced ${Math.floor(je/24)}d ago`};function buildSourceAttachments({documents:Ee=[],documentNames:Re={},groups:Te=[],allGroups:je=[],websites:Oe=[],websiteIds:Me=[],dbConnection:De=null,dbConnectionId:$e=null,activeDbConnections:Be=[],activeWebsiteConnections:Ue=[]}){const ze=[],We=new Map((Array.isArray(je)?je:[]).map(Ye=>[String(getGroupId(Ye)),Ye])),Xe=new Set((Array.isArray(Be)?Be:[]).map(Ye=>String(Ye.id))),He=new Set((Array.isArray(Ue)?Ue:[]).map(Ye=>String(Ye.id))),qe=new Set;for(const Ye of Ee){const Ve=getDocumentName(Ye,Re)||`Document ${Ye}`;ze.push({id:`doc-${Ye}`,type:SOURCE_CHIP_TYPES.DOCUMENT,sourceId:Ye,name:Ve,detail:"Document",tooltipTitle:Ve,tooltipLines:["Document"],unavailable:!1,previewType:"document"})}for(const Ye of Te){const Ve=We.get(String(Ye)),Ke=Ve?getGroupName(Ve):`Group ${Ye}`,Qe=(Ve==null?void 0:Ve.document_count)??(Ve==null?void 0:Ve.documentCount),Ze=(Ve==null?void 0:Ve.member_count)??(Ve==null?void 0:Ve.memberCount),Je=[];Qe!=null&&Je.push(`${Qe} document${Qe===1?"":"s"}`),Ze!=null&&Je.push(`${Ze} member${Ze===1?"":"s"}`);const ir=Je.length>0?Je.join(" · "):"",rr=getGroupDescription(Ve)||"No description",ar=!Ve;ze.push({id:`group-${Ye}`,type:SOURCE_CHIP_TYPES.GROUP,sourceId:Ye,name:Ke,detail:ar?"":rr,tooltipTitle:Ke,tooltipLines:ar?["Group unavailable â it may have been deleted or access was revoked"]:[rr,...ir?[ir]:[]],unavailable:ar,previewType:"group",meta:{docCount:Qe,memberCount:Ze,group:Ve,description:rr}})}for(const Ye of Oe){qe.add(String(Ye.id));const Ve=(Ye.url||"").trim(),Ke=Ye.connectionName||Ve||`Website ${Ye.id}`,Qe=formatRelativeTime(Ye.last_synced_at||Ye.lastSyncedAt||Ye.updated_at),Ze=[];Ve&&Ve!==Ke&&Ze.push(Ve),Qe&&Ze.push(Qe),ze.push({id:`web-${Ye.id}`,type:SOURCE_CHIP_TYPES.WEBSITE,sourceId:Ye.id,name:Ke,detail:Ze[0]||"",tooltipTitle:Ke,tooltipLines:Ze,unavailable:!He.has(String(Ye.id)),previewType:"website",meta:{website:Ye}})}const Ge=(Array.isArray(Me)?Me:[]).filter(Ye=>!qe.has(String(Ye)));for(const Ye of Ge){const Ve=Ue.find(Ze=>String(Ze.id)===String(Ye)),Ke=((Ve==null?void 0:Ve.url)||"").trim(),Qe=(Ve==null?void 0:Ve.connectionName)||Ke||`Website ${Ye}`;ze.push({id:`web-${Ye}`,type:SOURCE_CHIP_TYPES.WEBSITE,sourceId:Ye,name:Qe,detail:"",tooltipTitle:Qe,tooltipLines:["Website connection unavailable or sync failed"],unavailable:!0,previewType:"website",meta:{website:Ve||{id:Ye,url:""}}})}if(De){const Ye=formatRelativeTime(De.last_synced_at||De.updated_at),Ve=De.estimated_rows||De.row_count||De.record_count,Ke=De.table_name||De.databaseName||De.database_name,Qe=De.connectionName||Ke||"Database",Ze=Ve?`${Ke||"Database"} â ${Ve} rows`:`${De.dbType||De.db_type||"Database"} â ${De.host||""}/${De.databaseName||De.database_name||""}`.replace(/\/$/,""),Je=[];Ze&&Ze!==Qe&&Je.push(Ze),Ye&&Je.push(Ye),ze.push({id:`db-${De.id}`,type:SOURCE_CHIP_TYPES.DATABASE,sourceId:De.id,name:Qe,detail:Je[0]||"",tooltipTitle:Qe,tooltipLines:Je,unavailable:!Xe.has(String(De.id)),previewType:"database",meta:{dbConnection:De}})}else if($e){const Ye=`Database ${$e}`;ze.push({id:`db-${$e}`,type:SOURCE_CHIP_TYPES.DATABASE,sourceId:$e,name:Ye,detail:"",tooltipTitle:Ye,tooltipLines:["Database connection unavailable or access was revoked"],unavailable:!0,previewType:"database",meta:{dbConnection:{id:$e}}})}return ze}function buildAttachedScopeSnapshot(Ee=[]){const Re=Array.isArray(Ee)?Ee:[];return{items:Re.map(({id:Te,type:je,sourceId:Oe,name:Me,unavailable:De})=>({id:Te,type:je,sourceId:Oe,name:Me,unavailable:!!De})),totalCount:Re.length}}const TYPE_ICONS={[SOURCE_CHIP_TYPES.DOCUMENT]:InsertDriveFile,[SOURCE_CHIP_TYPES.GROUP]:Group,[SOURCE_CHIP_TYPES.WEBSITE]:Language,[SOURCE_CHIP_TYPES.DATABASE]:DatabaseIcon},MAX_VISIBLE=3,truncateName=(Ee,Re=28)=>Ee?Ee.length<=Re?Ee:`${Ee.slice(0,Re-1)}â¦`:"",SourcePreviewDialog=({item:Ee,open:Re,onClose:Te})=>{if(!Ee)return null;const je=Ee.tooltipTitle||Ee.name,Oe=getSourceSupplementaryLines(Ee);return jsxRuntimeExports.jsxs(Dialog,{open:Re,onClose:Te,maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",pr:1},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Ee.unavailable&&jsxRuntimeExports.jsx(ErrorIcon,{color:"error",fontSize:"small"}),jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",noWrap:!0,title:je,children:je})]}),jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:Te,"aria-label":"Close preview",children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})})]}),jsxRuntimeExports.jsxs(DialogContent,{dividers:!0,children:[Ee.unavailable&&jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"error",sx:{mb:1.5},children:"This source is unavailable. It may have been deleted, permissions were revoked, or sync failed."}),Oe.map(Me=>jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:.5},children:Me},Me))]}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:Te,children:"Close"})})]})},SourceChip=({item:Ee,onRemove:Re,onPreview:Te,showRemove:je})=>{const Oe=TYPE_ICONS[Ee.type]||InsertDriveFile,Me=getSourceSupplementaryLines(Ee),De=jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",component:"div",sx:{fontWeight:600},children:Ee.tooltipTitle||Ee.name}),Me.map($e=>jsxRuntimeExports.jsx(Typography,{variant:"caption",component:"div",display:"block",children:$e},$e)),Ee.unavailable&&jsxRuntimeExports.jsx(Typography,{variant:"caption",component:"div",color:"error.light",sx:{mt:.5},children:"Unavailable â excluded from queries"})]});return jsxRuntimeExports.jsx(Tooltip,{title:De,arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(Chip,{icon:Ee.unavailable?jsxRuntimeExports.jsx(ErrorIcon,{sx:{fontSize:18}}):jsxRuntimeExports.jsx(Oe,{sx:{fontSize:18}}),label:truncateName(Ee.name),size:"small",variant:"outlined",color:Ee.unavailable?"error":"default",onClick:()=>Te==null?void 0:Te(Ee),onDelete:je?()=>Re==null?void 0:Re(Ee):void 0,deleteIcon:je?jsxRuntimeExports.jsx(Close$1,{sx:{fontSize:"16px !important"}}):void 0,sx:{flexShrink:0,maxWidth:{xs:180,sm:240},cursor:Te?"pointer":"default","& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis"}}})})},SourceAttachmentChips=({items:Ee=[],onRemove:Re,onPreview:Te,showRemove:je=!0,maxVisible:Oe=MAX_VISIBLE})=>{const[Me,De]=reactExports.useState(!1);if(!Array.isArray(Ee)||Ee.length===0)return null;const $e=Ee.length>Oe+1,Be=!$e||Me?Ee:Ee.slice(0,Oe),Ue=$e&&!Me?Ee.length-Oe:0;return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.75,px:{xs:1.5,sm:2},py:1,overflowX:"auto",flexWrap:{xs:"nowrap",sm:Me?"wrap":"nowrap"},borderTop:"1px solid",borderColor:"divider",bgcolor:"background.paper","&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{bgcolor:"action.selected",borderRadius:3}},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{flexShrink:0,fontWeight:600,mr:.25},children:"Sources"}),Be.map(ze=>jsxRuntimeExports.jsx(SourceChip,{item:ze,onRemove:Re,onPreview:Te,showRemove:je},ze.id)),Ue>0&&jsxRuntimeExports.jsx(Chip,{label:`+${Ue} more`,size:"small",variant:"filled",onClick:()=>
4047De(!0),sx:{flexShrink:0,cursor:"pointer"}}),$e&&Me&&jsxRuntimeExports.jsx(Chip,{label:"Show less",size:"small",variant:"outlined",onClick:()=>De(!1),sx:{flexShrink:0,cursor:"pointer"}})]})},NO_CACHE$2={cache:!1},dbConnectionService={async listAvailable(){var Re;return((Re=(await cachedAxios.get("/database-connections/available",{cache:!1})).data)==null?void 0:Re.connections)||[]},async list(){var Re;return((Re=(await cachedAxios.get("/database-connections",NO_CACHE$2)).data)==null?void 0:Re.connections)||[]},async get(Ee){var Te;return((Te=(await cachedAxios.get(`/database-connections/${Ee}`,NO_CACHE$2)).data)==null?void 0:Te.connection)||null},async create(Ee){var Te;return((Te=(await cachedAxios.post("/database-connections",Ee)).data)==null?void 0:Te.connection)||null},async update(Ee,Re){var je;return((je=(await cachedAxios.patch(`/database-connections/${Ee}`,Re)).data)==null?void 0:je.connection)||null},async remove(Ee){await cachedAxios.delete(`/database-connections/${Ee}`)},async setActive(Ee,Re){var je;return((je=(await cachedAxios.patch(`/database-connections/${Ee}/active`,{isActive:Re})).data)==null?void 0:je.connection)||null},async testConnection(Ee){return(await cachedAxios.post("/database-connections/test",Ee)).data},async refreshSchema(Ee){return(await cachedAxios.post(`/database-connections/${Ee}/refresh-schema`,{},{cache:!1,timeout:12e4})).data},async testConnectionWithSchema(Ee){return(await cachedAxios.post("/database-connections/test-schema",Ee,{cache:!1,timeout:12e4})).data},async getSyncLogs(Ee=1,Re=15,Te=null){const je={page:Ee,per_page:Re};return Te!=null&&(je.connection_id=Te),(await cachedAxios.get("/database-connections/sync-logs",{params:je,cache:!1})).data},async getQueryLogs(Ee,Re=1,Te=20,je={}){var De;const Oe=new URLSearchParams;return Oe.set("page",Re),Oe.set("per_page",Te),(De=je.status)!=null&&De.length&&je.status.forEach($e=>Oe.append("status",$e)),je.search&&Oe.set("search",je.search),je.dateFrom&&Oe.set("date_from",je.dateFrom),je.dateTo&&Oe.set("date_to",je.dateTo),je.tableName&&Oe.set("table_name",je.tableName),je.userSearch&&Oe.set("user_search",je.userSearch),je.minDurationMs!=null&&je.minDurationMs!==""&&Oe.set("min_duration_ms",je.minDurationMs),je.maxDurationMs!=null&&je.maxDurationMs!==""&&Oe.set("max_duration_ms",je.maxDurationMs),(await cachedAxios.get(`/database-connections/${Ee}/query-logs?${Oe.toString()}`,{cache:!1})).data}},NO_CACHE$1={cache:!1},websiteConnectionService={async listAvailable(){var Re;return((Re=(await cachedAxios.get("/website-connections/available",{cache:!1})).data)==null?void 0:Re.connections)||[]},async list(){var Re;return((Re=(await cachedAxios.get("/website-connections",NO_CACHE$1)).data)==null?void 0:Re.connections)||[]},async get(Ee){var Te;return((Te=(await cachedAxios.get(`/website-connections/${Ee}`,NO_CACHE$1)).data)==null?void 0:Te.connection)||null},async create(Ee){var Te;return((Te=(await cachedAxios.post("/website-connections",Ee)).data)==null?void 0:Te.connection)||null},async update(Ee,Re){var je;return((je=(await cachedAxios.patch(`/website-connections/${Ee}`,Re)).data)==null?void 0:je.connection)||null},async remove(Ee){await cachedAxios.delete(`/website-connections/${Ee}`)},async setActive(Ee,Re){var je;return((je=(await cachedAxios.patch(`/website-connections/${Ee}/active`,{isActive:Re})).data)==null?void 0:je.connection)||null},async testConnection(Ee){return(await cachedAxios.post("/website-connections/test",Ee)).data}},NO_CACHE={cache:!1},normalizeWebGroup=Ee=>!Ee||typeof Ee!="object"?Ee:{...Ee,id:Ee.id??null,name:Ee.name??"",description:Ee.description??"",parent_group_id:Ee.parentGroupId??null,parent_group_name:Ee.parentGroupName??null,created_at:Ee.createdAt??null},webGroupService={async getWebGroups(){var Te;return(((Te=(await cachedAxios.get("/web-groups",NO_CACHE)).data)==null?void 0:Te.webGroups)||[]).map(normalizeWebGroup)},async getAvailableWebGroups(){var Te;return(((Te=(await cachedAxios.get("/web-groups/available",{cache:!1})).data)==null?void 0:Te.webGroups)||[]).map(normalizeWebGroup)},async getAllAssignments(){var Re;return((Re=(await cachedAxios.get("/web-assignments",NO_CACHE)).data)==null?void 0:Re.assignments)||[]},async createWebGroup({name:Ee,description:Re,parentGroupId:Te}){var Oe;const je=await cachedAxios.post("/web-groups",{name:Ee,description:Re,parentGroupId:Te??null});return normalizeWebGroup((Oe=je.data)==null?void 0:Oe.webGroup)},async updateWebGroup(Ee,{name:Re,description:Te,parentGroupId:je}={}){var De;const Oe={};Re!==void 0&&(Oe.name=Re),Te!==void 0&&(Oe.description=Te),je!==void 0&&(Oe.parentGroupId=je);const Me=await cachedAxios.put(`/web-groups/${Ee}`,Oe);return normalizeWebGroup((De=Me.data)==null?void 0:De.webGroup)},async deleteWebGroup(Ee){return(await cachedAxios.delete(`/web-groups/${Ee}`)).data},async getWebAssignments(Ee){var Te;return((Te=(await cachedAxios.get(`/groups/${Ee}/web-assignments`,NO_CACHE)).data)==null?void 0:Te.assignments)||[]},async assignToDocumentGroup(Ee,{webGroupId:Re,websiteConnectionId:Te}={}){var Oe;return((Oe=(await cachedAxios.post(`/groups/${Ee}/web-assignments`,{webGroupId:Re??null,websiteConnectionId:Te??null})).data)==null?void 0:Oe.assignment)||null},async removeAssignment(Ee,Re){return(await cachedAxios.delete(`/groups/${Ee}/web-assignments/${Re}`)).data}},SOURCE_LIST_SX$1={maxHeight:400,overflow:"auto",border:"1px solid",borderColor:"divider",borderRadius:1.5,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{bgcolor:"transparent"},"&::-webkit-scrollbar-thumb":{bgcolor:"action.selected",borderRadius:"3px","&:hover":{bgcolor:"action.disabled"}}},sourceListRowSx$1=(Ee,Re=0)=>({display:"flex",alignItems:"center",py:1,px:1.5,pl:1.5+Re*2,borderBottom:"1px solid",borderColor:"divider",bgcolor:Ee?"action.selected":"transparent",transition:"background-color 0.2s ease","&:hover":{bgcolor:Ee?"action.selected":"action.hover"}});function normalizeSelectableId(Ee){const Re=Ee.GroupID??Ee.id??Ee.group_id;if(Re==null)return null;const Te=Number(Re);return Number.isNaN(Te)?Re:Te}function idsMatch(Ee,Re){return Ee==null||Re==null?!1:Number(Ee)===Number(Re)&&!Number.isNaN(Number(Ee))?!0:String(Ee)===String(Re)}function isIdInList(Ee,Re){return Re.some(Te=>idsMatch(Te,Ee))}function flattenTreeNodeIds(Ee,Re=[]){return Ee.forEach(Te=>{var Oe;const je=normalizeSelectableId(Te.group);je!=null&&Re.push(je),(Oe=Te.children)!=null&&Oe.length&&flattenTreeNodeIds(Te.children,Re)}),Re}function GroupTreeRows({nodes:Ee,level:Re,expanded:Te,onToggleExpand:je,localSelected:Oe,onToggleGroup:Me,isLastBranch:De=!1}){return Ee.map(($e,Be)=>{const Ue=$e.group,ze=$e.id,We=normalizeSelectableId(Ue),Xe=Array.isArray($e.children)&&$e.children.length>0,He=Te[ze]!==!1,qe=We!=null&&isIdInList(We,Oe),Ge=De&&Be===Ee.length-1&&!(Xe&&He);return jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(ListItem,{disablePadding:!0,sx:{...sourceListRowSx$1(qe,Re),...Ge?{borderBottom:"none"}:{}},children:[Xe?jsxRuntimeExports.jsx(IconButton,{size:"small","aria-label":He?"Collapse":"Expand",onClick:Ye=>{Ye.stopPropagation(),je(ze)},sx:{mr:.5,p:.25}
4047,children:He?jsxRuntimeExports.jsx(ExpandMoreIcon,{fontSize:"small"}):jsxRuntimeExports.jsx(ChevronRight,{fontSize:"small"})}):jsxRuntimeExports.jsx(Box,{sx:{width:28,flexShrink:0}}),jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:"auto",mr:1},children:jsxRuntimeExports.jsx(Checkbox,{edge:"start",checked:qe,tabIndex:-1,disableRipple:!0,onChange:()=>We!=null&&Me(We),color:"primary"})}),jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:"auto",mr:1},children:jsxRuntimeExports.jsx(Group,{color:qe?"primary":"action"})}),jsxRuntimeExports.jsx(ListItemText,{primary:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:qe?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:$e.name})})]}),Xe&&jsxRuntimeExports.jsx(Collapse,{in:He,timeout:"auto",unmountOnExit:!0,children:jsxRuntimeExports.jsx(List,{disablePadding:!0,dense:!0,children:jsxRuntimeExports.jsx(GroupTreeRows,{nodes:$e.children,level:Re+1,expanded:Te,onToggleExpand:je,localSelected:Oe,onToggleGroup:Me,isLastBranch:De&&Be===Ee.length-1})})})]},ze)})}const GroupSourcePanel=({localSelected:Ee,onToggleGroup:Re,onSelectAll:Te,onDeselectAll:je,listSx:Oe={}})=>{const Me=useDispatch(),De=useSelector(Je=>{var ir;return((ir=Je.groups)==null?void 0:ir.groups)||[]}),$e=useSelector(Je=>{var ir;return((ir=Je.groups)==null?void 0:ir.loading)??!1}),Be=useSelector(Je=>{var ir;return(ir=Je.auth)==null?void 0:ir.user}),[Ue,ze]=reactExports.useState(""),[We,Xe]=reactExports.useState({}),He=reactExports.useMemo(()=>{if(!Be)return[];const ir=(Be.role??Be.RoleID??Be.role_level??Be.roleLevel)===ROLES.TENANT_ADMIN,rr=!!(Be.is_l1_admin||Be.IsL1Admin||Be.is_platform_admin);if(ir||rr)return Array.isArray(De)?De:[];const or=(Be.groups||Be.Groups||Be.memberships||[]).map(pr=>pr.group_id??pr.GroupID??pr.id).filter(pr=>pr!=null).map(pr=>Number(pr));return or.length===0?[]:De.filter(pr=>{const tr=pr.GroupID??pr.id??pr.group_id;return tr!=null&&or.includes(Number(tr))})},[De,Be]),qe=reactExports.useMemo(()=>{const Je=He||[],ir=Ue.trim().toLowerCase();if(!ir)return Je;const rr=new Set;return Je.forEach(ar=>{if(!(ar.GroupName||ar.name||"").toLowerCase().includes(ir))return;let pr=ar;for(;pr;){rr.add(getGroupStableId(pr));const tr=getParentRefFromGroup(pr);if(tr==null||tr==="")break;const nr=Je.find(hr=>getGroupStableId(hr)===String(tr));if(!nr)break;pr=nr}}),Je.forEach(ar=>{if(!(ar.GroupName||ar.name||"").toLowerCase().includes(ir))return;const pr=getGroupStableId(ar);collectDescendantIds(Je,pr).forEach(tr=>rr.add(tr))}),Je.filter(ar=>rr.has(getGroupStableId(ar)))},[He,Ue]),Ge=reactExports.useMemo(()=>buildGroupChildTree(qe),[qe]),Ye=reactExports.useMemo(()=>flattenTreeNodeIds(Ge),[Ge]),Ve=reactExports.useCallback(Je=>{Xe(ir=>{const rr=ir[Je]!==!1;return{...ir,[Je]:!rr}})},[]);reactExports.useEffect(()=>{Me(fetchGroups(!0)),Xe({})},[Me]);const Ke=Ye.length>0&&Ye.every(Je=>isIdInList(Je,Ee)),Qe=Ye.length>0&&Ye.some(Je=>isIdInList(Je,Ee))&&!Ke,Ze=Je=>{Je.target.checked?Te==null||Te([...Ye]):je==null||je()};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Box,{sx:{display:"flex",alignItems:"center",gap:2,mb:2},children:jsxRuntimeExports.jsx(TextField,{fullWidth:!0,size:"small",placeholder:"Search groups...",value:Ue,onChange:Je=>ze(Je.target.value),autoFocus:!0,InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(SearchIcon,{fontSize:"small",sx:{color:"text.secondary"}})})},sx:{"& .MuiOutlinedInput-root":{bgcolor:"background.paper"}}})}),$e?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",py:4},children:jsxRuntimeExports.jsx(CircularProgress,{})}):qe.length===0?jsxRuntimeExports.jsxs(Box,{sx:{py:6,textAlign:"center",borderRadius:1,border:"2px dashed",borderColor:"divider"},children:[jsxRuntimeExports.jsx(Box,{sx:{width:56,height:56,borderRadius:2,mx:"auto",mb:1.5,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"rgba(0, 45, 121, 0.1)"},children:jsxRuntimeExports.jsx(Group,{sx:{fontSize:28,color:"#002D79"}})}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mb:.5,fontWeight:700,color:"#002D79"}
4047,children:Ue?"No groups found":"You are not a member or admin of any groups."}),Ue&&jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Try adjusting your search criteria"})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Ye.length>1&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center"},children:[jsxRuntimeExports.jsx(Checkbox,{checked:Ke,indeterminate:Qe,onChange:Ze,disabled:$e||Ye.length===0,color:"primary",sx:{p:0,mr:1}}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:"Select All"})]}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:[Ye.length," group",Ye.length!==1?"s":""]})]}),jsxRuntimeExports.jsx(List,{disablePadding:!0,sx:{...SOURCE_LIST_SX$1,...Oe},children:jsxRuntimeExports.jsx(GroupTreeRows,{nodes:Ge,level:0,expanded:We,onToggleExpand:Ve,localSelected:Ee,onToggleGroup:Re,isLastBranch:!0})})]})]})},DOCUMENTS_PER_PAGE=100,EMPTY_ARRAY=[],SOURCE_TAB={DOCUMENTS:"documents",GROUPS:"groups",DATABASE:"database",WEBSITES:"websites"},DOC_FILTER_MODE={ALL:"all",SELECTED:"selected",UNSELECTED:"unselected"},SEARCH_BAR_SX={p:2,borderBottom:"1px solid",borderColor:"divider",bgcolor:Ee=>Ee.palette.mode==="dark"?"grey.900":"grey.50"},FOOTER_INFO_SX={px:2.5,py:1.5,borderTop:"1px solid",borderColor:"divider",bgcolor:Ee=>Ee.palette.mode==="dark"?"grey.900":"grey.50"},SOURCE_LIST_SX={maxHeight:400,overflow:"auto",border:"1px solid",borderColor:"divider",borderRadius:1.5,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{bgcolor:"transparent"},"&::-webkit-scrollbar-thumb":{bgcolor:"action.selected",borderRadius:"3px","&:hover":{bgcolor:"action.disabled"}}},sourceListRowSx=Ee=>({display:"flex",alignItems:"center",py:1,px:1.5,borderBottom:"1px solid",borderColor:"divider",bgcolor:Ee?"action.selected":"transparent",transition:"background-color 0.2s ease","&:hover":{bgcolor:Ee?"action.selected":"action.hover"},"&:last-child":{borderBottom:"none"}}),EMPTY_STATE_SX={py:6,textAlign:"center",borderRadius:1,border:"2px dashed",borderColor:"divider"},EmptyStateIcon=({icon:Ee})=>jsxRuntimeExports.jsx(Box,{sx:{width:56,height:56,borderRadius:2,mx:"auto",mb:1.5,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"rgba(0, 45, 121, 0.1)"},children:jsxRuntimeExports.jsx(Ee,{sx:{fontSize:28,color:"#002D79"}})}),documentIdMatches=(Ee,Re)=>Ee!=null&&Re!=null&&String(Ee)===String(Re),findSelectedDocumentIndex=(Ee,Re)=>(Ee||[]).findIndex(Te=>documentIdMatches(Te,Re)),DocumentSelectionModal=({open:Ee,onClose:Re,selectedDocuments:Te,onDocumentsChange:je,sessionId:Oe=null,minRequiredDocuments:Me=1,requirementLabel:De="",dbConnections:$e=EMPTY_ARRAY,selectedDbConnection:Be=null,onDbConnectionChange:Ue,websiteConnections:ze=EMPTY_ARRAY,webGroups:We=EMPTY_ARRAY,selectedWebsites:Xe=EMPTY_ARRAY,onWebsitesChange:He,selectedGroups:qe=EMPTY_ARRAY,onGroupsChange:Ge,initialTab:Ye=SOURCE_TAB.DOCUMENTS,restrictToSingleSource:Ve=!1,onSourcesConfirmed:Ke})=>{const Qe=useSelector(Nn=>Nn.auth.user),Ze=useSelector(Nn=>Nn.subscription.subscription),Je=useSelector(Nn=>{var Kn;return((Kn=Nn.groups)==null?void 0:Kn.groups)||[]}),[ir,rr]=reactExports.useState(SOURCE_TAB.DOCUMENTS),[ar,or]=reactExports.useState(""),[pr,tr]=reactExports.useState(""),[nr,hr]=reactExports.useState(Be||null),[sr,xr]=reactExports.useState(""),[Rr,br]=reactExports.useState(""),[wr,vr]=reactExports.useState(EMPTY_ARRAY),[Dr,kr]=reactExports.useState(EMPTY_ARRAY),[cr,dr]=reactExports.useState(null),[ur,gr]=reactExports.useState(""),[_r,Ir]=reactExports.useState(""),[Ar,Tr]=reactExports.useState(EMPTY_ARRAY),[Nr,Br]=reactExports.useState(DOC_FILTER_MODE.ALL),[Hr,Vr]=reactExports.useState(null),[mr,Sr]=reactExports.useState(EMPTY_ARRAY),[Lr,jr]=reactExports.useState(!1),[fr,Cr]=reactExports.useState(""),[Mr,$r]=reactExports.useState([]),[Fr,Kr]=reactExports.useState(!1),[an,Wr]=reactExports.useState(1),[hn,cn]=reactExports.useState(!1),[tn,Qr]=reactExports.useState(0),wn=reactExports.useRef(null),gn=reactExports.useRef(null),In=reactExports.useRef(!1),yn=reactExports.useRef(""),Mn=reactExports.useRef(EMPTY_ARRAY),on=reactExports.useRef(!1),Yr=reactExports.useCallback(async(Nn=1,Kn=!1,ds=null,xs=null)=>{try{Kr(!0);const js=ds!==null?ds:yn.current,Ws=xs!==null?xs:Mn.current,Gs={page:Nn,limit:DOCUMENTS_PER_PAGE,search:js};Ws&&Ws.length>0&&(Gs.group_id=Ws);const qs=await documentService.getPaginatedDocuments(Gs,!0);$r(Kn?Ns=>[...Ns,...qs.documents]:qs.documents),Qr(qs.total),cn(qs.hasMore),Wr(Nn)}catch(js){console.error("Error fetching documents:",js)}finally{Kr(!1)}},[]);reactExports.useEffect(()=>{if(!Ee){on.current=!1;return}on.current||(on.current=!0,Tr(Te!=null&&Te.length?Te:EMPTY_ARRAY),Cr(""),gr(""),Ir(""),Br(DOC_FILTER_MODE.ALL),Sr(EMPTY_ARRAY),yn.current="",Mn.current=EMPTY_ARRAY,Wr(1),In.current=!0,vr(Xe!=null&&Xe.length?Xe:EMPTY_ARRAY),kr(qe!=null&&qe.length?qe:EMPTY_ARRAY),hr(Be||null),or(""),tr(""),xr(""),br(""),qe!=null&&qe.length?rr(SOURCE_TAB.GROUPS):Te!=null&&Te.length?rr(SOURCE_TAB.DOCUMENTS):Be?rr(SOURCE_TAB.DATABASE):Xe!=null&&Xe.length?rr(SOURCE_TAB.WEBSITES):rr(Ye||SOURCE_TAB.DOCUMENTS),Yr(1,!1,"",""))},[Ee,Yr,Te,Be,Xe,qe,Ye]),reactExports.useEffect(()=>{if(Ee){if(In.current){In.current=!1;return}Mn.current=mr,Wr(1),Yr(1,!1)}},[Ee,mr,Yr]);const sn=()=>{gr(_r),yn.current=_r,Wr(1),Yr(1,!1,_r)},On=Nn=>{Nn.key==="Enter"&&sn()},Bn=()=>
4047{Ir(""),gr(""),Sr(EMPTY_ARRAY),yn.current="",Mn.current=EMPTY_ARRAY,Wr(1),Yr(1,!1,"","")},Hn=()=>{tr(ar)},Zr=()=>{or(""),tr("")},xn=()=>{br(sr)},An=()=>{xr(""),br("")},Wn=Nn=>{hr(Kn=>(Kn==null?void 0:Kn.id)===Nn.id?null:Nn)},ss=Nn=>{vr(Kn=>{const ds=new Set(Nn.items.map(Gs=>Gs.id));if(Nn.items.every(Gs=>Kn.some(qs=>qs.id===Gs.id)))return Kn.filter(Gs=>!ds.has(Gs.id));const js=Nn.items.filter(Gs=>!Kn.some(qs=>qs.id===Gs.id)),Ws=5-Kn.length;return[...Kn,...js.slice(0,Ws)]})},Yn=Nn=>{vr(Kn=>Kn.some(xs=>xs.id===Nn.id)?Kn.filter(xs=>xs.id!==Nn.id):Kn.length>=5?Kn:[...Kn,Nn])},en=reactExports.useCallback(Nn=>{kr(Kn=>{const ds=Kn.findIndex(js=>idsMatch(js,Nn));if(ds===-1)return[...Kn,Nn];const xs=[...Kn];return xs.splice(ds,1),xs})},[]),Gr=Nn=>{const Kn=findSelectedDocumentIndex(Ar,Nn),ds=[...Ar];Kn===-1?ds.push(Nn):ds.splice(Kn,1),Tr(ds)},nn=Nn=>{const Kn={};for(const ds of Mr){const xs=ds.FileID||ds.fileId||ds.file_id||ds.id;xs!=null&&Nn.some(js=>String(js)===String(xs))&&(Kn[xs]=ds.FileName||ds.filename||ds.file_name||ds.displayFilename||ds.OriginalFilename||String(xs))}return Kn},En=async()=>{var js,Ws,Gs,qs,Ns,ps;const Nn=coerceDocumentIds(Ar),Kn=nn(Nn.length?Nn:Ar),ds=wr.map(us=>us.id),xs=coerceGroupIds(Dr);if(!Oe){je(Nn.length?Nn:Ar,Kn),He==null||He(wr),Ue==null||Ue(nr||null),Ge==null||Ge(xs),Ke==null||Ke({documentIds:Nn.length?Nn:Ar,websites:wr,dbConnection:nr||null,groupIds:xs}),Re();return}jr(!0),Cr("");try{const[us,,Ts]=await Promise.all([chatService.updateSessionDocuments(Oe,Nn),chatService.updateSessionWebsites(Oe,ds),chatService.updateSessionGroups(Oe,xs)]),As=((js=us==null?void 0:us.session)==null?void 0:js.document_ids)??((Ws=us==null?void 0:us.session)==null?void 0:Ws.documentIds)??Nn,{ids:Fs,namesMap:Co}=await filterExistingDocumentIds$1(As);je(Fs,{...nn(Fs),...Co}),He==null||He(wr),Ue==null||Ue(nr||null);const Eo=((Gs=Ts==null?void 0:Ts.session)==null?void 0:Gs.group_ids)??((qs=Ts==null?void 0:Ts.session)==null?void 0:qs.groupIds)??xs;Ge==null||Ge(Eo),Ke==null||Ke({documentIds:Fs,websites:wr,dbConnection:nr||null,groupIds:Eo}),Re()}catch(us){const Ts=(Ns=us==null?void 0:us.response)==null?void 0:Ns.status,As=(ps=us==null?void 0:us.response)==null?void 0:ps.data,Fs=Ts===404?"Session not found or you do not have access.":Ts===409?"One or more selected items are invalid for your organization.":Ts===400?"Invalid selection. Please try again.":"Failed to save selection.",Co=(As==null?void 0:As.error)||(As==null?void 0:As.message)||(us==null?void 0:us.message)||Fs;Cr(typeof Co=="string"?Co:Fs)}finally{jr(!1)}},Cn=()=>{Tr(Te!=null&&Te.length?Te:EMPTY_ARRAY),vr(Xe!=null&&Xe.length?Xe:EMPTY_ARRAY),kr(qe!=null&&qe.length?qe:EMPTY_ARRAY),Cr(""),Re()},jn=(Nn,Kn)=>{Nn.preventDefault(),Nn.stopPropagation(),Vr(Kn)},$n=Ar.length>=Me,Vn=Ar.length>0,Qn=Dr.length>0,Un=!!nr,fs=wr.length>0,Jn=Ve&&(Qn||Un||fs),ts=Ve&&(Vn||Un||fs),cs=Ve&&(Vn||Qn||fs),Sn=Ve&&(Vn||Qn||Un),mn=Nn=>{const Kn=Nn.GroupName||Nn.groupName||Nn.group_name||Nn.Group||Nn.group;if(Kn)return Kn;const ds=Nn.GroupID||Nn.groupId||Nn.group_id;if(ds&&Je&&Array.isArray(Je)){const xs=Je.find(js=>(js.GroupID||js.id)===ds);if(xs)return xs.GroupName||xs.name||"Unknown Group"}return"No group"},os=(Mr||[]).filter(Nn=>{var Gs;if(!Qe)return!1;const ds=(Qe.role??Qe.RoleID??((Gs=Qe.department)==null?void 0:Gs.id))===2,xs=!!(Qe!=null&&Qe.is_l1_admin);if(ds||xs)return!0;let js=Qe.groups||Qe.Groups||[];js.length===0&&Je.length>0&&(js=Je);const Ws=js.map(qs=>{const Ns=qs.group_id||qs.GroupID||qs.id;return Ns?Number(Ns):null}).filter(qs=>qs!==null);if(Ws.length>0){const qs=Nn.GroupID||Nn.groupId||Nn.group_id,Ns=qs?Number(qs):null;return Ns&&Ws.includes(Ns)}return!1}),hs=reactExports.useMemo(()=>Nr===DOC_FILTER_MODE.ALL?os:os.filter(Nn=>{const Kn=Nn.FileID||Nn.fileId||Nn.file_id||Nn.id,ds=findSelectedDocumentIndex(Ar,Kn)!==-1;return Nr===DOC_FILTER_MODE.SELECTED?ds:!ds}),[os,Nr,Ar]),Cs=reactExports.useCallback(()=>{hn&&!Fr&&Yr(an+1,!0)},[hn,Fr,an,Yr]);reactExports.useEffect(()=>{if(!Ee||!gn.current||!hn)return;const Nn=new IntersectionObserver(Kn=>{Kn[0].isIntersecting&&hn&&!Fr&&Cs()},{root:wn.current,rootMargin:"100px",threshold:.1});return Nn.observe(gn.current),()=>{gn.current&&Nn.unobserve(gn.current)}},[Ee,hn,Fr,Cs]);const Ds=reactExports.useMemo(()=>{var js;const Kn=((Qe==null?void 0:Qe.role)??(Qe==null?void 0:Qe.RoleID)??((js=Qe==null?void 0:Qe.department)==null?void 0:js.id))===2,ds=!!(Qe!=null&&Qe.is_l1_admin);if(Kn||ds)return Array.isArray(Je)?Je:[];const xs=(Qe==null?void 0:Qe.groups)||(Qe==null?void 0:Qe.Groups)||[];return xs.length>0?xs:[]},[Qe,Je]),ho=reactExports.useMemo(()=>{const Nn=Array.isArray(Ds)?Ds:[],Kn=mr||[];return Kn.length?Kn.map(ds=>Nn.find(xs=>Number(xs.GroupID??xs.id??xs.group_id)===Number(ds)||String(xs.GroupID??xs.id??xs.group_id)===String(ds))).filter(
4047Boolean):[]},[mr,Ds]),Mo=reactExports.useMemo(()=>{const Nn=pr.trim().toLowerCase();return Nn?$e.filter(Kn=>Kn.connectionName.toLowerCase().includes(Nn)||(Kn.description||"").toLowerCase().includes(Nn)||Kn.dbType.toLowerCase().includes(Nn)):$e},[$e,pr]),Po=reactExports.useMemo(()=>{if(!cr)return null;const Nn=getGroupStableId(cr),Kn=collectDescendantIds(We,Nn);return Kn.add(Nn),Kn},[cr,We]),wo=reactExports.useMemo(()=>{const Nn=Rr.trim().toLowerCase();let Kn=ze;return Po&&(Kn=Kn.filter(ds=>ds.webGroupId!=null&&Po.has(String(ds.webGroupId)))),Nn?Kn.filter(ds=>(ds.connectionName||"").toLowerCase().includes(Nn)||(ds.url||"").toLowerCase().includes(Nn)||(ds.description||"").toLowerCase().includes(Nn)):Kn},[ze,Rr,Po]),ri=reactExports.useMemo(()=>{const Nn=new Map;return(We||[]).forEach(Kn=>Nn.set(getGroupStableId(Kn),Kn.name)),Nn},[We]),go=reactExports.useMemo(()=>{if(!We||We.length===0)return[{folderId:null,folderName:null,items:wo}];const Nn=new Map;wo.forEach(ds=>{const xs=ds.webGroupId!=null?String(ds.webGroupId):"__none__";Nn.has(xs)||Nn.set(xs,[]),Nn.get(xs).push(ds)});const Kn=[];return Nn.forEach((ds,xs)=>{xs==="__none__"?Kn.push({folderId:null,folderName:"No Folder",items:ds}):Kn.push({folderId:xs,folderName:ri.get(xs)||"Folder",items:ds})}),Kn.sort((ds,xs)=>ds.folderId===null?1:xs.folderId===null?-1:(ds.folderName||"").localeCompare(xs.folderName||"")),Kn},[wo,We,ri]),Vo=(Nn,Kn)=>{Kn==="backdropClick"||Kn==="escapeKeyDown"||Cn()};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:Vo,maxWidth:"md",fullWidth:!0,children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{py:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:700,fontSize:"1.1rem",color:"#002D79"},children:"Select Source"}),ir===SOURCE_TAB.DOCUMENTS&&jsxRuntimeExports.jsx(Chip,{label:`${Ar.length} selected`,size:"small",sx:{fontWeight:600,height:24,bgcolor:"rgba(0, 45, 121, 0.1)",color:"#002D79"}}),ir===SOURCE_TAB.GROUPS&&jsxRuntimeExports.jsx(Chip,{label:`${Dr.length} selected`,size:"small",sx:{fontWeight:600,height:24,bgcolor:"rgba(0, 45, 121, 0.1)",color:"#002D79"}}),ir===SOURCE_TAB.DATABASE&&jsxRuntimeExports.jsx(Chip,{label:`${nr?1:0} selected`,size:"small",sx:{fontWeight:600,height:24,bgcolor:"rgba(0, 45, 121, 0.1)",color:"#002D79"}}),ir===SOURCE_TAB.WEBSITES&&jsxRuntimeExports.jsx(Chip,{label:`${wr.length} selected`,size:"small",sx:{fontWeight:600,height:24,bgcolor:"rgba(0, 45, 121, 0.1)",color:"#002D79"}})]}),jsxRuntimeExports.jsxs(Tabs,{value:ir,onChange:(Nn,Kn)=>rr(Kn),sx:{mt:1,minHeight:36,"& .MuiTabs-indicator":{bgcolor:"#F97316"}},TabIndicatorProps:{sx:{height:2}},children:[jsxRuntimeExports.jsx(Tab,{value:SOURCE_TAB.DOCUMENTS,label:"Documents",icon:jsxRuntimeExports.jsx(InsertDriveFile,{sx:{fontSize:16}}),iconPosition:"start",disabled:Jn,sx:{minHeight:36,py:.5,textTransform:"none",fontWeight:600,fontSize:"0.85rem"}}),jsxRuntimeExports.jsx(Tab,{value:SOURCE_TAB.GROUPS,label:"Groups",icon:jsxRuntimeExports.jsx(Group,{sx:{fontSize:16}}),iconPosition:"start",disabled:ts,sx:{minHeight:36,py:.5,textTransform:"none",fontWeight:600,fontSize:"0.85rem"}}),$e.length>0&&jsxRuntimeExports.jsx(Tab,{value:SOURCE_TAB.DATABASE,label:`Database${$e.length>1?"s":""}`,icon:jsxRuntimeExports.jsx(DatabaseIcon,{sx:{fontSize:16}}),iconPosition:"start",disabled:cs,sx:{minHeight:36,py:.5,textTransform:"none",fontWeight:600,fontSize:"0.85rem"}}),ze.length>0&&jsxRuntimeExports.jsx(Tab,{value:SOURCE_TAB.WEBSITES,label:`Website${ze.length>1?"s":""}`,icon:jsxRuntimeExports.jsx(Language,{sx:{fontSize:16}}),iconPosition:"start",disabled:Sn,sx:{minHeight:36,py:.5,textTransform:"none",fontWeight:600,fontSize:"0.85rem"}})]})]}),jsxRuntimeExports.jsxs(DialogContent,{dividers:!0,sx:{p:0},children:[jsxRuntimeExports.jsxs(Box,{hidden:ir!==SOURCE_TAB.DOCUMENTS,children:[jsxRuntimeExports.jsxs(Box,{sx:SEARCH_BAR_SX,children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",flexWrap:"wrap"},children:[jsxRuntimeExports.jsx(TextField,{size:"small",placeholder:"Search by name",value:_r,onCh
4047ange:Nn=>Ir(Nn.target.value),onKeyPress:On,autoFocus:!0,InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(SearchIcon,{fontSize:"small",sx:{color:"text.secondary"}})})},sx:{minWidth:280,flex:1,maxWidth:400,"& .MuiOutlinedInput-root":{bgcolor:"background.paper"}}}),jsxRuntimeExports.jsx(Tooltip,{title:"Search documents",arrow:!0,children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:sn,disabled:Fr,color:"primary",sx:{bgcolor:"primary.main",color:"white","&:hover":{bgcolor:"primary.dark"},"&.Mui-disabled":{bgcolor:"action.disabledBackground",color:"action.disabled"}},children:jsxRuntimeExports.jsx(SearchIcon,{fontSize:"small"})})}),jsxRuntimeExports.jsx(Tooltip,{title:"Clear all filters",arrow:!0,children:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:Bn,disabled:!_r&&!ur&&mr.length===0,sx:{border:"1px solid",borderColor:"divider","&:hover":{bgcolor:"action.hover"}},children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})})})}),jsxRuntimeExports.jsxs(ToggleButtonGroup,{size:"small",exclusive:!0,value:Nr,onChange:(Nn,Kn)=>Kn&&Br(Kn),sx:{height:32,"& .MuiToggleButton-root":{textTransform:"none",fontSize:"0.75rem",px:1.25,py:0}},children:[jsxRuntimeExports.jsx(ToggleButton,{value:DOC_FILTER_MODE.ALL,children:"All"}),jsxRuntimeExports.jsx(ToggleButton,{value:DOC_FILTER_MODE.SELECTED,children:"Selected"}),jsxRuntimeExports.jsx(ToggleButton,{value:DOC_FILTER_MODE.UNSELECTED,children:"Unselected"})]}),Ds.length>0&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:200,maxWidth:340,flex:"1 1 200px","& .MuiOutlinedInput-root":{bgcolor:"background.paper"}},children:[jsxRuntimeExports.jsx(FilterList,{fontSize:"small",sx:{color:"text.secondary",mt:1.25,flexShrink:0}}),jsxRuntimeExports.jsx(Box,{sx:{flex:1,minWidth:0},children:jsxRuntimeExports.jsx(GroupHierarchyPicker,{multiple:!0,options:Ds,value:ho,onChange:Nn=>{const Kn=(Nn||[]).map(ds=>ds.GroupID??ds.id??ds.group_id).filter(ds=>ds!=null);Sr(Kn)},label:"Groups",placeholder:"All groups",size:"small"})})]})]}),(ur||mr.length>0)&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:.75,mt:1.5,flexWrap:"wrap",alignItems:"center"},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{fontWeight:500},children:"Active filters:"}),ur&&jsxRuntimeExports.jsx(Chip,{label:`Search: "${ur}"`,size:"small",onDelete:()=>{Ir(""),gr(""),yn.current="",Wr(1),Yr(1,!1,"",Mn.current)},sx:{height:22,fontSize:"0.7rem"}}),mr.map(Nn=>{const Kn=Ds.find(xs=>{const js=xs.GroupID||xs.id||xs.group_id;return Number(js)===Number(Nn)}),ds=(Kn==null?void 0:Kn.GroupName)||(Kn==null?void 0:Kn.name)||(Kn==null?void 0:Kn.group_name)||"Unknown";return jsxRuntimeExports.jsx(Chip,{label:`Group: ${ds}`,size:"small",onDelete:()=>{const xs=mr.filter(js=>js!==Nn);Sr(xs),Mn.current=xs,Wr(1),Yr(1,!1,yn.current,xs)},sx:{height:22,fontSize:"0.7rem"}},Nn)})]})]}),jsxRuntimeExports.jsxs(Box,{sx:{p:2.5},children:[tn>0&&jsxRuntimeExports.jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:Nr===DOC_FILTER_MODE.ALL?`${hs.length} of ${tn} documents`:`${hs.length} of ${os.length} loaded documents`})}),Fr&&Mr.length===0?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:6},children:jsxRuntimeExports.jsx(CircularProgress,{})}):hs.length===0?jsxRuntimeExports.jsxs(Box,{sx:{py:6,textAlign:"center",borderRadius:1,border:"2px dashed",borderColor:"divider"},children:[jsxRuntimeExports.jsx(EmptyStateIcon,{icon:InsertDriveFile}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mb:.5,fontWeight:700,color:"#002D79"},children:Nr===DOC_FILTER_MODE.SELECTED?"No documents selected":Nr===DOC_FILTER_MODE.UNSELECTED?"All documents are selected":ur||mr.length>0?"No documents found":"No approved documents available"}),Nr===DOC_FILTER_MODE.ALL&&jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:ur||mr.length>0?"Try adjusting your search or filter criteria":"Upload and get a document approved to use it as chat context"})]}):jsxRuntimeExports.jsxs(List,{ref:wn,sx:SOURCE_LIST_SX,children:[hs.map(Nn=>{const Kn=Nn.FileID||Nn.fileId||Nn.file_id||Nn.id,ds=findSelectedDocumentIndex(Ar,Kn)!==-1,xs=Nn.FileName||Nn.filename||Nn.file_name||Nn.displayFilename||Nn.OriginalFilename||"Unknown",js=canViewDocument(Qe,Nn,Ze);return jsxRuntimeExports.jsxs(ListItem,{disablePadding:!0,secondaryAction:js&&jsxRuntimeExports.jsx(Tooltip,{title:"Preview document",arrow:!0,children:jsxRuntimeExports.jsx(IconButton,{edge:"end",onClick:Ws=>jn(Ws,Nn),size:"small",sx:{mr:1,color:"primary.main","&:hover":{bgcolor:"primary.50"}},children:jsxRuntimeExports.jsx(VisibilityIcon,{fontSize:"small"})})}),sx:sourceListRowSx(ds),children:[jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:"auto",mr:1},children:jsxRuntimeExports.jsx(Checkbox,{edge:"start",checked:ds,tabIndex:-1,disableRipple:!0,onChange:()=>Gr(Kn),color:"primary"})}),jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:"auto",mr:1},children:jsxRuntimeExports.jsx(InsertDriveFile,{color:"action"})}),jsxRuntimeExports.jsx(ListItemText,{sx:{pr:js?6:0},primary:jsxRuntimeExports.jsx(Tooltip,{title:xs,placement:"top",arrow:!0,children:js?jsxRuntimeExports.jsx(Link,{component:"button",variant:"body2",onClick:Ws=>jn(Ws,Nn),sx:{textAlign:"left",textDecoration:"none",color:"text.primary","&:hover":{color:"primary.main",textDecoration:"underline"},display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:xs}):jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:xs})}),secondary:jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:[mn(Nn)," ",new Date(Nn.UploadedAt||Nn.uploaded_at||Nn.uploadedAt).toLocaleDateString()]})})]},Kn)}
4047),hn&&jsxRuntimeExports.jsx(Box,{ref:gn,sx:{py:2,textAlign:"center",bgcolor:"action.hover"},children:Fr?jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[jsxRuntimeExports.jsx(CircularProgress,{size:16}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Loading more..."})]}):null}),!hn&&hs.length>0&&jsxRuntimeExports.jsx(Box,{sx:{py:1.5,textAlign:"center",bgcolor:"action.hover"},children:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{fontWeight:500},children:"All documents loaded"})})]})]}),jsxRuntimeExports.jsxs(Box,{sx:FOOTER_INFO_SX,children:[jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"flex",alignItems:"center",gap:.5},children:[jsxRuntimeExports.jsx(LightbulbOutlined,{sx:{fontSize:"1rem",color:"#F97316"}}),De||"Selected documents will be used as context for your chat messages."]}),!$n&&Me>1&&jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"warning.main",sx:{display:"block",mt:.5},children:["Select at least ",Me," documents to continue."]})]})]})," ",jsxRuntimeExports.jsxs(Box,{hidden:ir!==SOURCE_TAB.GROUPS,children:[jsxRuntimeExports.jsx(Box,{sx:{p:2.5},children:jsxRuntimeExports.jsx(GroupSourcePanel,{localSelected:Dr,onToggleGroup:en,onSelectAll:Nn=>kr(Nn),onDeselectAll:()=>kr(EMPTY_ARRAY)})}),jsxRuntimeExports.jsx(Box,{sx:FOOTER_INFO_SX,children:jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"flex",alignItems:"center",gap:.5},children:[jsxRuntimeExports.jsx(LightbulbOutlined,{sx:{fontSize:"1rem",color:"#F97316"}}),"Selected groups will be used as context for your chat messages."]})})]}),jsxRuntimeExports.jsxs(Box,{hidden:ir!==SOURCE_TAB.DATABASE,children:[jsxRuntimeExports.jsxs(Box,{sx:SEARCH_BAR_SX,children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",flexWrap:"wrap"},children:[jsxRuntimeExports.jsx(TextField,{size:"small",placeholder:"Search by name",value:ar,onChange:Nn=>or(Nn.target.value),onKeyPress:Nn=>Nn.key==="Enter"&&Hn(),InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(SearchIcon,{fontSize:"small",sx:{color:"text.secondary"}})})},sx:{minWidth:280,flex:1,maxWidth:400,"& .MuiOutlinedInput-root":{bgcolor:"background.paper"}}}),jsxRuntimeExports.jsx(Tooltip,{title:"Search databases",arrow:!0,children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:Hn,color:"primary",sx:{bgcolor:"primary.main",color:"white","&:hover":{bgcolor:"primary.dark"}},children:jsxRuntimeExports.jsx(SearchIcon,{fontSize:"small"})})}),jsxRuntimeExports.jsx(Tooltip,{title:"Clear search",arrow:!0,children:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:Zr,disabled:!ar&&!pr,sx:{border:"1px solid",borderColor:"divider","&:hover":{bgcolor:"action.hover"}},children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})})})})]}),pr&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:.75,mt:1.5,flexWrap:"wrap",alignItems:"center"},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{fontWeight:500},children:"Active filters:"}),jsxRuntimeExports.jsx(Chip,{label:`Search: "${pr}"`,size:"small",onDelete:Zr,sx:{height:22,fontSize:"0.7rem"}})]})]}),jsxRuntimeExports.jsxs(Box,{sx:{p:2.5},children:[Mo.length>0&&jsxRuntimeExports.jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:[Mo.length," of ",$e.length," database",$e.length!==1?"s":""]})}),Mo.length===0?jsxRuntimeExports.jsxs(Box,{sx:EMPTY_STATE_SX,children:[jsxRuntimeExports.jsx(EmptyStateIcon,{icon:DatabaseIcon}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mb:.5,fontWeight:700,color:"#002D79"},children:pr?"No databases found":"No active database connections"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:pr?"Try adjusting your search criteria":"Connect a source in Administration to use it as chat context"})]}):jsxRuntimeExports.jsx(List,{sx:SOURCE_LIST_SX,children:Mo.map(Nn=>{const Kn=(nr==null?void 0:nr.id)===Nn.id,ds=Nn.description||`${Nn.host}:${Nn.port} / ${Nn.databaseName}`;return jsxRuntimeExports.jsxs(ListItem,{disablePadding:!0,sx:sourceListRowSx(Kn),children:[jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:"auto",mr:1},children:jsxRuntimeExports.jsx(Checkbox,{edge:"start",checked:Kn,tabIndex:-1,disableRipple:!0,onChange:()=>Wn(Nn),color:"primary"})}),jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:"auto",mr:1},children:jsxRuntimeExports.jsx(DatabaseIcon,{color:"action"})}),jsxRuntimeExports.jsx(ListItemText,{primary:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:Kn?600:400},children:Nn.connectionName}),jsxRuntimeExports.jsx(Chip,{size:"small",label:Nn.dbType,variant:"outlined",sx:{height:18,fontSize:"0.7rem",flexShrink:0}})]}),secondary:jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:ds})})]},Nn.id)})})]}),jsxRuntimeExports.jsx(Box,{sx:FOOTER_INFO_SX,children:jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{dis
4047play:"flex",alignItems:"center",gap:.5},children:[jsxRuntimeExports.jsx(LightbulbOutlined,{sx:{fontSize:"1rem",color:"#F97316"}}),"Selected database will be used as context for your chat messages."]})})]}),jsxRuntimeExports.jsxs(Box,{hidden:ir!==SOURCE_TAB.WEBSITES,children:[jsxRuntimeExports.jsxs(Box,{sx:SEARCH_BAR_SX,children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",flexWrap:"wrap"},children:[jsxRuntimeExports.jsx(TextField,{size:"small",placeholder:"Search by name",value:sr,onChange:Nn=>xr(Nn.target.value),onKeyPress:Nn=>Nn.key==="Enter"&&xn(),InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(SearchIcon,{fontSize:"small",sx:{color:"text.secondary"}})})},sx:{minWidth:280,flex:1,maxWidth:400,"& .MuiOutlinedInput-root":{bgcolor:"background.paper"}}}),jsxRuntimeExports.jsx(Tooltip,{title:"Search websites",arrow:!0,children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:xn,color:"primary",sx:{bgcolor:"primary.main",color:"white","&:hover":{bgcolor:"primary.dark"}},children:jsxRuntimeExports.jsx(SearchIcon,{fontSize:"small"})})}),jsxRuntimeExports.jsx(Tooltip,{title:"Clear search",arrow:!0,children:jsxRuntimeExports.jsx("span",{children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:An,disabled:!sr&&!Rr,sx:{border:"1px solid",borderColor:"divider","&:hover":{bgcolor:"action.hover"}},children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})})})}),We.length>0&&jsxRuntimeExports.jsx(Box,{sx:{minWidth:200,maxWidth:300,flex:"1 1 200px"},children:jsxRuntimeExports.jsx(GroupHierarchyPicker,{options:We,value:cr,onChange:dr,label:"Folder",placeholder:"All Folders",showTopLevelOption:!0,topLevelLabel:"All Folders",size:"small"})})]}),(Rr||cr)&&jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:.75,mt:1.5,flexWrap:"wrap",alignItems:"center"},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{fontWeight:500},children:"Active filters:"}),Rr&&jsxRuntimeExports.jsx(Chip,{label:`Search: "${Rr}"`,size:"small",onDelete:An,sx:{height:22,fontSize:"0.7rem"}}),cr&&jsxRuntimeExports.jsx(Chip,{label:`Folder: ${cr.name}`,size:"small",onDelete:()=>dr(null),sx:{height:22,fontSize:"0.7rem"}})]})]}),jsxRuntimeExports.jsxs(Box,{sx:{p:2.5},children:[wr.length>=5&&jsxRuntimeExports.jsx(Alert,{severity:"info",sx:{mb:1.5},children:"Maximum of 5 websites can be selected."}),wo.length>0&&jsxRuntimeExports.jsx(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5},children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:"text.secondary",sx:{fontWeight:500},children:[wo.length," of ",ze.length," website",ze.length!==1?"s":""]})}),wo.length===0?jsxRuntimeExports.jsxs(Box,{sx:EMPTY_STATE_SX,children:[jsxRuntimeExports.jsx(EmptyStateIcon,{icon:Language}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mb:.5,fontWeight:700,color:"#002D79"},children:Rr?"No websites found":"No active website connections"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:Rr?"Try adjusting your search criteria":"Connect a source in Administration to use it as chat context"})]}):jsxRuntimeExports.jsx(List,{sx:SOURCE_LIST_SX,subheader:jsxRuntimeExports.jsx("li",{}),children:go.map(Nn=>jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsxs("ul",{style:{padding:0},children:[Nn.folderName&&jsxRuntimeExports.jsxs(ListSubheader,{sx:{display:"flex",alignItems:"center",gap:.75,lineHeight:"36px",cursor:"pointer","&:hover":{bgcolor:"action.hover"}},onClick:()=>ss(Nn),children:[jsxRuntimeExports.jsx(Checkbox,{size:"small",edge:"start",tabIndex:-1,disableRipple:!0,checked:Nn.items.every(Kn=>wr.some(ds=>ds.id===Kn.id)),indeterminate:Nn.items.some(Kn=>wr.some(ds=>ds.id===Kn.id))&&!Nn.items.every(Kn=>wr.some(ds=>ds.id===Kn.id)),onChange:()=>ss(Nn),onClick:Kn=>Kn.stopPropagation(),color:"primary",sx:{p:.25}}),jsxRuntimeExports.jsx(FolderIcon,{fontSize:"small",sx:{color:"text.disabled"}}),jsxRuntimeExports.jsx(Box,{sx:{flex:1},children:Nn.folderName}),jsxRuntimeExports.jsx(Chip,{label:Nn.items.length,size:"small",sx:{height:18,fontSize:"0.7rem",mr:.5}})]}),Nn.items.map(Kn=>{const ds=wr.some(js=>js.id===Kn.id),xs=!ds&&wr.length>=5;return jsxRuntimeExports.jsxs(ListItem,{disablePadding:!0,sx:{...sourceListRowSx(ds),opacity:xs?.5:1},children:[jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:"auto",mr:1},children:jsxRuntimeExports.jsx(Checkbox,{edge:"start",checked:ds,tabIndex:-1,disableRipple:!0,disabled:xs,onChange:()=>Yn(Kn),color:"primary"})}),jsxRuntimeExports.jsx(ListItemIcon,{sx:{minWidth:"auto",mr:1},children:jsxRuntimeExports.jsx(Language,{color:ds?"info":"action"})}),jsxRuntimeExports.jsx(ListItemText,{primary:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:ds?600:400},children:Kn.connectionName}),secondary:jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",component:"div",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[Kn.description&&jsxRuntimeExports.jsx(Box,{component:"span",sx:{dis
4047play:"block"},children:Kn.description}),jsxRuntimeExports.jsx(Box,{component:"span",sx:{display:"block"},children:Kn.url})]})})]},Kn.id)})]})},Nn.folderId??"__none__"))})]}),jsxRuntimeExports.jsx(Box,{sx:FOOTER_INFO_SX,children:jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"flex",alignItems:"center",gap:.5},children:[jsxRuntimeExports.jsx(LightbulbOutlined,{sx:{fontSize:"1rem",color:"#F97316"}}),"Selected websites will be used as context for your chat messages."]})})]})]}),fr&&jsxRuntimeExports.jsx(Box,{sx:{px:2.5,pb:0},children:jsxRuntimeExports.jsx(Alert,{severity:"error",onClose:()=>Cr(""),children:fr})}),jsxRuntimeExports.jsxs(DialogActions,{sx:{px:2.5,py:1.5,gap:1,borderTop:"1px solid",borderColor:"divider",bgcolor:Nn=>Nn.palette.mode==="dark"?"grey.900":"grey.50"},children:[jsxRuntimeExports.jsx(Button,{onClick:Cn,variant:"outlined",size:"small",sx:{textTransform:"none",px:2.5,color:"#002D79",borderColor:"#002D79","&:hover":{borderColor:"#001D52",bgcolor:"rgba(0,45,121,0.06)"}},children:"Cancel"}),ir===SOURCE_TAB.DOCUMENTS&&jsxRuntimeExports.jsxs(Button,{onClick:En,variant:"contained",disabled:Lr,size:"small",sx:{textTransform:"none",px:2.5,fontWeight:600},children:["Confirm (",Ar.length,")"]}),ir===SOURCE_TAB.GROUPS&&jsxRuntimeExports.jsxs(Button,{onClick:En,variant:"contained",disabled:Lr,size:"small",sx:{textTransform:"none",px:2.5,fontWeight:600},children:["Confirm (",Dr.length,")"]}),ir===SOURCE_TAB.DATABASE&&jsxRuntimeExports.jsxs(Button,{onClick:En,variant:"contained",disabled:Lr,size:"small",sx:{textTransform:"none",px:2.5,fontWeight:600},children:["Confirm (",nr?1:0,")"]}),ir===SOURCE_TAB.WEBSITES&&jsxRuntimeExports.jsxs(Button,{onClick:En,variant:"contained",disabled:Lr,size:"small",sx:{textTransform:"none",px:2.5,fontWeight:600},children:["Confirm (",wr.length,")"]})]}),Hr&&jsxRuntimeExports.jsx(DocumentPreviewModal,{document:Hr,open:!!Hr,onClose:()=>Vr(null),user:Qe,subscription:Ze})]})},CustomInstructionsPanel=({open:Ee,onClose:Re,tenantLocked:Te=!1,tenantValues:je=null,embedded:Oe=!1})=>{const Me=useDispatch(),{darkMode:De}=useThemeMode(),$e=useSelector(selectSelectedInstructions),Be=useSelector(selectActivePresetKey);useSelector(selectAvailablePresets),useSelector(selectCurrentPresetData);const Ue=useSelector(selectCustomSettings),ze=useSelector(selectInstructionsLoading),We=useSelector(selectInstructionsError),[Xe,He]=reactExports.useState({responseStyle:"professional",responseLength:"moderate",detailLevel:3,preferredLanguage:"en"}),qe=ar=>({default:jsxRuntimeExports.jsx(DocumentIcon,{}),legal:jsxRuntimeExports.jsx(Gavel,{}),technical:jsxRuntimeExports.jsx(Code,{}),executive:jsxRuntimeExports.jsx(BusinessIcon,{}),research:jsxRuntimeExports.jsx(Science,{}),quick:jsxRuntimeExports.jsx(SpeedIcon,{}),customize:jsxRuntimeExports.jsx(Tune,{})})[ar]||jsxRuntimeExports.jsx(DocumentIcon,{});reactExports.useEffect(()=>{Ee&&Me(fetchInstructions(!0))},[Ee,Me]),reactExports.useEffect(()=>{const ar=Ue||$e;ar&&He({responseStyle:ar.responseStyle||"professional",responseLength:ar.responseLength||"moderate",detailLevel:ar.detailLevel||3,preferredLanguage:ar.preferredLanguage||"en"})},[$e,Ue]);const Ge=[{presetKey:"default",displayName:"Default",description:"Balanced responses",tooltip:"General-purpose preset with moderate detail and conversational tone. Good starting point for most questions and everyday document queries."},{presetKey:"legal",displayName:"Legal Review",description:"Formal, cited",tooltip:"Formal language with precise citations and comprehensive references. Ideal for legal documents, contracts, and compliance reviews where accuracy and source tracking are critical."},{presetKey:"technical",displayName:"Technical Analysis",description:"Detailed, precise",tooltip:"In-depth technical explanations with terminology, diagrams, and step-by-step breakdowns. Perfect for technical documentation, engineering specs, and code analysis."},{presetKey:"executive",displayName:"Executive Summary",description:"Brief, high-level",tooltip:"Concise high-level summaries focused on key insights and takeaways. Best for busy executives who need quick overviews without detailed background."},{presetKey:"research",displayName:"Research Mode",description:"Comprehensive, sourced",tooltip:"Thorough analysis with extensive citations, cross-references, and context. Designed for academic research, literature reviews, and deep investigative work."},{presetKey:"quick",displayName:"Quick Answers",description:"Fast, concise",tooltip:"Brief, to-the-point answers in 1-2 sentences. Use when you need fast facts without explanations or supporting details."},{presetKey:"customize",displayName:"Customize",description:"Your custom settings",tooltip:"Build your own preset by adjusting tone, length, detail level, and language below."}],Ye=async ar=>{if(Te||(Me(setActivePreset(ar)),ar==="customize"))return;(await Me(fetchPreset(ar))).payload&&await Me(saveInstructions(ar))},Ve=(ar,or)=>{He(pr=>({...pr,[ar]:or}))},Ke=async()=>
4047{if(!$e&&Qe!=="customize"){Re();return}if(Qe==="customize"){const or={presetKey:"custom",preset_name:"Custom",section:"response_styles",responseStyle:Xe.responseStyle,responseLength:Xe.responseLength,detailLevel:Xe.detailLevel,preferredLanguage:Xe.preferredLanguage};await Me(submitCustomInstructionsSelection(or))}else await Me(submitCustomInstructionsSelection({presetKey:Qe||($e==null?void 0:$e.presetKey)||"default",preset_name:($e==null?void 0:$e.preset_name)||"Default"}));Re()},Qe=Te&&je?je:Be,Ze=Qe==="customize",Je=ar=>{var xr,Rr;const or=Qe===ar.presetKey,pr=De?"#1E293B":"#f8fafc",tr=De?"#334155":"#fff7ed",nr=or?"#F97316":De?"#475569":"#e2e8f0",hr=or?"0 8px 20px rgba(249, 115, 22, 0.25)":De?"0 6px 16px rgba(0, 0, 0, 0.3)":"0 6px 16px rgba(15, 23, 42, 0.08)",sr=ar.description;return jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,sm:6,children:jsxRuntimeExports.jsx(Card,{elevation:0,sx:{cursor:Te?"default":"pointer",border:`1.5px solid ${nr}`,bgcolor:or?tr:pr,transition:"all 160ms ease",boxShadow:hr,borderRadius:3,height:"100%",display:"flex",flexDirection:"column",opacity:Te&&!or?.5:1,"&:hover":Te?{}:{transform:"translateY(-2px)",boxShadow:De?"0 10px 24px rgba(0, 0, 0, 0.4)":"0 10px 24px rgba(15, 23, 42, 0.12)"}},onClick:()=>Ye(ar.presetKey),children:jsxRuntimeExports.jsxs(CardContent,{sx:{flex:1,display:"flex",flexDirection:"column",gap:1,position:"relative"},children:[jsxRuntimeExports.jsx(Tooltip,{title:ar.tooltip||ar.description,arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{position:"absolute",top:8,right:8,fontSize:16,color:De?"#64748B":"#9CA3AF",cursor:"pointer",zIndex:1},onClick:br=>br.stopPropagation()})}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.2},children:[jsxRuntimeExports.jsxs(Box,{sx:{position:"relative",width:36,height:36,flexShrink:0},children:[jsxRuntimeExports.jsx(Box,{sx:{width:36,height:36,borderRadius:"50%",bgcolor:or?"#F97316":De?"rgba(91, 127, 196, 0.18)":"rgba(0, 45, 121, 0.1)",display:"grid",placeItems:"center",color:or?"#FFFFFF":De?"#93B4F0":"#002D79"},children:qe(ar.presetKey)}),or&&jsxRuntimeExports.jsx(Box,{sx:{position:"absolute",bottom:-4,right:-4,width:18,height:18,borderRadius:"50%",bgcolor:"#F97316",border:"2px solid",borderColor:De?"#334155":"#fff7ed",display:"grid",placeItems:"center"},children:jsxRuntimeExports.jsx(Check,{sx:{color:"#FFFFFF",fontSize:12}})})]}),jsxRuntimeExports.jsxs(Box,{sx:{flex:1,minWidth:0,pr:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",sx:{fontWeight:700,color:De?"#F1F5F9":"#0f172a",wordBreak:"break-word"},children:ar.displayName||ar.preset_name}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:De?"#94A3B8":"#475569"},children:sr})]})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5,mt:"auto"},children:[((xr=ar.settings)==null?void 0:xr.responseStyle)&&jsxRuntimeExports.jsx(Chip,{size:"small",label:ar.settings.responseStyle,sx:{bgcolor:De?"#0F172A":"#fff",color:De?"#E2E8F0":"#374151",borderRadius:1}}),((Rr=ar.settings)==null?void 0:Rr.responseLength)&&jsxRuntimeExports.jsx(Chip,{size:"small",label:ar.settings.responseLength,sx:{bgcolor:De?"#0F172A":"#fff",color:De?"#E2E8F0":"#374151",borderRadius:1}})]})]})})},ar.presetKey)},ir=()=>jsxRuntimeExports.jsx(Box,{sx:{mt:2,p:2.5,borderRadius:2,border:"1.5px solid #f59e0b",bgcolor:De?"#1E293B":"#fffbeb"},children:jsxRuntimeExports.jsxs(Stack,{spacing:2.5,children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500,mb:.5},children:"Tone & Style"}),jsxRuntimeExports.jsx(FormControl,{fullWidth:!0,size:"small",disabled:Te,children:jsxRuntimeExports.jsxs(Select,{value:Xe.responseStyle,onChange:ar=>Ve("responseStyle",ar.target.value),children:[jsxRuntimeExports.jsx(MenuItem,{value:"professional",children:"Professional"}),jsxRuntimeExports.jsx(MenuItem,{value:"casual",children:"Casual & Friendly"}),jsxRuntimeExports.jsx(MenuItem,{value:"technical",children:"Technical & Precise"}),jsxRuntimeExports.jsx(MenuItem,{value:"executive",children:"Executive Summary"}),jsxRuntimeExports.jsx(MenuItem,{value:"academic",children:"Academic"}),jsxRuntimeExports.jsx(MenuItem,{value:"conversational",children:"Conversational"})]})})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500,mb:.5},children:"Response Length"}),jsxRuntimeExports.jsx(FormControl,{fullWidth:!0,size:"small",disabled:Te,children:jsxRuntimeExports.jsxs(Select,{value:Xe.responseLength,onChange:ar=>Ve("responseLength",ar.target.value),children:[jsxRuntimeExports.jsx(MenuItem,{value:"brief",children:"Brief (1-2 paragraphs)"}),jsxRuntimeExports.jsx(MenuItem,{value:"moderate",children:"Moderate (3-5 paragraphs)"}),jsxRuntimeExports.jsx(MenuItem,{value:"detailed",children:"Detailed (Full explanation)"}),jsxRuntimeExports.jsx(MenuItem,{value:"comprehensive",children:"Comprehensive (In-depth)"})]})})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",justifyContent:"space-between",mb:.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Detail Level"}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",sx:{fontWeight:600,color:"#f59e0b"},children:[Xe.detailLevel,"/5"]})]}),jsxRuntimeExports.jsxs(Stack,{direction:"row",alignItems:"center",gap:1,children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{minWidth:40}
4047,children:"Quick"}),jsxRuntimeExports.jsx(Slider,{value:Xe.detailLevel,disabled:Te,onChange:(ar,or)=>Ve("detailLevel",or),min:1,max:5,step:1,marks:!0,sx:{flex:1}}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{minWidth:80,textAlign:"right"},children:"Comprehensive"})]})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500,mb:.5},children:"Preferred Language"}),jsxRuntimeExports.jsx(FormControl,{fullWidth:!0,size:"small",disabled:Te,children:jsxRuntimeExports.jsxs(Select,{value:Xe.preferredLanguage,onChange:ar=>Ve("preferredLanguage",ar.target.value),children:[jsxRuntimeExports.jsx(MenuItem,{value:"en",children:"English"}),jsxRuntimeExports.jsx(MenuItem,{value:"es",children:"Spanish"}),jsxRuntimeExports.jsx(MenuItem,{value:"fr",children:"French"}),jsxRuntimeExports.jsx(MenuItem,{value:"de",children:"German"}),jsxRuntimeExports.jsx(MenuItem,{value:"zh",children:"Mandarin Chinese"}),jsxRuntimeExports.jsx(MenuItem,{value:"hi",children:"Hindi"}),jsxRuntimeExports.jsx(MenuItem,{value:"ja",children:"Japanese"}),jsxRuntimeExports.jsx(MenuItem,{value:"ar",children:"Arabic"})]})})]})]})}),rr=jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:Oe?"100%":"auto",minHeight:0},children:[jsxRuntimeExports.jsx(Box,{sx:{flex:1,overflow:"auto",minHeight:0,p:Oe?0:2},children:ze&&!Ge.length?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",p:4},children:jsxRuntimeExports.jsx(CircularProgress,{})}):We?jsxRuntimeExports.jsx(Box,{sx:{p:2,bgcolor:"error.light",borderRadius:1},children:jsxRuntimeExports.jsx(Typography,{color:"error.contrastText",children:We})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{flex:1},children:"Customize how the AI responds to your questions. Choose a preset to configure response style, detail level, and more."}),jsxRuntimeExports.jsx(Tooltip,{title:"Presets are pre-built answer styles that control every aspect of how OpenParser AI communicates with youâfrom word choice to detail depth. Pick one that matches your workflow or create your own.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:De?"#64748B":"#9CA3AF",cursor:"pointer",flexShrink:0}})})]}),Te&&jsxRuntimeExports.jsx(Alert,{severity:"warning",icon:jsxRuntimeExports.jsx(Lock,{fontSize:"small"}),sx:{mb:2},children:"The preset selection is locked by your administrator and cannot be changed."}),$e&&jsxRuntimeExports.jsxs(Box,{sx:{mb:3,p:2.5,borderRadius:2,position:"relative",overflow:"hidden",background:"linear-gradient(135deg, #002D79 0%, #001D52 100%)",color:"#FFFFFF"},children:[jsxRuntimeExports.jsx(Box,{sx:{position:"absolute",top:-30,right:-30,width:140,height:140,borderRadius:"50%",background:"rgba(255, 255, 255, 0.06)",pointerEvents:"none"}}),jsxRuntimeExports.jsxs(Typography,{variant:"subtitle2",sx:{fontWeight:700,mb:1,position:"relative",zIndex:1,color:"#FFFFFF"},children:["Currently Selected: ",jsxRuntimeExports.jsx(Box,{component:"span",sx:{color:"#F97316"},children:$e.preset_name})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexWrap:"wrap",gap:.5,position:"relative",zIndex:1},children:[$e.responseStyle&&jsxRuntimeExports.jsx(Chip,{size:"small",label:`Style: ${$e.responseStyle}`,sx:{bgcolor:"rgba(255, 255, 255, 0.15)",color:"#FFFFFF",fontWeight:500}}),$e.responseLength&&jsxRuntimeExports.jsx(Chip,{size:"small",label:`Length: ${$e.responseLength}`,sx:{bgcolor:"rgba(255, 255, 255, 0.15)",color:"#FFFFFF",fontWeight:500}}),$e.citationStyle&&jsxRuntimeExports.jsx(Chip,{size:"small",label:`Citations: ${$e.citationStyle}`,sx:{bgcolor:"rgba(255, 255, 255, 0.15)",color:"#FFFFFF",fontWeight:500}})]})]}),Be==="legal"&&jsxRuntimeExports.jsxs(Box,{sx:{mb:3,p:2,bgcolor:De?"#422006":"#fff3cd",borderRadius:1,border:De?"1px solid #92400e":"1px solid #ffc107"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[jsxRuntimeExports.jsx(Warning,{sx:{color:De?"#FCD34D":"#ff9800",fontSize:20}}),jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{fontWeight:600,color:De?"#FDE68A":"#856404"},children:"Legal Review Mode Notice"})]}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:De?"#FEF3C7":"#856404"},children:"This AI-generated analysis is for assistive and informational purposes only. It is not a substitute for professional legal advice, counsel, or review. Always verify critical information with qualified legal professionals."})]}),jsxRuntimeExports.jsx(Divider,{sx:{my:2}}),jsxRuntimeExports.jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:2},children:jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{fontWeight:600,color:De?"#F1F5F9":"#111827"},children:"Available Presets"})}),jsxRuntimeExports.jsx(Grid,{container:!0,spacing:2,children:Ge.map(Je)}),Ze&&ir(),Ge.length===0&&!ze&&jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:4},children:"No presets available"})]})}),!(ze&&!Ge.length)&&!We&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Divider,{sx:{my:2.5,flexShrink:0,mx:Oe?0:2}}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,justifyContent:"flex-end",flexShrink:0,px:Oe?0:2,pb:Oe?0:2},children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",size:"small",onClick:Re,sx:{color:"#002D79",borderColor:"#002D79","&:hover":{borderColor:"#002D79",bgcolor:"rgba(0, 45, 121, 0.05)"}}
4047,children:Te?"Close":"Cancel"}),!Te&&jsxRuntimeExports.jsx(Button,{variant:"contained",size:"small",onClick:Ke,disabled:ze,sx:{bgcolor:"#F97316","&:hover":{bgcolor:"#EA580C"}},children:ze?jsxRuntimeExports.jsx(CircularProgress,{size:20}):"Save"})]})]})]});return Oe?rr:jsxRuntimeExports.jsx(Drawer,{anchor:"right",open:Ee,onClose:Re,children:jsxRuntimeExports.jsxs(Box,{sx:{width:{xs:"100vw",sm:500},height:"100%",display:"flex",flexDirection:"column"},children:[jsxRuntimeExports.jsxs(Box,{sx:{p:2.5,display:"flex",alignItems:"center",gap:1.5,justifyContent:"space-between",borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Box,{sx:{p:1,borderRadius:"8px",bgcolor:De?"#0F172A":"#f8fafc",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx(CustomRobotIcon,{sx:{color:"#f59e0b",fontSize:"20px"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:600,color:De?"#F1F5F9":"#1f2937"},children:"Response Styles"}),jsxRuntimeExports.jsx(Tooltip,{title:"Presets are pre-built answer styles that control every aspect of how OpenParser AI communicates with youâfrom word choice to detail depth. Pick one that matches your workflow or create your own.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Customize how AI responds to your questions"})]})]}),jsxRuntimeExports.jsx(IconButton,{onClick:Re,size:"small",children:jsxRuntimeExports.jsx(Close$1,{})})]}),rr]})})},DOCUMENT_SCOPE_OPTIONS=["all","recent"],normalizeDocumentScope=Ee=>{const Te={all_approved:"all",all:"all",recent:"recent",specific:"all",group:"all"}[Ee]||"all";return DOCUMENT_SCOPE_OPTIONS.includes(Te)?Te:"all"},toBackendDocumentScope=Ee=>({all:"all_approved",recent:"recent"})[Ee]||"all_approved",DocumentSettingsPanel=({open:Ee,onClose:Re,presetSettings:Te,tenantLocked:je=!1,tenantValues:Oe=null,embedded:Me=!1})=>{const De=useDispatch(),{darkMode:$e}=useThemeMode();useSelector(selectSelectedInstructions);const Be=useSelector(selectActivePresetKey),Ue=useSelector(selectInstructionsLoading),[ze,We]=reactExports.useState({documentScope:"all",citationStyle:"inline"}),[Xe,He]=reactExports.useState({documentScope:"all",citationStyle:"inline"});reactExports.useEffect(()=>{const Ve=je&&Oe?Oe:Te;if(Ve){const Ke=Ve.selectedDocumentScope||Ve.documentScope||"all_approved",Qe={documentScope:normalizeDocumentScope(Ke),citationStyle:Ve.citationStyle||"inline"};We(Qe),He(Qe)}},[Te,je,Oe]),reactExports.useEffect(()=>{if(!Ee){const Ve=je&&Oe?Oe:Te;if(Ve){const Ke=Ve.selectedDocumentScope||Ve.documentScope||"all_approved",Qe={documentScope:normalizeDocumentScope(Ke),citationStyle:Ve.citationStyle||"inline"};We(Qe),He(Qe)}}},[Ee,Te,je,Oe]);const qe=(Ve,Ke)=>{We(Qe=>{const Ze={...Qe,[Ve]:Ke};return(Ze.documentScope!==Xe.documentScope||Ze.citationStyle!==Xe.citationStyle)&&Be!=="customize"&&De(setActivePreset("customize")),Ze})},Ge=async()=>{const Ve={presetKey:"custom",preset_name:"Custom",section:"document_settings",selectedDocumentScope:toBackendDocumentScope(ze.documentScope),citationStyle:ze.citationStyle};await De(submitCustomInstructionsSelection(Ve)),Re()},Ye=jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:Me?"100%":"auto",minHeight:0},children:[jsxRuntimeExports.jsxs(Box,{sx:{flex:1,overflow:"auto",minHeight:0},children:[je&&jsxRuntimeExports.jsx(Alert,{severity:"warning",icon:jsxRuntimeExports.jsx(Lock,{fontSize:"small"}),sx:{mb:2},children:"These settings are locked by your administrator and cannot be changed."}),jsxRuntimeExports.jsxs(Box,{sx:{mb:3,display:"flex",flexDirection:"column",gap:2},children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Document Scope"}
4047),jsxRuntimeExports.jsx(Tooltip,{title:"Choose which documents OpenParser AI will search through when answering your questions. 'All' includes every approved document.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:"Which documents to query"}),jsxRuntimeExports.jsx(FormControl,{fullWidth:!0,disabled:je,children:jsxRuntimeExports.jsxs(Select,{value:ze.documentScope,onChange:Ve=>qe("documentScope",Ve.target.value),children:[jsxRuntimeExports.jsx(MenuItem,{value:"all",children:"All Approved Documents"}),jsxRuntimeExports.jsx(MenuItem,{value:"recent",children:"Recent Uploads (Last 30 days)"})]})})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Citation Style"}),jsxRuntimeExports.jsx(Tooltip,{title:"How OpenParser AI shows where information came from. 'Inline [1]' adds numbered references in the text, making it easy to verify facts.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:"How to show sources"}),jsxRuntimeExports.jsx(FormControl,{fullWidth:!0,disabled:je,children:jsxRuntimeExports.jsxs(Select,{value:ze.citationStyle,onChange:Ve=>qe("citationStyle",Ve.target.value),children:[jsxRuntimeExports.jsx(MenuItem,{value:"inline",children:"Inline References [1]"}),jsxRuntimeExports.jsx(MenuItem,{value:"footnotes",children:"Footnotes at End"}),jsxRuntimeExports.jsx(MenuItem,{value:"parenthetical",children:"Document Name, Page"}),jsxRuntimeExports.jsx(MenuItem,{value:"none",children:"No Citations"})]})})]})]})]}),jsxRuntimeExports.jsx(Divider,{sx:{my:2.5,flexShrink:0}}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,justifyContent:"flex-end",flexShrink:0},children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",size:"small",onClick:()=>Re({cancelled:!0}),children:je?"Close":"Cancel"}),!je&&jsxRuntimeExports.jsx(Button,{variant:"contained",size:"small",onClick:Ge,disabled:Ue,sx:{bgcolor:"#f59e0b","&:hover":{bgcolor:"#d97706"}},children:Ue?jsxRuntimeExports.jsx(CircularProgress,{size:20}):"Save"})]})]});return Me?Ye:jsxRuntimeExports.jsx(Drawer,{anchor:"right",open:Ee,onClose:(Ve,Ke)=>Re({cancelled:!0}),children:jsxRuntimeExports.jsxs(Box,{sx:{width:400,p:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:3,justifyContent:"space-between"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Box,{sx:{p:1,borderRadius:"8px",bgcolor:$e?"#0F172A":"#f8fafc",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx(DocumentIcon,{sx:{color:"#f59e0b",fontSize:"20px"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:600,color:$e?"#F1F5F9":"#1f2937"},children:"Document Settings"}),jsxRuntimeExports.jsx(Tooltip,{title:"Control which documents OpenParser AI searches and how it cites sources. These settings determine the scope of your searches and how references appear in answers.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Control document processing"})]})]}),jsxRuntimeExports.jsx(IconButton,{onClick:()=>Re({cancelled:!0}),size:"small",children:jsxRuntimeExports.jsx(Close$1,{})})]}),jsxRuntimeExports.jsx(Divider,{sx:{mb:2.5}}),Ye]})})},ContentPreferencesPanel=({open:Ee,onClose:Re,presetSettings:Te,tenantLocked:je=!1,tenantValues:Oe=null,embedded:Me=!1})=>{const De=useDispatch(),{darkMode:$e}=useThemeMode();useSelector(selectSelectedInstructions);const Be=useSelector(selectActivePresetKey),Ue=useSelector(selectInstructionsLoading),[ze,We]=reactExports.useState({formatPreference:"bullet",includeExamples:!0,crossReference:!0,includeMetadata:!0,highlightKeyTerms:!0}),[Xe,He]=reactExports.useState(null);reactExports.useEffect(()=>{const Ke=je&&Oe?Oe:Te;if(Ke){const Qe={formatPreference:Ke.formatPreference||"bullet",includeExamples:Ke.includeExamples??!0,crossReference:Ke.crossReference??!0,includeMetadata:Ke.includeMetadata??
4047!0,highlightKeyTerms:Ke.highlightKeyTerms??!0};We(Qe),He(Qe)}},[Te,je,Oe]),reactExports.useEffect(()=>{if(!Ee){const Ke=je&&Oe?Oe:Te;if(Ke){const Qe={formatPreference:Ke.formatPreference||"bullet",includeExamples:Ke.includeExamples??!0,crossReference:Ke.crossReference??!0,includeMetadata:Ke.includeMetadata??!0,highlightKeyTerms:Ke.highlightKeyTerms??!0};We(Qe),He(Qe)}}},[Ee,Te,je,Oe]);const qe=(Ke,Qe)=>{We(Ze=>{const Je={...Ze,[Ke]:Qe};return Xe&&(Je.formatPreference!==Xe.formatPreference||Je.includeExamples!==Xe.includeExamples||Je.crossReference!==Xe.crossReference||Je.includeMetadata!==Xe.includeMetadata||Je.highlightKeyTerms!==Xe.highlightKeyTerms)&&Be!=="customize"&&De(setActivePreset("customize")),Je})},Ge=Ke=>{We(Qe=>{const Ze={...Qe,[Ke]:!Qe[Ke]};return Xe&&(Ze.formatPreference!==Xe.formatPreference||Ze.includeExamples!==Xe.includeExamples||Ze.crossReference!==Xe.crossReference||Ze.includeMetadata!==Xe.includeMetadata||Ze.highlightKeyTerms!==Xe.highlightKeyTerms)&&Be!=="customize"&&De(setActivePreset("customize")),Ze})},Ye=async()=>{const Ke={presetKey:"custom",preset_name:"Custom",section:"content_preferences",formatPreference:ze.formatPreference,includeExamples:ze.includeExamples,crossReference:ze.crossReference,includeMetadata:ze.includeMetadata,highlightKeyTerms:ze.highlightKeyTerms};await De(submitCustomInstructionsSelection(Ke)),Re()},Ve=jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:Me?"100%":"auto",minHeight:0},children:[jsxRuntimeExports.jsxs(Box,{sx:{flex:1,overflow:"auto",minHeight:0},children:[je&&jsxRuntimeExports.jsx(Alert,{severity:"warning",icon:jsxRuntimeExports.jsx(Lock,{fontSize:"small"}),sx:{mb:2},children:"These settings are locked by your administrator and cannot be changed."}),jsxRuntimeExports.jsxs(Box,{sx:{mb:3,display:"flex",flexDirection:"column",gap:2},children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Format Preference"}),jsxRuntimeExports.jsx(Tooltip,{title:"Choose how answers are organized. 'Bullet Points' = easy to scan lists, 'Paragraphs' = flowing text like an essay, 'Tables' = organized data, 'Numbered Steps' = instructions in order.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:"How information is structured"}),jsxRuntimeExports.jsx(FormControl,{fullWidth:!0,disabled:je,children:jsxRuntimeExports.jsxs(Select,{value:ze.formatPreference,onChange:Ke=>qe("formatPreference",Ke.target.value),children:[jsxRuntimeExports.jsx(MenuItem,{value:"bullet",children:"Bullet Points"}),jsxRuntimeExports.jsx(MenuItem,{value:"paragraphs",children:"Paragraphs"}),jsxRuntimeExports.jsx(MenuItem,{value:"tables",children:"Tables & Lists"}),jsxRuntimeExports.jsx(MenuItem,{value:"mixed",children:"Mixed Format"}),jsxRuntimeExports.jsx(MenuItem,{value:"numbered",children:"Numbered Steps"})]})})]}),jsxRuntimeExports.jsx(Divider,{sx:{my:.5}}),jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Checkbox,{checked:ze.includeExamples,disabled:je,onChange:()=>Ge("includeExamples")}),label:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.3},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Include Examples"}),jsxRuntimeExports.jsx(Tooltip,{title:"Add practical illustrations to explanations. When on, the AI will provide concrete samples to clarify concepts.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:14,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Quote actual text from documents"})]}),sx:{alignItems:"flex-start"}}),jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Checkbox,{checked:ze.crossReference,disabled:je,onChange:()=>Ge("crossReference")}),label:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.3},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Cross Reference"}),jsxRuntimeExports.jsx(Tooltip,{title:"Link related information across different files. When enabled, the AI will connect relevant points from multiple documents in its answers.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:14,color:"#f59e0b",curs
4047or:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Link related content across documents"})]}),sx:{alignItems:"flex-start"}}),jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Checkbox,{checked:ze.includeMetadata,disabled:je,onChange:()=>Ge("includeMetadata")}),label:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.3},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Include Metadata"}),jsxRuntimeExports.jsx(Tooltip,{title:"Display document details like source name, page number, and upload date alongside answers. Helps trace information back to its origin.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:14,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Add document source information"})]}),sx:{alignItems:"flex-start"}}),jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Checkbox,{checked:ze.highlightKeyTerms,disabled:je,onChange:()=>Ge("highlightKeyTerms")}),label:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.5,mb:.3},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Highlight Key Terms"}),jsxRuntimeExports.jsx(Tooltip,{title:"Emphasize important words and phrases in bold. Makes key concepts and jargon stand out for quick scanning.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:14,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Emphasize important concepts"})]}),sx:{alignItems:"flex-start"}})]})]}),jsxRuntimeExports.jsx(Divider,{sx:{my:2.5,flexShrink:0}}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,justifyContent:"flex-end",flexShrink:0},children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",size:"small",onClick:Re,children:je?"Close":"Cancel"}),!je&&jsxRuntimeExports.jsx(Button,{variant:"contained",size:"small",onClick:Ye,disabled:Ue,sx:{bgcolor:"#f59e0b","&:hover":{bgcolor:"#d97706"}},children:Ue?jsxRuntimeExports.jsx(CircularProgress,{size:20}):"Save"})]})]});return Me?Ve:jsxRuntimeExports.jsx(Drawer,{anchor:"right",open:Ee,onClose:Re,children:jsxRuntimeExports.jsxs(Box,{sx:{width:400,p:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:3,justifyContent:"space-between"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Box,{sx:{p:1,borderRadius:"8px",bgcolor:$e?"#0F172A":"#f8fafc",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx(Tune,{sx:{color:"#f59e0b",fontSize:"20px"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:600,color:$e?"#F1F5F9":"#1f2937"},children:"Content Preferences"}),jsxRuntimeExports.jsx(Tooltip,{title:"Fine-tune how information is organized and displayed in answers. Control formatting styles, whether to include examples, metadata, cross-references, and visual emphasis.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"How information is presented"})]})]}),jsxRuntimeExports.jsx(IconButton,{onClick:Re,size:"small",children:jsxRuntimeExports.jsx(Close$1,{})})]}),jsxRuntimeExports.jsx(Divider,{sx:{mb:2.5}}),Ve]})})},AdditionalInstructionsPanel=({open:Ee,onClose:Re,presetSettings:Te,tenantLocked:je=!1,tenantValues:Oe=null,embedded:Me=!1})=>{const De=useDispatch(),{darkMode:$e}=useThemeMode();useSelector(selectSelectedInstructions);const Be=useSelector(selectActivePresetKey),Ue=useSelector(selectInstructionsLoading),ze=reactExports.useRef(null),[We,Xe]=reactExports.useState(""),[He,qe]=reactExports.useState(["custom-instructions"]),[Ge,Ye]=reactExports.useState("");reactExports.useEffect(()=>{if(je&&Oe!==null){const Qe=typeof Oe=="string"?Oe:"";Xe(Qe),Ye(Qe)}
4047else if(Te){const Qe=Te.customText||Te.customInstructions||Te.customPrompt||"";Xe(Qe),Ye(Qe)}},[Te,je,Oe]),reactExports.useEffect(()=>{if(!Ee)if(je&&Oe!==null){const Qe=typeof Oe=="string"?Oe:"";Xe(Qe),Ye(Qe)}else{const Qe=(Te==null?void 0:Te.customText)||(Te==null?void 0:Te.customInstructions)||(Te==null?void 0:Te.customPrompt)||"";Xe(Qe),Ye(Qe)}},[Ee,Te,je,Oe]),reactExports.useEffect(()=>{if(Ee&&!je){const Qe=setTimeout(()=>{var Ze;(Ze=ze.current)==null||Ze.focus()},300);return()=>clearTimeout(Qe)}},[Ee,je]),reactExports.useEffect(()=>{We!==Ge&&Be!=="customize"&&Ge!==void 0&&De(setActivePreset("customize"))},[We,Ge,Be,De]);const Ve=async()=>{await De(submitCustomInstructionsSelection({presetKey:"custom",preset_name:"Custom",section:"additional_instructions",customText:We||""})),Re()},Ke=jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:Me?"100%":"auto",minHeight:0},children:[jsxRuntimeExports.jsxs(Box,{sx:{flex:1,overflow:"auto",minHeight:0},children:[je&&jsxRuntimeExports.jsx(Alert,{severity:"warning",icon:jsxRuntimeExports.jsx(Lock,{fontSize:"small"}),sx:{mb:2},children:"These instructions are locked by your administrator and cannot be changed."}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(TextField,{fullWidth:!0,inputRef:ze,label:"Additional Instructions",multiline:!0,rows:6,value:We,disabled:je,onChange:Qe=>Xe(Qe.target.value),placeholder:"e.g., Always start with a summary, focus on financial implications, use industry-specific terminology...",variant:"outlined",inputProps:{maxLength:1e3}}),jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"flex-end",mt:.5},children:jsxRuntimeExports.jsxs(Typography,{variant:"caption",sx:{color:We.length>=1e3?"error.main":"text.secondary",fontSize:"0.75rem"},children:[We.length,"/1000"]})}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:2},children:"These instructions will be applied to all future responses in this session. You can update them at any time."})]})]}),jsxRuntimeExports.jsx(Divider,{sx:{my:2.5,flexShrink:0}}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,justifyContent:"flex-end",flexShrink:0},children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",size:"small",onClick:Re,children:je?"Close":"Cancel"}),!je&&jsxRuntimeExports.jsx(Button,{variant:"contained",size:"small",onClick:Ve,disabled:Ue,sx:{bgcolor:"#f59e0b","&:hover":{bgcolor:"#d97706"}},children:Ue?jsxRuntimeExports.jsx(CircularProgress,{size:20}):"Save"})]})]});return Me?Ke:jsxRuntimeExports.jsx(Drawer,{anchor:"right",open:Ee,onClose:Re,children:jsxRuntimeExports.jsxs(Box,{sx:{width:400,p:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:3,justifyContent:"space-between"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Box,{sx:{p:1,borderRadius:"8px",bgcolor:$e?"#0F172A":"#f8fafc",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx(EditIcon,{sx:{color:"#f59e0b",fontSize:"20px"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:600,color:$e?"#F1F5F9":"#1f2937"},children:"Additional Instructions"}),jsxRuntimeExports.jsx(Tooltip,{title:"Write any special instructions here...",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Add Additional instructions for your responses"})]})]}),jsxRuntimeExports.jsx(IconButton,{onClick:Re,size:"small",children:jsxRuntimeExports.jsx(Close$1,{})})]}),jsxRuntimeExports.jsx(Divider,{sx:{mb:2.5}}),Ke]})})},IndustryPanel=({open:Ee,onClose:Re,currentValue:Te,tenantIndustry:je,embedded:Oe=!1,onSave:Me,tenantLocked:De=!1,tenantValues:$e=null})=>{const Be=useDispatch(),{darkMode:Ue}=useThemeMode(),ze=useSelector(selectInstructionsLoading),We=useSelector(selectIndustryValue),Xe=useSelector(selectIndustryOptions),He=De&&$e?$e:Te||We||je||"Other",[qe,Ge]=reactExports.useState(He),[Ye,Ve]=reactExports.useState(He);reactExports.useEffect(()=>{Ee&&(Ge(He),Ve(He))},[Ee,He]),reactExports.useEffect(()=>{Ee||(Ge(He),Ve(He))},[Ee,He]);const Ke=async()=>{qe&&qe!==Ye&&(await Be(saveIndustry(qe)),Me&&Me(qe)),Re()},Qe=jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:Oe?"100%":"auto",minHeight:0},children:[jsxRuntimeExports.jsxs(Box,{sx:{flex:1,overflow:"auto",minHeight:0},children:[De&&jsxRuntimeExports.jsx(Alert,{severity:"warning",icon:jsxRuntimeExports.jsx(Lock,{fontSize:"small"}),sx:{mb:2},children:"This setting is locked by your administrator and cannot be changed."}),jsxRuntimeExports.jsx(Box,{sx:{mb:3,display:"flex",flexDirection:"column",gap:2},children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontWeight:500},children:"Industry"}),jsxRuntimeExports.jsx(Tooltip,{title:"Select your industry to help OpenParser AI tailor responses with industry-specific language, formatting, and context.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",curs
4047or:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mb:1},children:"Tailor responses for your industry"}),jsxRuntimeExports.jsx(FormControl,{fullWidth:!0,disabled:De,children:jsxRuntimeExports.jsx(Select,{value:qe||"Other",onChange:Ze=>Ge(Ze.target.value),children:Xe.map(Ze=>jsxRuntimeExports.jsx(MenuItem,{value:Ze,children:Ze},Ze))})})]})})]}),jsxRuntimeExports.jsx(Divider,{sx:{my:2.5,flexShrink:0}}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,justifyContent:"flex-end",flexShrink:0},children:[jsxRuntimeExports.jsx(Button,{variant:"outlined",size:"small",onClick:()=>Re({cancelled:!0}),children:De?"Close":"Cancel"}),!De&&jsxRuntimeExports.jsx(Button,{variant:"contained",size:"small",onClick:Ke,disabled:ze,sx:{bgcolor:"#f59e0b","&:hover":{bgcolor:"#d97706"}},children:ze?jsxRuntimeExports.jsx(CircularProgress,{size:20}):"Save"})]})]});return Oe?Qe:jsxRuntimeExports.jsx(Drawer,{anchor:"right",open:Ee,onClose:()=>Re(),children:jsxRuntimeExports.jsxs(Box,{sx:{width:400,p:3},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mb:3,justifyContent:"space-between"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Box,{sx:{p:1,borderRadius:"8px",bgcolor:Ue?"#0F172A":"#f8fafc",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx(BusinessIcon,{sx:{color:"#f59e0b",fontSize:"20px"}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:600,color:Ue?"#F1F5F9":"#1f2937"},children:"Industry"}),jsxRuntimeExports.jsx(Tooltip,{title:"Your selected industry helps OpenParser AI provide more relevant, industry-specific responses.",arrow:!0,placement:"top",children:jsxRuntimeExports.jsx(HelpOutline,{sx:{fontSize:16,color:"#f59e0b",cursor:"pointer"}})})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Shape responses for your field"})]})]}),jsxRuntimeExports.jsx(IconButton,{onClick:()=>Re(),size:"small",children:jsxRuntimeExports.jsx(Close$1,{})})]}),jsxRuntimeExports.jsx(Divider,{sx:{mb:2.5}}),Qe]})})},TAB_IDS={RESPONSE_STYLES:"response_styles",DOCUMENT_SETTINGS:"document_settings",CONTENT_PREFERENCES:"content_preferences",ADDITIONAL_INSTRUCTIONS:"additional_instructions",INDUSTRY:"industry"},ChatSettingsPopup=({open:Ee,onClose:Re,presetSettings:Te,tenantPanelSettings:je})=>{const Oe=useTheme$1(),Me=useMediaQuery(Oe.breakpoints.down("sm")),{darkMode:De}=useThemeMode(),$e=reactExports.useMemo(()=>{const He=[],qe=je||{};return qe.show_custom_instructions&&He.push({id:TAB_IDS.RESPONSE_STYLES,label:"Response Styles",icon:jsxRuntimeExports.jsx(CustomRobotIcon,{sx:{fontSize:20}})}),qe.show_document_settings&&He.push({id:TAB_IDS.DOCUMENT_SETTINGS,label:"Document Settings",icon:jsxRuntimeExports.jsx(DocumentIcon,{sx:{fontSize:20}})}),qe.show_content_preferences&&He.push({id:TAB_IDS.CONTENT_PREFERENCES,label:"Content Preferences",icon:jsxRuntimeExports.jsx(Tune,{sx:{fontSize:20}})}),qe.show_additional_instructions&&He.push({id:TAB_IDS.ADDITIONAL_INSTRUCTIONS,label:"Additional Instructions",icon:jsxRuntimeExports.jsx(EditIcon,{sx:{fontSize:20}})}),qe.show_industry!==!1&&He.push({id:TAB_IDS.INDUSTRY,label:"Industry",icon:jsxRuntimeExports.jsx(BusinessIcon,{sx:{fontSize:20}})}),He},[je]),[Be,Ue]=reactExports.useState(TAB_IDS.RESPONSE_STYLES);reactExports.useEffect(()=>{if(!Ee||$e.length===0)return;$e.some(qe=>qe.id===Be)||Ue($e[0].id)},[Ee,$e,Be]);const ze=He=>{Re(He)},We=He=>{ze(He)},Xe=()=>{switch(Be){case TAB_IDS.RESPONSE_STYLES:return jsxRuntimeExports.jsx(CustomInstructionsPanel,{open:Ee,onClose:We,embedded:!0,tenantLocked:je==null?void 0:je.enforce_custom_instructions,tenantValues:je==null?void 0:je.custom_instructions_value});case TAB_IDS.DOCUMENT_SETTINGS:return jsxRuntimeExports.jsx(DocumentSettingsPanel,{open:Ee,onClose:We,embedded:!0,presetSettings:Te,tenantLocked:je==null?void 0:je.enforce_document_settings,tenantValues:je==null?void 0:je.document_settings_value});case TAB_IDS.CONTENT_PREFERENCES:return jsxRuntimeExports.jsx(ContentPreferencesPanel,{open:Ee,onClose:We,embedded:!0,presetSettings:Te,tenantLocked:je==null?void 0:je.enforce_content_preferences,tenantValues:je==null?void 0:je.content_preferences_value});case TAB_IDS.ADDITIONAL_INSTRUCTIONS:return jsxRuntimeExports.jsx(AdditionalInstructionsPanel,{open:Ee,onClose:We,embedded:!0,presetSettings:Te,tenantLocked:je==null?void 0:je.enforce_additional_instructions,tenantValues:je==null?void 0:je.additional_instructions_value});case TAB_IDS.INDUSTRY:return jsxRuntimeExports.jsx(IndustryPanel,{open:Ee,onClose:We,embedded:!0,tenantLocked:je==null?void 0:je.enforce_industry,tenantValues:je==null?void 0:je.industry_value,tenantIndustry:je==null?void 0:je.tenant_industry});default:return null}};return $e.length===0?null:jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:()=>ze({cancelled:!0}),fullScreen:Me,maxWidth:"md",fullWidth:!0,PaperProps:{sx:{height:Me?"100%":"min(720px, 90vh)",maxHeight:Me?"100%":"90vh",borderRadius:Me?0:2,overflow:"hidden"}},children:[jsxRuntimeExports.jsxs(DialogTitle,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,py:1.75,px:2.5,borderBottom:"1px solid",borderColor:"divider"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[jsxRuntimeExports.jsx(Box,{sx:{p:1,borderRadius:"8px",bgcolor:De?"rgba(91, 127, 196, 0.18)":"rgba(0, 45, 121, 0.1)",display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx(Settings,{sx:{color:De?"#93B4F0":"#002D79",fontSize:20}})}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:700,lineHeight:1.3,color:De?"#93B4F0":"#002D79"},children:"Chat Settings"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Response style, documents, content, and instructions"})]})]}),jsxRuntimeExports.jsx(IconButton,{onClick:()=>ze({cancelled:!0}),size:"small","aria-label":"Close settings",children:jsxRuntimeExports.jsx(Close$1,{})})]}),jsxRuntimeExports.jsxs(DialogContent,{sx:{p:0,display:"flex",flexDirection:Me?"column":"row",overflow:"hidden",height:"100%"},children:[jsxRuntimeExports.jsx(Box,{sx:{width:Me?"100%":220,flexShrink:0,borderRight:Me?"none":"1px solid",borderBottom:Me?"1px solid":"none",borderColor:"divider",bgcolor:De?"#0F172A":"grey.50"},children:jsxRuntimeExports.jsx(Tabs,{orientation:Me?"horizontal":"vertical",variant:Me?"scrollable":"standard",scrollButtons:Me?"auto":!1,value:Be,onChange:(He,qe)=>Ue(qe),sx:{minHeight:Me?48:void 0,"& .MuiTabs-indicator":{left:Me?void 0:0,right:"auto",bgcolor:"#002D79"},"& .MuiTab-root":{alignItems:Me?"center":"flex-start",justifyContent:Me?"center":"flex-start",textAlign:"left",minHeight:52,px:2,py:1.25,textTransform:"none",color:De?"#94A3B8"
4047:"text.secondary","&.Mui-selected":{color:De?"#93B4F0":"#002D79",fontWeight:700,bgcolor:De?"rgba(91, 127, 196, 0.12)":"rgba(0, 45, 121, 0.08)"}}},children:$e.map(He=>jsxRuntimeExports.jsx(Tab,{value:He.id,icon:He.icon,iconPosition:"start",label:He.label,sx:{gap:1,"& .MuiTab-iconWrapper":{mb:"0 !important",mr:1}}},He.id))})}),jsxRuntimeExports.jsx(Box,{sx:{flex:1,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",p:2.5},children:Xe()})]})]})},FavoritePromptsModal=({open:Ee,onClose:Re,onSelectPrompt:Te})=>{const je=useDispatch(),Oe=useSelector(selectFilteredFavorites),Me=useSelector(selectFavoritesLoading),De=useSelector(selectSearchQuery$1);reactExports.useEffect(()=>{Ee&&je(fetchFavorites(!0))},[Ee,je]);const $e=ze=>{je(setSearchQuery$2(ze.target.value))},Be=ze=>{Te(ze.prompt),Re()},Ue=(ze,We)=>{We==="backdropClick"||We==="escapeKeyDown"||Re()};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:Ue,maxWidth:"md",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Star,{sx:{color:"warning.main"}}),jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Favorite Prompts"})]}),jsxRuntimeExports.jsx(Chip,{label:`${Oe.length} saved`,size:"small"})]})}),jsxRuntimeExports.jsxs(DialogContent,{dividers:!0,children:[jsxRuntimeExports.jsx(TextField,{fullWidth:!0,size:"small",placeholder:"Search favorites...",value:De,onChange:$e,autoFocus:!0,InputProps:{startAdornment:jsxRuntimeExports.jsx(InputAdornment,{position:"start",children:jsxRuntimeExports.jsx(SearchIcon,{})})},sx:{mb:2}}),Me?jsxRuntimeExports.jsx(Box,{sx:{display:"flex",justifyContent:"center",py:4},children:jsxRuntimeExports.jsx(CircularProgress,{})}):Oe.length===0?jsxRuntimeExports.jsxs(Box,{sx:{py:4,textAlign:"center"},children:[jsxRuntimeExports.jsx(Star,{sx:{fontSize:48,color:"action.disabled",mb:2}}),jsxRuntimeExports.jsx(Typography,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:De?"No favorites found":"No favorite prompts yet"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.disabled",children:!De&&"Star a message to save it as a favorite"})]}):jsxRuntimeExports.jsx(List,{children:Oe.map(ze=>jsxRuntimeExports.jsx(ListItem,{disablePadding:!0,children:jsxRuntimeExports.jsx(ListItemButton,{onClick:()=>Be(ze),children:jsxRuntimeExports.jsx(ListItemText,{primary:jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{fontWeight:600},children:ze.title||ze.name||"Untitled"}),secondary:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",mt:.5},children:ze.prompt})})})},ze.id))})]}),jsxRuntimeExports.jsx(DialogActions,{children:jsxRuntimeExports.jsx(Button,{onClick:Re,children:"Close"})})]})};var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(Ee,Re){for(var Te=new u16(31),je=0;je<31;++je)Te[je]=Re+=1<<Ee[je-1];for(var Oe=new i32(Te[30]),je=1;je<30;++je)for(var Me=Te[je];Me<Te[je+1];++Me)Oe[Me]=Me-Te[je]<<5|je;return{b:Te,r:Oe}},_a=freb(fleb,2),fl=_a.b,revfl=_a.r;fl[28]=258,revfl[258]=28;var _b=freb(fdeb,0),revfd=_b.r,rev=new u16(32768);for(var i$1=0;i$1<32768;++i$1){var x$1=(i$1&43690)>>1|(i$1&21845)<<1;x$1=(x$1&52428)>>2|(x$1&13107)<<2,x$1=(x$1&61680)>>4|(x$1&3855)<<4,rev[i$1]=((x$1&65280)>>8|(x$1&255)<<8)>>1}var hMap=function(Ee,Re,Te){for(var je=Ee.length,Oe=0,Me=new u16(Re);Oe<je;++Oe)Ee[Oe]&&++Me[Ee[Oe]-1];var De=new u16(Re);for(Oe=1;Oe<Re;++Oe)De[Oe]=De[Oe-1]+Me[Oe-1]<<1;var $e;if(Te){$e=new u16(1<<Re);var Be=15-Re;for(Oe=0;Oe<je;
vendor: 4,752 bytes, line 4047
4047++Oe)if(Ee[Oe])for(var Ue=Oe<<4|Ee[Oe],ze=Re-Ee[Oe],We=De[Ee[Oe]-1]++<<ze,Xe=We|(1<<ze)-1;We<=Xe;++We)$e[rev[We]>>Be]=Ue}else for($e=new u16(je),Oe=0;Oe<je;++Oe)Ee[Oe]&&($e[Oe]=rev[De[Ee[Oe]-1]++]>>15-Ee[Oe]);return $e},flt=new u8(288);for(var i$1=0;i$1<144;++i$1)flt[i$1]=8;for(var i$1=144;i$1<256;++i$1)flt[i$1]=9;for(var i$1=256;i$1<280;++i$1)flt[i$1]=7;for(var i$1=280;i$1<288;++i$1)flt[i$1]=8;var fdt=new u8(32);for(var i$1=0;i$1<32;++i$1)fdt[i$1]=5;var flm=hMap(flt,9,0),fdm=hMap(fdt,5,0),shft=function(Ee){return(Ee+7)/8|0},slc=function(Ee,Re,Te){return(Te==null||Te>Ee.length)&&(Te=Ee.length),new u8(Ee.subarray(Re,Te))},wbits=function(Ee,Re,Te){Te<<=Re&7;var je=Re/8|0;Ee[je]|=Te,Ee[je+1]|=Te>>8},wbits16=function(Ee,Re,Te){Te<<=Re&7;var je=Re/8|0;Ee[je]|=Te,Ee[je+1]|=Te>>8,Ee[je+2]|=Te>>16},hTree=function(Ee,Re){for(var Te=[],je=0;je<Ee.length;++je)Ee[je]&&Te.push({s:je,f:Ee[je]});var Oe=Te.length,Me=Te.slice();if(!Oe)return{t:et$1,l:0};if(Oe==1){var De=new u8(Te[0].s+1);return De[Te[0].s]=1,{t:De,l:1}}Te.sort(function(Je,ir){return Je.f-ir.f}),Te.push({s:-1,f:25001});var $e=Te[0],Be=Te[1],Ue=0,ze=1,We=2;for(Te[0]={s:-1,f:$e.f+Be.f,l:$e,r:Be};ze!=Oe-1;)$e=Te[Te[Ue].f<Te[We].f?Ue++:We++],Be=Te[Ue!=ze&&Te[Ue].f<Te[We].f?Ue++:We++],Te[ze++]={s:-1,f:$e.f+Be.f,l:$e,r:Be};for(var Xe=Me[0].s,je=1;je<Oe;++je)Me[je].s>Xe&&(Xe=Me[je].s);var He=new u16(Xe+1),qe=ln(Te[ze-1],He,0);if(qe>Re){var je=0,Ge=0,Ye=qe-Re,Ve=1<<Ye;for(Me.sort(function(ir,rr){return He[rr.s]-He[ir.s]||ir.f-rr.f});je<Oe;++je){var Ke=Me[je].s;if(He[Ke]>Re)Ge+=Ve-(1<<qe-He[Ke]),He[Ke]=Re;else break}for(Ge>>=Ye;Ge>0;){var Qe=Me[je].s;He[Qe]<Re?Ge-=1<<Re-He[Qe]++-1:++je}for(;je>=0&&Ge;--je){var Ze=Me[je].s;He[Ze]==Re&&(--He[Ze],++Ge)}qe=Re}return{t:new u8(He),l:qe}},ln=function(Ee,Re,Te){return Ee.s==-1?Math.max(ln(Ee.l,Re,Te+1),ln(Ee.r,Re,Te+1)):Re[Ee.s]=Te},lc=function(Ee){for(var Re=Ee.length;Re&&!Ee[--Re];);for(var Te=new u16(++Re),je=0,Oe=Ee[0],Me=1,De=function(Be){Te[je++]=Be},$e=1;$e<=Re;++$e)if(Ee[$e]==Oe&&$e!=Re)++Me;else{if(!Oe&&Me>2){for(;Me>138;Me-=138)De(32754);Me>2&&(De(Me>10?Me-11<<5|28690:Me-3<<5|12305),Me=0)}else if(Me>3){for(De(Oe),--Me;Me>6;Me-=6)De(8304);Me>2&&(De(Me-3<<5|8208),Me=0)}for(;Me--;)De(Oe);Me=1,Oe=Ee[$e]}return{c:Te.subarray(0,je),n:Re}},clen=function(Ee,Re){for(var Te=0,je=0;je<Re.length;++je)Te+=Ee[je]*Re[je];return Te},wfblk=function(Ee,Re,Te){var je=Te.length,Oe=shft(Re+2);Ee[Oe]=je&255,Ee[Oe+1]=je>>8,Ee[Oe+2]=Ee[Oe]^255,Ee[Oe+3]=Ee[Oe+1]^255;for(var Me=0;Me<je;++Me)Ee[Oe+Me+4]=Te[Me];return(Oe+4+je)*8},wblk=function(Ee,Re,Te,je,Oe,Me,De,$e,Be,Ue,ze){wbits(Re,ze++,Te),++Oe[256];for(var We=hTree(Oe,15),Xe=We.t,He=We.l,qe=hTree(Me,15),Ge=qe.t,Ye=qe.l,Ve=lc(Xe),Ke=Ve.c,Qe=Ve.n,Ze=lc(Ge),Je=Ze.c,ir=Ze.n,rr=new u16(19),ar=0;ar<Ke.length;++ar)++rr[Ke[ar]&31];for(var ar=0;ar<Je.length;++ar)++rr[Je[ar]&31];for(var or=hTree(rr,7),pr=or.t,tr=or.l,nr=19;nr>4&&!pr[clim[nr-1]];--nr);var hr=Ue+5<<3,sr=clen(Oe,flt)+clen(Me,fdt)+De,xr=clen(Oe,Xe)+clen(Me,Ge)+De+14+3*nr+clen(rr,pr)+2*rr[16]+3*rr[17]+7*rr[18];if(Be>=0&&hr<=sr&&hr<=xr)return wfblk(Re,ze,Ee.subarray(Be,Be+Ue));var Rr,br,wr,vr;if(wbits(Re,ze,1+(xr<sr)),ze+=2,xr<sr){Rr=hMap(Xe,He,0),br=Xe,wr=hMap(Ge,Ye,0),vr=Ge;var Dr=hMap(pr,tr,0);wbits(Re,ze,Qe-257),wbits(Re,ze+5,ir-1),wbits(Re,ze+10,nr-4),ze+=14;for(var ar=0;ar<nr;++ar)wbits(Re,ze+3*ar,pr[clim[ar]]);ze+=3*nr;for(var kr=[Ke,Je],cr=0;cr<2;++cr)for(var dr=kr[cr],ar=0;ar<dr.length;++ar){var ur=dr[ar]&31;wbits(Re,ze,Dr[ur]),ze+=pr[ur],ur>15&&(wbits(Re,ze,dr[ar]>>5&127),ze+=dr[ar]>>12)}}else Rr=flm,br=flt,wr=fdm,vr=fdt;for(var ar=0;ar<$e;++ar){var gr=je[ar];if(gr>255){var ur=gr>>18&31;wbits16(Re,ze,Rr[ur+257]),ze+=br[ur+257],ur>7&&(wbits(Re,ze,gr>>23&31),ze+=fleb[ur]);var _r=gr&31;wbits16(Re,ze,wr[_r]),ze+=vr[_r],_r>3&&(wbits16(Re,ze,gr>>5&8191),ze+=fdeb[_r])}else wbits16(Re,ze,Rr[gr]),ze+=br[gr]}return wbits16(Re,ze,Rr[256]),ze+br[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et$1=new u8(0),dflt=function(Ee,Re,Te,je,Oe,Me){var De=Me.z||Ee.length,$e=new u8(je+De+5*(1+Math.ceil(De/7e3))+Oe),Be=$e.subarray(je,$e.length-Oe),Ue=Me.l,ze=(Me.r||0)&7;if(Re){ze&&(Be[0]=Me.r>>3);for(var We=deo[Re-1],Xe=We>>13,He=We&8191,qe=(1<<Te)-1,Ge=Me.p||new u16(32768),Ye=Me.h||new u16(qe+1),Ve=Math.ceil(Te/3),Ke=2*Ve,Qe=function(mr){return(Ee[mr]^Ee[mr+1]<<Ve^Ee[mr+2]<<Ke)&qe},Ze=new i32(25e3),Je=new u16(288),ir=new u16(32),rr=0,ar=0,or=Me.i||0,pr=0,tr=Me.w||0,nr=0;or+2<De;++or){var hr=Qe(or),sr=or&32767,xr=Ye[hr];if(Ge[sr]=xr,Ye[hr]=sr,tr<=or){var Rr=De-or;if((rr>7e3||pr>24576)&&(Rr>423||!Ue)){ze=wblk(Ee,Be,0,Ze,Je,ir,ar,pr,nr,or-nr,ze),pr=rr=ar=0,nr=or;for(var br=0;br<286;++br)Je[br]=0;for(var br=0;br<30;++br)ir[br]=0}var wr=2,vr=0,Dr=He,kr=sr-xr&32767;if(Rr>
vendor: 10,877 bytes, lines 4047-4048
40472&&hr==Qe(or-kr))for(var cr=Math.min(Xe,Rr)-1,dr=Math.min(32767,or),ur=Math.min(258,Rr);kr<=dr&&--Dr&&sr!=xr;){if(Ee[or+wr]==Ee[or+wr-kr]){for(var gr=0;gr<ur&&Ee[or+gr]==Ee[or+gr-kr];++gr);if(gr>wr){if(wr=gr,vr=kr,gr>cr)break;for(var _r=Math.min(kr,gr-2),Ir=0,br=0;br<_r;++br){var Ar=or-kr+br&32767,Tr=Ge[Ar],Nr=Ar-Tr&32767;Nr>Ir&&(Ir=Nr,xr=Ar)}}}sr=xr,xr=Ge[sr],kr+=sr-xr&32767}if(vr){Ze[pr++]=268435456|revfl[wr]<<18|revfd[vr];var Br=revfl[wr]&31,Hr=revfd[vr]&31;ar+=fleb[Br]+fdeb[Hr],++Je[257+Br],++ir[Hr],tr=or+wr,++rr}else Ze[pr++]=Ee[or],++Je[Ee[or]]}}for(or=Math.max(or,tr);or<De;++or)Ze[pr++]=Ee[or],++Je[Ee[or]];ze=wblk(Ee,Be,Ue,Ze,Je,ir,ar,pr,nr,or-nr,ze),Ue||(Me.r=ze&7|Be[ze/8|0]<<3,ze-=7,Me.h=Ye,Me.p=Ge,Me.i=or,Me.w=tr)}else{for(var or=Me.w||0;or<De+Ue;or+=65535){var Vr=or+65535;Vr>=De&&(Be[ze/8|0]=Ue,Vr=De),ze=wfblk(Be,ze+1,Ee.subarray(or,Vr))}Me.i=De}return slc($e,0,je+shft(ze)+Oe)},adler=function(){var Ee=1,Re=0;return{p:function(Te){for(var je=Ee,Oe=Re,Me=Te.length|0,De=0;De!=Me;){for(var $e=Math.min(De+2655,Me);De<$e;++De)Oe+=je+=Te[De];je=(je&65535)+15*(je>>16),Oe=(Oe&65535)+15*(Oe>>16)}Ee=je,Re=Oe},d:function(){return Ee%=65521,Re%=65521,(Ee&255)<<24|(Ee&65280)<<8|(Re&255)<<8|Re>>8}}},dopt=function(Ee,Re,Te,je,Oe){if(!Oe&&(Oe={l:1},Re.dictionary)){var Me=Re.dictionary.subarray(-32768),De=new u8(Me.length+Ee.length);De.set(Me),De.set(Ee,Me.length),Ee=De,Oe.w=Me.length}return dflt(Ee,Re.level==null?6:Re.level,Re.mem==null?Oe.l?Math.ceil(Math.max(8,Math.min(13,Math.log(Ee.length)))*1.5):20:12+Re.mem,Te,je,Oe)},wbytes=function(Ee,Re,Te){for(;Te;++Re)Ee[Re]=Te,Te>>>=8},zlh=function(Ee,Re){var Te=Re.level,je=Te==0?0:Te<6?1:Te==9?3:2;if(Ee[0]=120,Ee[1]=je<<6|(Re.dictionary&&32),Ee[1]|=31-(Ee[0]<<8|Ee[1])%31,Re.dictionary){var Oe=adler();Oe.p(Re.dictionary),wbytes(Ee,2,Oe.d())}};function zlibSync(Ee,Re){Re||(Re={});var Te=adler();Te.p(Ee);var je=dopt(Ee,Re,Re.dictionary?6:2,4);return zlh(je,Re),wbytes(je,je.length-4,Te.d()),je}var td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et$1,{stream:!0}),tds=1}catch(Ee){}function _arrayWithHoles(Ee){if(Array.isArray(Ee))return Ee}function _iterableToArrayLimit(Ee,Re){var Te=Ee==null?null:typeof Symbol<"u"&&Ee[Symbol.iterator]||Ee["@@iterator"];if(Te!=null){var je,Oe,Me,De,$e=[],Be=!0,Ue=!1;try{if(Me=(Te=Te.call(Ee)).next,Re!==0)for(;!(Be=(je=Me.call(Te)).done)&&($e.push(je.value),$e.length!==Re);Be=!0);}catch(ze){Ue=!0,Oe=ze}finally{try{if(!Be&&Te.return!=null&&(De=Te.return(),Object(De)!==De))return}finally{if(Ue)throw Oe}}return $e}}function _arrayLikeToArray(Ee,Re){(Re==null||Re>Ee.length)&&(Re=Ee.length);for(var Te=0,je=Array(Re);Te<Re;Te++)je[Te]=Ee[Te];return je}function _unsupportedIterableToArray(Ee,Re){if(Ee){if(typeof Ee=="string")return _arrayLikeToArray(Ee,Re);var Te={}.toString.call(Ee).slice(8,-1);return Te==="Object"&&Ee.constructor&&(Te=Ee.constructor.name),Te==="Map"||Te==="Set"?Array.from(Ee):Te==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Te)?_arrayLikeToArray(Ee,Re):void 0}}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4048In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _slicedToArray(Ee,Re){return _arrayWithHoles(Ee)||_iterableToArrayLimit(Ee,Re)||_unsupportedIterableToArray(Ee,Re)||_nonIterableRest()}function decode(Ee,Re="utf8"){return new TextDecoder(Re).decode(Ee)}const encoder=new TextEncoder;function encode(Ee){return encoder.encode(Ee)}const defaultByteLength=1024*8,hostBigEndian=(()=>{const Ee=new Uint8Array(4),Re=new Uint32Array(Ee.buffer);return!((Re[0]=1)&Ee[0])})(),typedArrays={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class IOBuffer{constructor(Re=defaultByteLength,Te={}){Es(this,"buffer");Es(this,"byteLength");Es(this,"byteOffset");Es(this,"length");Es(this,"offset");Es(this,"lastWrittenByte");Es(this,"littleEndian");Es(this,"_data");Es(this,"_mark");Es(this,"_marks");let je=!1;typeof Re=="number"?Re=new ArrayBuffer(Re):(je=!0,this.lastWrittenByte=Re.byteLength);const Oe=Te.offset?Te.offset>>>0:0,Me=Re.byteLength-Oe;let De=Oe;(ArrayBuffer.isView(Re)||Re instanceof IOBuffer)&&(Re.byteLength!==Re.buffer.byteLength&&(De=Re.byteOffset+Oe),Re=Re.buffer),je?this.lastWrittenByte=Me:this.lastWrittenByte=0,this.buffer=Re,this.length=Me,this.byteLength=Me,this.byteOffset=De,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,De,Me),this._mark=0,this._marks=[]}available(Re=1){return this.offset+Re<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(Re=1){return this.offset+=Re,this}back(Re=1){return this.offset-=Re,this}seek(Re){return this.offset=Re,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const Re=this._marks.pop();if(Re===void 0)throw new Error("Mark stack empty");return this.seek(Re),this}rewind(){return this.offset=0,this}ensureAvailable(Re=1){if(!this.available(Re)){const je=(this.offset+Re)*2,Oe=new Uint8Array(je);Oe.set(new Uint8Array(this.buffer)),this.buffer=Oe.buffer,this.length=je,this.byteLength=je,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(Re=1){return this.readArray(Re,"uint8")}readArray(Re,Te){const je=typedArrays[Te].BYTES_PER_ELEMENT*Re,Oe=this.byteOffset+this.offset,Me=this.buffer.slice(Oe,Oe+je);if(this.littleEndian===hostBigEndian&&Te!=="uint8"&&Te!=="int8"){const $e=new Uint8Array(this.buffer.slice(Oe,Oe+je));$e.reverse();const Be=new typedArrays[Te]($e.buffer);return this.offset+=je,Be.reverse(),Be}const De=new typedArrays[Te](Me);return this.offset+=je,De}readInt16(){const Re=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,Re}readUint16(){const Re=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,Re}readInt32(){const Re=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,Re}readUint32(){const Re=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,Re}readFloat32(){const Re=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,Re}readFloat64(){const Re=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,Re}readBigInt64(){const Re=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,Re}readBigUint64(){const Re=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,Re}readChar(){return String.fromCharCode(this.readInt8())}readChars(Re=1){let Te="";for(let je=0;je<Re;je++)Te+=this.readChar();return Te}readUtf8(Re=1){return decode(this.readBytes(Re))}decodeText(Re=1,Te="utf8"){return decode(this.readBytes(Re),Te)}writeBoolean(Re){return this.writeUint8(Re?255:0),this}writeInt8(Re){return this.ensureAvailable(1),this._data.setInt8(this.offset++,Re),this._updateLastWrittenByte(),this}writeUint8(Re){return this.ensureAvailable(1),this._data.setUint8(this.offset++,Re),this._updateLastWrittenByte(),this}writeByte(Re){return this.writeUint8(Re)}writeBytes(Re){this.ensureAvailable(Re.length);for(let Te=0;Te<Re.length;Te++)this._data.setUint8(this.offset++,Re[Te]);return this._updateLastWrittenByte(),this}writeInt16(Re){return this.ensureAvailable(2),this._data.setInt16(this.offset,Re,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(Re){return this.ensureAvailable(2),this._data.setUint16(this.offset,Re,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(Re){return this.ensureAvailable(4),this._data.setInt32(this.offset,Re,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(Re){return this.ensureAvailable(4),this._data.setUint32(this.offset,Re,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(Re){return this.ensureAvailable(4),this._data.setFloat32(this.offset,Re,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(Re){return this.ensureAvailable(8),this._data.setFloat64(this.offset,Re,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(Re){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,Re,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(Re){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,Re,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(Re){return this.writeUint8(Re.charCodeAt(0))}writeChars(Re){for(let Te=0;Te<Re.length;Te++)this.writeUint8(Re.charCodeAt(Te));return this}writeUtf8(Re){return this.writeBytes(encode(Re))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function zero$1(Ee){let Re=Ee.length;for(;--Re>=0;)Ee[Re]=0}const MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);const adler32=(Ee,Re,Te,je)=>{let Oe=Ee&65535|0,Me=Ee>>>16&65535|0,De=0;for(;Te!==0;){De=Te>2e3?2e3:Te,Te-=De;do Oe=Oe+Re[je++]|0,Me=Me+Oe|0;while(--De);Oe%=65521,Me%=65521}return Oe|Me<<16|0};var adler32_1=adler32;const makeTable=()=>{let Ee,Re=[];for(var Te=0;Te<256;Te++){Ee=Te;for(var je=0;je<8;je++)Ee=Ee&1?3988292384^Ee>>>1:Ee>>>1;Re[Te]=Ee}return Re},crcTable$1=new Uint32Array(makeTable()),crc32=(Ee,Re,Te,je)=>{const Oe=crcTable$1,Me=je+Te;Ee^=-1;for(let De=je;De<Me;De++)Ee=Ee>>>8^Oe[(Ee^Re[De])&255];return Ee^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ER
vendor: 22,641 bytes, line 4048
4048ROR:-5,Z_DEFLATED:8};const _has=(Ee,Re)=>Object.prototype.hasOwnProperty.call(Ee,Re);var assign=function(Ee){const Re=Array.prototype.slice.call(arguments,1);for(;Re.length;){const Te=Re.shift();if(Te){if(typeof Te!="object")throw new TypeError(Te+"must be non-object");for(const je in Te)_has(Te,je)&&(Ee[je]=Te[je])}}return Ee},flattenChunks=Ee=>{let Re=0;for(let je=0,Oe=Ee.length;je<Oe;je++)Re+=Ee[je].length;const Te=new Uint8Array(Re);for(let je=0,Oe=0,Me=Ee.length;je<Me;je++){let De=Ee[je];Te.set(De,Oe),Oe+=De.length}return Te},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Ee){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let Ee=0;Ee<256;Ee++)_utf8len[Ee]=Ee>=252?6:Ee>=248?5:Ee>=240?4:Ee>=224?3:Ee>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=Ee=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(Ee);let Re,Te,je,Oe,Me,De=Ee.length,$e=0;for(Oe=0;Oe<De;Oe++)Te=Ee.charCodeAt(Oe),(Te&64512)===55296&&Oe+1<De&&(je=Ee.charCodeAt(Oe+1),(je&64512)===56320&&(Te=65536+(Te-55296<<10)+(je-56320),Oe++)),$e+=Te<128?1:Te<2048?2:Te<65536?3:4;for(Re=new Uint8Array($e),Me=0,Oe=0;Me<$e;Oe++)Te=Ee.charCodeAt(Oe),(Te&64512)===55296&&Oe+1<De&&(je=Ee.charCodeAt(Oe+1),(je&64512)===56320&&(Te=65536+(Te-55296<<10)+(je-56320),Oe++)),Te<128?Re[Me++]=Te:Te<2048?(Re[Me++]=192|Te>>>6,Re[Me++]=128|Te&63):Te<65536?(Re[Me++]=224|Te>>>12,Re[Me++]=128|Te>>>6&63,Re[Me++]=128|Te&63):(Re[Me++]=240|Te>>>18,Re[Me++]=128|Te>>>12&63,Re[Me++]=128|Te>>>6&63,Re[Me++]=128|Te&63);return Re};const buf2binstring=(Ee,Re)=>{if(Re<65534&&Ee.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,Ee.length===Re?Ee:Ee.subarray(0,Re));let Te="";for(let je=0;je<Re;je++)Te+=String.fromCharCode(Ee[je]);return Te};var buf2string=(Ee,Re)=>{const Te=Re||Ee.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(Ee.subarray(0,Re));let je,Oe;const Me=new Array(Te*2);for(Oe=0,je=0;je<Te;){let De=Ee[je++];if(De<128){Me[Oe++]=De;continue}let $e=_utf8len[De];if($e>4){Me[Oe++]=65533,je+=$e-1;continue}for(De&=$e===2?31:$e===3?15:7;$e>1&&je<Te;)De=De<<6|Ee[je++]&63,$e--;if($e>1){Me[Oe++]=65533;continue}De<65536?Me[Oe++]=De:(De-=65536,Me[Oe++]=55296|De>>10&1023,Me[Oe++]=56320|De&1023)}return buf2binstring(Me,Oe)},utf8border=(Ee,Re)=>{Re=Re||Ee.length,Re>Ee.length&&(Re=Ee.length);let Te=Re-1;for(;Te>=0&&(Ee[Te]&192)===128;)Te--;return Te<0||Te===0?Re:Te+_utf8len[Ee[Te]]>Re?Te:Re},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const BAD$1=16209,TYPE$1=16191;var inffast=function Ee(Re,Te){let je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze,Je,ir,rr,ar,or,pr;const tr=Re.state;je=Re.next_in,or=Re.input,Oe=je+(Re.avail_in-5),Me=Re.next_out,pr=Re.output,De=Me-(Te-Re.avail_out),$e=Me+(Re.avail_out-257),Be=tr.dmax,Ue=tr.wsize,ze=tr.whave,We=tr.wnext,Xe=tr.window,He=tr.hold,qe=tr.bits,Ge=tr.lencode,Ye=tr.distcode,Ve=(1<<tr.lenbits)-1,Ke=(1<<tr.distbits)-1;e:do{qe<15&&(He+=or[je++]<<qe,qe+=8,He+=or[je++]<<qe,qe+=8),Qe=Ge[He&Ve];t:for(;;){if(Ze=Qe>>>24,He>>>=Ze,qe-=Ze,Ze=Qe>>>16&255,Ze===0)pr[Me++]=Qe&65535;else if(Ze&16){Je=Qe&65535,Ze&=15,Ze&&(qe<Ze&&(He+=or[je++]<<qe,qe+=8),Je+=He&(1<<Ze)-1,He>>>=Ze,qe-=Ze),qe<15&&(He+=or[je++]<<qe,qe+=8,He+=or[je++]<<qe,qe+=8),Qe=Ye[He&Ke];r:for(;;){if(Ze=Qe>>>24,He>>>=Ze,qe-=Ze,Ze=Qe>>>16&255,Ze&16){if(ir=Qe&65535,Ze&=15,qe<Ze&&(He+=or[je++]<<qe,qe+=8,qe<Ze&&(He+=or[je++]<<qe,qe+=8)),ir+=He&(1<<Ze)-1,ir>Be){Re.msg="invalid distance too far back",tr.mode=BAD$1;break e}if(He>>>=Ze,qe-=Ze,Ze=Me-De,ir>Ze){if(Ze=ir-Ze,Ze>ze&&tr.sane){Re.msg="invalid distance too far back",tr.mode=BAD$1;break e}if(rr=0,ar=Xe,We===0){if(rr+=Ue-Ze,Ze<Je){Je-=Ze;do pr[Me++]=Xe[rr++];while(--Ze);rr=Me-ir,ar=pr}}else if(We<Ze){if(rr+=Ue+We-Ze,Ze-=We,Ze<Je){Je-=Ze;do pr[Me++]=Xe[rr++];while(--Ze);if(rr=0,We<Je){Ze=We,Je-=Ze;do pr[Me++]=Xe[rr++];while(--Ze);rr=Me-ir,ar=pr}}}else if(rr+=We-Ze,Ze<Je){Je-=Ze;do pr[Me++]=Xe[rr++];while(--Ze);rr=Me-ir,ar=pr}for(;Je>2;)pr[Me++]=ar[rr++],pr[Me++]=ar[rr++],pr[Me++]=ar[rr++],Je-=3;Je&&(pr[Me++]=ar[rr++],Je>1&&(pr[Me++]=ar[rr++]))}else{rr=Me-ir;do pr[Me++]=pr[rr++],pr[Me++]=pr[rr++],pr[Me++]=pr[rr++],Je-=3;while(Je>2);Je&&(pr[Me++]=pr[rr++],Je>1&&(pr[Me++]=pr[rr++]))}}else if(Ze&64){Re.msg="invalid distance code",tr.mode=BAD$1;break e}else{Qe=Ye[(Qe&65535)+(He&(1<<Ze)-1)];continue r}break}}else if(Ze&64)if(Ze&32){tr.mode=TYPE$1;break e}else{Re.msg="invalid literal/length code",tr.mode=BAD$1;break e}else{Qe=Ge[(Qe&65535)+(He&(1<<Ze)-1)];continue t}break}}while(je<Oe&&Me<$e);Je=qe>>3,je-=Je,qe-=Je<<3,He&=(1<<qe)-1,Re.next_in=je,Re.next_out=Me,Re.avail_in=je<Oe?5+(Oe-je):5-(je-Oe),Re.avail_out=Me<$e?257+($e-Me):257-(Me-$e),tr.hold=He,tr.bits=qe};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(Ee,Re,Te,je,Oe,Me,De,$e)=>{const Be=$e.bits;let Ue=0,ze=0,We=0,Xe=0,He=0,qe=0,Ge=0,Ye=0,Ve=0,Ke=0,Qe,Ze,Je,ir,rr,ar=null,or;const pr=new Uint16Array(MAXBITS+1),tr=new Uint16Array(MAXBITS+1);let nr=null,hr,sr,xr;for(Ue=0;Ue<=MAXBITS;Ue++)pr[Ue]=0;for(ze=0;ze<je;ze++)pr[Re[Te+ze]]++;for(He=Be,Xe=MAXBITS;Xe>=1&&pr[Xe]===0;Xe--);if(He>Xe&&(He=Xe),Xe===0)return Oe[Me++]=1<<24|64<<16|0,Oe[Me++]=1<<24|64<<16|0,$e.bits=1,0;for(We=1;We<Xe&&pr[We]===0;We++);for(He<We&&(He=We),Ye=1,Ue=1;Ue<=MAXBITS;Ue++)if(Ye<<=1,Ye-=pr[Ue],Ye<0)return-1;if(Ye>0&&(Ee===CODES$1||Xe!==1))return-1;for(tr[1]=0,Ue=1;Ue<MAXBITS;Ue++)tr[Ue+1]=tr[Ue]+pr[Ue];for(ze=0;ze<je;ze++)Re[Te+ze]!==0&&(De[tr[Re[Te+ze]]++]=ze);if(Ee===CODES$1?(ar=nr=De,or=20):Ee===LENS$1?(ar=lbase,nr=lext,or=257):(ar=dbase,nr=dext,or=0),Ke=0,ze=0,Ue=We,rr=Me,qe=He,Ge=0,Je=-1,Ve=1<<He,ir=Ve-1,Ee===LENS$1&&Ve>ENOUGH_LENS$1||Ee===DISTS$1&&Ve>ENOUGH_DISTS$1)return 1;for(;;){hr=Ue-Ge,De[ze]+1<or?(sr=0,xr=De[ze]):De[ze]>=or?(sr=nr[De[ze]-or],xr=ar[De[ze]-or]):(sr=96,xr=0),Qe=1<<Ue-Ge,Ze=1<<qe,We=Ze;do Ze-=Qe,Oe[rr+(Ke>>Ge)+Ze]=hr<<24|sr<<16|xr|0;while(Ze!==0);for(Qe=1<<Ue-1;Ke&Qe;)Qe>>=1;if(Qe!==0?(Ke&=Qe-1,Ke+=Qe):Ke=0,ze++,--pr[Ue]===0){if(Ue===Xe)break;Ue=Re[Te+De[ze]]}if(Ue>He&&(Ke&ir)!==Je){for(Ge===0&&(Ge=He),rr+=We,qe=Ue-Ge,Ye=1<<qe;qe+Ge<Xe&&(Ye-=pr[qe+Ge],!(Ye<=0));)qe++,Ye<<=1;if(Ve+=1<<qe,Ee===LENS$1&&Ve>ENOUGH_LENS$1||Ee===DISTS$1&&Ve>ENOUGH_DISTS$1)return 1;Je=Ke&ir,Oe[Je]=He<<24|qe<<16|rr-Me|0}}return Ke!==0&&(Oe[rr+Ke]=Ue-Ge<<24|64<<16|0),$e.bits=He,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=Ee=>(Ee>>>24&255)+(Ee>>>8&65280)+((Ee&65280)<<8)+((Ee&255)<<24);function InflateState(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateStateCheck=Ee=>{if(!Ee)return 1;const Re=Ee.state;return!Re||Re.strm!==Ee||Re.mode<HEAD||Re.mode>SYNC?1:0},inflateResetKeep=Ee=>{if(inflateStateCheck(Ee))return Z_STREAM_ERROR$1;const Re=Ee.state;return Ee.total_in=Ee.total_out=Re.total=0,Ee.msg="",Re.wrap&&(Ee.adler=Re.wrap&1),Re.mode=HEAD,Re.last=0,Re.havedict=0,Re.flags=-1,Re.dmax=32768,Re.head=null,Re.hold=0,Re.bits=0,Re.lencode=Re.lendyn=new Int32Array(ENOUGH_LENS),Re.distcode=Re.distdyn=new Int32Array(ENOUGH_DISTS),Re.sane=1,Re.back=-1,Z_OK$1},inflateReset=Ee=>{if(inflateStateCheck(Ee))return Z_STREAM_ERROR$1;const Re=Ee.state;return Re.wsize=0,Re.whave=0,Re.wnext=0,inflateResetKeep(Ee)},inflateReset2=(Ee,Re)=>{let Te;if(inflateStateCheck(Ee))return Z_STREAM_ERROR$1;const je=Ee.state;return Re<0?(Te=0,Re=-Re):(Te=(Re>>4)+5,Re<48&&(Re&=15)),Re&&(Re<8||Re>15)?Z_STREAM_ERROR$1:(je.window!==null&&je.wbits!==Re&&(je.window=null),je.wrap=Te,je.wbits=Re,inflateReset(Ee))},inflateInit2=(Ee,Re)=>{if(!Ee)return Z_STREAM_ERROR$1;const Te=new InflateState;Ee.state=Te,Te.strm=Ee,Te.window=null,Te.mode=HEAD;const je=inflateReset2(Ee,Re);return je!==Z_OK$1&&(Ee.state=null),je},inflateInit=Ee=>inflateInit2(Ee,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=Ee=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let Re=0;for(;Re<144;)Ee.lens[Re++]=8;for(;Re<256;)Ee.lens[Re++]=9;for(;Re<280;)Ee.lens[Re++]=7;for(;Re<288;)Ee.lens[Re++]=8;for(inftrees(LENS,Ee.lens,0,288,lenfix,0,Ee.work,{bits:9}),Re=0;Re<32;)Ee.lens[Re++]=5;inftrees(DISTS,Ee.lens,0,32,distfix,0,Ee.work,{bits:5}),virgin=!1}Ee.lencode=lenfix,Ee.lenbits=9,Ee.distcode=distfix,Ee.distbits=5},updatewindow=(Ee,Re,Te,je)=>{let Oe;const Me=Ee.state;return Me.window===null&&(Me.wsize=1<<Me.wbits,Me.wnext=0,Me.whave=0,Me.window=new Uint8Array(Me.wsize)),je>=Me.wsize?(Me.window.set(Re.subarray(Te-Me.wsize,Te),0),Me.wnext=0,Me.whave=Me.wsize):(Oe=Me.wsize-Me.wnext,Oe>je&&(Oe=je),Me.window.set(Re.subarray(Te-je,Te-je+Oe),Me.wnext),je-=Oe,je?(Me.window.set(Re.subarray(Te-je,Te),0),Me.wnext=je,Me.whave=Me.wsize):(Me.wnext+=Oe,Me.wnext===Me.wsize&&(Me.wnext=0),Me.whave<Me.wsize&&(Me.whave+=Oe))),0},inflate$2=(Ee,Re)=>{let Te,je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye=0,Ve,Ke,Qe,Ze,Je,ir,rr,ar;const or=new Uint8Array(4);let pr,tr;const nr=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(Ee)||!Ee.output||!Ee.input&&Ee.avail_in!==0)return Z_STREAM_ERROR$1;Te=Ee.state,Te.mode===TYPE&&(Te.mode=TYPEDO),De=Ee.next_out,Oe=Ee.output,Be=Ee.avail_out,Me=Ee.next_in,je=Ee.input,$e=Ee.avail_in,Ue=Te.hold,ze=Te.bits,We=$e,Xe=Be,ar=Z_OK$1;e:for(;;)switch(Te.mode){case HEAD:if(Te.wrap===0){Te.mode=TYPEDO;break}for(;ze<16;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(Te.wrap&2&&Ue===35615){Te.wbits===0&&(Te.wbits=15),Te.check=0,or[0]=Ue&255,or[1]=Ue>>>8&255,Te.check=crc32_1(Te.check,or,2,0),Ue=0,ze=0,Te.mode=FLAGS;break}if(Te.head&&(Te.head.done=!1),!(Te.wrap&1)||(((Ue&255)<<8)+(Ue>>8))%31){Ee.msg="incorrect header check",Te.mode=BAD;break}if((Ue&15)!==Z_DEFLATED){Ee.msg="unknown compression method",Te.mode=BAD;break}if(Ue>>>=4,ze-=4,rr=(Ue&15)+8,Te.wbits===0&&(Te.wbits=rr),rr>15||rr>Te.wbits){Ee.msg="invalid window size",Te.mode=BAD;break}Te.dmax=1<<Te.wbits,Te.flags=0,Ee.adler=Te.check=1,Te.mode=Ue&512?DICTID:TYPE,Ue=0,ze=0;break;case FLAGS:for(;ze<16;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(Te.flags=Ue,(Te.flags&255)!==Z_DEFLATED){Ee.msg="unknown compression method",Te.mode=BAD;break}if(Te.flags&57344){Ee.msg="unknown header flags set",Te.mode=BAD;break}Te.head&&(Te.head.text=Ue>>8&1),Te.flags&512&&Te.wrap&4&&(or[0]=Ue&255,or[1]=Ue>>>8&255,Te.check=crc32_1(Te.check,or,2,0)),Ue=0,ze=0,Te.mode=TIME;case TIME:for(;ze<32;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Te.head&&(Te.head.time=Ue),Te.flags&512&&Te.wrap&4&&(or[0]=Ue&255,or[1]=Ue>>>8&255,or[2]=Ue>>>16&255,or[3]=Ue>>>24&255,Te.check=crc32_1(Te.check,or,4,0)),Ue=0,ze=0,Te.mode=OS;case OS:for(;ze<16;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Te.head&&(Te.head.xflags=Ue&255,Te.head.os=Ue>>8),Te.flags&512&&Te.wrap&4&&(or[0]=Ue&255,or[1]=Ue>>>8&255,Te.check=crc32_1(Te.check,or,2,0)),Ue=0,ze=0,Te.mode=EXLEN;case EXLEN:if(Te.flags&1024){for(;ze<16;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Te.length=Ue,Te.head&&(Te.head.extra_len=Ue),Te.flags&512&&Te.wrap&4&&(or[0]=Ue&255,or[1]=Ue>>>8&255,Te.check=crc32_1(Te.check,or,2,0)),Ue=0,ze=0}else Te.head&&(Te.head.extra=null);Te.mode=EXTRA;case EXTRA:if(Te.flags&1024&&(He=Te.length,He>$e&&(He=$e),He&&(Te.head&&(rr=Te.head.extra_len-Te.length,Te.head.extra||(Te.head.extra=new Uint8Array(Te.head.extra_len)),Te.head.extra.set(je.subarray(Me,Me+He),rr)),Te.flags&512&&Te.wrap&4&&(Te.check=crc32_1(Te.check,je,He,Me)),$e-=He,Me+=He,Te.length-=He),Te.length))break e;Te.length=0,Te.mode=NAME;case NAME:if(Te.flags&2048){if($e===0)break e;He=0;do rr=je[Me+He++],Te.head&&rr&&Te.length<65536&&(Te.head.name+=String.fromCharCode(rr));while(rr&&He<$e);if(Te.flags&512&&Te.wrap&4&&(Te.check=crc32_1(Te.check,je,He,Me)),$e-=He,Me+=He,rr)break e}else Te.head&&(Te.head.name=null);Te.length=0,Te.mode=COMMENT;case COMMENT:if(Te.flags&4096){if($e===0)break e;He=0;do rr=je[Me+He++],Te.head&&rr&&Te.length<65536&&(Te.head.comment+=String.fromCharCode(rr));while(rr&&He<$e);if(Te.flags&512&&Te.wrap&4&&(Te.check=crc32_1(Te.check,je,He,Me)),$e-=He,Me+=He,rr)break e}else Te.head&&(Te.head.comment=null);Te.mode=HCRC;case HCRC:if(Te.flags&512){for(;ze<16;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(Te.wrap&4&&Ue!==(Te.check&65535)){Ee.msg="header crc mismatch",Te.mode=BAD;break}Ue=0,ze=0}Te.head&&(Te.head.hcrc=Te.flags>>9&1,Te.head.done=!0),Ee.adler=Te.check=0,Te.mode=TYPE;break;case DICTID:for(;ze<32;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Ee.adler=Te.check=zswap32(Ue),Ue=0,ze=0,Te.mode=DICT;case DICT:if(Te.havedict===0)return Ee.next_out=De,Ee.avail_out=Be,Ee.next_in=Me,Ee.avail_in=$e,Te.hold=Ue,Te.bits=ze,Z_NEED_DICT$1;Ee.adler=Te.check=1,Te.mode=TYPE;case TYPE:if(Re===Z_BLOCK||Re===Z_TREES)break e;case TYPEDO:if(Te.last){Ue>>>=ze&7,ze-=ze&7,Te.mode=CHECK;break}for(;ze<3;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}switch(Te.last=Ue&1,Ue>>>=1,ze-=1,Ue&3){case 0:Te.mode=STORED;break;case 1:if(fixedtables(Te),Te.mode=LEN_,Re===Z_TREES){Ue>>>=2,ze-=2;break e}break;case 2:Te.mode=TABLE;break;case 3:Ee.msg="invalid block type",Te.mode=BAD}Ue>>>=2,ze-=2;break;case STORED:for(Ue>>>=ze&7,ze-=ze&7;ze<32;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if((Ue&65535)!==(Ue>>>16^65535)){Ee.msg="invalid stored block lengths",Te.mode=BAD;break}if(Te.length=Ue&65535,Ue=0,ze=0,Te.mode=COPY_,Re===Z_TREES)break e;case COPY_:Te.mode=COPY;case COPY:if(He=Te.length,He){if(He>$e&&(He=$e),He>Be&&(He=Be),He===0)break e;Oe.set(je.subarray(Me,Me+He),De),$e-=He,Me+=He,Be-=He,De+=He,Te.length-=He;break}Te.mode=TYPE;break;case TABLE:for(;ze<14;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(Te.nlen=(Ue&31)+257,Ue>>>=5,ze-=5,Te.ndist=(Ue&31)+1,Ue>>>=5,ze-=5,Te.ncode=(Ue&15)+4,Ue>>>=4,ze-=4,Te.nlen>286||Te.ndist>30){Ee.msg="too many length or distance symbols",Te.mode=BAD;break}Te.have=0,Te.mode=LENLENS;case LENLENS:for(;Te.have<Te.ncode;){for(;ze<3;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Te.lens[nr[Te.have++]]=Ue&7,Ue>>>=3,ze-=3}for(;Te.have<19;)Te.lens[nr[Te.have++]]=0;if(Te.lencode=Te.lendyn,Te.lenbits=7,pr={bits:Te.lenbits},ar=inftrees(CODES,Te.lens,0,19,Te.lencode,0,Te.work,pr),Te.lenbits=pr.bits,ar){Ee.msg="invalid code lengths set",Te.mode=BAD;break}Te.have=0,Te.mode=CODELENS;case CODELENS:for(;Te.have<Te.nlen+Te.ndist;){for(;Ye=Te.lencode[Ue&(1<<Te.lenbits)-1],Ve=Ye>>>24,Ke=Ye>>>16&255,Qe=Ye&65535,!(Ve<=ze);){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(Qe<16)Ue>>>=Ve,ze-=Ve,Te.lens[Te.have++]=Qe;else{if(Qe===16){for(tr=Ve+2;ze<tr;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(Ue>>>=Ve,ze-=Ve,Te.have===0){Ee.msg="invalid bit length repeat",Te.mode=BAD;break}rr=Te.lens[Te.have-1],He=3+(Ue&3),Ue>>>=2,ze-=2}else if(Qe===17){for(tr=Ve+3;ze<tr;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Ue>>>=Ve,ze-=Ve,rr=0,He=3+(Ue&7),Ue>>>=3,ze-=3}else{for(tr=Ve+7;ze<tr;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Ue>>>=Ve,ze-=Ve,rr=0,He=11+(Ue&127),Ue>>>=7,ze-=7}if(Te.have+He>Te.nlen+Te.ndist){Ee.msg="invalid bit length repeat",Te.mode=BAD;break}for(;He--;)Te.lens[Te.have++]=rr}}if(Te.mode===BAD)break;if(Te.lens[256]===0){Ee.msg="invalid code -- missing end-of-block",Te.mode=BAD;break}if(Te.lenbits=9,pr={bits:Te.lenbits},ar=inftrees(LENS,Te.lens,0,Te.nlen,Te.lencode,0,Te.work,pr),Te.lenbits=pr.bits,ar){Ee.msg="invalid literal/lengths set",Te.mode=BAD;break}if(Te.distbits=6,Te.distcode=Te.distdyn,pr={bits:Te.distbits},ar=inftrees(DISTS,Te.lens,Te.nlen,Te.ndist,Te.distcode,0,Te.work,pr),Te.distbits=pr.bits,ar){Ee.msg="invalid distances set",Te.mode=BAD;break}if(Te.mode=LEN_,Re===Z_TREES)break e;case LEN_:Te.mode=LEN;case LEN:if($e>=6&&Be>=258){Ee.next_out=De,Ee.avail_out=Be,Ee.next_in=Me,Ee.avail_in=$e,Te.hold=Ue,Te.bits=ze,inffast(Ee,Xe),De=Ee.next_out,Oe=Ee.output,Be=Ee.avail_out,Me=Ee.next_in,je=Ee.input,$e=Ee.avail_in,Ue=Te.hold,ze=Te.bits,Te.mode===TYPE&&(Te.back=-1);break}for(Te.back=0;Ye=Te.lencode[Ue&(1<<Te.lenbits)-1],Ve=Ye>>>24,Ke=Ye>>>16&255,Qe=Ye&65535,!(Ve<=ze);){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(Ke&&!(Ke&240)){for(Ze=Ve,Je=Ke,ir=Qe;Ye=Te.lencode[ir+((Ue&(1<<Ze+Je)-1)>>Ze)],Ve=Ye>>>24,Ke=Ye>>>16&255,Qe=Ye&65535,!(Ze+Ve<=ze);){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Ue>>>=Ze,ze-=Ze,Te.back+=Ze}if(Ue>>>=Ve,ze-=Ve,Te.back+=Ve,Te.length=Qe,Ke===0){Te.mode=LIT;break}if(Ke&32){Te.back=-1,Te.mode=TYPE;break}if(Ke&64){Ee.msg="invalid literal/length code",Te.mode=BAD;break}Te.extra=Ke&15,Te.mode=LENEXT;case LENEXT:if(Te.extra){for(tr=Te.extra;ze<tr;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Te.length+=Ue&(1<<Te.extra)-1,Ue>>>=Te.extra,ze-=Te.extra,Te.back+=Te.extra}Te.was=Te.length,Te.mode=DIST;case DIST:for(;Ye=Te.distcode[Ue&(1<<Te.distbits)-1],Ve=Ye>>>24,Ke=Ye>>>16&255,Qe=Ye&65535,!(Ve<=ze);){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(!(Ke&240)){for(Ze=Ve,Je=Ke,ir=Qe;Ye=Te.distcode[ir+((Ue&(1<<Ze+Je)-1)>>Ze)],Ve=Ye>>>24,Ke=Ye>>>16&255,Qe=Ye&65535,!(Ze+Ve<=ze);){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Ue>>>=Ze,ze-=Ze,Te.back+=Ze}if(Ue>>>=Ve,ze-=Ve,Te.back+=Ve,Ke&64){Ee.msg="invalid distance code",Te.mode=BAD;break}Te.offset=Qe,Te.extra=Ke&15,Te.mode=DISTEXT;case DISTEXT:if(Te.extra){for(tr=Te.extra;ze<tr;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}Te.offset+=Ue&(1<<Te.extra)-1,Ue>>>=Te.extra,ze-=Te.extra,Te.back+=Te.extra}if(Te.offset>Te.dmax){Ee.msg="invalid distance too far back",Te.mode=BAD;break}Te.mode=MATCH;case MATCH:if(Be===0)break e;if(He=Xe-Be,Te.offset>He){if(He=Te.offset-He,He>Te.whave&&Te.sane){Ee.msg="invalid distance too far back",Te.mode=BAD;break}He>Te.wnext?(He-=Te.wnext,qe=Te.wsize-He):qe=Te.wnext-He,He>Te.length&&(He=Te.length),Ge=Te.window}else Ge=Oe,qe=De-Te.offset,He=Te.length;He>Be&&(He=Be),Be-=He,Te.length-=He;do Oe[De++]=Ge[qe++];while(--He);Te.length===0&&(Te.mode=LEN);break;case LIT:if(Be===0)break e;Oe[De++]=Te.length,Be--,Te.mode=LEN;break;case CHECK:if(Te.wrap){for(;ze<32;){if($e===0)break e;$e--,Ue|=je[Me++]<<ze,ze+=8}if(Xe-=Be,Ee.total_out+=Xe,Te.total+=Xe,Te.wrap&4&&Xe&&(Ee.adler=Te.check=Te.flags?crc32_1(Te.check,Oe,Xe,De-Xe):adler32_1(Te.check,Oe,Xe,De-Xe)),Xe=Be,Te.wrap&4&&(Te.flags?Ue:zswap32(Ue))!==Te.check){Ee.msg="incorrect data check",Te.mode=BAD;break}Ue=0,ze=0}Te.mode=LENGTH;case LENGTH:if(Te.wrap&&Te.flags){for(;ze<32;){if($e===0)break e;$e--,Ue+=je[Me++]<<ze,ze+=8}if(Te.wrap&4&&Ue!==(Te.total&4294967295)){Ee.msg="incorrect length check",Te.mode=BAD;break}Ue=0,ze=0}Te.mode=DONE;case DONE:ar=Z_STREAM_END$1;break e;case BAD:ar=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return Ee.next_out=De,Ee.avail_out=Be,Ee.next_in=Me,Ee.avail_in=$e,Te.hold=Ue,Te.bits=ze,(Te.wsize||Xe!==Ee.avail_out&&Te.mode<BAD&&(Te.mode<CHECK||Re!==Z_FINISH$1))&&updatewindow(Ee,Ee.output,Ee.next_out,Xe-Ee.avail_out),We-=Ee.avail_in,Xe-=Ee.avail_out,Ee.total_in+=We,Ee.total_out+=Xe,Te.total+=Xe,Te.wrap&4&&Xe&&(Ee.adler=Te.check=Te.flags?crc32_1(Te.check,Oe,Xe,Ee.next_out-Xe):adler32_1(Te.check,Oe,Xe,Ee.next_out-Xe)),Ee.data_type=Te.bits+(Te.last?64:0)+(Te.mode===TYPE?128:0)+(Te.mode===LEN_||Te.mode===COPY_?256:0),(We===0&&Xe===0||Re===Z_FINISH$1)&&ar===Z_OK$1&&(ar=Z_BUF_ERROR),ar},inflateEnd=Ee=>{if(inflateStateCheck(Ee))return Z_STREAM_ERROR$1;let Re=Ee.state;return Re.window&&(Re.window=null),Ee.state=null,Z_OK$1},inflateGetHeader=(Ee,Re)=>{if(inflateStateCheck(Ee))return Z_STREAM_ERROR$1;const Te=Ee.state;return Te.wrap&2?(Te.head=Re,Re.done=!1,Z_OK$1):Z_STREAM_ERROR$1},inflateSetDictionary=(Ee,Re)=>{const Te=Re.length;let je,Oe,Me;return inflateStateCheck(Ee)||(je=Ee.state,je.wrap!==0&&je.mode!==DICT)?Z_STREAM_ERROR$1:je.mode===DICT&&(Oe=1,Oe=adler32_1(Oe,Re,Te,0),Oe!==je.check)?Z_DATA_ERROR$1:(Me=updatewindow(Ee,Re,Te,Te),Me?(je.mode=MEM,Z_MEM_ERROR$1):(je.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(Ee){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},Ee||{});const Re=this.options;Re.raw&&Re.windowBits>
vendor: 12,612 bytes, line 4048
4048=0&&Re.windowBits<16&&(Re.windowBits=-Re.windowBits,Re.windowBits===0&&(Re.windowBits=-15)),Re.windowBits>=0&&Re.windowBits<16&&!(Ee&&Ee.windowBits)&&(Re.windowBits+=32),Re.windowBits>15&&Re.windowBits<48&&(Re.windowBits&15||(Re.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let Te=inflate_1$2.inflateInit2(this.strm,Re.windowBits);if(Te!==Z_OK)throw new Error(messages[Te]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),Re.dictionary&&(typeof Re.dictionary=="string"?Re.dictionary=strings.string2buf(Re.dictionary):toString.call(Re.dictionary)==="[object ArrayBuffer]"&&(Re.dictionary=new Uint8Array(Re.dictionary)),Re.raw&&(Te=inflate_1$2.inflateSetDictionary(this.strm,Re.dictionary),Te!==Z_OK)))throw new Error(messages[Te])}Inflate$1.prototype.push=function(Ee,Re){const Te=this.strm,je=this.options.chunkSize,Oe=this.options.dictionary;let Me,De,$e;if(this.ended)return!1;for(Re===~~Re?De=Re:De=Re===!0?Z_FINISH:Z_NO_FLUSH,toString.call(Ee)==="[object ArrayBuffer]"?Te.input=new Uint8Array(Ee):Te.input=Ee,Te.next_in=0,Te.avail_in=Te.input.length;;){for(Te.avail_out===0&&(Te.output=new Uint8Array(je),Te.next_out=0,Te.avail_out=je),Me=inflate_1$2.inflate(Te,De),Me===Z_NEED_DICT&&Oe&&(Me=inflate_1$2.inflateSetDictionary(Te,Oe),Me===Z_OK?Me=inflate_1$2.inflate(Te,De):Me===Z_DATA_ERROR&&(Me=Z_NEED_DICT));Te.avail_in>0&&Me===Z_STREAM_END&&Te.state.wrap>0&&Ee[Te.next_in]!==0;)inflate_1$2.inflateReset(Te),Me=inflate_1$2.inflate(Te,De);switch(Me){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(Me),this.ended=!0,!1}if($e=Te.avail_out,Te.next_out&&(Te.avail_out===0||Me===Z_STREAM_END))if(this.options.to==="string"){let Be=strings.utf8border(Te.output,Te.next_out),Ue=Te.next_out-Be,ze=strings.buf2string(Te.output,Be);Te.next_out=Ue,Te.avail_out=je-Ue,Ue&&Te.output.set(Te.output.subarray(Be,Be+Ue),0),this.onData(ze)}else this.onData(Te.output.length===Te.next_out?Te.output:Te.output.subarray(0,Te.next_out));if(!(Me===Z_OK&&$e===0)){if(Me===Z_STREAM_END)return Me=inflate_1$2.inflateEnd(this.strm),this.onEnd(Me),this.ended=!0,!0;if(Te.avail_in===0)break}}return!0};Inflate$1.prototype.onData=function(Ee){this.chunks.push(Ee)};Inflate$1.prototype.onEnd=function(Ee){Ee===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=Ee,this.msg=this.strm.msg};function inflate$1(Ee,Re){const Te=new Inflate$1(Re);if(Te.push(Ee),Te.err)throw Te.msg||messages[Te.err];return Te.result}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2};const{Inflate,inflate}=inflate_1$1;var Inflate_1=Inflate,inflate_1=inflate;const crcTable=[];for(let Ee=0;Ee<256;Ee++){let Re=Ee;for(let Te=0;Te<8;Te++)Re&1?Re=3988292384^Re>>>1:Re=Re>>>1;crcTable[Ee]=Re}const initialCrc=4294967295;function updateCrc(Ee,Re,Te){let je=Ee;for(let Oe=0;Oe<Te;Oe++)je=crcTable[(je^Re[Oe])&255]^je>>>8;return je}function crc(Ee,Re){return(updateCrc(initialCrc,Ee,Re)^initialCrc)>>>0}function checkCrc(Ee,Re,Te){const je=Ee.readUint32(),Oe=crc(new Uint8Array(Ee.buffer,Ee.byteOffset+Ee.offset-Re-4,Re),Re);if(Oe!==je)throw new Error(`CRC mismatch for chunk ${Te}. Expected ${je}, found ${Oe}`)}function unfilterNone(Ee,Re,Te){for(let je=0;je<Te;je++)Re[je]=Ee[je]}function unfilterSub(Ee,Re,Te,je){let Oe=0;for(;Oe<je;Oe++)Re[Oe]=Ee[Oe];for(;Oe<Te;Oe++)Re[Oe]=Ee[Oe]+Re[Oe-je]&255}function unfilterUp(Ee,Re,Te,je){let Oe=0;if(Te.length===0)for(;Oe<je;Oe++)Re[Oe]=Ee[Oe];else for(;Oe<je;Oe++)Re[Oe]=Ee[Oe]+Te[Oe]&255}function unfilterAverage(Ee,Re,Te,je,Oe){let Me=0;if(Te.length===0){for(;Me<Oe;Me++)Re[Me]=Ee[Me];for(;Me<je;Me++)Re[Me]=Ee[Me]+(Re[Me-Oe]>>1)&255}else{for(;Me<Oe;Me++)Re[Me]=Ee[Me]+(Te[Me]>>1)&255;for(;Me<je;Me++)Re[Me]=Ee[Me]+(Re[Me-Oe]+Te[Me]>>1)&255}}function unfilterPaeth(Ee,Re,Te,je,Oe){let Me=0;if(Te.length===0){for(;Me<Oe;Me++)Re[Me]=Ee[Me];for(;Me<je;Me++)Re[Me]=Ee[Me]+Re[Me-Oe]&255}else{for(;Me<Oe;Me++)Re[Me]=Ee[Me]+Te[Me]&255;for(;Me<je;Me++)Re[Me]=Ee[Me]+paethPredictor(Re[Me-Oe],Te[Me],Te[Me-Oe])&255}}function paethPredictor(Ee,Re,Te){const je=Ee+Re-Te,Oe=Math.abs(je-Ee),Me=Math.abs(je-Re),De=Math.abs(je-Te);return Oe<=Me&&Oe<=De?Ee:Me<=De?Re:Te}function applyUnfilter(Ee,Re,Te,je,Oe,Me){switch(Ee){case 0:unfilterNone(Re,Te,Oe);break;case 1:unfilterSub(Re,Te,Oe,Me);break;case 2:unfilterUp(Re,Te,je,Oe);break;case 3:unfilterAverage(Re,Te,je,Oe,Me);break;case 4:unfilterPaeth(Re,Te,je,Oe,Me);break;default:throw new Error(`Unsupported filter: ${Ee}`)}}const uint16$1=new Uint16Array([255]),uint8$1=new Uint8Array(uint16$1.buffer),osIsLittleEndian$1=uint8$1[0]===255;function decodeInterlaceAdam7(Ee){const{data:Re,width:Te,height:je,channels:Oe,depth:Me}=Ee,De=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],$e=Math.ceil(Me/8)*Oe,Be=new Uint8Array(je*Te*$e);let Ue=0;for(let ze=0;ze<7;ze++){const We=De[ze],Xe=Math.ceil((Te-We.x)/We.xStep),He=Math.ceil((je-We.y)/We.yStep);if(Xe<=0||He<=0)continue;const qe=Xe*$e,Ge=new Uint8Array(qe);for(let Ye=0;Ye<He;Ye++){const Ve=Re[Ue++],Ke=Re.subarray(Ue,Ue+qe);Ue+=qe;const Qe=new Uint8Array(qe);applyUnfilter(Ve,Ke,Qe,Ge,qe,$e),Ge.set(Qe);for(let Ze=0;Ze<Xe;Ze++){const Je=We.x+Ze*We.xStep,ir=We.y+Ye*We.yStep;if(!(Je>=Te||ir>=je))for(let rr=0;rr<$e;rr++)Be[(ir*Te+Je)*$e+rr]=Qe[Ze*$e+rr]}}}if(Me===16){const ze=new Uint16Array(Be.buffer);if(osIsLittleEndian$1)for(let We=0;We<ze.length;We++)ze[We]=swap16$1(ze[We]);return ze}else return Be}function swap16$1(Ee){return(Ee&255)<<8|Ee>>8&255}const uint16=new Uint16Array([255]),uint8=new Uint8Array(uint16.buffer),osIsLittleEndian=uint8[0]===255,empty=new Uint8Array(0);function decodeInterlaceNull(Ee){const{data:Re,width:Te,height:je,channels:Oe,depth:Me}=Ee,De=Math.ceil(Me/8)*Oe,$e=Math.ceil(Me/8*Oe*Te),Be=new Uint8Array(je*$e);let Ue=empty,ze=0,We,Xe;for(let He=0;He<je;He++){switch(We=Re.subarray(ze+1,ze+1+$e),Xe=Be.subarray(He*$e,(He+1)*$e),Re[ze]){case 0:unfilterNone(We,Xe,$e);break;case 1:unfilterSub(We,Xe,$e,De);break;case 2:unfilterUp(We,Xe,Ue,$e);break;case 3:unfilterAverage(We,Xe,Ue,$e,De);break;case 4:unfilterPaeth(We,Xe,Ue,$e,De);break;default:throw new Error(`Unsupported filter: ${Re[ze]}`)}Ue=Xe,ze+=$e+1}if(Me===16){const He=new Uint16Array(Be.buffer);if(osIsLittleEndian)for(let qe=0;qe<He.length;qe++)He[qe]=swap16(He[qe]);return He}else return Be}function swap16(Ee){return(Ee&255)<<8|Ee>>8&255}const pngSignature=Uint8Array.of(137,80,78,71,13,10,26,10);function checkSignature(Ee){if(!hasPngSignature(Ee.readBytes(pngSignature.length)))throw new Error("wrong PNG signature")}function hasPngSignature(Ee){if(Ee.length<pngSignature.length)return!1;for(let Re=0;Re<pngSignature.length;Re++)if(Ee[Re]!==pngSignature[Re])return!1;return!0}const textChunkName="tEXt",NULL=0,latin1Decoder=new TextDecoder("latin1");function validateKeyword(Ee){if(validateLatin1(Ee),Ee.length===0||Ee.length>79)throw new Error("keyword length must be between 1 and 79")}const latin1Regex=/^[\u0000-\u00FF]*$/;function validateLatin1(Ee){if(!latin1Regex.test(Ee))throw new Error("invalid latin1 text")}function decodetEXt(Ee,Re,Te){const je=readKeyword(Re);Ee[je]=readLatin1(Re,Te-je.length-1)}function readKeyword(Ee){for(Ee.mark();Ee.readByte()!==NULL;);const Re=Ee.offset;Ee.reset();const Te=latin1Decoder.decode(Ee.readBytes(Re-Ee.offset-1));return Ee.skip(1),validateKeyword(Te),Te}function readLatin1(Ee,Re){return latin1Decoder.decode(Ee.readBytes(Re))}const ColorType={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},CompressionMethod={UNKNOWN:-1,DEFLATE:0},FilterMethod={UNKNOWN:-1,ADAPTIVE:0},InterlaceMethod={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},DisposeOpType={NONE:0,BACKGROUND:1,PREVIOUS:2},BlendOpType={SOURCE:0,OVER:1};class PngDecoder extends IOBuffer{constructor(Te,je={}){super(Te);Es(this,"_checkCrc");Es(this,"_inflator");Es(this,"_png");Es(this,"_apng");Es(this,"_end");Es(this,"_hasPalette");Es(this,"_palette");Es(this,"_hasTransparency");Es(this,"_transparency");Es(this,"_compressionMethod");Es(this,"_filterMethod");Es(this,"_interlaceMethod");Es(this,"_colorType");Es(this,"_isAnimated");Es(this,"_numberOfFrames");Es(this,"_numberOfPlays");Es(this,"_frames");Es(this,"_writingDataChunks");const{checkCrc:Oe=!1}=je;this._checkCrc=Oe,this._inflator=new Inflate_1,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=CompressionMethod.UNKNOWN,this._filterMethod=FilterMethod.UNKNOWN,this._interlaceMethod=InterlaceMethod.UNKNOWN,this._colorType=ColorType.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(checkSignature(this);!this._end;){const Te=this.readUint32(),je=this.readChars(4);this.decodeChunk(Te,je)}return this.decodeImage(),this._png}decodeApng(){for(checkSignature(this);!this._end;){const Te=this.readUint32(),je=this.readChars(4);this.decodeApngChunk(Te,je)}return this.decodeApngImage(),this._apng}decodeChunk(Te,je){const Oe=this.offset;switch(je){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(Te);break;case"IDAT":this.decodeIDAT(Te);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(Te);break;case"iCCP":this.decodeiCCP(Te);break;case textChunkName:decodetEXt(this._png.text,this,Te);break;case"pHYs":this.decodepHYs();break;default:this.skip(Te);break}if(this.offset-Oe!==Te)throw new Error(`Length mismatch while decoding chunk ${je}`);this._checkCrc?checkCrc(this,Te+4,je):this.skip(4)}decodeApngChunk(Te,je){const Oe=this.offset;switch(je!=="fdAT"&&je!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),je){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(Te);break;default:this.decodeChunk(Te,je),this.offset=Oe+Te;break}if(this.offset-Oe!==Te)throw new Error(`Length mismatch while decoding chunk ${je}`);this._checkCrc?checkCrc(this,Te+4,je):this.skip(4)}decodeIHDR(){const Te=this._png;Te.width=this.readUint32(),Te.height=this.readUint32(),Te.depth=checkBitDepth(this.readUint8());const je=this.readUint8();this._colorType=je;let Oe;switch(je){case ColorType.GREYSCALE:Oe=1;break;case ColorType.TRUECOLOUR:Oe=3;break;case ColorType.INDEXED_COLOUR:Oe=1;break;case ColorType.GREYSCALE_ALPHA:Oe=2;break;case ColorType.TRUECOLOUR_ALPHA:Oe=4;break;case ColorType.UNKNOWN:default:throw new Error(`Unknown color type: ${je}`)}if(this._png.channels=Oe,this._compressionMethod=this.readUint8(),this._compressionMethod!==CompressionMethod.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const Te={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(Te)}decodePLTE(Te){if(Te%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${Te}`);const je=Te/3;this._hasPalette=!0;const Oe=[];this._palette=Oe;for(let Me=0;Me<je;Me++)Oe.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(Te){this._writingDataChunks=!0;const je=Te,Oe=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,Oe,je)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(Te)}decodeFDAT(Te){this._writingDataChunks=!0;let je=Te,Oe=this.offset+this.byteOffset;if(Oe+=4,je-=4,this._inflator.push(new Uint8Array(this.buffer,Oe,je)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(Te)}decodetRNS(Te){switch(this._colorType){case ColorType.GREYSCALE:case ColorType.TRUECOLOUR:{if(Te%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${Te}`);if(Te/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alph
vendor: 5,015 bytes, line 4048
4048a values than there are pixels (${Te/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(Te/2);for(let je=0;je<Te/2;je++)this._transparency[je]=this.readUint16();break}case ColorType.INDEXED_COLOUR:{if(Te>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${Te} vs ${this._palette.length})`);let je=0;for(;je<Te;je++){const Oe=this.readByte();this._palette[je].push(Oe)}for(;je<this._palette.length;je++)this._palette[je].push(255);break}case ColorType.UNKNOWN:case ColorType.GREYSCALE_ALPHA:case ColorType.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(Te){const je=readKeyword(this),Oe=this.readUint8();if(Oe!==CompressionMethod.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${Oe}`);const Me=this.readBytes(Te-je.length-2);this._png.iccEmbeddedProfile={name:je,profile:inflate_1(Me)}}decodepHYs(){const Te=this.readUint32(),je=this.readUint32(),Oe=this.readByte();this._png.resolution={x:Te,y:je,unit:Oe}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let Te=0;Te<this._numberOfFrames;Te++){const je={sequenceNumber:this._frames[Te].sequenceNumber,delayNumber:this._frames[Te].delayNumber,delayDenominator:this._frames[Te].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},Oe=this._frames.at(Te);if(Oe){if(Oe.data=decodeInterlaceNull({data:Oe.data,width:Oe.width,height:Oe.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),Te===0||Oe.xOffset===0&&Oe.yOffset===0&&Oe.width===this._png.width&&Oe.height===this._png.height)je.data=Oe.data;else{const Me=this._apng.frames.at(Te-1);this.disposeFrame(Oe,Me,je),this.addFrameDataToCanvas(je,Oe)}this._apng.frames.push(je)}}return this._apng}disposeFrame(Te,je,Oe){switch(Te.disposeOp){case DisposeOpType.NONE:break;case DisposeOpType.BACKGROUND:for(let Me=0;Me<this._png.height;Me++)for(let De=0;De<this._png.width;De++){const $e=(Me*Te.width+De)*this._png.channels;for(let Be=0;Be<this._png.channels;Be++)Oe.data[$e+Be]=0}break;case DisposeOpType.PREVIOUS:Oe.data.set(je.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(Te,je){const Oe=1<<this._png.depth,Me=(De,$e)=>{const Be=((De+je.yOffset)*this._png.width+je.xOffset+$e)*this._png.channels,Ue=(De*je.width+$e)*this._png.channels;return{index:Be,frameIndex:Ue}};switch(je.blendOp){case BlendOpType.SOURCE:for(let De=0;De<je.height;De++)for(let $e=0;$e<je.width;$e++){const{index:Be,frameIndex:Ue}=Me(De,$e);for(let ze=0;ze<this._png.channels;ze++)Te.data[Be+ze]=je.data[Ue+ze]}break;case BlendOpType.OVER:for(let De=0;De<je.height;De++)for(let $e=0;$e<je.width;$e++){const{index:Be,frameIndex:Ue}=Me(De,$e);for(let ze=0;ze<this._png.channels;ze++){const We=je.data[Ue+this._png.channels-1]/Oe,Xe=ze%(this._png.channels-1)===0?1:je.data[Ue+ze],He=Math.floor(We*Xe+(1-We)*Te.data[Be+ze]);Te.data[Be+ze]+=He}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var je;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const Te=this._isAnimated?((je=this._frames)==null?void 0:je.at(0)).data:this._inflator.result;if(this._filterMethod!==FilterMethod.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===InterlaceMethod.NO_INTERLACE)this._png.data=decodeInterlaceNull({data:Te,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===InterlaceMethod.ADAM7)this._png.data=decodeInterlaceAdam7({data:Te,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const Te=this._inflator.result,je=this._frames.at(-1);je?je.data=Te:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:DisposeOpType.NONE,blendOp:BlendOpType.SOURCE,data:Te}),this._inflator=new Inflate_1,this._writingDataChunks=!1}}function checkBitDepth(Ee){if(Ee!==1&&Ee!==2&&Ee!==4&&Ee!==8&&Ee!==16)throw new Error(`invalid bit depth: ${Ee}`);return Ee}var ResolutionUnitSpecifier;(function(Ee){Ee[Ee.UNKNOWN=0]="UNKNOWN",Ee[Ee.METRE=1]="METRE"}
vendor: 4,533 bytes, lines 4048-4053
4048)(ResolutionUnitSpecifier||(ResolutionUnitSpecifier={}));function decodePng(Ee,Re){return new PngDecoder(Ee,Re).decode()}var i=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function a(){i.console&&typeof i.console.log=="function"&&i.console.log.apply(i.console,arguments)}var o={log:a,warn:function(Ee){i.console&&(typeof i.console.warn=="function"?i.console.warn.apply(i.console,arguments):a.call(null,arguments))},error:function(Ee){i.console&&(typeof i.console.error=="function"?i.console.error.apply(i.console,arguments):a(Ee))}};function s(Ee,Re,Te){var je=new XMLHttpRequest;je.open("GET",Ee),je.responseType="blob",je.onload=function(){l(je.response,Re,Te)},je.onerror=function(){o.error("could not download file")},je.send()}function u(Ee){var Re=new XMLHttpRequest;Re.open("HEAD",Ee,!1);try{Re.send()}catch{}return Re.status>=200&&Re.status<=299}function c(Ee){try{Ee.dispatchEvent(new MouseEvent("click"))}catch{var Re=document.createEvent("MouseEvents");Re.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),Ee.dispatchEvent(Re)}}var l=i.saveAs||((typeof window>"u"?"undefined":_typeof(window))!=="object"||window!==i?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(Ee,Re,Te){var je=i.URL||i.webkitURL,Oe=document.createElement("a");Re=Re||Ee.name||"download",Oe.download=Re,Oe.rel="noopener",typeof Ee=="string"?(Oe.href=Ee,Oe.origin!==location.origin?u(Oe.href)?s(Ee,Re,Te):c(Oe,Oe.target="_blank"):c(Oe)):(Oe.href=je.createObjectURL(Ee),setTimeout(function(){je.revokeObjectURL(Oe.href)},4e4),setTimeout(function(){c(Oe)},0))}:"msSaveOrOpenBlob"in navigator?function(Ee,Re,Te){if(Re=Re||Ee.name||"download",typeof Ee=="string")if(u(Ee))s(Ee,Re,Te);else{var je=document.createElement("a");je.href=Ee,je.target="_blank",setTimeout(function(){c(je)})}else navigator.msSaveOrOpenBlob(function(Oe,Me){return Me===void 0?Me={autoBom:!1}:_typeof(Me)!=="object"&&(o.warn("Deprecated: Expected third argument to be a object"),Me={autoBom:!Me}),Me.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(Oe.type)?new Blob(["\uFEFF",Oe],{type:Oe.type}):Oe}(Ee,Te),Re)}:function(Ee,Re,Te,je){if((je=je||open("","_blank"))&&(je.document.title=je.document.body.innerText="downloading..."),typeof Ee=="string")return s(Ee,Re,Te);var Oe=Ee.type==="application/octet-stream",Me=/constructor/i.test(i.HTMLElement)||i.safari,De=/CriOS\/[\d]+/.test(navigator.userAgent);if((De||Oe&&Me)&&(typeof FileReader>"u"?"undefined":_typeof(FileReader))==="object"){var $e=new FileReader;$e.onloadend=function(){var ze=$e.result;ze=De?ze:ze.replace(/^data:[^;]*;/,"data:attachment/file;"),je?je.location.href=ze:location=ze,je=null},$e.readAsDataURL(Ee)}else{var Be=i.URL||i.webkitURL,Ue=Be.createObjectURL(Ee);je?je.location=Ue:location.href=Ue,je=null,setTimeout(function(){Be.revokeObjectURL(Ue)},4e4)}});/** 4049 * A class to parse color values 4050 * @author Stoyan Stefanov <[email protected]> 4051 * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} 4052 * @license Use it if you like it 4053 */function h(Ee){var Re;Ee=Ee||"",this.ok=!1,Ee.charAt(0)=="#"&&(Ee=Ee.substr(1,6)),Ee={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",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee9
40530",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",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:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",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",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[Ee=(Ee=Ee.replace(/ /g,"")).toLowerCase()]||Ee;for(var Te=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function($e){return[parseInt($e[1]),parseInt($e[2]),parseInt($e[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function($e){return[parseInt($e[1],16),parseInt($e[2],16),parseInt($e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function($e){return[parseInt($e[1]+$e[1],16),parseInt($e[2]+$e[2],16),parseInt($e[3]+$e[3],16)]}}],je=0;je<Te.length;je++){var Oe=Te[je].re,Me=Te[je].process,De=Oe.exec(Ee);De&&(Re=Me(De),this.r=Re[0],this.g=Re[1],this.b=Re[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var $e=this.r.toString(16),Be=this.g.toString(16),Ue=this.b.toString(16);return $e.length==1&&($e="0"+$e),Be.length==1&&(Be="0"+Be),Ue.length==1&&(Ue="0"+Ue),"#"+$e+Be+Ue}}var f=i.atob.bind(i),d=i.btoa.bind(i);/** 4054 * @license 4055 * Joseph Myers does not specify a particular license for his work. 4056 * 4057 * Author: Joseph Myers 4058 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js 4059 * 4060 * Modified by: Owen Leong 4061 */function p(Ee,Re){var Te=Ee[0],je=Ee[1],Oe=Ee[2],Me=Ee[3];Te=m(Te,je,Oe,Me,Re[0],7,-680876936),Me=m(Me,Te,je,Oe,Re[1],12,-389564586),Oe=m(Oe,Me,Te,je,Re[2],17,606105819),je=m(je,Oe,Me,Te,Re[3],22,-1044525330),Te=m(Te,je,Oe,Me,Re[4],7,-176418897),Me=m(Me,Te,je,Oe,Re[5],12,1200080426),Oe=m(Oe,Me,Te,je,Re[6],17,-1473231341),je=m(je,Oe,Me,Te,Re[7],22,-45705983),Te=m(Te,je,Oe,Me,Re[8],7,1770035416),Me=m(Me,Te,je,Oe,Re[9],12,-1958414417),Oe=m(Oe,Me,Te,je,Re[10],17,-42063),je=m(je,Oe,Me,Te,Re[11],22,-1990404162),Te=m(Te,je,Oe,Me,Re[12],7,1804603682),Me=m(Me,Te,je,Oe,Re[13],12,-40341101),Oe=m(Oe,Me,Te,je,Re[14],17,-1502002290),Te=v(Te,je=m(je,Oe,Me,Te,Re[15],22,1236535329),Oe,Me,Re[1],5,-165796510),Me=v(Me,Te,je,Oe,Re[6],9,-1069501632),Oe=v(Oe,Me,Te,je,Re[11],14,643717713),je=v(je,Oe,Me,Te,Re[0],20,-373897302),Te=v(Te,je,Oe,Me,Re[5],5,-701558691),Me=v(Me,Te,je,Oe,Re[10],9,38016083),Oe=v(Oe,Me,Te,je,Re[15],14,-660478335),je=v(je,Oe,Me,Te,Re[4],20,-405537848),Te=v(Te,je,Oe,Me,Re[9],5,568446438),Me=v(Me,Te,je,Oe,Re[14],9,-1019803690),Oe=v(Oe,Me,Te,je,Re[3],14,-187363961),je=v(je,Oe,Me,Te,Re[8],20,1163531501),Te=v(Te,je,Oe,Me,Re[13],5,-1444681467),Me=v(Me,Te,je,Oe,Re[2],9,-51403784),Oe=v(Oe,Me,Te,je,Re[7],14,1735328473),Te=b(Te,je=v(je,Oe,Me,Te,Re[12],20,-1926607734),Oe,Me,Re[5],4,-378558),Me=b(Me,Te,je,Oe,Re[8],11,-2022574463),Oe=b(Oe,Me,Te,je,Re[11],16,1839030562),je=b(je,Oe,Me,Te,Re[14],23,-35309556),Te=b(Te,je,Oe,Me,Re[1],4,-1530992060),Me=b
vendor: 9,378 bytes, lines 4061-4078
4061(Me,Te,je,Oe,Re[4],11,1272893353),Oe=b(Oe,Me,Te,je,Re[7],16,-155497632),je=b(je,Oe,Me,Te,Re[10],23,-1094730640),Te=b(Te,je,Oe,Me,Re[13],4,681279174),Me=b(Me,Te,je,Oe,Re[0],11,-358537222),Oe=b(Oe,Me,Te,je,Re[3],16,-722521979),je=b(je,Oe,Me,Te,Re[6],23,76029189),Te=b(Te,je,Oe,Me,Re[9],4,-640364487),Me=b(Me,Te,je,Oe,Re[12],11,-421815835),Oe=b(Oe,Me,Te,je,Re[15],16,530742520),Te=y(Te,je=b(je,Oe,Me,Te,Re[2],23,-995338651),Oe,Me,Re[0],6,-198630844),Me=y(Me,Te,je,Oe,Re[7],10,1126891415),Oe=y(Oe,Me,Te,je,Re[14],15,-1416354905),je=y(je,Oe,Me,Te,Re[5],21,-57434055),Te=y(Te,je,Oe,Me,Re[12],6,1700485571),Me=y(Me,Te,je,Oe,Re[3],10,-1894986606),Oe=y(Oe,Me,Te,je,Re[10],15,-1051523),je=y(je,Oe,Me,Te,Re[1],21,-2054922799),Te=y(Te,je,Oe,Me,Re[8],6,1873313359),Me=y(Me,Te,je,Oe,Re[15],10,-30611744),Oe=y(Oe,Me,Te,je,Re[6],15,-1560198380),je=y(je,Oe,Me,Te,Re[13],21,1309151649),Te=y(Te,je,Oe,Me,Re[4],6,-145523070),Me=y(Me,Te,je,Oe,Re[11],10,-1120210379),Oe=y(Oe,Me,Te,je,Re[2],15,718787259),je=y(je,Oe,Me,Te,Re[9],21,-343485551),Ee[0]=P(Te,Ee[0]),Ee[1]=P(je,Ee[1]),Ee[2]=P(Oe,Ee[2]),Ee[3]=P(Me,Ee[3])}function g(Ee,Re,Te,je,Oe,Me){return Re=P(P(Re,Ee),P(je,Me)),P(Re<<Oe|Re>>>32-Oe,Te)}function m(Ee,Re,Te,je,Oe,Me,De){return g(Re&Te|~Re&je,Ee,Re,Oe,Me,De)}function v(Ee,Re,Te,je,Oe,Me,De){return g(Re&je|Te&~je,Ee,Re,Oe,Me,De)}function b(Ee,Re,Te,je,Oe,Me,De){return g(Re^Te^je,Ee,Re,Oe,Me,De)}function y(Ee,Re,Te,je,Oe,Me,De){return g(Te^(Re|~je),Ee,Re,Oe,Me,De)}function w(Ee){var Re,Te=Ee.length,je=[1732584193,-271733879,-1732584194,271733878];for(Re=64;Re<=Ee.length;Re+=64)p(je,N(Ee.substring(Re-64,Re)));Ee=Ee.substring(Re-64);var Oe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(Re=0;Re<Ee.length;Re++)Oe[Re>>2]|=Ee.charCodeAt(Re)<<(Re%4<<3);if(Oe[Re>>2]|=128<<(Re%4<<3),Re>55)for(p(je,Oe),Re=0;Re<16;Re++)Oe[Re]=0;return Oe[14]=8*Te,p(je,Oe),je}function N(Ee){var Re,Te=[];for(Re=0;Re<64;Re+=4)Te[Re>>2]=Ee.charCodeAt(Re)+(Ee.charCodeAt(Re+1)<<8)+(Ee.charCodeAt(Re+2)<<16)+(Ee.charCodeAt(Re+3)<<24);return Te}var L="0123456789abcdef".split("");function x(Ee){for(var Re="",Te=0;Te<4;Te++)Re+=L[Ee>>8*Te+4&15]+L[Ee>>8*Te&15];return Re}function A(Ee){return String.fromCharCode(255&Ee,(65280&Ee)>>8,(16711680&Ee)>>16,(4278190080&Ee)>>24)}function S(Ee){return w(Ee).map(A).join("")}var _=function(Ee){for(var Re=0;Re<Ee.length;Re++)Ee[Re]=x(Ee[Re]);return Ee.join("")}(w("hello"))!="5d41402abc4b2a76b9719d911017c592";function P(Ee,Re){if(_){var Te=(65535&Ee)+(65535&Re);return(Ee>>16)+(Re>>16)+(Te>>16)<<16|65535&Te}return Ee+Re&4294967295}/** 4062 * @license 4063 * FPDF is released under a permissive license: there is no usage restriction. 4064 * You may embed it freely in your application (commercial or not), with or 4065 * without modifications. 4066 * 4067 * Reference: http://www.fpdf.org/en/script/script37.php 4068 */function k(Ee,Re){var Te,je,Oe,Me;if(Ee!==Te){for(var De=(Oe=Ee,Me=1+(256/Ee.length|0),new Array(Me+1).join(Oe)),$e=[],Be=0;Be<256;Be++)$e[Be]=Be;var Ue=0;for(Be=0;Be<256;Be++){var ze=$e[Be];Ue=(Ue+ze+De.charCodeAt(Be))%256,$e[Be]=$e[Ue],$e[Ue]=ze}Te=Ee,je=$e}else $e=je;var We=Re.length,Xe=0,He=0,qe="";for(Be=0;Be<We;Be++)He=(He+(ze=$e[Xe=(Xe+1)%256]))%256,$e[Xe]=$e[He],$e[He]=ze,De=$e[($e[Xe]+$e[He])%256],qe+=String.fromCharCode(Re.charCodeAt(Be)^De);return qe}/** 4069 * @license 4070 * Licensed under the MIT License. 4071 * http://opensource.org/licenses/mit-license 4072 * Author: Owen Leong (@owenl131) 4073 * Date: 15 Oct 2020 4074 * References: 4075 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt 4076 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js 4077 * http://www.fpdf.org/en/script/script37.php 4078 */var F={print:4,modify:8,copy:16,"annot-forms":32};function I(Ee,Re,Te,je){this.v=1,this.r=2;var Oe=192;Ee.forEach(function($e){if(F.perm!==void 0)throw new Error("Invalid permission: "+$e);Oe+=F[$e]}),this.padding="(¿N^NuÂAd\0NVÿú�\b..\0¶Ãh>Â/\f©þdSiz";var Me=(Re+this.padding).substr(0,32),De=(Te+this.padding).substr(0,32);this.O=this.processOwnerPassword(Me,De),this.P=-(1+(255^Oe)),this.encryptionKey=S(Me+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(je)).substr(0,5),this.U=k(this.encryptionKey,this.padding)}function C(Ee){if(/[^\u0000-\u00ff]/.test(Ee))throw new Error("Invalid PDF Name Object: "+Ee+", Only accept ASCII characters.");for(var Re="",Te=Ee.length,je=0;je<Te;je++){var Oe=Ee.charCodeAt(je);Re+=Oe<33||Oe===35||Oe===37||Oe===40||Oe===41||Oe===47||Oe===60||Oe===62||Oe===91||Oe===93||Oe===123||Oe===125||Oe>126?"#"+("0"+Oe.toString(16)).slice(-2):Ee[je]}return Re}function j(Ee){if(_typeof(Ee)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var Re={};this.subscribe=function(Te,je,Oe){if(Oe=Oe||!1,typeof Te!="string"||typeof je!="function"||typeof Oe!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");Re.hasOwnProperty(Te)||(Re[Te]={});var Me=Math.random().toString(35);return Re[Te][Me]=[je,!!Oe],Me},this.unsubscribe=function(Te){for(var je in Re)if(Re[je][Te])return delete Re[je][Te],Object.keys(Re[je]).length===0&&delete Re[je],!0;return!1},this.publish=function(Te){if(Re.hasOwnProperty(Te)){var je=Array.prototype.slice.call(arguments,1),Oe=[];for(var Me in Re[Te]){var De=Re[Te][Me];try{De[0].apply(Ee,je)}catch($e){i.console&&o.error("jsPDF PubSub Error",$e.message,$e)}De[1]&&Oe.push(Me)}Oe.length&&Oe.forEach(this.unsubscribe)}},this.getTopics=function(){return Re}}function O(Ee){if(!(this instanceof O))return new O(Ee);var Re="opacity,stroke-opacity".split(",");for(var Te in Ee)Ee.hasOwnProperty(Te)&&Re.indexOf(Te)>=0&&(this[Te]=Ee[Te]);this.id="",this.objectNumber=-1}function B(Ee,Re){this.gState=Ee,this.matrix=Re,this.id="",this.objectNumber=-1}function M(Ee,Re,Te,je,Oe){if(!(this instanceof M))return new M(Ee,Re,Te,je,Oe);this.type=Ee==="axial"?2:3,this.coords=Re,this.colors=Te,B.call(this,je,Oe)}function q(Ee,Re,Te,je,Oe){if(!(this instanceof q))return new q(Ee,Re,Te,je,Oe);this.boundingBox=Ee,this.xStep=Re,this.yStep=Te,this.stream="",this.cloneIndex=0,B.call(this,je,Oe)}function E(Ee){var Re,Te=typeof arguments[0]=="string"?arguments[0]:"p",je=arguments[1],Oe=arguments[2],Me=arguments[3],De=[],$e=1,Be=16,Ue="S",ze=null;_typeof(Ee=Ee||{})==="object"&&(Te=Ee.orientation,je=Ee.unit||je,Oe=Ee.format||Oe,Me=Ee.compress||Ee.compressPdf||Me,(ze=Ee.encryption||null)!==null&&(ze.userPassword=ze.userPassword||"",ze.ownerPassword=ze.ownerPassword||"",ze.userPermissions=ze.userPermissions||[]),$e=typeof Ee.userUnit=="number"?Math.abs(Ee.userUnit):1,Ee.precision!==void 0&&(Re=Ee.precision),Ee.floatPrecision!==void 0&&(Be=Ee.floatPrecision),Ue=Ee.defaultPathOperation||"S"),De=Ee.filters||(Me===!0?["FlateEncode"]:De),je=je||"mm",Te=(""+(Te||"P")).toLowerCase();var We=Ee.putOnlyUsedFonts||!1,Xe={},He={internal:{},__private__:{}};He.__private__.PubSub=j;var qe="1.3",Ge=He.__private__.getPdfVersion=function(){return qe};He.__private__.setPdfVersion=function(yr){qe=yr};var Ye={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};He.__private__.getPageFormats=function(){return Ye};var Ve=He.__private__.getPageFormat=function(yr){return Ye[yr]};Oe=Oe||"a4";var Ke="compat",Qe="advanced",Ze=Ke;function Je(){this.saveGraphicsState(),Sr(new nn(wn,0,0,-wn,0,Ki()*wn).toString()+" cm"),this.setFontSize(this.getFontSize()/wn),Ue="n",Ze=Qe}function ir(){this.restoreGraphicsState(),Ue="S",Ze=Ke}var rr=He.__private__.combineFontStyleAndFontWeight=function(yr,Ur){if(yr=="bold"&&Ur=="normal"||yr=="bold"&&Ur==400||yr=="normal"&&Ur=="italic"||yr=="bold"&&Ur=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return Ur&&(yr=Ur==400||Ur==="normal"?yr==="italic"?"italic":"normal":Ur!=700&&Ur!=="bold"||yr!=="normal"?(Ur==700?"bold":Ur)+""+yr:"bold"),yr};He.advancedAPI=function(yr){var Ur=Ze===Ke;return Ur&&Je.call(this),typeof yr!="function"||(yr(this),Ur&&ir.call(this)),this},He.compatAPI=function(yr){var Ur=Ze===Qe;return Ur&&ir.call(this),typeof yr!="function"||(yr(this),Ur&&Je.call(this)),this},He.isAdvancedAPI=function(){return Ze===Qe};var ar,or=function(yr){if(Ze!==Qe)throw new Error(yr+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},pr=He.roundToPrecision=He.__private__.roundToPrecision=function(yr,Ur){var un=Re||Ur;if(isNaN(yr)||isNaN(un))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return yr.toFixed(un).replace(/0+$/,"")};ar=He.hpf=He.__private__.hpf=typeof Be=="number"?function(yr){if(isNaN(yr))throw new Error("Invalid argument passed to jsPDF.hpf");return pr(yr,Be)}:Be==="smart"?function(yr){if(isNaN(yr))throw new Error("Invalid argument passed to
4078jsPDF.hpf");return pr(yr,yr>-1&&yr<1?16:5)}:function(yr){if(isNaN(yr))throw new Error("Invalid argument passed to jsPDF.hpf");return pr(yr,16)};var tr=He.f2=He.__private__.f2=function(yr){if(isNaN(yr))throw new Error("Invalid argument passed to jsPDF.f2");return pr(yr,2)},nr=He.__private__.f3=function(yr){if(isNaN(yr))throw new Error("Invalid argument passed to jsPDF.f3");return pr(yr,3)},hr=He.scale=He.__private__.scale=function(yr){if(isNaN(yr))throw new Error("Invalid argument passed to jsPDF.scale");return Ze===Ke?yr*wn:Ze===Qe?yr:void 0},sr=function(yr){return hr(function(Ur){return Ze===Ke?Ki()-Ur:Ze===Qe?Ur:void 0}(yr))};He.__private__.setPrecision=He.setPrecision=function(yr){typeof parseInt(yr,10)=="number"&&(Re=parseInt(yr,10))};var xr,Rr="00000000000000000000000000000000",br=He.__private__.getFileId=function(){return Rr},wr=He.__private__.setFileId=function(yr){return Rr=yr!==void 0&&/^[a-fA-F0-9]{32}$/.test(yr)?yr.toUpperCase():Rr.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),ze!==null&&(xo=new I(ze.userPermissions,ze.userPassword,ze.ownerPassword,Rr)),Rr};He.setFileId=function(yr){return wr(yr),this},He.getFileId=function(){return br()};var vr=He.__private__.convertDateToPDFDate=function(yr){var Ur=yr.getTimezoneOffset(),un=Ur<0?"+":"-",bn=Math.floor(Math.abs(Ur/60)),Tn=Math.abs(Ur%60),Gn=[un,ur(bn),"'",ur(Tn),"'"].join("");return["D:",yr.getFullYear(),ur(yr.getMonth()+1),ur(yr.getDate()),ur(yr.getHours()),ur(yr.getMinutes()),ur(yr.getSeconds()),Gn].join("")},Dr=He.__private__.convertPDFDateToDate=function(yr){var Ur=parseInt(yr.substr(2,4),10),un=parseInt(yr.substr(6,2),10)-1,bn=parseInt(yr.substr(8,2),10),Tn=parseInt(yr.substr(10,2),10),Gn=parseInt(yr.substr(12,2),10),es=parseInt(yr.substr(14,2),10);return new Date(Ur,un,bn,Tn,Gn,es,0)},kr=He.__private__.setCreationDate=function(yr){var Ur;if(yr===void 0&&(yr=new Date),yr instanceof Date)Ur=vr(yr);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(yr))throw new Error("Invalid argument passed to jsPDF.setCreationDate");Ur=yr}return xr=Ur},cr=He.__private__.getCreationDate=function(yr){var Ur=xr;return yr==="jsDate"&&(Ur=Dr(xr)),Ur};He.setCreationDate=function(yr){return kr(yr),this},He.getCreationDate=function(yr){return cr(yr)};var dr,ur=He.__private__.padd2=function(yr){return("0"+parseInt(yr)).slice(-2)},gr=He.__private__.padd2Hex=function(yr){return("00"+(yr=yr.toString())).substr(yr.length)},_r=0,Ir=[],Ar=[],Tr=0,Nr=[],Br=[],Hr=!1,Vr=Ar;He.__private__.setCustomOutputDestination=function(yr){Hr=!0,Vr=yr};var mr=function(yr){Hr||(Vr=yr)};He.__private__.resetCustomOutputDestination=function(){Hr=!1,Vr=Ar};var Sr=He.__private__.out=function(yr){return yr=yr.toString(),Tr+=yr.length+1,Vr.push(yr),Vr},Lr=He.__private__.write=function(yr){return Sr(arguments.length===1?yr.toString():Array.prototype.join.call(arguments," "))},jr=He.__private__.getArrayBuffer=function(yr){for(var Ur=yr.length,un=new ArrayBuffer(Ur),bn=new Uint8Array(un);Ur--;)bn[Ur]=yr.charCodeAt(Ur);return un},fr=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];He.__private__.getStandardFonts=function(){return fr};var Cr=Ee.fontSize||16;He.__private__.setFontSize=He.setFontSize=function(yr){return Cr=Ze===Qe?yr/wn:yr,this};var Mr,$r=He.__private__.getFontSize=He.getFontSize=function(){return Ze===Ke?Cr:Cr*wn},Fr=Ee.R2L||!1;He.__private__.setR2L=He.setR2L=function(yr){return Fr=yr,this},He.__private__.getR2L=He.getR2L=function(){return Fr};var Kr,an=He.__private__.setZoomMode=function(yr){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(yr))Mr=yr;else if(isNaN(yr)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(yr)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+yr+'" is not recognized.');Mr=yr}else Mr=parseInt(yr,10)};He.__private__.getZoomMode=function(){return Mr};var Wr,hn=He.__private__.setPageMode=function(yr){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(yr)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+yr+'" is not recognized.');Kr=yr};He.__private__.getPageMode=function(){return Kr};var cn=He.__private__.setLayoutMode=function(yr){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(yr)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+yr+'" is not recognized.');Wr=yr};He.__private__.getLayoutMode=function(){return Wr},He.__private__.setDisplayMode=He.setDisplayMode=function(yr,Ur,un){return an(yr),cn(Ur),hn(un),this};var tn={title:"",subject:"",author:"",keywords:"",creator:""};He.__private__.getDocumentProperty=function(yr){if(Object.keys(tn).indexOf(yr)===-1)throw new Error("Invalid argument passed to
4078jsPDF.getDocumentProperty");return tn[yr]},He.__private__.getDocumentProperties=function(){return tn},He.__private__.setDocumentProperties=He.setProperties=He.setDocumentProperties=function(yr){for(var Ur in tn)tn.hasOwnProperty(Ur)&&yr[Ur]&&(tn[Ur]=yr[Ur]);return this},He.__private__.setDocumentProperty=function(yr,Ur){if(Object.keys(tn).indexOf(yr)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return tn[yr]=Ur};var Qr,wn,gn,In,yn,Mn={},on={},Yr=[],sn={},On={},Bn={},Hn={},Zr=null,xn=0,An=[],Wn=new j(He),ss=Ee.hotfixes||[],Yn={},en={},Gr=[],nn=function yr(Ur,un,bn,Tn,Gn,es){if(!(this instanceof yr))return new yr(Ur,un,bn,Tn,Gn,es);isNaN(Ur)&&(Ur=1),isNaN(un)&&(un=0),isNaN(bn)&&(bn=0),isNaN(Tn)&&(Tn=1),isNaN(Gn)&&(Gn=0),isNaN(es)&&(es=0),this._matrix=[Ur,un,bn,Tn,Gn,es]};Object.defineProperty(nn.prototype,"sx",{get:function(){return this._matrix[0]},set:function(yr){this._matrix[0]=yr}}),Object.defineProperty(nn.prototype,"shy",{get:function(){return this._matrix[1]},set:function(yr){this._matrix[1]=yr}}),Object.defineProperty(nn.prototype,"shx",{get:function(){return this._matrix[2]},set:function(yr){this._matrix[2]=yr}}),Object.defineProperty(nn.prototype,"sy",{get:function(){return this._matrix[3]},set:function(yr){this._matrix[3]=yr}}),Object.defineProperty(nn.prototype,"tx",{get:function(){return this._matrix[4]},set:function(yr){this._matrix[4]=yr}}),Object.defineProperty(nn.prototype,"ty",{get:function(){return this._matrix[5]},set:function(yr){this._matrix[5]=yr}}),Object.defineProperty(nn.prototype,"a",{get:function(){return this._matrix[0]},set:function(yr){this._matrix[0]=yr}}),Object.defineProperty(nn.prototype,"b",{get:function(){return this._matrix[1]},set:function(yr){this._matrix[1]=yr}}),Object.defineProperty(nn.prototype,"c",{get:function(){return this._matrix[2]},set:function(yr){this._matrix[2]=yr}}),Object.defineProperty(nn.prototype,"d",{get:function(){return this._matrix[3]},set:function(yr){this._matrix[3]=yr}}),Object.defineProperty(nn.prototype,"e",{get:function(){return this._matrix[4]},set:function(yr){this._matrix[4]=yr}}),Object.defineProperty(nn.prototype,"f",{get:function(){return this._matrix[5]},set:function(yr){this._matrix[5]=yr}}),Object.defineProperty(nn.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(nn.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(nn.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(nn.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),nn.prototype.join=function(yr){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(ar).join(yr)},nn.prototype.multiply=function(yr){var Ur=yr.sx*this.sx+yr.shy*this.shx,un=yr.sx*this.shy+yr.shy*this.sy,bn=yr.shx*this.sx+yr.sy*this.shx,Tn=yr.shx*this.shy+yr.sy*this.sy,Gn=yr.tx*this.sx+yr.ty*this.shx+this.tx,es=yr.tx*this.shy+yr.ty*this.sy+this.ty;return new nn(Ur,un,bn,Tn,Gn,es)},nn.prototype.decompose=function(){var yr=this.sx,Ur=this.shy,un=this.shx,bn=this.sy,Tn=this.tx,Gn=this.ty,es=Math.sqrt(yr*yr+Ur*Ur),vs=(yr/=es)*un+(Ur/=es)*bn;un-=yr*vs,bn-=Ur*vs;var bs=Math.sqrt(un*un+bn*bn);return vs/=bs,yr*(bn/=bs)<Ur*(un/=bs)&&(yr=-yr,Ur=-Ur,vs=-vs,es=-es),{scale:new nn(es,0,0,bs,0,0),translate:new nn(1,0,0,1,Tn,Gn),rotate:new nn(yr,Ur,-Ur,yr,0,0),skew:new nn(1,0,vs,1,0,0)}},nn.prototype.toString=function(yr){return this.join(" ")},nn.prototype.inversed=function(){var yr=this.sx,Ur=this.shy,un=this.shx,bn=this.sy,Tn=this.tx,Gn=this.ty,es=1/(yr*bn-Ur*un),vs=bn*es,bs=-Ur*es,ks=-un*es,Is=yr*es;return new nn(vs,bs,ks,Is,-vs*Tn-ks*Gn,-bs*Tn-Is*Gn)},nn.prototype.applyToPoint=function(yr){var Ur=yr.x*this.sx+yr.y*this.shx+this.tx,un=yr.x*this.shy+yr.y*this.sy+this.ty;return new ui(Ur,un)},nn.prototype.applyToRectangle=function(yr){var Ur=this.applyToPoint(yr),un=this.applyToPoint(new ui(yr.x+yr.w,yr.y+yr.h));return new $o(Ur.x,Ur.y,un.x-Ur.x,un.y-Ur.y)},nn.prototype.clone=function(){var yr=this.sx,Ur=this.shy,un=this.shx,bn=this.sy,Tn=this.tx,Gn=this.ty;return new nn(yr,Ur,un,bn,Tn,Gn)},He.Matrix=nn;var En=He.matrixMult=function(yr,Ur){return Ur.multiply(yr)},Cn=new nn(1,0,0,1,0,0);He.unitMatrix=He.identityMatrix=Cn;var jn=function(yr,Ur){if(!On[yr]){var un=(Ur instanceof M?"Sh":"P")+(Object.keys(sn).length+1).toString(10);Ur.id=un,On[yr]=un,sn[un]=Ur,Wn.publish("addPattern",Ur)}};He.ShadingPattern=M,He.TilingPattern=q,He.addShadingPattern=function(yr,Ur){return or("addShadingPattern()"),jn(yr,Ur),this},He.beginTilingPattern=function(yr){or("beginTilingPattern()"),_i(yr.boundingBox[0],yr.boundingBox[1],yr.boundingBox[2]-yr.boundingBox[0],yr.boundingBox[3]-yr.boundingBox[1],yr.matrix)},He.endTilingPattern=function(yr,Ur){or("endTilingPattern()"),Ur.stream=Br[dr].join(` 4079`),jn(yr,Ur),Wn.publish("endTilingPattern",Ur),Gr.pop().restore(
vendor: 20,650 bytes, lines 4079-4084
4079)};var $n,Vn=He.__private__.newObject=function(){var yr=Qn();return Un(yr,!0),yr},Qn=He.__private__.newObjectDeferred=function(){return _r++,Ir[_r]=function(){return Tr},_r},Un=function(yr,Ur){return Ur=typeof Ur=="boolean"&&Ur,Ir[yr]=Tr,Ur&&Sr(yr+" 0 obj"),yr},fs=He.__private__.newAdditionalObject=function(){var yr={objId:Qn(),content:""};return Nr.push(yr),yr},Jn=Qn(),ts=Qn(),cs=He.__private__.decodeColorString=function(yr){var Ur=yr.split(" ");if(Ur.length!==2||Ur[1]!=="g"&&Ur[1]!=="G")Ur.length!==5||Ur[4]!=="k"&&Ur[4]!=="K"||(Ur=[(1-Ur[0])*(1-Ur[3]),(1-Ur[1])*(1-Ur[3]),(1-Ur[2])*(1-Ur[3]),"r"]);else{var un=parseFloat(Ur[0]);Ur=[un,un,un,"r"]}for(var bn="#",Tn=0;Tn<3;Tn++)bn+=("0"+Math.floor(255*parseFloat(Ur[Tn])).toString(16)).slice(-2);return bn},Sn=He.__private__.encodeColorString=function(yr){var Ur;typeof yr=="string"&&(yr={ch1:yr});var un=yr.ch1,bn=yr.ch2,Tn=yr.ch3,Gn=yr.ch4,es=yr.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof un=="string"&&un.charAt(0)!=="#"){var vs=new h(un);if(vs.ok)un=vs.toHex();else if(!/^\d*\.?\d*$/.test(un))throw new Error('Invalid color "'+un+'" passed to jsPDF.encodeColorString.')}if(typeof un=="string"&&/^#[0-9A-Fa-f]{3}$/.test(un)&&(un="#"+un[1]+un[1]+un[2]+un[2]+un[3]+un[3]),typeof un=="string"&&/^#[0-9A-Fa-f]{6}$/.test(un)){var bs=parseInt(un.substr(1),16);un=bs>>16&255,bn=bs>>8&255,Tn=255&bs}if(bn===void 0||Gn===void 0&&un===bn&&bn===Tn)Ur=typeof un=="string"?un+" "+es[0]:yr.precision===2?tr(un/255)+" "+es[0]:nr(un/255)+" "+es[0];else if(Gn===void 0||_typeof(Gn)==="object"){if(Gn&&!isNaN(Gn.a)&&Gn.a===0)return["1.","1.","1.",es[1]].join(" ");Ur=typeof un=="string"?[un,bn,Tn,es[1]].join(" "):yr.precision===2?[tr(un/255),tr(bn/255),tr(Tn/255),es[1]].join(" "):[nr(un/255),nr(bn/255),nr(Tn/255),es[1]].join(" ")}else Ur=typeof un=="string"?[un,bn,Tn,Gn,es[2]].join(" "):yr.precision===2?[tr(un),tr(bn),tr(Tn),tr(Gn),es[2]].join(" "):[nr(un),nr(bn),nr(Tn),nr(Gn),es[2]].join(" ");return Ur},mn=He.__private__.getFilters=function(){return De},zn=He.__private__.putStream=function(yr){var Ur=(yr=yr||{}).data||"",un=yr.filters||mn(),bn=yr.alreadyAppliedFilters||[],Tn=yr.addLength1||!1,Gn=Ur.length,es=yr.objectId,vs=function(ro){return ro};if(ze!==null&&es===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");ze!==null&&(vs=xo.encryptor(es,0));var bs={};un===!0&&(un=["FlateEncode"]);var ks=yr.additionalKeyValues||[],Is=(bs=E.API.processDataByFilters!==void 0?E.API.processDataByFilters(Ur,un):{data:Ur,reverseChain:[]}).reverseChain+(Array.isArray(bn)?bn.join(" "):bn.toString());if(bs.data.length!==0&&(ks.push({key:"Length",value:bs.data.length}),Tn===!0&&ks.push({key:"Length1",value:Gn})),Is.length!=0)if(Is.split("/").length-1==1)ks.push({key:"Filter",value:Is});else{ks.push({key:"Filter",value:"["+Is+"]"});for(var Bs=0;Bs<ks.length;Bs+=1)if(ks[Bs].key==="DecodeParms"){for(var fo=[],Ks=0;Ks<bs.reverseChain.split("/").length-1;Ks+=1)fo.push("null");fo.push(ks[Bs].value),ks[Bs].value="["+fo.join(" ")+"]"}}Sr("<<");for(var Ys=0;Ys<ks.length;Ys++)Sr("/"+ks[Ys].key+" "+ks[Ys].value);Sr(">>"),bs.data.length!==0&&(Sr("stream"),Sr(vs(bs.data)),Sr("endstream"))},os=He.__private__.putPage=function(yr){var Ur=yr.number,un=yr.data,bn=yr.objId,Tn=yr.contentsObjId;Un(bn,!0),Sr("<</Type /Page"),Sr("/Parent "+yr.rootDictionaryObjId+" 0 R"),Sr("/Resources "+yr.resourceDictionaryObjId+" 0 R"),Sr("/MediaBox ["+parseFloat(ar(yr.mediaBox.bottomLeftX))+" "+parseFloat(ar(yr.mediaBox.bottomLeftY))+" "+ar(yr.mediaBox.topRightX)+" "+ar(yr.mediaBox.topRightY)+"]"),yr.cropBox!==null&&Sr("/CropBox ["+ar(yr.cropBox.bottomLeftX)+" "+ar(yr.cropBox.bottomLeftY)+" "+ar(yr.cropBox.topRightX)+" "+ar(yr.cropBox.topRightY)+"]"),yr.bleedBox!==null&&Sr("/BleedBox ["+ar(yr.bleedBox.bottomLeftX)+" "+ar(yr.bleedBox.bottomLeftY)+" "+ar(yr.bleedBox.topRightX)+" "+ar(yr.bleedBox.topRightY)+"]"),yr.trimBox!==null&&Sr("/TrimBox ["+ar(yr.trimBox.bottomLeftX)+" "+ar(yr.trimBox.bottomLeftY)+" "+ar(yr.trimBox.topRightX)+" "+ar(yr.trimBox.topRightY)+"]"),yr.artBox!==null&&Sr("/ArtBox ["+ar(yr.artBox.bottomLeftX)+" "+ar(yr.artBox.bottomLeftY)+" "+ar(yr.artBox.topRightX)+" "+ar(yr.artBox.topRightY)+"]"),typeof yr.userUnit=="number"&&yr.userUnit!==1&&Sr("/UserUnit "+yr.userUnit),Wn.publish("putPage",{objId:bn,pageContext:An[Ur],pageNumber:Ur,page:un}),Sr("/Contents "+Tn+" 0 R"),Sr(">>"),Sr("endobj");var Gn=un.join(` 4080`);return Ze===Qe&&(Gn+=` 4081Q`),Un(Tn,!0),zn({data:Gn,filters:mn(),objectId:Tn}),Sr("endobj"),bn},ls=He.__private__.putPages=function(){var yr,Ur,un=[];for(yr=1;yr<=xn;yr++)An[yr].objId=Qn(),An[yr].contentsObjId=Qn();for(yr=1;yr<=xn;yr++)un.push(os({number:yr,data:Br[yr],objId:An[yr].objId,contentsObjId:An[yr].contentsObjId,mediaBox:An[yr].mediaBox,cropBox:An[yr].cropBox,bleedBox:An[yr].bleedBox,trimBox:An[yr].trimBox,artBox:An[yr].artBox,userUnit:An[yr].userUnit,rootDictionaryObjId:Jn,resourceDictionaryObjId:ts}));Un(Jn,!0),Sr("<</Type /Pages");var bn="/Kids [";for(Ur=0;Ur<xn;Ur++)bn+=un[Ur]+" 0 R ";Sr(bn+"]"),Sr("/Count "+xn),Sr(">>"),Sr("endobj"),Wn.publish("postPutPages")},hs=function(yr){Wn.publish("putFont",{font:yr,out:Sr,newObject:Vn,putStream:zn}),yr.isAlreadyPutted!==!0&&(yr.objectNumber=Vn(),Sr("<<"),Sr("/Type /Font"),Sr("/BaseFont /"+C(yr.postScriptName)),Sr("/Subtype /Type1"),typeof yr.encoding=="string"&&Sr("/Encoding /"+yr.encoding),Sr("/FirstChar 32"),Sr("/LastChar 255"),Sr(">>"),Sr("endobj"))},Cs=function(yr){yr.objectNumber=Vn();var Ur=[];Ur.push({key:"Type",value:"/XObject"}),Ur.push({key:"Subtype",value:"/Form"}),Ur.push({key:"BBox",value:"["+[ar(yr.x),ar(yr.y),ar(yr.x+yr.width),ar(yr.y+yr.height)].join(" ")+"]"}),Ur.push({key:"Matrix",value:"["+yr.matrix.toString()+"]"});var un=yr.pages[1].join(` 4082`);zn({data:un,additionalKeyValues:Ur,objectId:yr.objectNumber}),Sr("endobj")},Ds=function(yr,Ur){Ur||(Ur=21);var un=Vn(),bn=function(es,vs){var bs,ks=[],Is=1/(vs-1);for(bs=0;bs<1;bs+=Is)ks.push(bs);if(ks.push(1),es[0].offset!=0){var Bs={offset:0,color:es[0].color};es.unshift(Bs)}if(es[es.length-1].offset!=1){var fo={offset:1,color:es[es.length-1].color};es.push(fo)}for(var Ks="",Ys=0,ro=0;ro<ks.length;ro++){for(bs=ks[ro];bs>es[Ys+1].offset;)Ys++;var oo=es[Ys].offset,io=(bs-oo)/(es[Ys+1].offset-oo),jo=es[Ys].color,Pi=es[Ys+1].color;Ks+=gr(Math.round((1-io)*jo[0]+io*Pi[0]).toString(16))+gr(Math.round((1-io)*jo[1]+io*Pi[1]).toString(16))+gr(Math.round((1-io)*jo[2]+io*Pi[2]).toString(16))}return Ks.trim()}(yr.colors,Ur),Tn=[];Tn.push({key:"FunctionType",value:"0"}),Tn.push({key:"Domain",value:"[0.0 1.0]"}),Tn.push({key:"Size",value:"["+Ur+"]"}),Tn.push({key:"BitsPerSample",value:"8"}),Tn.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Tn.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),zn({data:bn,additionalKeyValues:Tn,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:un}),Sr("endobj"),yr.objectNumber=Vn(),Sr("<< /ShadingType "+yr.type),Sr("/ColorSpace /DeviceRGB");var Gn="/Coords ["+ar(parseFloat(yr.coords[0]))+" "+ar(parseFloat(yr.coords[1]))+" ";yr.type===2?Gn+=ar(parseFloat(yr.coords[2]))+" "+ar(parseFloat(yr.coords[3])):Gn+=ar(parseFloat(yr.coords[2]))+" "+ar(parseFloat(yr.coords[3]))+" "+ar(parseFloat(yr.coords[4]))+" "+ar(parseFloat(yr.coords[5])),Sr(Gn+="]"),yr.matrix&&Sr("/Matrix ["+yr.matrix.toString()+"]"),Sr("/Function "+un+" 0 R"),Sr("/Extend [true true]"),Sr(">>"),Sr("endobj")},ho=function(yr,Ur){var un=Qn(),bn=Vn();Ur.push({resourcesOid:un,objectOid:bn}),yr.objectNumber=bn;var Tn=[];Tn.push({key:"Type",value:"/Pattern"}),Tn.push({key:"PatternType",value:"1"}),Tn.push({key:"PaintType",value:"1"}),Tn.push({key:"TilingType",value:"1"}),Tn.push({key:"BBox",value:"["+yr.boundingBox.map(ar).join(" ")+"]"}),Tn.push({key:"XStep",value:ar(yr.xStep)}),Tn.push({key:"YStep",value:ar(yr.yStep)}),Tn.push({key:"Resources",value:un+" 0 R"}),yr.matrix&&Tn.push({key:"Matrix",value:"["+yr.matrix.toString()+"]"}),zn({data:yr.stream,additionalKeyValues:Tn,objectId:yr.objectNumber}),Sr("endobj")},Mo=function(yr){for(var Ur in yr.objectNumber=Vn(),Sr("<<"),yr)switch(Ur){case"opacity":Sr("/ca "+tr(yr[Ur]));break;case"stroke-opacity":Sr("/CA "+tr(yr[Ur]))}Sr(">>"),Sr("endobj")},Po=function(yr){Un(yr.resourcesOid,!0),Sr("<<"),Sr("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var Ur in Sr("/Font <<"),Mn)Mn.hasOwnProperty(Ur)&&(We===!1||We===!0&&Xe.hasOwnProperty(Ur))&&Sr("/"+Ur+" "+Mn[Ur].objectNumber+" 0 R");Sr(">>")}(),function(){if(Object.keys(sn).length>0){for(var Ur in Sr("/Shading <<"),sn)sn.hasOwnProperty(Ur)&&sn[Ur]instanceof M&&sn[Ur].objectNumber>=0&&Sr("/"+Ur+" "+sn[Ur].objectNumber+" 0 R");Wn.publish("putShadingPatternDict"),Sr(">>")}}(),function(Ur){if(Object.keys(sn).length>0){for(var un in Sr("/Pattern <<"),sn)sn.hasOwnProperty(un)&&sn[un]instanceof He.TilingPattern&&sn[un].objectNumber>=0&&sn[un].objectNumber<Ur&&Sr("/"+un+" "+sn[un].objectNumber+" 0 R");Wn.publish("putTilingPatternDict"),Sr(">>")}}(yr.objectOid),function(){if(Object.keys(Bn).length>0){var Ur;for(Ur in Sr("/ExtGState <<"),Bn)Bn.hasOwnProperty(Ur)&&Bn[Ur].objectNumber>=0&&Sr("/"+Ur+" "+Bn[Ur].objectNumber+" 0 R");Wn.publish("putGStateDict"),Sr(">>")}}(),function(){for(var Ur in Sr("/XObject <<"),Yn)Yn.hasOwnProperty(Ur)&&Yn[Ur].objectNumber>=0&&Sr("/"+Ur+" "+Yn[Ur].objectNumber+" 0 R");Wn.publish("putXobjectDict"),Sr(">>")}(),Sr(">>"),Sr("endobj")},wo=function(yr){on[yr.fontName]=on[yr.fontName]||{},on[yr.fontName][yr.fontStyle]=yr.id},ri=function(yr,Ur,un,bn,Tn){var Gn={id:"F"+(Object.keys(Mn).length+1).toString(10),postScriptName:yr,fontName:Ur,fontStyle:un,encoding:bn,isStandardFont:Tn||!1,metadata:{}};return Wn.publish("addFont",{font:Gn,instance:this}),Mn[Gn.id]=Gn,wo(Gn),Gn.id},go=He.__private__.pdfEscape=He.pdfEscape=function(yr,Ur){return function(un,bn){var Tn,Gn,es,vs,bs,ks,Is,Bs,fo;if(es=(bn=bn||{}).sourceEncoding||"Unicode",bs=bn.outputEncoding,(bn.autoencode||bs)&&Mn[Qr].metadata&&Mn[Qr].metadata[es]&&Mn[Qr].metadata[es].encoding&&(vs=Mn[Qr].metadata[es].encoding,!bs&&Mn[Qr].encoding&&(bs=Mn[Qr].encoding),!bs&&vs.codePages&&(bs=vs.codePages[0]),typeof bs=="string"&&(bs=vs[bs]),bs)){for(Is=!1,ks=[],Tn=0,Gn=un.length;Tn<Gn;Tn++)(Bs=bs[un.charCodeAt(Tn)])?ks.push(String.fromCharCode(Bs)):ks.push(un[Tn]),ks[Tn].charCodeAt(0)>>8&&(Is=!0);un=ks.join("")}for(Tn=un.length;Is===void 0&&Tn!==0;)un.charCodeAt(Tn-1)>>8&&(Is=!0),Tn--;if(!Is)return un;for(ks=bn.noBOM?[]:[254,255],Tn=0,Gn=un.length;Tn<Gn;Tn++){if((fo=(Bs=un.charCodeAt(Tn))>>8)>>8)throw new Error("Character at position "+Tn+" of string '"+un+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");ks.push(fo),ks.push(Bs-(fo<<8))}return String.fromCharCode.apply(void 0,ks)}(yr,Ur).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Vo=He.__private__.beginPage=function(yr){Br[++xn]=[],An[xn]={objId:0,contentsObjId:0,userUnit:Number($e),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(yr[0]),topRightY:Number(yr[1])}},ds(xn),mr(Br[dr])},Nn=function(yr,Ur){var un,bn,Tn;switch(Te=Ur||Te,typeof yr=="string"&&(un=Ve(yr.toLowerCase()),Array.isArray(un)&&(bn=un[0],Tn=un[1])),Array.isArray(yr)&&(bn=yr[0]*wn,Tn=yr[1]*wn),isNaN(bn)&&(bn=Oe[0],Tn=Oe[1]),(bn>14400||Tn>14400)&&(o.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),bn=Math.min(14400,bn),Tn=Math.min(14400,Tn)),Oe=[bn,Tn],Te.substr(0,1)){case"l":Tn>bn&&(Oe=[Tn,bn]);break;case"p":bn>Tn&&(Oe=[Tn,bn])}Vo(Oe),gs(Rs),Sr(ci),No!==0&&Sr(No+" J"),to!==0&&Sr(to+" j"),Wn.publish("addPage",{pageNumber:xn})},Kn=function(yr){yr>0&&yr<=xn&&(Br.splice(yr,1),An.splice(yr,1),xn--,dr>xn&&(dr=xn),this.setPage(dr))},ds=function(yr){yr>0&&yr<=xn&&(dr=yr)},xs=He.__private__.getNumberOfPages=He.getNumberOfPages=function(){return Br.length-1},js=function(yr,Ur,un){var bn,Tn=void 0;return un=un||{},yr=yr!==void 0?yr:Mn[Qr].fontName,Ur=Ur!==void 0?Ur:Mn[Qr].fontStyle,bn=yr.toLowerCase(),on[bn]!==void 0&&on[bn][Ur]!==void 0?Tn=on[bn][Ur]:on[yr]!==void 0&&on[yr][Ur]!==void 0?Tn=on[yr][Ur]:un.disableWarning===!1&&o.warn("Unable to look up font label for font '"+yr+"', '"+Ur+"'. Refer to getFontList() for available fonts."),Tn||un.noFallback||(Tn=on.times[Ur])==null&&(Tn=on.times.normal),Tn},Ws=He.__private__.putInfo=function(){var yr=Vn(),Ur=function(bn){return bn};for(var un in ze!==null&&(Ur=xo.encryptor(yr,0)),Sr("<<"),Sr("/Producer ("+go(Ur("jsPDF "+E.version))+")"),tn)tn.hasOwnProperty(un)&&tn[un]&&Sr("/"+un.substr(0,1).toUpperCase()+un.substr(1)+" ("+go(Ur(tn[un]))+")");Sr("/CreationDate ("+go(Ur(xr))+")"),Sr(">>"),Sr("endobj")},Gs=He.__private__.putCatalog=function(yr){var Ur=(yr=yr||{}).rootDictionaryObjId||Jn;switch(Vn(),Sr("<<"),Sr("/Type /Catalog"),Sr("/Pages "+Ur+" 0 R"),Mr||(Mr="fullwidth"),Mr){case"fullwidth":Sr("/OpenAction [3 0 R /FitH null]");break;case"fullheight":Sr("/OpenAction [3 0 R /FitV null]");break;case"fullpage":Sr("/OpenAction [3 0 R /Fit]");break;case"original":Sr("/OpenAction [3 0 R /XYZ null null 1]");break;default:var un=""+Mr;un.substr(un.length-1)==="%"&&(Mr=parseInt(Mr)/100),typeof Mr=="number"&&Sr("/OpenAction [3 0 R /XYZ null null "+tr(Mr)+"]")}switch(Wr||(Wr="continuous"),Wr){case"continuous":Sr("/PageLayout /OneColumn");break;case"single":Sr("/PageLayout /SinglePage");break;case"two":case"twoleft":Sr("/PageLayout /TwoColumnLeft");break;case"tworight":Sr("/PageLayout /TwoColumnRight")}Kr&&Sr("/PageMode /"+Kr),Wn.publish("putCatalog"),Sr(">>"),Sr("endobj")},qs=He.__private__.putTrailer=function(){Sr("trailer"),Sr("<<"),Sr("/Size "+(_r+1)),Sr("/Root "+_r+" 0 R"),Sr("/Info "+(_r-1)+" 0 R"),ze!==null&&Sr("/Encrypt "+xo.oid+" 0 R"),Sr("/ID [ <"+Rr+"> <"+Rr+"> ]"),Sr(">>")},Ns=He.__private__.putHeader=function(){Sr("%PDF-"+qe),Sr("%ºÃˆ ")},ps=He.__private__.putXRef=function(){var yr="0000000000";Sr("xref"),Sr("0 "+(_r+1)),Sr("0000000000 65535 f ");for(var Ur=1;Ur<=_r;Ur++)typeof Ir[Ur]=="function"?Sr((yr+Ir[Ur]()).slice(-10)+" 00000 n "):Ir[Ur]!==void 0?Sr((yr+Ir[Ur]).slice(-10)+" 00000 n "):Sr("0000000000 00000 n ")},us=He.__private__.buildDocument=function(){var yr;_r=0,Tr=0,Ar=[],Ir=[],Nr=[],Jn=Qn(),ts=Qn(),mr(Ar),Wn.publish("buildDocument"),Ns(),ls(),function(){Wn.publish("putAdditionalObjects");for(var un=0;un<Nr.length;un++){var bn=Nr[un];Un(bn.objId,!0),Sr(bn.content),Sr("endobj")}Wn.publish("postPutAdditionalObjects")}(),yr=[],function(){for(var un in Mn)Mn.hasOwnProperty(un)&&(We===!1||We===!0&&Xe.hasOwnProperty(un))&&hs(Mn[un])}(),function(){var un;for(un in Bn)Bn.hasOwnProperty(un)&&Mo(Bn[un])}(),function(){for(var un in Yn)Yn.hasOwnProperty(un)&&Cs(Yn[un])}(),function(un){var bn;for(bn in sn)sn.hasOwnProperty(bn)&&(sn[bn]instanceof M?Ds(sn[bn]):sn[bn]instanceof q&&ho(sn[bn],un))}(yr),Wn.publish("putResources"),yr.forEach(Po),Po({resourcesOid:ts,objectOid:Number.MAX_SAFE_INTEGER}),Wn.publish("postPutResources"),ze!==null&&(xo.oid=Vn(),Sr("<<"),Sr("/Filter /Standard"),Sr("/V "+xo.v),Sr("/R "+xo.r),Sr("/U <"+xo.toHexString(xo.U)+">"),Sr("/O <"+xo.toHexString(xo.O)+">"),Sr("/P "+xo.P),Sr(">>"),Sr("endobj")),Ws(),Gs();var Ur=Tr;return ps(),qs(),Sr("startxref"),Sr(""+Ur),Sr("%%EOF"),mr(Br[dr]),Ar.join(` 4083`)},Ts=He.__private__.getBlob=function(yr){return new Blob([jr(yr)],{type:"application/pdf"})},As=function(yr){for(;yr.firstChild;)yr.removeChild(yr.firstChild)},Fs=function(yr){var Ur,un=yr.document,bn=un.documentElement,Tn=un.head,Gn=un.body;return Tn||(Tn=un.createElement("head"),bn.appendChild(Tn)),Gn||(Gn=un.createElement("body"),bn.appendChild(Gn)),As(Tn),As(Gn),(Ur=un.createElement("style")).appendChild(un.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),Tn.appendChild(Ur),{document:un,body:Gn}},Co=He.output=He.__private__.output=($n=function(yr,Ur){switch(typeof(Ur=Ur||{})=="string"?Ur={filename:Ur}:Ur.filename=Ur.filename||"generated.pdf",yr){case void 0:return us();case"save":He.save(Ur.filename);break;case"arraybuffer":return jr(us());case"blob":return Ts(us());case"bloburi":case"bloburl":if(i.URL!==void 0&&typeof i.URL.createObjectURL=="function")return i.URL&&i.URL.createObjectURL(Ts(us()))||void 0;o.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var un="",bn=us();try{un=d(bn)}catch{un=d(unescape(encodeURIComponent(bn)))}return"data:application/pdf;filename="+encodeURIComponent(Ur.filename)+";base64,"+un;case"pdfobjectnewwindow":if(Object.prototype.toString.call(i)==="[object Window]"){var Tn="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Gn=!Ur.pdfObjectUrl;Gn||(Tn=Ur.pdfObjectUrl);var es=i.open();if(es!==null){var vs=Fs(es),bs=vs.document.createElement("script"),ks=this;bs.src=Tn,Gn&&(bs.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",bs.crossOrigin="anonymous"),bs.onload=function(){es.PDFObject.embed(ks.output("dataurlstring"),Ur)},vs.body.appendChild(bs)}return es}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(i)==="[object Window]"){var Is=Ur.pdfJsUrl||"examples/PDF.js/web/viewer.html",Bs=i.open();if(Bs!==null){var fo=Fs(Bs),Ks=fo.document.createElement("iframe"),Ys=Is.indexOf("?")===-1?"?":"&";ks=this,Ks.id="pdfViewer",Ks.width="500px",Ks.height="400px",Ks.src=Is+Ys+"file=&downloadName="+encodeURIComponent(Ur.filename),Ks.onload=function(){Bs.document.title=Ur.filename,Ks.contentWindow.PDFViewerApplication.open(ks.output("bloburl"))},fo.body.appendChild(Ks)}return Bs}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(i)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var ro=i.open();if(ro!==null){var oo=Fs(ro),io=oo.document.createElement("iframe");io.src=this.output("datauristring",Ur),oo.body.appendChild(io),ro.document.title=Ur.filename}if(ro||typeof safari>"u")return ro;break;case"datauri":case"dataurl":return i.document.location.href=this.output("datauristring",Ur);default:return null}},$n.foo=function(){try{return $n.apply(this,arguments)}catch(un){var yr=un.stack||"";~yr.indexOf(" at ")&&(yr=yr.split(" at ")[1]);var Ur="Error in function "+yr.split(` 4084`)[0].split("<")[0]+": "+un.message;if(!i.console)throw new Error(Ur);i.console.error(Ur,un),i.alert&&alert(Ur)}},$n.foo.bar=$n,$n.foo),Eo=function(yr){return Array.isArray(ss)===!0&&ss.indexOf(yr)>-1};switch(je){case"pt":wn=1;break;case"mm":wn=72/25.4;break;case"cm":wn=72/2.54;break;case"in":wn=72;break;case"px":wn=Eo("px_scaling")==1?.75:96/72;break;case"pc":case"em":wn=12;break;case"ex":wn=6;break;default:if(typeof je!="number")throw new Error("Invalid unit: "+je);wn=je}var xo=null;kr(),wr();var ua=He.__private__.getPageInfo=He.getPageInfo=function(yr){if(isNaN(yr)||yr%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:An[yr].objId,pageNumber:yr,pageContext:An[yr]}},Ma=He.__private__.getPageInfoByObjId=function(yr){if(isNaN(yr)||yr%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var Ur in An)if(An[Ur].objId===yr)break;return ua(Ur)},Da=He.__private__.getCurrentPageInfo=He.getCurrentPageInfo=function(){return{objId:An[dr].objId,pageNumber:dr,pageContext:An[dr]}};He.addPage=function(){return Nn.apply(this,arguments),this},He.setPage=function(){return ds.apply(this,arguments),mr.call(this,Br[dr]),this},He.insertPage=function(yr){return this.addPage(),this.movePage(dr,yr),this},He.movePage=function(yr,Ur){var un,bn;if(yr>Ur){un=Br[yr],bn=An[yr];for(var Tn=yr;Tn>Ur;Tn--)Br[Tn]=Br[Tn-1],An[Tn]=An[Tn-1];Br[Ur]=un,An[Ur]=bn,this.setPage(Ur)}else if(yr<Ur){un=Br[yr],bn=An[yr];for(var Gn=yr;Gn<Ur;Gn++)Br[Gn]=Br[Gn+1],An[Gn]=An[Gn+1];Br[Ur]=un,An[Ur]=bn,this.setPage(Ur)}return this},He.deletePage=function(){return Kn.apply(this,arguments),this},He.__private__.text=He.text=function(yr,Ur,un,bn,Tn){var Gn,es,vs,bs,ks,Is,Bs,fo,Ks,Ys=(bn=bn||{}).scope||this;if(typeof yr=="number"&&typeof Ur=="number"&&(typeof un=="string"||Array.isArray(un))){var ro=un;un=Ur,Ur=yr,yr=ro}if(arguments[3]instanceof nn==0?(vs=arguments[4],bs=arguments[5],_typeof(Bs=arguments[3])==="object"&&Bs!==null||(typeof vs=="string"&&(bs=vs,vs=null),typeof Bs=="string"&&(bs=Bs,Bs=null),typeof Bs=="number"&&(vs=Bs,Bs=null),bn={flags:Bs,angle:vs,align:bs})):(or("The transform parameter of text() with a Matrix value"),Ks=Tn),isNaN(Ur)||isNaN(un)||yr==null)throw new Error("Invalid arguments passed to
4084jsPDF.text");if(yr.length===0)return Ys;var oo,io="",jo=typeof bn.lineHeightFactor=="number"?bn.lineHeightFactor:xi,Pi=Ys.internal.scaleFactor;function Na(Qs){return Qs=Qs.split(" ").join(Array(bn.TabLen||9).join(" ")),go(Qs,Bs)}function Zi(Qs){for(var Js,co=Qs.concat(),yo=[],ki=co.length;ki--;)typeof(Js=co.shift())=="string"?yo.push(Js):Array.isArray(Qs)&&(Js.length===1||Js[1]===void 0&&Js[2]===void 0)?yo.push(Js[0]):yo.push([Js[0],Js[1],Js[2]]);return yo}function Qi(Qs,Js){var co;if(typeof Qs=="string")co=Js(Qs)[0];else if(Array.isArray(Qs)){for(var yo,ki,Ha=Qs.concat(),Pa=[],pl=Ha.length;pl--;)typeof(yo=Ha.shift())=="string"?Pa.push(Js(yo)[0]):Array.isArray(yo)&&typeof yo[0]=="string"&&(ki=Js(yo[0],yo[1],yo[2]),Pa.push([ki[0],ki[1],ki[2]]));co=Pa}return co}var Fi=!1,Ji=!0;if(typeof yr=="string")Fi=!0;else if(Array.isArray(yr)){var ba=yr.concat();es=[];for(var va,Io=ba.length;Io--;)(typeof(va=ba.shift())!="string"||Array.isArray(va)&&typeof va[0]!="string")&&(Ji=!1);Fi=Ji}if(Fi===!1)throw new Error('Type of text must be string or Array. "'+yr+'" is not recognized.');typeof yr=="string"&&(yr=yr.match(/[\r?\n]/)?yr.split(/\r\n|\r|\n/g):[yr]);var ea=Cr/Ys.internal.scaleFactor,ta=ea*(jo-1);switch(bn.baseline){case"bottom":un-=ta;break;case"top":un+=ea-ta;break;case"hanging":un+=ea-2*ta;break;case"middle":un+=ea/2-ta}if((Is=bn.maxWidth||0)>0&&(typeof yr=="string"?yr=Ys.splitTextToSize(yr,Is):Object.prototype.toString.call(yr)==="[object Array]"&&(yr=yr.reduce(function(Qs,Js){return Qs.concat(Ys.splitTextToSize(Js,Is))},[]))),Gn={text:yr,x:Ur,y:un,options:bn,mutex:{pdfEscape:go,activeFontKey:Qr,fonts:Mn,activeFontSize:Cr}},Wn.publish("preProcessText",Gn),yr=Gn.text,vs=(bn=Gn.options).angle,Ks instanceof nn==0&&vs&&typeof vs=="number"){vs*=Math.PI/180,bn.rotationDirection===0&&(vs=-vs),Ze===Qe&&(vs=-vs);var $a=Math.cos(vs),bi=Math.sin(vs);Ks=new nn($a,bi,-bi,$a,0,0)}else vs&&vs instanceof nn&&(Ks=vs);Ze!==Qe||Ks||(Ks=Cn),(ks=bn.charSpace||Ci)!==void 0&&(io+=ar(hr(ks))+` Tc 4085`,this.setCharSpace(this.getCharSpace()||0)),(fo=bn.horizontalScale)!==void 0&&(io+=ar(100*fo)+` Tz 4086`),bn.lang;var Fo=-1,ul=bn.renderingMode!==void 0?bn.renderingMode:bn.stroke,Sa=Ys.internal.getCurrentPageInfo().pageContext;switch(ul){case 0:case!1:case"fill":Fo=0;break;case 1:case!0:case"stroke":Fo=1;break;case 2:case"fillThenStroke":Fo=2;break;case 3:case"invisible":Fo=3;break;case 4:case"fillAndAddForClipping":Fo=4;break;case 5:case"strokeAndAddPathForClipping":Fo=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Fo=6;break;case 7:case"addToPathForClipping":Fo=7}var dl=Sa.usedRenderingMode!==void 0?Sa.usedRenderingMode:-1;Fo!==-1?io+=Fo+` Tr 4087`:dl!==-1&&(io+=`0 Tr 4088`),Fo!==-1&&(Sa.usedRenderingMode=Fo),bs=bn.align||"left";var ni,ra=Cr*jo,Fa=Ys.internal.pageSize.getWidth(),wa=Mn[Qr];ks=bn.charSpace||Ci,Is=bn.maxWidth||0,Bs=Object.assign({autoencode:!0,noBOM:!0},bn.flags);var na=[],Ba=function(Qs){return Ys.getStringUnitWidth(Qs,{font:wa,charSpace:ks,fontSize:Cr,doKerning:!1})*Cr/Pi};if(Object.prototype.toString.call(yr)==="[object Array]"){var Bo;es=Zi(yr),bs!=="left"&&(ni=es.map(Ba));var Wo,Ea=0;if(bs==="right"){Ur-=ni[0],yr=[],Io=es.length;for(var Bi=0;Bi<Io;Bi++)Bi===0?(Wo=To(Ur),Bo=Do(un)):(Wo=hr(Ea-ni[Bi]),Bo=-ra),yr.push([es[Bi],Wo,Bo]),Ea=ni[Bi]}else if(bs==="center"){Ur-=ni[0]/2,yr=[],Io=es.length;for(var Ui=0;Ui<Io;Ui++)Ui===0?(Wo=To(Ur),Bo=Do(un)):(Wo=hr((Ea-ni[Ui])/2),Bo=-ra),yr.push([es[Ui],Wo,Bo]),Ea=ni[Ui]}else if(bs==="left"){yr=[],Io=es.length;for(var Ca=0;Ca<Io;Ca++)yr.push(es[Ca])}else if(bs==="justify"&&wa.encoding==="Identity-H"){yr=[],Io=es.length,Is=Is!==0?Is:Fa;for(var sa=0,mo=0;mo<Io;mo++)if(Bo=mo===0?Do(un):-ra,Wo=mo===0?To(Ur):sa,mo<Io-1){var Wl=hr((Is-ni[mo])/(es[mo].split(" ").length-1)),vi=es[mo].split(" ");yr.push([vi[0]+" ",Wo,Bo]),sa=0;for(var pi=1;pi<vi.length;pi++){var oa=(Ba(vi[pi-1]+" "+vi[pi])-Ba(vi[pi]))*Pi+Wl;pi==vi.length-1?yr.push([vi[pi],oa,0]):yr.push([vi[pi]+" ",oa,0]),sa-=oa}}else yr.push([es[mo],Wo,Bo]);yr.push(["",sa,0])}else{if(bs!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(yr=[],Io=es.length,Is=Is!==0?Is:Fa,mo=0;mo<Io;mo++){Bo=mo===0?Do(un):-ra,Wo=mo===0?To(Ur):0;var Ua=es[mo].split(" ").length-1,za=Ua>0?(Is-ni[mo])/Ua:0;mo<Io-1?na.push(ar(hr(za))):na.push(0),yr.push([es[mo],Wo,Bo])}}}(typeof bn.R2L=="boolean"?bn.R2L:Fr)===!0&&(yr=Qi(yr,function(Qs,Js,co){return[Qs.split("").reverse().join(""),Js,co]})),Gn={text:yr,x:Ur,y:un,options:bn,mutex:{pdfEscape:go,activeFontKey:Qr,fonts:Mn,activeFontSize:Cr}},Wn.publish("postProcessText",Gn),yr=Gn.text,oo=Gn.mutex.isHex||!1;var Aa=Mn[Qr].encoding;Aa!=="WinAnsiEncoding"&&Aa!=="StandardEncoding"||(yr=Qi(yr,function(Qs,Js,co){return[Na(Qs),Js,co]})),es=Zi(yr),yr=[];for(var ia,aa,zi,Ti=Array.isArray(es[0])?1:0,Hi="",Ra=function(Qs,Js,co){var yo="";return co instanceof nn?(co=typeof bn.angle=="number"?En(co,new nn(1,0,0,1,Qs,Js)):En(new nn(1,0,0,1,Qs,Js),co),Ze===Qe&&(co=En(new nn(1,0,0,-1,0,0),co)),yo=co.join(" ")+` Tm 4089`):yo=ar(Qs)+" "+ar(Js)+` Td 4090`,yo},Lo=0;Lo<es.length;Lo++){switch(Hi="",Ti){case 1:zi=(oo?"<":"(")+es[Lo][0]+(oo?">":")"),ia=parseFloat(es[Lo][1]),aa=parseFloat(es[Lo][2]);break;case 0:zi=(oo?"<":"(")+es[Lo]+(oo?">":")"),ia=To(Ur),aa=Do(un)}na!==void 0&&na[Lo]!==void 0&&(Hi=na[Lo]+` Tw 4091`),Lo===0?yr.push(Hi+Ra(ia,aa,Ks)+zi):Ti===0?yr.push(Hi+zi):Ti===1&&yr.push(Hi+Ra(ia,aa,Ks)+zi)}yr=Ti===0?yr.join(` Tj 4092T* `):yr.join(` Tj 4093`),yr+=` Tj 4094`;var Si=`BT 4095/`;return Si+=Qr+" "+Cr+` Tf 4096`,Si+=ar(Cr*jo)+` TL 4097`,Si+=Yo+` 4098`,Si+=io,Si+=yr,Sr(Si+="ET"),Xe[Qr]=!0,Ys};var wi=He.__private__.clip=He.clip=function(yr){return Sr(yr==="evenodd"?"W*":"W"),this};He.clipEvenOdd=function(){return wi("evenodd")},He.__private__.discardPath=He.discardPath=function(){return Sr("n"),this};var Xo=He.__private__.isValidStyle=function(yr){var Ur=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(yr)!==-1&&(Ur=!0),Ur};He.__private__.setDefaultPathOperation=He.setDefaultPathOperation=function(yr){return Xo(yr)&&(Ue=yr),this};var da=He.__private__.getStyle=He.getStyle=function(yr){var Ur=Ue;switch(yr){case"D":case"S":Ur="S";break;case"F":Ur="f";break;case"FD":case"DF":Ur="B";break;case"f":case"f*":case"B":case"B*":Ur=yr}return Ur},gi=He.close=function(){return Sr("h"),this};He.stroke=function(){return Sr("S"),this},He.fill=function(yr){return Mi("f",yr),this},He.fillEvenOdd=function(yr){return Mi("f*",yr),this},He.fillStroke=function(yr){return Mi("B",yr),this},He.fillStrokeEvenOdd=function(yr){return Mi("B*",yr),this};var Mi=function(yr,Ur){_typeof(Ur)==="object"?ha(Ur,yr):Sr(yr)},Di=function(yr){yr===null||Ze===Qe&&yr===void 0||(yr=da(yr),Sr(yr))};function pa(yr,Ur,un,bn,Tn){var Gn=new q(Ur||this.boundingBox,un||this.xStep,bn||this.yStep,this.gState,Tn||this.matrix
vendor: 4,738 bytes, line 4098
4098);Gn.stream=this.stream;var es=yr+"$$"+this.cloneIndex+++"$$";return jn(es,Gn),Gn}var ha=function(yr,Ur){var un=On[yr.key],bn=sn[un];if(bn instanceof M)Sr("q"),Sr(fa(Ur)),bn.gState&&He.setGState(bn.gState),Sr(yr.matrix.toString()+" cm"),Sr("/"+un+" sh"),Sr("Q");else if(bn instanceof q){var Tn=new nn(1,0,0,-1,0,Ki());yr.matrix&&(Tn=Tn.multiply(yr.matrix||Cn),un=pa.call(bn,yr.key,yr.boundingBox,yr.xStep,yr.yStep,Tn).id),Sr("q"),Sr("/Pattern cs"),Sr("/"+un+" scn"),bn.gState&&He.setGState(bn.gState),Sr(Ur),Sr("Q")}},fa=function(yr){switch(yr){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},ai=He.moveTo=function(yr,Ur){return Sr(ar(hr(yr))+" "+ar(sr(Ur))+" m"),this},ma=He.lineTo=function(yr,Ur){return Sr(ar(hr(yr))+" "+ar(sr(Ur))+" l"),this},li=He.curveTo=function(yr,Ur,un,bn,Tn,Gn){return Sr([ar(hr(yr)),ar(sr(Ur)),ar(hr(un)),ar(sr(bn)),ar(hr(Tn)),ar(sr(Gn)),"c"].join(" ")),this};He.__private__.line=He.line=function(yr,Ur,un,bn,Tn){if(isNaN(yr)||isNaN(Ur)||isNaN(un)||isNaN(bn)||!Xo(Tn))throw new Error("Invalid arguments passed to jsPDF.line");return Ze===Ke?this.lines([[un-yr,bn-Ur]],yr,Ur,[1,1],Tn||"S"):this.lines([[un-yr,bn-Ur]],yr,Ur,[1,1]).stroke()},He.__private__.lines=He.lines=function(yr,Ur,un,bn,Tn,Gn){var es,vs,bs,ks,Is,Bs,fo,Ks,Ys,ro,oo,io;if(typeof yr=="number"&&(io=un,un=Ur,Ur=yr,yr=io),bn=bn||[1,1],Gn=Gn||!1,isNaN(Ur)||isNaN(un)||!Array.isArray(yr)||!Array.isArray(bn)||!Xo(Tn)||typeof Gn!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(ai(Ur,un),es=bn[0],vs=bn[1],ks=yr.length,ro=Ur,oo=un,bs=0;bs<ks;bs++)(Is=yr[bs]).length===2?(ro=Is[0]*es+ro,oo=Is[1]*vs+oo,ma(ro,oo)):(Bs=Is[0]*es+ro,fo=Is[1]*vs+oo,Ks=Is[2]*es+ro,Ys=Is[3]*vs+oo,ro=Is[4]*es+ro,oo=Is[5]*vs+oo,li(Bs,fo,Ks,Ys,ro,oo));return Gn&&gi(),Di(Tn),this},He.path=function(yr){for(var Ur=0;Ur<yr.length;Ur++){var un=yr[Ur],bn=un.c;switch(un.op){case"m":ai(bn[0],bn[1]);break;case"l":ma(bn[0],bn[1]);break;case"c":li.apply(this,bn);break;case"h":gi()}}return this},He.__private__.rect=He.rect=function(yr,Ur,un,bn,Tn){if(isNaN(yr)||isNaN(Ur)||isNaN(un)||isNaN(bn)||!Xo(Tn))throw new Error("Invalid arguments passed to jsPDF.rect");return Ze===Ke&&(bn=-bn),Sr([ar(hr(yr)),ar(sr(Ur)),ar(hr(un)),ar(hr(bn)),"re"].join(" ")),Di(Tn),this},He.__private__.triangle=He.triangle=function(yr,Ur,un,bn,Tn,Gn,es){if(isNaN(yr)||isNaN(Ur)||isNaN(un)||isNaN(bn)||isNaN(Tn)||isNaN(Gn)||!Xo(es))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[un-yr,bn-Ur],[Tn-un,Gn-bn],[yr-Tn,Ur-Gn]],yr,Ur,[1,1],es,!0),this},He.__private__.roundedRect=He.roundedRect=function(yr,Ur,un,bn,Tn,Gn,es){if(isNaN(yr)||isNaN(Ur)||isNaN(un)||isNaN(bn)||isNaN(Tn)||isNaN(Gn)||!Xo(es))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var vs=4/3*(Math.SQRT2-1);return Tn=Math.min(Tn,.5*un),Gn=Math.min(Gn,.5*bn),this.lines([[un-2*Tn,0],[Tn*vs,0,Tn,Gn-Gn*vs,Tn,Gn],[0,bn-2*Gn],[0,Gn*vs,-Tn*vs,Gn,-Tn,Gn],[2*Tn-un,0],[-Tn*vs,0,-Tn,-Gn*vs,-Tn,-Gn],[0,2*Gn-bn],[0,-Gn*vs,Tn*vs,-Gn,Tn,-Gn]],yr+Tn,Ur,[1,1],es,!0),this},He.__private__.ellipse=He.ellipse=function(yr,Ur,un,bn,Tn){if(isNaN(yr)||isNaN(Ur)||isNaN(un)||isNaN(bn)||!Xo(Tn))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Gn=4/3*(Math.SQRT2-1)*un,es=4/3*(Math.SQRT2-1)*bn;return ai(yr+un,Ur),li(yr+un,Ur-es,yr+Gn,Ur-bn,yr,Ur-bn),li(yr-Gn,Ur-bn,yr-un,Ur-es,yr-un,Ur),li(yr-un,Ur+es,yr-Gn,Ur+bn,yr,Ur+bn),li(yr+Gn,Ur+bn,yr+un,Ur+es,yr+un,Ur),Di(Tn),this},He.__private__.circle=He.circle=function(yr,Ur,un,bn){if(isNaN(yr)||isNaN(Ur)||isNaN(un)||!Xo(bn))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(yr,Ur,un,un,bn)},He.setFont=function(yr,Ur,un){return un&&(Ur=rr(Ur,un)),Qr=js(yr,Ur,{disableWarning:!1}),this};var ga=He.__private__.getFont=He.getFont=function(){return Mn[js.apply(He,arguments)]};He.__private__.getFontList=He.getFontList=function(){var yr,Ur,un={};for(yr in on)if(on.hasOwnProperty(yr))for(Ur in un[yr]=[],on[yr])on[yr].hasOwnProperty(Ur)&&un[yr].push(Ur);return un},He.addFont=function(yr,Ur,un,bn,Tn){var Gn=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Gn.indexOf(arguments[3])!==-1?Tn=arguments[3]:arguments[3]&&Gn.indexOf(arguments[3])==-1&&(un=rr(un,bn)),ri.call(this,yr,Ur,un,Tn=Tn||"Identity-H")};var xi,Rs=Ee.lineWidth||.200025,fn=He.__private__.getLineWidth=He.getLineWidth=function(){return Rs},gs=He.__private__.setLineWidth=He.setLineWidth=function(yr){return Rs=yr,Sr(ar(hr(yr))+" w"),this};He.__private__.setLineDash=E.API.setLineDash=E.API.setLineDashPattern=function(yr,Ur){if(yr=yr||[],Ur=Ur||0,isNaN(Ur)||!Array.isArray(yr))throw new Error("Invalid arguments passed to
4098jsPDF.setLineDash");return yr=yr.map(function(un){return ar(hr(un))}).join(" "),Ur=ar(hr(Ur)),Sr("["+yr+"] "+Ur+" d"),this};var Ps=He.__private__.getLineHeight=He.getLineHeight=function(){return Cr*xi};He.__private__.getLineHeight=He.getLineHeight=function(){return Cr*xi};var Hs=He.__private__.setLineHeightFactor=He.setLineHeightFactor=function(yr){return typeof(yr=yr||1.15)=="number"&&(xi=yr),this},so=He.__private__.getLineHeightFactor=He.getLineHeightFactor=function(){return xi};Hs(Ee.lineHeight);var To=He.__private__.getHorizontalCoordinate=function(yr){return hr(yr)},Do=He.__private__.getVerticalCoordinate=function(yr){return Ze===Qe?yr:An[dr].mediaBox.topRightY-An[dr].mediaBox.bottomLeftY-hr(yr)},Ni=He.__private__.getHorizontalCoordinateString=He.getHorizontalCoordinateString=function(yr){return ar(To(yr))},yi=He.__private__.getVerticalCoordinateString=He.getVerticalCoordinateString=function(yr){return ar(Do(yr))},ci=Ee.strokeColor||"0 G";He.__private__.getStrokeColor=He.getDrawColor=function(){return cs(ci)},He.__private__.setStrokeColor=He.setDrawColor=function(yr,Ur,un,bn){return ci=Sn({ch1:yr,ch2:Ur,ch3:un,ch4:bn,pdfColorType:"draw",precision:2}),Sr(ci),this};var Ei=Ee.fillColor||"0 g";He.__private__.getFillColor=He.getFillColor=function(){return cs(Ei)},He.__private__.setFillColor=He.setFillColor=function(yr,Ur,un,bn){return Ei=Sn({ch1:yr,ch2:Ur,ch3:un,ch4:bn,pdfColorType:"fill",precision:2}),Sr(Ei),this};var Yo=Ee.textColor||"0 g",xa=He.__private__.getTextColor=He.getTextColor=function(){return cs(Yo)};He.__private__.setTextColor=He.setTextColor=function(yr,Ur,un,bn){return Yo=Sn({ch1:yr,ch2:Ur,ch3:un,ch4:bn,pdfColorType:"text",precision:3}),this};var Ci=Ee.charSpace,ya=He.__private__.getCharSpace=He.getCharSpace=function(){return parseFloat(Ci||0)};He.__private__.setCharSpace=He.setCharSpace=function(yr){if(isNaN(yr))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Ci=yr,this};var No=0;He.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},He.__private__.setLineCap=He.setLineCap=function(yr){var Ur=He.CapJoinStyles[yr];if(Ur===void 0)throw new Error("Line cap style of '"+yr+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return No=Ur,Sr(Ur+" J"),this};var to=0;He.__private__.setLineJoin=He.setLineJoin=function(yr){var Ur=He.CapJoinStyles[yr];if(Ur===void 0)throw new Error("Line join style of '"+yr+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return to=Ur,Sr(Ur+" j"),this},He.__private__.setLineMiterLimit=He.__private__.setMiterLimit=He.setLineMiterLimit=He.setMiterLimit=function(yr){if(yr=yr||0,isNaN(yr))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return Sr(ar(hr(yr))+" M"),this},He.GState=O,He.setGState=function(yr){(yr=typeof yr=="string"?Bn[Hn[yr]]:ko(null,yr)).equals(Zr)||(Sr("/"+yr.id+" gs"),Zr=yr)};var ko=function(yr,Ur){if(!yr||!Hn[yr]){var un=!1;for(var bn in Bn)if(Bn.hasOwnProperty(bn)&&Bn[bn].equals(Ur)){un=!0;break}if(un)Ur=Bn[bn];else{var Tn="GS"+(Object.keys(Bn).length+1).toString(10);Bn[Tn]=Ur,Ur.id=Tn}return yr&&(Hn[yr]=Ur.id),Wn.publish("addGState",Ur),Ur}};He.addGState=function(yr,Ur){return ko(yr,Ur),this},He.saveGraphicsState=function(){return Sr("q"),Yr.push({key:Qr,size:Cr,color:Yo}),this},He.restoreGraphicsState=function(){Sr("Q");var yr=Yr.pop();return Qr=yr.key,Cr=yr.size,Yo=yr.color,Zr=null,this},He.setCurrentTransformationMatrix=function(yr){return Sr(yr.toString()+" cm"),this},He.comment=function(yr){return Sr("#"+yr),this};var ui=function(yr,Ur){var un=yr||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return un},set:function(Gn){isNaN(Gn)||(un=parseFloat(Gn))}});var bn=Ur||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return bn},set:function(Gn){isNaN(Gn)||(bn=parseFloat(Gn))}});var Tn="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Tn},set:function(Gn){Tn=Gn.toString()}}),this},$o=function(yr,Ur,un,bn){ui.call(this,yr,Ur),this.type="rect";var Tn=un||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Tn},set:function(es){isNaN(es)||(Tn=parseFloat(es))}});var Gn=bn||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Gn},set:function(es){isNaN(es)||(Gn=parseFloat(es))}}),this},di=function(){this.page=xn,this.currentPage=dr,this.pages=Br.slice(0),this.pagesContext=An.slice(0),this.x=gn,this.y=In,this.matrix=yn,this.width=ol(dr),this.height=Ri(dr),this.outputDestination=Vr,this.id="",this.objectNumber=-1};di.prototype.restore=function(){xn=this.page,dr=this.currentPage,An=this.pagesContext,Br=this.pages,gn=this.x,In=this.y,yn=this.matrix,Ai(dr,this.width),il(dr,this.height),Vr=this.outputDestination};var _i=function(yr,Ur,un,bn,Tn){Gr.push(new di),xn=dr=0,Br=[],gn=yr,In=Ur,yn=Tn,Vo([un,bn])};for(var $i in He.beginFormObject=function(yr,Ur,un,bn,Tn){return _i(yr,Ur,un,bn,Tn),this},He.endFormObject=function(yr){return function(Ur){if(en[Ur])Gr.pop().restore(
vendor: 4,944 bytes, line 4098
4098);else{var un=new di,bn="Xo"+(Object.keys(Yn).length+1).toString(10);un.id=bn,en[Ur]=bn,Yn[bn]=un,Wn.publish("addFormObject",un),Gr.pop().restore()}}(yr),this},He.doFormObject=function(yr,Ur){var un=Yn[en[yr]];return Sr("q"),Sr(Ur.toString()+" cm"),Sr("/"+un.id+" Do"),Sr("Q"),this},He.getFormObject=function(yr){var Ur=Yn[en[yr]];return{x:Ur.x,y:Ur.y,width:Ur.width,height:Ur.height,matrix:Ur.matrix}},He.save=function(yr,Ur){return yr=yr||"generated.pdf",(Ur=Ur||{}).returnPromise=Ur.returnPromise||!1,Ur.returnPromise===!1?(l(Ts(us()),yr),typeof l.unload=="function"&&i.setTimeout&&setTimeout(l.unload,911),this):new Promise(function(un,bn){try{var Tn=l(Ts(us()),yr);typeof l.unload=="function"&&i.setTimeout&&setTimeout(l.unload,911),un(Tn)}catch(Gn){bn(Gn.message)}})},E.API)E.API.hasOwnProperty($i)&&($i==="events"&&E.API.events.length?function(yr,Ur){var un,bn,Tn;for(Tn=Ur.length-1;Tn!==-1;Tn--)un=Ur[Tn][0],bn=Ur[Tn][1],yr.subscribe.apply(yr,[un].concat(typeof bn=="function"?[bn]:bn))}(Wn,E.API.events):He[$i]=E.API[$i]);function ol(yr){return An[yr].mediaBox.topRightX-An[yr].mediaBox.bottomLeftX}function Ai(yr,Ur){An[yr].mediaBox.topRightX=Ur+An[yr].mediaBox.bottomLeftX}function Ri(yr){return An[yr].mediaBox.topRightY-An[yr].mediaBox.bottomLeftY}function il(yr,Ur){An[yr].mediaBox.topRightY=Ur+An[yr].mediaBox.bottomLeftY}var al=He.getPageWidth=function(yr){return ol(yr=yr||dr)/wn},ll=He.setPageWidth=function(yr,Ur){Ai(yr,Ur*wn)},Ki=He.getPageHeight=function(yr){return Ri(yr=yr||dr)/wn},cl=He.setPageHeight=function(yr,Ur){il(yr,Ur*wn)};return He.internal={pdfEscape:go,getStyle:da,getFont:ga,getFontSize:$r,getCharSpace:ya,getTextColor:xa,getLineHeight:Ps,getLineHeightFactor:so,getLineWidth:fn,write:Lr,getHorizontalCoordinate:To,getVerticalCoordinate:Do,getCoordinateString:Ni,getVerticalCoordinateString:yi,collections:{},newObject:Vn,newAdditionalObject:fs,newObjectDeferred:Qn,newObjectDeferredBegin:Un,getFilters:mn,putStream:zn,events:Wn,scaleFactor:wn,pageSize:{getWidth:function(){return al(dr)},setWidth:function(yr){ll(dr,yr)},getHeight:function(){return Ki(dr)},setHeight:function(yr){cl(dr,yr)}},encryptionOptions:ze,encryption:xo,getEncryptor:function(yr){return ze!==null?xo.encryptor(yr,0):function(Ur){return Ur}},output:Co,getNumberOfPages:xs,get pages(){return Br},out:Sr,f2:tr,f3:nr,getPageInfo:ua,getPageInfoByObjId:Ma,getCurrentPageInfo:Da,getPDFVersion:Ge,Point:ui,Rectangle:$o,Matrix:nn,hasHotfix:Eo},Object.defineProperty(He.internal.pageSize,"width",{get:function(){return al(dr)},set:function(yr){ll(dr,yr)},enumerable:!0,configurable:!0}),Object.defineProperty(He.internal.pageSize,"height",{get:function(){return Ki(dr)},set:function(yr){cl(dr,yr)},enumerable:!0,configurable:!0}),(function(yr){for(var Ur=0,un=fr.length;Ur<un;Ur++){var bn=ri.call(this,yr[Ur][0],yr[Ur][1],yr[Ur][2],fr[Ur][3],!0);We===!1&&(Xe[bn]=!0);var Tn=yr[Ur][0].split("-");wo({id:bn,fontName:Tn[0],fontStyle:Tn[1]||""})}Wn.publish("addFonts",{fonts:Mn,dictionary:on})}).call(He,fr),Qr="F1",Nn(Oe,Te),Wn.publish("initialized"),He}I.prototype.lsbFirstWord=function(Ee){return String.fromCharCode(255&Ee,Ee>>8&255,Ee>>16&255,Ee>>24&255)},I.prototype.toHexString=function(Ee){return Ee.split("").map(function(Re){return("0"+(255&Re.charCodeAt(0)).toString(16)).slice(-2)}).join("")},I.prototype.hexToBytes=function(Ee){for(var Re=[],Te=0;Te<Ee.length;Te+=2)Re.push(String.fromCharCode(parseInt(Ee.substr(Te,2),16)));return Re.join("")},I.prototype.processOwnerPassword=function(Ee,Re){return k(S(Re).substr(0,5),Ee)},I.prototype.encryptor=function(Ee,Re){var Te=S(this.encryptionKey+String.fromCharCode(255&Ee,Ee>>8&255,Ee>>16&255,255&Re,Re>>8&255)).substr(0,10);return function(je){return k(Te,je)}},O.prototype.equals=function(Ee){var Re,Te="id,objectNumber,equals";if(!Ee||_typeof(Ee)!==_typeof(this))return!1;var je=0;for(Re in this)if(!(Te.indexOf(Re)>=0)){if(this.hasOwnProperty(Re)&&!Ee.hasOwnProperty(Re)||this[Re]!==Ee[Re])return!1;je++}for(Re in Ee)Ee.hasOwnProperty(Re)&&Te.indexOf(Re)<0&&je--;return je===0},E.API={events:[]},E.version="4.2.1";var R=E.API,D=1,T=function(Ee){return Ee.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},z=function(Ee){return Ee.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},U=function(Ee){return Ee.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(Re){var Te=Re.charCodeAt(0).toString(16).toUpperCase();return"#"+(Te.length===1?"0"+Te:Te)})},H=function(Ee){return Ee.toFixed(2)},W=function(Ee){return Ee.toFixed(5)};R.__acroform__={};var V=function(Ee,Re){Ee.prototype=Object.create(Re.prototype),Ee.prototype.constructor=Ee},G=function(Ee){return Ee*D},Y=function(Ee){var Re=new lt,Te=At.internal.getHeight(Ee)||0,je=At.internal.getWidth(Ee)||0;return Re.BBox=[0,0,Number(H(je)),Number(H(Te))],Re},J=R.__acroform__.setBit=function(Ee,Re){if(Ee=Ee||0,Re=Re||0,isNaN(Ee)||isNaN(Re))throw new Error("Invalid arguments passed to
4098jsPDF.API.__acroform__.setBit");return Ee|1<<Re},X=R.__acroform__.clearBit=function(Ee,Re){if(Ee=Ee||0,Re=Re||0,isNaN(Ee)||isNaN(Re))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return Ee&~(1<<Re)},K=R.__acroform__.getBit=function(Ee,Re){if(isNaN(Ee)||isNaN(Re))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return Ee&1<<Re?1:0},Z=R.__acroform__.getBitForPdf=function(Ee,Re){if(isNaN(Ee)||isNaN(Re))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return K(Ee,Re-1)},$=R.__acroform__.setBitForPdf=function(Ee,Re){if(isNaN(Ee)||isNaN(Re))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return J(Ee,Re-1)},Q=R.__acroform__.clearBitForPdf=function(Ee,Re){if(isNaN(Ee)||isNaN(Re))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return X(Ee,Re-1)},tt=R.__acroform__.calculateCoordinates=function(Ee,Re){var Te=Re.internal.getHorizontalCoordinate,je=Re.internal.getVerticalCoordinate,Oe=Ee[0],Me=Ee[1],De=Ee[2],$e=Ee[3],Be={};return Be.lowerLeft_X=Te(Oe)||0,Be.lowerLeft_Y=je(Me+$e)||0,Be.upperRight_X=Te(Oe+De)||0,Be.upperRight_Y=je(Me)||0,[Number(H(Be.lowerLeft_X)),Number(H(Be.lowerLeft_Y)),Number(H(Be.upperRight_X)),Number(H(Be.upperRight_Y))]},et=function(Ee){if(Ee.appearanceStreamContent)return Ee.appearanceStreamContent;if(Ee.V||Ee.DV){var Re=[],Te=Ee._V||Ee.DV,je=rt(Ee,Te),Oe=Ee.scope.internal.getFont(Ee.fontName,Ee.fontStyle).id;Re.push("/Tx BMC"),Re.push("q"),Re.push("BT"),Re.push(Ee.scope.__private__.encodeColorString(Ee.color)),Re.push("/"+Oe+" "+H(je.fontSize)+" Tf"),Re.push("1 0 0 1 0 0 Tm"),Re.push(je.text),Re.push("ET"),Re.push("Q"),Re.push("EMC");var Me=Y(Ee);return Me.scope=Ee.scope,Me.stream=Re.join(` 4099`),Me}},rt=function(Ee,Re){var Te=Ee.fontSize===0?Ee.maxFontSize:Ee.fontSize,je={text:"",fontSize:""},Oe=(Re=(Re=Re.substr(0,1)=="("?Re.substr(1):Re).substr(Re.length-1)==")"?Re.substr(0,Re.length-1):Re).split(" ");Oe=Ee.multiline?Oe.map(function(tr){return tr.split(` 4100`)}):Oe.map(function(tr){return[tr]});var Me=Te,De=At.internal.getHeight(Ee)||0;De=De<0?-De:De;var $e=At.internal.getWidth(Ee)||0;$e=$e<0?-$e:$e;var Be=function(tr,nr,hr){if(tr+1<Oe.length){var sr=nr+" "+Oe[tr+1][0];return nt(sr,Ee,hr).width<=$e-4}return!1};Me++;e:for(;Me>0;){Re="",Me--;var Ue,ze,We=nt("3",Ee,Me).height,Xe=Ee.multiline?De-Me:(De-We)/2,He=Xe+=2,qe=0,Ge=0,Ye=0;if(Me<=0){Re=`(...) Tj 4101`,Re+="% Width of Text: "+nt(Re,Ee,Me=12).width+", FieldWidth:"+$e+` 4102`;break}for(var Ve="",Ke=0,Qe=0;Qe<Oe.length;Qe++)if(Oe.hasOwnProperty(Qe)){var Ze=!1;if(Oe[Qe].length!==1&&Ye!==Oe[Qe].length-1){if((We+2)*(Ke+2)+2>De)continue e;Ve+=Oe[Qe][Ye],Ze=!0,Ge=Qe,Qe--}else{Ve=(Ve+=Oe[Qe][Ye]+" ").substr(Ve.length-1)==" "?Ve.substr(0,Ve.length-1):Ve;var Je=parseInt(Qe),ir=Be(Je,Ve,Me),rr=Qe>=Oe.length-1;if(ir&&!rr){Ve+=" ",Ye=0;continue}if(ir||rr){if(rr)Ge=Je;else if(Ee.multiline&&(We+2)*(Ke+2)+2>De)continue e}else{if(!Ee.multiline||(We+2)*(Ke+2)+2>De)continue e;Ge=Je}}for(var ar="",or=qe;or<=Ge;or++){var pr=Oe[or];if(Ee.multiline){if(or===Ge){ar+=pr[Ye]+" ",Ye=(Ye+1)%pr.length;continue}if(or===qe){ar+=pr[pr.length-1]+" ";continue}}ar+=pr[0]+" "}switch(ar=ar.substr(ar.length-1)==" "?ar.substr(0,ar.length-1):ar,ze=nt(ar,Ee,Me).width,Ee.textAlign){case"right":Ue=$e-ze-2;break;case"center":Ue=($e-ze)/2;break;default:Ue=2}Re+=H(Ue)+" "+H(He)+` Td 4103`,Re+="("+T(ar)+`) Tj 4104`,Re+=-H(Ue)+` 0 Td 4105`,He=-(Me+2),ze=0,qe=Ze?Ge:Ge+1,Ke++,Ve=""}break}return je.text=Re,je.fontSize=Me,je},nt=function(Ee,Re,Te){var je=Re.scope.internal.getFont(Re.fontName,Re.fontStyle),Oe=Re.scope.getStringUnitWidth(Ee,{font:je,fontSize:parseFloat(Te),charSpace:0})*parseFloat(Te);return{height:Re.scope.getStringUnitWidth("3",{font:je,fontSize:parseFloat(Te),charSpace:0})*parseFloat(Te)*1.5,width:Oe}},it={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},at=function(Ee,Re){var Te={type:"reference",object:Ee};Re.internal.getPageInfo(Ee.page).pageContext.annotations.find(function(je){return je.type===Te.type&&je.object===Te.object})===void 0&&Re.internal.getPageInfo(Ee.page).pageContext.annotations.push(Te)},ot=function(Ee,Re){if(Re.scope=Ee,Ee.internal!==void 0&&(Ee.internal.acroformPlugin===void 0||Ee.internal.acroformPlugin.isInitialized===!1)){if
vendor: 49,792 bytes, lines 4105-4117
4105(ft.FieldNum=0,Ee.internal.acroformPlugin=JSON.parse(JSON.stringify(it)),Ee.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");D=Ee.internal.scaleFactor,Ee.internal.acroformPlugin.acroFormDictionaryRoot=new ht,Ee.internal.acroformPlugin.acroFormDictionaryRoot.scope=Ee,Ee.internal.acroformPlugin.acroFormDictionaryRoot._eventID=Ee.internal.events.subscribe("postPutResources",function(){(function(Te){Te.internal.events.unsubscribe(Te.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete Te.internal.acroformPlugin.acroFormDictionaryRoot._eventID,Te.internal.acroformPlugin.printedOut=!0})(Ee)}),Ee.internal.events.subscribe("buildDocument",function(){(function(Te){Te.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var je=Te.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var Oe in je)if(je.hasOwnProperty(Oe)){var Me=je[Oe];Me.objId=void 0,Me.hasAnnotation&&at(Me,Te)}})(Ee)}),Ee.internal.events.subscribe("putCatalog",function(){(function(Te){if(Te.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");Te.internal.write("/AcroForm "+Te.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(Ee)}),Ee.internal.events.subscribe("postPutPages",function(Te){(function(je,Oe){var Me=!je;for(var De in je||(Oe.internal.newObjectDeferredBegin(Oe.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),Oe.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),je=je||Oe.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(je.hasOwnProperty(De)){var $e=je[De],Be=[],Ue=$e.Rect;if($e.Rect&&($e.Rect=tt($e.Rect,Oe)),Oe.internal.newObjectDeferredBegin($e.objId,!0),$e.DA=At.createDefaultAppearanceStream($e),_typeof($e)==="object"&&typeof $e.getKeyValueListForStream=="function"&&(Be=$e.getKeyValueListForStream()),$e.Rect=Ue,$e.hasAppearanceStream&&!$e.appearanceStreamContent){var ze=et($e);Be.push({key:"AP",value:"<</N "+ze+">>"}),Oe.internal.acroformPlugin.xForms.push(ze)}if($e.appearanceStreamContent){var We="";for(var Xe in $e.appearanceStreamContent)if($e.appearanceStreamContent.hasOwnProperty(Xe)){var He=$e.appearanceStreamContent[Xe];if(We+="/"+Xe+" ",We+="<<",Object.keys(He).length>=1||Array.isArray(He)){for(var De in He)if(He.hasOwnProperty(De)){var qe=He[De];typeof qe=="function"&&(qe=qe.call(Oe,$e)),We+="/"+De+" "+qe+" ",Oe.internal.acroformPlugin.xForms.indexOf(qe)>=0||Oe.internal.acroformPlugin.xForms.push(qe)}}else typeof(qe=He)=="function"&&(qe=qe.call(Oe,$e)),We+="/"+De+" "+qe,Oe.internal.acroformPlugin.xForms.indexOf(qe)>=0||Oe.internal.acroformPlugin.xForms.push(qe);We+=">>"}Be.push({key:"AP",value:`<< 4106`+We+">>"})}Oe.internal.putStream({additionalKeyValues:Be,objectId:$e.objId}),Oe.internal.out("endobj")}Me&&function(Ge,Ye){for(var Ve in Ge)if(Ge.hasOwnProperty(Ve)){var Ke=Ve,Qe=Ge[Ve];Ye.internal.newObjectDeferredBegin(Qe.objId,!0),_typeof(Qe)==="object"&&typeof Qe.putStream=="function"&&Qe.putStream(),delete Ge[Ke]}}(Oe.internal.acroformPlugin.xForms,Oe)})(Te,Ee)}),Ee.internal.acroformPlugin.isInitialized=!0}},st=R.__acroform__.arrayToPdfArray=function(Ee,Re,Te){var je=function(De){return De};if(Array.isArray(Ee)){for(var Oe="[",Me=0;Me<Ee.length;Me++)switch(Me!==0&&(Oe+=" "),_typeof(Ee[Me])){case"boolean":case"number":case"object":Oe+=Ee[Me].toString();break;case"string":Ee[Me].substr(0,1)==="/"?Oe+="/"+U(Ee[Me].substr(1)):(Re!==void 0&&Te&&(je=Te.internal.getEncryptor(Re)),Oe+="("+T(je(Ee[Me].toString()))+")")}return Oe+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},ut=function(Ee,Re,Te){var je=function(Oe){return Oe};return Re!==void 0&&Te&&(je=Te.internal.getEncryptor(Re)),(Ee=Ee||"").toString(),"("+T(je(Ee))+")"},ct=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(Ee){this._objId=Ee}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};ct.prototype.toString=function(){return this.objId+" 0 R"},ct.prototype.putStream=function(){var Ee=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:Ee,objectId:this.objId}),this.scope.internal.out("endobj")},ct.prototype.getKeyValueListForStream=function(){var Ee=[],Re=Object.getOwnPropertyNames(this).filter(function(Me){return Me!="content"&&Me!="appearanceStreamContent"&&Me!="scope"&&Me!="objId"&&Me.substring(0,1)!="_"});for(var Te in Re)if(Object.getOwnPropertyDescriptor(this,Re[Te]).configurable===!1){var je=Re[Te],Oe=this[je];Oe&&(Array.isArray(Oe)?Ee.push({key:je,value:st(Oe,this.objId,this.scope)}):Oe instanceof ct?(Oe.scope=this.scope,Ee.push({key:je,value:Oe.objId+" 0 R"})):typeof Oe!="function"&&Ee.push({key:je,value:Oe}))}return Ee};var lt=function(){ct.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var Ee,Re=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return Re},set:function(Te){Re=Te}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(Te){Ee=Te.trim()},get:function(){return Ee||null}})};V(lt,ct);var ht=function(){ct.call(this);var Ee,Re=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return Re.length>0?Re:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return Re}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(Ee){var Te=function(je){return je};return this.scope&&(Te=this.scope.internal.getEncryptor(this.objId)),"("+T(Te(Ee))+")"}},set:function(Te){Ee=Te}})};V(ht,ct);var ft=function Ee(){ct.call(this);var Re=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return Re},set:function(Ve){if(isNaN(Ve))throw new Error('Invalid value "'+Ve+'" for attribute F supplied.');Re=Ve}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Z(Re,3)},set:function(Ve){Ve?this.F=$(Re,3):this.F=Q(Re,3)}});var Te=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return Te},set:function(Ve){if(isNaN(Ve))throw new Error('Invalid value "'+Ve+'" for attribute Ff supplied.');Te=Ve}});var je=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(je.length!==0)return je},set:function(Ve){je=Ve!==void 0?Ve:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!je||isNaN(je[0])?0:je[0]},set:function(Ve){je[0]=Ve}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!je||isNaN(je[1])?0:je[1]},set:function(Ve){je[1]=Ve}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!je||isNaN(je[2])?0:je[2]},set:function(Ve){je[2]=Ve}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!je||isNaN(je[3])?0:je[3]},set:function(Ve){je[3]=Ve}});var Oe="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return Oe},set:function(Ve){switch(Ve){case"/Btn":case"/Tx":case"/Ch":case"/Sig":Oe=Ve;break;default:throw new Error('Invalid value "'+Ve+'" for attribute FT supplied.')}}});var Me=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!Me||Me.length<1){if(this instanceof wt)return;Me="FieldObject"+Ee.FieldNum++}var Ve=function(Ke){return Ke};return this.scope&&(Ve=this.scope.internal.getEncryptor(this.objId)),"("+T(Ve(Me))+")"},set:function(Ve){Me=Ve.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return Me},set:function(Ve){Me=Ve}});var De="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return De},set:function(Ve){De=Ve}});var $e="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return $e},set:function(Ve){$e=Ve}});var Be=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return Be},set:function(Ve){Be=Ve}});var Ue=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return Ue===void 0?50/D:Ue},set:function(Ve){Ue=Ve}});var ze="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return ze},set:function(Ve){ze=Ve}});var We="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!We||this instanceof wt||this instanceof Lt))return ut(We,this.objId,this.scope)},set:function(Ve){Ve=Ve.toString(),We=Ve}});var Xe=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(Xe)return this instanceof vt==0?ut(Xe,this.objId,this.scope):Xe},set:function(Ve){Ve=Ve.toString(),Xe=this instanceof vt==0?Ve.substr(0,1)==="("?z(Ve.substr(1,Ve.length-2)):z(Ve):Ve}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof vt==1?z(Xe.substr(1,Xe.length-1)):Xe},set:function(Ve){Ve=Ve.toString(),Xe=this instanceof vt==1?"/"+U(Ve):Ve}});var He=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(He)return He},set:function(Ve){this.V=Ve}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(He)return this instanceof vt==0?ut(He,this.objId,this.scope):He},set:function(Ve){Ve=Ve.toString(),He=this instanceof vt==0?Ve.substr(0,1)==="("?z(Ve.substr(1,Ve.length-2)):z(Ve):Ve}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof vt==1?z(He.substr(1,He.length-1)):He},set:function(Ve){Ve=Ve.toString(),He=this instanceof vt==1?"/"+U(Ve):Ve}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var qe,Ge=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return Ge},set:function(Ve){Ve=!!Ve,Ge=Ve}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(qe)return qe},set:function(Ve){qe=Ve}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,1)},set:function(Ve){Ve?this.Ff=$(this.Ff,1):this.Ff=Q(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,2)},set:function(Ve){Ve?this.Ff=$(this.Ff,2):this.Ff=Q(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,3)},set:function(Ve){Ve?this.Ff=$(this.Ff,3):this.Ff=Q(this.Ff,3)}});var Ye=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(Ye!==null)return Ye},set:function(Ve){if([0,1,2].indexOf(Ve)===-1)throw new Error('Invalid value "'+Ve+'" for attribute Q supplied.');Ye=Ve}}),Object.defineProperty(this,"textAlign",{get:function(){var Ve;switch(Ye){case 0:default:Ve="left";break;case 1:Ve="center";break;case 2:Ve="right"}return Ve},configurable:!0,enumerable:!0,set:function(Ve){switch(Ve){case"right":case 2:Ye=2;break;case"center":case 1:Ye=1;break;default:Ye=0}}})};V(ft,ct);var dt=function(){ft.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var Ee=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return Ee},set:function(Te){Ee=Te}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return Ee},set:function(Te){Ee=Te}});var Re=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return st(Re,this.objId,this.scope)},set:function(Te){var je,Oe;Oe=[],typeof(je=Te)=="string"&&(Oe=function(Me,De,$e){$e||($e=1);for(var Be,Ue=[];Be=De.exec(Me);)Ue.push(Be[$e]);return Ue}(je,/\((.*?)\)/g)),Re=Oe}}),this.getOptions=function(){return Re},this.setOptions=function(Te){Re=Te,this.sort&&Re.sort()},this.addOption=function(Te){Te=(Te=Te||"").toString(),Re.push(Te),this.sort&&Re.sort()},this.removeOption=function(Te,je){for(je=je||!1,Te=(Te=Te||"").toString();Re.indexOf(Te)!==-1&&(Re.splice(Re.indexOf(Te),1),je!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,18)},set:function(Te){Te?this.Ff=$(this.Ff,18):this.Ff=Q(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,19)},set:function(Te){this.combo===!0&&(Te?this.Ff=$(this.Ff,19):this.Ff=Q(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,20)},set:function(Te){Te?(this.Ff=$(this.Ff,20),Re.sort()):this.Ff=Q(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,22)},set:function(Te){Te?this.Ff=$(this.Ff,22):this.Ff=Q(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,23)},set:function(Te){Te?this.Ff=$(this.Ff,23):this.Ff=Q(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,27)},set:function(Te){Te?this.Ff=$(this.Ff,27):this.Ff=Q(this.Ff,27)}}),this.hasAppearanceStream=!1};V(dt,ft);var pt=function(){dt.call(this),this.fontName="helvetica",this.combo=!1};V(pt,dt);var gt=function(){pt.call(this),this.combo=!0};V(gt,pt);var mt=function(){gt.call(this),this.edit=!0};V(mt,gt);var vt=function(){ft.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,15)},set:function(Te){Te?this.Ff=$(this.Ff,15):this.Ff=Q(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,16)},set:function(Te){Te?this.Ff=$(this.Ff,16):this.Ff=Q(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,17)},set:function(Te){Te?this.Ff=$(this.Ff,17):this.Ff=Q(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,26)},set:function(Te){Te?this.Ff=$(this.Ff,26):this.Ff=Q(this.Ff,26)}});var Ee,Re={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var Te=function(Me){return Me};if(this.scope&&(Te=this.scope.internal.getEncryptor(this.objId)),Object.keys(Re).length!==0){var je,Oe=[];for(je in Oe.push("<<"),Re)Oe.push("/"+je+" ("+T(Te(Re[je]))+")");return Oe.push(">>"),Oe.join(` 4107`)}},set:function(Te){_typeof(Te)==="object"&&(Re=Te)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return Re.CA||""},set:function(Te){typeof Te=="string"&&(Re.CA=Te)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return Ee},set:function(Te){var je=Te==null?"":Te.toString();je.substr(0,1)==="/"&&(je=je.substr(1)),Ee="/"+U(je)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return Ee.substr(1,Ee.length-1)},set:function(Te){Ee="/"+U(Te)}})};V(vt,ft);var bt=function(){vt.call(this),this.pushButton=!0};V(bt,vt);var yt=function(){vt.call(this),this.radio=!0,this.pushButton=!1;var Ee=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return Ee},set:function(Re){Ee=Re!==void 0?Re:[]}})};V(yt,vt);var wt=function(){var Ee,Re;ft.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return Ee},set:function(Oe){Ee=Oe}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return Re},set:function(Oe){Re=Oe}});var Te,je={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var Oe=function($e){return $e};this.scope&&(Oe=this.scope.internal.getEncryptor(this.objId));var Me,De=[];for(Me in De.push("<<"),je)De.push("/"+Me+" ("+T(Oe(je[Me]))+")");return De.push(">>"),De.join(` 4108`)},set:function(Oe){_typeof(Oe)==="object"&&(je=Oe)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return je.CA||""},set:function(Oe){typeof Oe=="string"&&(je.CA=Oe)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return Te},set:function(Oe){var Me=Oe==null?"":Oe.toString();Me.substr(0,1)==="/"&&(Me=Me.substr(1)),Te="/"+U(Me)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return Te.substr(1,Te.length-1)},set:function(Oe){var Me=Oe==null?"":Oe.toString();Me.substr(0,1)==="/"&&(Me=Me.substr(1)),Te="/"+U(Me)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=At.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};V(wt,ft),yt.prototype.setAppearance=function(Ee){if(!("createAppearanceStream"in Ee)||!("getCA"in Ee))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var Re in this.Kids)if(this.Kids.hasOwnProperty(Re)){var Te=this.Kids[Re];Te.appearanceStreamContent=Ee.createAppearanceStream(Te.optionName),Te.caption=Ee.getCA()}},yt.prototype.createOption=function(Ee){var Re=new wt;return Re.Parent=this,Re.optionName=Ee,this.Kids.push(Re),St.call(this.scope,Re),Re};var Nt=function(){vt.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=At.CheckBox.createAppearanceStream()};V(Nt,vt);var Lt=function(){ft.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,13)},set:function(Re){Re?this.Ff=$(this.Ff,13):this.Ff=Q(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,21)},set:function(Re){Re?this.Ff=$(this.Ff,21):this.Ff=Q(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,23)},set:function(Re){Re?this.Ff=$(this.Ff,23):this.Ff=Q(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,24)},set:function(Re){Re?this.Ff=$(this.Ff,24):this.Ff=Q(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,25)},set:function(Re){Re?this.Ff=$(this.Ff,25):this.Ff=Q(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,26)},set:function(Re){Re?this.Ff=$(this.Ff,26):this.Ff=Q(this.Ff,26)}});var Ee=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return Ee},set:function(Re){Ee=Re}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return Ee},set:function(Re){Number.isInteger(Re)&&(Ee=Re)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};V(Lt,ft);var xt=function(){Lt.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Z(this.Ff,14)},set:function(Ee){Ee?this.Ff=$(this.Ff,14):this.Ff=Q(this.Ff,14)}}),this.password=!0};V(xt,Lt);var At={CheckBox:{createAppearanceStream:function(){return{N:{On:At.CheckBox.YesNormal},D:{On:At.CheckBox.YesPushDown,Off:At.CheckBox.OffPushDown}}},YesPushDown:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=[],je=Ee.scope.internal.getFont(Ee.fontName,Ee.fontStyle).id,Oe=Ee.scope.__private__.encodeColorString(Ee.color),Me=rt(Ee,Ee.caption);return Te.push("0.749023 g"),Te.push("0 0 "+H(At.internal.getWidth(Ee))+" "+H(At.internal.getHeight(Ee))+" re"),Te.push("f"),Te.push("BMC"),Te.push("q"),Te.push("0 0 1 rg"),Te.push("/"+je+" "+H(Me.fontSize)+" Tf "+Oe),Te.push("BT"),Te.push(Me.text),Te.push("ET"),Te.push("Q"),Te.push("EMC"),Re.stream=Te.join(` 4109`),Re},YesNormal:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=Ee.scope.internal.getFont(Ee.fontName,Ee.fontStyle).id,je=Ee.scope.__private__.encodeColorString(Ee.color),Oe=[],Me=At.internal.getHeight(Ee),De=At.internal.getWidth(Ee),$e=rt(Ee,Ee.caption);return Oe.push("1 g"),Oe.push("0 0 "+H(De)+" "+H(Me)+" re"),Oe.push("f"),Oe.push("q"),Oe.push("0 0 1 rg"),Oe.push("0 0 "+H(De-1)+" "+H(Me-1)+" re"),Oe.push("W"),Oe.push("n"),Oe.push("0 g"),Oe.push("BT"),Oe.push("/"+Te+" "+H($e.fontSize)+" Tf "+je),Oe.push($e.text),Oe.push("ET"),Oe.push("Q"),Re.stream=Oe.join(` 4110`),Re},OffPushDown:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=[];return Te.push("0.749023 g"),Te.push("0 0 "+H(At.internal.getWidth(Ee))+" "+H(At.internal.getHeight(Ee))+" re"),Te.push("f"),Re.stream=Te.join(` 4111`),Re}},RadioButton:{Circle:{createAppearanceStream:function(Ee){var Re={D:{Off:At.RadioButton.Circle.OffPushDown},N:{}};return Re.N[Ee]=At.RadioButton.Circle.YesNormal,Re.D[Ee]=At.RadioButton.Circle.YesPushDown,Re},getCA:function(){return"l"},YesNormal:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=[],je=At.internal.getWidth(Ee)<=At.internal.getHeight(Ee)?At.internal.getWidth(Ee)/4:At.internal.getHeight(Ee)/4;je=Number((.9*je).toFixed(5));var Oe=At.internal.Bezier_C,Me=Number((je*Oe).toFixed(5));return Te.push("q"),Te.push("1 0 0 1 "+W(At.internal.getWidth(Ee)/2)+" "+W(At.internal.getHeight(Ee)/2)+" cm"),Te.push(je+" 0 m"),Te.push(je+" "+Me+" "+Me+" "+je+" 0 "+je+" c"),Te.push("-"+Me+" "+je+" -"+je+" "+Me+" -"+je+" 0 c"),Te.push("-"+je+" -"+Me+" -"+Me+" -"+je+" 0 -"+je+" c"),Te.push(Me+" -"+je+" "+je+" -"+Me+" "+je+" 0 c"),Te.push("f"),Te.push("Q"),Re.stream=Te.join(` 4112`),Re},YesPushDown:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=[],je=At.internal.getWidth(Ee)<=At.internal.getHeight(Ee)?At.internal.getWidth(Ee)/4:At.internal.getHeight(Ee)/4;je=Number((.9*je).toFixed(5));var Oe=Number((2*je).toFixed(5)),Me=Number((Oe*At.internal.Bezier_C).toFixed(5)),De=Number((je*At.internal.Bezier_C).toFixed(5));return Te.push("0.749023 g"),Te.push("q"),Te.push("1 0 0 1 "+W(At.internal.getWidth(Ee)/2)+" "+W(At.internal.getHeight(Ee)/2)+" cm"),Te.push(Oe+" 0 m"),Te.push(Oe+" "+Me+" "+Me+" "+Oe+" 0 "+Oe+" c"),Te.push("-"+Me+" "+Oe+" -"+Oe+" "+Me+" -"+Oe+" 0 c"),Te.push("-"+Oe+" -"+Me+" -"+Me+" -"+Oe+" 0 -"+Oe+" c"),Te.push(Me+" -"+Oe+" "+Oe+" -"+Me+" "+Oe+" 0 c"),Te.push("f"),Te.push("Q"),Te.push("0 g"),Te.push("q"),Te.push("1 0 0 1 "+W(At.internal.getWidth(Ee)/2)+" "+W(At.internal.getHeight(Ee)/2)+" cm"),Te.push(je+" 0 m"),Te.push(je+" "+De+" "+De+" "+je+" 0 "+je+" c"),Te.push("-"+De+" "+je+" -"+je+" "+De+" -"+je+" 0 c"),Te.push("-"+je+" -"+De+" -"+De+" -"+je+" 0 -"+je+" c"),Te.push(De+" -"+je+" "+je+" -"+De+" "+je+" 0 c"),Te.push("f"),Te.push("Q"),Re.stream=Te.join(` 4113`),Re},OffPushDown:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=[],je=At.internal.getWidth(Ee)<=At.internal.getHeight(Ee)?At.internal.getWidth(Ee)/4:At.internal.getHeight(Ee)/4;je=Number((.9*je).toFixed(5));var Oe=Number((2*je).toFixed(5)),Me=Number((Oe*At.internal.Bezier_C).toFixed(5));return Te.push("0.749023 g"),Te.push("q"),Te.push("1 0 0 1 "+W(At.internal.getWidth(Ee)/2)+" "+W(At.internal.getHeight(Ee)/2)+" cm"),Te.push(Oe+" 0 m"),Te.push(Oe+" "+Me+" "+Me+" "+Oe+" 0 "+Oe+" c"),Te.push("-"+Me+" "+Oe+" -"+Oe+" "+Me+" -"+Oe+" 0 c"),Te.push("-"+Oe+" -"+Me+" -"+Me+" -"+Oe+" 0 -"+Oe+" c"),Te.push(Me+" -"+Oe+" "+Oe+" -"+Me+" "+Oe+" 0 c"),Te.push("f"),Te.push("Q"),Re.stream=Te.join(` 4114`),Re}},Cross:{createAppearanceStream:function(Ee){var Re={D:{Off:At.RadioButton.Cross.OffPushDown},N:{}};return Re.N[Ee]=At.RadioButton.Cross.YesNormal,Re.D[Ee]=At.RadioButton.Cross.YesPushDown,Re},getCA:function(){return"8"},YesNormal:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=[],je=At.internal.calculateCross(Ee);return Te.push("q"),Te.push("1 1 "+H(At.internal.getWidth(Ee)-2)+" "+H(At.internal.getHeight(Ee)-2)+" re"),Te.push("W"),Te.push("n"),Te.push(H(je.x1.x)+" "+H(je.x1.y)+" m"),Te.push(H(je.x2.x)+" "+H(je.x2.y)+" l"),Te.push(H(je.x4.x)+" "+H(je.x4.y)+" m"),Te.push(H(je.x3.x)+" "+H(je.x3.y)+" l"),Te.push("s"),Te.push("Q"),Re.stream=Te.join(` 4115`),Re},YesPushDown:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=At.internal.calculateCross(Ee),je=[];return je.push("0.749023 g"),je.push("0 0 "+H(At.internal.getWidth(Ee))+" "+H(At.internal.getHeight(Ee))+" re"),je.push("f"),je.push("q"),je.push("1 1 "+H(At.internal.getWidth(Ee)-2)+" "+H(At.internal.getHeight(Ee)-2)+" re"),je.push("W"),je.push("n"),je.push(H(Te.x1.x)+" "+H(Te.x1.y)+" m"),je.push(H(Te.x2.x)+" "+H(Te.x2.y)+" l"),je.push(H(Te.x4.x)+" "+H(Te.x4.y)+" m"),je.push(H(Te.x3.x)+" "+H(Te.x3.y)+" l"),je.push("s"),je.push("Q"),Re.stream=je.join(` 4116`),Re},OffPushDown:function(Ee){var Re=Y(Ee);Re.scope=Ee.scope;var Te=[];return Te.push("0.749023 g"),Te.push("0 0 "+H(At.internal.getWidth(Ee))+" "+H(At.internal.getHeight(Ee))+" re"),Te.push("f"),Re.stream=Te.join(` 4117`),Re}}},createDefaultAppearanceStream:function(Ee){var Re=Ee.scope.internal.getFont(Ee.fontName,Ee.fontStyle).id,Te=Ee.scope.__private__.encodeColorString(Ee.color);return"/"+Re+" "+Ee.fontSize+" Tf "+Te}};At.internal={Bezier_C:.551915024494,calculateCross:function(Ee){var Re=At.internal.getWidth(Ee),Te=At.internal.getHeight(Ee),je=Math.min(Re,Te);return{x1:{x:(Re-je)/2,y:(Te-je)/2+je},x2:{x:(Re-je)/2+je,y:(Te-je)/2},x3:{x:(Re-je)/2,y:(Te-je)/2},x4:{x:(Re-je)/2+je,y:(Te-je)/2+je}}}},At.internal.getWidth=function(Ee){var Re=0;return _typeof(Ee)==="object"&&(Re=G(Ee.Rect[2])),Re},At.internal.getHeight=function(Ee){var Re=0;return _typeof(Ee)==="object"&&(Re=G(Ee.Rect[3])),Re};var St=R.addField=function(Ee){if(ot(this,Ee),!(Ee instanceof ft))throw new Error("Invalid argument passed to jsPDF.addField.");var Re;return(Re=Ee).scope.internal.acroformPlugin.printedOut&&(Re.scope.internal.acroformPlugin.printedOut=!1,Re.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),Re.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(Re),Ee.page=Ee.scope.internal.getCurrentPageInfo().pageNumber,this};R.AcroFormChoiceField=dt,R.AcroFormListBox=pt,R.AcroFormComboBox=gt,R.AcroFormEditBox=mt,R.AcroFormButton=vt,R.AcroFormPushButton=bt,R.AcroFormRadioButton=yt,R.AcroFormCheckBox=Nt,R.AcroFormTextField=Lt,R.AcroFormPasswordField=xt,R.AcroFormAppearance=At,R.AcroForm={ChoiceField:dt,ListBox:pt,ComboBox:gt,EditBox:mt,Button:vt,PushButton:bt,RadioButton:yt,CheckBox:Nt,TextField:Lt,PasswordField:xt,Appearance:At},E.AcroForm={ChoiceField:dt,ListBox:pt,ComboBox:gt,EditBox:mt,Button:vt,PushButton:bt,RadioButton:yt,CheckBox:Nt,TextField:Lt,PasswordField:xt,Appearance:At};E.AcroForm;function Pt(Ee){return Ee.reduce(function(Re,Te,je){return Re[Te]=je,Re},{})}(function(Ee){var Re="addImage_";Ee.__addimage__={};var Te="UNKNOWN",je={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},Oe=Ee.__addimage__.getImageFileTypeByImageData=function(tr,nr){var hr,sr,xr,Rr,br,wr=Te;if((nr=nr||Te)==="RGBA"||tr.data!==void 0&&tr.data instanceof Uint8ClampedArray&&"height"in tr&&"width"in tr)return"RGBA";if(ir(tr))for(br in je)for(xr=je[br],hr=0;hr<xr.length;hr+=1){for(Rr=!0,sr=0;sr<xr[hr].length;sr+=1)if(xr[hr][sr]!==void 0&&xr[hr][sr]!==tr[sr]){Rr=!1;break}if(Rr===!0){wr=br;break}}else for(br in je)for(xr=je[br],hr=0;hr<xr.length;hr+=1){for(Rr=!0,sr=0;sr<xr[hr].length;sr+=1)if(xr[hr][sr]!==void 0&&xr[hr][sr]!==tr.charCodeAt(sr)){Rr=!1;break}if(Rr===!0){wr=br;break}}return wr===Te&&nr!==Te&&(wr=nr),wr},Me=function tr(nr){for(var hr=this.internal.write,sr=this.internal.putStream,xr=(0,this.internal.getFilters)();xr.indexOf("FlateEncode")!==-1;)xr.splice(xr.indexOf("FlateEncode"),1);nr.objectId=this.internal.newObject();var Rr=[];if(Rr.push({key:"Type",value:"/XObject"}),Rr.push({key:"Subtype",value:"/Image"}),Rr.push({key:"Width",value:nr.width}),Rr.push({key:"Height",value:nr.height}),nr.colorSpace===Ve.INDEXED?Rr.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(nr.palette.length/3-1)+" "+("sMask"in nr&&nr.sMask!==void 0?nr.objectId+2:nr.objectId+1)+" 0 R]"}):(Rr.push({key:"ColorSpace",value:"/"+nr.colorSpace}),nr.colorSpace===Ve.DEVICE_CMYK&&Rr.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),Rr.push({key:"BitsPerComponent",value:nr.bitsPerComponent}),"decodeParameters"in nr&&nr.decodeParameters!==void 0&&Rr.push({key:"DecodeParms",value:"<<"+nr.decodeParameters+">>"}),"transparency"in nr&&Array.isArray(nr.transparency)&&nr.transparency.length>0){for(var br="",wr=0,vr=nr.transparency.length;wr<vr;wr++)br+=nr.transparency[wr]+" "+nr.transparency[wr]+" ";Rr.push({key:"Mask",value:"["+br+"]"})}nr.sMask!==void 0&&Rr.push({key:"SMask",value:nr.objectId+1+" 0 R"});var Dr=nr.filter!==void 0?["/"+nr.filter]:void 0;if(sr({data:nr.data,additionalKeyValues:Rr,alreadyAppliedFilters:Dr,objectId:nr.objectId}),hr("endobj"),"sMask"in nr&&nr.sMask!==void 0){var kr,cr=(kr=nr.sMaskBitsPerComponent)!==null&&kr!==void 0?kr:nr.bitsPerComponent,dr={width:nr.width,height:nr.height,colorSpace:"DeviceGray",bitsPerComponent:cr,data:nr.sMask};"filter"in nr&&(dr.decodeParameters="/Predictor ".concat(nr.predictor," /Colors 1 /BitsPerComponent ").concat(cr," /Columns ").concat(nr.width),dr.filter=nr.filter),tr.call(this,dr)}if(nr.colorSpace===Ve.INDEXED){var ur=this.internal.newObject();sr({data:ar(new Uint8Array(nr.palette)),objectId:ur}),hr("endobj")}},De=function(){var tr=this.internal.collections[Re+"images"];for(var nr in tr)Me.call(this,tr[nr])},$e=function(){var tr,nr=this.internal.collections[Re+"images"],hr=this.internal.write;for(var sr in nr)hr("/I"+(tr=nr[sr]).index,tr.objectId,"0","R")},Be=function(){this.internal.collections[Re+"images"]||(this.internal.collections[Re+"images"]={},this.internal.events.subscribe("putResources",De),this.internal.events.subscribe("putXobjectDict",$e))},Ue=function(){var tr=this.internal.collections[Re+"images"];return Be.call(this),tr},ze=function(){return Object.keys(this.internal.collections[Re+"images"]).length},We=function(tr){return typeof Ee["process"+tr.toUpperCase()]=="function"},Xe=function(tr){return _typeof(tr)==="object"&&tr.nodeType===1},He=function(tr,nr){if(tr.nodeName==="IMG"&&tr.hasAttribute("src")){var hr=""+tr.getAttribute("src");if(hr.indexOf("data:image/")===0)return f(unescape(hr).split("base64,").pop());var sr=Ee.loadFile(hr,!0);if(sr!==void 0)return sr}if(tr.nodeName==="CANVAS"){if(tr.width===0||tr.height===0)throw new Error("Given canvas must have data. Canvas width: "+tr.width+", height: "+tr.height);var xr;switch(nr){case"PNG":xr="image/png";break;case"WEBP":xr="image/webp";break;default:xr="image/jpeg"}return f(tr.toDataURL(xr,1).split("base64,").pop())}},qe=function(tr){var nr=this.internal.collections[Re+"images"];if(nr){for(var hr in nr)if(tr===nr[hr].alias)return nr[hr]}},Ge=function(tr,nr,hr){return tr||nr||(tr=-96,nr=-96),tr<0&&(tr=-1*hr.width*72/tr/this.internal.scaleFactor),nr<0&&(nr=-1*hr.height*72/nr/this.internal.scaleFactor),tr===0&&(tr=nr*hr.width/hr.height),nr===0&&(nr=tr*hr.height/hr.width),[tr,nr]},Ye=function(tr,nr,hr,sr,xr,Rr){var br=Ge.call(this,hr,sr,xr),wr=this.internal.getCoordinateString,vr=this.internal.getVerticalCoordinateString,Dr=Ue.call(this);if(hr=br[0],sr=br[1],Dr[xr.index]=xr,Rr){Rr*=Math.PI/180;var kr=Math.cos(Rr),cr=Math.sin(Rr),dr=function(gr){return gr.toFixed(4)},ur=[dr(kr),dr(cr),dr(-1*cr),dr(kr),0,0,"cm"]}this.internal.write("q"),Rr?(this.internal.write([1,"0","0",1,wr(tr),vr(nr+sr),"cm"].join(" ")),this.internal.write(ur.join(" ")),this.internal.write([wr(hr),"0","0",wr(sr),"0","0","cm"].join(" "))):this.internal.write([wr(hr),"0","0",wr(sr),wr(tr),vr(nr+sr),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+xr.index+" Do"),this.internal.write("Q")},Ve=Ee.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};Ee.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var Ke=Ee.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},Qe=Ee.__addimage__.sHashCode=function(tr){var nr,hr,sr=0;if(typeof tr=="string")for(hr=tr.length,nr=0;nr<hr;nr++)sr=(sr<<5)-sr+tr.charCodeAt(nr),sr|=0;else if(ir(tr))for(hr=tr.byteLength/2,nr=0;nr<hr;nr++)sr=(sr<<5)-sr+tr[nr],sr|=0;return sr},Ze=Ee.__addimage__.validateStringAsBase64=function(tr){(tr=tr||"").toString().trim();var nr=!0;return tr.length===0&&(nr=!1),tr.length%4!=0&&(nr=!1),/^[A-Za-z0-9+/]+$/.test(tr.substr(0,tr.length-2))===!1&&(nr=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(tr.substr(-2))===!1&&(nr=!1),nr},Je=Ee.__addimage__.extractImageFromDataUrl=function(tr){if(tr==null||!(tr=tr.trim()).startsWith("data:"))return null;var nr=tr.indexOf(",");return nr<0?null:tr.substring(0,nr).trim().endsWith("base64")?tr.substring(nr+1):null};Ee.__addimage__.isArrayBuffer=function(tr){return tr instanceof ArrayBuffer};var ir=Ee.__addimage__.isArrayBufferView=function(tr){return tr instanceof Int8Array||tr instanceof Uint8Array||tr instanceof Uint8ClampedArray||tr instanceof Int16Array||tr instanceof Uint16Array||tr instanceof Int32Array||tr instanceof Uint32Array||tr instanceof Float32Array||tr instanceof Float64Array},rr=Ee.__addimage__.binaryStringToUint8Array=function(tr){for(var nr=tr.length,hr=new Uint8Array(nr),sr=0;sr<nr;sr++)hr[sr]=tr.charCodeAt(sr);return hr},ar=Ee.__addimage__.arrayBufferToBinaryString=function(tr){for(var nr="",hr=ir(tr)?tr:new Uint8Array(tr),sr=0;sr<hr.length;sr+=8192)nr+=String.fromCharCode.apply(null,hr.subarray(sr,sr+8192));return nr};Ee.addImage=function(){var tr,nr,hr,sr,xr,Rr,br,wr,vr;if(typeof arguments[1]=="number"?(nr=Te,hr=arguments[1],sr=arguments[2],xr=arguments[3],Rr=arguments[4],br=arguments[5],wr=arguments[6],vr=arguments[7]):(nr=arguments[1],hr=arguments[2],sr=arguments[3],xr=arguments[4],Rr=arguments[5],br=arguments[6],wr=arguments[7],vr=arguments[8]),_typeof(tr=arguments[0])==="object"&&!Xe(tr)&&"imageData"in tr){var Dr=tr;tr=Dr.imageData,nr=Dr.format||nr||Te,hr=Dr.x||hr||0,sr=Dr.y||sr||0,xr=Dr.w||Dr.width||xr,Rr=Dr.h||Dr.height||Rr,br=Dr.alias||br,wr=Dr.compression||wr,vr=Dr.rotation||Dr.angle||vr}var kr=this.internal.getFilters();if(wr===void 0&&kr.indexOf("FlateEncode")!==-1&&(wr="SLOW"),isNaN(hr)||isNaN(sr))throw new Error("Invalid coordinates passed to jsPDF.addImage");Be.call(this);var cr=or.call(this,tr,nr,br,wr);return Ye.call(this,hr,sr,xr,Rr,cr,vr),this};var or=function(tr,nr,hr,sr){var xr,Rr,br;if(typeof tr=="string"&&Oe(tr)===Te){tr=unescape(tr);var wr=pr(tr,!1);(wr!==""||(wr=Ee.loadFile(tr,!0))!==void 0)&&(tr=wr)}if(Xe(tr)&&(tr=He(tr,nr)),nr=Oe(tr,nr),!We(nr))throw new Error("addImage does not support files of type '"+nr+"', please ensure that a plugin for '"+nr+"' support is added.");if(((br=hr)==null||br.length===0)&&(hr=function(vr){return typeof vr=="string"||ir(vr)?Qe(vr):ir(vr.data)?Qe(vr.data):null}(tr)),(xr=qe.call(this,hr))||(tr instanceof Uint8Array||nr==="RGBA"||(Rr=tr,tr=rr(tr)),xr=this["process"+nr.toUpperCase()](tr,ze.call(this),hr,function(vr){return vr&&typeof vr=="string"&&(vr=vr.toUpperCase()),vr in Ee.image_compression?vr:Ke.NONE}(sr),Rr)),!xr)throw new Error("An unknown error occurred whilst processing the image.");return xr},pr=Ee.__addimage__.convertBase64ToBinaryString=function(tr,nr){nr=typeof nr!="boolean"||nr;var hr,sr="";if(typeof tr=="string"){var xr;hr=(xr=Je(tr))!==null&&xr!==void 0?xr:tr;try{sr=f(hr)}catch(Rr){if(nr)throw Ze(hr)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+Rr.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return sr};Ee.getImageProperties=function(tr){var nr,hr,sr="";if(Xe(tr)&&(tr=He(tr)),typeof tr=="string"&&Oe(tr)===Te&&((sr=pr(tr,!1))===""&&(sr=Ee.loadFile(tr)||""),tr=sr),hr=Oe(tr),!We(hr))throw new Error("addImage does not support files of type '"+hr+"', please ensure that a plugin for '"+hr+"' support is added.");if(tr instanceof Uint8Array||(tr=rr(tr)),!(nr=this["process"+hr.toUpperCase()](tr)))throw new Error("An unknown error occurred whilst processing the image");return nr.fileType=hr,nr}})(E.API),function(Ee){var Re=function(Te){if(Te!==void 0&&Te!="")return!0};E.API.events.push(["addPage",function(Te){this.internal.getPageInfo(Te.pageNumber).pageContext.annotations=[]}]),Ee.events.push(["putPage",function(Te){for(var je,Oe,Me,De=this.internal.getCoordinateString,$e=this.internal.getVerticalCoordinateString,Be=this.internal.getPageInfoByObjId(Te.objId),Ue=Te.pageContext.annotations,ze=!1,We=0;We<Ue.length&&!ze;We++)switch((je=Ue[We]).type){case"link":(Re(je.options.url)||Re(je.options.pageNumber))&&(ze=!0);break;case"reference":case"text":case"freetext":ze=!0}if(ze!=0){this.internal.write("/Annots [");for(var Xe=0;Xe<Ue.length;Xe++){je=Ue[Xe];var He=this.internal.pdfEscape,qe=this.internal.getEncryptor(Te.objId);switch(je.type){case"reference":this.internal.write(" "+je.object.objId+" 0 R ");break;case"text":var Ge=this.internal.newAdditionalObject(),Ye=this.internal.newAdditionalObject(),Ve=this.internal.getEncryptor(Ge.objId),Ke=je.title||"Note";Me="<</Type /Annot /Subtype /Text "+(Oe="/Rect ["+De(je.bounds.x)+" "+$e(je.bounds.y+je.bounds.h)+" "+De(je.bounds.x+je.bounds.w)+" "+$e(je.bounds.y)+"] ")+"/Contents ("+He(Ve(je.contents))+")",Me+=" /Popup "+Ye.objId+" 0 R",Me+=" /P "+Be.objId+" 0 R",Me+=" /T ("+He(Ve(Ke))+") >>",Ge.content=Me;var Qe=Ge.objId+" 0 R";Me="<</Type /Annot /Subtype /Popup "+(Oe="/Rect ["+De(je.bounds.x+30)+" "+$e(je.bounds.y+je.bounds.h)+" "+De(je.bounds.x+je.bounds.w+30)+" "+$e(je.bounds.y)+"] ")+" /Parent "+Qe,je.open&&(Me+=" /Open true"),Me+=" >>",Ye.content=Me,this.internal.write(Ge.objId,"0 R",Ye.objId,"0 R");break;case"freetext":Oe="/Rect ["+De(je.bounds.x)+" "+$e(je.bounds.y)+" "+De(je.bounds.x+je.bounds.w)+" "+$e(je.bounds.y+je.bounds.h)+"] ";var Ze="font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+(je.color||"#000000");Me="<</Type /Annot /Subtype /FreeText "+Oe+"/Contents ("+He(qe(je.contents))+")",Me+=" /DS("+He(qe(Ze))+")",Me+=" /Border [0 0 0]",Me+=" >>",this.internal.write(Me);break;case"link":if(je.options.name){var Je=this.annotations._nameMap[je.options.name];je.options.pageNumber=Je.page,je.options.top=Je.y}else je.options.top||(je.options.top=0);if(Oe="/Rect ["+je.finalBounds.x+" "+je.finalBounds.y+" "+je.finalBounds.w+" "+je.finalBounds.h+"] ",Me="",je.options.url)Me="<</Type /Annot /Subtype /Link "+Oe+"/Border [0 0 0] /A <</S /URI /URI ("+He(qe(je.options.url))+") >>";else if(je.options.pageNumber)switch(Me="<</Type /Annot /Subtype /Link "+Oe+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(je.options.pageNumber).objId+" 0 R",je.options.magFactor=je.options.magFactor||"XYZ",je.options.magFactor){case"Fit":Me+=" /Fit]";break;case"FitH":Me+=" /FitH "+je.options.top+"]";break;case"FitV":je.options.left=je.options.left||0,Me+=" /FitV "+je.options.left+"]";break;default:var ir=$e(je.options.top);je.options.left=je.options.left||0,je.options.zoom===void 0&&(je.options.zoom=0),Me+=" /XYZ "+je.options.left+" "+ir+" "+je.options.zoom+"]"}Me!=""&&(Me+=" >>",this.internal.write(Me))}}this.internal.write("]")}}]),Ee.createAnnotation=function(Te){var je=this.internal.getCurrentPageInfo();switch(Te.type){case"link":this.link(Te.bounds.x,Te.bounds.y,Te.bounds.w,Te.bounds.h,Te);break;case"text":case"freetext":je.pageContext.annotations.push(Te)}},Ee.link=function(Te,je,Oe,Me,De){var $e=this.internal.getCurrentPageInfo(),Be=this.internal.getCoordinateString,Ue=this.internal.getVerticalCoordinateString;$e.pageContext.annotations.push({finalBounds:{x:Be(Te),y:Ue(je),w:Be(Te+Oe),h:Ue(je+Me)},options:De,type:"link"})},Ee.textWithLink=function(Te,je,Oe,Me){var De,$e,Be=this.getTextWidth(Te),Ue=this.internal.getLineHeight()/this.internal.scaleFactor;if(Me.maxWidth!==void 0){$e=Me.maxWidth;var ze=this.splitTextToSize(Te,$e).length;De=Math.ceil(Ue*ze)}else $e=Be,De=Ue;return this.text(Te,je,Oe,Me),Oe+=.2*Ue,Me.align==="center"&&(je-=Be/2),Me.align==="right"&&(je-=Be),this.link(je,Oe-Ue,$e,De,Me),Be},Ee.getTextWidth=function(Te){var je=this.internal.getFontSize();return this.getStringUnitWidth(Te)*je/this.internal.scaleFactor}}(E.API),function(Ee){var Re={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},Te={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},je={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},Oe=[1570,1571,1573,1575];Ee.__arabicParser__={};var Me=Ee.__arabicParser__.isInArabicSubstitutionA=function(Ge){return Re[Ge.charCodeAt(0)]!==void 0},De=Ee.__arabicParser__.isArabicLetter=function(Ge){return typeof Ge=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(Ge)},$e=Ee.__arabicParser__.isArabicEndLetter=function(Ge){return De(Ge)&&Me(Ge)&&Re[Ge.charCodeAt(0)].length<=2},Be=Ee.__arabicParser__.isArabicAlfLetter=function(Ge){return De(Ge)&&Oe.indexOf(Ge.charCodeAt(0))>=0};Ee.__arabicParser__.arabicLetterHasIsolatedForm=function(Ge){return De(Ge)&&Me(Ge)&&Re[Ge.charCodeAt(0)].length>=1};var Ue=Ee.__arabicParser__.arabicLetterHasFinalForm=function(Ge){return De(Ge)&&Me(Ge)&&Re[Ge.charCodeAt(0)].length>=2};Ee.__arabicParser__.arabicLetterHasInitialForm=function(Ge){return De(Ge)&&Me(Ge)&&Re[Ge.charCodeAt(0)].length>=3};var ze=Ee.__arabicParser__.arabicLetterHasMedialForm=function(Ge){return De(Ge)&&Me(Ge)&&Re[Ge.charCodeAt(0)].length==4},We=Ee.__arabicParser__.resolveLigatures=function(Ge){var Ye=0,Ve=Te,Ke="",Qe=0;for(Ye=0;Ye<Ge.length;Ye+=1)Ve[Ge.charCodeAt(Ye)]!==void 0?(Qe++,typeof(Ve=Ve[Ge.charCodeAt(Ye)])=="number"&&(Ke+=String.fromCharCode(Ve),Ve=Te,Qe=0),Ye===Ge.length-1&&(Ve=Te,Ke+=Ge.charAt(Ye-(Qe-1)),Ye-=Qe-1,Qe=0)):(Ve=Te,Ke+=Ge.charAt(Ye-Qe),Ye-=Qe,Qe=0);return Ke};Ee.__arabicParser__.isArabicDiacritic=function(Ge){return Ge!==void 0&&je[Ge.charCodeAt(0)]!==void 0};var Xe=Ee.__arabicParser__.getCorrectForm=function(Ge,Ye,Ve){return De(Ge)?Me(Ge)===!1?-1:!Ue(Ge)||!De(Ye)&&!De(Ve)||!De(Ve)&&$e(Ye)||$e(Ge)&&!De(Ye)||$e(Ge)&&Be(Ye)||$e(Ge)&&$e(Ye)?0:ze(Ge)&&De(Ye)&&!$e(Ye)&&De(Ve)&&Ue(Ve)?3:$e(Ge)||!De(Ve)?1:2:-1},He=function(Ge){var Ye=0,Ve=0,Ke=0,Qe="",Ze="",Je="",ir=(Ge=Ge||"").split("\\s+"),rr=[];for(Ye=0;Ye<ir.length;Ye+=1){for(rr.push(""),Ve=0;Ve<ir[Ye].length;Ve+=1)Qe=ir[Ye][Ve],Ze=ir[Ye][Ve-1],Je=ir[Ye][Ve+1],De(Qe)?(Ke=Xe(Qe,Ze,Je),rr[Ye]+=Ke!==-1?String.fromCharCode(Re[Qe.charCodeAt(0)][Ke]):Qe):rr[Ye]+=Qe;rr[Ye]=We(rr[Ye])}return rr.join(" ")},qe=Ee.__arabicParser__.processArabic=Ee.processArabic=function(){var Ge,Ye=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,Ve=[];if(Array.isArray(Ye)){var Ke=0;for(Ve=[],Ke=0;Ke<Ye.length;Ke+=1)Array.isArray(Ye[Ke])?Ve.push([He(Ye[Ke][0]),Ye[Ke][1],Ye[Ke][2]]):Ve.push([He(Ye[Ke])]);Ge=Ve}else Ge=He(Ye);return typeof arguments[0]=="string"?Ge:(arguments[0].text=Ge,arguments[0])};Ee.events.push(["preProcessText",qe])}(E.API),E.API.autoPrint=function(Ee){var Re;return(Ee=Ee||{}).variant=Ee.variant||"non-conform",Ee.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){Re=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+Re+" 0 R")})),this},function(Ee){var Re=function(){var Te=void 0;Object.defineProperty(this,"pdf",{get:function(){return Te},set:function($e){Te=$e}});var je=150;Object.defineProperty(this,"width",{get:function(){return je},set:function($e){je=isNaN($e)||Number.isInteger($e)===!1||$e<0?150:$e,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=je+1)}});var Oe=300;Object.defineProperty(this,"height",{get:function(){return Oe},set:function($e){Oe=isNaN($e)||Number.isInteger($e)===!1||$e<0?300:$e,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=Oe+1)}});var Me=[];Object.defineProperty(this,"childNodes",{get:function(){return Me},set:function($e){Me=$e}});var De={};Object.defineProperty(this,"style",{get:function(){return De},set:function($e){De=$e}}),Object.defineProperty(this,"parentNode",{})};Re.prototype.getContext=function(Te,je){var Oe;if((Te=Te||"2d")!=="2d")return null;for(Oe in je)this.pdf.context2d.hasOwnProperty(Oe)&&(this.pdf.context2d[Oe]=je[Oe]);return this.pdf.context2d._canvas=this,this.pdf.context2d},Re.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},Ee.events.push(["initialized",function(){this.canvas=new Re,this.canvas.pdf=this}])}(E.API),function(Ee){var Re={left:0,top:0,bottom:0,right:0},Te=!1,je=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},Re),this.internal.__cell__.margins.width=this.getPageWidth(),Oe.call(this))},Oe=function(){this.internal.__cell__.lastCell=new Me,this.internal.__cell__.pages=1},Me=function(){var Be=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return Be},set:function(Ge){Be=Ge}});var Ue=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Ue},set:function(Ge){Ue=Ge}});var ze=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return ze},set:function(Ge){ze=Ge}});var We=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return We},set:function(Ge){We=Ge}});var Xe=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return Xe},set:function(Ge){Xe=Ge}});var He=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return He},set:function(Ge){He=Ge}});var qe=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return qe},set:function(Ge){qe=Ge}}),this};Me.prototype.clone=function(){return new Me(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},Me.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},Ee.setHeaderFunction=function(Be){return je.call(this),this.internal.__cell__.headerFunction=typeof Be=="function"?Be:void 0,this},Ee.getTextDimensions=function(Be,Ue){je.call(this);var ze=(Ue=Ue||{}).fontSize||this.getFontSize(),We=Ue.font||this.getFont(),Xe=Ue.scaleFactor||this.internal.scaleFactor,He=0,qe=0,Ge=0,Ye=this;if(!Array.isArray(Be)&&typeof Be!="string"){if(typeof Be!="number")throw new Error("getTextDimensions expects text-parameter to be of type Str
4117ing or type Number or an Array of Strings.");Be=String(Be)}var Ve=Ue.maxWidth;Ve>0?typeof Be=="string"?Be=this.splitTextToSize(Be,Ve):Object.prototype.toString.call(Be)==="[object Array]"&&(Be=Be.reduce(function(Qe,Ze){return Qe.concat(Ye.splitTextToSize(Ze,Ve))},[])):Be=Array.isArray(Be)?Be:[Be];for(var Ke=0;Ke<Be.length;Ke++)He<(Ge=this.getStringUnitWidth(Be[Ke],{font:We})*ze)&&(He=Ge);return He!==0&&(qe=Be.length),{w:He/=Xe,h:Math.max((qe*ze*this.getLineHeightFactor()-ze*(this.getLineHeightFactor()-1))/Xe,0)}},Ee.cellAddPage=function(){je.call(this),this.addPage();var Be=this.internal.__cell__.margins||Re;return this.internal.__cell__.lastCell=new Me(Be.left,Be.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var De=Ee.cell=function(){var Be;Be=arguments[0]instanceof Me?arguments[0]:new Me(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),je.call(this);var Ue=this.internal.__cell__.lastCell,ze=this.internal.__cell__.padding,We=this.internal.__cell__.margins||Re,Xe=this.internal.__cell__.tableHeaderRow,He=this.internal.__cell__.printHeaders;return Ue.lineNumber!==void 0&&(Ue.lineNumber===Be.lineNumber?(Be.x=(Ue.x||0)+(Ue.width||0),Be.y=Ue.y||0):Ue.y+Ue.height+Be.height+We.bottom>this.getPageHeight()?(this.cellAddPage(),Be.y=We.top,He&&Xe&&(this.printHeaderRow(Be.lineNumber,!0),Be.y+=Xe[0].height)):Be.y=Ue.y+Ue.height||Be.y),Be.text[0]!==void 0&&(this.rect(Be.x,Be.y,Be.width,Be.height,Te===!0?"FD":void 0),Be.align==="right"?this.text(Be.text,Be.x+Be.width-ze,Be.y+ze,{align:"right",baseline:"top"}):Be.align==="center"?this.text(Be.text,Be.x+Be.width/2,Be.y+ze,{align:"center",baseline:"top",maxWidth:Be.width-ze-ze}):this.text(Be.text,Be.x+ze,Be.y+ze,{align:"left",baseline:"top",maxWidth:Be.width-ze-ze})),this.internal.__cell__.lastCell=Be,this};Ee.table=function(Be,Ue,ze,We,Xe){if(je.call(this),!ze)throw new Error("No data for PDF table.");var He,qe,Ge,Ye,Ve=[],Ke=[],Qe=[],Ze={},Je={},ir=[],rr=[],ar=(Xe=Xe||{}).autoSize||!1,or=Xe.printHeaders!==!1,pr=Xe.css&&Xe.css["font-size"]!==void 0?16*Xe.css["font-size"]:Xe.fontSize||12,tr=Xe.margins||Object.assign({width:this.getPageWidth()},Re),nr=typeof Xe.padding=="number"?Xe.padding:3,hr=Xe.headerBackgroundColor||"#c8c8c8",sr=Xe.headerTextColor||"#000";if(Oe.call(this),this.internal.__cell__.printHeaders=or,this.internal.__cell__.margins=tr,this.internal.__cell__.table_font_size=pr,this.internal.__cell__.padding=nr,this.internal.__cell__.headerBackgroundColor=hr,this.internal.__cell__.headerTextColor=sr,this.setFontSize(pr),We==null)Ke=Ve=Object.keys(ze[0]),Qe=Ve.map(function(){return"left"});else if(Array.isArray(We)&&_typeof(We[0])==="object")for(Ve=We.map(function(Dr){return Dr.name}),Ke=We.map(function(Dr){return Dr.prompt||Dr.name||""}),Qe=We.map(function(Dr){return Dr.align||"left"}),He=0;He<We.length;He+=1)Je[We[He].name]=.7499990551181103*We[He].width;else Array.isArray(We)&&typeof We[0]=="string"&&(Ke=Ve=We,Qe=Ve.map(function(){return"left"}));if(ar||Array.isArray(We)&&typeof We[0]=="string")for(He=0;He<Ve.length;He+=1){for(Ze[Ye=Ve[He]]=ze.map(function(Dr){return Dr[Ye]}),this.setFont(void 0,"bold"),ir.push(this.getTextDimensions(Ke[He],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),qe=Ze[Ye],this.setFont(void 0,"normal"),Ge=0;Ge<qe.length;Ge+=1)ir.push(this.getTextDimensions(qe[Ge],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);Je[Ye]=Math.max.apply(null,ir)+nr+nr,ir=[]}if(or){var xr={};for(He=0;He<Ve.length;He+=1)xr[Ve[He]]={},xr[Ve[He]].text=Ke[He],xr[Ve[He]].align=Qe[He];var Rr=$e.call(this,xr,Je);rr=Ve.map(function(Dr){return new Me(Be,Ue,Je[Dr],Rr,xr[Dr].text,void 0,xr[Dr].align)}),this.setTableHeaderRow(rr),this.printHeaderRow(1,!1)}var br=We.reduce(function(Dr,kr){return Dr[kr.name]=kr.align,Dr},{});for(He=0;He<ze.length;
vendor: 44,777 bytes, lines 4117-4154
4117He+=1){"rowStart"in Xe&&Xe.rowStart instanceof Function&&Xe.rowStart({row:He,data:ze[He]},this);var wr=$e.call(this,ze[He],Je);for(Ge=0;Ge<Ve.length;Ge+=1){var vr=ze[He][Ve[Ge]];"cellStart"in Xe&&Xe.cellStart instanceof Function&&Xe.cellStart({row:He,col:Ge,data:vr},this),De.call(this,new Me(Be,Ue,Je[Ve[Ge]],wr,vr,He+2,br[Ve[Ge]]))}}return this.internal.__cell__.table_x=Be,this.internal.__cell__.table_y=Ue,this};var $e=function(Be,Ue){var ze=this.internal.__cell__.padding,We=this.internal.__cell__.table_font_size,Xe=this.internal.scaleFactor;return Object.keys(Be).map(function(He){var qe=Be[He];return this.splitTextToSize(qe.hasOwnProperty("text")?qe.text:qe,Ue[He]-ze-ze)},this).map(function(He){return this.getLineHeightFactor()*He.length*We/Xe+ze+ze},this).reduce(function(He,qe){return Math.max(He,qe)},0)};Ee.setTableHeaderRow=function(Be){je.call(this),this.internal.__cell__.tableHeaderRow=Be},Ee.printHeaderRow=function(Be,Ue){if(je.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var ze;if(Te=!0,typeof this.internal.__cell__.headerFunction=="function"){var We=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new Me(We[0],We[1],We[2],We[3],void 0,-1)}this.setFont(void 0,"bold");for(var Xe=[],He=0;He<this.internal.__cell__.tableHeaderRow.length;He+=1){ze=this.internal.__cell__.tableHeaderRow[He].clone(),Ue&&(ze.y=this.internal.__cell__.margins.top||0,Xe.push(ze)),ze.lineNumber=Be;var qe=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),De.call(this,ze),this.setTextColor(qe)}Xe.length>0&&this.setTableHeaderRow(Xe),this.setFont(void 0,"normal"),Te=!1}}(E.API);var kt={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Ft=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],It=Pt(Ft),Ct=[100,200,300,400,500,600,700,800,900],jt=Pt(Ct);function Ot(Ee){var Re=Ee.family.replace(/"|'/g,"").toLowerCase(),Te=function(Me){return kt[Me=Me||"normal"]?Me:"normal"}(Ee.style),je=function(Me){return Me?typeof Me=="number"?Me>=100&&Me<=900&&Me%100==0?Me:400:/^\d00$/.test(Me)?parseInt(Me):Me==="bold"?700:400:400}(Ee.weight),Oe=function(Me){return typeof It[Me=Me||"normal"]=="number"?Me:"normal"}(Ee.stretch);return{family:Re,style:Te,weight:je,stretch:Oe,src:Ee.src||[],ref:Ee.ref||{name:Re,style:[Oe,Te,je].join(" ")}}}function Bt(Ee,Re,Te,je){var Oe;for(Oe=Te;Oe>=0&&Oe<Re.length;Oe+=je)if(Ee[Re[Oe]])return Ee[Re[Oe]];for(Oe=Te;Oe>=0&&Oe<Re.length;Oe-=je)if(Ee[Re[Oe]])return Ee[Re[Oe]]}var Mt={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},qt={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Et(Ee){return[Ee.stretch,Ee.style,Ee.weight,Ee.family].join(" ")}function Rt(Ee){return Ee.trimLeft()}function Dt(Ee,Re){for(var Te=0;Te<Ee.length;){if(Ee.charAt(Te)===Re)return[Ee.substring(0,Te),Ee.substring(Te+1)];Te+=1}return null}function Tt(Ee){var Re=Ee.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return Re===null?null:[Re[0],Ee.substring(Re[0].length)]}var zt,Ut,Ht,Wt,Vt,Gt=["times"];function Yt(Ee,Re,Te,je,Oe){var Me=4,De=Kt;switch(Oe){case E.API.image_compression.FAST:Me=1,De=Xt;break;case E.API.image_compression.MEDIUM:Me=6,De=Zt;break;case E.API.image_compression.SLOW:Me=9,De=$t}Ee=function(Be,Ue,ze,We){for(var Xe,He=Be.length/Ue,qe=new Uint8Array(Be.length+He),Ge=[Jt,Xt,Kt,Zt,$t],Ye=0;Ye<He;Ye+=1){var Ve=Ye*Ue,Ke=Be.subarray(Ve,Ve+Ue);if(We)qe.set(We(Ke,ze,Xe),Ve+Ye);else{for(var Qe=Ge.length,Ze=[],Je=0;Je<Qe;Je+=1)Ze[Je]=Ge[Je](Ke,ze,Xe);var ir=te(Ze.concat());qe.set(Ze[ir],Ve+Ye)}Xe=Ke}return qe}(Ee,Re,Math.ceil(Te*je/8),De);var $e=zlibSync(Ee,{level:Me});return E.API.__addimage__.arrayBufferToBinaryString($e)}function Jt(Ee){var Re=Array.apply([],Ee);return Re.unshift(0),Re}function Xt(Ee,Re){var Te=Ee.length,je=[];je[0]=1;for(var Oe=0;Oe<Te;Oe+=1){var Me=Ee[Oe-Re]||0;je[Oe+1]=Ee[Oe]-Me+256&255}return je}function Kt(Ee,Re,Te){var je=Ee.length,Oe=[];Oe[0]=2;for(var Me=0;Me<je;Me+=1){var De=Te&&Te[Me]||0;Oe[Me+1]=Ee[Me]-De+256&255}return Oe}function Zt(Ee,Re,Te){var je=Ee.length,Oe=[];Oe[0]=3;for(var Me=0;Me<je;Me+=1){var De=Ee[Me-Re]||0,$e=Te&&Te[Me]||0;Oe[Me+1]=Ee[Me]+256-(De+$e>>>1)&255}return Oe}function $t(Ee,Re,Te){var je=Ee.length,Oe=[];Oe[0]=4;for(var Me=0;Me<je;Me+=1){var De=Qt(Ee[Me-Re]||0,Te&&Te[Me]||0,Te&&Te[Me-Re]||0);Oe[Me+1]=Ee[Me]-De+256&255}return Oe}function Qt(Ee,Re,Te){if(Ee===Re&&Re===Te)return Ee;var je=Math.abs(Re-Te),Oe=Math.abs(Ee-Te),Me=Math.abs(Ee+Re-Te-Te);return je<=Oe&&je<=Me?Ee:Oe<=Me?Re:Te}function te(Ee){var Re=Ee.map(function(Te){return Te.reduce(function(je,Oe){return je+Math.abs(Oe)},0)});return Re.indexOf(Math.min.apply(null,Re))}function ee(Ee,Re,Te){var je=Re*Te,Oe=Math.floor(je/8),Me=16-(je-8*Oe+Te),De=(1<<Te)-1;return ne(Ee,Oe)>>Me&De}function re(Ee,Re,Te,je){var Oe=Te*je,Me=Math.floor(Oe/8),De=16-(Oe-8*Me+je),$e=(1<<je)-1,Be=(Re&$e)<<De;(function(Ue,ze,We){if(ze+1<Ue.byteLength)Ue.setUint16(ze,We,!1);else{var Xe=We>>8&255;Ue.setUint8(ze,Xe)}})(Ee,Me,ne(Ee,Me)&~($e<<De)&65535|Be)}function ne(Ee,Re){return Re+1<Ee.byteLength?Ee.getUint16(Re,!1):Ee.getUint8(Re)<<8}function ie(Ee){var Re=0;if(Ee[Re++]!==71||Ee[Re++]!==73||Ee[Re++]!==70||Ee[Re++]!==56||(Ee[Re++]+1&253)!=56||Ee[Re++]!==97)throw new Error("Invalid GIF 87a/89a header.");var Te=Ee[Re++]|Ee[Re++]<<8,je=Ee[Re++]|Ee[Re++]<<8,Oe=Ee[Re++],Me=Oe>>7,De=1<<1+(7&Oe);Ee[Re++],Ee[Re++];var $e=null,Be=null;Me&&($e=Re,Be=De,Re+=3*De);var Ue=!0,ze=[],We=0,Xe=null,He=0,qe=null;for(this.width=Te,this.height=je;Ue&&Re<Ee.length;)switch(Ee[Re++]){case 33:switch(Ee[Re++]){case 255:if(Ee[Re]!==11||Ee[Re+1]==78&&Ee[Re+2]==69&&Ee[Re+3]==84&&Ee[Re+4]==83&&Ee[Re+5]==67&&Ee[Re+6]==65&&Ee[Re+7]==80&&Ee[Re+8]==69&&Ee[Re+9]==50&&Ee[Re+10]==46&&Ee[Re+11]==48&&Ee[Re+12]==3&&Ee[Re+13]==1&&Ee[Re+16]==0)Re+=14,qe=Ee[Re++]|Ee[Re++]<<8,Re++;else for(Re+=12;;){if(!((tr=Ee[Re++])>=0))throw Error("Invalid block size");if(tr===0)break;Re+=tr}break;case 249:if(Ee[Re++]!==4||Ee[Re+4]!==0)throw new Error("Invalid graphics extension block.");var Ge=Ee[Re++];We=Ee[Re++]|Ee[Re++]<<8,Xe=Ee[Re++],1&Ge||(Xe=null),He=Ge>>2&7,Re++;break;case 254:for(;;){if(!((tr=Ee[Re++])>=0))throw Error("Invalid block size");if(tr===0)break;Re+=tr}break;default:throw new Error("Unknown graphic control label: 0x"+Ee[Re-1].toString(16))}break;case 44:var Ye=Ee[Re++]|Ee[Re++]<<8,Ve=Ee[Re++]|Ee[Re++]<<8,Ke=Ee[Re++]|Ee[Re++]<<8,Qe=Ee[Re++]|Ee[Re++]<<8,Ze=Ee[Re++],Je=Ze>>6&1,ir=1<<1+(7&Ze),rr=$e,ar=Be,or=!1;Ze>>7&&(or=!0,rr=Re,ar=ir,Re+=3*ir);var pr=Re;for(Re++;;){var tr;if(!((tr=Ee[Re++])>=0))throw Error("Invalid block size");if(tr===0)break;Re+=tr}ze.push({x:Ye,y:Ve,width:Ke,height:Qe,has_local_palette:or,palette_offset:rr,palette_size:ar,data_offset:pr,data_length:Re-pr,transparent_index:Xe,interlaced:!!Je,delay:We,disposal:He});break;case 59:Ue=!1;break;default:throw new Error("Unknown gif block: 0x"+Ee[Re-1].toString(16))}this.numFrames=function(){return ze.length},this.loopCount=function(){return qe},this.frameInfo=function(nr){if(nr<0||nr>=ze.length)throw new Error("Frame index out of range.");return ze[nr]},this.decodeAndBlitFrameBGRA=function(nr,hr){var sr=this.frameInfo(nr),xr=sr.width*sr.height;if(xr>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var Rr=new Uint8Array(xr);ae(Ee,sr.data_offset,Rr,xr);var br=sr.palette_offset,wr=sr.transparent_index;wr===null&&(wr=256);var vr=sr.width,Dr=Te-vr,kr=vr,cr=4*(sr.y*Te+sr.x),dr=4*((sr.y+sr.height)*Te+sr.x),ur=cr,gr=4*Dr;sr.interlaced===!0&&(gr+=4*Te*7);for(var _r=8,Ir=0,Ar=Rr.length;Ir<Ar;++Ir){var Tr=Rr[Ir];if(kr===0&&(kr=vr,(ur+=gr)>=dr&&(gr=4*Dr+4*Te*(_r-1),ur=cr+(vr+Dr)*(_r<<1),_r>>=1)),Tr===wr)ur+=4;else{var Nr=Ee[br+3*Tr],Br=Ee[br+3*Tr+1],Hr=Ee[br+3*Tr+2];hr[ur++]=Hr,hr[ur++]=Br,hr[ur++]=Nr,hr[ur++]=255}--kr}},this.decodeAndBlitFrameRGBA=function(nr,hr){var sr=this.frameInfo(nr),xr=sr.width*sr.height;if(xr>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var Rr=new Uint8Array(xr);ae(Ee,sr.data_offset,Rr,xr);var br=sr.palette_offset,wr=sr.transparent_index;wr===null&&(wr=256);var vr=sr.width,Dr=Te-vr,kr=vr,cr=4*(sr.y*Te+sr.x),dr=4*((sr.y+sr.height)*Te+sr.x),ur=cr,gr=4*Dr;sr.interlaced===!0&&(gr+=4*Te*7);for(var _r=8,Ir=0,Ar=Rr.length;Ir<Ar;++Ir){var Tr=Rr[Ir];if(kr===0&&(kr=vr,(ur+=gr)>=dr&&(gr=4*Dr+4*Te*(_r-1),ur=cr+(vr+Dr)*(_r<<1),_r>>=1)),Tr===wr)ur+=4;else{var Nr=Ee[br+3*Tr],Br=Ee[br+3*Tr+1],Hr=Ee[br+3*Tr+2];hr[ur++]=Nr,hr[ur++]=Br,hr[ur++]=Hr,hr[ur++]=255}--kr}}}function ae(Ee,Re,Te,je){for(var Oe=Ee[Re++],Me=1<<Oe,De=Me+1,$e=De+1,Be=Oe+1,Ue=(1<<Be)-1,ze=0,We=0,Xe=0,He=Ee[Re++],qe=new Int32Array(4096),Ge=null;;){for(;ze<16&&He!==0;)We|=Ee[Re++]<<ze,ze+=8,He===1?He=Ee[Re++]:--He;if(ze<Be)break;var Ye=We&Ue;if(We>>=Be,ze-=Be,Ye!==Me){if(Ye===De)break;for(var Ve=Ye<$e?Ye:Ge,Ke=0,Qe=Ve;Qe>Me;)Qe=qe[Qe]>>8,++Ke;var Ze=Qe;if(Xe+Ke+(Ve!==Ye?1:0)>je)return void o.log("Warning, gif stream longer than expected.");Te[Xe++]=Ze;var Je=Xe+=Ke;for(Ve!==Ye&&(Te[Xe++]=Ze),Qe=Ve;Ke--;)Qe=qe[Qe],Te[--Je]=255&Qe,Qe>>=8;Ge!==null&&$e<4096&&(qe[$e++]=Ge<<8|Ze,$e>=Ue+1&&Be<12&&(++Be,Ue=Ue<<1|1)),Ge=Ye}else $e=De+1,Ue=(1<<(Be=Oe+1))-1,Ge=null}return Xe!==je&&o.log("Warning, gif stream shorter than expected."),Te}/** 4118 * @license 4119 Copyright (c) 2008, Adobe Systems Incorporated 4120 All rights reserved. 4121 4122 Redistribution and use in source and binary forms, with or without 4123 modification, are permitted provided that the following conditions are 4124 met: 4125 4126 * Redistributions of source code must retain the above copyright notice, 4127 this list of conditions and the following disclaimer. 4128 4129 * Redistributions in binary form must reproduce the above copyright 4130 notice, this list of conditions and the following disclaimer in the 4131 documentation and/or other materials provided with the distribution. 4132 4133 * Neither the name of Adobe Systems Incorporated nor the names of its 4134 contributors may be used to endorse or promote products derived from 4135 this software without specific prior written permission. 4136 4137 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 4138 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 4139 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 4140 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 4141 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 4142 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 4143 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 4144 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 4145 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 4146 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 4147 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4148*/function oe(Ee){var Re,Te,je,Oe,Me,De=Math.floor,$e=new Array(64),Be=new Array(64),Ue=new Array(64),ze=new Array(64),We=new Array(65535),Xe=new Array(65535),He=new Array(64),qe=new Array(64),Ge=[],Ye=0,Ve=7,Ke=new Array(64),Qe=new Array(64),Ze=new Array(64),Je=new Array(256),ir=new Array(2048),rr=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],ar=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],or=[0,1,2,3,4,5,6,7,8,9,10,11],pr=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],tr=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],nr=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],hr=[0,1,2,3,4,5,6,7,8,9,10,11],sr=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],xr=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function Rr(cr,dr){for(var ur=0,gr=0,_r=new Array,Ir=1;Ir<=16;Ir++){for(var Ar=1;Ar<=cr[Ir];Ar++)_r[dr[gr]]=[],_r[dr[gr]][0]=ur,_r[dr[gr]][1]=Ir,gr++,ur++;ur*=2}return _r}function br(cr){for(var dr=cr[0],ur=cr[1]-1;ur>=0;)dr&1<<ur&&(Ye|=1<<Ve),ur--,--Ve<0&&(Ye==255?(wr(255),wr(0)):wr(Ye),Ve=7,Ye=0)}function wr(cr){Ge.push(cr)}function vr(cr){wr(cr>>8&255),wr(255&cr)}function Dr(cr,dr,ur,gr,_r){for(var Ir,Ar=_r[0],Tr=_r[240],Nr=function(Cr,Mr){var $r,Fr,Kr,an,Wr,hn,cn,tn,Qr,wn,gn=0;for(Qr=0;Qr<8;++Qr){$r=Cr[gn],Fr=Cr[gn+1],Kr=Cr[gn+2],an=Cr[gn+3],Wr=Cr[gn+4],hn=Cr[gn+5],cn=Cr[gn+6];var In=$r+(tn=Cr[gn+7]),yn=$r-tn,Mn=Fr+cn,on=Fr-cn,Yr=Kr+hn,sn=Kr-hn,On=an+Wr,Bn=an-Wr,Hn=In+On,Zr=In-On,xn=Mn+Yr,An=Mn-Yr;Cr[gn]=Hn+xn,Cr[gn+4]=Hn-xn;var Wn=.707106781*(An+Zr);Cr[gn+2]=Zr+Wn,Cr[gn+6]=Zr-Wn;var ss=.382683433*((Hn=Bn+sn)-(An=on+yn)),Yn=.5411961*Hn+ss,en=1.306562965*An+ss,Gr=.707106781*(xn=sn+on),nn=yn+Gr,En=yn-Gr;Cr[gn+5]=En+Yn,Cr[gn+3]=En-Yn,Cr[gn+1]=nn+en,Cr[gn+7]=nn-en,gn+=8}for(gn=0,Qr=0;Qr<8;++Qr){$r=Cr[gn],Fr=Cr[gn+8],Kr=Cr[gn+16],an=Cr[gn+24],Wr=Cr[gn+32],hn=Cr[gn+40],cn=Cr[gn+48];var Cn=$r+(tn=Cr[gn+56]),jn=$r-tn,$n=Fr+cn,Vn=Fr-cn,Qn=Kr+hn,Un=Kr-hn,fs=an+Wr,Jn=an-Wr,ts=Cn+fs,cs=Cn-fs,Sn=$n+Qn,mn=$n-Qn;Cr[gn]=ts+Sn,Cr[gn+32]=ts-Sn;var zn=.707106781*(mn+cs);Cr[gn+16]=cs+zn,Cr[gn+48]=cs-zn;var os=.382683433*((ts=Jn+Un)-(mn=Vn+jn)),ls=.5411961*ts+os,hs=1.306562965*mn+os,Cs=.707106781*(Sn=Un+Vn),Ds=jn+Cs,ho=jn-Cs;Cr[gn+40]=ho+ls,Cr[gn+24]=ho-ls,Cr[gn+8]=Ds+hs,Cr[gn+56]=Ds-hs,gn++}for(Qr=0;Qr<64;++Qr)wn=Cr[Qr]*Mr[Qr],He[Qr]=wn>0?wn+.5|0:wn-.5|0;return He}(cr,dr),Br=0;Br<64;++Br)qe[rr[Br]]=Nr[Br];var Hr=qe[0]-ur;ur=qe[0],Hr==0?br(gr[0]):(br(gr[Xe[Ir=32767+Hr]]),br(We[Ir]));for(var Vr=63;Vr>0&&qe[Vr]==0;)Vr--;if(Vr==0)return br(Ar),ur;for(var mr,Sr=1;Sr<=Vr;){for(var Lr=Sr;qe[Sr]==0&&Sr<=Vr;)++Sr;var jr=Sr-Lr;if(jr>=16){mr=jr>>4;for(var fr=1;fr<=mr;++fr)br(Tr);jr&=15}Ir=32767+qe[Sr],br(_r[(jr<<4)+Xe[Ir]]),br(We[Ir]),Sr++}return Vr!=63&&br(Ar),ur}function kr(cr){cr=Math.min(Math.max(cr,1),100),Me!=cr&&(function(dr){for(var ur=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],gr=0;gr<64;gr++){var _r=De((ur[gr]*dr+50)/100);_r=Math.min(Math.max(_r,1),255),$e[rr[gr]]=_r}for(var Ir=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],Ar=0;Ar<64;Ar++){var Tr=De((Ir[Ar]*dr+50)/100);Tr=Math.min(Math.max(Tr,1),255),Be[rr[Ar]]=Tr}for(var Nr=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Br=0,Hr=0;Hr<8;Hr++)for(var Vr=0;Vr<8;Vr++)Ue[Br]=1/($e[rr[Br]]*Nr[Hr]*Nr[Vr]*8),ze[Br]=1/(Be[rr[Br]]*Nr[Hr]*Nr[Vr]*8),Br++}(cr<50?Math.floor(5e3/cr):Math.floor(200-2*cr)),Me=cr)}this.encode=function(cr,dr){dr&&kr(dr),Ge=new Array,Ye=0,Ve=7,vr(65496),vr(65504),vr(16),wr(74),wr(70),wr(73),wr(70),wr(0),wr(1),wr(1),wr(0),vr(1),vr(1),wr(0),wr(0),function(){vr(65499),vr(132),wr(0);for(var Fr=0;Fr<64;Fr++)wr($e[Fr]);wr(1);for(var Kr=0;Kr<64;Kr++)wr(Be[Kr])}(),function(Fr,Kr){vr(65472),vr(17),wr(8),vr(Kr),vr(Fr),wr(3),wr(1),wr(17),wr(0),wr(2),wr(17),wr(1),wr(3),wr(17),wr(1)}(cr.width,cr.height),function(){vr(65476),vr(418),wr(0);for(var Fr=0;Fr<16;Fr++)wr(ar[Fr+1]);for(var Kr=0;Kr<=11;Kr++)wr(or[Kr]);wr(16);for(var an=0;an<16;an++)wr(pr[an+1]);for(var Wr=0;Wr<=161;Wr++)wr(tr[Wr]);wr(1);for(var hn=0;hn<16;hn++)wr(nr[hn+1]);for(var cn=0;cn<=11;cn++)wr(hr[cn]);wr(17);for(var tn=0;tn<16;tn++)wr(sr[tn+1]);for(var Qr=0;Qr<=161;Qr++)wr(xr[Qr])}(),vr(65498),vr(12),wr(3),wr(1),wr(0),wr(2),wr(17),wr(3),wr(17),wr(0),wr(63),wr(0);var ur=0,gr=0,_r=0;Ye=0,Ve=7,this.encode.displayName="_encode_";for(var Ir,Ar,Tr,Nr,Br,Hr,Vr,mr,Sr,Lr=cr.data,jr=cr.width,fr=cr.height,Cr=4*jr,Mr=0;Mr<fr;){for(Ir=0;Ir<Cr;){for(Br=Cr*Mr+Ir,Vr=-1,mr=0,Sr=0;Sr<64;Sr++)Hr=Br+(mr=Sr>>3)*Cr+(Vr=4*(7&Sr)),Mr+mr>=fr&&(Hr-=Cr*(Mr+1+mr-fr)),Ir+Vr>=Cr&&(Hr-=Ir+Vr-Cr+4),Ar=Lr[Hr++],Tr=Lr[Hr++],Nr=Lr[Hr++],Ke[Sr]=(ir[Ar]+ir[Tr+256|0]+ir[Nr+512|0]>>16)-128,Qe[Sr]=(ir[Ar+768|0]+ir[Tr+1024|0]+ir[Nr+1280|0]>>16)-128,Ze[Sr]=(ir[Ar+1280|0]+ir[Tr+1536|0]+ir[Nr+1792|0]>>16)-128;ur=Dr(Ke,Ue,ur,Re,je),gr=Dr(Qe,ze,gr,Te,Oe),_r=Dr(Ze,ze,_r,Te,Oe),Ir+=32}Mr+=8}if(Ve>=0){var $r=[];$r[1]=Ve+1,$r[0]=(1<<Ve+1)-1,br($r)}return vr(65497),new Uint8Array(Ge)},Ee=Ee||50,function(){for(var cr=String.fromCharCode,dr=0;dr<256;dr++)Je[dr]=cr(dr)}(),Re=Rr(ar,or),Te=Rr(nr,hr),je=Rr(pr,tr),Oe=Rr(sr,xr),function(){for(var cr=1,dr=2,ur=1;ur<=15;ur++){for(var gr=cr;gr<dr;gr++)Xe[32767+gr]=ur,We[32767+gr]=[],We[32767+gr][1]=ur,We[32767+gr][0]=gr;for(var _r=-(dr-1);_r<=-cr;_r++)Xe[32767+_r]=ur,We[32767+_r]=[],We[32767+_r][1]=ur,We[32767+_r][0]=dr-1+_r;cr<<=1,dr<<=1}}(),function(){for(var cr=0;cr<256;cr++)ir[cr]=19595*cr,ir[cr+256|0]=38470*cr,ir[cr+512|0]=7471*cr+32768,ir[cr+768|0]=-11059*cr,ir[cr+1024|0]=-21709*cr,ir[cr+1280|0]=32768*cr+8421375,ir[cr+1536|0]=-27439*cr,ir[cr+1792|0]=-5329*cr}(),kr(Ee)}/** 4149 * @license 4150 * Copyright (c) 2017 Aras Abbasi 4151 * 4152 * Licensed under the MIT License. 4153 * http://opensource.org/licenses/mit-license 4154 */function se(Ee,Re){if(this.pos=0,this.buffer=Ee,this.datav=new DataView(Ee.buffer),this.is_with_alpha=!!Re,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function ue(Ee){function Re(or){if(!or)throw Error("assert :P")}function Te(or,pr,tr){for(var nr=0;4>nr;nr++)if(or[pr+nr]!=tr.charCodeAt(nr))return!0;return!1}function je(or,pr,tr,nr,hr){for(var sr=0;sr<hr;sr++)or[pr+sr]=tr[nr+sr]}function Oe(or,pr,tr,nr){for(var hr=0;hr<nr;hr++)or[pr+hr]=tr}function Me(or){return new Int32Array(or)}function De(or,pr){for(var tr=[],nr=0;nr<or;nr++)tr.push(new pr);return tr}function $e(or,pr){var tr=[];return function nr(hr,sr,xr){for(var Rr=xr[sr],br=0;br<Rr&&(hr.push(xr.length>sr+1?[]:new pr),!(xr.length<sr+1));br++)nr(hr[br],sr+1,xr)}(tr,0,or),tr}var Be=function(){var or=this;function pr(er,lr){for(var Er=1<<lr-1>>>0;er&Er;)Er>>>=1;return Er?(er&Er-1)+Er:er}function tr(er,lr,Er,Or,zr){Re(!(Or%Er));do er[lr+(Or-=Er)]=zr;while(0<Or)}function nr(er,lr,Er,Or,zr){if(Re(2328>=zr),512>=zr)var qr=Me(512);else if((qr=Me(zr))==null)return 0;return function(Xr,Jr,rn,dn,_n,Fn){var pn,Rn,Ln=Jr,qn=1<<rn,Dn=Me(16),Xn=Me(16);for(Re(_n!=0),Re(dn!=null),Re(Xr!=null),Re(0<rn),Rn=0;Rn<_n;++Rn){if(15<dn[Rn])return 0;++Dn[dn[Rn]]}if(Dn[0]==_n)return 0;for(Xn[1]=0,pn=1;15>pn;++pn){if(Dn[pn]>1<<pn)return 0;Xn[pn+1]=Xn[pn]+Dn[pn]}for(Rn=0;Rn<_n;++Rn)pn=dn[Rn],0<dn[Rn]&&(Fn[Xn[pn]++]=Rn);if(Xn[15]==1)return(dn=new hr).g=0,dn.value=Fn[0],tr(Xr,Ln,1,qn,dn),qn;var Zn,as=-1,rs=qn-1,_s=0,ys=1,Os=1,Ss=1<<rn;for(Rn=0,pn=1,_n=2;pn<=rn;++pn,_n<<=1){if(ys+=Os<<=1,0>(Os-=Dn[pn]))return 0;for(;0<Dn[pn];--Dn[pn])(dn=new hr).g=pn,dn.value=Fn[Rn++],tr(Xr,Ln+_s,_n,Ss,dn),_s=pr(_s,pn)}for(pn=rn+1,_n=2;15>=pn;++pn,_n<<=1){if(ys+=Os<<=1,0>(Os-=Dn[pn]))return 0;for(;0<Dn[pn];--Dn[pn]){if(dn=new hr,(_s&rs)!=as){for(Ln+=Ss,Zn=1<<(as=pn)-rn;15>as&&!(0>=(Zn-=Dn[as]));)++as,Zn<<=1;qn+=Ss=1<<(Zn=as-rn),Xr[Jr+(as=_s&rs)].g=Zn+rn,Xr[Jr+as].value=Ln-Jr-as}dn.g=pn-rn,dn.value=Fn[Rn++],tr(Xr,Ln+(_s>>rn),_n,Ss,dn),_s=pr(_s,pn)}}return ys!=2*Xn[15]-1?0:qn}(er,lr,Er,Or,zr,qr)}function hr(){this.value=this.g=0}function sr(){this.value=this.g=0}function xr(){this.G=De(5,hr),this.H=Me(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=De(wa,sr)}function Rr(er,lr,Er,Or){Re(er!=null),Re(lr!=null),Re(2147483648>Or),er.Ca=254,er.I=0,er.b=-8,er.Ka=0,er.oa=lr,er.pa=Er,er.Jd=lr,er.Yc=Er+Or,er.Zc=4<=Or?Er+Or-4+1:Er,Ar(er)}function br(er,lr){for(var Er=0;0<lr--;)Er|=Nr(er,128)<<lr;return Er}function wr(er,lr){var Er=br(er,lr);return Tr(er)?-Er:Er}function vr(er,lr,Er,Or){var zr,qr=0;for(Re(er!=null),Re(lr!=null),Re(4294967288>Or),er.Sb=Or,er.Ra=0,er.u=0,er.h=0,4<Or&&(Or=4),zr=0;zr<Or;++zr)qr+=lr[Er+zr]<<8*zr;er.Ra=qr,er.bb=Or,er.oa=lr,er.pa=Er}function Dr(er){for(;8<=er.u&&er.bb<er.Sb;)er.Ra>>>=8,er.Ra+=er.oa[er.pa+er.bb]<<Bo-8>>>0,++er.bb,er.u-=8;gr(er)&&(er.h=1,er.u=0)}function kr(er,lr){if(Re(0<=lr),!er.h&&lr<=Ba){var Er=ur(er)&na[lr];return er.u+=lr,Dr(er),Er}return er.h=1,er.u=0}function cr(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function dr(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function ur(er){return er.Ra>>>(er.u&Bo-1)>>>0}function gr(er){return Re(er.bb<=er.Sb),er.h||er.bb==er.Sb&&er.u>Bo}function _r(er,lr){er.u=lr,er.h=gr(er)}function Ir(er){er.u>=Wo&&(Re(er.u>=Wo),Dr(er))}function Ar(er){Re(er!=null&&er.oa!=null),er.pa<er.Zc?(er.I=(er.oa[er.pa++]|er.I<<8)>>>0,er.b+=8):(Re(er!=null&&er.oa!=null),er.pa<er.Yc?(er.b+=8,er.I=er.oa[er.pa++]|er.I<<8):er.Ka?er.b=0:(er.I<<=8,er.b+=8,er.Ka=1))}function Tr(er){return br(er,1)}function Nr(er,lr){var Er=er.Ca;0>er.b&&Ar(er);var Or=er.b,zr=Er*lr>>>8,qr=(er.I>>>Or>zr)+0;for(qr?(Er-=zr,er.I-=zr+1<<Or>>>0):Er=zr+1,Or=Er,zr=0;256<=Or;)zr+=8,Or>>=8;return Or=7^zr+Ea[Or],er.b-=Or,er.Ca=(Er<<Or)-1,qr}function Br(er,lr,Er){er[lr+0]=Er>>24&255,er[lr+1]=Er>>16&255,er[lr+2]=Er>>8&255,er[lr+3]=255&Er}function Hr(er,lr){return er[lr+0]|er[lr+1]<<8}function Vr(er,lr){return Hr(er,lr)|er[lr+2]<<16}function mr(er,lr){return Hr(er,lr)|Hr(er,lr+2)<<16}function Sr(er,lr){var Er=1<<lr;return Re(er!=null),Re(0<lr),er.X=Me(Er),er.X==null?0:(er.Mb=32-lr,er.Xa=lr,1)}function Lr(er,lr){Re(er!=null),Re(lr!=null),Re(er.Xa==lr.Xa),je(lr.X,0,er.X,0,1<<lr.Xa)}function jr(){this.X=[],this.Xa=this.Mb=0}function fr(er,lr,Er,Or){Re(Er!=null),Re(Or!=null);var zr=Er[0],qr=Or[0];return zr==0&&(zr=(er*qr+lr/2)/lr),qr==0&&(qr=(lr*zr+er/2)/er),0>=zr||0>=qr?0:(Er[0]=zr,Or[0]=qr,1)}function Cr(er,lr){return er+(1<<lr)-1>>>lr}function Mr(er,lr){return((4278255360&er)+(4278255360&lr)>>>0&4278255360)+((16711935&er)+(16711935&lr)>>>0&16711935)>>>0}function $r(er,lr){or[lr]=function(Er,Or,zr,qr,Xr,Jr,rn){var dn;for(dn=0;dn<Xr;++dn){var _n=or[er](Jr[rn+dn-1],zr,qr+dn);Jr[rn+dn]=Mr(Er[Or+dn],_n)}}}function Fr(){this.ud=this.hd=this.jd=0}function Kr(er,lr){return((4278124286&(er^lr))>>>1)+(er&lr)>>>0}function an(er){return 0<=er&&256>er?er:0>er?0:255<er?255:void 0}function Wr(er,lr){return an(er+(er-lr+.5>>1))}function hn(er,lr,Er){return Math.abs(lr-Er)-Math.abs(er-Er)}function cn(er,lr,Er,Or,zr,qr,Xr){for(Or=qr[Xr-1],Er=0;Er<zr;++Er)qr[Xr+Er]=Or=Mr(er[lr+Er],Or)}function tn(er,lr,Er,Or,zr){var qr;for(qr=0;qr<Er;++qr){var Xr=er[lr+qr],Jr=Xr>>8&255,rn=16711935&(rn=(rn=16711935&Xr)+((Jr<<16)+Jr));Or[zr+qr]=(4278255360&Xr)+rn>>>0}}function Qr(er,lr){lr.jd=255&er,lr.hd=er>>8&255,lr.ud=er>>16&255}function wn(er,lr,Er,Or,zr,qr){var Xr;for(Xr=0;Xr<Or;++Xr){var Jr=lr[Er+Xr],rn=Jr>>>8,dn=Jr,_n=255&(_n=(_n=Jr>>>16)+((er.jd<<24>>24)*(rn<<24>>24)>>>5));dn=255&(dn=(dn+=(er.hd<<24>>24)*(rn<<24>>24)>>>5)+((er.ud<<24>>24)*(_n<<24>>24)>>>5)),zr[qr+Xr]=(4278255360&Jr)+(_n<<16)+dn}}function gn(er,lr,Er,Or,zr){or[lr]=function(qr,Xr,Jr,rn,dn,_n,Fn,pn,Rn){for(rn=Fn;rn<pn;++rn)for(Fn=0;Fn<Rn;++Fn)dn[_n++]=zr(Jr[Or(qr[Xr++])])},or[er]=function(qr,Xr,Jr,rn,dn,_n,Fn){var pn=8>>qr.b,Rn=qr.Ea,Ln=qr.K[0],qn=qr.w;if(8>pn)for(qr=(1<<qr.b)-1,qn=(1<<pn)-1;Xr<Jr;++Xr){var Dn,Xn=0;for(Dn=0;Dn<Rn;++Dn)Dn&qr||(Xn=Or(rn[dn++])),_n[Fn++]=zr(Ln[Xn&qn]),Xn>>=pn}else or["VP8LMapColor"+Er](rn,dn,Ln,qn,_n,Fn,Xr,Jr,Rn)}}function In(er,lr,Er,Or,zr){for(Er=lr+Er;lr<Er;){var qr=er[lr++];Or[zr++]=qr>>16&255,Or[zr++]=qr>>8&255,Or[zr++]=255&qr}}function yn(er,lr,Er,Or,zr){for(Er=lr+Er;lr<Er;){var qr=er[lr++];Or[zr++]=qr>>16&255,Or[zr++]=qr>>8&255,Or[zr++]=255&qr,Or[zr++]=qr>>24&255}}function Mn(er,lr,Er,Or,zr){for(Er=lr+Er;lr<Er;){var qr=(Xr=er[lr++])>>16&240|Xr>>12&15,Xr=240&Xr|Xr>>28&15;Or[zr++]=qr,Or[zr++]=Xr}}function on(er,lr,Er,Or,zr){for(Er=lr+Er;lr<Er;){var qr=(Xr=er[lr++])>>16&248|Xr>>13&7,Xr=Xr>>5&224|Xr>>3&31;Or[zr++]=qr,Or[zr++]=Xr}}function Yr(er,lr,Er,Or,zr){for(Er=lr+Er;lr<Er;){var qr=er[lr++];Or[zr++]=255&qr,Or[zr++]=qr>>8&255,Or[zr++]=qr>>16&255}}function sn(er,lr,Er,Or,zr,qr){if(qr==0)for(Er=lr+Er;lr<Er;)Br(Or,((qr=er[lr++])[0]>>24|qr[1]>>8&65280|qr[2]<<8&16711680|qr[3]<<24)>>>0),zr+=32;else je(Or,zr,er,lr,Er)}function On(er,lr){or[lr][0]=or[er+"0"],or[lr][1]=or[er+"1"],or[lr][2]=or[er+"2"],or[lr][3]=or[er+"3"],or[lr][4]=or[er+"4"],or[lr][5]=or[er+"5"],or[lr][6]=or[er+"6"],or[lr][7]=or[er+"7"],or[lr][8]=or[er+"8"],or[lr][9]=or[er+"9"],or[lr][10]=or[er+"10"],or[lr][11]=or[er+"11"],or[lr][12]=or[er+"12"],or[lr][13]=or[er+"13"],or[lr][14]=or[er+"0"],or[lr][15]=or[er+"0"]}function Bn(er){return er==Vl||er==Xl||er==bl||er==Yl}function Hn(){this.eb=[],this.size=this.A=this.fb=0}function Zr(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function xn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Hn,this.f.kb=new Zr,this.sd=null}function An(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Wn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function ss(er){return alert("todo:WebPSamplerProcessPlane"),er.T}function Yn(er,lr){var Er=er.T,Or=lr.ba.f.RGBA,zr=Or.eb,qr=Or.fb+er.ka*Or.A,Xr=oi[lr.ba.S],Jr=er.y,rn=er.O,dn=er.f,_n=er.N,Fn=er.ea,pn=er.W,Rn=lr.cc,Ln=lr.dc,qn=lr.Mc,Dn=lr.Nc,Xn=er.ka,Zn=er.ka+er.T,as=er.U,rs=as+1>>1;for(Xn==0?Xr(Jr,rn,null,null,dn,_n,Fn,pn,dn,_n,Fn,pn,zr,qr,null,null,as):(Xr(lr.ec,lr.fc,Jr,rn,Rn,Ln,qn,Dn,dn,_n,Fn,pn,zr,qr-Or.A,zr,qr,as),++Er);Xn+2<Zn;Xn+=2)Rn=dn,Ln=_n,qn=Fn,Dn=pn,_n+=er.Rc,pn+=er.Rc,qr+=2*Or.A,Xr(Jr,(rn+=2*er.fa)-er.fa,Jr,rn,Rn,Ln,qn,Dn,dn,_n,Fn,pn,zr,qr-Or.A,zr,qr,as);return rn+=er.fa,er.j+Zn<er.o?(je(lr.ec,lr.fc,Jr,rn,as),je(lr.cc,lr.dc,dn,_n,rs),je(lr.Mc,lr.Nc,Fn,pn,rs),Er--):1&Zn||Xr(Jr,rn,null,null,dn,_n,Fn,pn,dn,_n,Fn,pn,zr,qr+Or.A,null,null,as),Er}function en(er,lr,Er){var Or=er.F,zr=[er.J];if(Or!=null){var qr=er.U,Xr=lr.ba.S,Jr=Xr==yl||Xr==bl;lr=lr.ba.f.RGBA;var rn=[0],dn=er.ka;rn[0]=er.T,er.Kb&&(dn==0?--rn[0]:(--dn,zr[0]-=er.width),er.j+er.ka+er.T==er.o&&(rn[0]=er.o-er.j-dn));var _n=lr.eb;dn=lr.fb+dn*lr.A,er=Xc(Or,zr[0],er.width,qr,rn,_n,dn+(Jr?0:3),lr.A),Re(Er==rn),er&&Bn(Xr)&&Wa(_n,dn,Jr,qr,rn,lr.A)}return 0}function Gr(er){var lr=er.ma,Er=lr.ba.S,Or=11>Er,zr=Er==gl||Er==xl||Er==yl||Er==ql||Er==12||Bn(Er);if(lr.memory=null,lr.Ib=null,lr.Jb=null,lr.Nd=null,!ni(lr.Oa,er,zr?11:12))return 0;if(zr&&Bn(Er)&&Pi(),er.da)alert("todo:use_scaling");else{if(Or){if(lr.Ib=ss,er.Kb){if(Er=er.U+1>>1,lr.memory=Me(er.U+2*Er),lr.memory==null)return 0;lr.ec=lr.memory,lr.fc=0,lr.cc=lr.ec,lr.dc=lr.fc+er.U,lr.Mc=lr.cc,lr.Nc=lr.dc+Er,lr.Ib=Yn,Pi()}}else alert("todo:EmitYUV");zr&&(lr.Jb=en,Or&&io())}if(Or&&!uu){for(er=0;256>er;++er)Ad[er]=89858*(er-128)+Sl>>vl,Td[er]=-22014*(er-128)+Sl,Pd[er]=-45773*(er-128),Rd[er]=113618*(er-128)+Sl>>vl;for(er=qa;er<Ql;++er)lr=76283*(er-16)+Sl>>vl,kd[er-qa]=Ws(lr,255),jd[er-qa]=Ws(lr+8>>4,15);uu=1}return 1}function nn(er){var lr=er.ma,Er=er.U,Or=er.T;return Re(!(1&er.ka)),0>=Er||0>=Or?0:(Er=lr.Ib(er,lr),lr.Jb!=null&&lr.Jb(er,lr,Er),lr.Dc+=Er,1)}function En(er){er.ma.memory=null}function Cn(er,lr,Er,Or){return kr(er,8)!=47?0:(lr[0]=kr(er,14)+1,Er[0]=kr(er,14)+1,Or[0]=kr(er,1),kr(er,3)!=0?0:!er.h)}function jn(er,lr){if(4>er)return er+1;var Er=er-2>>1;return(2+(1&er)<<Er)+kr(lr,Er)+1}function $n(er,lr){return 120<lr?lr-120:1<=(Er=((Er=pd[lr-1])>>4)*er+(8-(15&Er)))?Er:1;var Er}function Vn(er,lr,Er){var Or=ur(Er),zr=er[lr+=255&Or].g-8;return 0<zr&&(_r(Er,Er.u+8),Or=ur(Er),lr+=er[lr].value,lr+=Or&(1<<zr)-1),_r(Er,Er.u+er[lr].g),er[lr].value}function Qn(er,lr,Er){return Er.g+=er.g,Er.value+=er.value<<lr>>>0,Re(8>=Er.g),er.g}function Un(er,lr,Er){var Or=er.xc;return Re((lr=Or==0?0:er.vc[er.md*(Er>>Or)+(lr>>Or)])<er.Wb),er.Ya[lr]}function fs(er,lr,Er,Or){var zr=er.ab,qr=er.c*lr,Xr=er.C;lr=Xr+lr;var Jr=Er,rn=Or;for(Or=er.Ta,Er=er.Ua;0<zr--;){var dn=er.gc[zr],_n=Xr,Fn=lr,pn=Jr,Rn=rn,Ln=(rn=Or,Jr=Er,dn.Ea);switch(Re(_n<Fn),Re(Fn<=dn.nc),dn.hc){case 2:Ca(pn,Rn,(Fn-_n)*Ln,rn,Jr);break;case 0:var qn=_n,Dn=Fn,Xn=rn,Zn=Jr,as=(Ss=dn).Ea;qn==0&&(Bi(pn,Rn,null,null,1,Xn,Zn),cn(pn,Rn+1,0,0,as-1,Xn,Zn+1),Rn+=as,Zn+=as,++qn);for(var rs=1<<Ss.b,_s=rs-1,ys=Cr(as,Ss.b),Os=Ss.K,Ss=Ss.w+(qn>>Ss.b)*ys;qn<Dn;){var $s=Os,bo=Ss,Ms=1;for(Ui(pn,Rn,Xn,Zn-as,1,Xn,Zn);Ms<as;){var ws=(Ms&~_s)+rs;ws>as&&(ws=as),(0,pi[$s[bo++]>>8&15])(pn,Rn+ +Ms,Xn,Zn+Ms-as,ws-Ms,Xn,Zn+Ms),Ms=ws}Rn+=as,Zn+=as,++qn&_s||(Ss+=ys)}Fn!=dn.nc&&je(rn,Jr-Ln,rn,Jr+(Fn-_n-1)*Ln,Ln);break;case 1:for(Ln=pn,Dn=Rn,as=(pn=dn.Ea)-(Zn=pn&~(Xn=(Rn=1<<dn.b)-1)),qn=Cr(pn,dn.b),rs=dn.K,dn=dn.w+(_n>>dn.b)*qn;_n<Fn;){for(_s=rs,ys=dn,Os=new Fr,Ss=Dn+Zn,$s=Dn+pn;Dn<Ss;)Qr(_s[ys++],Os),oa(Os,Ln,Dn,Rn,rn,Jr),Dn+=Rn,Jr+=Rn;Dn<$s&&(Qr(_s[ys++],Os),oa(Os,Ln,Dn,as,rn,Jr),Dn+=as,Jr+=as),++_n&Xn||(dn+=qn)}break;case 3:if(pn==rn&&Rn==Jr&&0<dn.b){for(Dn=rn,pn=Ln=Jr+(Fn-_n)*Ln-(Zn=(Fn-_n)*Cr(dn.Ea,dn.b)),Rn=rn,Xn=Jr,qn=[],Zn=(as=Zn)-1;0<=Zn;--Zn)qn[Zn]=Rn[Xn+Zn];for(Zn=as-1;0<=Zn;--Zn)Dn[pn+Zn]=qn[Zn];sa(dn,_n,Fn,rn,Ln,rn,Jr)}else sa(dn,_n,Fn,pn,Rn,rn,Jr)}Jr=Or,rn=Er}rn!=Er&&je(Or,Er,Jr,rn,qr)}function Jn(er,lr){var Er=er.V,Or=er.Ba+er.c*er.C,zr=lr-er.C;if(Re(lr<=er.l.o),Re(16>=zr),0<zr){var qr=er.l,Xr=er.Ta,Jr=er.Ua,rn=qr.width;if(fs(er,zr,Er,Or),zr=Jr=[Jr],Re((Er=er.C)<(Or=lr)),Re(qr.v<qr.va),Or>qr.o&&(Or=qr.o),Er<qr.j){var dn=qr.j-Er;Er=qr.j,zr[0]+=dn*rn}if(Er>=Or?Er=0:(zr[0]+=4*qr.v,qr.ka=Er-qr.j,qr.U=qr.va-qr.v,qr.T=Or-Er,Er=1),Er){if(Jr=Jr[0],11>(Er=er.ca).S){var _n=Er.f.RGBA,Fn=(Or=Er.S,zr=qr.U,qr=qr.T,dn=_n.eb,_n.A),pn=qr;for(_n=_n.fb+er.Ma*_n.A;0<pn--;){var Rn=Xr,Ln=Jr,qn=zr,Dn=dn,Xn=_n;switch(Or){case ml:Ua(Rn,Ln,qn,Dn,Xn);break;case gl:za(Rn,Ln,qn,Dn,Xn);break;case Vl:za(Rn,Ln,qn,Dn,Xn),Wa(Dn,Xn,0,qn,1,0);break;case tu:aa(Rn,Ln,qn,Dn,Xn);break;case xl:sn(Rn,Ln,qn,Dn,Xn,1);break;case Xl:sn(Rn,Ln,qn,Dn,Xn,1),Wa(Dn,Xn,0,qn,1,0);break;case yl:sn(Rn,Ln,qn,Dn,Xn,0);break;case bl:sn(Rn,Ln,qn,Dn,Xn,0),Wa(Dn,Xn,1,qn,1,0);break;case ql:Aa(Rn,Ln,qn,Dn,Xn);break;case Yl:Aa(Rn,Ln,qn,Dn,Xn),Vc(Dn,Xn,qn,1,0);break;case ru:ia(Rn,Ln,qn,Dn,Xn);break;default:Re(0)}Jr+=rn,_n+=Fn}er.Ma+=qr}else alert("todo:EmitRescaledRowsYUVA");Re(er.Ma<=Er.height)}}er.C=lr,Re(er.C<=er.i)}function ts(er){var lr;if(0<er.ua)return 0;for(lr=0;lr<er.Wb;++lr){var Er=er.Ya[lr].G,Or=er.Ya[lr].H;if(0<Er[1][Or[1]+0].g||0<Er[2][Or[2]+0].g||0<Er[3][Or[3]+0].g)return 0}return 1}function cs(er,lr,Er,Or,zr,qr){if(er.Z!=0){var Xr=er.qd,Jr=er.rd;for(Re(Gi[er.Z]!=null);lr<Er;++lr)Gi[er.Z](Xr,Jr,Or,zr,Or,zr,qr),Xr=Or,Jr=zr,zr+=qr;er.qd=Xr,er.rd=Jr}}function Sn(er,lr){var Er=er.l.ma,Or=Er.Z==0||Er.Z==1?er.l.j:er.C;if(Or=er.C<Or?Or:er.C,Re(lr<=er.l.o),lr>Or){var zr=er.l.width,qr=Er.ca,Xr=Er.tb+zr*Or,Jr=er.V,rn=er.Ba+er.c*Or,dn=er.gc;Re(er.ab==1),Re(dn[0].hc==3),Wl(dn[0],Or,lr,Jr,rn,qr,Xr),cs(Er,Or,lr,qr,Xr,zr)}er.C=er.Ma=lr}function mn(er,lr,Er,Or,zr,qr,Xr){var Jr=er.$/Or,rn=er.$%Or,dn=er.m,_n=er.s,Fn=Er+er.$,pn=Fn;zr=Er+Or*zr;var Rn=Er+Or*qr,Ln=280+_n.ua,qn=er.Pb?Jr:16777216,Dn=0<_n.ua?_n.Wa:null,Xn=_n.wc,Zn=Fn<Rn?Un(_n,rn,Jr):null;Re(er.C<qr),Re(Rn<=zr);var as=!1;e:for(;;){for(;as||Fn<Rn;){var rs=0;if(Jr>=qn){var _s=Fn-Er;Re((qn=er).Pb),qn.wd=qn.m,qn.xd=_s,0<qn.s.ua&&Lr(qn.s.Wa,qn.s.vb),qn=Jr+fd}if(rn&Xn||(Zn=Un(_n,rn,Jr)),Re(Zn!=null),Zn.Qb&&(lr[Fn]=Zn.qb,as=!0),!as)if(Ir(dn),Zn.jc){rs=dn,_s=lr;var ys=Fn,Os=Zn.pd[ur(rs)&wa-1];Re(Zn.jc),256>Os.g?(_r(rs,rs.u+Os.g),_s[ys]=Os.value,rs=0):(_r(rs,rs.u+Os.g-256),Re(256<=Os.value),rs=Os.value),rs==0&&(as=!0)}else rs=Vn(Zn.G[0],Zn.H[0],dn);if(dn.h)break;if(as||256>rs){if(!as)if(Zn.nd)lr[Fn]=(Zn.qb|rs<<8)>>>0;else{if(Ir(dn),as=Vn(Zn.G[1],Zn.H[1],dn),Ir(dn),_s=Vn(Zn.G[2],Zn.H[2],dn),ys=Vn(Zn.G[3],Zn.H[3],dn),dn.h)break;lr[Fn]=(ys<<24|as<<16|rs<<8|_s)>>>0}if(as=!1,++Fn,++rn>=Or&&(rn=0,++Jr,Xr!=null&&Jr<=qr&&!(Jr%16)&&Xr(er,Jr),Dn!=null))for(;pn<Fn;)rs=lr[pn++],Dn.X[(506832829*rs&4294967295)>>>Dn.Mb]=rs}else if(280>rs){if(rs=jn(rs-256,dn),_s=Vn(Zn.G[4],Zn.H[4],dn),Ir(dn),_s=$n(Or,_s=jn(_s,dn)),dn.h)break;if(Fn-Er<_s||zr-Fn<rs)break e;for(ys=0;ys<rs;++ys)lr[Fn+ys]=lr[Fn+ys-_s];for(Fn+=rs,rn+=rs;rn>=Or;)rn-=Or,++Jr,Xr!=null&&Jr<=qr&&!(Jr%16)&&Xr(er,Jr);if(Re(Fn<=zr),rn&Xn&&(Zn=Un(_n,rn,Jr)),Dn!=null)for(;pn<Fn;)rs=lr[pn++],Dn.X[(506832829*rs&4294967295)>>>Dn.Mb]=rs}else{if(!(rs<Ln))break e;for(as=rs-280,Re(Dn!=null);pn<Fn;)rs=lr[pn++],Dn.X[(506832829*rs&4294967295)>>>Dn.Mb]=rs;rs=Fn,Re(!(as>>>(_s=Dn).Xa)),lr[rs]=_s.X[as],as=!0}as||Re(dn.h==gr(dn))}if(er.Pb&&dn.h&&Fn<zr)Re(er.m.h),er.a=5,er.m=er.wd,er.$=er.xd,0<er.s.ua&&Lr(er.s.vb,er.s.Wa);else{if(dn.h)break e;Xr!=null&&Xr(er,Jr>qr?qr:Jr),er.a=0,er.$=Fn-Er}return 1}return er.a=3,0}function zn(er){Re(er!=null),er.vc=null,er.yc=null,er.Ya=null;var lr=er.Wa;lr!=null&&(lr.X=null),er.vb=null,Re(er!=null)}function os(){var er=new vs;return er==null?null:(er.a=0,er.xb=ou,On("Predictor","VP8LPredictors"),On("Predictor","VP8LPredictors_C"),On("PredictorAdd","VP8LPredictorsAdd"),On("PredictorAdd","VP8LPredictorsAdd_C"),Ca=tn,oa=wn,Ua=In,za=yn,Aa=Mn,ia=on,aa=Yr,or.VP8LMapColor32b=mo,or.VP8LMapColor8b=vi,er)}function ls(er,lr,Er,Or,zr){var qr=1,Xr=[er],Jr=[lr],rn=Or.m,dn=Or.s,_n=null,Fn=0;e:for(;;){if(Er)for(;qr&&kr(rn,1);){var pn=Xr,Rn=Jr,Ln=Or,qn=1,Dn=Ln.m,Xn=Ln.gc[Ln.ab],Zn=kr(Dn,2);if(Ln.Oc&1<<Zn)qr=0;else{switch(Ln.Oc|=1<<Zn,Xn.hc=Zn,Xn.Ea=pn[0],Xn.nc=Rn[0],Xn.K=[null],++Ln.ab,Re(4>=Ln.ab),Zn){case 0:case 1:Xn.b=kr(Dn,3)+2,qn=ls(Cr(Xn.Ea,Xn.b),Cr(Xn.nc,Xn.b),0,Ln,Xn.K),Xn.K=Xn.K[0];break;case 3:var as,rs=kr(Dn,8)+1,_s=16<rs?0:4<rs?1:2<rs?2:3;if(pn[0]=Cr(Xn.Ea,_s),Xn.b=_s,as=qn=ls(rs,1,0,Ln,Xn.K)){var ys,Os=rs,Ss=Xn,$s=1<<(8>>Ss.b),bo=Me($s);if(bo==null)as=0;else{var Ms=Ss.K[0],ws=Ss.w;for(bo[0]=Ss.K[0][0],ys=1;ys<1*Os;++ys)bo[ys]=Mr(Ms[ws+ys],bo[ys-1]);for(;ys<4*$s;++ys)bo[ys]=0;Ss.K[0]=null,Ss.K[0]=bo,as=1}}qn=as;break;case 2:break;default:Re(0)}qr=qn}}if(Xr=Xr[0],Jr=Jr[0],qr&&kr(rn,1)&&!(qr=1<=(Fn=kr(rn,4))&&11>=Fn)){Or.a=3;break e}var ms;if(ms=qr)t:{var uo,Ls,Us,no=Or,_o=Xr,Uo=Jr,ao=Fn,Oo=Er,zo=no.m,vo=no.s,zs=[null],Vs=1,lo=0,Xs=hd[ao];r:for(;;){if(Oo&&kr(zo,1)){var Ao=kr(zo,3)+2,fi=Cr(_o,Ao),po=Cr(Uo,Ao),Go=fi*po;if(!ls(fi,po,0,no,zs))break r;for(zs=zs[0],vo.xc=Ao,uo=0;uo<Go;++uo){var Zs=zs[uo]>>8&65535;zs[uo]=Zs,Zs>=Vs&&(Vs=Zs+1)}}if(zo.h)break r;for(Ls=0;5>Ls;++Ls){var So=nu[Ls];!Ls&&0<ao&&(So+=1<<ao),lo<So&&(lo=So)}var Zo=De(Vs*Xs,hr),Ho=Vs,Qo=De(Ho,xr);if(Qo==null)var Jo=null;else Re(65536>=Ho),Jo=Qo;var qo=Me(lo);if(Jo==null||qo==null||Zo==null){no.a=1;break r}var ei=Zo;for(uo=Us=0;uo<Vs;++uo){var eo=Jo[uo],ti=eo.G,mi=eo.H,la=0,Ii=1,Ro=0;for(Ls=0;5>Ls;++Ls){So=nu[Ls],ti[Ls]=ei,mi[Ls]=Us,!Ls&&0<ao&&(So+=1<<ao);s:{var El,Jl=So,Cl=no,Va=qo,Od=ei,Md=Us,ec=0,qi=Cl.m,Dd=kr(qi,1);if(Oe(Va,0,0,Jl),Dd){var Nd=kr(qi,1)+1,$d=kr(qi,1),hu=kr(qi,$d==0?1:8);Va[hu]=1,Nd==2&&(Va[hu=kr(qi,8)]=1);var _l=1}else{var fu=Me(19),mu=kr(qi,4)+4;if(19<mu){Cl.a=3;var Al=0;break s}for(El=0;El<mu;++El)fu[dd[El]]=kr(qi,3);var tc=void 0,Xa=void 0,gu=Cl,Fd=fu,Rl=Jl,xu=Va,rc=0,Vi=gu.m,yu=8,bu=De(128,hr);n:for(;nr(bu,0,7,Fd,19);){if(kr(Vi,1)){var Bd=2+2*kr(Vi,3);if((tc=2+kr(Vi,Bd))>Rl)break n}else tc=Rl;for(Xa=0;Xa<Rl&&tc--;){Ir(Vi);var vu=bu[0+(127&ur(Vi))];_r(Vi,Vi.u+vu.g);var Ta=vu.value;if(16>Ta)xu[Xa++]=Ta,Ta!=0&&(yu=Ta);else{var Ud=Ta==16,Su=Ta-16,zd=cd[Su],wu=kr(Vi,ld[Su])+zd;if(Xa+wu>Rl)break n;for(var Hd=Ud?yu:0;0<wu--;)xu[Xa++]=Hd}}rc=1;break n}rc||(gu.a=3),_l=rc}(_l=_l&&!qi.h)&&(ec=nr(Od,Md,8,Va,Jl)),_l&&ec!=0?Al=ec:(Cl.a=3,Al=0)}if(Al==0)break r;if(Ii&&ud[Ls]==1&&(Ii=ei[Us].g==0),la+=ei[Us].g,Us+=Al,3>=Ls){var Ya,nc=qo[0];for(Ya=1;Ya<So;++Ya)qo[Ya]>nc&&(nc=qo[Ya]);Ro+=nc}}if(eo.nd=Ii,eo.Qb=0,Ii&&(eo.qb=(ti[3][mi[3]+0].value<<24|ti[1][mi[1]+0].value<<16|ti[2][mi[2]+0].value)>>>0,la==0&&256>ti[0][mi[0]+0].value&&(eo.Qb=1,eo.qb+=ti[0][mi[0]+0].value<<8)),eo.jc=!eo.Qb&&6>Ro,eo.jc){var Pl,Li=eo;for(Pl=0;Pl<wa;++Pl){var Xi=Pl,Yi=Li.pd[Xi],Tl=Li.G[0][Li.H[0]+Xi];256<=Tl.value?(Yi.g=Tl.g+256,Yi.value=Tl.value):(Yi.g=0,Yi.value=0,Xi>>=Qn(Tl,8,Yi),Xi>>=Qn(Li.G[1][Li.H[1]+Xi],16,Yi),Xi>>=Qn(Li.G[2][Li.H[2]+Xi],0,Yi),Qn(Li.G[3][Li.H[3]+Xi],24,Yi))}}}vo.vc=zs,vo.Wb=Vs,vo.Ya=Jo,vo.yc=Zo,ms=1;break t}ms=0}if(!(qr=ms)){Or.a=3;break e}if(0<Fn){if(dn.ua=1<<Fn,!Sr(dn.Wa,Fn)){Or.a=1,qr=0;break e}}else dn.ua=0;var sc=Or,Eu=Xr,Wd=Jr,oc=sc.s,ic=oc.xc;if(sc.c=Eu,sc.i=Wd,oc.md=Cr(Eu,ic),oc.wc=ic==0?-1:(1<<ic)-1,Er){Or.xb=Sd;break e}if((_n=Me(Xr*Jr))==null){Or.a=1,qr=0;break e}qr=(qr=mn(Or,_n,0,Xr,Jr,Jr,null))&&!rn.h;break e}return qr?(zr!=null?zr[0]=_n:(Re(_n==null),Re(Er)),Or.$=0,Er||zn(dn)):zn(dn),qr}function hs(er,lr){var Er=er.c*er.i,Or=Er+lr+16*lr;return Re(er.c<=lr),er.V=Me(Or),er.V==null?(er.Ta=null,er.Ua=0,er.a=1,0):(er.Ta=er.V,er.Ua=er.Ba+Er+lr,1)}function Cs(er,lr){var Er=er.C,Or=lr-Er,zr=er.V,qr=er.Ba+er.c*Er;for(Re(lr<=er.l.o);0<Or;){var Xr=16<Or?16:Or,Jr=er.l.ma,rn=er.l.width,dn=rn*Xr,_n=Jr.ca,Fn=Jr.tb+rn*Er,pn=er.Ta,Rn=er.Ua;fs(er,Xr,zr,qr),Yc(pn,Rn,_n,Fn,dn),cs(Jr,Er,Er+Xr,_n,Fn,rn),Or-=Xr,zr+=Xr*er.c,Er+=Xr}Re(Er==lr),er.C=er.Ma=lr}function Ds(){this.ub=this.yd=this.td=this.Rb=0}function ho(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Mo(){this.Fb=this.Bb=this.Cb=0,this.Zb=Me(4),this.Lb=Me(4)}function Po(){this.Yb=function(){var er=[];return function lr(Er,Or,zr){for(var qr=zr[Or],Xr=0;Xr<qr&&(Er.push(zr.length>Or+1?[]:0),!(zr.length<Or+1));Xr++)lr(Er[Xr],Or+1,zr)}(er,0,[3,11]),er}()}function wo(){this.jb=Me(3),this.Wc=$e([4,8],Po),this.Xc=$e([4,17],Po)}function ri(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new Me(4),this.od=new Me(4)}function go(){this.ld=this.La=this.dd=this.tc=0}function Vo(){this.Na=this.la=0}function Nn(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Kn(){this.ad=Me(384),this.Za=0,this.Ob=Me(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function ds(){this.uc=this.M=this.Nb=0,this.wa=Array(new go),this.Y=0,this.ya=Array(new Kn),this.aa=0,this.l=new Gs}function xs(){this.y=Me(16),this.f=Me(8),this.ea=Me(8)}function js(){this.cb=this.a=0,this.sc="",this.m=new cr,this.Od=new Ds,this.Kc=new ho,this.ed=new ri,this.Qa=new Mo,this.Ic=this.$c=this.Aa=0,this.D=new ds,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=De(8,cr),this.ia=0,this.pb=De(4,Nn),this.Pa=new wo,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new xs),this.Hd=0,this.rb=Array(new Vo),this.sb=0,this.wa=Array(new go),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Kn),this.L=this.aa=0,this.gd=$e([4,2],go),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Ws(er,lr){return 0>er?0:er>lr?lr:er}function Gs(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function qs(){var er=new js;return er!=null&&(er.a=0,er.sc="OK",er.cb=0,er.Xb=0,Ga||(Ga=Ts)),er}function Ns(er,lr,Er){return er.a==0&&(er.a=lr,er.sc=Er,er.cb=0),0}function ps(er,lr,Er){return 3<=Er&&er[lr+0]==157&&er[lr+1]==1&&er[lr+2]==42}function us(er,lr){if(er==null)return 0;if(er.a=0,er.sc="OK",lr==null)return Ns(er,2,"null VP8Io passed to VP8GetHeaders()");var Er=lr.data,Or=lr.w,zr=lr.ha;if(4>zr)return Ns(er,7,"Truncated header.");var qr=Er[Or+0]|Er[Or+1]<<8|Er[Or+2]<<16,Xr=er.Od;if(Xr.Rb=!(1&qr),Xr.td=qr>>1&7,Xr.yd=qr>>4&1,Xr.ub=qr>>5,3<Xr.td)return Ns(er,3,"Incorrect keyframe parameters.");if(!Xr.yd)return Ns(er,4,"Frame not displayable.");Or+=3,zr-=3;var Jr=er.Kc;if(Xr.Rb){if(7>zr)return Ns(er,7,"cannot parse picture header");if(!ps(Er,Or,zr))return Ns(er,3,"Bad code word");Jr.c=16383&(Er[Or+4]<<8|Er[Or+3]),Jr.Td=Er[Or+4]>>6,Jr.i=16383&(Er[Or+6]<<8|Er[Or+5]),Jr.Ud=Er[Or+6]>>6,Or+=7,zr-=7,er.za=Jr.c+15>>4,er.Ub=Jr.i+15>>4,lr.width=Jr.c,lr.height=Jr.i,lr.Da=0,lr.j=0,lr.v=0,lr.va=lr.width,lr.o=lr.height,lr.da=0,lr.ib=lr.width,lr.hb=lr.height,lr.U=lr.width,lr.T=lr.height,Oe((qr=er.Pa).jb,0,255,qr.jb.length),Re((qr=er.Qa)!=null),qr.Cb=0,qr.Bb=0,qr.Fb=1,Oe(qr.Zb,0,0,qr.Zb.length),Oe(qr.Lb,0,0,qr.Lb)}if(Xr.ub>zr)return Ns(er,7,"bad partition length");Rr(qr=er.m,Er,Or,Xr.ub),Or+=Xr.ub,zr-=Xr.ub,Xr.Rb&&(Jr.Ld=Tr(qr),Jr.Kd=Tr(qr)),Jr=er.Qa;var rn,dn=er.Pa;if(Re(qr!=null),Re(Jr!=null),Jr.Cb=Tr(qr),Jr.Cb){if(Jr.Bb=Tr(qr),Tr(qr)){for(Jr.Fb=Tr(qr),rn=0;4>rn;++rn)Jr.Zb[rn]=Tr(qr)?wr(qr,7):0;for(rn=0;4>rn;++rn)Jr.Lb[rn]=Tr(qr)?wr(qr,6):0}if(Jr.Bb)for(rn=0;3>rn;++rn)dn.jb[rn]=Tr(qr)?br(qr,8):255}else Jr.Bb=0;if(qr.Ka)return Ns(er,3,"cannot parse segment header");if((Jr=er.ed).zd=Tr(qr),Jr.Tb=br(qr,6),Jr.wb=br(qr,3),Jr.Pc=Tr(qr),Jr.Pc&&Tr(qr)){for(dn=0;4>dn;++dn)Tr(qr)&&(Jr.vd[dn]=wr(qr,6));for(dn=0;4>dn;++dn)Tr(qr)&&(Jr.od[dn]=wr(qr,6))}if(er.L=Jr.Tb==0?0:Jr.zd?1:2,qr.Ka)return Ns(er,3,"cannot parse filter header");var _n=zr;if(zr=rn=Or,Or=rn+_n,Jr=_n,er.Xb=(1<<br(er.m,2))-1,_n<3*(dn=er.Xb))Er=7;else{for(rn+=3*dn,Jr-=3*dn,_n=0;_n<dn;++_n){var Fn=Er[zr+0]|Er[zr+1]<<8|Er[zr+2]<<16;Fn>Jr&&(Fn=Jr),Rr(er.Jc[+_n],Er,rn,Fn),rn+=Fn,Jr-=Fn,zr+=3}Rr(er.Jc[+dn],Er,rn,Jr),Er=rn<Or?0:5}if(Er!=0)return Ns(er,Er,"cannot parse partitions");for(Er=br(rn=er.m,7),zr=Tr(rn)?wr(rn,4):0,Or=Tr(rn)?wr(rn,4):0,Jr=Tr(rn)?wr(rn,4):0,dn=Tr(rn)?wr(rn,4):0,rn=Tr(rn)?wr(rn,4):0,_n=er.Qa,Fn=0;4>Fn;++Fn){if(_n.Cb){var pn=_n.Zb[Fn];_n.Fb||(pn+=Er)}else{if(0<Fn){er.pb[Fn]=er.pb[0];continue}pn=Er}var Rn=er.pb[Fn];Rn.Sc[0]=Kl[Ws(pn+zr,127)],Rn.Sc[1]=Zl[Ws(pn+0,127)],Rn.Eb[0]=2*Kl[Ws(pn+Or,127)],Rn.Eb[1]=101581*Zl[Ws(pn+Jr,127)]>>16,8>Rn.Eb[1]&&(Rn.Eb[1]=8),Rn.Qc[0]=Kl[Ws(pn+dn,117)],Rn.Qc[1]=Zl[Ws(pn+rn,127)],Rn.lc=pn+rn}if(!Xr.Rb)return Ns(er,4,"Not a key frame.");for(Tr(qr),Xr=er.Pa,Er=0;4>Er;++Er){for(zr=0;8>zr;++zr)for(Or=0;3>Or;++Or)for(Jr=0;11>Jr;++Jr)dn=Nr(qr,bd[Er][zr][Or][Jr])?br(qr,8):xd[Er][zr][Or][Jr],Xr.Wc[Er][zr].Yb[Or][Jr]=dn;for(zr=0;17>zr;++zr)Xr.Xc[Er][zr]=Xr.Wc[Er][vd[zr]]}return er.kc=Tr(qr),er.kc&&(er.Bd=br(qr,8)),er.cb=1}function Ts(er,lr,Er,Or,zr,qr,Xr){var Jr=lr[zr].Yb[Er];for(Er=0;16>zr;++zr){if(!Nr(er,Jr[Er+0]))return zr;for(;!Nr(er,Jr[Er+1]);)if(Jr=lr[++zr].Yb[0],Er=0,zr==16)return 16;var rn=lr[zr+1].Yb;if(Nr(er,Jr[Er+2])){var dn=er,_n=0;if(Nr(dn,(pn=Jr)[(Fn=Er)+3]))if(Nr(dn,pn[Fn+6])){for(Jr=0,Fn=2*(_n=Nr(dn,pn[Fn+8]))+(pn=Nr(dn,pn[Fn+9+_n])),_n=0,pn=md[Fn];pn[Jr];++Jr)_n+=_n+Nr(dn,pn[Jr]);_n+=3+(8<<Fn)}else Nr(dn,pn[Fn+7])?(_n=7+2*Nr(dn,165),_n+=Nr(dn,145)):_n=5+Nr(dn,159);else _n=Nr(dn,pn[Fn+4])?3+Nr(dn,pn[Fn+5]):2;Jr=rn[2]}else _n=1,Jr=rn[1];rn=Xr+gd[zr],0>(dn=er).b&&Ar(dn);var Fn,pn=dn.b,Rn=(Fn=dn.Ca>>1)-(dn.I>>pn)>>31;--dn.b,dn.Ca+=Rn,dn.Ca|=1,dn.I-=(Fn+1&Rn)<<pn,qr[rn]=((_n^Rn)-Rn)*Or[(0<zr)+0]}return 16}function As(er){var lr=er.rb[er.sb-1];lr.la=0,lr.Na=0,Oe(er.zc,0,0,er.zc.length),er.ja=0}function Fs(er,lr,Er,Or,zr){zr=er[lr+Er+32*Or]+(zr>>3),er[lr+Er+32*Or]=-256&zr?0>zr?0:255:zr}function Co(er,lr,Er,Or,zr,qr){Fs(er,lr,0,Er,Or+zr),Fs(er,lr,1,Er,Or+qr),Fs(er,lr,2,Er,Or-qr),Fs(er,lr,3,Er,Or-zr)}function Eo(er){return(20091*er>>16)+er}function xo(er,lr,Er,Or){var zr,qr=0,Xr=Me(16);for(zr=0;4>zr;++zr){var Jr=er[lr+0]+er[lr+8],rn=er[lr+0]-er[lr+8],dn=(35468*er[lr+4]>>16)-Eo(er[lr+12]),_n=Eo(er[lr+4])+(35468*er[lr+12]>>16);Xr[qr+0]=Jr+_n,Xr[qr+1]=rn+dn,Xr[qr+2]=rn-dn,Xr[qr+3]=Jr-_n,qr+=4,lr++}for(zr=qr=0;4>zr;++zr)Jr=(er=Xr[qr+0]+4)+Xr[qr+8],rn=er-Xr[qr+8],dn=(35468*Xr[qr+4]>>16)-Eo(Xr[qr+12]),Fs(Er,Or,0,0,Jr+(_n=Eo(Xr[qr+4])+(35468*Xr[qr+12]>>16))),Fs(Er,Or,1,0,rn+dn),Fs(Er,Or,2,0,rn-dn),Fs(Er,Or,3,0,Jr-_n),qr++,Or+=32}
vendor: 4,763 bytes, line 4154
4154function ua(er,lr,Er,Or){var zr=er[lr+0]+4,qr=35468*er[lr+4]>>16,Xr=Eo(er[lr+4]),Jr=35468*er[lr+1]>>16;Co(Er,Or,0,zr+Xr,er=Eo(er[lr+1]),Jr),Co(Er,Or,1,zr+qr,er,Jr),Co(Er,Or,2,zr-qr,er,Jr),Co(Er,Or,3,zr-Xr,er,Jr)}function Ma(er,lr,Er,Or,zr){xo(er,lr,Er,Or),zr&&xo(er,lr+16,Er,Or+4)}function Da(er,lr,Er,Or){Ti(er,lr+0,Er,Or,1),Ti(er,lr+32,Er,Or+128,1)}function wi(er,lr,Er,Or){var zr;for(er=er[lr+0]+4,zr=0;4>zr;++zr)for(lr=0;4>lr;++lr)Fs(Er,Or,lr,zr,er)}function Xo(er,lr,Er,Or){er[lr+0]&&Lo(er,lr+0,Er,Or),er[lr+16]&&Lo(er,lr+16,Er,Or+4),er[lr+32]&&Lo(er,lr+32,Er,Or+128),er[lr+48]&&Lo(er,lr+48,Er,Or+128+4)}function da(er,lr,Er,Or){var zr,qr=Me(16);for(zr=0;4>zr;++zr){var Xr=er[lr+0+zr]+er[lr+12+zr],Jr=er[lr+4+zr]+er[lr+8+zr],rn=er[lr+4+zr]-er[lr+8+zr],dn=er[lr+0+zr]-er[lr+12+zr];qr[0+zr]=Xr+Jr,qr[8+zr]=Xr-Jr,qr[4+zr]=dn+rn,qr[12+zr]=dn-rn}for(zr=0;4>zr;++zr)Xr=(er=qr[0+4*zr]+3)+qr[3+4*zr],Jr=qr[1+4*zr]+qr[2+4*zr],rn=qr[1+4*zr]-qr[2+4*zr],dn=er-qr[3+4*zr],Er[Or+0]=Xr+Jr>>3,Er[Or+16]=dn+rn>>3,Er[Or+32]=Xr-Jr>>3,Er[Or+48]=dn-rn>>3,Or+=64}function gi(er,lr,Er){var Or,zr=lr-32,qr=Ko,Xr=255-er[zr-1];for(Or=0;Or<Er;++Or){var Jr,rn=qr,dn=Xr+er[lr-1];for(Jr=0;Jr<Er;++Jr)er[lr+Jr]=rn[dn+er[zr+Jr]];lr+=32}}function Mi(er,lr){gi(er,lr,4)}function Di(er,lr){gi(er,lr,8)}function pa(er,lr){gi(er,lr,16)}function ha(er,lr){var Er;for(Er=0;16>Er;++Er)je(er,lr+32*Er,er,lr-32,16)}function fa(er,lr){var Er;for(Er=16;0<Er;--Er)Oe(er,lr,er[lr-1],16),lr+=32}function ai(er,lr,Er){var Or;for(Or=0;16>Or;++Or)Oe(lr,Er+32*Or,er,16)}function ma(er,lr){var Er,Or=16;for(Er=0;16>Er;++Er)Or+=er[lr-1+32*Er]+er[lr+Er-32];ai(Or>>5,er,lr)}function li(er,lr){var Er,Or=8;for(Er=0;16>Er;++Er)Or+=er[lr-1+32*Er];ai(Or>>4,er,lr)}function ga(er,lr){var Er,Or=8;for(Er=0;16>Er;++Er)Or+=er[lr+Er-32];ai(Or>>4,er,lr)}function xi(er,lr){ai(128,er,lr)}function Rs(er,lr,Er){return er+2*lr+Er+2>>2}function fn(er,lr){var Er,Or=lr-32;for(Or=new Uint8Array([Rs(er[Or-1],er[Or+0],er[Or+1]),Rs(er[Or+0],er[Or+1],er[Or+2]),Rs(er[Or+1],er[Or+2],er[Or+3]),Rs(er[Or+2],er[Or+3],er[Or+4])]),Er=0;4>Er;++Er)je(er,lr+32*Er,Or,0,Or.length)}function gs(er,lr){var Er=er[lr-1],Or=er[lr-1+32],zr=er[lr-1+64],qr=er[lr-1+96];Br(er,lr+0,16843009*Rs(er[lr-1-32],Er,Or)),Br(er,lr+32,16843009*Rs(Er,Or,zr)),Br(er,lr+64,16843009*Rs(Or,zr,qr)),Br(er,lr+96,16843009*Rs(zr,qr,qr))}function Ps(er,lr){var Er,Or=4;for(Er=0;4>Er;++Er)Or+=er[lr+Er-32]+er[lr-1+32*Er];for(Or>>=3,Er=0;4>Er;++Er)Oe(er,lr+32*Er,Or,4)}function Hs(er,lr){var Er=er[lr-1+0],Or=er[lr-1+32],zr=er[lr-1+64],qr=er[lr-1-32],Xr=er[lr+0-32],Jr=er[lr+1-32],rn=er[lr+2-32],dn=er[lr+3-32];er[lr+0+96]=Rs(Or,zr,er[lr-1+96]),er[lr+1+96]=er[lr+0+64]=Rs(Er,Or,zr),er[lr+2+96]=er[lr+1+64]=er[lr+0+32]=Rs(qr,Er,Or),er[lr+3+96]=er[lr+2+64]=er[lr+1+32]=er[lr+0+0]=Rs(Xr,qr,Er),er[lr+3+64]=er[lr+2+32]=er[lr+1+0]=Rs(Jr,Xr,qr),er[lr+3+32]=er[lr+2+0]=Rs(rn,Jr,Xr),er[lr+3+0]=Rs(dn,rn,Jr)}function so(er,lr){var Er=er[lr+1-32],Or=er[lr+2-32],zr=er[lr+3-32],qr=er[lr+4-32],Xr=er[lr+5-32],Jr=er[lr+6-32],rn=er[lr+7-32];er[lr+0+0]=Rs(er[lr+0-32],Er,Or),er[lr+1+0]=er[lr+0+32]=Rs(Er,Or,zr),er[lr+2+0]=er[lr+1+32]=er[lr+0+64]=Rs(Or,zr,qr),er[lr+3+0]=er[lr+2+32]=er[lr+1+64]=er[lr+0+96]=Rs(zr,qr,Xr),er[lr+3+32]=er[lr+2+64]=er[lr+1+96]=Rs(qr,Xr,Jr),er[lr+3+64]=er[lr+2+96]=Rs(Xr,Jr,rn),er[lr+3+96]=Rs(Jr,rn,rn)}function To(er,lr){var Er=er[lr-1+0],Or=er[lr-1+32],zr=er[lr-1+64],qr=er[lr-1-32],Xr=er[lr+0-32],Jr=er[lr+1-32],rn=er[lr+2-32],dn=er[lr+3-32];er[lr+0+0]=er[lr+1+64]=qr+Xr+1>>1,er[lr+1+0]=er[lr+2+64]=Xr+Jr+1>>1,er[lr+2+0]=er[lr+3+64]=Jr+rn+1>>1,er[lr+3+0]=rn+dn+1>>1,er[lr+0+96]=Rs(zr,Or,Er),er[lr+0+64]=Rs(Or,Er,qr),er[lr+0+32]=er[lr+1+96]=Rs(Er,qr,Xr),er[lr+1+32]=er[lr+2+96]=Rs(qr,Xr,Jr),er[lr+2+32]=er[lr+3+96]=Rs(Xr,Jr,rn),er[lr+3+32]=Rs(Jr,rn,dn)}function Do(er,lr){var Er=er[lr+0-32],Or=er[lr+1-32],zr=er[lr+2-32],qr=er[lr+3-32],Xr=er[lr+4-32],Jr=er[lr+5-32],rn=er[lr+6-32],dn=er[lr+7-32];er[lr+0+0]=Er+Or+1>>1,er[lr+1+0]=er[lr+0+64]=Or+zr+1>>1,er[lr+2+0]=er[lr+1+64]=zr+qr+1>>1,er[lr+3+0]=er[lr+2+64]=qr+Xr+1>>1,er[lr+0+32]=Rs(Er,Or,zr),er[lr+1+32]=er[lr+0+96]=Rs(Or,zr,qr),er[lr+2+32]=er[lr+1+96]=Rs(zr,qr,Xr),er[lr+3+32]=er[lr+2+96]=Rs(qr,Xr,Jr),er[lr+3+64]=Rs(Xr,Jr,rn),er[lr+3+96]=Rs(Jr,rn,dn)}function Ni(er,lr){var Er=er[lr-1+0],Or=er[lr-1+32],zr=er[lr-1+64],qr=er[lr-1+96];er[lr+0+0]=Er+Or+1>>1,er[lr+2+0]=er[lr+0+32]=Or+zr+1>>1,er[lr+2+32]=er[lr+0+64]=zr+qr+1>>1,er[lr+1+0]=Rs(Er,Or,zr),er[lr+3+0]=er[lr+1+32]=Rs(Or,zr,qr),er[lr+3+32]=er[lr+1+64]=Rs(zr,qr,qr),er[lr+3+64]=er[lr+2+64]=er[lr+0+96]=er[lr+1+96]=er[lr+2+96]=er[lr+3+96]=qr}function yi(er,lr){var Er=er[lr-1+0],Or=er[lr-1+32],zr=er[lr-1+64],qr=er[lr-1+96],Xr=er[lr-1-32],Jr=er[lr+0-32],rn=er[lr+1-32],dn=er[lr+2-32];er[lr+0+0]=er[lr+2+32]=Er+Xr+1>>1,er[lr+0+32]=er[lr+2+64]=Or+Er+1>
vendor: 20,452 bytes, line 4154
4154>1,er[lr+0+64]=er[lr+2+96]=zr+Or+1>>1,er[lr+0+96]=qr+zr+1>>1,er[lr+3+0]=Rs(Jr,rn,dn),er[lr+2+0]=Rs(Xr,Jr,rn),er[lr+1+0]=er[lr+3+32]=Rs(Er,Xr,Jr),er[lr+1+32]=er[lr+3+64]=Rs(Or,Er,Xr),er[lr+1+64]=er[lr+3+96]=Rs(zr,Or,Er),er[lr+1+96]=Rs(qr,zr,Or)}function ci(er,lr){var Er;for(Er=0;8>Er;++Er)je(er,lr+32*Er,er,lr-32,8)}function Ei(er,lr){var Er;for(Er=0;8>Er;++Er)Oe(er,lr,er[lr-1],8),lr+=32}function Yo(er,lr,Er){var Or;for(Or=0;8>Or;++Or)Oe(lr,Er+32*Or,er,8)}function xa(er,lr){var Er,Or=8;for(Er=0;8>Er;++Er)Or+=er[lr+Er-32]+er[lr-1+32*Er];Yo(Or>>4,er,lr)}function Ci(er,lr){var Er,Or=4;for(Er=0;8>Er;++Er)Or+=er[lr+Er-32];Yo(Or>>3,er,lr)}function ya(er,lr){var Er,Or=4;for(Er=0;8>Er;++Er)Or+=er[lr-1+32*Er];Yo(Or>>3,er,lr)}function No(er,lr){Yo(128,er,lr)}function to(er,lr,Er){var Or=er[lr-Er],zr=er[lr+0],qr=3*(zr-Or)+Gl[1020+er[lr-2*Er]-er[lr+Er]],Xr=hl[112+(qr+4>>3)];er[lr-Er]=Ko[255+Or+hl[112+(qr+3>>3)]],er[lr+0]=Ko[255+zr-Xr]}function ko(er,lr,Er,Or){var zr=er[lr+0],qr=er[lr+Er];return si[255+er[lr-2*Er]-er[lr-Er]]>Or||si[255+qr-zr]>Or}function ui(er,lr,Er,Or){return 4*si[255+er[lr-Er]-er[lr+0]]+si[255+er[lr-2*Er]-er[lr+Er]]<=Or}function $o(er,lr,Er,Or,zr){var qr=er[lr-3*Er],Xr=er[lr-2*Er],Jr=er[lr-Er],rn=er[lr+0],dn=er[lr+Er],_n=er[lr+2*Er],Fn=er[lr+3*Er];return 4*si[255+Jr-rn]+si[255+Xr-dn]>Or?0:si[255+er[lr-4*Er]-qr]<=zr&&si[255+qr-Xr]<=zr&&si[255+Xr-Jr]<=zr&&si[255+Fn-_n]<=zr&&si[255+_n-dn]<=zr&&si[255+dn-rn]<=zr}function di(er,lr,Er,Or){var zr=2*Or+1;for(Or=0;16>Or;++Or)ui(er,lr+Or,Er,zr)&&to(er,lr+Or,Er)}function _i(er,lr,Er,Or){var zr=2*Or+1;for(Or=0;16>Or;++Or)ui(er,lr+Or*Er,1,zr)&&to(er,lr+Or*Er,1)}function $i(er,lr,Er,Or){var zr;for(zr=3;0<zr;--zr)di(er,lr+=4*Er,Er,Or)}function ol(er,lr,Er,Or){var zr;for(zr=3;0<zr;--zr)_i(er,lr+=4,Er,Or)}function Ai(er,lr,Er,Or,zr,qr,Xr,Jr){for(qr=2*qr+1;0<zr--;){if($o(er,lr,Er,qr,Xr))if(ko(er,lr,Er,Jr))to(er,lr,Er);else{var rn=er,dn=lr,_n=Er,Fn=rn[dn-2*_n],pn=rn[dn-_n],Rn=rn[dn+0],Ln=rn[dn+_n],qn=rn[dn+2*_n],Dn=27*(Zn=Gl[1020+3*(Rn-pn)+Gl[1020+Fn-Ln]])+63>>7,Xn=18*Zn+63>>7,Zn=9*Zn+63>>7;rn[dn-3*_n]=Ko[255+rn[dn-3*_n]+Zn],rn[dn-2*_n]=Ko[255+Fn+Xn],rn[dn-_n]=Ko[255+pn+Dn],rn[dn+0]=Ko[255+Rn-Dn],rn[dn+_n]=Ko[255+Ln-Xn],rn[dn+2*_n]=Ko[255+qn-Zn]}lr+=Or}}function Ri(er,lr,Er,Or,zr,qr,Xr,Jr){for(qr=2*qr+1;0<zr--;){if($o(er,lr,Er,qr,Xr))if(ko(er,lr,Er,Jr))to(er,lr,Er);else{var rn=er,dn=lr,_n=Er,Fn=rn[dn-_n],pn=rn[dn+0],Rn=rn[dn+_n],Ln=hl[112+(4+(qn=3*(pn-Fn))>>3)],qn=hl[112+(qn+3>>3)],Dn=Ln+1>>1;rn[dn-2*_n]=Ko[255+rn[dn-2*_n]+Dn],rn[dn-_n]=Ko[255+Fn+qn],rn[dn+0]=Ko[255+pn-Ln],rn[dn+_n]=Ko[255+Rn-Dn]}lr+=Or}}function il(er,lr,Er,Or,zr,qr){Ai(er,lr,Er,1,16,Or,zr,qr)}function al(er,lr,Er,Or,zr,qr){Ai(er,lr,1,Er,16,Or,zr,qr)}function ll(er,lr,Er,Or,zr,qr){var Xr;for(Xr=3;0<Xr;--Xr)Ri(er,lr+=4*Er,Er,1,16,Or,zr,qr)}function Ki(er,lr,Er,Or,zr,qr){var Xr;for(Xr=3;0<Xr;--Xr)Ri(er,lr+=4,1,Er,16,Or,zr,qr)}function cl(er,lr,Er,Or,zr,qr,Xr,Jr){Ai(er,lr,zr,1,8,qr,Xr,Jr),Ai(Er,Or,zr,1,8,qr,Xr,Jr)}function yr(er,lr,Er,Or,zr,qr,Xr,Jr){Ai(er,lr,1,zr,8,qr,Xr,Jr),Ai(Er,Or,1,zr,8,qr,Xr,Jr)}function Ur(er,lr,Er,Or,zr,qr,Xr,Jr){Ri(er,lr+4*zr,zr,1,8,qr,Xr,Jr),Ri(Er,Or+4*zr,zr,1,8,qr,Xr,Jr)}function un(er,lr,Er,Or,zr,qr,Xr,Jr){Ri(er,lr+4,1,zr,8,qr,Xr,Jr),Ri(Er,Or+4,1,zr,8,qr,Xr,Jr)}function bn(){this.ba=new xn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Wn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Tn(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Gn(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function es(){this.ua=0,this.Wa=new jr,this.vb=new jr,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new xr,this.yc=new hr}function vs(){this.xb=this.a=0,this.l=new Gs,this.ca=new xn,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new dr,this.Pb=0,this.wd=new dr,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new es,this.ab=0,this.gc=De(4,Gn),this.Oc=0}function bs(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Gs,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function ks(er,lr,Er,Or,zr,qr,Xr){for(er=er==null?0:er[lr+0],lr=0;lr<Xr;++lr)zr[qr+lr]=er+Er[Or+lr]&255,er=zr[qr+lr]}function Is(er,lr,Er,Or,zr,qr,Xr){var Jr;if(er==null)ks(null,null,Er,Or,zr,qr,Xr);else for(Jr=0;Jr<Xr;++Jr)zr[qr+Jr]=er[lr+Jr]+Er[Or+Jr]&255}function Bs(er,lr,Er,Or,zr,qr,Xr){if(er==null)ks(null,null,Er,Or,zr,qr,Xr);else{var Jr,rn=er[lr+0],dn=rn,_n=rn;for(Jr=0;Jr<Xr;++Jr)dn=_n+(rn=er[lr+Jr])-dn,_n=Er[Or+Jr]+(-256&dn?0>dn?0:255:dn)&255,dn=rn,zr[qr+Jr]=_n}}function fo(er,lr,Er,Or){var zr=lr.width,qr=lr.o;if(Re(er!=null&&lr!=null),0>Er||0>=Or||Er+Or>qr)return null;if(!er.Cc){if(er.ga==null){var Xr;if(er.ga=new bs,(Xr=er.ga==null)||(Xr=lr.width*lr.o,Re(er.Gb.length==0),er.Gb=Me(Xr),er.Uc=0,er.Gb==null?Xr=0:(er.mb=er.Gb,er.nb=er.Uc,er.rc=null,Xr=1),Xr=!Xr),!Xr){Xr=er.ga;var Jr=er.Fa,rn=er.P,dn=er.qc,_n=er.mb,Fn=er.nb,pn=rn+1,Rn=dn-1,Ln=Xr.l;if(Re(Jr!=null&&_n!=null&&lr!=null),Gi[0]=null,Gi[1]=ks,Gi[2]=Is,Gi[3]=Bs,Xr.ca=_n,Xr.tb=Fn,Xr.c=lr.width,Xr.i=lr.height,Re(0<Xr.c&&0<Xr.i),1>=dn)lr=0;else if(Xr.$a=3&Jr[rn+0],Xr.Z=Jr[rn+0]>>2&3,Xr.Lc=Jr[rn+0]>>4&3,rn=Jr[rn+0]>>6&3,0>Xr.$a||1<Xr.$a||4<=Xr.Z||1<Xr.Lc||rn)lr=0;else if(Ln.put=nn,Ln.ac=Gr,Ln.bc=En,Ln.ma=Xr,Ln.width=lr.width,Ln.height=lr.height,Ln.Da=lr.Da,Ln.v=lr.v,Ln.va=lr.va,Ln.j=lr.j,Ln.o=lr.o,Xr.$a)e:{Re(Xr.$a==1),lr=os();t:for(;;){if(lr==null){lr=0;break e}if(Re(Xr!=null),Xr.mc=lr,lr.c=Xr.c,lr.i=Xr.i,lr.l=Xr.l,lr.l.ma=Xr,lr.l.width=Xr.c,lr.l.height=Xr.i,lr.a=0,vr(lr.m,Jr,pn,Rn),!ls(Xr.c,Xr.i,1,lr,null)||(lr.ab==1&&lr.gc[0].hc==3&&ts(lr.s)?(Xr.ic=1,Jr=lr.c*lr.i,lr.Ta=null,lr.Ua=0,lr.V=Me(Jr),lr.Ba=0,lr.V==null?(lr.a=1,lr=0):lr=1):(Xr.ic=0,lr=hs(lr,Xr.c)),!lr))break t;lr=1;break e}Xr.mc=null,lr=0}else lr=Rn>=Xr.c*Xr.i;Xr=!lr}if(Xr)return null;er.ga.Lc!=1?er.Ga=0:Or=qr-Er}Re(er.ga!=null),Re(Er+Or<=qr);e:{if(lr=(Jr=er.ga).c,qr=Jr.l.o,Jr.$a==0){if(pn=er.rc,Rn=er.Vc,Ln=er.Fa,rn=er.P+1+Er*lr,dn=er.mb,_n=er.nb+Er*lr,Re(rn<=er.P+er.qc),Jr.Z!=0)for(Re(Gi[Jr.Z]!=null),Xr=0;Xr<Or;++Xr)Gi[Jr.Z](pn,Rn,Ln,rn,dn,_n,lr),pn=dn,Rn=_n,_n+=lr,rn+=lr;else for(Xr=0;Xr<Or;++Xr)je(dn,_n,Ln,rn,lr),pn=dn,Rn=_n,_n+=lr,rn+=lr;er.rc=pn,er.Vc=Rn}else{if(Re(Jr.mc!=null),lr=Er+Or,Re((Xr=Jr.mc)!=null),Re(lr<=Xr.i),Xr.C>=lr)lr=1;else if(Jr.ic||io(),Jr.ic){Jr=Xr.V,pn=Xr.Ba,Rn=Xr.c;var qn=Xr.i,Dn=(Ln=1,rn=Xr.$/Rn,dn=Xr.$%Rn,_n=Xr.m,Fn=Xr.s,Xr.$),Xn=Rn*qn,Zn=Rn*lr,as=Fn.wc,rs=Dn<Zn?Un(Fn,dn,rn):null;Re(Dn<=Xn),Re(lr<=qn),Re(ts(Fn));t:for(;;){for(;!_n.h&&Dn<Zn;){if(dn&as||(rs=Un(Fn,dn,rn)),Re(rs!=null),Ir(_n),256>(qn=Vn(rs.G[0],rs.H[0],_n)))Jr[pn+Dn]=qn,++Dn,++dn>=Rn&&(dn=0,++rn<=lr&&!(rn%16)&&Sn(Xr,rn));else{if(!(280>qn)){Ln=0;break t}qn=jn(qn-256,_n);var _s,ys=Vn(rs.G[4],rs.H[4],_n);if(Ir(_n),!(Dn>=(ys=$n(Rn,ys=jn(ys,_n)))&&Xn-Dn>=qn)){Ln=0;break t}for(_s=0;_s<qn;++_s)Jr[pn+Dn+_s]=Jr[pn+Dn+_s-ys];for(Dn+=qn,dn+=qn;dn>=Rn;)dn-=Rn,++rn<=lr&&!(rn%16)&&Sn(Xr,rn);Dn<Zn&&dn&as&&(rs=Un(Fn,dn,rn))}Re(_n.h==gr(_n))}Sn(Xr,rn>lr?lr:rn);break t}!Ln||_n.h&&Dn<Xn?(Ln=0,Xr.a=_n.h?5:3):Xr.$=Dn,lr=Ln}else lr=mn(Xr,Xr.V,Xr.Ba,Xr.c,Xr.i,lr,Cs);if(!lr){Or=0;break e}}Er+Or>=qr&&(er.Cc=1),Or=1}if(!Or)return null;if(er.Cc&&((Or=er.ga)!=null&&(Or.mc=null),er.ga=null,0<er.Ga))return alert("todo:WebPDequantizeLevels"),null}return er.nb+Er*zr}function Ks(er,lr,Er,Or,zr,qr){for(;0<zr--;){var Xr,Jr=er,rn=lr+(Er?1:0),dn=er,_n=lr+(Er?0:3);for(Xr=0;Xr<Or;++Xr){var Fn=dn[_n+4*Xr];Fn!=255&&(Fn*=32897,Jr[rn+4*Xr+0]=Jr[rn+4*Xr+0]*Fn>>23,Jr[rn+4*Xr+1]=Jr[rn+4*Xr+1]*Fn>>23,Jr[rn+4*Xr+2]=Jr[rn+4*Xr+2]*Fn>>23)}lr+=qr}}function Ys(er,lr,Er,Or,zr){for(;0<Or--;){var qr;for(qr=0;qr<Er;++qr){var Xr=er[lr+2*qr+0],Jr=15&(dn=er[lr+2*qr+1]),rn=4369*Jr,dn=(240&dn|dn>>4)*rn>>16;er[lr+2*qr+0]=(240&Xr|Xr>>4)*rn>>16&240|(15&Xr|Xr<<4)*rn>>16>>4&15,er[lr+2*qr+1]=240&dn|Jr}lr+=zr}}function ro(er,lr,Er,Or,zr,qr,Xr,Jr){var rn,dn,_n=255;for(dn=0;dn<zr;++dn){for(rn=0;rn<Or;++rn){var Fn=er[lr+rn];qr[Xr+4*rn]=Fn,_n&=Fn}lr+=Er,Xr+=Jr}return _n!=255}function oo(er,lr,Er,Or,zr){var qr;for(qr=0;qr<zr;++qr)Er[Or+qr]=er[lr+qr]>>8}function io(){Wa=Ks,Vc=Ys,Xc=ro,Yc=oo}function jo(er,lr,Er){or[er]=function(Or,zr,qr,Xr,Jr,rn,dn,_n,Fn,pn,Rn,Ln,qn,Dn,Xn,Zn,as){var rs,_s=as-1>>1,ys=Jr[rn+0]|dn[_n+0]<<16,Os=Fn[pn+0]|Rn[Ln+0]<<16;Re(Or!=null);var Ss=3*ys+Os+131074>>2;for(lr(Or[zr+0],255&Ss,Ss>>16,qn,Dn),qr!=null&&(Ss=3*Os+ys+131074>>2,lr(qr[Xr+0],255&Ss,Ss>>16,Xn,Zn)),rs=1;rs<=_s;++rs){var $s=Jr[rn+rs]|dn[_n+rs]<<16,bo=Fn[pn+rs]|Rn[Ln+rs]<<16,Ms=ys+$s+Os+bo+524296,ws=Ms+2*($s+Os)>>3;Ss=ws+ys>>1,ys=(Ms=Ms+2*(ys+bo)>>3)+$s>>1,lr(Or[zr+2*rs-1],255&Ss,Ss>>16,qn,Dn+(2*rs-1)*Er),lr(Or[zr+2*rs-0],255&ys,ys>>16,qn,Dn+(2*rs-0)*Er),qr!=null&&(Ss=Ms+Os>>1,ys=ws+bo>>1,lr(qr[Xr+2*rs-1],255&Ss,Ss>>16,Xn,Zn+(2*rs-1)*Er),lr(qr[Xr+2*rs+0],255&ys,ys>>16,Xn,Zn+(2*rs+0)*Er)),ys=$s,Os=bo}1&as||(Ss=3*ys+Os+131074>>2,lr(Or[zr+as-1],255&Ss,Ss>>16,qn,Dn+(as-1)*Er),qr!=null&&(Ss=3*Os+ys+131074>>2,lr(qr[Xr+as-1],255&Ss,Ss>>16,Xn,Zn+(as-1)*Er)))}}function Pi(){oi[ml]=wd,oi[gl]=iu,oi[tu]=Ed,oi[xl]=au,oi[yl]=lu,oi[ql]=cu,oi[ru]=Cd,oi[Vl]=iu,oi[Xl]=au,oi[bl]=lu,oi[Yl]=cu}function Na(er){return er&-16384?0>er?0:255:er>>_d}function Zi(er,lr){return Na((19077*er>>8)+(26149*lr>>8)-14234)}function Qi(er,lr,Er){return Na((19077*er>>8)-(6419*lr>>8)-(13320*Er>>8)+8708)}function Fi(er,lr){return Na((19077*er>>8)+(33050*lr>>8)-17685)}function Ji(er,lr,Er,Or,zr){Or[zr+0]=Zi(er,Er),Or[zr+1]=Qi(er,lr,Er),Or[zr+2]=Fi(er,lr)}function ba(er,lr,Er,Or,zr){Or[zr+0]=Fi(er,lr),Or[zr+1]=Qi(er,lr,Er),Or[zr+2]=Zi(er,Er)}function va(er,lr,Er,Or,zr){var qr=Qi(er,lr,Er);lr=qr<<3&224|Fi(er,lr)>>3,Or[zr+0]=248&Zi(er,Er)|qr>>5,Or[zr+1]=lr}function Io(er,lr,Er,Or,zr){var qr=240&Fi(er,lr)|15;Or[zr+0]=240&Zi(er,Er)|Qi(er,lr,Er)>>4,Or[zr+1]=qr}function ea(er,lr,Er,Or,zr){Or[zr+0]=255,Ji(er,lr,Er,Or,zr+1)}function ta(er,lr,Er,Or,zr){ba(er,lr,Er,Or,zr),Or[zr+3]=255}function $a(er,lr,Er,Or,zr){Ji(er,lr,Er,Or,zr),Or[zr+3]=255}function bi(er,lr,Er){or[er]=function(Or,zr,qr,Xr,Jr,rn,dn,_n,Fn){for(var pn=_n+(-2&Fn)*Er;_n!=pn;)lr(Or[zr+0],qr[Xr+0],Jr[rn+0],dn,_n),lr(Or[zr+1],qr[Xr+0],Jr[rn+0],dn,_n+Er),zr+=2,++Xr,++rn,_n+=2*Er;1&Fn&&lr(Or[zr+0],qr[Xr+0],Jr[rn+0],dn,_n)}}function Fo(er,lr,Er){return Er==0?er==0?lr==0?6:5:lr==0?4:0:Er}function ul(er,lr,Er,Or,zr){switch(er>>>30){case 3:Ti(lr,Er,Or,zr,0);break;case 2:Hi(lr,Er,Or,zr);break;case 1:Lo(lr,Er,Or,zr)}}function Sa(er,lr){var Er,Or,zr=lr.M,qr=lr.Nb,Xr=er.oc,Jr=er.pc+40,rn=er.oc,dn=er.pc+584,_n=er.oc,Fn=er.pc+600;for(Er=0;16>Er;++Er)Xr[Jr+32*Er-1]=129;for(Er=0;8>Er;++Er)rn[dn+32*Er-1]=129,_n[Fn+32*Er-1]=129;for(0<zr?Xr[Jr-1-32]=rn[dn-1-32]=_n[Fn-1-32]=129:(Oe(Xr,Jr-32-1,127,21),Oe(rn,dn-32-1,127,9),Oe(_n,Fn-32-1,127,9)),Or=0;Or<er.za;++Or){var pn=lr.ya[lr.aa+Or];if(0<Or){for(Er=-1;16>Er;++Er)je(Xr,Jr+32*Er-4,Xr,Jr+32*Er+12,4);for(Er=-1;8>Er;++Er)je(rn,dn+32*Er-4,rn,dn+32*Er+4,4),je(_n,Fn+32*Er-4,_n,Fn+32*Er+4,4)}var Rn=er.Gd,Ln=er.Hd+Or,qn=pn.ad,Dn=pn.Hc;if(0<zr&&(je(Xr,Jr-32,Rn[Ln].y,0,16),je(rn,dn-32,Rn[Ln].f,0,8),je(_n,Fn-32,Rn[Ln].ea,0,8)),pn.Za){var Xn=Xr,Zn=Jr-32+16;for(0<zr&&(Or>=er.za-1?Oe(Xn,Zn,Rn[Ln].y[15],4):je(Xn,Zn,Rn[Ln+1].y,0,4)),Er=0;4>Er;Er++)Xn[Zn+128+Er]=Xn[Zn+256+Er]=Xn[Zn+384+Er]=Xn[Zn+0+Er];for(Er=0;16>Er;++Er,Dn<<=2)Xn=Xr,Zn=Jr+du[Er],hi[pn.Ob[Er]](Xn,Zn),ul(Dn,qn,16*+Er,Xn,Zn)}else if(Xn=Fo(Or,zr,pn.Ob[0]),Wi[Xn](Xr,Jr),Dn!=0)for(Er=0;16>Er;++Er,Dn<<=2)ul(Dn,qn,16*+Er,Xr,Jr+du[Er]);for(Er=pn.Gc,Xn=Fo(Or,zr,pn.Dd),ji[Xn](rn,dn),ji[Xn](_n,Fn),Dn=qn,Xn=rn,Zn=dn,255&(pn=0|Er)&&(170&pn?Ra(Dn,256,Xn,Zn):Si(Dn,256,Xn,Zn)),pn=_n,Dn=Fn,255&(Er>>=8)&&(170&Er?Ra(qn,320,pn,Dn):Si(qn,320,pn,Dn)),zr<er.Ub-1&&(je(Rn[Ln].y,0,Xr,Jr+480,16),je(Rn[Ln].f,0,rn,dn+224,8),je(Rn[Ln].ea,0,_n,Fn+224,8)),Er=8*qr*er.B,Rn=er.sa,Ln=er.ta+16*Or+16*qr*er.R,qn=er.qa,pn=er.ra+8*Or+Er,Dn=er.Ha,Xn=er.Ia+8*Or+Er,Er=0;16>Er;++Er)je(Rn,Ln+Er*er.R,Xr,Jr+32*Er,16);for(Er=0;8>Er;++Er)je(qn,pn+Er*er.B,rn,dn+32*Er,8),je(Dn,Xn+Er*er.B,_n,Fn+32*Er,8)}}function dl(er,lr,Er,Or,zr,qr,Xr,Jr,rn){var dn=[0],_n=[0],Fn=0,pn=rn!=null?rn.kd:0,Rn=rn??new Tn;if(er==null||12>Er)return 7;Rn.data=er,Rn.w=lr,Rn.ha=Er,lr=[lr],Er=[Er],Rn.gb=[Rn.gb];e:{var Ln=lr,qn=Er,Dn=Rn.gb;if(Re(er!=null),Re(qn!=null),Re(Dn!=null),Dn[0]=0,12<=qn[0]&&!Te(er,Ln[0],"RIFF")){if(Te(er,Ln[0]+8,"WEBP")){Dn=3;break e}var Xn=mr(er,Ln[0]+4);if(12>Xn||4294967286<Xn){Dn=3;break e}if(pn&&Xn>qn[0]-8){Dn=7;break e}Dn[0]=Xn,Ln[0]+=12,qn[0]-=12}Dn=0}if(Dn!=0)return Dn;for(Xn=0<Rn.gb[0],Er=Er[0];;){e:{var Zn=er;qn=lr,Dn=Er;var as=dn,rs=_n,_s=Ln=[0];if((Ss=Fn=[Fn])[0]=0,8>Dn[0])Dn=7;else{if(!Te(Zn,qn[0],"VP8X")){if(mr(Zn,qn[0]+4)!=10){Dn=3;break e}if(18>Dn[0]){Dn=7;break e}var ys=mr(Zn,qn[0]+8),Os=1+Vr(Zn,qn[0]+12);if(2147483648<=Os*(Zn=1+Vr(Zn,qn[0]+15))){Dn=3;break e}_s!=null&&(_s[0]=ys),as!=null&&(as[0]=Os),rs!=null&&(rs[0]=Zn),qn[0]+=18,Dn[0]-=18,Ss[0]=1}Dn=0}}if(Fn=Fn[0],Ln=Ln[0],Dn!=0)return Dn;if(qn=!!(2&Ln),!Xn&&Fn)return 3;if(qr!=null&&(qr[0]=!!(16&Ln)),Xr!=null&&(Xr[0]=qn),Jr!=null&&(Jr[0]=0),Xr=dn[0],Ln=_n[0],Fn&&qn&&rn==null){Dn=0;break}if(4>Er){Dn=7;break}if(Xn&&Fn||!Xn&&!Fn&&!Te(er,lr[0],"ALPH")){Er=[Er],Rn.na=[Rn.na],Rn.P=[Rn.P],Rn.Sa=[Rn.Sa];e:{ys=er,Dn=lr,Xn=Er;var Ss=Rn.gb;as=Rn.na,rs=Rn.P,_s=Rn.Sa,Os=22,Re(ys!=null),Re(Xn!=null),Zn=Dn[0];var $s=Xn[0];for(Re(as!=null),Re(_s!=null),as[0]=null,rs[0]=null,_s[0]=0;;){if(Dn[0]=Zn,Xn[0]=$s,8>$s){Dn=7;break e}var bo=mr(ys,Zn+4);if(4294967286<bo){Dn=3;break e}var Ms=8+bo+1&-2;if(Os+=Ms,0<Ss&&Os>Ss){Dn=3;break e}if(!Te(ys,Zn,"VP8 ")||!Te(ys,Zn,"VP8L")){Dn=0;break e}if($s[0]<Ms){Dn=7;break e}Te(ys,Zn,"ALPH")||(as[0]=ys,rs[0]=Zn+8,_s[0]=bo),Zn+=Ms,$s-=Ms}}if(Er=Er[0],Rn.na=Rn.na[0],Rn.P=Rn.P[0],Rn.Sa=Rn.Sa[0],Dn!=0)break}Er=[Er],Rn.Ja=[Rn.Ja],Rn.xa=[Rn.xa];e:if(Ss=er,Dn=lr,Xn=Er,as=Rn.gb[0],rs=Rn.Ja,_s=Rn.xa,ys=Dn[0],Zn=!Te(Ss,ys,"VP8 "),Os=!Te(Ss,ys,"VP8L"),Re(Ss!=null),Re(Xn!=null),Re(rs!=null),Re(_s!=null),8>Xn[0])Dn=7;else{if(Zn||Os){if(Ss=mr(Ss,ys+4),12<=as&&Ss>as-12){Dn=3;break e}if(pn&&Ss>Xn[0]-8){Dn=7;break e}rs[0]=Ss,Dn[0]+=8,Xn[0]-=8,_s[0]=Os}else _s[0]=5<=Xn[0]&&Ss[ys+0]==47&&!(Ss[ys+4]>>5),rs[0]=Xn[0];Dn=0}if(Er=Er[0],Rn.Ja=Rn.Ja[0],Rn.xa=Rn.xa[0],lr=lr[0],Dn!=0)break;if(4294967286<Rn.Ja)return 3;if(Jr==null||qn||(Jr[0]=Rn.xa?2:1),Xr=[Xr],Ln=[Ln],Rn.xa){if(5>Er){Dn=7;break}Jr=Xr,pn=Ln,qn=qr,er==null||5>Er?er=0:5<=Er&&er[lr+0]==47&&!(er[lr+4]>>5)?(Xn=[0],Ss=[0],as=[0],vr(rs=new dr,er,lr,Er),Cn(rs,Xn,Ss,as)?(Jr!=null&&(Jr[0]=Xn[0]),pn!=null&&(pn[0]=Ss[0]),qn!=null&&(qn[0]=as[0]),er=1):er=0):er=0}else{if(10>Er){Dn=7;break}Jr=Ln,er==null||10>Er||!ps(er,lr+3,Er-3)?er=0:(pn=er[lr+0]|er[lr+1]<<8|er[lr+2]<<16,qn=16383&(er[lr+7]<<8|er[lr+6]),er=16383&(er[lr+9]<<8|er[lr+8]),1&pn||3<(pn>>1&7)||!(pn>>4&1)||pn>>5>=Rn.Ja||!qn||!er?er=0:(Xr&&(Xr[0]=qn),Jr&&(Jr[0]=er),er=1))}if(!er||(Xr=Xr[0],Ln=Ln[0],Fn&&(dn[0]!=Xr||_n[0]!=Ln)))return 3;rn!=null&&(rn[0]=Rn,rn.offset=lr-rn.w,Re(4294967286>lr-rn.w),Re(rn.offset==rn.ha-Er));break}return Dn==0||Dn==7&&Fn&&rn==null?(qr!=null&&(qr[0]|=Rn.na!=null&&0<Rn.na.length),Or!=null&&(Or[0]=Xr),zr!=null&&(zr[0]=Ln),0):Dn}function ni(er,lr,Er){var Or=lr.width,zr=lr.height,qr=0,Xr=0,Jr=Or,rn=zr;if(lr.Da=er!=null&&0<er.Da,lr.Da&&(Jr=er.cd,rn=er.bd,qr=er.v,Xr=er.j,11>Er||(qr&=-2,Xr&=-2),0>qr||0>Xr||0>=Jr||0>=rn||qr+Jr>Or||Xr+rn>zr))return 0;if(lr.v=qr,lr.j=Xr,lr.va=qr+Jr,lr.o=Xr+rn,lr.U=Jr,lr.T=rn,lr.da=er!=null&&0<er.da,lr.da){if(!fr(Jr,rn,Er=[er.ib],qr=[er.hb]))return 0;lr.ib=Er[0],lr.hb=qr[0]}return lr.ob=er!=null&&er.ob,lr.Kb=er==null||!er.Sd,lr.da&&(lr.ob=lr.ib<3*Or/4&&lr.hb<3*zr/4,lr.Kb=0),1}function ra(er){if(er==null)return 2;if(11>er.S){var lr=er.f.RGBA;lr.fb+=(er.height-1)*lr.A,lr.A=-lr.A}else lr=er.f.kb,er=er.height,lr.O+=(er-1)*lr.fa,lr.fa=-lr.fa,lr.N+=(er-1>>1)*lr.Ab,lr.Ab=-lr.Ab,lr.W+=(er-1>>1)*lr.Db,lr.Db=-lr.Db,lr.F!=null&&(lr.J+=(er-1)*lr.lb,lr.lb=-lr.lb);return 0}function Fa(er,lr,Er,Or){if(Or==null||0>=er||0>=lr)return 2;if(Er!=null){if(Er.Da){var zr=Er.cd,qr=Er.bd,Xr=-2&Er.v,Jr=-2&Er.j;if(0>Xr||0>Jr||0>=zr||0>=qr||Xr+zr>er||Jr+qr>lr)return 2;er=zr,lr=qr}if(Er.da){if(!fr(er,lr,zr=[Er.ib],qr=[Er.hb]))return 2;er=zr[0],lr=qr[0]}}Or.width=er,Or.height=lr;e:{var rn=Or.width,dn=Or.height;if(er=Or.S,0>=rn||0>=dn||!(er>=ml&&13>er))er=2;else{if(0>=Or.Rd&&Or.sd==null){Xr=qr=zr=lr=0;var _n=(Jr=rn*pu[er])*dn;if(11>er||(qr=(dn+1)/2*(lr=(rn+1)/2),er==12&&(Xr=(zr=rn)*dn)),(dn=Me(_n+2*qr+Xr))==null){er=1;break e}Or.sd=dn,11>er?((rn=Or.f.RGBA).eb=dn,rn.fb=0,rn.A=Jr,rn.size=_n):((rn=Or.f.kb).y=dn,rn.O=0,rn.fa=Jr,rn.Fd=_n,rn.f=dn,rn.N=0+_n,rn.Ab=lr,rn.Cd=qr,rn.ea=dn,rn.W=0+_n+qr,rn.Db=lr,rn.Ed=qr,er==12&&(rn.F=dn,rn.J=0+_n+2*qr),rn.Tc=Xr,rn.lb=zr)}if(lr=1,zr=Or.S,qr=Or.width,Xr=Or.height,zr>=ml&&13>zr)if(11>zr)er=Or.f.RGBA,lr&=(Jr=Math.abs(er.A))*(Xr-1)+qr<=er.size,lr&=Jr>=qr*pu[zr],lr&=er.eb!=null;else{er=Or.f.kb,Jr=(qr+1)/2,_n=(Xr+1)/2,rn=Math.abs(er.fa),dn=Math.abs(er.Ab);var Fn=Math.abs(er.Db),pn=Math.abs(er.lb),Rn=pn*(Xr-1)+qr;lr&=rn*(Xr-1)+qr<=er.Fd,lr&=dn*(_n-1)+Jr<=er.Cd,lr=(lr&=Fn*(_n-1)+Jr<=er.Ed)&rn>=qr&dn>=Jr&Fn>=Jr,lr&=er.y!=null,lr&=er.f!=null,lr&=er.ea!=null,zr==12&&(lr&=pn>=qr,lr&=Rn<=er.Tc,lr&=er.F!=null)}else lr=0;er=lr?0:2}}return er!=0||Er!=null&&Er.fd&&(er=ra(Or)),er}var wa=64,na=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Ba=24,Bo=32,Wo=8,Ea=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];$r("Predictor0","PredictorAdd0"),or.Predictor0=function(){return 4278190080},or.Predictor1=function(er){return er},or.Predictor2=function(er,lr,Er){return lr[Er+0]},or.Predictor3=function(er,lr,Er){return lr[Er+1]},or.Predictor4=function(er,lr,Er){return lr[Er-1]},or.Predictor5=function(er,lr,Er){return Kr(Kr(er,lr[Er+1]),lr[Er+0])},or.Predictor6=function(er,lr,Er){return Kr(er,lr[Er-1])},or.Predictor7=function(er,lr,Er){return Kr(er,lr[Er+0])},or.Predictor8=function(er,lr,Er){return Kr(lr[Er-1],lr[Er+0])},or.Predictor9=function(er,lr,Er){return Kr(lr[Er+0],lr[Er+1])},or.Predictor10=function(er,lr,Er){return Kr(Kr(er,lr[Er-1]),Kr(lr[Er+0],lr[Er+1]))},or.Predictor11=function(er,lr,Er){var Or=lr[Er+0];return 0>=hn(Or>>24&255,er>>24&255,(lr=lr[Er-1])>>24&255)+hn(Or>>16&255,er>>16&255,lr>>16&255)+hn(Or>>8&255,er>>8&255,lr>>8&255)+hn(255&Or,255&er,255&lr)?Or:er},or.Predictor12=function(er,lr,Er){var Or=lr[Er+0];return(an((er>>24&255)+(Or>>24&255)-((lr=lr[Er-1])>>24&255))<<24|an((er>>16&255)+(Or>>16&255)-(lr>>16&255))<<16|an((er>>8&255)+(Or>>8&255)-(lr>>8&255))<<8|an((255&er)+(255&Or)-(255&lr)))>>>0},or.Predictor13=function(er,lr,Er){var Or=lr[Er-1];return(Wr((er=Kr(er,lr[Er+0]))>>24&255,Or>>24&255)<<24|Wr(er>>16&255,Or>>16&255)<<16|Wr(er>>8&255,Or>>8&255)<<8|Wr(255&er,255&Or))>>>0};var Bi=or.PredictorAdd0;or.PredictorAdd1=cn,$r("Predictor2","PredictorAdd2"),$r("Predictor3","PredictorAdd3"),$r("Predictor4","PredictorAdd4"),$r("Predictor5","PredictorAdd5"),$r("Predictor6","PredictorAdd6"),$r("Predictor7","PredictorAdd7"),$r("Predictor8","PredictorAdd8"),$r("Predictor9","PredictorAdd9"),$r("Predictor10","PredictorAdd10"),$r("Predictor11","PredictorAdd11"),$r("Predictor12","PredictorAdd12"),$r("Predictor13","PredictorAdd13");var Ui=or.PredictorAdd2;gn("ColorIndexInverseTransform","MapARGB","32b",function(er){return er>>8&255},function(er){return er}),gn("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(er){return er},function(er){return er>>8&255});var Ca,sa=or.ColorIndexInverseTransform,mo=or.MapARGB,Wl=or.VP8LColorIndexInverseTransformAlpha,vi=or.MapAlpha,pi=or.VP8LPredictorsAdd=[];pi.length=16,(or.VP8LPredictors=[]).length=16,(or.VP8LPredictorsAdd_C=[]).length=16,(or.VP8LPredictors_C=[]).length=16;var oa,Ua,za,Aa,ia,aa,zi,Ti,Hi,Ra,Lo,Si,Qs,Js,co,yo,ki,Ha,Pa,pl,Hc,Wc,Gc,qc,Wa,Vc,Xc,Yc,Kc=Me(511),Zc=Me(2041),Qc=Me(225),Jc=Me(767),eu=0,Gl=Zc,hl=Qc,Ko=Jc,si=Kc,ml=0,gl=1,tu=2,xl=3,yl=4,ql=5,ru=6,Vl=7,Xl=8,bl=9,Yl=10,ld=[2,3,7],cd=[3,3,11],nu=[280,256,256,256,40],ud=[0,1,1,1,0],dd=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],pd=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,3
vendor: 4,386 bytes, line 4154
41546,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],hd=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],fd=8,Kl=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Zl=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Ga=null,md=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],gd=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],su=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],xd=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,25
41545,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],yd=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,
41541,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],bd=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,25
vendor: 26,078 bytes, lines 4154-4178
41545,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],vd=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Wi=[],hi=[],ji=[],Sd=1,ou=2,Gi=[],oi=[];jo("UpsampleRgbLinePair",Ji,3),jo("UpsampleBgrLinePair",ba,3),jo("UpsampleRgbaLinePair",$a,4),jo("UpsampleBgraLinePair",ta,4),jo("UpsampleArgbLinePair",ea,4),jo("UpsampleRgba4444LinePair",Io,2),jo("UpsampleRgb565LinePair",va,2);var wd=or.UpsampleRgbLinePair,Ed=or.UpsampleBgrLinePair,iu=or.UpsampleRgbaLinePair,au=or.UpsampleBgraLinePair,lu=or.UpsampleArgbLinePair,cu=or.UpsampleRgba4444LinePair,Cd=or.UpsampleRgb565LinePair,vl=16,Sl=1<<vl-1,qa=-227,Ql=482,_d=6,uu=0,Ad=Me(256),Rd=Me(256),Pd=Me(256),Td=Me(256),kd=Me(Ql-qa),jd=Me(Ql-qa);bi("YuvToRgbRow",Ji,3),bi("YuvToBgrRow",ba,3),bi("YuvToRgbaRow",$a,4),bi("YuvToBgraRow",ta,4),bi("YuvToArgbRow",ea,4),bi("YuvToRgba4444Row",Io,2),bi("YuvToRgb565Row",va,2);var du=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],wl=[0,2,8],Id=[8,7,6,4,4,2,2,2,1,1,1,1],Ld=1;this.WebPDecodeRGBA=function(er,lr,Er,Or,zr){var qr=gl,Xr=new bn,Jr=new xn;Xr.ba=Jr,Jr.S=qr,Jr.width=[Jr.width],Jr.height=[Jr.height];var rn=Jr.width,dn=Jr.height,_n=new An;if(_n==null||er==null)var Fn=2;else Re(_n!=null),Fn=dl(er,lr,Er,_n.width,_n.height,_n.Pd,_n.Qd,_n.format,null);if(Fn!=0?rn=0:(rn!=null&&(rn[0]=_n.width[0]),dn!=null&&(dn[0]=_n.height[0]),rn=1),rn){Jr.width=Jr.width[0],Jr.height=Jr.height[0],Or!=null&&(Or[0]=Jr.width),zr!=null&&(zr[0]=Jr.height);e:{if(Or=new Gs,(zr=new Tn).data=er,zr.w=lr,zr.ha=Er,zr.kd=1,lr=[0],Re(zr!=null),((er=dl(zr.data,zr.w,zr.ha,null,null,null,lr,null,zr))==0||er==7)&&lr[0]&&(er=4),(lr=er)==0){if(Re(Xr!=null),Or.data=zr.data,Or.w=zr.w+zr.offset,Or.ha=zr.ha-zr.offset,Or.put=nn,Or.ac=Gr,Or.bc=En,Or.ma=Xr,zr.xa){if((er=os())==null){Xr=1;break e}if(function(pn,Rn){var Ln=[0],qn=[0],Dn=[0];t:for(;;){if(pn==null)return 0;if(Rn==null)return pn.a=2,0;if(pn.l=Rn,pn.a=0,vr(pn.m,Rn.data,Rn.w,Rn.ha),!Cn(pn.m,Ln,qn,Dn)){pn.a=3;break t}if(pn.xb=ou,Rn.width=Ln[0],Rn.height=qn[0],!ls(Ln[0],qn[0],1,pn,null))break t;return 1}return Re(pn.a!=0),0}(er,Or)){if(Or=(lr=Fa(Or.width,Or.height,Xr.Oa,Xr.ba))==0){t:{Or=er;r:for(;;){if(Or==null){Or=0;break t}if(Re(Or.s.yc!=null),Re(Or.s.Ya!=null),Re(0<Or.s.Wb),Re((Er=Or.l)!=null),Re((zr=Er.ma)!=null),Or.xb!=0){if(Or.ca=zr.ba,Or.tb=zr.tb,Re(Or.ca!=null),!ni(zr.Oa,Er,xl)){Or.a=2;break r}if(!hs(Or,Er.width)||Er.da)break r;if((Er.da||Bn(Or.ca.S))&&io(),11>Or.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),Or.ca.f.kb.F!=null&&io()),Or.Pb&&0<Or.s.ua&&Or.s.vb.X==null&&!Sr(Or.s.vb,Or.s.Wa.Xa)){Or.a=1;break r}Or.xb=0}if(!mn(Or,Or.V,Or.Ba,Or.c,Or.i,Er.o,Jn))break r;zr.Dc=Or.Ma,Or=1;break t}Re(Or.a!=0),Or=0}Or=!Or}Or&&(lr=er.a)}else lr=er.a}else{if((er=new qs)==null){Xr=1;break e}if(er.Fa=zr.na,er.P=zr.P,er.qc=zr.Sa,us(er,Or)){if((lr=Fa(Or.width,Or.height,Xr.Oa,Xr.ba))==0){if(er.Aa=0,Er=Xr.Oa,Re((zr=er)!=null),Er!=null){if(0<(rn=0>(rn=Er.Md)?0:100<rn?255:255*rn/100)){for(dn=_n=0;4>dn;++dn)12>(Fn=zr.pb[dn]).lc&&(Fn.ia=rn*Id[0>Fn.lc?0:Fn.lc]>>3),_n|=Fn.ia;_n&&(alert("todo:VP8InitRandom"),zr.ia=1)}zr.Ga=Er.Id,100<zr.Ga?zr.Ga=100:0>zr.Ga&&(zr.Ga=0)}(function(pn,Rn){if(pn==null)return 0;if(Rn==null)return Ns(pn,2,"NULL VP8Io parameter in VP8Decode().");if(!pn.cb&&!us(pn,Rn))return 0;if(Re(pn.cb),Rn.ac==null||Rn.ac(Rn)){Rn.ob&&(pn.L=0);var Ln=wl[pn.L];if(pn.L==2?(pn.yb=0,pn.zb=0):(pn.yb=Rn.v-Ln>>4,pn.zb=Rn.j-Ln>>4,0>pn.yb&&(pn.yb=0),0>pn.zb&&(pn.zb=0)),pn.Va=Rn.o+15+Ln>>4,pn.Hb=Rn.va+15+Ln>>4,pn.Hb>pn.za&&(pn.Hb=pn.za),pn.Va>pn.Ub&&(pn.Va=pn.Ub),0<pn.L){var qn=pn.ed;for(Ln=0;4>Ln;++Ln){var Dn;if(pn.Qa.Cb){var Xn=pn.Qa.Lb[Ln];pn.Qa.Fb||(Xn+=qn.Tb)}else Xn=qn.Tb;for(Dn=0;1>=Dn;++Dn){var Zn=pn.gd[Ln][Dn],as=Xn;if(qn.Pc&&(as+=qn.vd[0],Dn&&(as+=qn.od[0])),0<(as=0>as?0:63<as?63:as)){var rs=as;0<qn.wb&&(rs=4<qn.wb?rs>>2:rs>>1)>9-qn.wb&&(rs=9-qn.wb),1>rs&&(rs=1),Zn.dd=rs,Zn.tc=2*as+rs,Zn.ld=40<=as?2:15<=as?1:0}else Zn.tc=0;Zn.La=Dn}}}Ln=0}else Ns(pn,6,"Frame setup failed"),Ln=pn.a;if(Ln=Ln==0){if(Ln){pn.$c=0,0<pn.Aa||(pn.Ic=Ld);t:{Ln=pn.Ic,qn=4*(rs=pn.za);var _s=32*rs,ys=rs+1,Os=0<pn.L?rs*(0<pn.Aa?2:1):0,Ss=(pn.Aa==2?2:1)*rs;if((Zn=qn+832+(Dn=3*(16*Ln+wl[pn.L])/2*_s)+(Xn=pn.Fa!=null&&0<pn.Fa.length?pn.Kc.c*pn.Kc.i:0))!=Zn)Ln=0;else{if(Zn>pn.Vb){if(pn.Vb=0,pn.Ec=Me(Zn),pn.Fc=0,pn.Ec==null){Ln=Ns(pn,1,"no memory during frame initialization.");break t}pn.Vb=Zn}Zn=pn.Ec,as=pn.Fc,pn.Ac=Zn,pn.Bc=as,as+=qn,pn.Gd=De(_s,xs),pn.Hd=0,pn.rb=De(ys+1,Vo),pn.sb=1,pn.wa=Os?De(Os,go):null,pn.Y=0,pn.D.Nb=0,pn.D.wa=pn.wa,pn.D.Y=pn.Y,0<pn.Aa&&(pn.D.Y+=rs),Re(!0),pn.oc=Zn,pn.pc=as,as+=832,pn.ya=De(Ss,Kn),pn.aa=0,pn.D.ya=pn.ya,pn.D.aa=pn.aa,pn.Aa==2&&(pn.D.aa+=rs),pn.R=16*rs,pn.B=8*rs,rs=(_s=wl[pn.L])*pn.R,_s=_s/2*pn.B,pn.sa=Zn,pn.ta=as+rs,pn.qa=pn.sa,pn.ra=pn.ta+16*Ln*pn.R+_s,pn.Ha=pn.qa,pn.Ia=pn.ra+8*Ln*pn.B+_s,pn.$c=0,as+=Dn,pn.mb=Xn?Zn:null,pn.nb=Xn?as:null,Re(as+Xn<=pn.Fc+pn.Vb),As(pn),Oe(pn.Ac,pn.Bc,0,qn),Ln=1}}if(Ln){if(Rn.ka=0,Rn.y=pn.sa,Rn.O=pn.ta,Rn.f=pn.qa,Rn.N=pn.ra,Rn.ea=pn.Ha,Rn.Vd=pn.Ia,Rn.fa=pn.R,Rn.Rc=pn.B,Rn.F=null,Rn.J=0,!eu){for(Ln=-255;255>=Ln;++Ln)Kc[255+Ln]=0>Ln?-Ln:Ln;for(Ln=-1020;1020>=Ln;++Ln)Zc[1020+Ln]=-128>Ln?-128:127<Ln?127:Ln;for(Ln=-112;112>=Ln;++Ln)Qc[112+Ln]=-16>Ln?-16:15<Ln?15:Ln;for(Ln=-255;510>=Ln;++Ln)Jc[255+Ln]=0>Ln?0:255<Ln?255:Ln;eu=1}zi=da,Ti=Ma,Ra=Da,Lo=wi,Si=Xo,Hi=ua,Qs=il,Js=al,co=cl,yo=yr,ki=ll,Ha=Ki,Pa=Ur,pl=un,Hc=di,Wc=_i,Gc=$i,qc=ol,hi[0]=Ps,hi[1]=Mi,hi[2]=fn,hi[3]=gs,hi[4]=Hs,hi[5]=To,hi[6]=so,hi[7]=Do,hi[8]=yi,hi[9]=Ni,Wi[0]=ma,Wi[1]=pa,Wi[2]=ha,Wi[3]=fa,Wi[4]=li,Wi[5]=ga,Wi[6]=xi,ji[0]=xa,ji[1]=Di,ji[2]=ci,ji[3]=Ei,ji[4]=ya,ji[5]=Ci,ji[6]=No,Ln=1}else Ln=0}Ln&&(Ln=function($s,bo){for($s.M=0;$s.M<$s.Va;++$s.M){var Ms,ws=$s.Jc[$s.M&$s.Xb],ms=$s.m,uo=$s;for(Ms=0;Ms<uo.za;++Ms){var Ls=ms,Us=uo,no=Us.Ac,_o=Us.Bc+4*Ms,Uo=Us.zc,ao=Us.ya[Us.aa+Ms];if(Us.Qa.Bb?ao.$b=Nr(Ls,Us.Pa.jb[0])?2+Nr(Ls,Us.Pa.jb[2]):Nr(Ls,Us.Pa.jb[1]):ao.$b=0,Us.kc&&(ao.Ad=Nr(Ls,Us.Bd)),ao.Za=!Nr(Ls,145)+0,ao.Za){var Oo=ao.Ob,zo=0;for(Us=0;4>Us;++Us){var vo,zs=Uo[0+Us];for(vo=0;4>vo;++vo){zs=yd[no[_o+vo]][zs];for(var Vs=su[Nr(Ls,zs[0])];0<Vs;)Vs=su[2*Vs+Nr(Ls,zs[Vs])];zs=-Vs,no[_o+vo]=zs}je(Oo,zo,no,_o,4),zo+=4,Uo[0+Us]=zs}}else zs=Nr(Ls,156)?Nr(Ls,128)?1:3:Nr(Ls,163)?2:0,ao.Ob[0]=zs,Oe(no,_o,zs,4),Oe(Uo,0,zs,4);ao.Dd=Nr(Ls,142)?Nr(Ls,114)?Nr(Ls,183)?1:3:2:0}if(uo.m.Ka)return Ns($s,7,"Premature end-of-partition0 encountered.");for(;$s.ja<$s.za;++$s.ja){if(uo=ws,Ls=(ms=$s).rb[ms.sb-1],no=ms.rb[ms.sb+ms.ja],Ms=ms.ya[ms.aa+ms.ja],_o=ms.kc?Ms.Ad:0)Ls.la=no.la=0,Ms.Za||(Ls.Na=no.Na=0),Ms.Hc=0,Ms.Gc=0,Ms.ia=0;else{var lo,Xs;if(Ls=no,no=uo,_o=ms.Pa.Xc,Uo=ms.ya[ms.aa+ms.ja],ao=ms.pb[Uo.$b],Us=Uo.ad,Oo=0,zo=ms.rb[ms.sb-1],zs=vo=0,Oe(Us,Oo,0,384),Uo.Za)var Ao=0,fi=_o[3];else{Vs=Me(16);var po=Ls.Na+zo.Na;if(po=Ga(no,_o[1],po,ao.Eb,0,Vs,0),Ls.Na=zo.Na=(0<po)+0,1<po)zi(Vs,0,Us,Oo);else{var Go=Vs[0]+3>>3;for(Vs=0;256>Vs;Vs+=16)Us[Oo+Vs]=Go}Ao=1,fi=_o[0]}var Zs=15&Ls.la,So=15&zo.la;for(Vs=0;4>Vs;++Vs){var Zo=1&So;for(Go=Xs=0;4>Go;++Go)Zs=Zs>>1|(Zo=(po=Ga(no,fi,po=Zo+(1&Zs),ao.Sc,Ao,Us,Oo))>Ao)<<7,Xs=Xs<<2|(3<po?3:1<po?2:Us[Oo+0]!=0),Oo+=16;Zs>>=4,So=So>>1|Zo<<7,vo=(vo<<8|Xs)>>>0}for(fi=Zs,Ao=So>>4,lo=0;4>lo;lo+=2){for(Xs=0,Zs=Ls.la>>4+lo,So=zo.la>>4+lo,Vs=0;2>Vs;++Vs){for(Zo=1&So,Go=0;2>Go;++Go)po=Zo+(1&Zs),Zs=Zs>>1|(Zo=0<(po=Ga(no,_o[2],po,ao.Qc,0,Us,Oo)))<<3,Xs=Xs<<2|(3<po?3:1<po?2:Us[Oo+0]!=0),Oo+=16;Zs>>=2,So=So>>1|Zo<<5}zs|=Xs<<4*lo,fi|=Zs<<4<<lo,Ao|=(240&So)<<lo}Ls.la=fi,zo.la=Ao,Uo.Hc=vo,Uo.Gc=zs,Uo.ia=43690&zs?0:ao.ia,_o=!(vo|zs)}if(0<ms.L&&(ms.wa[ms.Y+ms.ja]=ms.gd[Ms.$b][Ms.Za],ms.wa[ms.Y+ms.ja].La|=!_o),uo.Ka)return Ns($s,7,"Premature end-of-file encountered.")}if(As($s),ms=bo,uo=1,Ms=(ws=$s).D,Ls=0<ws.L&&ws.M>=ws.zb&&ws.M<=ws.Va,ws.Aa==0)t:{if(Ms.M=ws.M,Ms.uc=Ls,Sa(ws,Ms),uo=1,Ms=(Xs=ws.D).Nb,Ls=(zs=wl[ws.L])*ws.R,no=zs/2*ws.B,Vs=16*Ms*ws.R,Go=8*Ms*ws.B,_o=ws.sa,Uo=ws.ta-Ls+Vs,ao=ws.qa,Us=ws.ra-no+Go,Oo=ws.Ha,zo=ws.Ia-no+Go,So=(Zs=Xs.M)==0,vo=Zs>=ws.Va-1,ws.Aa==2&&Sa(ws,Xs),Xs.uc)for(Zo=(po=ws).D.M,Re(po.D.uc),Xs=po.yb;Xs<po.Hb;++Xs){Ao=Xs,fi=Zo;var Ho=(Qo=(Ro=po).D).Nb;lo=Ro.R;var Qo=Qo.wa[Qo.Y+Ao],Jo=Ro.sa,qo=Ro.ta+16*Ho*lo+16*Ao,ei=Qo.dd,eo=Qo.tc;if(eo!=0)if(Re(3<=eo),Ro.L==1)0<Ao&&Wc(Jo,qo,lo,eo+4),Qo.La&&qc(Jo,qo,lo,eo),0<fi&&Hc(Jo,qo,lo,eo+4),Qo.La&&Gc(Jo,qo,lo,eo);else{var ti=Ro.B,mi=Ro.qa,la=Ro.ra+8*Ho*ti+8*Ao,Ii=Ro.Ha,Ro=Ro.Ia+8*Ho*ti+8*Ao;Ho=Qo.ld,0<Ao&&(Js(Jo,qo,lo,eo+4,ei,Ho),yo(mi,la,Ii,Ro,ti,eo+4,ei,Ho)),Qo.La&&(Ha(Jo,qo,lo,eo,ei,Ho),pl(mi,la,Ii,Ro,ti,eo,ei,Ho)),0<fi&&(Qs(Jo,qo,lo,eo+4,ei,Ho),co(mi,la,Ii,Ro,ti,eo+4,ei,Ho)),Qo.La&&(ki(Jo,qo,lo,eo,ei,Ho),Pa(mi,la,Ii,Ro,ti,eo,ei,Ho))}}if(ws.ia&&alert("todo:DitherRow"),ms.put!=null){if(Xs=16*Zs,Zs=16*(Zs+1),So?(ms.y=ws.sa,ms.O=ws.ta+Vs,ms.f=ws.qa,ms.N=ws.ra+Go,ms.ea=ws.Ha,ms.W=ws.Ia+Go):(Xs-=zs,ms.y=_o,ms.O=Uo,ms.f=ao,ms.N=Us,ms.ea=Oo,ms.W=zo),vo||(Zs-=zs),Zs>ms.o&&(Zs=ms.o),ms.F=null,ms.J=null,ws.Fa!=null&&0<ws.Fa.length&&Xs<Zs&&(ms.J=fo(ws,ms,Xs,Zs-Xs),ms.F=ws.mb,ms.F==null&&ms.F.length==0)){uo=Ns(ws,3,"Could not decode alpha data.");break t}Xs<ms.j&&(zs=ms.j-Xs,Xs=ms.j,Re(!(1&zs)),ms.O+=ws.R*zs,ms.N+=ws.B*(zs>>1),ms.W+=ws.B*(zs>>1),ms.F!=null&&(ms.J+=ms.width*zs)),Xs<Zs&&(ms.O+=ms.v,ms.N+=ms.v>>1,ms.W+=ms.v>>1,ms.F!=null&&(ms.J+=ms.v),ms.ka=Xs-ms.j,ms.U=ms.va-ms.v,ms.T=Zs-Xs,uo=ms.put(ms))}Ms+1!=ws.Ic||vo||(je(ws.sa,ws.ta-Ls,_o,Uo+16*ws.R,Ls),je(ws.qa,ws.ra-no,ao,Us+8*ws.B,no),je(ws.Ha,ws.Ia-no,Oo,zo+8*ws.B,no))}if(!uo)return Ns($s,6,"Output aborted.")}return 1}(pn,Rn)),Rn.bc!=null&&Rn.bc(Rn),Ln&=1}return Ln?(pn.cb=0,Ln):0})(er,Or)||(lr=er.a)}}else lr=er.a}lr==0&&Xr.Oa!=null&&Xr.Oa.fd&&(lr=ra(Xr.ba))}Xr=lr}qr=Xr!=0?null:11>qr?Jr.f.RGBA.eb:Jr.f.kb.y}else qr=null;return qr};var pu=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function Ue(or,pr){for(var tr="",nr=0;nr<4;nr++)tr+=String.fromCharCode(or[pr++]);return tr}function ze(or,pr){return or[pr+0]|or[pr+1]<<8}function We(or,pr){return(or[pr+0]|or[pr+1]<<8|or[pr+2]<<16)>>>0}function Xe(or,pr){return(or[pr+0]|or[pr+1]<<8|or[pr+2]<<16|or[pr+3]<<24)>>>0}new Be;var He=[0],qe=[0],Ge=[],Ye=new Be,Ve=Ee,Ke=function(or,pr){var tr={},nr=0,hr=!1,sr=0,xr=0;if(tr.frames=[],!function(cr,dr){for(var ur=0;ur<4;ur++)if(cr[dr+ur]!="RIFF".charCodeAt(ur))return!0;return!1}(or,pr)){for(Xe(or,pr+=4),pr+=8;pr<or.length;){var Rr=Ue(or,pr),br=Xe(or,pr+=4);pr+=4;var wr=br+(1&br);switch(Rr){case"VP8 ":case"VP8L":tr.frames[nr]===void 0&&(tr.frames[nr]={}),(kr=tr.frames[nr]).src_off=hr?xr:pr-8,kr.src_size=sr+br+8,nr++,hr&&(hr=!1,sr=0,xr=0);break;case"VP8X":(kr=tr.header={}).feature_flags=or[pr];var vr=pr+4;kr.canvas_width=1+We(or,vr),vr+=3,kr.canvas_height=1+We(or,vr),vr+=3;break;case"ALPH":hr=!0,sr=wr+8,xr=pr-8;break;case"ANIM":(kr=tr.header).bgcolor=Xe(or,pr),vr=pr+4,kr.loop_count=ze(or,vr),vr+=2;break;case"ANMF":var Dr,kr;(kr=tr.frames[nr]={}).offset_x=2*We(or,pr),pr+=3,kr.offset_y=2*We(or,pr),pr+=3,kr.width=1+We(or,pr),pr+=3,kr.height=1+We(or,pr),pr+=3,kr.duration=We(or,pr),pr+=3,Dr=or[pr++],kr.dispose=1&Dr,kr.blend=Dr>>1&1}Rr!="ANMF"&&(pr+=wr)}return tr}}(Ve,0);Ke.response=Ve,Ke.rgbaoutput=!0,Ke.dataurl=!1;var Qe=Ke.header?Ke.header:null,Ze=Ke.frames?Ke.frames:null;if(Qe){Qe.loop_counter=Qe.loop_count,He=[Qe.canvas_height],qe=[Qe.canvas_width];for(var Je=0;Je<Ze.length&&Ze[Je].blend!=0;Je++);}var ir=Ze[0],rr=Ye.WebPDecodeRGBA(Ve,ir.src_off,ir.src_size,qe,He);ir.rgba=rr,ir.imgwidth=qe[0],ir.imgheight=He[0];for(var ar=0;ar<qe[0]*He[0]*4;ar++)Ge[ar]=rr[ar];return this.width=qe,this.height=He,this.data=Ge,this}/** ==================================================================== 4155 * @license 4156 * jsPDF XMP metadata plugin 4157 * Copyright (c) 2016 Jussi Utunen, [email protected] 4158 * 4159 * Permission is hereby granted, free of charge, to any person obtaining 4160 * a copy of this software and associated documentation files (the 4161 * "Software"), to deal in the Software without restriction, including 4162 * without limitation the rights to use, copy, modify, merge, publish, 4163 * distribute, sublicense, and/or sell copies of the Software, and to 4164 * permit persons to whom the Software is furnished to do so, subject to 4165 * the following conditions: 4166 * 4167 * The above copyright notice and this permission notice shall be 4168 * included in all copies or substantial portions of the Software. 4169 * 4170 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 4171 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 4172 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 4173 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 4174 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 4175 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 4176 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 4177 * ==================================================================== 4178 */function ce(){var Ee,Re=this.internal.__metadata__.metadata,Te=unescape(encodeURIComponent(Re));Ee=this.internal.__metadata__.rawXml?Te:'<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceUri+'"><jspdf:metadata>'+Te.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")+"</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+Ee.length+" >>"),this.internal.write("stream"),this.internal.write(Ee),this.internal.write("endstream"),this.internal.write("endobj")}function le(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(Ee){var Re,Te,je,Oe,Me,De,$e,Be,Ue,ze=function(cr){return cr=cr||{},this.isStrokeTransparent=cr.isStrokeTransparent||!1,this.strokeOpacity=cr.strokeOpacity||1,this.strokeStyle=cr.strokeStyle||"#000000",this.fillStyle=cr.fillStyle||"#000000",this.isFillTransparent=cr.isFillTransparent||!1,this.fillOpacity=cr.fillOpacity||1,this.font=cr.font||"10px sans-serif",this.textBaseline=cr.textBaseline||"alphabetic",this.textAlign=cr.textAlign||"left",this.lineWidth=cr.lineWidth||1,this.lineJoin=cr.lineJoin||"miter",this.lineCap=cr.lineCap||"butt",this.path=cr.path||[],this.transform=cr.transform!==void 0?cr.transform.clone():new Be,this.globalCompositeOperation=cr.globalCompositeOperation||"normal",this.globalAlpha=cr.globalAlpha||1,this.clip_path=cr.clip_path||[],this.currentPoint=cr.currentPoint||new De,this.miterLimit=cr.miterLimit||10,this.lastPoint=cr.lastPoint||new De,this.lineDashOffset=cr.lineDashOffset||0,this.lineDash=cr.lineDash||[],this.margin=cr.margin||[0,0,0,0],this.prevPageLastElemOffset=cr.prevPageLastElemOffset||0,this.ignoreClearRect=typeof cr.ignoreClearRect!="boolean"||cr.ignoreClearRect,this};Ee.events.push(["initialized",function(){this.context2d=new We(this),Re=this.internal.f2,Te=this.internal.getCoordinateString,je=this.internal.getVerticalCoordinateString,Oe=this.internal.getHorizontalCoordinate,Me=this.internal.getVerticalCoordinate,De=this.internal.Point,$e=this.internal.Rectangle,Be=this.internal.Matrix,Ue=new ze}]);var We=function(cr){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var dr=cr;Object.defineProperty(this,"pdf",{get:function(){return dr}});var ur=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return ur},set:function(Sr){ur=!!Sr}});var gr=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return gr},set:function(Sr){gr=!!Sr}});var _r=0;Object.defineProperty(this,"posX",{get:function(){return _r},set:function(Sr){isNaN(Sr)||(_r=Sr)}});var Ir=0;Object.defineProperty(this,"posY",{get:function(){return Ir},set:function(Sr){isNaN(Sr)||(Ir=Sr)}}),Object.defineProperty(this,"margin",{get:function(){return Ue.margin},set:function(Sr){var Lr;typeof Sr=="number"?Lr=[Sr,Sr,Sr,Sr]:((Lr=new Array(4))[0]=Sr[0],Lr[1]=Sr.length>=2?Sr[1]:Lr[0],Lr[2]=Sr.length>=3?Sr[2]:Lr[0],Lr[3]=Sr.length>=4?Sr[3]:Lr[1]),Ue.margin=Lr}});var Ar=!1;Object.defineProperty(this,"autoPaging",{get:function(){return Ar},set:function(Sr){Ar=Sr}});var Tr=0;Object.defineProperty(this,"lastBreak",{get:function(){return Tr},set:function(Sr){Tr=Sr}});var Nr=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Nr},set:function(Sr){Nr=Sr}}),Object.defineProperty(this,"ctx",{get:function(){return Ue},set:function(Sr){Sr instanceof ze&&(Ue=Sr)}}),Object.defineProperty(this,"path",{get:function(){return Ue.path},set:function(Sr){Ue.path=Sr}});var Br=[];Object.defineProperty(this,"ctxStack",{get:function(){return Br},set:function(Sr){Br=Sr}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(Sr){var Lr;Lr=Xe(Sr),this.ctx.fillStyle=Lr.style,this.ctx.isFillTransparent=Lr.a===0,this.ctx.fillOpacity=Lr.a,this.pdf.setFillColor(Lr.r,Lr.g,Lr.b,{a:Lr.a}),this.pdf.setTextColor(Lr.r,Lr.g,Lr.b,{a:Lr.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(Sr){var Lr=Xe(Sr);this.ctx.strokeStyle=Lr.style,this.ctx.isStrokeTransparent=Lr.a===0,this.ctx.strokeOpacity=Lr.a,Lr.a===0?this.pdf.setDrawColor(255,255,255):(Lr.a,this.pdf.setDrawColor(Lr.r,Lr.g,Lr.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(Sr){["butt","round","square"].indexOf(Sr)!==-1&&(this.ctx.lineCap=Sr,this.pdf.setLineCap(Sr))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(Sr){isNaN(Sr)||(this.ctx.lineWidth=Sr,this.pdf.setLineWidth(Sr))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(Sr){["bevel","round","miter"].indexOf(Sr)!==-1&&(this.ctx.lineJoin=Sr,this.pdf.setLineJoin(Sr))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(Sr){isNaN(Sr)||(this.ctx.miterLimit=Sr,this.pdf.setMiterLimit(Sr))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(Sr){this.ctx.textBaseline=Sr}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(Sr){["right","end","center","left","start"].indexOf(Sr)!==-1&&(this.ctx.textAlign=Sr)}});var Hr=null,Vr=null,mr=null;Object.defineProperty(this,"fontFaces",{get:function(){return mr},set:function(Sr){Hr=null,Vr=null,mr=Sr}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(Sr){var Lr;if(this.ctx.font=Sr,(Lr=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(Sr))!==null){var jr=Lr[1];Lr[2];var fr=Lr[3],Cr=Lr[4];Lr[5];var Mr=Lr[6],$r=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Cr)[2];Cr=Math.floor($r==="px"?parseFloat(Cr)*this.pdf.internal.scaleFactor:$r==="em"?parseFloat(Cr)*this.pdf.getFontSize():parseFloat(Cr)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Cr);var Fr=function(gn){var In,yn,Mn=[],on=gn.trim();if(on==="")return Gt;if(on in qt)return[qt[on]];for(;on!=="";){switch(yn=null,In=(on=Rt(on)).charAt(0)){case'"':case"'":yn=Dt(on.substring(1),In);break;default:yn=Tt(on)}if(yn===null||(Mn.push(yn[0]),(on=Rt(yn[1]))!==""&&on.charAt(0)!==","))return Gt;on=on.replace(/^,/,"")}return Mn}(Mr);if(this.fontFaces){var Kr=function(gn,In){var yn=gn.getFontList(),Mn=JSON.stringify(yn);if(Hr===null||Vr!==Mn){var on=function(Yr){var sn=[];return Object.keys(Yr).forEach(function(On){Yr[On].forEach(function(Bn){var Hn=null;switch(Bn){case"bold":Hn={family:On,weight:"bold"};break;case"italic":Hn={family:On,style:"italic"};break;case"bolditalic":Hn={family:On,weight:"bold",style:"italic"};break;case"":case"normal":Hn={family:On}}Hn!==null&&(Hn.ref={name:On,style:Bn},sn.push(Hn))})}),sn}(yn);Hr=function(Yr){for(var sn={},On=0;On<Yr.length;++On){var Bn=Ot(Yr[On]),Hn=Bn.family,Zr=Bn.stretch,xn=Bn.style,An=Bn.weight;sn[Hn]=sn[Hn]||{},sn[Hn][Zr]=sn[Hn][Zr]||{},sn[Hn][Zr][xn]=sn[Hn][Zr][xn]||{},sn[Hn][Zr][xn][An]=Bn}return sn}(on.concat(In)),Vr=Mn}return Hr}(this.pdf,this.fontFaces),an=Fr.map(function(gn){return{family:gn,stretch:"normal",weight:fr,style:jr}}),Wr=function(gn,In,yn){for(var Mn=(yn=yn||{}).defaultFontFamily||"times",on=Object.assign({},Mt,yn.genericFontFamilies||{}),Yr=null,sn=null,On=0;On<In.length;++On)if(on[(Yr=Ot(In[On])).family]&&(Yr.family=on[Yr.family]),gn.hasOwnProperty(Yr.family)){sn=gn[Yr.family];break}if(!(sn=sn||gn[Mn]))throw new Error("Could not find a font-family for the rule '"+Et(Yr)+"' and default family '"+Mn+"'.");if(sn=function(Bn,Hn){if(Hn[Bn])return Hn[Bn];var Zr=It[Bn],xn=Zr<=It.normal?-1:1,An=Bt(Hn,Ft,Zr,xn);if(!An)throw new Error("Could not find a matching font-stretch value for "+Bn);return An}(Yr.stretch,sn),sn=function(Bn,Hn){if(Hn[Bn])return Hn[Bn];for(var Zr=kt[Bn],xn=0;xn<Zr.length;++xn)if(Hn[Zr[xn]])return Hn[Zr[xn]];throw new Error("Could not find a matching font-style for "+Bn)}(Yr.style,sn),!(sn=function(Bn,Hn){if(Hn[Bn])return Hn[Bn];if(Bn===400&&Hn[500])return Hn[500];if(Bn===500&&Hn[400])return Hn[400];var Zr=jt[Bn],xn=Bt(Hn,Ct,Zr,Bn<400?-1:1);if(!xn)throw new Error("Could not find a matching font-weight for value "+Bn);return xn}(Yr.weight,sn)))throw new Error("Failed to resolve a font for the rule '"+Et(Yr)+"'.");return sn}(Kr,an);this.pdf.setFont(Wr.ref.name,Wr.ref.style)}else{var hn="";(fr==="bold"||parseInt(fr,10)>=700||jr==="bold")&&(hn="bold"),jr==="italic"&&(hn+="italic"),hn.length===0&&(hn="normal");for(var cn="",tn={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Qr=0;Qr<Fr.length;Qr++){if(this.pdf.internal.getFont(Fr[Qr],hn,{noFallback:!0,disableWarning:!0})!==void 0){cn=Fr[Qr];break}if(hn==="bolditalic"&&this.pdf.internal.getFont(Fr[Qr],"bold",{noFallback:!0,disableWarning:!0})!==void 0)cn=Fr[Qr],hn="bold";else if(this.pdf.internal.getFont(Fr[Qr],"normal",{noFallback:!0,disableWarning:!0})!==void 0){cn=Fr[Qr],hn="normal";break}}if(cn===""){for(var wn=0;wn<Fr.length;wn++)if(tn[Fr[wn]]){cn=tn[Fr[wn]];break}}cn=cn===""?"Times":cn,this.pdf.setFont(cn,hn)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(Sr){this.ctx.globalCompositeOperation=Sr}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(Sr){this.ctx.globalAlpha=Sr}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(Sr){this.ctx.lineDashOffset=Sr,kr.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(Sr){this.ctx.lineDash=Sr,kr.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(Sr){this.ctx.ignoreClearRect=!!Sr}})};We.prototype.setLineDash=function(cr){this.lineDash=cr},We.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},We.prototype.fill=function(){Ze.call(this,"fill",!1)},We.prototype.stroke=function(){Ze.call(this,"stroke",!1)},We.prototype.beginPath=function(){this.path=[{type:"begin"}]},We.prototype.moveTo=function(cr,dr){if(isNaN(cr)||isNaN(dr))throw o.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var ur=this.ctx.transform.applyToPoint(new De(cr,dr));this.path.push({type:"mt",x:ur.x,y:ur.y}),this.ctx.lastPoint=new De(cr,dr)},We.prototype.closePath=function(){var cr=new De(0,0),dr=0;for(dr=this.path.length-1;dr!==-1;dr--)if(this.path[dr].type==="begin"&&_typeof(this.path[dr+1])==="object"&&typeof this.path[dr+1].x=="number"){cr=new De(this.path[dr+1].x,this.path[dr+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new De(cr.x,cr.y)},We.prototype.lineTo=function(cr,dr){if(isNaN(cr)||isNaN(dr))throw o.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var ur=this.ctx.transform.applyToPoint(new De(cr,dr));this.path.push({type:"lt",x:ur.x,y:ur.y}),this.ctx.lastPoint=new De(ur.x,ur.y)},We.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),Ze.call(this,null,!0)},We.prototype.quadraticCurveTo=function(cr,dr,ur,gr){if(isNaN(ur)||isNaN(gr)||isNaN(cr)||isNaN(dr))throw o.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var _r=this.ctx.transform.applyToPoint(new De(ur,gr)),Ir=this.ctx.transform.applyToPoint(new De(cr,dr));this.path.push({type:"qct",x1:Ir.x,y1:Ir.y,x:_r.x,y:_r.y}),this.ctx.lastPoint=new De(_r.x,_r.y)},We.prototype.bezierCurveTo=function(cr,dr,ur,gr,_r,Ir){if(isNaN(_r)||isNaN(Ir)||isNaN(cr)||isNaN(dr)||isNaN(ur)||isNaN(gr))throw o.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to
4178jsPDF.context2d.bezierCurveTo");var Ar=this.ctx.transform.applyToPoint(new De(_r,Ir)),Tr=this.ctx.transform.applyToPoint(new De(cr,dr)),Nr=this.ctx.transform.applyToPoint(new De(ur,gr));this.path.push({type:"bct",x1:Tr.x,y1:Tr.y,x2:Nr.x,y2:Nr.y,x:Ar.x,y:Ar.y}),this.ctx.lastPoint=new De(Ar.x,Ar.y)},We.prototype.arc=function(cr,dr,ur,gr,_r,Ir){if(isNaN(cr)||isNaN(dr)||isNaN(ur)||isNaN(gr)||isNaN(_r))throw o.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Ir=!!Ir,!this.ctx.transform.isIdentity){var Ar=this.ctx.transform.applyToPoint(new De(cr,dr));cr=Ar.x,dr=Ar.y;var Tr=this.ctx.transform.applyToPoint(new De(0,ur)),Nr=this.ctx.transform.applyToPoint(new De(0,0));ur=Math.sqrt(Math.pow(Tr.x-Nr.x,2)+Math.pow(Tr.y-Nr.y,2))}Math.abs(_r-gr)>=2*Math.PI&&(gr=0,_r=2*Math.PI),this.path.push({type:"arc",x:cr,y:dr,radius:ur,startAngle:gr,endAngle:_r,counterclockwise:Ir})},We.prototype.arcTo=function(cr,dr,ur,gr,_r){throw new Error("arcTo not implemented.")},We.prototype.rect=function(cr,dr,ur,gr){if(isNaN(cr)||isNaN(dr)||isNaN(ur)||isNaN(gr))throw o.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(cr,dr),this.lineTo(cr+ur,dr),this.lineTo(cr+ur,dr+gr),this.lineTo(cr,dr+gr),this.lineTo(cr,dr),this.lineTo(cr+ur,dr),this.lineTo(cr,dr)},We.prototype.fillRect=function(cr,dr,ur,gr){if(isNaN(cr)||isNaN(dr)||isNaN(ur)||isNaN(gr))throw o.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!He.call(this)){var _r={};this.lineCap!=="butt"&&(_r.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(_r.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(cr,dr,ur,gr),this.fill(),_r.hasOwnProperty("lineCap")&&(this.lineCap=_r.lineCap),_r.hasOwnProperty("lineJoin")&&(this.lineJoin=_r.lineJoin)}},We.prototype.strokeRect=function(cr,dr,ur,gr){if(isNaN(cr)||isNaN(dr)||isNaN(ur)||isNaN(gr))throw o.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");qe.call(this)||(this.beginPath(),this.rect(cr,dr,ur,gr),this.stroke())},We.prototype.clearRect=function(cr,dr,ur,gr){if(isNaN(cr)||isNaN(dr)||isNaN(ur)||isNaN(gr))throw o.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(cr,dr,ur,gr))},We.prototype.save=function(cr){cr=typeof cr!="boolean"||cr;for(var dr=this.pdf.internal.getCurrentPageInfo().pageNumber,ur=0;ur<this.pdf.internal.getNumberOfPages();ur++)this.pdf.setPage(ur+1),this.pdf.internal.out("q");if(this.pdf.setPage(dr),cr){this.ctx.fontSize=this.pdf.internal.getFontSize();var gr=new ze(this.ctx);this.ctxStack.push(this.ctx),this.ctx=gr}},We.prototype.restore=function(cr){cr=typeof cr!="boolean"||cr;for(var dr=this.pdf.internal.getCurrentPageInfo().pageNumber,ur=0;ur<this.pdf.internal.getNumberOfPages();ur++)this.pdf.setPage(ur+1),this.pdf.internal.out("Q");this.pdf.setPage(dr),cr&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},We.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var Xe=function(cr){var dr,ur,gr,_r;if(cr.isCanvasGradient===!0&&(cr=cr.getColor()),!cr)return{r:0,g:0,b:0,a:0,style:cr};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(cr))dr=0,ur=0,gr=0,_r=0;else{var Ir=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(cr);if(Ir!==null)dr=parseInt(Ir[1]),ur=parseInt(Ir[2]),gr=parseInt(Ir[3]),_r=1;else if((Ir=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(cr))!==null)dr=parseInt(Ir[1]),ur=parseInt(Ir[2]),gr=parseInt(Ir[3]),_r=parseFloat(Ir[4]);else{if(_r=1,typeof cr=="string"&&cr.charAt(0)!=="#"){var Ar=new h(cr);cr=Ar.ok?Ar.toHex():"#000000"}cr.length===4?(dr=cr.substring(1,2),dr+=dr,ur=cr.substring(2,3),ur+=ur,gr=cr.substring(3,4),gr+=gr):(dr=cr.substring(1,3),ur=cr.substring(3,5),gr=cr.substring(5,7)),dr=parseInt(dr,16),ur=parseInt(ur,16),gr=parseInt(gr,16)}}return{r:dr,g:ur,b:gr,a:_r,style:cr}},He=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},qe=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};We.prototype.fillText=function(cr,dr,ur,gr){if(isNaN(dr)||isNaN(ur)||typeof cr!="string")throw o.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to
4178jsPDF.context2d.fillText");if(gr=isNaN(gr)?void 0:gr,!He.call(this)){var _r=wr(this.ctx.transform.rotation),Ir=this.ctx.transform.scaleX;nr.call(this,{text:cr,x:dr,y:ur,scale:Ir,angle:_r,align:this.textAlign,maxWidth:gr})}},We.prototype.strokeText=function(cr,dr,ur,gr){if(isNaN(dr)||isNaN(ur)||typeof cr!="string")throw o.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!qe.call(this)){gr=isNaN(gr)?void 0:gr;var _r=wr(this.ctx.transform.rotation),Ir=this.ctx.transform.scaleX;nr.call(this,{text:cr,x:dr,y:ur,scale:Ir,renderingMode:"stroke",angle:_r,align:this.textAlign,maxWidth:gr})}},We.prototype.measureText=function(cr){if(typeof cr!="string")throw o.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var dr=this.pdf,ur=this.pdf.internal.scaleFactor,gr=dr.internal.getFontSize(),_r=dr.getStringUnitWidth(cr)*gr/dr.internal.scaleFactor;return new function(Ir){var Ar=(Ir=Ir||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return Ar}}),this}({width:_r*=Math.round(96*ur/72*1e4)/1e4})},We.prototype.scale=function(cr,dr){if(isNaN(cr)||isNaN(dr))throw o.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var ur=new Be(cr,0,0,dr,0,0);this.ctx.transform=this.ctx.transform.multiply(ur)},We.prototype.rotate=function(cr){if(isNaN(cr))throw o.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var dr=new Be(Math.cos(cr),Math.sin(cr),-Math.sin(cr),Math.cos(cr),0,0);this.ctx.transform=this.ctx.transform.multiply(dr)},We.prototype.translate=function(cr,dr){if(isNaN(cr)||isNaN(dr))throw o.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var ur=new Be(1,0,0,1,cr,dr);this.ctx.transform=this.ctx.transform.multiply(ur)},We.prototype.transform=function(cr,dr,ur,gr,_r,Ir){if(isNaN(cr)||isNaN(dr)||isNaN(ur)||isNaN(gr)||isNaN(_r)||isNaN(Ir))throw o.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var Ar=new Be(cr,dr,ur,gr,_r,Ir);this.ctx.transform=this.ctx.transform.multiply(Ar)},We.prototype.setTransform=function(cr,dr,ur,gr,_r,Ir){cr=isNaN(cr)?1:cr,dr=isNaN(dr)?0:dr,ur=isNaN(ur)?0:ur,gr=isNaN(gr)?1:gr,_r=isNaN(_r)?0:_r,Ir=isNaN(Ir)?0:Ir,this.ctx.transform=new Be(cr,dr,ur,gr,_r,Ir)};var Ge=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};We.prototype.drawImage=function(cr,dr,ur,gr,_r,Ir,Ar,Tr,Nr){var Br=this.pdf.getImageProperties(cr),Hr=1,Vr=1,mr=1,Sr=1;gr!==void 0&&Tr!==void 0&&(mr=Tr/gr,Sr=Nr/_r,Hr=Br.width/gr*Tr/gr,Vr=Br.height/_r*Nr/_r),Ir===void 0&&(Ir=dr,Ar=ur,dr=0,ur=0),gr!==void 0&&Tr===void 0&&(Tr=gr,Nr=_r),gr===void 0&&Tr===void 0&&(Tr=Br.width,Nr=Br.height);var Lr=this.ctx.transform.decompose(),jr=wr(Lr.rotate.shx),fr=new Be,Cr=(fr=(fr=(fr=fr.multiply(Lr.translate)).multiply(Lr.skew)).multiply(Lr.scale)).applyToRectangle(new $e(Ir-dr*mr,Ar-ur*Sr,gr*Hr,_r*Vr));if(this.autoPaging){for(var Mr,$r=Ye.call(this,Cr),Fr=[],Kr=0;Kr<$r.length;Kr+=1)Fr.indexOf($r[Kr])===-1&&Fr.push($r[Kr]);Qe(Fr);for(var an=Fr[0],Wr=Fr[Fr.length-1],hn=an;hn<Wr+1;hn++){this.pdf.setPage(hn);var cn=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],tn=hn===1?this.posY+this.margin[0]:this.margin[0],Qr=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],wn=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],gn=hn===1?0:Qr+(hn-2)*wn;if(this.ctx.clip_path.length!==0){var In=this.path;Mr=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Ke(Mr,this.posX+this.margin[3],-gn+tn+this.ctx.prevPageLastElemOffset),Je.call(this,"fill",!0),this.path=In}var yn=JSON.parse(JSON.stringify(Cr));yn=Ke([yn],this.posX+this.margin[3],-gn+tn+this.ctx.prevPageLastElemOffset)[0];var Mn=(hn>an||hn<Wr)&&Ge.call(this);Mn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],cn,wn,null).clip().discardPath()),this.pdf.addImage(cr,"JPEG",yn.x,yn.y,yn.w,yn.h,null,null,jr),Mn&&this.pdf.restoreGraphicsState()}}
vendor: 44,127 bytes, lines 4178-4184
4178else this.pdf.addImage(cr,"JPEG",Cr.x,Cr.y,Cr.w,Cr.h,null,null,jr)};var Ye=function(cr,dr,ur){var gr=[];dr=dr||this.pdf.internal.pageSize.width,ur=ur||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var _r=this.posY+this.ctx.prevPageLastElemOffset;switch(cr.type){default:case"mt":case"lt":gr.push(Math.floor((cr.y+_r)/ur)+1);break;case"arc":gr.push(Math.floor((cr.y+_r-cr.radius)/ur)+1),gr.push(Math.floor((cr.y+_r+cr.radius)/ur)+1);break;case"qct":var Ir=vr(this.ctx.lastPoint.x,this.ctx.lastPoint.y,cr.x1,cr.y1,cr.x,cr.y);gr.push(Math.floor((Ir.y+_r)/ur)+1),gr.push(Math.floor((Ir.y+Ir.h+_r)/ur)+1);break;case"bct":var Ar=Dr(this.ctx.lastPoint.x,this.ctx.lastPoint.y,cr.x1,cr.y1,cr.x2,cr.y2,cr.x,cr.y);gr.push(Math.floor((Ar.y+_r)/ur)+1),gr.push(Math.floor((Ar.y+Ar.h+_r)/ur)+1);break;case"rect":gr.push(Math.floor((cr.y+_r)/ur)+1),gr.push(Math.floor((cr.y+cr.h+_r)/ur)+1)}for(var Tr=0;Tr<gr.length;Tr+=1)for(;this.pdf.internal.getNumberOfPages()<gr[Tr];)Ve.call(this);return gr},Ve=function(){var cr=this.fillStyle,dr=this.strokeStyle,ur=this.font,gr=this.lineCap,_r=this.lineWidth,Ir=this.lineJoin;this.pdf.addPage(),this.fillStyle=cr,this.strokeStyle=dr,this.font=ur,this.lineCap=gr,this.lineWidth=_r,this.lineJoin=Ir},Ke=function(cr,dr,ur){for(var gr=0;gr<cr.length;gr++)switch(cr[gr].type){case"bct":cr[gr].x2+=dr,cr[gr].y2+=ur;case"qct":cr[gr].x1+=dr,cr[gr].y1+=ur;default:cr[gr].x+=dr,cr[gr].y+=ur}return cr},Qe=function(cr){return cr.sort(function(dr,ur){return dr-ur})},Ze=function(cr,dr){var ur=this.fillStyle,gr=this.strokeStyle,_r=this.lineCap,Ir=this.lineWidth,Ar=Math.abs(Ir*this.ctx.transform.scaleX),Tr=this.lineJoin;if(this.autoPaging){for(var Nr,Br,Hr=JSON.parse(JSON.stringify(this.path)),Vr=JSON.parse(JSON.stringify(this.path)),mr=[],Sr=0;Sr<Vr.length;Sr++)if(Vr[Sr].x!==void 0)for(var Lr=Ye.call(this,Vr[Sr]),jr=0;jr<Lr.length;jr+=1)mr.indexOf(Lr[jr])===-1&&mr.push(Lr[jr]);for(var fr=0;fr<mr.length;fr++)for(;this.pdf.internal.getNumberOfPages()<mr[fr];)Ve.call(this);Qe(mr);for(var Cr=mr[0],Mr=mr[mr.length-1],$r=Cr;$r<Mr+1;$r++){this.pdf.setPage($r),this.fillStyle=ur,this.strokeStyle=gr,this.lineCap=_r,this.lineWidth=Ar,this.lineJoin=Tr;var Fr=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Kr=$r===1?this.posY+this.margin[0]:this.margin[0],an=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Wr=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],hn=$r===1?0:an+($r-2)*Wr;if(this.ctx.clip_path.length!==0){var cn=this.path;Nr=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Ke(Nr,this.posX+this.margin[3],-hn+Kr+this.ctx.prevPageLastElemOffset),Je.call(this,cr,!0),this.path=cn}if(Br=JSON.parse(JSON.stringify(Hr)),this.path=Ke(Br,this.posX+this.margin[3],-hn+Kr+this.ctx.prevPageLastElemOffset),dr===!1||$r===0){var tn=($r>Cr||$r<Mr)&&Ge.call(this);tn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Fr,Wr,null).clip().discardPath()),Je.call(this,cr,dr),tn&&this.pdf.restoreGraphicsState()}this.lineWidth=Ir}this.path=Hr}else this.lineWidth=Ar,Je.call(this,cr,dr),this.lineWidth=Ir},Je=function(cr,dr){if((cr!=="stroke"||dr||!qe.call(this))&&(cr==="stroke"||dr||!He.call(this))){for(var ur,gr,_r=[],Ir=this.path,Ar=0;Ar<Ir.length;Ar++){var Tr=Ir[Ar];switch(Tr.type){case"begin":_r.push({begin:!0});break;case"close":_r.push({close:!0});break;case"mt":_r.push({start:Tr,deltas:[],abs:[]});break;case"lt":var Nr=_r.length;if(Ir[Ar-1]&&!isNaN(Ir[Ar-1].x)&&(ur=[Tr.x-Ir[Ar-1].x,Tr.y-Ir[Ar-1].y],Nr>0)){for(;Nr>=0;Nr--)if(_r[Nr-1].close!==!0&&_r[Nr-1].begin!==!0){_r[Nr-1].deltas.push(ur),_r[Nr-1].abs.push(Tr);break}}break;case"bct":ur=[Tr.x1-Ir[Ar-1].x,Tr.y1-Ir[Ar-1].y,Tr.x2-Ir[Ar-1].x,Tr.y2-Ir[Ar-1].y,Tr.x-Ir[Ar-1].x,Tr.y-Ir[Ar-1].y],_r[_r.length-1].deltas.push(ur);break;case"qct":var Br=Ir[Ar-1].x+2/3*(Tr.x1-Ir[Ar-1].x),Hr=Ir[Ar-1].y+2/3*(Tr.y1-Ir[Ar-1].y),Vr=Tr.x+2/3*(Tr.x1-Tr.x),mr=Tr.y+2/3*(Tr.y1-Tr.y),Sr=Tr.x,Lr=Tr.y;ur=[Br-Ir[Ar-1].x,Hr-Ir[Ar-1].y,Vr-Ir[Ar-1].x,mr-Ir[Ar-1].y,Sr-Ir[Ar-1].x,Lr-Ir[Ar-1].y],_r[_r.length-1].deltas.push(ur);break;case"arc":_r.push({deltas:[],abs:[],arc:!0}),Array.isArray(_r[_r.length-1].abs)&&_r[_r.length-1].abs.push(Tr)}}gr=dr?null:cr==="stroke"?"stroke":"fill";for(var jr=!1,fr=0;fr<_r.length;fr++)if(_r[fr].arc)for(var Cr=_r[fr].abs,Mr=0;Mr<Cr.length;Mr++){var $r=Cr[Mr];$r.type==="arc"?ar.call(this,$r.x,$r.y,$r.radius,$r.startAngle,$r.endAngle,$r.counterclockwise,void 0,dr,!jr):hr.call(this,$r.x,$r.y),jr=!0}else if(_r[fr].close===!0)this.pdf.internal.out("h"),jr=!1;else if(_r[fr].begin!==!0){var Fr=_r[fr].start.x,Kr=_r[fr].start.y;sr.call(this,_r[fr].deltas,Fr,Kr),jr=!0}gr&&or.call(this,gr),dr&&pr.call(this)}},ir=function(cr){var dr=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,ur=dr*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return cr-ur;case"top":return cr+dr-ur;case"hanging":return cr+dr-2*ur;case"middle":return cr+dr/2-ur;default:return cr}},rr=function(cr){return cr+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};We.prototype.createLinearGradient=function(){var cr=function(){};return cr.colorStops=[],cr.addColorStop=function(dr,ur){this.colorStops.push([dr,ur])},cr.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},cr.isCanvasGradient=!0,cr},We.prototype.createPattern=function(){return this.createLinearGradient()},We.prototype.createRadialGradient=function(){return this.createLinearGradient()};var ar=function(cr,dr,ur,gr,_r,Ir,Ar,Tr,Nr){for(var Br=Rr.call(this,ur,gr,_r,Ir),Hr=0;Hr<Br.length;Hr++){var Vr=Br[Hr];Hr===0&&(Nr?tr.call(this,Vr.x1+cr,Vr.y1+dr):hr.call(this,Vr.x1+cr,Vr.y1+dr)),xr.call(this,cr,dr,Vr.x2,Vr.y2,Vr.x3,Vr.y3,Vr.x4,Vr.y4)}Tr?pr.call(this):or.call(this,Ar)},or=function(cr){switch(cr){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},pr=function(){this.pdf.clip(),this.pdf.discardPath()},tr=function(cr,dr){this.pdf.internal.out(Te(cr)+" "+je(dr)+" m")},nr=function(cr){var dr;switch(cr.align){case"right":case"end":dr="right";break;case"center":dr="center";break;default:dr="left"}var ur,gr,_r,Ir=this.pdf.getTextDimensions(cr.text),Ar=ir.call(this,cr.y),Tr=rr.call(this,Ar)-Ir.h,Nr=this.ctx.transform.applyToPoint(new De(cr.x,Ar));if(this.autoPaging){var Br=this.ctx.transform.decompose(),Hr=new Be;Hr=(Hr=(Hr=Hr.multiply(Br.translate)).multiply(Br.skew)).multiply(Br.scale);for(var Vr=this.ctx.transform.applyToRectangle(new $e(cr.x,Ar,Ir.w,Ir.h)),mr=Hr.applyToRectangle(new $e(cr.x,Tr,Ir.w,Ir.h)),Sr=Ye.call(this,mr),Lr=[],jr=0;jr<Sr.length;jr+=1)Lr.indexOf(Sr[jr])===-1&&Lr.push(Sr[jr]);Qe(Lr);for(var fr=Lr[0],Cr=Lr[Lr.length-1],Mr=fr;Mr<Cr+1;Mr++){this.pdf.setPage(Mr);var $r=Mr===1?this.posY+this.margin[0]:this.margin[0],Fr=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Kr=this.pdf.internal.pageSize.height-this.margin[2],an=Kr-this.margin[0],Wr=this.pdf.internal.pageSize.width-this.margin[1],hn=Wr-this.margin[3],cn=Mr===1?0:Fr+(Mr-2)*an;if(this.ctx.clip_path.length!==0){var tn=this.path;ur=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Ke(ur,this.posX+this.margin[3],-1*cn+$r),Je.call(this,"fill",!0),this.path=tn}var Qr=Ke([JSON.parse(JSON.stringify(mr))],this.posX+this.margin[3],-cn+$r+this.ctx.prevPageLastElemOffset)[0];cr.scale>=.01&&(gr=this.pdf.internal.getFontSize(),this.pdf.setFontSize(gr*cr.scale),_r=this.lineWidth,this.lineWidth=_r*cr.scale);var wn=this.autoPaging!=="text";if(wn||Qr.y+Qr.h<=Kr){if(wn||Qr.y>=$r&&Qr.x<=Wr){var gn=wn?cr.text:this.pdf.splitTextToSize(cr.text,cr.maxWidth||Wr-Qr.x)[0],In=Ke([JSON.parse(JSON.stringify(Vr))],this.posX+this.margin[3],-cn+$r+this.ctx.prevPageLastElemOffset)[0],yn=wn&&(Mr>fr||Mr<Cr)&&Ge.call(this);yn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],hn,an,null).clip().discardPath()),this.pdf.text(gn,In.x,In.y,{angle:cr.angle,align:dr,renderingMode:cr.renderingMode}),yn&&this.pdf.restoreGraphicsState()}}else Qr.y<Kr&&(this.ctx.prevPageLastElemOffset+=Kr-Qr.y);cr.scale>=.01&&(this.pdf.setFontSize(gr),this.lineWidth=_r)}}else cr.scale>=.01&&(gr=this.pdf.internal.getFontSize(),this.pdf.setFontSize(gr*cr.scale),_r=this.lineWidth,this.lineWidth=_r*cr.scale),this.pdf.text(cr.text,Nr.x+this.posX,Nr.y+this.posY,{angle:cr.angle,align:dr,renderingMode:cr.renderingMode,maxWidth:cr.maxWidth}),cr.scale>=.01&&(this.pdf.setFontSize(gr),this.lineWidth=_r)},hr=function(cr,dr,ur,gr){ur=ur||0,gr=gr||0,this.pdf.internal.out(Te(cr+ur)+" "+je(dr+gr)+" l")},sr=function(cr,dr,ur){return this.pdf.lines(cr,dr,ur,null,null)},xr=function(cr,dr,ur,gr,_r,Ir,Ar,Tr){this.pdf.internal.out([Re(Oe(ur+cr)),Re(Me(gr+dr)),Re(Oe(_r+cr)),Re(Me(Ir+dr)),Re(Oe(Ar+cr)),Re(Me(Tr+dr)),"c"].join(" "))},Rr=function(cr,dr,ur,gr){for(var _r=2*Math.PI,Ir=Math.PI/2;dr>ur;)dr-=_r;var Ar=Math.abs(ur-dr);Ar<_r&&gr&&(Ar=_r-Ar);for(var Tr=[],Nr=gr?-1:1,Br=dr;Ar>1e-5;){var Hr=Br+Nr*Math.min(Ar,Ir);Tr.push(br.call(this,cr,Br,Hr)),Ar-=Math.abs(Hr-Br),Br=Hr}return Tr},br=function(cr,dr,ur){var gr=(ur-dr)/2,_r=cr*Math.cos(gr),Ir=cr*Math.sin(gr),Ar=_r,Tr=-Ir,Nr=Ar*Ar+Tr*Tr,Br=Nr+Ar*_r+Tr*Ir,Hr=4/3*(Math.sqrt(2*Nr*Br)-Br)/(Ar*Ir-Tr*_r),Vr=Ar-Hr*Tr,mr=Tr+Hr*Ar,Sr=Vr,Lr=-mr,jr=gr+dr,fr=Math.cos(jr),Cr=Math.sin(jr);return{x1:cr*Math.cos(dr),y1:cr*Math.sin(dr),x2:Vr*fr-mr*Cr,y2:Vr*Cr+mr*fr,x3:Sr*fr-Lr*Cr,y3:Sr*Cr+Lr*fr,x4:cr*Math.cos(ur),y4:cr*Math.sin(ur)}},wr=function(cr){return 180*cr/Math.PI},vr=function(cr,dr,ur,gr,_r,Ir){var Ar=cr+.5*(ur-cr),Tr=dr+.5*(gr-dr),Nr=_r+.5*(ur-_r),Br=Ir+.5*(gr-Ir),Hr=Math.min(cr,_r,Ar,Nr),Vr=Math.max(cr,_r,Ar,Nr),mr=Math.min(dr,Ir,Tr,Br),Sr=Math.max(dr,Ir,Tr,Br);return new $e(Hr,mr,Vr-Hr,Sr-mr)},Dr=function(cr,dr,ur,gr,_r,Ir,Ar,Tr){var Nr,Br,Hr,Vr,mr,Sr,Lr,jr,fr,Cr,Mr,$r,Fr,Kr,an=ur-cr,Wr=gr-dr,hn=_r-ur,cn=Ir-gr,tn=Ar-_r,Qr=Tr-Ir;for(Br=0;Br<41;Br++)fr=(Lr=(Hr=cr+(Nr=Br/40)*an)+Nr*((mr=ur+Nr*hn)-Hr))+Nr*(mr+Nr*(_r+Nr*tn-mr)-Lr),Cr=(jr=(Vr=dr+Nr*Wr)+Nr*((Sr=gr+Nr*cn)-Vr))+Nr*(Sr+Nr*(Ir+Nr*Qr-Sr)-jr),Br==0?(Mr=fr,$r=Cr,Fr=fr,Kr=Cr):(Mr=Math.min(Mr,fr),$r=Math.min($r,Cr),Fr=Math.max(Fr,fr),Kr=Math.max(Kr,Cr));return new $e(Math.round(Mr),Math.round($r),Math.round(Fr-Mr),Math.round(Kr-$r))},kr=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var cr,dr,ur=(cr=this.ctx.lineDash,dr=this.ctx.lineDashOffset,JSON.stringify({lineDash:cr,lineDashOffset:dr}));this.prevLineDash!==ur&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=ur)}}})(E.API),function(Ee){var Re=function(De){var $e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye;for(Be=[],Ue=0,ze=(De+=$e="\0\0\0\0".slice(De.length%4||4)).length;ze>Ue;Ue+=4)(We=(De.charCodeAt(Ue)<<24)+(De.charCodeAt(Ue+1)<<16)+(De.charCodeAt(Ue+2)<<8)+De.charCodeAt(Ue+3))!==0?(Xe=(We=((We=((We=((We=(We-(Ye=We%85))/85)-(Ge=We%85))/85)-(qe=We%85))/85)-(He=We%85))/85)%85,Be.push(Xe+33,He+33,qe+33,Ge+33,Ye+33)):Be.push(122);return function(Ve,Ke){for(var Qe=Ke;Qe>0;Qe--)Ve.pop()}(Be,$e.length),String.fromCharCode.apply(String,Be)+"~>"},Te=function(De){var $e,Be,Ue,ze,We,Xe=String,He="length",qe=255,Ge="charCodeAt",Ye="slice",Ve="replace";for(De[Ye](-2),De=De[Ye](0,-2)[Ve](/\s/g,"")[Ve]("z","!!!!!"),Ue=[],ze=0,We=(De+=$e="uuuuu"[Ye](De[He]%5||5))[He];We>ze;ze+=5)Be=52200625*(De[Ge](ze)-33)+614125*(De[Ge](ze+1)-33)+7225*(De[Ge](ze+2)-33)+85*(De[Ge](ze+3)-33)+(De[Ge](ze+4)-33),Ue.push(qe&Be>>24,qe&Be>>16,qe&Be>>8,qe&Be);return function(Ke,Qe){for(var Ze=Qe;Ze>0;Ze--)Ke.pop()}(Ue,$e[He]),Xe.fromCharCode.apply(Xe,Ue)},je=function(De){return De.split("").map(function($e){return("0"+$e.charCodeAt().toString(16)).slice(-2)}).join("")+">"},Oe=function(De){var $e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((De=De.replace(/\s/g,"")).indexOf(">")!==-1&&(De=De.substr(0,De.indexOf(">"))),De.length%2&&(De+="0"),$e.test(De)===!1)return"";for(var Be="",Ue=0;Ue<De.length;Ue+=2)Be+=String.fromCharCode("0x"+(De[Ue]+De[Ue+1]));return Be},Me=function(De){for(var $e=new Uint8Array(De.length),Be=De.length;Be--;)$e[Be]=De.charCodeAt(Be);return($e=zlibSync($e)).reduce(function(Ue,ze){return Ue+String.fromCharCode(ze)},"")};Ee.processDataByFilters=function(De,$e){var Be=0,Ue=De||"",ze=[];for(typeof($e=$e||[])=="string"&&($e=[$e]),Be=0;Be<$e.length;Be+=1)switch($e[Be]){case"ASCII85Decode":case"/ASCII85Decode":Ue=Te(Ue),ze.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":Ue=Re(Ue),ze.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":Ue=Oe(Ue),ze.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":Ue=je(Ue),ze.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":Ue=Me(Ue),ze.push("/FlateDecode");break;default:throw new Error('The filter: "'+$e[Be]+'" is not implemented')}return{data:Ue,reverseChain:ze.reverse().join(" ")}}}(E.API),function(Ee){Ee.loadFile=function(Re,Te,je){return function(Oe,Me,De){Me=Me!==!1,De=typeof De=="function"?De:function(){};var $e=void 0;try{$e=function(Be,Ue,ze){var We=new XMLHttpRequest,Xe=0,He=function(qe){var Ge=qe.length,Ye=[],Ve=String.fromCharCode;for(Xe=0;Xe<Ge;Xe+=1)Ye.push(Ve(255&qe.charCodeAt(Xe)));return Ye.join("")};if(We.open("GET",Be,!Ue),We.overrideMimeType("text/plain; charset=x-user-defined"),Ue===!1&&(We.onload=function(){We.status===200?ze(He(this.responseText)):ze(void 0)}),We.send(null),Ue&&We.status===200)return He(We.responseText)}(Oe,Me,De)}catch{}return $e}(Re,Te,je)},Ee.allowFsRead=void 0,Ee.loadImageFile=Ee.loadFile}(E.API),function(Ee){function Re(){return(i.html2canvas?Promise.resolve(i.html2canvas):__vitePreload(()=>import("./html2canvas.esm-CBrSDip1.js"),[])).catch(function($e){return Promise.reject(new Error("Could not load html2canvas: "+$e))}).then(function($e){return $e.default?$e.default:$e})}function Te(){return(i.DOMPurify?Promise.resolve(i.DOMPurify):__vitePreload(()=>import("./purify.es-B9ZVCkUG.js"),[])).catch(function($e){return Promise.reject(new Error("Could not load dompurify: "+$e))}).then(function($e){return $e.default?$e.default:$e})}var je=function($e){var Be=_typeof($e);return Be==="undefined"?"undefined":Be==="string"||$e instanceof String?"string":Be==="number"||$e instanceof Number?"number":Be==="function"||$e instanceof Function?"function":$e&&$e.constructor===Array?"array":$e&&$e.nodeType===1?"element":Be==="object"?"object":"unknown"},Oe=function($e,Be){var Ue=document.createElement($e);for(var ze in Be.className&&(Ue.className=Be.className),Be.innerHTML&&Be.dompurify&&(Ue.innerHTML=Be.dompurify.sanitize(Be.innerHTML)),Be.style)Ue.style[ze]=Be.style[ze];return Ue},Me=function $e(Be,Ue){for(var ze=Be.nodeType===3?document.createTextNode(Be.nodeValue):Be.cloneNode(!1),We=Be.firstChild;We;We=We.nextSibling)Ue!==!0&&We.nodeType===1&&We.nodeName==="SCRIPT"||ze.appendChild($e(We,Ue));return Be.nodeType===1&&(Be.nodeName==="CANVAS"?(ze.width=Be.width,ze.height=Be.height,ze.getContext("2d").drawImage(Be,0,0)):Be.nodeName!=="TEXTAREA"&&Be.nodeName!=="SELECT"||(ze.value=Be.value),ze.addEventListener("load",function(){ze.scrollTop=Be.scrollTop,ze.scrollLeft=Be.scrollLeft},!0)),ze},De=function $e(Be){var Ue=Object.assign($e.convert(Promise.resolve()),JSON.parse(JSON.stringify($e.template))),ze=$e.convert(Promise.resolve(),Ue);return(ze=ze.setProgress(1,$e,1,[$e])).set(Be)};(De.prototype=Object.create(Promise.prototype)).constructor=De,De.convert=function($e,Be){return $e.__proto__=Be||De.prototype,$e},De.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},De.prototype.from=function($e,Be){return this.then(function(){switch(Be=Be||function(Ue){switch(je(Ue)){case"string":return"string";case"element":return Ue.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}($e),Be){case"string":return this.then(Te).then(function(Ue){return this.set({src:Oe("div",{innerHTML:$e,dompurify:Ue})})});case"element":return this.set({src:$e});case"canvas":return this.set({canvas:$e});case"img":return this.set({img:$e});default:return this.error("Unknown source type.")}})},De.prototype.to=function($e){switch($e){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},De.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var $e={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},Be=Me(this.prop.src,this.opt.html2canvas.javascriptEnabled);Be.tagName==="BODY"&&($e.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=Oe("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=Oe("div",{className:"html2pdf__container",style:$e}),this.prop.container.appendChild(Be),this.prop.container.firstChild.appendChild(Oe("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},De.prototype.toCanvas=function(){var $e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList($e).then(Re).then(function(Be){var Ue=Object.assign({},this.opt.html2canvas);return delete Ue.onrendered,Be(this.prop.container,Ue)}).then(function(Be){(this.opt.html2canvas.onrendered||function(){})(Be),this.prop.canvas=Be,document.body.removeChild(this.prop.overlay)})},De.prototype.toContext2d=function(){var $e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList($e).then(Re).then(function(Be){var Ue=this.opt.jsPDF,ze=this.opt.fontFaces,We=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,Xe=Object.assign({async:!0,allowTaint:!0,scale:We,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete Xe.onrendered,Ue.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,Ue.context2d.posX=this.opt.x,Ue.context2d.posY=this.opt.y,Ue.context2d.margin=this.opt.margin,Ue.context2d.fontFaces=ze,ze)for(var He=0;He<ze.length;++He){var qe=ze[He],Ge=qe.src.find(function(Ye){return Ye.format==="truetype"});Ge&&Ue.addFont(Ge.url,qe.ref.name,qe.ref.style)}return Xe.windowHeight=Xe.windowHeight||0,Xe.windowHeight=Xe.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):Xe.windowHeight,Ue.context2d.save(!0),Be(this.prop.container,Xe)}).then(function(Be){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(Be),this.prop.canvas=Be,document.body.removeChild(this.prop.overlay)})},De.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var $e=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=$e})},De.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},De.prototype.output=function($e,Be,Ue){return(Ue=Ue||"pdf").toLowerCase()==="img"||Ue.toLowerCase()==="image"?this.outputImg($e,Be):this.outputPdf($e,Be)},De.prototype.outputPdf=function($e,Be){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output($e,Be)})},De.prototype.outputImg=function($e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch($e){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+$e+'" is not supported.'}})},De.prototype.save=function($e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set($e?{filename:$e}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},De.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},De.prototype.set=function($e){if(je($e)!=="object")return this;var Be=Object.keys($e||{}).map(function(Ue){if(Ue in De.template.prop)return function(){this.prop[Ue]=$e[Ue]};switch(Ue){case"margin":return this.setMargin.bind(this,$e.margin);case"jsPDF":return function(){return this.opt.jsPDF=$e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,$e.pageSize);default:return function(){this.opt[Ue]=$e[Ue]}}},this);return this.then(function(){return this.thenList(Be)})},De.prototype.get=function($e,Be){return this.then(function(){var Ue=$e in De.template.prop?this.prop[$e]:this.opt[$e];return Be?Be(Ue):Ue})},De.prototype.setMargin=function($e){return this.then(function(){switch(je($e)){case"number":$e=[$e,$e,$e,$e];case"array":if($e.length===2&&($e=[$e[0],$e[1],$e[0],$e[1]]),$e.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=$e}).then(this.setPageSize)},De.prototype.setPageSize=function($e){function Be(Ue,ze){return Math.floor(Ue*ze/72*96)}return this.then(function(){($e=$e||E.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||($e.inner={width:$e.width-this.opt.margin[1]-this.opt.margin[3],height:$e.height-this.opt.margin[0]-this.opt.margin[2]},$e.inner.px={width:Be($e.inner.width,$e.k),height:Be($e.inner.height,$e.k)},$e.inner.ratio=$e.inner.height/$e.inner.width),this.prop.pageSize=$e})},De.prototype.setProgress=function($e,Be,Ue,ze){return $e!=null&&(this.progress.val=$e),Be!=null&&(this.progress.state=Be),Ue!=null&&(this.progress.n=Ue),ze!=null&&(this.progress.stack=ze),this.progress.ratio=this.progress.val/this.progress.state,this},De.prototype.updateProgress=function($e,Be,Ue,ze){return this.setProgress($e?this.progress.val+$e:null,Be||null,Ue?this.progress.n+Ue:null,ze?this.progress.stack.concat(ze):null)},De.prototype.then=function($e,Be){var Ue=this;return this.thenCore($e,Be,function(ze,We){return Ue.updateProgress(null,null,1,[ze]),Promise.prototype.then.call(this,function(Xe){return Ue.updateProgress(null,ze),Xe}).then(ze,We).then(function(Xe){return Ue.updateProgress(1),Xe})})},De.prototype.thenCore=function($e,Be,Ue){Ue=Ue||Promise.prototype.then;var ze=this;$e&&($e=$e.bind(ze)),Be&&(Be=Be.bind(ze));var We=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?ze:De.convert(Object.assign({},ze),Promise.prototype),Xe=Ue.call(We,$e,Be);return De.convert(Xe,ze.__proto__)},De.prototype.thenExternal=function($e,Be){return Promise.prototype.then.call(this,$e,Be)},De.prototype.thenList=function($e){var Be=this;return $e.forEach(function(Ue){Be=Be.thenCore(Ue)}),Be},De.prototype.catch=function($e){$e&&($e=$e.bind(this));var Be=Promise.prototype.catch.call(this,$e);return De.convert(Be,this)},De.prototype.catchExternal=function($e){return Promise.prototype.catch.call(this,$e)},De.prototype.error=function($e){return this.then(function(){throw new Error($e)})},De.prototype.using=De.prototype.set,De.prototype.saveAs=De.prototype.save,De.prototype.export=De.prototype.output,De.prototype.run=De.prototype.then,E.getPageSize=function($e,Be,Ue){if(_typeof($e)==="object"){var ze=$e;$e=ze.orientation,Be=ze.unit||Be,Ue=ze.format||Ue}Be=Be||"mm",Ue=Ue||"a4",$e=(""+($e||"P")).toLowerCase();var We,Xe=(""+Ue).toLowerCase(),He={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(Be){case"pt":We=1;break;case"mm":We=72/25.4;break;case"cm":We=72/2.54;break;case"in":We=72;break;case"px":We=.75;break;case"pc":case"em":We=12;break;case"ex":We=6;break;default:throw"Invalid unit: "+Be}var qe,Ge=0,Ye=0;if(He.hasOwnProperty(Xe))Ge=He[Xe][1]/We,Ye=He[Xe][0]/We;else try{Ge=Ue[1],Ye=Ue[0]}catch{throw new Error("Invalid format: "+Ue)}if($e==="p"||$e==="portrait")$e="p",Ye>Ge&&(qe=Ye,Ye=Ge,Ge=qe);else{if($e!=="l"&&$e!=="landscape")throw"Invalid orientation: "+$e;$e="l",Ge>Ye&&(qe=Ye,Ye=Ge,Ge=qe)}return{width:Ye,height:Ge,unit:Be,k:We,orientation:$e}},Ee.html=function($e,Be){(Be=Be||{}).callback=Be.callback||function(){},Be.html2canvas=Be.html2canvas||{},Be.html2canvas.canvas=Be.html2canvas.canvas||this.canvas,Be.jsPDF=Be.jsPDF||this,Be.fontFaces=Be.fontFaces?Be.fontFaces.map(Ot):null;var Ue=new De(Be);return Be.worker?Ue:Ue.from($e).doCallback()}}(E.API),E.API.addJS=function(Ee){var Re,Te,je=function(Oe){for(var Me="",De=0;De<Oe.length;De++){var $e=Oe[De];if($e==="("||$e===")"){for(var Be=0,Ue=De-1;Ue>=0&&Oe[Ue]==="\\";Ue--)Be++;Me+=Be%2==0?"\\"+$e:$e}else Me+=$e}return Me}(Ee);return this.internal.events.subscribe("postPutResources",function(){Re=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Re+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Te=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+je+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){Re!==void 0&&Te!==void 0&&this.internal.out("/Names <</JavaScript "+Re+" 0 R>>")}),this},function(Ee){var Re;Ee.events.push(["postPutResources",function(){var Te=this,je=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var Oe=Te.outline.render().split(/\r\n/),Me=0;Me<Oe.length;Me++){var De=Oe[Me],$e=je.exec(De);if($e!=null){var Be=$e[1];Te.internal.newObjectDeferredBegin(Be,!1)}Te.internal.write(De)}if(this.outline.createNamedDestinations){var Ue=this.internal.pages.length,ze=[];for(Me=0;Me<Ue;Me++){var We=Te.internal.newObject();ze.push(We);var Xe=Te.internal.getPageInfo(Me+1);Te.internal.write("<< /D["+Xe.objId+" 0 R /XYZ null null null]>> endobj")}var He=Te.internal.newObject();for(Te.internal.write("<< /Names [ "),Me=0;Me<ze.length;Me++)Te.internal.write("(page_"+(Me+1)+")"+ze[Me]+" 0 R");Te.internal.write(" ] >>","endobj"),Re=Te.internal.newObject(),Te.internal.write("<< /Dests "+He+" 0 R"),Te.internal.write(">>","endobj")}}]),Ee.events.push(["putCatalog",function(){var Te=this;Te.outline.root.children.length>0&&(Te.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&Te.internal.write("/Names "+Re+" 0 R"))}]),Ee.events.push(["initialized",function(){var Te=this;Te.outline={createNamedDestinations:!1,root:{children:[]}},Te.outline.add=function(je,Oe,Me){var De={title:Oe,options:Me,children:[]};return je==null&&(je=this.root),je.children.push(De),De},Te.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=Te,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},Te.outline.genIds_r=function(je){je.id=Te.internal.newObjectDeferred();for(var Oe=0;Oe<je.children.length;Oe++)this.genIds_r(je.children[Oe])},Te.outline.renderRoot=function(je){this.objStart(je),this.line("/Type /Outlines"),je.children.length>0&&(this.line("/First "+this.makeRef(je.children[0])),this.line("/Last "+this.makeRef(je.children[je.children.length-1]))),this.line("/Count "+this.count_r({count:0},je)),this.objEnd()},Te.outline.renderItems=function(je){for(var Oe=this.ctx.pdf.internal.getVerticalCoordinateString,Me=0;Me<je.children.length;Me++){var De=je.children[Me];this.objStart(De),this.line("/Title "+this.makeString(De.title)),this.line("/Parent "+this.makeRef(je)),Me>0&&this.line("/Prev "+this.makeRef(je.children[Me-1])),Me<je.children.length-1&&this.line("/Next "+this.makeRef(je.children[Me+1])),De.children.length>0&&(this.line("/First "+this.makeRef(De.children[0])),this.line("/Last "+this.makeRef(De.children[De.children.length-1])));var $e=this.count=this.count_r({count:0},De);if($e>0&&this.line("/Count "+$e),De.options&&De.options.pageNumber){var Be=Te.internal.getPageInfo(De.options.pageNumber);this.line("/Dest ["+Be.objId+" 0 R /XYZ 0 "+Oe(0)+" 0]")}this.objEnd()}for(var Ue=0;Ue<je.children.length;Ue++)this.renderItems(je.children[Ue])},Te.outline.line=function(je){this.ctx.val+=je+`\r 4179`},Te.outline.makeRef=function(je){return je.id+" 0 R"},Te.outline.makeString=function(je){return"("+Te.internal.pdfEscape(je)+")"},Te.outline.objStart=function(je){this.ctx.val+=`\r 4180`+je.id+` 0 obj\r 4181<<\r 4182`},Te.outline.objEnd=function(){this.ctx.val+=`>> \r 4183endobj\r 4184`},Te.outline.count_r=function(je,Oe){for(var Me=0;Me<Oe.children.length;Me++)je.count++,this.count_r(je,Oe.children[Me]);return je.count}}])}(E.API),function(Ee){var Re=[192,193,194,195,196,197,198,199];Ee.processJPEG=function(Te,je,Oe,Me,De,$e){var Be,Ue=this.decode.DCT_DECODE,ze=null;if(typeof Te=="string"||this.__addimage__.isArrayBuffer(Te)||this.__addimage__.isArrayBufferView(Te)){switch(Te=De||Te,Te=this.__addimage__.isArrayBuffer(Te)?new Uint8Array(Te):Te,Be=function(We){for(var Xe,He=256*We.charCodeAt(4)+We.charCodeAt(5),qe=We.length,Ge={width:0,height:0,numcomponents:1},Ye=4;Ye<qe;Ye+=2){if(Ye+=He,Re.indexOf(We.charCodeAt(Ye+1))!==-1){Xe=256*We.charCodeAt(Ye+5)+We.charCodeAt(Ye+6),Ge={width:256*We.charCodeAt(Ye+7)+We.charCodeAt(Ye+8),height:Xe,numcomponents:We.charCodeAt(Ye+9)};break}He=256*We.charCodeAt(Ye+2)+We.charCodeAt(Ye+3)}return Ge}(Te=this.__addimage__.isArrayBufferView(Te)?this.__addimage__.arrayBufferToBinaryString(Te):Te),Be.numcomponents){case 1:$e=this.color_spaces.DEVICE_GRAY;break;case 4:$e=this.color_spaces.DEVICE_CMYK;break;case 3:$e=this.color_spaces.DEVICE_RGB}ze={data:Te,width:Be.width,height:Be.height,colorSpace:$e,bitsPerComponent:8,filter:Ue,index:je,alias:Oe}}return ze}}(E.API),E.API.processPNG=function(Ee,Re,Te,je){if(this.__addimage__.isArrayBuffer(Ee)&&(Ee=new Uint8Array(Ee)),this.__addimage__.isArrayBufferView(Ee)){var Oe,Me=decodePng(Ee,{checkCrc:!0}),De=Me.width,$e=Me.height,Be=Me.channels,Ue=Me.palette,ze=Me.depth;Oe=Ue&&Be===1?function(ar){for(var or=ar.width,pr=ar.height,tr=ar.data,nr=ar.palette,hr=ar.depth,sr=!1,xr=[],Rr=[],br=void 0,wr=!1,vr=0,Dr=0;Dr<nr.length;Dr++){var kr=_slicedToArray(nr[Dr],4),cr=kr[0],dr=kr[1],ur=kr[2],gr=kr[3];xr.push(cr,dr,ur),gr!=null&&(gr===0?(vr++,Rr.length<1&&Rr.push(Dr)):gr<255&&(wr=!0))}if(wr||vr>1){sr=!0,Rr=void 0;var _r=or*pr;br=new Uint8Array(_r);for(var Ir=new DataView(tr.buffer),Ar=0;Ar<_r;Ar++){var Tr=ee(Ir,Ar,hr),Nr=_slicedToArray(nr[Tr],4)[3];br[Ar]=Nr}}else vr===0&&(Rr=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:sr?8:void 0,colorBytes:tr,alphaBytes:br,needSMask:sr,palette:xr,mask:Rr}}(Me):Be===2||Be===4?function(ar){for(var or=ar.data,pr=ar.width,tr=ar.height,nr=ar.channels,hr=ar.depth,sr=nr===2?"DeviceGray":"DeviceRGB",xr=nr-1,Rr=pr*tr,br=xr,wr=Rr*br,vr=1*Rr,Dr=Math.ceil(wr*hr/8),kr=Math.ceil(vr*hr/8),cr=new Uint8Array(Dr),dr=new Uint8Array(kr),ur=new DataView(or.buffer),gr=new DataView(cr.buffer),_r=new DataView(dr.buffer),Ir=!1,Ar=0;Ar<Rr;Ar++){for(var Tr=Ar*nr,Nr=0;Nr<br;Nr++)re(gr,ee(ur,Tr+Nr,hr),Ar*br+Nr,hr);var Br=ee(ur,Tr+br,hr);Br<(1<<hr)-1&&(Ir=!0),re(_r,Br,1*Ar,hr)}return{colorSpace:sr,colorsPerPixel:xr,sMaskBitsPerComponent:Ir?hr:void 0,colorBytes:cr,alphaBytes:dr,needSMask:Ir}}(Me):function(ar){var or=ar.data,pr=ar.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:pr,colorsPerPixel:pr==="DeviceGray"?1:3,colorBytes:or instanceof Uint16Array?function(tr){for(var nr=tr.length,hr=new Uint8Array(2*nr),sr=new DataView(hr.buffer,hr.byteOffset,hr.byteLength),xr=0;xr<nr;xr++)sr.setUint16(2*xr,tr[xr],!1);return hr}(or):or,needSMask:!1}}(Me);var We,Xe,He,qe=Oe,Ge=qe.colorSpace,Ye=qe.colorsPerPixel,Ve=qe.sMaskBitsPerComponent,Ke=qe.colorBytes,Qe=qe.alphaBytes,Ze=qe.needSMask,Je=qe.palette,ir=qe.mask,rr=null;return je!==E.API.image_compression.NONE&&typeof zlibSync=="function"?(rr=function(ar){var or;switch(ar){case E.API.image_compression.FAST:or=11;break;case E.API.image_compression.MEDIUM:or=13;break;case E.API.image_compression.SLOW:or=14;break;default:or=12}return or}(je),We=this.decode.FLATE_DECODE,Xe="/Predictor ".concat(rr," /Colors ").concat(Ye," /BitsPerComponent ").concat(ze," /Columns ").concat(De),Ee=Yt(Ke,Math.ceil(De*Ye*ze/8),Ye,ze,je),Ze&&(He=Yt(Qe,Math.ceil(De*Ve/8),1,Ve,je))):(We=void 0,Xe=void 0,Ee=Ke,Ze&&(He=Qe)),(this.__addimage__.isArrayBuffer(Ee)||this.__addimage__.isArrayBufferView(Ee))&&(Ee=this.__addimage__.arrayBufferToBinaryString(Ee)),(He&&this.__addimage__.isArrayBuffer(He)||this.__addimage__.isArrayBufferView(He))&&(He=this.__addimage__.arrayBufferToBinaryString(He)),{alias:Te,data:Ee,index:Re,filter:We,decodeParameters:Xe,transparency:ir,palette:Je,sMask:He,predictor:rr,width:De,height:$e,bitsPerComponent:ze,sMaskBitsPerComponent:Ve,colorSpace:Ge}}},function(Ee){Ee.processGIF89A=function(Re,Te,je,Oe){var Me=new ie(Re),De=Me.width,$e=Me.height,Be=[];Me.decodeAndBlitFrameRGBA(0,Be);var Ue={data:Be,width:De,height:$e},ze=new oe(100).encode(Ue,100);return Ee.processJPEG.call(this,ze,Te,je,Oe)},Ee.processGIF87A=Ee.processGIF89A}(E.API),se.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var Ee=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(Ee);for(var Re=0;Re<Ee;Re++){var Te=this.datav.getUint8(this.pos++,!0),je=this.datav.getUint8(this.pos++,!0),Oe=this.datav.getUint8(this.pos++,!0),Me=this.datav.getUint8(this.pos++,!0);this.palette[Re]={red:Oe,green:je,blue:Te,quad:Me}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},se.prototype.parseBGR=function(){this.pos=this.offset;var Ee="bit"+this.bitPP,Re=this.width*this.height*4;if(Re>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(Re);try{this[Ee]()}catch(Te){o.log("bit decode error:"+Te)}},se.prototype.bit1=function(){var Ee,Re=Math.ceil(this.width/8),Te=Re%4;for(Ee=this.height-1;Ee>=0;Ee--){for(var je=this.bottom_up?Ee:this.height-1-Ee,Oe=0;Oe<Re;Oe++)for(var Me=this.datav.getUint8(this.pos++,!0),De=je*this.width*4+8*Oe*4,$e=0;$e<8&&8*Oe+$e<this.width;$e++){var Be=this.palette[Me>>7-$e&1];this.data[De+4*$e]=Be.blue,this.data[De+4*$e+1]=Be.green,this.data[De+4*$e+2]=Be.red,this.data[De+4*$e+3]=255}Te!==0&&(this.pos+=4-Te)}},se.prototype.bit4=function(){for(var Ee=Math.ceil(this.width/2),Re=Ee%4,Te=this.height-1;Te>=0;Te--){for(var je=this.bottom_up?Te:this.height-1-Te,Oe=0;Oe<Ee;Oe++){var Me=this.datav.getUint8(this.pos++,!0),De=je*this.width*4+2*Oe*4,$e=Me>>4,Be=15&Me,Ue=this.palette[$e];if(this.data[De]=Ue.blue,this.data[De+1]=Ue.green,this.data[De+2]=Ue.red,this.data[De+3]=255,2*Oe+1>=this.width)break;Ue=this.palette[Be],this.data[De+4]=Ue.blue,this.data[De+4+1]=Ue.green,this.data[De+4+2]=Ue.red,this.data[De+4+3]=255}Re!==0&&(this.pos+=4-Re)}},se.prototype.bit8=function(){for(var Ee=this.width%4,Re=this.height-1;Re>=0;Re--){for(var Te=this.bottom_up?Re:this.height-1-Re,je=0;je<this.width;je++){var Oe=this.datav.getUint8(this.pos++,!0),Me=Te*this.width*4+4*je;if(Oe<this.palette.length){var De=this.palette[Oe];this.data[Me]=De.red,this.data[Me+1]=De.green,this.data[Me+2]=De.blue,this.data[Me+3]=255}else this.data[Me]=255,this.data[Me+1]=255,this.data[Me+2]=255,this.data[Me+3]=255}Ee!==0&&(this.pos+=4-Ee)}},se.prototype.bit15=function(){for(var Ee=this.width%3,Re=parseInt("11111",2),Te=this.height-1;Te>=0;Te--){for(var je=this.bottom_up?Te:this.height-1-Te,Oe=0;Oe<this.width;Oe++){var Me=this.datav.getUint16(this.pos,!0);this.pos+=2;var De=(Me&Re)/Re*255|0,$e=(Me>>5&Re)/Re*255|0,Be=(Me>>10&Re)/Re*255|0,Ue=Me>>15?255:0,ze=je*this.width*4+4*Oe;this.data[ze]=Be,this.data[ze+1]=$e,this.data[ze+2]=De,this.data[ze+3]=Ue}this.pos+=Ee}},se.prototype.bit16=function(){for(var Ee=this.width%3,Re=parseInt("11111",2),Te=parseInt("111111",2),je=this.height-1;je>=0;je--){for(var Oe=this.bottom_up?je:this.height-1-je,Me=0;Me<this.width;Me++){var De=this.datav.getUint16(this.pos,!0);this.pos+=2;var $e=(De&Re)/Re*255|0,Be=(De>>5&Te)/Te*255|0,Ue=(De>>11)/Re*255|0,ze=Oe*this.width*4+4*Me;this.data[ze]=Ue,this.data[ze+1]=Be,this.data[ze+2]=$e,this.data[ze+3]=255}this.pos+=Ee}},se.prototype.bit24=function(){for(var Ee=this.height-1;Ee>=0;Ee--){for(var Re=this.bottom_up?Ee:this.height-1-Ee,Te=0;Te<this.width;Te++){var je=this.datav.getUint8(this.pos++,!0),Oe=this.datav.getUint8(this.pos++,!0),Me=this.datav.getUint8(this.pos++,!0),De=Re*this.width*4+4*Te;this.data[De]=Me,this.data[De+1]=Oe,this.data[De+2]=je,this.data[De+3]=255}this.pos+=this.width%4}},se.prototype.bit32=function(){for(var Ee=this.height-1;Ee>=0;Ee--)for(var Re=this.bottom_up?Ee:this.height-1-Ee,Te=0;Te<this.width;Te++){var je=this.datav.getUint8(this.pos++,!0),Oe=this.datav.getUint8(this.pos++,!0),Me=this.datav.getUint8(this.pos++,!0),De=this.datav.getUint8(this.pos++,!0),$e=Re*this.width*4+4*Te;this.data[$e]=Me,this.data[$e+1]=Oe,this.data[$e+2]=je,this.data[$e+3]=De}},se.prototype.getData=function(){return this.data},function(Ee){Ee.processBMP=function(Re,Te,je,Oe){var Me=new se(Re,!1),De=Me.width,$e=Me.height,Be={data:Me.getData(),width:De,height:$e},Ue=new oe(100).encode(Be,100);return Ee.processJPEG.call(this,Ue,Te,je,Oe)}}(E.API),ue.prototype.getData=function(){return this.data},function(Ee){Ee.processWEBP=function(Re,Te,je,Oe){var Me=new ue(Re),De=Me.width,$e=Me.height,Be={data:Me.getData(),width:De,height:$e},Ue=new oe(100).encode(Be,100);return Ee.processJPEG.call(this,Ue,Te,je,Oe)}}(E.API),E.API.processRGBA=function(Ee,Re,Te){for(var je=Ee.data,Oe=je.length,Me=new Uint8Array(Oe/4*3),De=new Uint8Array(Oe/4),$e=0,Be=0,Ue=0;Ue<Oe;Ue+=4){var ze=je[Ue],We=je[Ue+1],Xe=je[Ue+2],He=je[Ue+3];Me[$e++]=ze,Me[$e++]=We,Me[$e++]=Xe,De[Be++]=He}var qe=this.__addimage__.arrayBufferToBinaryString(Me);return{alpha:this.__addimage__.arrayBufferToBinaryString(De),data:qe,index:Re,alias:Te,colorSpace:"DeviceRGB",bitsPerComponent:8,width:Ee.width,height:Ee.height}},E.API.setLanguage=function(Ee){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Sp
4184ain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[Ee]!==void 0&&(this.internal.languageSettings.languageCode=Ee,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},zt=E.API,Ut=zt.getCharWidthsArray=function(Ee,Re){var Te,je,Oe=(Re=Re||{}).font||this.internal.getFont(),Me=Re.fontSize||this.internal.getFontSize(),De=Re.charSpace||this.internal.getCharSpace(),$e=Re.widths?Re.widths:Oe.metadata.Unicode.widths,Be=$e.fof?$e.fof:1,Ue=Re.kerning?Re.kerning:Oe.metadata.Unicode.kerning,ze=Ue.fof?Ue.fof:1,We=Re.doKerning!==!1,Xe=0,He=Ee.length,qe=0,Ge=$e[0]||Be,Ye=[];for(Te=0;Te<He;Te++)je=Ee.charCodeAt(Te),typeof Oe.metadata.widthOfString=="function"?Ye.push((Oe.metadata.widthOfGlyph(Oe.metadata.characterToGlyph(je))+De*(1e3/Me)||0)/1e3):(Xe=We&&_typeof(Ue[je])==="object"&&!isNaN(parseInt(Ue[je][qe],10))?Ue[je][qe]/ze:0,Ye.push(($e[je]||Ge)/Be+Xe)),qe=je;return Ye},Ht=zt.getStringUnitWidth=function(Ee,Re){var Te=(Re=Re||{}).fontSize||this.internal.getFontSize(),je=Re.font||this.internal.getFont(),Oe=Re.charSpace||this.internal.getCharSpace();return zt.processArabic&&(Ee=zt.processArabic(Ee)),typeof je.metadata.widthOfString=="function"?je.metadata.widthOfString(Ee,Te,Oe)/Te:Ut.apply(this,arguments).reduce(function(Me,De){return Me+De},0)},Wt=function(Ee,Re,Te,je){for(var Oe=[],Me=0,De=Ee.length,$e=0;Me!==De&&$e+Re[Me]<Te;)$e+=Re[Me],Me++;Oe.push(Ee.slice(0,Me));var Be=Me;for($e=0;Me!==De;)$e+Re[Me]>je&&(Oe.push(Ee.slice(Be,Me)),$e=0,Be=Me),$e+=Re[Me],Me++;return Be!==Me&&Oe.push(Ee.slice(Be,Me)),Oe},Vt=function(Ee,Re,Te){Te||(Te={});var je,Oe,Me,De,$e,Be,Ue,ze=[],We=[ze],Xe=Te.textIndent||0,He=0,qe=0,Ge=Ee.split(" "),Ye=Ut.apply(this,[" ",Te])[0];if(Be=Te.lineIndent===-1?Ge[0].length+2:Te.lineIndent||0){var Ve=Array(Be).join(" "),Ke=[];Ge.map(function(Ze){(Ze=Ze.split(/\s*\n/)).length>1?Ke=Ke.concat(Ze.map(function(Je,ir){return(ir&&Je.length?` 4185`:"")+Je})):Ke.push(Ze[0])}),Ge=Ke,Be=Ht.apply(this,[Ve,Te])}for(Me=0,De=Ge.length;Me<De;Me++){var Qe=0;if(je=Ge[Me],Be&&je[0]==` 4186`&&(je=je.substr(1),Qe=1),Xe+He+(qe=(Oe=Ut.apply(this,[je,Te])).reduce(function(Ze,Je){return Ze+Je},0))>Re||Qe){if(qe>Re){for($e=Wt.apply(this,[je,Oe,Re-(Xe+He),Re]),ze.push($e.shift()),ze=[$e.pop()];$e.length;)We.push([$e.shift()]);qe=Oe.slice(je.length-(ze[0]?ze[0].length:0)).reduce(function(Ze,Je){return Ze+Je},0)}else ze=[je];We.push(ze),Xe=qe+Be,He=Ye}else ze.push(je),Xe+=He+qe,He=Ye}return Ue=Be?function(Ze,Je){return(Je?Ve:"")+Ze.join(" ")}:function(Ze){return Ze.join(" ")},We.map(Ue)},zt.splitTextToSize=function(Ee,Re,Te){var je,Oe=(Te=Te||{}).fontSize||this.internal.getFontSize(),Me=(function(ze){if(ze.widths&&ze.kerning)return{widths:ze.widths,kerning:ze.kerning};var We=this.internal.getFont(ze.fontName,ze.fontStyle),Xe="Unicode";return We.metadata[Xe]?{widths:We.metadata[Xe].widths||{0:1},kerning:We.metadata[Xe].kerning||{}}:{font:We.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,Te);je=Array.isArray(Ee)?Ee:String(Ee).split(/\r?\n/);var De=1*this.internal.scaleFactor*Re/Oe;Me.textIndent=Te.textIndent?1*Te.textIndent*this.internal.scaleFactor/Oe:0,Me.lineIndent=Te.lineIndent;var $e,Be,Ue=[];for($e=0,Be=je.length;$e<Be;$e++)Ue=Ue.concat(Vt.apply(this,[je[$e],De,Me]));return Ue},function(Ee){Ee.__fontmetrics__=Ee.__fontmetrics__||{};for(var Re="0123456789abcdef",Te="klmnopqrstuvwxyz",je={},Oe={},Me=0;Me<16;Me++)je[Te[Me]]=Re[Me],Oe[Re[Me]]=Te[Me];var De=function(Xe){return"0x"+parseInt(Xe,10).toString(16)},$e=Ee.__fontmetrics__.compress=function(Xe){var He,qe,Ge,Ye,Ve=["{"];for(var Ke in Xe){if(He=Xe[Ke],isNaN(parseInt(Ke,10))?qe="'"+Ke+"'":(Ke=parseInt(Ke,10),qe=(qe=De(Ke).slice(2)).slice(0,-1)+Oe[qe.slice(-1)]),typeof He=="number")He<0?(Ge=De(He).slice(3),Ye="-"):(Ge=De(He).slice(2),Ye=""),Ge=Ye+Ge.slice(0,-1)+Oe[Ge.slice(-1)];
vendor: 3,775 bytes, line 4186
4186else{if(_typeof(He)!=="object")throw new Error("Don't know what to do with value type "+_typeof(He)+".");Ge=$e(He)}Ve.push(qe+Ge)}return Ve.push("}"),Ve.join("")},Be=Ee.__fontmetrics__.uncompress=function(Xe){if(typeof Xe!="string")throw new Error("Invalid argument passed to uncompress.");for(var He,qe,Ge,Ye,Ve={},Ke=1,Qe=Ve,Ze=[],Je="",ir="",rr=Xe.length-1,ar=1;ar<rr;ar+=1)(Ye=Xe[ar])=="'"?He?(Ge=He.join(""),He=void 0):He=[]:He?He.push(Ye):Ye=="{"?(Ze.push([Qe,Ge]),Qe={},Ge=void 0):Ye=="}"?((qe=Ze.pop())[0][qe[1]]=Qe,Ge=void 0,Qe=qe[0]):Ye=="-"?Ke=-1:Ge===void 0?je.hasOwnProperty(Ye)?(Je+=je[Ye],Ge=parseInt(Je,16)*Ke,Ke=1,Je=""):Je+=Ye:je.hasOwnProperty(Ye)?(ir+=je[Ye],Qe[Ge]=parseInt(ir,16)*Ke,Ke=1,Ge=void 0,ir=""):ir+=Ye;return Ve},Ue={codePages:["WinAnsiEncoding"],WinAnsiEncoding:Be("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},ze={Unicode:{Courier:Ue,"Courier-Bold":Ue,"Courier-BoldOblique":Ue,"Courier-Oblique":Ue,Helvetica:Ue,"Helvetica-Bold":Ue,"Helvetica-BoldOblique":Ue,"Helvetica-Oblique":Ue,"Times-Roman":Ue,"Times-Bold":Ue,"Times-BoldItalic":Ue,"Times-Italic":Ue}},We={Unicode:{"Courier-Oblique":Be("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":Be("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":Be("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
4186dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:Be("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":Be("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":Be("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:Be("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:Be("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4y
4186dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":Be("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4y
4186dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:Be("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":Be("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":Be("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}
4186fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":Be("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":Be("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4y
4186dn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};Ee.events.push(["addFont",function(Xe){var He=Xe.font,qe=We.Unicode[He.postScriptName];qe&&(He.metadata.Unicode={},He.metadata.Unicode.widths=qe.widths,He.metadata.Unicode.kerning=qe.kerning);var Ge=ze.Unicode[He.postScriptName];Ge&&(He.metadata.Unicode.encoding=Ge,He.encoding=Ge.codePages[0])}])}(E.API),function(Ee){var Re=function(Te){for(var je=Te.length,Oe=new Uint8Array(je),Me=0;Me<je;Me++)Oe[Me]=Te.charCodeAt(Me);return Oe};Ee.API.events.push(["addFont",function(Te){var je=void 0,Oe=Te.font,Me=Te.instance;if(!Oe.isStandardFont){if(Me===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+Oe.postScriptName+"').");if(typeof(je=Me.existsFileInVFS(Oe.postScriptName)===!1?Me.loadFile(Oe.postScriptName):Me.getFileFromVFS(Oe.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+Oe.postScriptName+"').");(function(De,$e){$e=/^\x00\x01\x00\x00/.test($e)?Re($e):Re(f($e)),De.metadata=Ee.API.TTFFont.open($e),De.metadata.Unicode=De.metadata.Unicode||{encoding:{},kerning:{},widths:[]},De.metadata.glyIdsUsed=[0]})(Oe,je)}}])}(E),E.API.addSvgAsImage=function(Ee,Re,Te,je,Oe,Me,De,$e){if(isNaN(Re)||isNaN(Te))throw o.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(je)||isNaN(Oe))throw o.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var Be=document.createElement("canvas");Be.width=je,Be.height=Oe;var Ue=Be.getContext("2d");Ue.fillStyle="#fff",Ue.fillRect(0,0,Be.width,Be.height);var ze={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},We=this;return(i.canvg?Promise.resolve(i.canvg):__vitePreload(()=>import("./index.es-Cuc-5p49.js"),__vite__mapDeps([0,1,2]))).catch(function(Xe){return Promise.reject(new Error("Could not load canvg: "+Xe))}).then(function(Xe){return Xe.default?Xe.default:Xe}).then(function(Xe){return Xe.fromString(Ue,Ee,ze)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(Xe){return Xe.render(ze)}).then(function(){We.addImage(Be.toDataURL("image/jpeg",1),Re,Te,je,Oe,De,$e)})},E.API.putTotalPages=function(Ee){var Re,Te=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(Re=new RegExp(Ee,"g"),Te=this.internal.getNumberOfPages()):(Re=new RegExp(this.pdfEscape16(Ee,this.internal.getFont()),"g"),Te=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var je=1;je<=this.internal.getNumberOfPages();je++)for(var Oe=0;Oe<this.internal.pages[je].length;Oe++)this.internal.pages[je][Oe]=this.internal.pages[je][Oe].replace(Re,Te);return this},E.API.viewerPreferences=function(Ee,Re){var Te;Ee=Ee||{},Re=Re||!1;var je,Oe,Me,De={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},$e=Object.keys(De),Be=[],Ue=0,ze=0,We=0;function Xe(qe,Ge){var Ye,Ve=!1;for(Ye=0;Ye<qe.length;Ye+=1)qe[Ye]===Ge&&(Ve=!0);return Ve}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(De)),this.internal.viewerpreferences.isSubscribed=!1),Te=this.internal.viewerpreferences.configuration,Ee==="reset"||Re===!0){var He=$e.length;for(We=0;We<He;We+=1)Te[$e[We]].value=Te[$e[We]].defaultValue,Te[$e[We]].explicitSet=!1}if(_typeof(Ee)==="object"){for(Oe in Ee)if(Me=Ee[Oe],Xe($e,Oe)&&Me!==void 0){if(Te[Oe].type==="boolean"&&typeof Me=="boolean")Te[Oe].value=Me;else if(Te[Oe].type==="name"&&Xe(Te[Oe].valueSet,Me))Te[Oe].value=Me;else if(Te[Oe].type==="integer"&&Number.isInteger(Me))Te[Oe].value=Me;else if(Te[Oe].type==="array"){for(Ue=0;Ue<Me.length;Ue+=1)if(je=!0,Me[Ue].length===1&&typeof Me[Ue][0]=="number")Be.pu
vendor: 44,669 bytes, lines 4186-4215
4186sh(String(Me[Ue]-1));else if(Me[Ue].length>1){for(ze=0;ze<Me[Ue].length;ze+=1)typeof Me[Ue][ze]!="number"&&(je=!1);je===!0&&Be.push([Me[Ue][0]-1,Me[Ue][1]-1].join(" "))}Te[Oe].value="["+Be.join(" ")+"]"}else Te[Oe].value=Te[Oe].defaultValue;Te[Oe].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var qe,Ge=[];for(qe in Te)Te[qe].explicitSet===!0&&(Te[qe].type==="name"?Ge.push("/"+qe+" /"+Te[qe].value):Ge.push("/"+qe+" "+Te[qe].value));Ge.length!==0&&this.internal.write(`/ViewerPreferences 4187<< 4188`+Ge.join(` 4189`)+` 4190>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=Te,this},E.API.addMetadata=function(Ee,Re){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:Ee,namespaceUri:Re??"http://jspdf.default.namespaceuri/",rawXml:typeof Re=="boolean"&&Re},this.internal.events.subscribe("putCatalog",le),this.internal.events.subscribe("postPutResources",ce)),this},function(Ee){var Re=Ee.API,Te=Re.pdfEscape16=function(Me,De){for(var $e,Be=De.metadata.Unicode.widths,Ue=["","0","00","000","0000"],ze=[""],We=0,Xe=Me.length;We<Xe;++We){if($e=De.metadata.characterToGlyph(Me.charCodeAt(We)),De.metadata.glyIdsUsed.push($e),De.metadata.toUnicode[$e]=Me.charCodeAt(We),Be.indexOf($e)==-1&&(Be.push($e),Be.push([parseInt(De.metadata.widthOfGlyph($e),10)])),$e=="0")return ze.join("");$e=$e.toString(16),ze.push(Ue[4-$e.length],$e)}return ze.join("")},je=function(Me){var De,$e,Be,Ue,ze,We,Xe;for(ze=`/CIDInit /ProcSet findresource begin 419112 dict begin 4192begincmap 4193/CIDSystemInfo << 4194 /Registry (Adobe) 4195 /Ordering (UCS) 4196 /Supplement 0 4197>> def 4198/CMapName /Adobe-Identity-UCS def 4199/CMapType 2 def 42001 begincodespacerange 4201<0000><ffff> 4202endcodespacerange`,Be=[],We=0,Xe=($e=Object.keys(Me).sort(function(He,qe){return He-qe})).length;We<Xe;We++)De=$e[We],Be.length>=100&&(ze+=` 4203`+Be.length+` beginbfchar 4204`+Be.join(` 4205`)+` 4206endbfchar`,Be=[]),Me[De]!==void 0&&Me[De]!==null&&typeof Me[De].toString=="function"&&(Ue=("0000"+Me[De].toString(16)).slice(-4),De=("0000"+(+De).toString(16)).slice(-4),Be.push("<"+De+"><"+Ue+">"));return Be.length&&(ze+=` 4207`+Be.length+` beginbfchar 4208`+Be.join(` 4209`)+` 4210endbfchar 4211`),ze+`endcmap 4212CMapName currentdict /CMap defineresource pop 4213end 4214end`};Re.events.push(["putFont",function(Me){(function(De){var $e=De.font,Be=De.out,Ue=De.newObject,ze=De.putStream;if($e.metadata instanceof Ee.API.TTFFont&&$e.encoding==="Identity-H"){for(var We=$e.metadata.Unicode.widths,Xe=$e.metadata.subset.encode($e.metadata.glyIdsUsed,1),He="",qe=0;qe<Xe.length;qe++)He+=String.fromCharCode(Xe[qe]);var Ge=Ue();ze({data:He,addLength1:!0,objectId:Ge}),Be("endobj");var Ye=Ue();ze({data:je($e.metadata.toUnicode),addLength1:!0,objectId:Ye}),Be("endobj");var Ve=Ue();Be("<<"),Be("/Type /FontDescriptor"),Be("/FontName /"+C($e.fontName)),Be("/FontFile2 "+Ge+" 0 R"),Be("/FontBBox "+Ee.API.PDFObject.convert($e.metadata.bbox)),Be("/Flags "+$e.metadata.flags),Be("/StemV "+$e.metadata.stemV),Be("/ItalicAngle "+$e.metadata.italicAngle),Be("/Ascent "+$e.metadata.ascender),Be("/Descent "+$e.metadata.decender),Be("/CapHeight "+$e.metadata.capHeight),Be(">>"),Be("endobj");var Ke=Ue();Be("<<"),Be("/Type /Font"),Be("/BaseFont /"+C($e.fontName)),Be("/FontDescriptor "+Ve+" 0 R"),Be("/W "+Ee.API.PDFObject.convert(We)),Be("/CIDToGIDMap /Identity"),Be("/DW 1000"),Be("/Subtype /CIDFontType2"),Be("/CIDSystemInfo"),Be("<<"),Be("/Supplement 0"),Be("/Registry (Adobe)"),Be("/Ordering ("+$e.encoding+")"),Be(">>"),Be(">>"),Be("endobj"),$e.objectNumber=Ue(),Be("<<"),Be("/Type /Font"),Be("/Subtype /Type0"),Be("/ToUnicode "+Ye+" 0 R"),Be("/BaseFont /"+C($e.fontName)),Be("/Encoding /"+$e.encoding),Be("/DescendantFonts ["+Ke+" 0 R]"),Be(">>"),Be("endobj"),$e.isAlreadyPutted=!0}})(Me)}]),Re.events.push(["putFont",function(Me){(function(De){var $e=De.font,Be=De.out,Ue=De.newObject,ze=De.putStream;if($e.metadata instanceof Ee.API.TTFFont&&$e.encoding==="WinAnsiEncoding"){for(var We=$e.metadata.rawData,Xe="",He=0;He<We.length;He++)Xe+=String.fromCharCode(We[He]);var qe=Ue();ze({data:Xe,addLength1:!0,objectId:qe}),Be("endobj");var Ge=Ue();ze({data:je($e.metadata.toUnicode),addLength1:!0,objectId:Ge}),Be("endobj");var Ye=Ue();Be("<<"),Be("/Descent "+$e.metadata.decender),Be("/CapHeight "+$e.metadata.capHeight),Be("/StemV "+$e.metadata.stemV),Be("/Type /FontDescriptor"),Be("/FontFile2 "+qe+" 0 R"),Be("/Flags 96"),Be("/FontBBox "+Ee.API.PDFObject.convert($e.metadata.bbox)),Be("/FontName /"+C($e.fontName)),Be("/ItalicAngle "+$e.metadata.italicAngle),Be("/Ascent "+$e.metadata.ascender),Be(">>"),Be("endobj"),$e.objectNumber=Ue();for(var Ve=0;Ve<$e.metadata.hmtx.widths.length;Ve++)$e.metadata.hmtx.widths[Ve]=parseInt($e.metadata.hmtx.widths[Ve]*(1e3/$e.metadata.head.unitsPerEm));Be("<</Subtype/TrueType/Type/Font/ToUnicode "+Ge+" 0 R/BaseFont/"+C($e.fontName)+"/FontDescriptor "+Ye+" 0 R/Encoding/"+$e.encoding+" /FirstChar 29 /LastChar 255 /Widths "+Ee.API.PDFObject.convert($e.metadata.hmtx.widths)+">>"),Be("endobj"),$e.isAlreadyPutted=!0}})(Me)}]);var Oe=function(Me){var De,$e=Me.text||"",Be=Me.x,Ue=Me.y,ze=Me.options||{},We=Me.mutex||{},Xe=We.pdfEscape,He=We.activeFontKey,qe=We.fonts,Ge=He,Ye="",Ve=0,Ke="",Qe=qe[Ge].encoding;if(qe[Ge].encoding!=="Identity-H")return{text:$e,x:Be,y:Ue,options:ze,mutex:We};for(Ke=$e,Ge=He,Array.isArray($e)&&(Ke=$e[0]),Ve=0;Ve<Ke.length;Ve+=1)qe[Ge].metadata.hasOwnProperty("cmap")&&(De=qe[Ge].metadata.cmap.unicode.codeMap[Ke[Ve].charCodeAt(0)]),De||Ke[Ve].charCodeAt(0)<256&&qe[Ge].metadata.hasOwnProperty("Unicode")?Ye+=Ke[Ve]:Ye+="";var Ze="";return parseInt(Ge.slice(1))<14||Qe==="WinAnsiEncoding"?Ze=Xe(Ye,Ge).split("").map(function(Je){return Je.charCodeAt(0).toString(16)}).join(""):Qe==="Identity-H"&&(Ze=Te(Ye,qe[Ge])),We.isHex=!0,{text:Ze,x:Be,y:Ue,options:ze,mutex:We}};Re.events.push(["postProcessText",function(Me){var De=Me.text||"",$e=[],Be={text:De,x:Me.x,y:Me.y,options:Me.options,mutex:Me.mutex};if(Array.isArray(De)){var Ue=0;for(Ue=0;Ue<De.length;Ue+=1)Array.isArray(De[Ue])&&De[Ue].length===3?$e.push([Oe(Object.assign({},Be,{text:De[Ue][0]})).text,De[Ue][1],De[Ue][2]]):$e.push(Oe(Object.assign({},Be,{text:De[Ue]})).text);Me.text=$e}else Me.text=Oe(Object.assign({},Be,{text:De})).text}])}(E),function(Ee){var Re=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};Ee.existsFileInVFS=function(Te){return Re.call(this),this.internal.vFS[Te]!==void 0},Ee.addFileToVFS=function(Te,je){return Re.call(this),this.internal.vFS[Te]=je,this},Ee.getFileFromVFS=function(Te){return Re.call(this),this.internal.vFS[Te]!==void 0?this.internal.vFS[Te]:null}}(E.API),function(Ee){Ee.__bidiEngine__=Ee.prototype.__bidiEngine__=function(je){var Oe,Me,De,$e,Be,Ue,ze,We=Re,Xe=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],He=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],qe={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},Ge={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},Ye=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","â¹","âº","â¹","â ","â","â ","â½","â¾","â½","â","â","â","â¤","â¥","â¤","â©","âª","â©","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","﹤","ï¹¥","﹤"],Ve=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),Ke=!1,Qe=0;this.__bidiEngine__={};var Ze=function(tr){var nr=tr.charCodeAt(),hr=nr>>8,sr=Ge[hr];return sr!==void 0?We[256*sr+(255&nr)]:hr===252||hr===253?"AL":Ve.test(hr)?"L":hr===8?"R":"N"},Je=function(tr){for(var nr,hr=0;hr<tr.length;hr++){if((nr=Ze(tr.charAt(hr)))==="L")return!1;if(nr==="R")return!0}return!1},ir=function(tr,nr,hr,sr){var xr,Rr,br,wr,vr=nr[sr];switch(vr){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":Ke=!1;break;case"N":case"AN":break;case"EN":Ke&&(vr="AN");break;case"AL":Ke=!0,vr="R";break;case"WS":case"BN":vr="N";break;case"CS":sr<1||sr+1>=nr.length||(xr=hr[sr-1])!=="EN"&&xr!=="AN"||(Rr=nr[sr+1])!=="EN"&&Rr!=="AN"?vr="N":Ke&&(Rr="AN"),vr=Rr===xr?Rr:"N";break;case"ES":vr=(xr=sr>0?hr[sr-1]:"B")==="EN"&&sr+1<nr.length&&nr[sr+1]==="EN"?"EN":"N";break;case"ET":if(sr>0&&hr[sr-1]==="EN"){vr="EN";break}if(Ke){vr="N";break}for(br=sr+1,wr=nr.length;br<wr&&nr[br]==="ET";)br++;vr=br<wr&&nr[br]==="EN"?"EN":"N";break;case"NSM":if(De&&!$e){for(wr=nr.length,br=sr+1;br<wr&&nr[br]==="NSM";)br++;if(br<wr){var Dr=tr[sr],kr=Dr>=1425&&Dr<=2303||Dr===64286;if(xr=nr[br],kr&&(xr==="R"||xr==="AL")){vr="R";break}}}vr=sr<1||(xr=nr[sr-1])==="B"?"N":hr[sr-1];break;case"B":Ke=!1,Oe=!0,vr=Qe;break;case"S":Me=!0,vr="N"}return vr},rr=function(tr,nr,hr){var sr=tr.split("");return hr&&ar(sr,hr,{hiLevel:Qe}),sr.reverse(),nr&&nr.reverse(),sr.join("")},ar=function(tr,nr,hr){var sr,xr,Rr,br,wr,vr=-1,Dr=tr.length,kr=0,cr=[],dr=Qe?He:Xe,ur=[];for(Ke=!1,Oe=!1,Me=!1,xr=0;xr<Dr;xr++)ur[xr]=Ze(tr[xr]);for(Rr=0;Rr<Dr;Rr++){if(wr=kr,cr[Rr]=ir(tr,ur,cr,Rr),sr=240&(kr=dr[wr][qe[cr[Rr]]]),kr&=15,nr[Rr]=br=dr[kr][5],sr>0)if(sr===16){for(xr=vr;xr<Rr;xr++)nr[xr]=1;vr=-1}else vr=-1;if(dr[kr][6])vr===-1&&(vr=Rr);else if(vr>-1){for(xr=vr;xr<Rr;xr++)nr[xr]=br;vr=-1}ur[Rr]==="B"&&(nr[Rr]=0),hr.hiLevel|=br}Me&&function(gr,_r,Ir){for(var Ar=0;Ar<Ir;Ar++)if(gr[Ar]==="S"){_r[Ar]=Qe;for(var Tr=Ar-1;Tr>=0&&gr[Tr]==="WS";Tr--)_r[Tr]=Qe}}(ur,nr,Dr)},or=function(tr,nr,hr,sr,xr){if(!(xr.hiLevel<tr)){if(tr===1&&Qe===1&&!Oe)return nr.reverse(),void(hr&&hr.reverse());for(var Rr,br,wr,vr,Dr=nr.length,kr=0;kr<Dr;){if(sr[kr]>=tr){for(wr=kr+1;wr<Dr&&sr[wr]>=tr;)wr++;for(vr=kr,br=wr-1;vr<br;vr++,br--)Rr=nr[vr],nr[vr]=nr[br],nr[br]=Rr,hr&&(Rr=hr[vr],hr[vr]=hr[br],hr[br]=Rr);kr=wr}kr++}}},pr=function(tr,nr,hr){var sr=tr.split(""),xr={hiLevel:Qe};return hr||(hr=[]),ar(sr,hr,xr),function(Rr,br,wr){if(wr.hiLevel!==0&&ze)for(var vr,Dr=0;Dr<Rr.length;Dr++)br[Dr]===1&&(vr=Ye.indexOf(Rr[Dr]))>=0&&(Rr[Dr]=Ye[vr+1])}(sr,hr,xr),or(2,sr,nr,hr,xr),or(1,sr,nr,hr,xr),sr.join("")};return this.__bidiEngine__.doBidiReorder=function(tr,nr,hr){if(function(xr,Rr){if(Rr)for(var br=0;br<xr.length;br++)Rr[br]=br;$e===void 0&&($e=Je(xr)),Ue===void 0&&(Ue=Je(xr))}(tr,nr),De||!Be||Ue)if(De&&Be&&$e^Ue)Qe=$e?1:0,tr=rr(tr,nr,hr);else if(!De&&Be&&Ue)Qe=$e?1:0,tr=pr(tr,nr,hr),tr=rr(tr,nr);else if(!De||$e||Be||Ue){if(De&&!Be&&$e^Ue)tr=rr(tr,nr),$e?(Qe=0,tr=pr(tr,nr,hr)):(Qe=1,tr=pr(tr,nr,hr),tr=rr(tr,nr));else if(De&&$e&&!Be&&Ue)Qe=1,tr=pr(tr,nr,hr),tr=rr(tr,nr);else if(!De&&!Be&&$e^Ue){var sr=ze;$e?(Qe=1,tr=pr(tr,nr,hr),Qe=0,ze=!1,tr=pr(tr,nr,hr),ze=sr):(Qe=0,tr=pr(tr,nr,hr),tr=rr(tr,nr),Qe=1,ze=!1,tr=pr(tr,nr,hr),ze=sr,tr=rr(tr,nr))}}else Qe=0,tr=pr(tr,nr,hr);else Qe=$e?1:0,tr=pr(tr,nr,hr);return tr},this.__bidiEngine__.setOptions=function(tr){tr&&(De=tr.isInputVisual,Be=tr.isOutputVisual,$e=tr.isInputRtl,Ue=tr.isOutputRtl,ze=tr.isSymmetricSwapping)},this.__bidiEngine__.setOptions(je),this.__bidiEngine__};var Re=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],Te=new Ee.__bidiEngine__({isInputVisual:!0});Ee.API.events.push(["postProcessText",function(je){var Oe=je.text;je.x,je.y;var Me=je.options||{};je.mutex,Me.lang;var De=[];if(Me.isInputVisual=typeof Me.isInputVisual!="boolean"||Me.isInputVisual,Te.setOptions(Me),Object.prototype.toString.call(Oe)==="[object Array]"){var $e=0;for(De=[],$e=0;$e<Oe.length;$e+=1)Object.prototype.toString.call(Oe[$e])==="[object Array]"?De.push([Te.doBidiReorder(Oe[$e][0]),Oe[$e][1],Oe[$e][2]]):De.push([Te.doBidiReorder(Oe[$e])]);je.text=De}else je.text=Te.doBidiReorder(Oe);Te.setOptions({isInputVisual:!0})}])}(E),E.API.TTFFont=function(){function Ee(Re){var Te;if(this.rawData=Re,Te=this.contents=new fe(Re),this.contents.pos=4,Te.readString(4)==="ttcf")throw new Error("TTCF not supported.");Te.pos=0,this.parse(),this.subset=new Ce(this),this.registerTTF()}return Ee.open=function(Re){return new Ee(Re)},Ee.prototype.parse=function(){return this.directory=new de(this.contents),this.head=new me(this),this.name=new xe(this),this.cmap=new be(this),this.toUnicode={},this.hhea=new ye(this),this.maxp=new Ae(this),this.hmtx=new Se(this),this.post=new Ne(this),this.os2=new we(this),this.loca=new Ie(this),this.glyf=new Pe(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},Ee.prototype.registerTTF=function(){var Re,Te,je,Oe,Me;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var De,$e,Be,Ue;for(Ue=[],De=0,$e=(Be=this.bbox).length;De<$e;De++)Re=Be[De],Ue.push(Math.round(Re*this.scaleFactor));return Ue}).call(this),this.stemV=0,this.post.exists?(je=255&(Oe=this.post.italic_angle),32768&(Te=Oe>>16)&&(Te=-(1+(65535^Te))),this.italicAngle=+(Te+"."+je)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(Me=this.familyClass)===1||Me===2||Me===3||Me===4||Me===5||Me===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},Ee.prototype.characterToGlyph=function(Re){var Te;return((Te=this.cmap.unicode)!=null?Te.codeMap[Re]:void 0)||0},Ee.prototype.widthOfGlyph=function(Re){var Te;return Te=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(Re).advance*Te},Ee.prototype.widthOfString=function(Re,Te,je){var Oe,Me,De,$e;for(De=0,Me=0,$e=(Re=""+Re).length;0<=$e?Me<$e:Me>$e;Me=0<=$e?++Me:--Me)Oe=Re.charCodeAt(Me),De+=this.widthOfGlyph(this.characterToGlyph(Oe))+je*(1e3/Te)||0;return De*(Te/1e3)},Ee.prototype.lineHeight=function(Re,Te){var je;return Te==null&&(Te=!1),je=Te?this.lineGap:0,(this.ascender+je-this.decender)/1e3*Re},Ee}();var he,fe=function(){function Ee(Re){this.data=Re??[],this.pos=0,this.length=this.data.length}return Ee.prototype.readByte=function(){return this.data[this.pos++]},Ee.prototype.writeByte=function(Re){return this.data[this.pos++]=Re},Ee.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},Ee.prototype.writeUInt32=function(Re){return this.writeByte(Re>>>24&255),this.writeByte(Re>>16&255),this.writeByte(Re>>8&255),this.writeByte(255&Re)},Ee.prototype.readInt32=function(){var Re;return(Re=this.readUInt32())>=2147483648?Re-4294967296:Re},Ee.prototype.writeInt32=function(Re){return Re<0&&(Re+=4294967296),this.writeUInt32(Re)},Ee.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},Ee.prototype.writeUInt16=function(Re){return this.writeByte(Re>>8&255),this.writeByte(255&Re)},Ee.prototype.readInt16=function(){var Re;return(Re=this.readUInt16())>=32768?Re-65536:Re},Ee.prototype.writeInt16=function(Re){return Re<0&&(Re+=65536),this.writeUInt16(Re)},Ee.prototype.readString=function(Re){var Te,je;for(je=[],Te=0;0<=Re?Te<Re:Te>Re;Te=0<=Re?++Te:--Te)je[Te]=String.fromCharCode(this.readByte());return je.join("")},Ee.prototype.writeString=function(Re){var Te,je,Oe;for(Oe=[],Te=0,je=Re.length;0<=je?Te<je:Te>je;Te=0<=je?++Te:--Te)Oe.push(this.writeByte(Re.charCodeAt(Te)));return Oe},Ee.prototype.readShort=function(){return this.readInt16()},Ee.prototype.writeShort=function(Re){return this.writeInt16(Re)},Ee.prototype.readLongLong=function(){var Re,Te,je,Oe,Me,De,$e,Be;return Re=this.readByte(),Te=this.readByte(),je=this.readByte(),Oe=this.readByte(),Me=this.readByte(),De=this.readByte(),$e=this.readByte(),Be=this.readByte(),128&Re?-1*(72057594037927940*(255^Re)+281474976710656*(255^Te)+1099511627776*(255^je)+4294967296*(255^Oe)+16777216*(255^Me)+65536*(255^De)+256*(255^$e)+(255^Be)+1):72057594037927940*Re+281474976710656*Te+1099511627776*je+4294967296*Oe+16777216*Me+65536*De+256*$e+Be},Ee.prototype.writeLongLong=function(Re){var Te,je;return Te=Math.floor(Re/4294967296),je=4294967295&Re,this.writeByte(Te>>24&255),this.writeByte(Te>>16&255),this.writeByte(Te>>8&255),this.writeByte(255&Te),this.writeByte(je>>24&255),this.writeByte(je>>16&255),this.writeByte(je>>8&255),this.writeByte(255&je)},Ee.prototype.readInt=function(){return this.readInt32()},Ee.prototype.writeInt=function(Re){return this.writeInt32(Re)},Ee.prototype.read=function(Re){var Te,je;for(Te=[],je=0;0<=Re?je<Re:je>Re;je=0<=Re?++je:--je)Te.push(this.readByte());return Te},Ee.prototype.write=function(Re){var Te,je,Oe,Me;for(Me=[],je=0,Oe=Re.length;je<Oe;je++)Te=Re[je],Me.push(this.writeByte(Te));return Me},Ee}(),de=function(){var Ee;function Re(Te){var je,Oe,Me;for(this.scalarType=Te.readInt(),this.tableCount=Te.readShort(),this.searchRange=Te.readShort(),this.entrySelector=Te.readShort(),this.rangeShift=Te.readShort(),this.tables={},Oe=0,Me=this.tableCount;0<=Me?Oe<Me:Oe>Me;Oe=0<=Me?++Oe:--Oe)je={tag:Te.readString(4),checksum:Te.readInt(),offset:Te.readInt(),length:Te.readInt()},this.tables[je.tag]=je}return Re.prototype.encode=function(Te){var je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe,Ge;for(Ge in He=Object.keys(Te).length,Be=Math.log(2),We=16*Math.floor(Math.log(He)/Be),De=Math.floor(We/Be),ze=16*He-We,(Oe=new fe).writeInt(this.scalarType),Oe.writeShort(He),Oe.writeShort(We),Oe.writeShort(De),Oe.writeShort(ze),Me=16*He,Ue=Oe.pos+Me,$e=null,qe=[],Te)for(Xe=Te[Ge],Oe.writeString(Ge),Oe.writeInt(Ee(Xe)),Oe.writeInt(Ue),Oe.writeInt(Xe.length),qe=qe.concat(Xe),Ge==="head"&&($e=Ue),Ue+=Xe.length;Ue%4;)qe.push(0),Ue++;return Oe.write(qe),je=2981146554-Ee(Oe.data),Oe.pos=$e+8,Oe.writeUInt32(je),Oe.data},Ee=function(Te){var je,Oe,Me,De;for(Te=_e.call(Te);Te.length%4;)Te.push(0);for(Me=new fe(Te),Oe=0,je=0,De=Te.length;je<De;je=je+=4)Oe+=Me.readUInt32();return 4294967295&Oe},Re}(),pe={}.hasOwnProperty,ge=function(Ee,Re){for(var Te in Re)pe.call(Re,Te)&&(Ee[Te]=Re[Te]);function je(){this.constructor=Ee}return je.prototype=Re.prototype,Ee.prototype=new je,Ee.__super__=Re.prototype,Ee};he=function(){function Ee(Re){var Te;this.file=Re,Te=this.file.directory.tables[this.tag],this.exists=!!Te,Te&&(this.offset=Te.offset,this.length=Te.length,this.parse(this.file.contents))}return Ee.prototype.parse=function(){},Ee.prototype.encode=function(){},Ee.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},Ee}();var me=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="head",Ee.prototype.parse=function(Re){return Re.pos=this.offset,this.version=Re.readInt(),this.revision=Re.readInt(),this.checkSumAdjustment=Re.readInt(),this.magicNumber=Re.readInt(),this.flags=Re.readShort(),this.unitsPerEm=Re.readShort(),this.created=Re.readLongLong(),this.modified=Re.readLongLong(),this.xMin=Re.readShort(),this.yMin=Re.readShort(),this.xMax=Re.readShort(),this.yMax=Re.readShort(),this.macStyle=Re.readShort(),this.lowestRecPPEM=Re.readShort(),this.fontDirectionHint=Re.readShort(),this.indexToLocFormat=Re.readShort(),this.glyphDataFormat=Re.readShort()},Ee.prototype.encode=function(Re){var Te;return(Te=new fe).writeInt(this.version),Te.writeInt(this.revision),Te.writeInt(this.checkSumAdjustment),Te.writeInt(this.magicNumber),Te.writeShort(this.flags),Te.writeShort(this.unitsPerEm),Te.writeLongLong(this.created),Te.writeLongLong(this.modified),Te.writeShort(this.xMin),Te.writeShort(this.yMin),Te.writeShort(this.xMax),Te.writeShort(this.yMax),Te.writeShort(this.macStyle),Te.writeShort(this.lowestRecPPEM),Te.writeShort(this.fontDirectionHint),Te.writeShort(Re),Te.writeShort(this.glyphDataFormat),Te.data},Ee}(),ve=function(){function Ee(Re,Te){var je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe;switch(this.platformID=Re.readUInt16(),this.encodingID=Re.readShort(),this.offset=Te+Re.readInt(),We=Re.pos,Re.pos=this.offset,this.format=Re.readUInt16(),this.length=Re.readUInt16(),this.language=Re.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(Be=0;Be<256;++Be)this.codeMap[Be]=Re.readByte();break;case 4:for(He=Re.readUInt16(),Xe=He/2,Re.pos+=6,Me=function(){var Ze,Je;for(Je=[],Be=Ze=0;0<=Xe?Ze<Xe:Ze>Xe;Be=0<=Xe?++Ze:--Ze)Je.push(Re.readUInt16());return Je}(),Re.pos+=2,Ge=function(){var Ze,Je;for(Je=[],Be=Ze=0;0<=Xe?Ze<Xe:Ze>Xe;Be=0<=Xe?++Ze:--Ze)Je.push(Re.readUInt16());return Je}(),Ue=function(){var Ze,Je;for(Je=[],Be=Ze=0;0<=Xe?Ze<Xe:Ze>Xe;Be=0<=Xe?++Ze:--Ze)Je.push(Re.readUInt16());return Je}(),ze=function(){var Ze,Je;for(Je=[],Be=Ze=0;0<=Xe?Ze<Xe:Ze>Xe;Be=0<=Xe?++Ze:--Ze)Je.push(Re.readUInt16());return Je}(),Oe=(this.length-Re.pos+this.offset)/2,$e=function(){var Ze,Je;for(Je=[],Be=Ze=0;0<=Oe?Ze<Oe:Ze>Oe;Be=0<=Oe?++Ze:--Ze)Je.push(Re.readUInt16());return Je}(),Be=Ve=0,Qe=Me.length;Ve<Qe;Be=++Ve)for(Ye=Me[Be],je=Ke=qe=Ge[Be];qe<=Ye?Ke<=Ye:Ke>=Ye;je=qe<=Ye?++Ke:--Ke)ze[Be]===0?De=je+Ue[Be]:(De=$e[ze[Be]/2+(je-qe)-(Xe-Be)]||0)!==0&&(De+=Ue[Be]),this.codeMap[je]=65535&De}Re.pos=We}return Ee.encode=function(Re,Te){var je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve,Ke,Qe,Ze,Je,ir,rr,ar,or,pr,tr,nr,hr,sr,xr,Rr,br,wr,vr,Dr,kr,cr,dr,ur,gr,_r,Ir,Ar,Tr,Nr,Br,Hr;switch(sr=new fe,De=Object.keys(Re).sort(function(Vr,mr){return Vr-mr}),Te){case"macroman":for(Ge=0,Ye=function(){var Vr=[];for(qe=0;qe<256;++qe)Vr.push(0);return Vr}(),Ke={0:0},Me={},xr=0,vr=De.length;xr<vr;xr++)Ke[Tr=Re[Oe=De[xr]]]==null&&(Ke[Tr]=++Ge),Me[Oe]={old:Re[Oe],new:Ke[Re[Oe]]},Ye[Oe]=Ke[Re[Oe]];return sr.writeUInt16(1),sr.writeUInt16(0),sr.writeUInt32(12),sr.writeUInt16(0),sr.writeUInt16(262),sr.writeUInt16(0),sr.write(Ye),{charMap:Me,subtable:sr.data,maxGlyphID:Ge+1};case"unicode":for(nr=[],We=[],Qe=0,Ke={},je={},Ve=Ue=null,Rr=0,Dr=De.length;Rr<Dr;Rr++)Ke[Je=Re[Oe=De[Rr]]]==null&&(Ke[Je]=++Qe),je[Oe]={old:Je,new:Ke[Je]},$e=Ke[Je]-Oe,Ve!=null&&$e===Ue||(Ve&&We.push(Ve),nr.push(Oe),Ue=$e),Ve=Oe;for(Ve&&We.push(Ve),We.push(65535),nr.push(65535),pr=2*(or=nr.length),ar=2*Math.pow(Math.log(or)/Math.LN2,2),Xe=Math.log(ar/2)/Math.LN2,rr=2*or-ar,Be=[],ir=[],He=[],qe=br=0,kr=nr.length;br<kr;qe=++br){if(tr=nr[qe],ze=We[qe],tr===65535){Be.push(0),ir.push(0);break}if(tr-(hr=je[tr].new)>=32768)for(Be.push(0),ir.push(2*(He.length+or-qe)),Oe=wr=tr;tr<=ze?wr<=ze:wr>=ze;Oe=tr<=ze?++wr:--wr)He.push(je[Oe].new);else Be.push(hr-tr),ir.push(0)}for(sr.writeUInt16(3),sr.writeUInt16(1),sr.writeUInt32(12),sr.writeUInt16(4),sr.writeUInt16(16+8*or+2*He.length),sr.writeUInt16(0),sr.writeUInt16(pr),sr.writeUInt16(ar),sr.writeUInt16(Xe),sr.writeUInt16(rr),Ir=0,cr=We.length;Ir<cr;Ir++)Oe=We[Ir],sr.writeUInt16(Oe);for(sr.writeUInt16(0),Ar=0,dr=nr.length;Ar<dr;Ar++)Oe=nr[Ar],sr.writeUInt16(Oe);for(Nr=0,ur=Be.length;Nr<ur;Nr++)$e=Be[Nr],sr.writeUInt16($e);for(Br=0,gr=ir.length;Br<gr;Br++)Ze=ir[Br],sr.writeUInt16(Ze);for(Hr=0,_r=He.length;Hr<_r;Hr++)Ge=He[Hr],sr.writeUInt16(Ge);return{charMap:je,subtable:sr.data,maxGlyphID:Qe+1}}},Ee}(),be=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="cmap",Ee.prototype.parse=function(Re){var Te,je,Oe;for(Re.pos=this.offset,this.version=Re.readUInt16(),Oe=Re.readUInt16(),this.tables=[],this.unicode=null,je=0;0<=Oe?je<Oe:je>Oe;je=0<=Oe?++je:--je)Te=new ve(Re,this.offset),this.tables.push(Te),Te.isUnicode&&this.unicode==null&&(this.unicode=Te);return!0},Ee.encode=function(Re,Te){var je,Oe;return Te==null&&(Te="macroman"),je=ve.encode(Re,Te),(Oe=new fe).writeUInt16(0),Oe.writeUInt16(1),je.table=Oe.data.concat(je.subtable),je},Ee}(),ye=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="hhea",Ee.prototype.parse=function(Re){return Re.pos=this.offset,this.version=Re.readInt(),this.ascender=Re.readShort(),this.decender=Re.readShort(),this.lineGap=Re.readShort(),this.advanceWidthMax=Re.readShort(),this.minLeftSideBearing=Re.readShort(),this.minRightSideBearing=Re.readShort(),this.xMaxExtent=Re.readShort(),this.caretSlopeRise=Re.readShort(),this.caretSlopeRun=Re.readShort(),this.caretOffset=Re.readShort(),Re.pos+=8,this.metricDataFormat=Re.readShort(),this.numberOfMetrics=Re.readUInt16()},Ee}(),we=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="OS/2",Ee.prototype.parse=function(Re){if(Re.pos=this.offset,this.version=Re.readUInt16(),this.averageCharWidth=Re.readShort(),this.weightClass=Re.readUInt16(),this.widthClass=Re.readUInt16(),this.type=Re.readShort(),this.ySubscriptXSize=Re.readShort(),this.ySubscriptYSize=Re.readShort(),this.ySubscriptXOffset=Re.readShort(),this.ySubscriptYOffset=Re.readShort(),this.ySuperscriptXSize=Re.readShort(),this.ySuperscriptYSize=Re.readShort(),this.ySuperscriptXOffset=Re.readShort(),this.ySuperscriptYOffset=Re.readShort(),this.yStrikeoutSize=Re.readShort(),this.yStrikeoutPosition=Re.readShort(),this.familyClass=Re.readShort(),this.panose=function(){var Te,je;for(je=[],Te=0;Te<10;++Te)je.push(Re.readByte());return je}(),this.charRange=function(){var Te,je;for(je=[],Te=0;Te<4;++Te)je.push(Re.readInt());return je}(),this.vendorID=Re.readString(4),this.selection=Re.readShort(),this.firstCharIndex=Re.readShort(),this.lastCharIndex=Re.readShort(),this.version>0&&(this.ascent=Re.readShort(),this.descent=Re.readShort(),this.lineGap=Re.readShort(),this.winAscent=Re.readShort(),this.winDescent=Re.readShort(),this.codePageRange=function(){var Te,je;for(je=[],Te=0;Te<2;Te=++Te)je.push(Re.readInt());return je}(),this.version>1))return this.xHeight=Re.readShort(),this.capHeight=Re.readShort(),this.defaultChar=Re.readShort(),this.breakChar=Re.readShort(),this.maxContext=Re.readShort()},Ee}(),Ne=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="post",Ee.prototype.parse=function(Re){var Te,je,Oe;switch(Re.pos=this.offset,this.format=Re.readInt(),this.italicAngle=Re.readInt(),this.underlinePosition=Re.readShort(),this.underlineThickness=Re.readShort(),this.isFixedPitch=Re.readInt(),this.minMemType42=Re.readInt(),this.maxMemType42=Re.readInt(),this.minMemType1=Re.readInt(),this.maxMemType1=Re.readInt(),this.format){case 65536:case 196608:break;case 131072:var Me;for(je=Re.readUInt16(),this.glyphNameIndex=[],Me=0;0<=je?Me<je:Me>je;Me=0<=je?++Me:--Me)this.glyphNameIndex.push(Re.readUInt16());for(this.names=[],Oe=[];Re.pos<this.offset+this.length;)Te=Re.readByte(),Oe.push(this.names.push(Re.readString(Te)));return Oe;case 151552:return je=Re.readUInt16(),this.offsets=Re.read(je);case 262144:return this.map=(function(){var De,$e,Be;for(Be=[],Me=De=0,$e=this.file.maxp.numGlyphs;0<=$e?De<$e:De>$e;Me=0<=$e?++De:--De)Be.push(Re.readUInt32());return Be}).call(this)}},Ee}(),Le=function(Ee,Re){this.raw=Ee,this.length=Ee.length,this.platformID=Re.platformID,this.encodingID=Re.encodingID,this.languageID=Re.languageID},xe=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="name",Ee.prototype.parse=function(Re){var Te,je,Oe,Me,De,$e,Be,Ue,ze,We,Xe;for(Re.pos=this.offset,Re.readShort(),Te=Re.readShort(),$e=Re.readShort(),je=[],Me=0;0<=Te?Me<Te:Me>Te;Me=0<=Te?++Me:--Me)je.push({platformID:Re.readShort(),encodingID:Re.readShort(),languageID:Re.readShort(),nameID:Re.readShort(),length:Re.readShort(),offset:this.offset+$e+Re.readShort()});for(Be={},Me=ze=0,We=je.length;ze<We;Me=++ze)Oe=je[Me],Re.pos=Oe.offset,Ue=Re.readString(Oe.length),De=new Le(Ue,Oe),Be[Xe=Oe.nameID]==null&&(Be[Xe]=[]),Be[Oe.nameID].push(De);this.strings=Be,this.copyright=Be[0],this.fontFamily=Be[1],this.fontSubfamily=Be[2],this.uniqueSubfamily=Be[3],this.fontName=Be[4],this.version=Be[5];try{this.postscriptName=Be[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=Be[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=Be[7],this.manufacturer=Be[8],this.designer=Be[9],this.description=Be[10],this.vendorUrl=Be[11],this.designerUrl=Be[12],this.license=Be[13],this.licenseUrl=Be[14],this.preferredFamily=Be[15],this.preferredSubfamily=Be[17],this.compatibleFull=Be[18],this.sampleText=Be[19]},Ee}(),Ae=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="maxp",Ee.prototype.parse=function(Re){return Re.pos=this.offset,this.version=Re.readInt(),this.numGlyphs=Re.readUInt16(),this.maxPoints=Re.readUInt16(),this.maxContours=Re.readUInt16(),this.maxCompositePoints=Re.readUInt16(),this.maxComponentContours=Re.readUInt16(),this.maxZones=Re.readUInt16(),this.maxTwilightPoints=Re.readUInt16(),this.maxStorage=Re.readUInt16(),this.maxFunctionDefs=Re.readUInt16(),this.maxInstructionDefs=Re.readUInt16(),this.maxStackElements=Re.readUInt16(),this.maxSizeOfInstructions=Re.readUInt16(),this.maxComponentElements=Re.readUInt16(),this.maxComponentDepth=Re.readUInt16()},Ee}(),Se=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="hmtx",Ee.prototype.parse=function(Re){var Te,je,Oe,Me,De,$e,Be;for(Re.pos=this.offset,this.metrics=[],Te=0,$e=this.file.hhea.numberOfMetrics;0<=$e?Te<$e:Te>$e;Te=0<=$e?++Te:--Te)this.metrics.push({advance:Re.readUInt16(),lsb:Re.readInt16()});for(Oe=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var Ue,ze;for(ze=[],Te=Ue=0;0<=Oe?Ue<Oe:Ue>Oe;Te=0<=Oe?++Ue:--Ue)ze.push(Re.readInt16());return ze}(),this.widths=(function(){var Ue,ze,We,Xe;for(Xe=[],Ue=0,ze=(We=this.metrics).length;Ue<ze;Ue++)Me=We[Ue],Xe.push(Me.advance);return Xe}).call(this),je=this.widths[this.widths.length-1],Be=[],Te=De=0;0<=Oe?De<Oe:De>Oe;Te=0<=Oe?++De:--De)Be.push(this.widths.push(je));return Be},Ee.prototype.forGlyph=function(Re){return Re in this.metrics?this.metrics[Re]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[Re-this.metrics.length]}},Ee}(),_e=[].slice,Pe=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="glyf",Ee.prototype.parse=function(){return this.cache={}},Ee.prototype.glyphFor=function(Re){var Te,je,Oe,Me,De,$e,Be,Ue,ze,We;return Re in this.cache?this.cache[Re]:(Me=this.file.loca,Te=this.file.contents,je=Me.indexOf(Re),(Oe=Me.lengthOf(Re))===0?this.cache[Re]=null:(Te.pos=this.offset+je,De=($e=new fe(Te.read(Oe))).readShort(),Ue=$e.readShort(),We=$e.readShort(),Be=$e.readShort(),ze=$e.readShort(),this.cache[Re]=De===-1?new Fe($e,Ue,We,Be,ze):new ke($e,De,Ue,We,Be,ze),this.cache[Re]))},Ee.prototype.encode=function(Re,Te,je){var Oe,Me,De,$e,Be;for(De=[],Me=[],$e=0,Be=Te.length;$e<Be;$e++)Oe=Re[Te[$e]],Me.push(De.length),Oe&&(De=De.concat(Oe.encode(je)));return Me.push(De.length),{table:De,offsets:Me}},Ee}(),ke=function(){function Ee(Re,Te,je,Oe,Me,De){this.raw=Re,this.numberOfContours=Te,this.xMin=je,this.yMin=Oe,this.xMax=Me,this.yMax=De,this.compound=!1}return Ee.prototype.encode=function(){return this.raw.data},Ee}(),Fe=function(){function Ee(Re,Te,je,Oe,Me){var De,$e;for(this.raw=Re,this.xMin=Te,this.yMin=je,this.xMax=Oe,this.yMax=Me,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],De=this.raw;$e=De.readShort(),this.glyphOffsets.push(De.pos),this.glyphIDs.push(De.readUInt16()),32&$e;)De.pos+=1&$e?4:2,128&$e?De.pos+=8:64&$e?De.pos+=4:8&$e&&(De.pos+=2)}return Ee.prototype.encode=function(){var Re,Te,je;for(Te=new fe(_e.call(this.raw.data)),Re=0,je=this.glyphIDs.length;Re<je;++Re)Te.pos=this.glyphOffsets[Re];return Te.data},Ee}(),Ie=function(){function Ee(){return Ee.__super__.constructor.apply(this,arguments)}return ge(Ee,he),Ee.prototype.tag="loca",Ee.prototype.parse=function(Re){var Te,je;return Re.pos=this.offset,Te=this.file.head.indexToLocFormat,this.offsets=Te===0?(function(){var Oe,Me;for(Me=[],je=0,Oe=this.length;je<Oe;je+=2)Me.push(2*Re.readUInt16());return Me}).call(this):(function(){var Oe,Me;for(Me=[],je=0,Oe=this.length;je<Oe;je+=4)Me.push(Re.readUInt32());return Me}).call(this)},Ee.prototype.indexOf=function(Re){return this.offsets[Re]},Ee.prototype.lengthOf=function(Re){return this.offsets[Re+1]-this.offsets[Re]},Ee.prototype.encode=function(Re,Te){for(var je=new Uint32Array(this.offsets.length),Oe=0,Me=0,De=0;De<je.length;++De)if(je[De]=Oe,Me<Te.length&&Te[Me]==De){++Me,je[De]=Oe;var $e=this.offsets[De],Be=this.offsets[De+1]-$e;Be>0&&(Oe+=Be)}for(var Ue=new Array(4*je.length),ze=0;ze<je.length;++ze)Ue[4*ze+3]=255&je[ze],Ue[4*ze+2]=(65280&je[ze])>>8,Ue[4*ze+1]=(16711680&je[ze])>>16,Ue[4*ze]=(4278190080&je[ze])>>24;return Ue},Ee}(),Ce=function(){function Ee(Re){this.font=Re,this.subset={},this.unicodes={},this.next=33}return Ee.prototype.generateCmap=function(){var Re,Te,je,Oe,Me;for(Te in Oe=this.font.cmap.tables[0].codeMap,Re={},Me=this.subset)je=Me[Te],Re[Te]=Oe[je];return Re},Ee.prototype.glyphsFor=function(Re){var Te,je,Oe,Me,De,$e,Be;for(Oe={},De=0,$e=Re.length;De<$e;De++)Oe[Me=Re[De]]=this.font.glyf.glyphFor(Me);for(Me in Te=[],Oe)(je=Oe[Me])!=null&&je.compound&&Te.push.apply(Te,je.glyphIDs);if(Te.length>0)for(Me in Be=this.glyphsFor(Te))je=Be[Me],Oe[Me]=je;return Oe},Ee.prototype.encode=function(Re,Te){var je,Oe,Me,De,$e,Be,Ue,ze,We,Xe,He,qe,Ge,Ye,Ve;for(Oe in je=be.encode(this.generateCmap(),"unicode"),De=this.glyphsFor(Re),He={0:0},Ve=je.charMap)He[(Be=Ve[Oe]).old]=Be.new;for(qe in Xe=je.maxGlyphID,De)qe in He||(He[qe]=Xe++);return ze=function(Ke){var Qe,Ze;for(Qe in Ze={},Ke)Ze[Ke[Qe]]=Qe;return Ze}(He),We=Object.keys(ze).sort(function(Ke,Qe){return Ke-Qe}),Ge=function(){var Ke,Qe,Ze;for(Ze=[],Ke=0,Qe=We.length;Ke<Qe;Ke++)$e=We[Ke],Ze.push(ze[$e]);return Ze}(),Me=this.font.glyf.encode(De,Ge,He),Ue=this.font.loca.encode(Me.offsets,Ge),Ye={cmap:this.font.cmap.raw(),glyf:Me.table,loca:Ue,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(Te)},this.font.os2.exists&&(Ye["OS/2"]=this.font.os2.raw()),this.font.directory.encode(Ye)},Ee}();E.API.PDFObject=function(){var Ee;function Re(){}return Ee=function(Te,je){return(Array(je+1).join("0")+Te).slice(-je)},Re.convert=function(Te){var je,Oe,Me,De;if(Array.isArray(Te))return"["+function(){var $e,Be,Ue;for(Ue=[],$e=0,Be=Te.length;$e<Be;$e++)je=Te[$e],Ue.push(Re.convert(je));return Ue}().join(" ")+"]";if(typeof Te=="string")return"/"+Te;if(Te!=null&&Te.isString)return"("+Te+")";if(Te instanceof Date)return"(D:"+Ee(Te.getUTCFullYear(),4)+Ee(Te.getUTCMonth(),2)+Ee(Te.getUTCDate(),2)+Ee(Te.getUTCHours(),2)+Ee(Te.getUTCMinutes(),2)+Ee(Te.getUTCSeconds(),2)+"Z)";if({}.toString.call(Te)==="[object Object]"){for(Oe in Me=["<<"],Te)De=Te[Oe],Me.push("/"+Oe+" "+Re.convert(De));return Me.push(">>"),Me.join(` 4215`)}return""+Te},Re}();const ExportChatDialog=({open:Ee,onClose:Re,sessionName:Te,messages:je})=>{const[Oe,Me]=reactExports.useState("txt"),[De,$e]=reactExports.useState(!1);reactExports.useEffect(()=>{Ee&&Me("txt")},[Ee]);const Be=async()=>{$e(!0);try{let Ue="";
4215const ze=new Date().toLocaleString(),We=new Date,Xe=`${We.getFullYear()}-${String(We.getMonth()+1).padStart(2,"0")}-${String(We.getDate()).padStart(2,"0")}`;if(Oe==="txt"){Ue=`Chat Export: ${Te} 4216`,Ue+=`Exported: ${ze} 4217`,Ue+=`${"=".repeat(50)} 4218 4219`,je.forEach(Ye=>{const Ve=Ye.role==="user"?"You":"AI Assistant",Ke=new Date(Ye.timestamp).toLocaleString();Ue+=`[${Ke}] ${Ve}: 4220${Ye.content} 4221 4222`});const He=new Blob([Ue],{type:"text/plain"}),qe=URL.createObjectURL(He),Ge=document.createElement("a");Ge.href=qe,Ge.download=`${Te.replace(/[^a-z0-9]/gi,"_")}_${Xe}.txt`,document.body.appendChild(Ge),Ge.click(),document.body.removeChild(Ge),URL.revokeObjectURL(qe)}else{const He=new E,qe=He.internal.pageSize.getWidth(),Ge=He.internal.pageSize.getHeight(),Ye=20,Ve=qe-2*Ye;let Ke=Ye;const Qe=(Ze,Je=11,ir=!1,rr=[0,0,0])=>{He.setFontSize(Je),He.setFont("helvetica",ir?"bold":"normal"),He.setTextColor(...rr),He.splitTextToSize(Ze,Ve).forEach(or=>{Ke+Je/2>Ge-Ye&&(He.addPage(),Ke=Ye),He.text(or,Ye,Ke),Ke+=Je/2+2})};Qe(`Chat Export: ${Te}`,16,!0),Ke+=5,Qe(`Exported: ${ze}`,10,!1,[100,100,100]),Qe(`Total Messages: ${je.length}`,10,!1,[100,100,100]),Ke+=10,He.setDrawColor(200,200,200),He.line(Ye,Ke,qe-Ye,Ke),Ke+=10,je.forEach((Ze,Je)=>{const ir=Ze.role==="user"?"You":"AI Assistant",rr=new Date(Ze.timestamp).toLocaleString(),ar=Ze.role==="user"?[33,150,243]:[100,100,100];Ke>Ge-Ye-30&&(He.addPage(),Ke=Ye),Qe(`${ir} - ${rr}`,10,!0,ar),Ke+=2,Qe(Ze.content,11,!1),Ke+=8,Je<je.length-1&&(He.setDrawColor(230,230,230),He.line(Ye,Ke,qe-Ye,Ke),Ke+=8)}),He.save(`${Te.replace(/[^a-z0-9]/gi,"_")}_${Xe}.pdf`)}setTimeout(()=>{$e(!1),Re()},500)}catch(Ue){console.error("Export failed:",Ue),$e(!1)}};return jsxRuntimeExports.jsxs(Dialog,{open:Ee,onClose:Re,maxWidth:"xs",fullWidth:!0,children:[jsxRuntimeExports.jsx(DialogTitle,{children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(DownloadIcon,{}),jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Export Chat"})]})}),jsxRuntimeExports.jsxs(DialogContent,{children:[jsxRuntimeExports.jsx(Alert,{severity:"info",sx:{mb:3},children:"Export your chat history for offline viewing or record keeping."}),jsxRuntimeExports.jsxs(FormControl,{component:"fieldset",children:[jsxRuntimeExports.jsx(FormLabel,{component:"legend",children:"Export Format"}),jsxRuntimeExports.jsx(RadioGroup,{value:Oe,onChange:Ue=>Me(Ue.target.value),children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:[jsxRuntimeExports.jsx(Box,{sx:{border:"1px solid",borderColor:Oe==="txt"?"primary.main":"divider",borderRadius:1,p:2,cursor:"pointer",bgcolor:Oe==="txt"?"action.selected":"transparent"},onClick:()=>Me("txt"),children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Radio,{value:"txt"}),jsxRuntimeExports.jsx(DocumentIcon,{}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",children:"Text File (.txt)"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Simple text format, easy to read"})]})]})}),jsxRuntimeExports.jsx(Box,{sx:{border:"1px solid",borderColor:Oe==="pdf"?"primary.main":"divider",borderRadius:1,p:2,cursor:"pointer",bgcolor:Oe==="pdf"?"action.selected":"transparent"},onClick:()=>Me("pdf"),children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Radio,{value:"pdf"}),jsxRuntimeExports.jsx(PictureAsPdf,{}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",children:"PDF File (.pdf)"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Formatted document, print-ready"})]})]})})]})})]}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",sx:{display:"block",mt:2},children:[je.length," messages will be exported"]})]}),jsxRuntimeExports.jsxs(DialogActions,{children:[jsxRuntimeExports.jsx(Button,{onClick:Re,disabled:De,children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:Be,variant:"contained",startIcon:De?jsxRuntimeExports.jsx(CircularProgress,{size:16}):jsxRuntimeExports.jsx(DownloadIcon,{}),disabled:De||je.length===0,children:De?"Exporting...":"Export"})]})]})},ChatPage=()=>{var ga,xi,Rs;const Ee=useDispatch(),Re=useLocation(),Te=useNavigate(),{darkMode:je}=useThemeMode(),Oe=useTheme$1(),Me=useMediaQuery(Oe.breakpoints.down("md")),De=useSelector(selectSessions),$e=useSelector(selectCurrentSessionId),Be=useSelector(selectSessionDocumentIds),Ue=useSelector(selectSessionDocumentNames),ze=useSelector(selectSessionGroupIds),We=useSelector(selectSessionWebsiteIds),Xe=useSelector(selectSessionDbConnectionId),He=useSelector(selectMessages),qe=useSelector(selectChatLoading),Ge=useSelector(selectCreatingSession),Ye=useSelector(selectSendingMessage),Ve=useSelector(selectChatError),Ke=useSelector(selectHasMoreMessages),Qe=useSelector(selectIsLoadingMore),Ze=useSelector(selectMessagesLimit),Je=useSelector(selectAvailableModels),ir=useSelector(selectModelsLoading),rr=useSelector(selectCustomInstru
4222ctions),ar=useSelector(selectActivePresetKey),or=useSelector(selectStrictModeValue);useSelector(selectIndustryValue);const{user:pr}=useSelector(fn=>fn.auth),{subscription:tr}=useSelector(fn=>fn.subscription),nr=useSelector(selectAllGroups),hr=useSelector(selectSharedSessions),sr=useSelector(selectCurrentSessionAccess),xr=useSelector(selectIsCurrentSessionReadOnly),br=((pr==null?void 0:pr.role)??(pr==null?void 0:pr.RoleID)??(pr==null?void 0:pr.role_level)??(pr==null?void 0:pr.roleLevel))===ROLES.VIEW_ONLY,[wr,vr]=reactExports.useState(!1),[Dr,kr]=reactExports.useState(!1),[cr,dr]=reactExports.useState(null),[ur,gr]=reactExports.useState([]),[_r,Ir]=reactExports.useState([]),[Ar,Tr]=reactExports.useState(null),[Nr,Br]=reactExports.useState([]),[Hr,Vr]=reactExports.useState([]),[mr,Sr]=reactExports.useState([]),[Lr,jr]=reactExports.useState({}),[fr,Cr]=reactExports.useState(null),[Mr,$r]=reactExports.useState([]),[Fr,Kr]=reactExports.useState(!1),[an,Wr]=reactExports.useState(SOURCE_TAB.DOCUMENTS),[hn,cn]=reactExports.useState(!1),[tn,Qr]=reactExports.useState(!1),[wn,gn]=reactExports.useState(!1),[In,yn]=reactExports.useState(null),[Mn,on]=reactExports.useState(""),[Yr,sn]=reactExports.useState(null),[On,Bn]=reactExports.useState(null),[Hn,Zr]=reactExports.useState(!1),[xn,An]=reactExports.useState(null),[Wn,ss]=reactExports.useState(null),[Yn,en]=reactExports.useState(!1),Gr=reactExports.useRef(null),nn=reactExports.useRef({documents:[]}),[En,Cn]=reactExports.useState(!1),[jn,$n]=reactExports.useState(!1),[Vn,Qn]=reactExports.useState({enforce_custom_instructions:!1,custom_instructions_value:null,enforce_document_settings:!1,document_settings_value:null,enforce_response_styles:!1,response_styles_value:null,enforce_content_preferences:!1,content_preferences_value:null,enforce_additional_instructions:!1,additional_instructions_value:null,show_strict_mode:!0,show_custom_instructions:!0,show_document_settings:!0,show_response_styles:!0,show_content_preferences:!0,show_additional_instructions:!0,enforce_industry:!1,industry_value:null,show_industry:!0,multi_source_scope_enabled:!1,tenant_industry:null}),[Un,fs]=reactExports.useState(!1),Jn=Vn.multi_source_scope_enabled,ts=!br&&(Vn.show_custom_instructions||Vn.show_document_settings||Vn.show_content_preferences||Vn.show_additional_instructions),[cs,Sn]=reactExports.useState("default"),[mn,zn]=reactExports.useState(!1),[os,ls]=reactExports.useState(""),[hs,Cs]=reactExports.useState(!1),[Ds,ho]=reactExports.useState(null);reactExports.useEffect(()=>{var fn;(fn=Re.state)!=null&&fn.message&&(ls(Re.state.message),zn(!0),Te(Re.pathname,{replace:!0,state:{}}))},[Re,Te]),reactExports.useEffect(()=>{Ee(fetchSessions(!0)),Ee(fetchSharedSessions(!0));const fn=window.setTimeout(()=>{Ee(fetchInstructions(!0)),Ee(fetchAvailableModels(!0))},0);return()=>window.clearTimeout(fn)},[Ee]);const Mo=reactExports.useCallback(()=>{dbConnectionService.listAvailable().then(fn=>{Ir(fn||[])}).catch(()=>{})},[]),Po=reactExports.useCallback(()=>{websiteConnectionService.listAvailable().then(fn=>{Br(fn||[])}).catch(()=>{})},[]);reactExports.useEffect(()=>{const fn=window.setTimeout(()=>{Mo(),Po()},0);return()=>window.clearTimeout(fn)},[Mo,Po]),reactExports.useEffect(()=>{or!==null&&!jn&&Cn(or)},[or,jn]),reactExports.useEffect(()=>{tenantAdminService.getTenantPublicSettings().then(fn=>{const gs=!!(fn!=null&&fn.enforce_strict_mode);$n(gs),gs&&Cn(!!(fn!=null&&fn.strict_mode_value)),Qn({enforce_custom_instructions:!!(fn!=null&&fn.enforce_custom_instructions),custom_instructions_value:(fn==null?void 0:fn.custom_instructions_value)||null,enforce_document_settings:!!(fn!=null&&fn.enforce_document_settings),document_settings_value:(fn==null?void 0:fn.document_settings_value)||null,enforce_response_styles:!!(fn!=null&&fn.enforce_response_styles),response_styles_value:(fn==null?void 0:fn.response_styles_value)||null,enforce_content_preferences:!!(fn!=null&&fn.enforce_content_preferences),content_preferences_value:(fn==null?void 0:fn.content_preferences_value)||null,enforce_additional_instructions:!!(fn!=null&&fn.enforce_additional_instructions),additional_instructions_value:(fn==null?void 0:fn.additional_instructions_value)||null,show_strict_mode:(fn==null?void 0:fn.show_strict_mode)!==!1,show_custom_instructions:(fn==null?void 0:fn.show_custom_instructions)!==!1,show_document_settings:(fn==null?void 0:fn.show_document_settings)!==!1,show_response_styles:(fn==null?void 0:fn.show_response_styles)!==!1,show_content_preferences:(fn==null?void 0:fn.show_content_preferences)!==!1,show_additional_instructions:(fn==null?void 0:fn.show_additional_instructions)!==!1,enforce_industry:!!(fn!=null&&fn.enforce_industry),industry_value:(fn==null?void 0:fn.industry_value)||null,show_industry:(fn==null?void 0:fn.show_industry)!==!1,multi_source_scope_enabled:!!(fn!=null&&fn.multi_source_scope_enabled),tenant_industry:(fn==null?void 0:fn.tenant_industry)||null}),fs(!0)}).catch(()=>{})},[]);const wo=reactExports.useMemo(()=>buildSourceAttachments({documents:ur,documentNames:Lr,groups:Mr,allGroups:nr,websites:mr,websiteIds:We,dbConnection:Ar,dbConnectionId:Xe,activeDbConnections:_r,activeWebsiteConnections:Nr}),[ur,Lr,Mr,nr,mr,We,Ar,Xe,_r,Nr]),ri=reactExports.useCallback(fn=>{if(!fn||fn.unavailable){ss(fn);return}if(fn.type===SOURCE_CHIP_TYPES.DOCUMENT){An({FileID:fn.sourceId,FileName:fn.name});return}ss(fn)},[]),go=reactExports.useCallback(fn=>{if(fn){switch(fn.type){case SOURCE_CHIP_TYPES.DOCUMENT:{const gs=ur.filter(Hs=>
4222String(Hs)!==String(fn.sourceId)),Ps={...Lr};delete Ps[fn.sourceId],delete Ps[String(fn.sourceId)],delete Ps[Number(fn.sourceId)],Ee(setSessionDocumentIds(gs)),Ee(setSessionDocumentNames(Ps)),gr(gs),jr(Ps),$e&&chatService.updateSessionDocuments($e,gs).catch(()=>{});break}case SOURCE_CHIP_TYPES.GROUP:{const gs=Mr.filter(Ps=>String(Ps)!==String(fn.sourceId));Ee(setSessionGroupIds(gs)),$r(gs),$e&&chatService.updateSessionGroups($e,gs).catch(()=>{});break}case SOURCE_CHIP_TYPES.WEBSITE:{const gs=mr.filter(Ps=>String(Ps.id)!==String(fn.sourceId));Ee(setSessionWebsiteIds(coerceWebsiteIds(gs.map(Ps=>Ps.id)))),Sr(gs),$e&&chatService.updateSessionWebsites($e,coerceWebsiteIds(gs.map(Ps=>Ps.id))).catch(()=>{});break}case SOURCE_CHIP_TYPES.DATABASE:Tr(null),Ee(setSessionDbConnectionId(null)),$e&&chatService.updateSessionDbConnection($e,null).catch(()=>{});break}setTimeout(()=>{var gs;return(gs=Gr.current)==null?void 0:gs.focus()},100)}},[$e,Ee,Lr,ur,Mr,mr]),Vo=reactExports.useCallback(()=>{webGroupService.getAvailableWebGroups().then(fn=>{Vr(fn||[])}).catch(()=>{})},[]);reactExports.useEffect(()=>{Vo()},[Vo]),reactExports.useEffect(()=>{!Me&&Yn&&en(!1)},[Me,Yn]),reactExports.useEffect(()=>{if(!Array.isArray(Je)||Je.length===0){Sn("default");return}Je.some(fn=>fn.id===cs)||Sn("default")},[Je,cs]),reactExports.useEffect(()=>{const fn=Array.isArray(Be)?Be:[];gr(fn),jr(fn.length>0&&Ue&&typeof Ue=="object"?Ue:{})},[$e,Be,Ue]),reactExports.useEffect(()=>{const fn=Array.isArray(ur)?ur:[];if(fn.length===0||fn.filter(Hs=>{const so=String(Hs);return!(Lr[Hs]||Lr[so]||Lr[Number(so)])}).length===0)return;let Ps=!1;return(async()=>{try{const{namesMap:Hs}=await chatService.filterExistingDocumentIds(fn);if(Ps||!Hs||Object.keys(Hs).length===0)return;const so={...Lr,...Hs};Object.entries(Hs).forEach(([To,Do])=>{so[To]=Do,so[String(To)]=Do}),jr(so),Ee(setSessionDocumentNames(so))}catch{}})(),()=>{Ps=!0}},[ur,Lr,Ee]),reactExports.useEffect(()=>{const fn=Array.isArray(ze)?ze:[];$r(fn)},[$e,ze]),reactExports.useEffect(()=>{const fn=Array.isArray(We)?We:[];if(fn.length===0){Sr([]);return}if(Nr.length===0)return;const gs=Nr.filter(Ps=>fn.some(Hs=>String(Hs)===String(Ps.id)));Sr(gs)},[$e,We,Nr]),reactExports.useEffect(()=>{if(!Xe){Tr(null);return}if(_r.length===0)return;const fn=_r.find(gs=>String(gs.id)===String(Xe))||null;Tr(fn)},[$e,Xe,_r]),reactExports.useEffect(()=>{$e&&Ee(fetchHistory({sessionId:$e,forceRefresh:!0}))},[$e,Ee]),reactExports.useEffect(()=>{if(!$e)return;let fn;const gs=Hs=>{Hs&&Hs.session_id&&String(Hs.session_id)===String($e)&&Ee(receiveSharedChatMessage(Hs))},Ps=()=>{kr(!1),dr(null)};return(sr!=="owner"||hr.some(Hs=>String(Hs.id)===String($e)))&&(fn=chatService.subscribeChatSessionMessages($e,gs,Ps)),()=>{fn&&fn()}},[$e,sr,hr,Ee]),reactExports.useEffect(()=>{sn(null),Bn(null),Zr(!1),An(null),stopTTS()},[$e]),reactExports.useEffect(()=>()=>stopTTS(),[]),reactExports.useEffect(()=>{hn&&(nn.current={documents:Array.isArray(ur)?[...ur]:[]})},[hn]),reactExports.useEffect(()=>{Ve&&vr(!0)},[Ve]),reactExports.useEffect(()=>{var Ps;const fn=(Ps=Re.state)==null?void 0:Ps.favoritePrompt;if(!fn)return;const gs=setTimeout(()=>{Gr.current&&Gr.current.setMessageOnly(fn),Te(Re.pathname,{replace:!0,state:{...Re.state||{},favoritePrompt:void 0}})},200);return()=>clearTimeout(gs)},[(ga=Re.state)==null?void 0:ga.favoritePrompt,Re.pathname,Re.state,Te]);const Nn=async(fn="New Chat")=>{(await Ee(createSession(fn))).type==="chat/createSession/fulfilled"&&(Ee(setSessionDocumentIds([])),Ee(setSessionDocumentNames({})),Ee(setSessionGroupIds([])),Ee(setSessionWebsiteIds([])),Ee(setSessionDbConnectionId(null)),gr([]),jr({}),$r([]),Sr([]),Tr(null),Ee(fetchSessions(!0)),setTimeout(()=>{var Ps;return(Ps=Gr.current)==null?void 0:Ps.focus()},150))},Kn=fn=>{Ee(setCurrentSession(fn)),setTimeout(()=>{var gs;return(gs=Gr.current)==null?void 0:gs.focus()},150)},ds=async(fn,gs={})=>{var ya;gs.fromVoice&&(Cs(!0),ho(He.length));const Ps=[...He||[]].reverse().find(No=>No.role==="assistant"),Hs=!!((ya=Ps==null?void 0:Ps.meta)!=null&&ya.needs_clarification),so=gs.sourceOverride||null,To=so&&so!=="document"?[]:ur,Do=so&&so!=="group"?[]:Mr,Ni=so&&so!=="website"?[]:mr,yi=so&&so!=="database"?null:Ar,ci=coerceDocumentIds(To);let Ei=Lr;if(!so&&isAgentMessage(fn)&&ci.length>0&&!ci.every(to=>{const ko=String(to);return Lr[to]||Lr[ko]||Lr[Number(ko)]}))try{const to=await documentService.getDocuments(!0),ko=Array.isArray(to)?to:(to==null?void 0:to.files)||(to==null?void 0:to.documents)||[],ui={...Lr};for(const $o of ko){const di=$o.FileID??$o.fileId??$o.file_id??$o.id;if(di==null||!ci.some($i=>String($i)===String(di)))continue;const _i=$o.FileName||$o.filename||$o.file_name||$o.displayFilename||$o.OriginalFilename;
4222_i&&(ui[di]=_i,ui[String(di)]=_i)}Ei=ui}catch{Ei=Lr}const Yo=so?fn:buildAgentDisplayMessage(fn,ci,Ei),xa=so?fn:resolveAgentMessage(fn),Ci=buildAttachedScopeSnapshot(wo);if($e)Ee(sendMessage({sessionId:$e,message:Yo,agentMessage:xa,selectedDocuments:To,selectedGroups:Do,customInstructions:ar||"",mode:En?"strict":"non_strict",additional_instructions:(rr==null?void 0:rr.customText)||null,selectedModel:cs,dbConnectionId:(yi==null?void 0:yi.id)||null,webUrls:Ni.map(No=>No.url),websiteIds:Ni.map(No=>No.id),attachedScope:Ci,isClarification:Hs}));else{const No=await Ee(createSession("New Chat"));if(await new Promise(to=>setTimeout(to,500)),No.type==="chat/createSession/fulfilled"){const to=No.payload.session_id;await Ee(fetchHistory({sessionId:to,forceRefresh:!0})),await new Promise(ko=>setTimeout(ko,500)),Ee(sendMessage({sessionId:to,message:Yo,agentMessage:xa,selectedDocuments:To,selectedGroups:Do,customInstructions:ar||"",mode:En?"strict":"non_strict",additional_instructions:(rr==null?void 0:rr.customText)||null,selectedModel:cs,dbConnectionId:(yi==null?void 0:yi.id)||null,webUrls:Ni.map(ko=>ko.url),websiteIds:Ni.map(ko=>ko.id),attachedScope:Ci,isClarification:Hs}))}}},xs=()=>{if(!$e||!Ke||Qe)return;const fn=He.length;Ee(fetchOlderMessages({sessionId:$e,offset:fn,limit:Ze}))},js=({docs:fn=ur,groups:gs=Mr,websites:Ps=mr,db:Hs=Ar}={})=>{if(!Jn)return;[(fn||[]).length>0,(gs||[]).length>0,(Ps||[]).length>0,!!Hs].filter(Boolean).length>1&&(ls("Chat might take longer to respond when multiple source are selected."),zn(!0))},Ws=(fn,gs)=>{const Ps=coerceDocumentIds(fn),Hs=gs||(Ps.length===0?{}:Lr);Ee(setSessionDocumentIds(Ps)),Ee(setSessionDocumentNames(Hs)),gr(Ps),jr(Hs),setTimeout(()=>{Gr.current&&Gr.current.focus()},100)},Gs=(fn=null,gs=SOURCE_TAB.DOCUMENTS)=>{Cr(fn),Wr(gs),Kr(!0),Mo(),Po()},qs=fn=>{const gs=Array.isArray(fn)?fn:[];Ee(setSessionWebsiteIds(coerceWebsiteIds(gs.map(Ps=>Ps.id)))),Sr(gs)},Ns=reactExports.useCallback(fn=>{Tr(fn),Ee(setSessionDbConnectionId((fn==null?void 0:fn.id)||null)),$e&&chatService.updateSessionDbConnection($e,(fn==null?void 0:fn.id)||null).catch(()=>{})},[$e,Ee]),ps=fn=>{const gs=coerceGroupIds(fn);Ee(setSessionGroupIds(gs)),$r(gs),setTimeout(()=>{Gr.current&&Gr.current.focus()},100)},us=()=>{Sr([]),Ee(setSessionWebsiteIds([])),$e&&chatService.updateSessionWebsites($e,[]).catch(()=>{})},Ts=()=>{gr([]),jr({}),Ee(setSessionDocumentIds([])),$e&&chatService.updateSessionDocuments($e,[]).catch(()=>{})},As=()=>{Tr(null),Ee(setSessionDbConnectionId(null)),$e&&chatService.updateSessionDbConnection($e,null).catch(()=>{})},Fs=()=>{$r([]),Ee(setSessionGroupIds([])),$e&&chatService.updateSessionGroups($e,[]).catch(()=>{})};reactExports.useEffect(()=>{!Un||Jn||[ur.length>0,Mr.length>0,mr.length>0,!!Ar].filter(Boolean).length<=1||(Ts(),Fs(),us(),As(),ls("Combining multiple source types is turned off for your organization â cleared your selection so you can pick just one (documents, groups, a website, or a database)."),zn(!0))},[Un,Jn,$e,ur,Mr,mr,Ar]);const Co=fn=>{Gr.current&&Gr.current.setMessageOnly(fn),Qr(!1)},Eo=fn=>{on(fn),setTimeout(()=>{Gr.current&&(Gr.current.focus(),Gr.current.send())},100)},xo=(fn,gs)=>{if(!(!fn||!gs)){if(Hn&&Yr===fn){Zr(!1);return}sn(fn),Bn(gs),Zr(!0)}},ua=fn=>{fn!=null&&fn.file_id&&(An({id:fn.file_id,FileID:fn.file_id,filename:fn.filename||"document",FileName:fn.filename||"document",displayFilename:fn.filename||"document",chunk_text:fn.chunk_text||null,initialPage:fn.page||null,node_id:fn.node_id||null,highlight_rects:fn.highlight_rects||fn.citation_rects||null,anchor_ids:fn.anchor_ids||null}),Zr(!1))},Ma=()=>{An(null)},Da=()=>{Zr(!1)};let wi=null;Yr&&Array.isArray(He)&&(wi=He.find(fn=>((fn==null?void 0:fn.id)||(fn==null?void 0:fn.message_id)||null)===Yr)||null),!wi&&On&&(wi=On);const Xo=!!(Hn&&wi),da=fn=>{yn(fn.currentTarget)},gi=()=>{yn(null)},Mi=()=>{gi(),gn(!0)},Di=async(fn,gs)=>{await Ee(renameSession({sessionId:fn,newName:gs})),Ee(fetchSessions(!0)),setTimeout(()=>{var Ps;return(Ps=Gr.current)==null?void 0:Ps.focus()},150)},pa=async fn=>{await Ee(deleteSession(fn)),Ee(fetchSessions(!0)),setTimeout(()=>{var gs;return(gs=Gr.current)==null?void 0:gs.focus()},150)},ha=async(fn,gs)=>{await Ee(togglePinSession({sessionId:fn,isPinned:gs})),setTimeout(()=>{var Ps;return(Ps=Gr.current)==null?void 0:Ps.focus()},150)},fa=async fn=>{await Ee(clearConversation(fn)),setTimeout(()=>{var gs;return(gs=Gr.current)==null?void 0:gs.focus()},150)},ai=fn=>{dr(fn),kr(!0)},ma=()=>{vr(!1),Ee(clearError$7())},li=fn=>{gi(),fn==null||fn(),setTimeout(()=>{var gs;return(gs=Gr.current)==null?void 0:gs.focus()},100)};return jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",height:{xs:"c
4222alc(100vh - 56px)",sm:"calc(100vh - 64px)"},bgcolor:"background.default"},children:[Me?jsxRuntimeExports.jsx(Drawer,{open:Yn,onClose:()=>en(!1),anchor:"left",ModalProps:{keepMounted:!0},PaperProps:{sx:{width:{xs:"min(100vw, 360px)",sm:360},maxWidth:"100vw"}},children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[jsxRuntimeExports.jsxs(Box,{sx:{px:1.5,py:1,display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid",borderColor:"divider",bgcolor:"background.paper"},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{fontWeight:700},children:"Conversations"}),jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:()=>en(!1),"aria-label":"Close conversations",children:jsxRuntimeExports.jsx(Close$1,{fontSize:"small"})})]}),jsxRuntimeExports.jsx(Box,{sx:{flex:1,minHeight:0},children:jsxRuntimeExports.jsx(SessionSidebar,{sessions:De,currentSessionId:$e,onSelectSession:fn=>{Kn(fn),en(!1)},onCreateSession:async fn=>{await Nn(fn),en(!1)},onRenameSession:Di,onDeleteSession:pa,onTogglePin:ha,onClearConversation:fa,loading:qe,creatingSession:Ge,sharedSessions:hr,onShareSession:ai})})]})}):jsxRuntimeExports.jsx(SessionSidebar,{sessions:De,currentSessionId:$e,onSelectSession:Kn,onCreateSession:Nn,onRenameSession:Di,onDeleteSession:pa,onTogglePin:ha,onClearConversation:fa,loading:qe,creatingSession:Ge,sharedSessions:hr,onShareSession:ai}),jsxRuntimeExports.jsxs(Box,{sx:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},children:[jsxRuntimeExports.jsxs(Box,{sx:{p:2,borderBottom:"1px solid",borderColor:"divider",bgcolor:"background.paper",display:"flex",alignItems:"center",justifyContent:"space-between",gap:1.5,flexWrap:{xs:"wrap",sm:"nowrap"}},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.25,minWidth:0},children:[Me&&jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:()=>en(!0),"aria-label":"Open conversations",sx:{display:{xs:"inline-flex",md:"none"}},children:jsxRuntimeExports.jsx(MenuIcon,{})}),jsxRuntimeExports.jsxs(Box,{sx:{minWidth:0},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{fontWeight:600,fontSize:{xs:"1rem",sm:"1.15rem"}},noWrap:!0,children:((xi=De.find(fn=>fn.session_id===$e)||hr.find(fn=>String(fn.id)===String($e)))==null?void 0:xi.name)||"Chat"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",children:"Ask questions about your data sources or get assistance"})]})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1,alignItems:"center",flexWrap:"wrap",justifyContent:{xs:"flex-start",sm:"flex-end"}},children:[!br&&!xr&&Vn.show_strict_mode&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Tooltip,{title:jn?"Strict mode is enforced by your organization and cannot be changed":"",disableHoverListener:!jn,children:jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Switch,{checked:En,onChange:fn=>{if(jn)return;const gs=fn.target.checked;Cn(gs),Ee(saveStrictMode(gs)),setTimeout(()=>{Gr.current&&Gr.current.focus()},100)},size:"small",disabled:jn,sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:"#002D79"},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:"#002D79"}}}),label:"Strict",sx:{m:0,"& .MuiFormControlLabel-label":{fontSize:{xs:"0.8rem",sm:"0.875rem"},fontWeight:500}}})})}),!br&&!xr&&jsxRuntimeExports.jsx(Tooltip,{title:"Generate analytical report",children:jsxRuntimeExports.jsx(IconButton,{onClick:()=>{if(!Ar){Gs(null,SOURCE_TAB.DATABASE);return}on("/agent analytical-report "),setTimeout(()=>{var fn;return(fn=Gr.current)==null?void 0:fn.focus()},0)},size:"small",sx:{display:{xs:"none",sm:"inline-flex"}},children:jsxRuntimeExports.jsx(Assessment,{})})}),jsxRuntimeExports.jsx(Tooltip,{title:"Favorite Prompts",children:jsxRuntimeExports.jsx(IconButton,{onClick:()=>Qr(!0),size:"small",sx:{display:{xs:"none",sm:"inline-flex"}},children:jsxRuntimeExports.jsx(Star,{})})}),!br&&!xr&&ts&&jsxRuntimeExports.jsx(Tooltip,{title:"Chat Settings",children:jsxRuntimeExports.jsx(IconButton,{onClick:()=>
4222cn(!0),size:"small","data-tour":"custom-instructions",sx:{display:{xs:"none",sm:"inline-flex"}},children:jsxRuntimeExports.jsx(Settings,{})})}),jsxRuntimeExports.jsx(Tooltip,{title:"More options",children:jsxRuntimeExports.jsx(IconButton,{onClick:da,size:"small",children:jsxRuntimeExports.jsx(MoreVertIcon,{})})})]})]}),jsxRuntimeExports.jsx(MessageList,{messages:He,loading:qe&&He.length===0&&!!$e,sendingMessage:Ye,sessionId:$e,onEditMessage:Eo,readOnly:xr,hasMoreMessages:Ke,isLoadingMore:Qe,onLoadMore:xs,activeSourceMessageId:Yr,isSourcePanelOpen:Xo,onActivateSources:xo,awaitingVoiceReply:hs,voiceReplyAfterIndex:Ds,onVoiceReplySpoken:()=>{Cs(!1),ho(null)},onSuggestionClick:ds}),wo.length>0&&jsxRuntimeExports.jsx(SourceAttachmentChips,{items:wo,onRemove:go,onPreview:ri}),jsxRuntimeExports.jsx(Box,{sx:{position:"relative",flexShrink:0},children:jsxRuntimeExports.jsx(ChatInput,{ref:Gr,onSendMessage:ds,disabled:Ye||xr,readOnlyReason:xr?"You have view-only access to this shared chat":null,onAttachDocuments:Gs,onAttachDbConnection:fn=>{Tr(fn),Ee(setSessionDbConnectionId((fn==null?void 0:fn.id)||null)),js({db:fn})},dbConnections:_r,initialMessage:Mn,onMessageSet:()=>on(""),availableModels:Je,selectedModel:cs,onSelectedModelChange:Sn,modelsLoading:ir,selectedDocuments:ur,selectedGroups:Mr,selectedWebsites:mr,selectedDbConnection:Ar})})]}),jsxRuntimeExports.jsxs(Menu,{anchorEl:In,open:!!In,onClose:gi,children:[Me&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(MenuItem,{onClick:()=>li(()=>Qr(!0)),children:[jsxRuntimeExports.jsx(Star,{sx:{mr:1},fontSize:"small"}),"Favorite Prompts"]}),ts&&jsxRuntimeExports.jsxs(MenuItem,{onClick:()=>li(()=>cn(!0)),children:[jsxRuntimeExports.jsx(Settings,{sx:{mr:1},fontSize:"small"}),"Chat Settings"]})]}),jsxRuntimeExports.jsxs(MenuItem,{onClick:Mi,children:[jsxRuntimeExports.jsx(DownloadIcon,{sx:{mr:1},fontSize:"small"}),"Export Chat"]})]}),jsxRuntimeExports.jsx(DocumentSelectionModal,{open:Fr,sessionId:$e,initialTab:an,onClose:()=>{Kr(!1),Cr(null),Wr(SOURCE_TAB.DOCUMENTS),setTimeout(()=>{var fn;return(fn=Gr.current)==null?void 0:fn.focus()},100)},selectedDocuments:ur,onDocumentsChange:Ws,selectedGroups:Mr,onGroupsChange:ps,minRequiredDocuments:(fr==null?void 0:fr.minDocuments)||1,requirementLabel:fr!=null&&fr.commandSlug?`/${fr.commandSlug} needs ${fr.minDocuments===1?"a selected document":`at least ${fr.minDocuments} selected documents`}.`:"",dbConnections:_r,selectedDbConnection:Ar,onDbConnectionChange:Ns,websiteConnections:Nr,webGroups:Hr,selectedWebsites:mr,onWebsitesChange:qs,restrictToSingleSource:!Jn,onSourcesConfirmed:({documentIds:fn,websites:gs,dbConnection:Ps,groupIds:Hs})=>js({docs:fn,websites:gs,db:Ps,groups:Hs})}),jsxRuntimeExports.jsx(ChatSettingsPopup,{open:hn,onClose:fn=>{fn!=null&&fn.cancelled&&gr(nn.current.documents),cn(!1),setTimeout(()=>{var gs;return(gs=Gr.current)==null?void 0:gs.focus()},100)},presetSettings:rr,tenantPanelSettings:Vn}),jsxRuntimeExports.jsx(FavoritePromptsModal,{open:tn,onClose:()=>{Qr(!1),setTimeout(()=>{var fn;return(fn=Gr.current)==null?void 0:fn.focus()},100)},onSelectPrompt:Co}),jsxRuntimeExports.jsx(ExportChatDialog,{open:wn,onClose:()=>{gn(!1),setTimeout(()=>{var fn;return(fn=Gr.current)==null?void 0:fn.focus()},100)},sessionName:((Rs=De.find(fn=>fn.session_id===$e))==null?void 0:Rs.name)||"Chat",messages:He}),jsxRuntimeExports.jsx(SourceBlocksSidebar,{activeMessage:wi,open:Xo,onClose:Da,onOpenSource:ua}),xn&&jsxRuntimeExports.jsx(DocumentPreviewModal,{document:xn,open:!!xn,onClose:Ma,user:pr,subscription:tr,highlightText:xn.chunk_text||null,highlightRects:xn.highlight_rects||null,initialPage:xn.initialPage||null}),jsxRuntimeExports.jsx(SourcePreviewDialog,{item:Wn,open:!!Wn,onClose:()=>ss(null)}),jsxRuntimeExports.jsx(ShareChatDialog,{open:Dr,session:cr,onClose:()=>{kr(!1),dr(null)},onShared:()=>{ls("Chat shared successfully!"),zn(!0)}}),jsxRuntimeExports.jsx(Toast,{open:wr,message:Ve||"An error occurred",severity:"error",onClose:ma}),jsxRuntimeExports.jsx(Toast,{open:mn,message:os,severity:"success",onClose:()=>zn(!1)})]})},MaintenancePage=reactExports.lazy(()=>__vitePreload(()=>import("./MaintenancePage-CVJEKA5a.js"),__vite__mapDeps([3,1,4,5,6]))),LoginPage=reactExports.lazy(()=>__vitePreload(()=>import("./LoginPage-BIGnoOSz.js"),__vite__mapDeps([7,1,8,9,10,11,12,13,14,15]))),RegisterPage=reactExports.lazy(()=>__vitePreload(()=>
4222import("./RegisterPage-DPByorHF.js"),__vite__mapDeps([16,1,9,10,17,13,15]))),ForgotPasswordPage=reactExports.lazy(()=>__vitePreload(()=>import("./ForgotPasswordPage-CilBbmhk.js"),__vite__mapDeps([18,1,9,10]))),TermsAcceptancePage=reactExports.lazy(()=>__vitePreload(()=>import("./TermsAcceptancePage-DKLyMAkS.js"),__vite__mapDeps([19,1,13]))),SSOCallbackPage=reactExports.lazy(()=>__vitePreload(()=>import("./SSOCallbackPage-BM9g01v4.js"),__vite__mapDeps([20,1]))),RegistrationPendingPage=reactExports.lazy(()=>__vitePreload(()=>import("./RegistrationPendingPage-83GsQvIe.js"),__vite__mapDeps([21,1,10]))),PrivacyPolicyPage=reactExports.lazy(()=>__vitePreload(()=>import("./PrivacyPolicyPage-DqBNl2ts.js"),__vite__mapDeps([22,1,11]))),TermsAndConditionsPage=reactExports.lazy(()=>__vitePreload(()=>import("./TermsAndConditionsPage-DSt1AQRD.js"),__vite__mapDeps([23,1,11]))),ResetPasswordPage=reactExports.lazy(()=>__vitePreload(()=>import("./ResetPasswordPage-C2ycFvCS.js"),__vite__mapDeps([24,1,9,10,15]))),ActivateAccountPage=reactExports.lazy(()=>__vitePreload(()=>import("./ActivateAccountPage-XVGO6d1l.js"),__vite__mapDeps([25,1,9,10,15]))),SubscriptionPage=reactExports.lazy(()=>__vitePreload(()=>import("./SubscriptionPage-DVSyhzXL.js"),__vite__mapDeps([26,1,8,27,10,17,13,28,29,30,31,32,33,4,34,35,36,15,37,38,39,40]))),SignupLandingPage=reactExports.lazy(()=>__vitePreload(()=>import("./SignupLandingPage-Dxz9bgyo.js"),__vite__mapDeps([41,1,35,42]))),SubmitTicketPage=reactExports.lazy(()=>__vitePreload(()=>import("./SubmitTicketPage-DITTiX7E.js"),__vite__mapDeps([43,1,44]))),HelpCenterPage=reactExports.lazy(()=>__vitePreload(()=>import("./HelpCenterPage-BggeF3Nt.js"),__vite__mapDeps([45,1,44,46,47]))),Day10SurveyPage=reactExports.lazy(()=>__vitePreload(()=>import("./Day10SurveyPage-C9GJJvdL.js"),__vite__mapDeps([48,1]))),DocumentRepositoryPage=reactExports.lazy(()=>__vitePreload(()=>import("./DocumentRepositoryPage-CRro1Fnf.js"),__vite__mapDeps([49,1,50,51,27,52,30,12,53,54,55,2,56,39,57]))),PendingApprovalsPage=reactExports.lazy(()=>__vitePreload(()=>import("./PendingApprovalsPage-XZ_59b4u.js"),__vite__mapDeps([58,1,50,4]))),AgentAppsPage=reactExports.lazy(()=>__vitePreload(()=>import("./mermaid-VLURNSYL-BvLj-jQm.js").then(Ee=>Ee.A),__vite__mapDeps([59,1,52,60,61,62,27,47,38,39,4,56,63,64,65,66]))),AgentSchedulesPage=reactExports.lazy(()=>__vitePreload(()=>import("./AgentSchedulesPage-Dsjh1BCw.js"),__vite__mapDeps([67,1,68,63,34,38,39,64]))),GroupsPage=reactExports.lazy(()=>__vitePreload(()=>import("./GroupsPage-CTq7XBnX.js"),__vite__mapDeps([69,1,70,71,64,72,27,14,55,2,56,39,57]))),FavoritesPage=reactExports.lazy(()=>__vitePreload(()=>import("./FavoritesPage-5YgK8u9Y.js"),__vite__mapDeps([73,1,27]))),AnalyticsPage=reactExports.lazy(()=>__vitePreload(()=>import("./AnalyticsPage-689VsFEm.js"),__vite__mapDeps([74,1,38,39,53]))),AdminPage=reactExports.lazy(()=>__vitePreload(()=>import("./AdminPage-Da89_1h3.js"),__vite__mapDeps([75,1,30,13,14,70,71,64,72,55,2,56,39,57,28,29,27,32,33,4,34,76,77,78,79,80,81,82,83,84,85,38,65,86,15,87,68,54,60,61,62,47,88,5,89,90,63,51,91,92,93,94]))),PlatformAdmin=reactExports.lazy(()=>__vitePreload(()=>import("./PlatformAdmin-Ds6RTEus.js"),__vite__mapDeps([95,1,76,77,78,79,80,81,82,83,33,54,4,15,55,2,56,39,57,46,61,62,96,27,89,91,29,36,38]))),ProfilePage=reactExports.lazy(()=>__vitePreload(()=>import("./ProfilePage-B7zYNYT9.js"),__vite__mapDeps([97,1,15,61,96,98]))),BillingSettingsPage=reactExports.lazy(()=>__vitePreload(()=>import("./BillingSettingsPage-BXumvqbE.js"),__vite__mapDeps([99,1,57,28,29,30,37,31,38,39])));new Date().toISOString();const RouteTracker=()=>{const Ee=useLocation(),{isAuthenticated:Re}=useSelector(Te=>Te.auth);return reactExports.useEffect(()=>{if(!Re)return;if(!["/login","/register","/forgot-password","/forgotPassword","/auth/callback"].includes(Ee.pathname))try{const je=`${Ee.pathname}${Ee.search||""}`;localStorage.setItem(STORAGE_KEYS.LAST_ROUTE,je)}catch{}},[Re,Ee.pathname,Ee.search]),null},RedirectIfAuthenticated=({children:Ee})=>{const{isAuthenticated:Re,user:Te}=useSelector(Oe=>Oe.auth),{subscription:je}=useSelector(Oe=>Oe.subscription);
4222if(Re){let Oe=Te!=null&&Te.is_l1_admin?"/platform/tenants/overview":isEnterprisePlan(je)?"/documents/repository":"/chat";try{const Me=localStorage.getItem(STORAGE_KEYS.LAST_ROUTE);Me&&(Oe=Me)}catch{}return jsxRuntimeExports.jsx(Navigate,{to:Oe,replace:!0})}return Ee},SubscriptionEntry=()=>{const{isAuthenticated:Ee}=useSelector(Re=>Re.auth);return Ee?jsxRuntimeExports.jsx(SubscriptionPage,{}):jsxRuntimeExports.jsx(SignupLandingPage,{})},AppContent=()=>{const Ee=useDispatch(),{isAuthenticated:Re,user:Te,userFetched:je,photoError:Oe,tenantsFetched:Me}=useSelector(Be=>Be.auth),{tcLoaded:De}=useSelector(Be=>Be.user),$e=useSelector(selectIndustriesLoaded);return reactExports.useEffect(()=>{Re&&!Te&&!je&&Ee(getCurrentUser())},[Re,Te,je,Ee]),reactExports.useEffect(()=>{Re&&!Me&&Ee(fetchMyTenants())},[Re,Me,Ee]),reactExports.useEffect(()=>{Re&&Te&&!Te.photo_url&&!Oe&&Ee(getUserPhoto())},[Re,Te,Oe,Ee]),reactExports.useEffect(()=>{const Be=new URLSearchParams(window.location.search),Ue=[{param:"gdrive_bulk",channel:"gdrive_bulk_oauth",connected:"gdrive_bulk_connected",error:"gdrive_bulk_error"},{param:"sharepoint_bulk",channel:"sharepoint_bulk_oauth",connected:"sharepoint_bulk_connected",error:"sharepoint_bulk_error"}];for(const ze of Ue){const We=Be.get(ze.param);if(We){window.history.replaceState({},"",window.location.pathname);try{const Xe=new BroadcastChannel(ze.channel);Xe.postMessage({type:We==="connected"?ze.connected:ze.error}),Xe.close()}catch{}setTimeout(()=>{try{window.close()}catch{}},300);break}}},[]),reactExports.useEffect(()=>{Re&&!De&&Ee(fetchTCStatus())},[Re,De,Ee]),reactExports.useEffect(()=>{Re&&!$e&&Ee(fetchIndustries())},[Re,$e,Ee]),jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsxs(NavigationGuardProvider,{children:[jsxRuntimeExports.jsx(GoogleAnalytics,{}),jsxRuntimeExports.jsx(RouteTracker,{}),jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx(Loader,{fullScreen:!0}),children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"/maintenance",element:jsxRuntimeExports.jsx(MaintenancePage,{})}),jsxRuntimeExports.jsx(Route,{path:"/login",element:jsxRuntimeExports.jsx(RedirectIfAuthenticated,{children:jsxRuntimeExports.jsx(LoginPage,{})})}),jsxRuntimeExports.jsx(Route,{path:"/register",element:jsxRuntimeExports.jsx(RegisterPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/registration-pending",element:jsxRuntimeExports.jsx(RegistrationPendingPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/forgot-password",element:jsxRuntimeExports.jsx(ForgotPasswordPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/forgotPassword",element:jsxRuntimeExports.jsx(ResetPasswordPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/activate-account",element:jsxRuntimeExports.jsx(ActivateAccountPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/auth/callback",element:jsxRuntimeExports.jsx(SSOCallbackPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/subscription/campaign",element:jsxRuntimeExports.jsx(SubscriptionPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/subscription",element:jsxRuntimeExports.jsx(SubscriptionEntry,{})}),jsxRuntimeExports.jsx(Route,{path:"/subscription-preview",element:jsxRuntimeExports.jsx(SignupLandingPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/subscription/:plan",element:jsxRuntimeExports.jsx(SubscriptionPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/billing/success",element:jsxRuntimeExports.jsx(BillingSuccessHandler,{})}),jsxRuntimeExports.jsx(Route,{path:"/billing/cancel",element:jsxRuntimeExports.jsx(BillingSuccessHandler,{cancelled:!0})}),jsxRuntimeExports.jsx(Route,{path:"/privacy",element:jsxRuntimeExports.jsx(PrivacyPolicyPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/terms",element:jsxRuntimeExports.jsx(TermsAndConditionsPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/submit-ticket",element:jsxRuntimeExports.jsx(SubmitTicketPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/help",element:jsxRuntimeExports.jsx(HelpCenterPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/day10-survey/:token",element:jsxRuntimeExports.jsx(Day10SurveyPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/day10-survey",element:jsxRuntimeExports.jsx(Day10SurveyPage,{})}),jsxRuntimeExports.jsx(Route,{path:"/terms-acceptance",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(TermsAcceptancePage,{})})})}),jsxRuntimeExports.jsx(Route,{path:"/chat",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(ChatPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/agent-apps",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(AgentAppsPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/agent-schedules",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(AgentSchedulesPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/favorites",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(FavoritesPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/analytics",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(AnalyticsPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/profile",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(ProfilePage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/billing",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(BillingSettingsPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/documents/repository",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(DocumentRepositoryPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/documents/pending",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(PendingApprovalsPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/groups",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(GroupsPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/admin/*",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(Adm
4222inPage,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/platform/*",element:jsxRuntimeExports.jsx(MaintenanceGuard,{children:jsxRuntimeExports.jsx(ProtectedRoute,{requireAuth:!0,children:jsxRuntimeExports.jsx(ProtectedLayout,{children:jsxRuntimeExports.jsx(PlatformAdmin,{})})})})}),jsxRuntimeExports.jsx(Route,{path:"/",element:jsxRuntimeExports.jsx(SSOTokenHandler,{children:jsxRuntimeExports.jsx(Navigate,{to:"/documents/repository",replace:!0})})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx("div",{style:{textAlign:"center",padding:"50px"},children:jsxRuntimeExports.jsx("h1",{children:"404 - Page Not Found"})})})]})})]})})};function App(){return jsxRuntimeExports.jsx(Provider_default,{store,children:jsxRuntimeExports.jsx(PersistGate,{loading:jsxRuntimeExports.jsx(Loader,{fullScreen:!0}),persistor,children:jsxRuntimeExports.jsx(ThemeProvider,{children:jsxRuntimeExports.jsx(TourProvider,{children:jsxRuntimeExports.jsx(AppContent,{})})})})})}client.createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(React$3.StrictMode,{children:jsxRuntimeExports.jsx(App,{})}));export{STORAGE_KEYS as $,Alert as A,Box as B,Container as C,Divider as D,forgotPassword as E,FormControlLabel as F,Grid as G,clearError$a as H,InputAdornment as I,DocumentIcon as J,Chip as K,Loader as L,CheckCircle as M,acceptTermsAndConditions as N,fetchSubscription as O,Paper as P,getLoginRedirectPath as Q,logout as R,ROLES as S,Typography as T,useSearchParams as U,VisibilityIcon as V,googleLogin as W,microsoftLogin as X,useLocation as Y,useThemeMode as Z,authService as _,useNavigate as a,selectSubscriptionError as a$,clearApiCache as a0,setCredentials as a1,createSvgIcon$1 as a2,selectLicensePool as a3,selectSubscriptionLoading as a4,fetchLicensePool as a5,normalizeBillingCycle as a6,Tooltip as a7,Warning as a8,setPurchaseSourcePage as a9,Navigate as aA,getCurrentUser as aB,validateSSOEmail as aC,axios as aD,useParams as aE,Card as aF,CardContent as aG,FormLabel as aH,agentService as aI,SearchIcon as aJ,InputLabel as aK,Select as aL,MenuItem as aM,DocumentSelectionModal as aN,Switch as aO,interopRequireDefaultExports as aP,requireCreateSvgIcon as aQ,selectPendingSignupData as aR,confirmPayment as aS,clearPendingSignupData as aT,clearPurchaseSourcePage as aU,formatBillingCadence as aV,formatBillingCycle as aW,DownloadIcon as aX,Toast as aY,_typeof as aZ,selectSubscriptionActionLoading as a_,AddIcon as aa,ArrowForward$1 as ab,LinearProgress as ac,__vitePreload as ad,cachedAxios as ae,groupService as af,Stack as ag,GroupHierarchyPicker as ah,List as ai,ListItemButton as aj,ListItemIcon as ak,DatabaseIcon as al,ListItemText as am,FolderIcon as an,canUploadToGroup as ao,getGroupStableId as ap,fetchGroups as aq,FormControl as ar,CloudUpload as as,RadioGroup as at,Radio as au,InsertDriveFile as av,documentService as aw,clearRegistrationPending as ax,selectBlockedEmailDomains as ay,registerCompany as az,useSelector as b,ErrorIcon as b$,clearError$3 as b0,subscriptionService as b1,setPendingSignupData as b2,PropTypes as b3,hoistStatics as b4,generateUtilityClass as b5,generateUtilityClasses as b6,useDefaultProps as b7,_objectWithoutPropertiesLoose as b8,_extends$1 as b9,Menu as bA,webGroupService as bB,findDuplicateGroupName as bC,ExpandMoreIcon as bD,ChevronRight as bE,Collapse as bF,isSuperGroupAdminFlag as bG,selectFilteredFavorites as bH,selectFavorites as bI,selectFavoritesLoading as bJ,selectFavoritesError as bK,selectSearchQuery$1 as bL,fetchFavorites as bM,clearSearchQuery as bN,formatDate as bO,setSearchQuery$2 as bP,saveFavorite as bQ,editFavorite as bR,deleteFavorite as bS,bulkDeleteFavorites as bT,alpha$1 as bU,css as bV,keyframes as bW,isTenantAdminOrHigher as bX,websiteConnectionService as bY,getParentRefFromGroup as bZ,buildGroupChildTree as b_,styled as ba,clsx as bb,composeClasses as bc,canApproveDocuments as bd,getUploadApprovalStatus as be,fetchPendingDocuments as bf,clearError$9 as bg,canViewDocument as bh,CancelIcon as bi,DocumentPreviewModal as bj,Document as bk,Page as bl,canDownloadDocument as bm,renderAsync as bn,approveDocument as bo,rejectDocument as bp,fetchDocuments as bq,pdfjs as br,useTheme$1 as bs,extractGroupIds as bt,KeyboardArrowDown as bu,Person as bv,Language as bw,MoreVertIcon as bx,EditIcon as by,DeleteIcon as bz,clearError$b as c,getUserRole as c$,Transition as c0,useForkRef as c1,getReactElementRef as c2,getTransitionProps as c3,reflow as c4,Fade as c5,Grow as c6,selectCaptchaEnabled as c7,checkLockExpiry as c8,selectLoginAttempts as c9,updateUserProfile$1 as cA,fetchProfile as cB,getUserPhoto as cC,clearChangePasswordState as cD,changePassword as cE,updateEmailNotificationsPreference as cF,feedbackService as cG,FEEDBACK_REASON_CATEGORIES as cH,ThumbUpOffAlt as cI,ThumbDownOffAlt as cJ,fetchSessions as cK,CheckCircleOutline as cL,DOC_STATUS as cM,SvgIcon as cN,BusinessIcon as cO,upgradeSubscription as cP,createCheckoutSession as cQ,selectBillingHistory as cR,fetchBillingHistory$1 as cS,formatBilling
4222CycleShort as cT,clearUploadProgress as cU,formatFileSize as cV,FILE_UPLOAD as cW,truncateFilename as cX,getFileTypeDescription as cY,getUploadErrorMessage as cZ,selectFilteredDocuments as c_,Tabs as ca,Tab as cb,formatLockoutTime as cc,RECAPTCHA_SITE_KEY as cd,login as ce,clearAttempts as cf,recordFailedAttempt as cg,capitalize$1 as ch,lighten_1 as ci,darken_1 as cj,alpha_1 as ck,dbConnectionService as cl,ListItem as cm,SUPPORT_API_BASE_URL as cn,isTenantAllowedTool as co,useNavigationGuard as cp,Assessment as cq,Settings as cr,default_1 as cs,useRtl as ct,KeyboardArrowRight as cu,KeyboardArrowLeft as cv,useId as cw,InputBase as cx,isHostComponent as cy,selectIndustryOptions as cz,fetchLatestTC as d,clearSelectedGroup as d$,clearFilters$2 as d0,canAccessUploadScreen as d1,formatFileExtensions as d2,Mic as d3,Autocomplete as d4,SelectedChipsSummary as d5,setFilters as d6,canDeleteDocument as d7,setGridSettings as d8,VoiceNotesModal as d9,approveUserRequest as dA,rejectUserRequest as dB,selectFilteredUsers as dC,selectUserRequests as dD,selectLoading as dE,selectRequestsLoading as dF,selectSearchQuery as dG,selectRoleFilter as dH,selectStatusFilter as dI,clearFilters$1 as dJ,setSearchQuery$1 as dK,setRoleFilter as dL,Lock as dM,setSelectedUser as dN,unlockUser as dO,lockUser as dP,restoreUser as dQ,deleteUser as dR,suspendUser as dS,activateUser as dT,resendInvite as dU,cancelInvite as dV,selectGroupsActionLoading as dW,selectGroupsError as dX,createGroup as dY,selectSelectedGroup as dZ,collectDescendantIds as d_,isEnterprisePlan as da,deleteDocument as db,updateDocumentStatus as dc,useControlled as dd,ButtonBase as de,Slider as df,Send as dg,selectActionLoading as dh,selectError as di,selectAllGroups as dj,clearError$4 as dk,superGroupAdminService as dl,formatRestrictedGroupAdminCopy as dm,SGA_ONE_PER_GROUP_ERROR as dn,inviteUser as dp,fetchUsers as dq,fetchUserRequests as dr,selectSelectedUser as ds,selectUsers as dt,clearSelectedUser as du,syncSuperGroupAdminAfterRoleChange as dv,updateUser as dw,selectTenantMeta as dx,UserAvatar as dy,useMediaQuery as dz,userService as e,useThemeProps as e$,updateGroup as e0,selectGroupMembers as e1,addGroupMembers as e2,fetchGroupMembers as e3,Star as e4,StarBorder as e5,updateMemberRole as e6,removeGroupMember as e7,deleteGroup as e8,selectFilteredGroups as e9,createTenant as eA,updateTenant as eB,suspendTenant as eC,activateTenant as eD,deleteTenant as eE,fetchTenants as eF,Avatar as eG,fetchSubscriptionsOverview as eH,fetchBillingHistory as eI,platformAdminService as eJ,fetchAllPlans as eK,clearUpdateStatus as eL,updatePlan as eM,fetchStorageStats as eN,ImageIcon as eO,fetchHealthOverview as eP,fetchHealthResources as eQ,fetchHealthConnectivity as eR,SpeedIcon as eS,fetchHealthPerformance as eT,ToggleButtonGroup as eU,ToggleButton as eV,fetchAuditLogs as eW,fetchGeneralSettings as eX,updateGeneralSettings as eY,fetchRateLimits as eZ,updateRateLimits as e_,selectGroupsLoading as ea,selectSearchQuery$2 as eb,clearSearchQuery$1 as ec,setSearchQuery$3 as ed,setSelectedGroup as ee,tenantAdminService as ef,invariant as eg,downloadInvoice as eh,selectPlans as ei,downgradePlan as ej,cancelSubscription as ek,selectSubscription as el,selectUsage as em,fetchUsageStats as en,ChatIcon as eo,superAdminService as ep,Article as eq,selectIndustriesLoaded as er,fetchIndustries as es,Tune as et,OutlinedInput as eu,FilterList as ev,Code as ew,Routes as ex,Route as ey,useSlot as ez,fetchMaintenanceStatus as f,defaultTheme$1 as f0,THEME_ID as f1,usePreviousProps as f2,useSlotProps as f3,styled$1 as f4,useEnhancedEffect as f5,ownerDocument as f6,ClickAwayListener as f7,Popper as f8,MenuList as f9,AutoAwesome as fA,resolveMarkdownHref as fB,rewriteApiMarkdownLinks as fC,lighten$1 as fa,darken$1 as fb,useEventCallback as fc,FocusTrap as fd,switchClasses as fe,createFilterOptions as ff,debounce$1 as fg,ownerWindow as fh,ListContext as fi,createSlice as fj,prepareAutoBatched as fk,current as fl,reactIsExports as fm,shallowEqual as fn,createListenerMiddleware as fo,createAction as fp,configureStore as fq,combineReducers as fr,autoBatchEnhancer as fs,Provider_default as ft,Popover as fu,Drawer as fv,selectAvailableModels as fw,selectModelsLoading as fx,fetchAvailableModels as fy,ModelSelector as fz,Button as g,CircularProgress as h,TextField as i,IconButton as j,Checkbox as k,FormHelperText as l,Link as m,Link$1 as n,Dialog as o,DialogTitle as p,Close$1 as q,DialogContent as r,DialogActions as s,API_BASE_URL as t,useDispatch as u,register as v,CORPORATE_EMAIL_REQUIRED_MSG as w,validateCorporateEmail as x,clearForgotPasswordSuccess as y,ArrowBack as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.