From 8bb7938396e5618fbfbba7fc71b252f076783434 Mon Sep 17 00:00:00 2001 From: Andrew Wei Date: Tue, 29 Oct 2024 22:47:58 -0700 Subject: [PATCH 01/10] add pre-commit to clean up code --- .pre-commit-config.yaml | 16 +++++ .../@yarnpkg/plugin-interactive-tools.cjs | 6 +- .yarn/releases/yarn-3.7.0.cjs | 16 ++--- __mocks__/passage-user.ts | 2 +- .../migration.sql | 2 +- .../migration.sql | 10 +-- api/db/migrations/migration_lock.toml | 2 +- api/db/schema.prisma | 4 +- .../processValidationJson.ts | 10 +-- docker-compose.dev.yml | 2 +- docs/python-schema.md | 4 +- python/src/functions/create_archive.py | 5 +- .../generate_presigned_url_and_send_email.py | 67 ++++++++++--------- .../subrecipient_treasury_report_gen.py | 1 + python/src/functions/test_lambdas.py | 3 +- python/src/lib/email.py | 12 ++-- python/src/lib/s3_helper.py | 14 ++-- python/src/lib/treasury_generation_common.py | 1 + python/tests/test_create_archive.bats | 2 +- .../clear_group.sh | 2 +- scripts/sample_lambda.py | 4 +- terraform/datadog_metrics.tf | 2 +- terraform/variables.tf | 1 - .../NewOrganizationForm.tsx | 4 +- .../TableBuilder/DebouncedInput.tsx | 2 +- .../NewTreasuryGenerationForm.tsx | 2 +- web/src/index.css | 1 - web/src/scss/colors-base-tokens.scss | 2 +- web/src/scss/colors-semantic-tokens.scss | 10 +-- web/src/scss/custom.scss | 4 +- web/src/scss/fonts.scss | 2 +- web/src/scss/layouts.scss | 2 +- web/src/scss/tables.scss | 2 +- web/types/passage.d.ts | 2 +- 34 files changed, 122 insertions(+), 99 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..8a7f555a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,16 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.7.1 + hooks: + # Run the linter. + - id: ruff + args: [--fix] + # Run the formatter. + - id: ruff-format diff --git a/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs b/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs index bc2ca19f..eff0f6db 100644 --- a/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +++ b/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs @@ -43,7 +43,7 @@ function print() { __p += __j.call(arguments, '') } Add a component higher in the tree to provide a loading indicator or placeholder to display.`+Hr(B))}Me!==_0&&(Me=Kn),Z=Cl(Z,B),Rt=P;do{switch(Rt.tag){case 3:de=Z,Rt.effectTag|=4096,Rt.expirationTime=g;var je=_s(Rt,de,g);ua(Rt,je);break e;case 1:de=Z;var st=Rt.type,$t=Rt.stateNode;if((Rt.effectTag&64)===0&&(typeof st.getDerivedStateFromError=="function"||$t!==null&&typeof $t.componentDidCatch=="function"&&(mr===null||!mr.has($t)))){Rt.effectTag|=4096,Rt.expirationTime=g;var Wn=aa(Rt,de,g);ua(Rt,Wn);break e}}Rt=Rt.return}while(Rt!==null)}ie=yo(ie)}catch(oi){g=oi;continue}break}while(1)}function U0(){var _=Zu.current;return Zu.current=bo,_===null?bo:_}function cc(_,g){_Sn&&(Sn=_)}function _2(){for(;ie!==null;)ie=rd(ie)}function nd(){for(;ie!==null&&!$n();)ie=rd(ie)}function rd(_){var g=Ha(_.alternate,_,Pe);return _.memoizedProps=_.pendingProps,g===null&&(g=yo(_)),Es.current=null,g}function yo(_){ie=_;do{var g=ie.alternate;if(_=ie.return,(ie.effectTag&2048)===0){e:{var A=g;g=ie;var P=Pe,B=g.pendingProps;switch(g.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:eu(g.type)&&Q0(g);break;case 3:Je(g),Yi(g),B=g.stateNode,B.pendingContext&&(B.context=B.pendingContext,B.pendingContext=null),(A===null||A.child===null)&&$l(g)&&Qu(g),Qr(g);break;case 5:oe(g);var Z=$(Oe.current);if(P=g.type,A!==null&&g.stateNode!=null)qu(A,g,P,B,Z),A.ref!==g.ref&&(g.effectTag|=128);else if(B){if(A=$(Ce.current),$l(g)){if(B=g,!S)throw Error(t(175));A=su(B.stateNode,B.type,B.memoizedProps,Z,A,B),B.updateQueue=A,A=A!==null,A&&Qu(g)}else{var de=ce(P,B,Z,A,g);$r(de,g,!1,!1),g.stateNode=de,le(de,P,B,Z,A)&&Qu(g)}g.ref!==null&&(g.effectTag|=128)}else if(g.stateNode===null)throw Error(t(166));break;case 6:if(A&&g.stateNode!=null)xn(A,g,A.memoizedProps,B);else{if(typeof B!="string"&&g.stateNode===null)throw Error(t(166));if(A=$(Oe.current),Z=$(Ce.current),$l(g)){if(A=g,!S)throw Error(t(176));(A=ki(A.stateNode,A.memoizedProps,A))&&Qu(g)}else g.stateNode=nn(B,A,Z,g)}break;case 11:break;case 13:if(mi(qe,g),B=g.memoizedState,(g.effectTag&64)!==0){g.expirationTime=P;break e}B=B!==null,Z=!1,A===null?g.memoizedProps.fallback!==void 0&&$l(g):(P=A.memoizedState,Z=P!==null,B||P===null||(P=A.child.sibling,P!==null&&(de=g.firstEffect,de!==null?(g.firstEffect=P,P.nextEffect=de):(g.firstEffect=g.lastEffect=P,P.nextEffect=null),P.effectTag=8))),B&&!Z&&(g.mode&2)!==0&&(A===null&&g.memoizedProps.unstable_avoidThisFallback!==!0||(qe.current&1)!==0?Me===Li&&(Me=$u):((Me===Li||Me===$u)&&(Me=g0),Sn!==0&&fe!==null&&(Ol(fe,Pe),Ts(fe,Sn)))),Er&&B&&(g.effectTag|=4),Vt&&(B||Z)&&(g.effectTag|=4);break;case 7:break;case 8:break;case 12:break;case 4:Je(g),Qr(g);break;case 10:wu(g);break;case 9:break;case 14:break;case 17:eu(g.type)&&Q0(g);break;case 19:if(mi(qe,g),B=g.memoizedState,B===null)break;if(Z=(g.effectTag&64)!==0,de=B.rendering,de===null){if(Z)Lu(B,!1);else if(Me!==Li||A!==null&&(A.effectTag&64)!==0)for(A=g.child;A!==null;){if(de=rt(A),de!==null){for(g.effectTag|=64,Lu(B,!1),A=de.updateQueue,A!==null&&(g.updateQueue=A,g.effectTag|=4),B.lastEffect===null&&(g.firstEffect=null),g.lastEffect=B.lastEffect,A=P,B=g.child;B!==null;)Z=B,P=A,Z.effectTag&=2,Z.nextEffect=null,Z.firstEffect=null,Z.lastEffect=null,de=Z.alternate,de===null?(Z.childExpirationTime=0,Z.expirationTime=P,Z.child=null,Z.memoizedProps=null,Z.memoizedState=null,Z.updateQueue=null,Z.dependencies=null):(Z.childExpirationTime=de.childExpirationTime,Z.expirationTime=de.expirationTime,Z.child=de.child,Z.memoizedProps=de.memoizedProps,Z.memoizedState=de.memoizedState,Z.updateQueue=de.updateQueue,P=de.dependencies,Z.dependencies=P===null?null:{expirationTime:P.expirationTime,firstContext:P.firstContext,responders:P.responders}),B=B.sibling;en(qe,qe.current&1|2,g),g=g.child;break e}A=A.sibling}}else{if(!Z)if(A=rt(de),A!==null){if(g.effectTag|=64,Z=!0,A=A.updateQueue,A!==null&&(g.updateQueue=A,g.effectTag|=4),Lu(B,!0),B.tail===null&&B.tailMode==="hidden"&&!de.alternate){g=g.lastEffect=B.lastEffect,g!==null&&(g.nextEffect=null);break}}else h0()>B.tailExpiration&&1B&&(B=P),de>B&&(B=de),Z=Z.sibling;A.childExpirationTime=B}if(g!==null)return g;_!==null&&(_.effectTag&2048)===0&&(_.firstEffect===null&&(_.firstEffect=ie.firstEffect),ie.lastEffect!==null&&(_.lastEffect!==null&&(_.lastEffect.nextEffect=ie.firstEffect),_.lastEffect=ie.lastEffect),1_?g:_}function Rl(_){var g=hs();return co(99,ul.bind(null,_,g)),null}function ul(_,g){do qs();while(ti!==null);if((Ln&(nu|fu))!==Rr)throw Error(t(327));var A=_.finishedWork,P=_.finishedExpirationTime;if(A===null)return null;if(_.finishedWork=null,_.finishedExpirationTime=0,A===_.current)throw Error(t(177));_.callbackNode=null,_.callbackExpirationTime=0,_.callbackPriority=90,_.nextKnownPendingLevel=0;var B=qc(A);if(_.firstPendingTime=B,P<=_.lastSuspendedTime?_.firstSuspendedTime=_.lastSuspendedTime=_.nextKnownPendingLevel=0:P<=_.firstSuspendedTime&&(_.firstSuspendedTime=P-1),P<=_.lastPingedTime&&(_.lastPingedTime=0),P<=_.lastExpiredTime&&(_.lastExpiredTime=0),_===fe&&(ie=fe=null,Pe=0),1=A?Kt(_,g,A):(en(qe,qe.current&1,g),g=mu(_,g,A),g!==null?g.sibling:null);en(qe,qe.current&1,g);break;case 19:if(P=g.childExpirationTime>=A,(_.effectTag&64)!==0){if(P)return bn(_,g,A);g.effectTag|=64}if(B=g.memoizedState,B!==null&&(B.rendering=null,B.tail=null),en(qe,qe.current,g),!P)return null}return mu(_,g,A)}ho=!1}}else ho=!1;switch(g.expirationTime=0,g.tag){case 2:if(P=g.type,_!==null&&(_.alternate=null,g.alternate=null,g.effectTag|=2),_=g.pendingProps,B=Ru(g,Ai.current),Fo(g,A),B=un(null,g,P,_,B,A),g.effectTag|=1,typeof B=="object"&&B!==null&&typeof B.render=="function"&&B.$$typeof===void 0){if(g.tag=1,fn(),eu(P)){var Z=!0;li(g)}else Z=!1;g.memoizedState=B.state!==null&&B.state!==void 0?B.state:null;var de=P.getDerivedStateFromProps;typeof de=="function"&&Zl(g,P,de,_),B.updater=oa,g.stateNode=B,B._reactInternalFiber=g,Bs(g,P,_,A),g=tt(null,g,P,!0,Z,A)}else g.tag=0,Bi(null,g,B,A),g=g.child;return g;case 16:if(B=g.elementType,_!==null&&(_.alternate=null,g.alternate=null,g.effectTag|=2),_=g.pendingProps,Ae(B),B._status!==1)throw B._result;switch(B=B._result,g.type=B,Z=g.tag=ol(B),_=Yn(B,_),Z){case 0:g=to(null,g,B,_,A);break;case 1:g=xe(null,g,B,_,A);break;case 11:g=Ci(null,g,B,_,A);break;case 14:g=mf(null,g,B,Yn(B.type,_),P,A);break;default:throw Error(t(306,B,""))}return g;case 0:return P=g.type,B=g.pendingProps,B=g.elementType===P?B:Yn(P,B),to(_,g,P,B,A);case 1:return P=g.type,B=g.pendingProps,B=g.elementType===P?B:Yn(P,B),xe(_,g,P,B,A);case 3:if(Ke(g),P=g.updateQueue,P===null)throw Error(t(282));if(B=g.memoizedState,B=B!==null?B.element:null,S0(g,P,g.pendingProps,null,A),P=g.memoizedState.element,P===B)tu(),g=mu(_,g,A);else{if((B=g.stateNode.hydrate)&&(S?(Su=F0(g.stateNode.containerInfo),Xu=g,B=_i=!0):B=!1),B)for(A=Y(g,null,P,A),g.child=A;A;)A.effectTag=A.effectTag&-3|1024,A=A.sibling;else Bi(_,g,P,A),tu();g=g.child}return g;case 5:return vt(g),_===null&&Uo(g),P=g.type,B=g.pendingProps,Z=_!==null?_.memoizedProps:null,de=B.children,dt(P,B)?de=null:Z!==null&&dt(P,Z)&&(g.effectTag|=16),eo(_,g),g.mode&4&&A!==1&&At(P,B)?(g.expirationTime=g.childExpirationTime=1,g=null):(Bi(_,g,de,A),g=g.child),g;case 6:return _===null&&Uo(g),null;case 13:return Kt(_,g,A);case 4:return Ne(g,g.stateNode.containerInfo),P=g.pendingProps,_===null?g.child=H(g,null,P,A):Bi(_,g,P,A),g.child;case 11:return P=g.type,B=g.pendingProps,B=g.elementType===P?B:Yn(P,B),Ci(_,g,P,B,A);case 7:return Bi(_,g,g.pendingProps,A),g.child;case 8:return Bi(_,g,g.pendingProps.children,A),g.child;case 12:return Bi(_,g,g.pendingProps.children,A),g.child;case 10:e:{if(P=g.type._context,B=g.pendingProps,de=g.memoizedProps,Z=B.value,zu(g,Z),de!==null){var yt=de.value;if(Z=Fe(yt,Z)?0:(typeof P._calculateChangedBits=="function"?P._calculateChangedBits(yt,Z):1073741823)|0,Z===0){if(de.children===B.children&&!yi.current){g=mu(_,g,A);break e}}else for(yt=g.child,yt!==null&&(yt.return=g);yt!==null;){var Rt=yt.dependencies;if(Rt!==null){de=yt.child;for(var Nt=Rt.firstContext;Nt!==null;){if(Nt.context===P&&(Nt.observedBits&Z)!==0){yt.tag===1&&(Nt=v0(A,null),Nt.tag=2,J0(yt,Nt)),yt.expirationTime"u")return!1;var g=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(g.isDisabled||!g.supportsFiber)return!0;try{var A=g.inject(_);ca=function(P){try{g.onCommitFiberRoot(A,P,void 0,(P.current.effectTag&64)===64)}catch{}},ws=function(P){try{g.onCommitFiberUnmount(A,P)}catch{}}}catch{}return!0}function ts(_,g,A,P){this.tag=_,this.key=A,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=g,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=P,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Ho(_,g,A,P){return new ts(_,g,A,P)}function Ef(_){return _=_.prototype,!(!_||!_.isReactComponent)}function ol(_){if(typeof _=="function")return Ef(_)?1:0;if(_!=null){if(_=_.$$typeof,_===De)return 11;if(_===we)return 14}return 2}function Vu(_,g){var A=_.alternate;return A===null?(A=Ho(_.tag,g,_.key,_.mode),A.elementType=_.elementType,A.type=_.type,A.stateNode=_.stateNode,A.alternate=_,_.alternate=A):(A.pendingProps=g,A.effectTag=0,A.nextEffect=null,A.firstEffect=null,A.lastEffect=null),A.childExpirationTime=_.childExpirationTime,A.expirationTime=_.expirationTime,A.child=_.child,A.memoizedProps=_.memoizedProps,A.memoizedState=_.memoizedState,A.updateQueue=_.updateQueue,g=_.dependencies,A.dependencies=g===null?null:{expirationTime:g.expirationTime,firstContext:g.firstContext,responders:g.responders},A.sibling=_.sibling,A.index=_.index,A.ref=_.ref,A}function qa(_,g,A,P,B,Z){var de=2;if(P=_,typeof _=="function")Ef(_)&&(de=1);else if(typeof _=="string")de=5;else e:switch(_){case j:return n0(A.children,B,Z,g);case me:de=8,B|=7;break;case q:de=8,B|=1;break;case V:return _=Ho(12,A,g,B|8),_.elementType=V,_.type=V,_.expirationTime=Z,_;case ge:return _=Ho(13,A,g,B),_.type=ge,_.elementType=ge,_.expirationTime=Z,_;case ae:return _=Ho(19,A,g,B),_.elementType=ae,_.expirationTime=Z,_;default:if(typeof _=="object"&&_!==null)switch(_.$$typeof){case re:de=10;break e;case y:de=9;break e;case De:de=11;break e;case we:de=14;break e;case he:de=16,P=null;break e}throw Error(t(130,_==null?_:typeof _,""))}return g=Ho(de,A,g,B),g.elementType=_,g.type=P,g.expirationTime=Z,g}function n0(_,g,A,P){return _=Ho(7,_,P,g),_.expirationTime=A,_}function j0(_,g,A){return _=Ho(6,_,null,g),_.expirationTime=A,_}function Df(_,g,A){return g=Ho(4,_.children!==null?_.children:[],_.key,g),g.expirationTime=A,g.stateNode={containerInfo:_.containerInfo,pendingChildren:null,implementation:_.implementation},g}function Wc(_,g,A){this.tag=g,this.current=null,this.containerInfo=_,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=lr,this.pendingContext=this.context=null,this.hydrate=A,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function dc(_,g){var A=_.firstSuspendedTime;return _=_.lastSuspendedTime,A!==0&&A>=g&&_<=g}function Ol(_,g){var A=_.firstSuspendedTime,P=_.lastSuspendedTime;Ag||A===0)&&(_.lastSuspendedTime=g),g<=_.lastPingedTime&&(_.lastPingedTime=0),g<=_.lastExpiredTime&&(_.lastExpiredTime=0)}function Ts(_,g){g>_.firstPendingTime&&(_.firstPendingTime=g);var A=_.firstSuspendedTime;A!==0&&(g>=A?_.firstSuspendedTime=_.lastSuspendedTime=_.nextKnownPendingLevel=0:g>=_.lastSuspendedTime&&(_.lastSuspendedTime=g+1),g>_.nextKnownPendingLevel&&(_.nextKnownPendingLevel=g))}function da(_,g){var A=_.lastExpiredTime;(A===0||A>g)&&(_.lastExpiredTime=g)}function ud(_){var g=_._reactInternalFiber;if(g===void 0)throw typeof _.render=="function"?Error(t(188)):Error(t(268,Object.keys(_)));return _=Qe(g),_===null?null:_.stateNode}function pa(_,g){_=_.memoizedState,_!==null&&_.dehydrated!==null&&_.retryTime{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var _P=0;ec.__interactionsRef=null;ec.__subscriberRef=null;ec.unstable_clear=function(o){return o()};ec.unstable_getCurrent=function(){return null};ec.unstable_getThreadID=function(){return++_P};ec.unstable_trace=function(o,l,f){return f()};ec.unstable_wrap=function(o){return o};ec.unstable_subscribe=function(){};ec.unstable_unsubscribe=function(){}});var WS=nt(vu=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";Object.defineProperty(vu,"__esModule",{value:!0});var o=!0,l=0,f=0,h=0;vu.__interactionsRef=null,vu.__subscriberRef=null,o&&(vu.__interactionsRef={current:new Set},vu.__subscriberRef={current:null});function E(ae){if(!o)return ae();var we=vu.__interactionsRef.current;vu.__interactionsRef.current=new Set;try{return ae()}finally{vu.__interactionsRef.current=we}}function t(){return o?vu.__interactionsRef.current:null}function N(){return++h}function F(ae,we,he){var ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:l;if(!o)return he();var ue={__count:1,id:f++,name:ae,timestamp:we},Ae=vu.__interactionsRef.current,ze=new Set(Ae);ze.add(ue),vu.__interactionsRef.current=ze;var We=vu.__subscriberRef.current,gt;try{We!==null&&We.onInteractionTraced(ue)}finally{try{We!==null&&We.onWorkStarted(ze,ve)}finally{try{gt=he()}finally{vu.__interactionsRef.current=Ae;try{We!==null&&We.onWorkStopped(ze,ve)}finally{ue.__count--,We!==null&&ue.__count===0&&We.onInteractionScheduledWorkCompleted(ue)}}}}return gt}function k(ae){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;if(!o)return ae;var he=vu.__interactionsRef.current,ve=vu.__subscriberRef.current;ve!==null&&ve.onWorkScheduled(he,we),he.forEach(function(ze){ze.__count++});var ue=!1;function Ae(){var ze=vu.__interactionsRef.current;vu.__interactionsRef.current=he,ve=vu.__subscriberRef.current;try{var We;try{ve!==null&&ve.onWorkStarted(he,we)}finally{try{We=ae.apply(void 0,arguments)}finally{vu.__interactionsRef.current=ze,ve!==null&&ve.onWorkStopped(he,we)}}return We}finally{ue||(ue=!0,he.forEach(function(gt){gt.__count--,ve!==null&>.__count===0&&ve.onInteractionScheduledWorkCompleted(gt)}))}}return Ae.cancel=function(){ve=vu.__subscriberRef.current;try{ve!==null&&ve.onWorkCanceled(he,we)}finally{he.forEach(function(We){We.__count--,ve&&We.__count===0&&ve.onInteractionScheduledWorkCompleted(We)})}},Ae}var x=null;o&&(x=new Set);function j(ae){o&&(x.add(ae),x.size===1&&(vu.__subscriberRef.current={onInteractionScheduledWorkCompleted:re,onInteractionTraced:V,onWorkCanceled:ge,onWorkScheduled:y,onWorkStarted:me,onWorkStopped:De}))}function q(ae){o&&(x.delete(ae),x.size===0&&(vu.__subscriberRef.current=null))}function V(ae){var we=!1,he=null;if(x.forEach(function(ve){try{ve.onInteractionTraced(ae)}catch(ue){we||(we=!0,he=ue)}}),we)throw he}function re(ae){var we=!1,he=null;if(x.forEach(function(ve){try{ve.onInteractionScheduledWorkCompleted(ae)}catch(ue){we||(we=!0,he=ue)}}),we)throw he}function y(ae,we){var he=!1,ve=null;if(x.forEach(function(ue){try{ue.onWorkScheduled(ae,we)}catch(Ae){he||(he=!0,ve=Ae)}}),he)throw ve}function me(ae,we){var he=!1,ve=null;if(x.forEach(function(ue){try{ue.onWorkStarted(ae,we)}catch(Ae){he||(he=!0,ve=Ae)}}),he)throw ve}function De(ae,we){var he=!1,ve=null;if(x.forEach(function(ue){try{ue.onWorkStopped(ae,we)}catch(Ae){he||(he=!0,ve=Ae)}}),he)throw ve}function ge(ae,we){var he=!1,ve=null;if(x.forEach(function(ue){try{ue.onWorkCanceled(ae,we)}catch(Ae){he||(he=!0,ve=Ae)}}),he)throw ve}vu.unstable_clear=E,vu.unstable_getCurrent=t,vu.unstable_getThreadID=N,vu.unstable_trace=F,vu.unstable_wrap=k,vu.unstable_subscribe=j,vu.unstable_unsubscribe=q}()});var VS=nt((_H,vD)=>{"use strict";process.env.NODE_ENV==="production"?vD.exports=qS():vD.exports=WS()});var GS=nt((EH,Yy)=>{"use strict";process.env.NODE_ENV!=="production"&&(Yy.exports=function o(l){"use strict";var f=Py(),h=Mi(),E=XE(),t=z_(),N=VS(),F=0,k=1,x=2,j=3,q=4,V=5,re=6,y=7,me=8,De=9,ge=10,ae=11,we=12,he=13,ve=14,ue=15,Ae=16,ze=17,We=18,gt=19,_t=20,Qe=21,ot=function(){};ot=function(c,d){for(var D=arguments.length,C=new Array(D>2?D-2:0),O=2;O8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!c){if(typeof console<"u"){var z=C.map(function(se){return""+se});z.unshift("Warning: "+d),Function.prototype.apply.call(console.error,console,z)}try{var G=0,ne="Warning: "+d.replace(/%s/g,function(){return C[G++]});throw new Error(ne)}catch{}}};var Ve=ot;function Pt(c){return c._reactInternalFiber}function Jt(c,d){c._reactInternalFiber=d}var it=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;it.hasOwnProperty("ReactCurrentDispatcher")||(it.ReactCurrentDispatcher={current:null}),it.hasOwnProperty("ReactCurrentBatchConfig")||(it.ReactCurrentBatchConfig={suspense:null});var J=typeof Symbol=="function"&&Symbol.for,ce=J?Symbol.for("react.element"):60103,Re=J?Symbol.for("react.portal"):60106,le=J?Symbol.for("react.fragment"):60107,He=J?Symbol.for("react.strict_mode"):60108,dt=J?Symbol.for("react.profiler"):60114,At=J?Symbol.for("react.provider"):60109,nn=J?Symbol.for("react.context"):60110,an=J?Symbol.for("react.concurrent_mode"):60111,On=J?Symbol.for("react.forward_ref"):60112,lr=J?Symbol.for("react.suspense"):60113,ln=J?Symbol.for("react.suspense_list"):60120,Vt=J?Symbol.for("react.memo"):60115,Er=J?Symbol.for("react.lazy"):60116,S=J?Symbol.for("react.fundamental"):60117,zt=J?Symbol.for("react.responder"):60118,Xn=J?Symbol.for("react.scope"):60119,vr=typeof Symbol=="function"&&Symbol.iterator,jr="@@iterator";function fr(c){if(c===null||typeof c!="object")return null;var d=vr&&c[vr]||c[jr];return typeof d=="function"?d:null}var zr=Ve;zr=function(c,d){if(!c){for(var D=it.ReactDebugCurrentFrame,C=D.getStackAddendum(),O=arguments.length,z=new Array(O>2?O-2:0),G=2;G import('./MyComponent'))`,C),c._status=Ao,c._result=O}},function(C){c._status===c0&&(c._status=Jo,c._result=C)})}}function $o(c,d,D){var C=d.displayName||d.name||"";return c.displayName||(C!==""?D+"("+C+")":D)}function qt(c){if(c==null)return null;if(typeof c.tag=="number"&&Ve(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case le:return"Fragment";case Re:return"Portal";case dt:return"Profiler";case He:return"StrictMode";case lr:return"Suspense";case ln:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case nn:return"Context.Consumer";case At:return"Context.Provider";case On:return $o(c,c.render,"ForwardRef");case Vt:return qt(c.type);case Er:{var d=c,D=Fs(d);if(D)return qt(D);break}}return null}var xi=0,lu=1,vi=2,Dr=4,el=6,Y0=8,Bu=16,K0=32,Kr=64,Oo=128,Mo=256,F0=512,su=1024,ki=1028,Ps=932,Kl=2047,P0=2048,d0=4096,Hr=!0,Ri=!0,X0=!0,mi=!0,en=!0,In=!0,Ai=!1,yi=!1,Wt=!1,Ru=!1,eu=!1,Q0=!0,Yi=!1,Xl=!1,ko=!1,li=!1,ao=!1,Ql=it.ReactCurrentOwner;function No(c){var d=c,D=c;if(c.alternate)for(;d.return;)d=d.return;else{var C=d;do d=C,(d.effectTag&(vi|su))!==xi&&(D=d.return),C=d.return;while(C)}return d.tag===j?D:null}function Is(c){return No(c)===c}function $n(c){{var d=Ql.current;if(d!==null&&d.tag===k){var D=d,C=D.stateNode;C._warnedAboutRefsInRender||Ve(!1,"%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",qt(D.type)||"A component"),C._warnedAboutRefsInRender=!0}}var O=Pt(c);return O?No(O)===O:!1}function tl(c){if(No(c)!==c)throw Error("Unable to find node on an unmounted component.")}function fo(c){var d=c.alternate;if(!d){var D=No(c);if(D===null)throw Error("Unable to find node on an unmounted component.");return D!==c?null:c}for(var C=c,O=d;;){var z=C.return;if(z===null)break;var G=z.alternate;if(G===null){var ne=z.return;if(ne!==null){C=O=ne;continue}break}if(z.child===G.child){for(var se=z.child;se;){if(se===C)return tl(z),c;if(se===O)return tl(z),d;se=se.sibling}throw Error("Unable to find node on an unmounted component.")}if(C.return!==O.return)C=z,O=G;else{for(var Ue=!1,Xe=z.child;Xe;){if(Xe===C){Ue=!0,C=z,O=G;break}if(Xe===O){Ue=!0,O=z,C=G;break}Xe=Xe.sibling}if(!Ue){for(Xe=G.child;Xe;){if(Xe===C){Ue=!0,C=G,O=z;break}if(Xe===O){Ue=!0,O=G,C=z;break}Xe=Xe.sibling}if(!Ue)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(C.alternate!==O)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(C.tag!==j)throw Error("Unable to find node on an unmounted component.");return C.stateNode.current===C?c:d}function I0(c){var d=fo(c);if(!d)return null;for(var D=d;;){if(D.tag===V||D.tag===re)return D;if(D.child){D.child.return=D,D=D.child;continue}if(D===d)return null;for(;!D.sibling;){if(!D.return||D.return===d)return null;D=D.return}D.sibling.return=D.return,D=D.sibling}return null}function Sl(c){var d=fo(c);if(!d)return null;for(var D=d;;){if(D.tag===V||D.tag===re||Wt&&D.tag===_t)return D;if(D.child&&D.tag!==q){D.child.return=D,D=D.child;continue}if(D===d)return null;for(;!D.sibling;){if(!D.return||D.return===d)return null;D=D.return}D.sibling.return=D.return,D=D.sibling}return null}var Lo=l.getPublicInstance,St=l.getRootHostContext,Bt=l.getChildHostContext,Hn=l.prepareForCommit,qr=l.resetAfterCommit,Ki=l.createInstance,Xr=l.appendInitialChild,Au=l.finalizeInitialChildren,p0=l.prepareUpdate,Ni=l.shouldSetTextContent,h0=l.shouldDeprioritizeSubtree,hs=l.createTextInstance,Ct=l.setTimeout,co=l.clearTimeout,nl=l.noTimeout,Jl=l.now,Uu=l.isPrimaryRenderer,vs=l.warnsIfNotActing,b0=l.supportsMutation,Q=l.supportsPersistence,Se=l.supportsHydration,Fe=l.mountResponderInstance,Le=l.unmountResponderInstance,pt=l.getFundamentalComponentInstance,Yn=l.mountFundamentalComponent,Cn=l.shouldUpdateFundamentalComponent,cr=l.getInstanceFromNode,Si=l.appendChild,Ou=l.appendChildToContainer,ju=l.commitTextUpdate,zu=l.commitMount,wu=l.commitUpdate,Ti=l.insertBefore,Fo=l.insertInContainerBefore,Mu=l.removeChild,po=l.removeChildFromContainer,Hu=l.resetTextContent,Pa=l.hideInstance,v0=l.hideTextInstance,ia=l.unhideInstance,J0=l.unhideTextInstance,ua=l.updateFundamentalComponent,Ia=l.unmountFundamentalComponent,ms=l.cloneInstance,S0=l.createContainerChildSet,Qn=l.appendChildToContainerChildSet,ac=l.finalizeContainerChildren,si=l.replaceContainerChildren,Jr=l.cloneHiddenInstance,Zl=l.cloneHiddenTextInstance,oa=l.cloneInstance,pf=l.canHydrateInstance,bs=l.canHydrateTextInstance,ba=l.canHydrateSuspenseInstance,Bs=l.isSuspenseInstancePending,m0=l.isSuspenseInstanceFallback,Us=l.registerSuspenseInstanceRetry,zi=l.getNextHydratableSibling,U=l.getFirstHydratableChild,H=l.hydrateInstance,Y=l.hydrateTextInstance,ee=l.hydrateSuspenseInstance,Ce=l.getNextHydratableInstanceAfterSuspenseInstance,_e=l.commitHydratedContainer,Oe=l.commitHydratedSuspenseInstance,$=l.clearSuspenseBoundary,Ne=l.clearSuspenseBoundaryFromContainer,Je=l.didNotMatchHydratedContainerTextInstance,vt=l.didNotMatchHydratedTextInstance,oe=l.didNotHydrateContainerInstance,qe=l.didNotHydrateInstance,rt=l.didNotFindHydratableContainerInstance,xt=l.didNotFindHydratableContainerTextInstance,kt=l.didNotFindHydratableContainerSuspenseInstance,bt=l.didNotFindHydratableInstance,sn=l.didNotFindHydratableTextInstance,rn=l.didNotFindHydratableSuspenseInstance,Ft=/^(.*)[\\\/]/,Dn=function(c,d,D){var C="";if(d){var O=d.fileName,z=O.replace(Ft,"");if(/^index\./.test(z)){var G=O.match(Ft);if(G){var ne=G[1];if(ne){var se=ne.replace(Ft,"");z=se+"/"+z}}}C=" (at "+z+":"+d.lineNumber+")"}else D&&(C=" (created by "+D+")");return` in `+(c||"Unknown")+C},dr=it.ReactDebugCurrentFrame;function er(c){switch(c.tag){case j:case q:case re:case y:case ge:case De:return"";default:var d=c._debugOwner,D=c._debugSource,C=qt(c.type),O=null;return d&&(O=qt(d.type)),Dn(C,D,O)}}function Cr(c){var d="",D=c;do d+=er(D),D=D.return;while(D);return d}var Rn=null,Nr=null;function y0(){{if(Rn===null)return null;var c=Rn._debugOwner;if(c!==null&&typeof c<"u")return qt(c.type)}return null}function Lr(){return Rn===null?"":Cr(Rn)}function ut(){dr.getCurrentStack=null,Rn=null,Nr=null}function wt(c){dr.getCurrentStack=Lr,Rn=c,Nr=null}function et(c){Nr=c}var It="\u269B",un="\u26D4",fn=typeof performance<"u"&&typeof performance.mark=="function"&&typeof performance.clearMarks=="function"&&typeof performance.measure=="function"&&typeof performance.clearMeasures=="function",Jn=null,wr=null,au=null,ku=!1,T0=!1,Z0=!1,Nu=0,gi=0,Po=new Set,rl=function(c){return It+" "+c},hf=function(c,d){var D=d?un+" ":It+" ",C=d?" Warning: "+d:"";return""+D+c+C},Tl=function(c){performance.mark(rl(c))},vf=function(c){performance.clearMarks(rl(c))},Io=function(c,d,D){var C=rl(d),O=hf(c,D);try{performance.measure(O,C)}catch{}performance.clearMarks(C),performance.clearMeasures(O)},ys=function(c,d){return c+" (#"+d+")"},js=function(c,d,D){return D===null?c+" ["+(d?"update":"mount")+"]":c+"."+D},bo=function(c,d){var D=qt(c.type)||"Unknown",C=c._debugID,O=c.alternate!==null,z=js(D,O,d);if(ku&&Po.has(z))return!1;Po.add(z);var G=ys(z,C);return Tl(G),!0},Bo=function(c,d){var D=qt(c.type)||"Unknown",C=c._debugID,O=c.alternate!==null,z=js(D,O,d),G=ys(z,C);vf(G)},gs=function(c,d,D){var C=qt(c.type)||"Unknown",O=c._debugID,z=c.alternate!==null,G=js(C,z,d),ne=ys(G,O);Io(G,ne,D)},Xu=function(c){switch(c.tag){case j:case V:case re:case q:case y:case ge:case De:case me:return!0;default:return!1}},Su=function(){wr!==null&&au!==null&&Bo(au,wr),au=null,wr=null,Z0=!1},_i=function(){for(var c=Jn;c;)c._debugIsCurrentlyTiming&&gs(c,null,null),c=c.return},C0=function(c){c.return!==null&&C0(c.return),c._debugIsCurrentlyTiming&&bo(c,null)},$0=function(){Jn!==null&&C0(Jn)};function Uo(){Hr&&gi++}function la(){Hr&&(ku&&(T0=!0),wr!==null&&wr!=="componentWillMount"&&wr!=="componentWillReceiveProps"&&(Z0=!0))}function $l(c){if(Hr){if(!fn||Xu(c)||(Jn=c,!bo(c,null)))return;c._debugIsCurrentlyTiming=!0}}function tu(c){if(Hr){if(!fn||Xu(c))return;c._debugIsCurrentlyTiming=!1,Bo(c,null)}}function Zr(c){if(Hr){if(!fn||Xu(c)||(Jn=c.return,!c._debugIsCurrentlyTiming))return;c._debugIsCurrentlyTiming=!1,gs(c,null,null)}}function ho(c){if(Hr){if(!fn||Xu(c)||(Jn=c.return,!c._debugIsCurrentlyTiming))return;c._debugIsCurrentlyTiming=!1;var d=c.tag===he?"Rendering was suspended":"An error was thrown inside this error boundary";gs(c,null,d)}}function Bi(c,d){if(Hr){if(!fn||(Su(),!bo(c,d)))return;au=c,wr=d}}function Ci(){if(Hr){if(!fn)return;if(wr!==null&&au!==null){var c=Z0?"Scheduled a cascading update":null;gs(au,wr,c)}wr=null,au=null}}function mf(c){if(Hr){if(Jn=c,!fn)return;Nu=0,Tl("(React Tree Reconciliation)"),$0()}}function yf(c,d){if(Hr){if(!fn)return;var D=null;if(c!==null)if(c.tag===j)D="A top-level update interrupted the previous render";else{var C=qt(c.type)||"Unknown";D="An update to "+C+" interrupted the previous render"}else Nu>1&&(D="There were cascading updates");Nu=0;var O=d?"(React Tree Reconciliation: Completed Root)":"(React Tree Reconciliation: Yielded)";_i(),Io(O,"(React Tree Reconciliation)",D)}}function eo(){if(Hr){if(!fn)return;ku=!0,T0=!1,Po.clear(),Tl("(Committing Changes)")}}function to(){if(Hr){if(!fn)return;var c=null;T0?c="Lifecycle hook scheduled a cascading update":Nu>0&&(c="Caused by a cascading update in earlier commit"),T0=!1,Nu++,ku=!1,Po.clear(),Io("(Committing Changes)","(Committing Changes)",c)}}function xe(){if(Hr){if(!fn)return;gi=0,Tl("(Committing Snapshot Effects)")}}function tt(){if(Hr){if(!fn)return;var c=gi;gi=0,Io("(Committing Snapshot Effects: "+c+" Total)","(Committing Snapshot Effects)",null)}}function Ke(){if(Hr){if(!fn)return;gi=0,Tl("(Committing Host Effects)")}}function Yt(){if(Hr){if(!fn)return;var c=gi;gi=0,Io("(Committing Host Effects: "+c+" Total)","(Committing Host Effects)",null)}}function Kt(){if(Hr){if(!fn)return;gi=0,Tl("(Calling Lifecycle Methods)")}}function pr(){if(Hr){if(!fn)return;var c=gi;gi=0,Io("(Calling Lifecycle Methods: "+c+" Total)","(Calling Lifecycle Methods)",null)}}var Ei=[],bn;bn=[];var mu=-1;function Qu(c){return{current:c}}function $r(c,d){if(mu<0){Ve(!1,"Unexpected pop.");return}d!==bn[mu]&&Ve(!1,"Unexpected Fiber popped."),c.current=Ei[mu],Ei[mu]=null,bn[mu]=null,mu--}function Qr(c,d,D){mu++,Ei[mu]=c.current,bn[mu]=D,c.current=d}var qu;qu={};var xn={};Object.freeze(xn);var x0=Qu(xn),Lu=Qu(!1),ui=xn;function Cl(c,d,D){return li?xn:D&&Xi(d)?ui:x0.current}function zs(c,d,D){if(!li){var C=c.stateNode;C.__reactInternalMemoizedUnmaskedChildContext=d,C.__reactInternalMemoizedMaskedChildContext=D}}function Wu(c,d){if(li)return xn;var D=c.type,C=D.contextTypes;if(!C)return xn;var O=c.stateNode;if(O&&O.__reactInternalMemoizedUnmaskedChildContext===d)return O.__reactInternalMemoizedMaskedChildContext;var z={};for(var G in C)z[G]=d[G];{var ne=qt(D)||"Unknown";E(C,z,"context",ne,Lr)}return O&&zs(c,d,z),z}function sa(){return li?!1:Lu.current}function Xi(c){if(li)return!1;var d=c.childContextTypes;return d!=null}function Hs(c){li||($r(Lu,c),$r(x0,c))}function R0(c){li||($r(Lu,c),$r(x0,c))}function Hi(c,d,D){if(!li){if(x0.current!==xn)throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");Qr(x0,d,c),Qr(Lu,D,c)}}function A0(c,d,D){if(li)return D;var C=c.stateNode,O=d.childContextTypes;if(typeof C.getChildContext!="function"){{var z=qt(d)||"Unknown";qu[z]||(qu[z]=!0,Ve(!1,"%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.",z,z))}return D}var G;et("getChildContext"),Bi(c,"getChildContext"),G=C.getChildContext(),Ci(),et(null);for(var ne in G)if(!(ne in O))throw Error((qt(d)||"Unknown")+'.getChildContext(): key "'+ne+'" is not defined in childContextTypes.');{var se=qt(d)||"Unknown";E(O,G,"child context",se,Lr)}return f({},D,{},G)}function qi(c){if(li)return!1;var d=c.stateNode,D=d&&d.__reactInternalMemoizedMergedChildContext||xn;return ui=x0.current,Qr(x0,D,c),Qr(Lu,Lu.current,c),!0}function il(c,d,D){if(!li){var C=c.stateNode;if(!C)throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");if(D){var O=A0(c,d,ui);C.__reactInternalMemoizedMergedChildContext=O,$r(Lu,c),$r(x0,c),Qr(x0,O,c),Qr(Lu,D,c)}else $r(Lu,c),Qr(Lu,D,c)}}function xl(c){if(li)return xn;if(!(Is(c)&&c.tag===k))throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");var d=c;do{switch(d.tag){case j:return d.stateNode.context;case k:{var D=d.type;if(Xi(D))return d.stateNode.__reactInternalMemoizedMergedChildContext;break}}d=d.return}while(d!==null);throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.")}var B0=1,O0=2,vo=t.unstable_runWithPriority,Fu=t.unstable_scheduleCallback,Ju=t.unstable_cancelCallback,es=t.unstable_shouldYield,_s=t.unstable_requestPaint,aa=t.unstable_now,gf=t.unstable_getCurrentPriorityLevel,Zu=t.unstable_ImmediatePriority,Es=t.unstable_UserBlockingPriority,Rr=t.unstable_NormalPriority,no=t.unstable_LowPriority,nu=t.unstable_IdlePriority;if(In&&!(N.__interactionsRef!=null&&N.__interactionsRef.current!=null))throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling");var fu={},Li=99,ei=98,Kn=97,$u=96,g0=95,_0=90,Ln=es,fe=_s!==void 0?_s:function(){},ie=null,Pe=null,Me=!1,at=aa(),mt=at<1e4?aa:function(){return aa()-at};function Qt(){switch(gf()){case Zu:return Li;case Es:return ei;case Rr:return Kn;case no:return $u;case nu:return g0;default:throw Error("Unknown priority level.")}}function An(c){switch(c){case Li:return Zu;case ei:return Es;case Kn:return Rr;case $u:return no;case g0:return nu;default:throw Error("Unknown priority level.")}}function Sn(c,d){var D=An(c);return vo(D,d)}function _n(c,d,D){var C=An(c);return Fu(C,d,D)}function Tn(c){return ie===null?(ie=[c],Pe=Fu(Zu,Fi)):ie.push(c),fu}function ir(c){c!==fu&&Ju(c)}function Ut(){if(Pe!==null){var c=Pe;Pe=null,Ju(c)}Fi()}function Fi(){if(!Me&&ie!==null){Me=!0;var c=0;try{var d=!0,D=ie;Sn(Li,function(){for(;c1?d-1:0),C=1;C2?D-2:0),O=2;O0&&(ja.forEach(function(Lt){c.add(qt(Lt.type)||"Component"),ts.add(Lt.type)}),ja=[]);var d=new Set;za.length>0&&(za.forEach(function(Lt){d.add(qt(Lt.type)||"Component"),ts.add(Lt.type)}),za=[]);var D=new Set;Ha.length>0&&(Ha.forEach(function(Lt){D.add(qt(Lt.type)||"Component"),ts.add(Lt.type)}),Ha=[]);var C=new Set;ca.length>0&&(ca.forEach(function(Lt){C.add(qt(Lt.type)||"Component"),ts.add(Lt.type)}),ca=[]);var O=new Set;ws.length>0&&(ws.forEach(function(Lt){O.add(qt(Lt.type)||"Component"),ts.add(Lt.type)}),ws=[]);var z=new Set;if(Ss.length>0&&(Ss.forEach(function(Lt){z.add(qt(Lt.type)||"Component"),ts.add(Lt.type)}),Ss=[]),d.size>0){var G=zo(d);Ve(!1,`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details. @@ -156,10 +156,10 @@ act(() => { }); /* assert on the output */ -This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act%s`,qt(c.type),Cr(c))}var hy=py,Hp=!1;function vy(c){Hp===!1&&t.unstable_flushAllWithoutAsserting===void 0&&(c.mode&K||c.mode&ti?(Hp=!0,Ve(!1,`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: +This ensures that you're testing the behavior the user would see in the browser. Learn more at https://fb.me/react-wrap-tests-with-act%s`,qt(c.type),Cr(c))}var hy=py,Hp=!1;function vy(c){Hp===!1&&t.unstable_flushAllWithoutAsserting===void 0&&(c.mode&K||c.mode&ti?(Hp=!0,Ve(!1,`In Concurrent or Sync modes, the "scheduler" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: jest.mock('scheduler', () => require('scheduler/unstable_mock')); -For more info, visit https://fb.me/react-mock-scheduler`)):eu===!0&&(Hp=!0,Ve(!1,`Starting from React v17, the "scheduler" module will need to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: +For more info, visit https://fb.me/react-mock-scheduler`)):eu===!0&&(Hp=!0,Ve(!1,`Starting from React v17, the "scheduler" module will need to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: jest.mock('scheduler', () => require('scheduler/unstable_mock')); For more info, visit https://fb.me/react-mock-scheduler`)))}var Zs=null;function my(c){{var d=Qt();if((c.mode&ti)!==xi&&(d===ei||d===Li))for(var D=c;D!==null;){var C=D.alternate;if(C!==null)switch(D.tag){case k:var O=C.updateQueue;if(O!==null)for(var z=O.firstUpdate;z!==null;){var G=z.priority;if(G===ei||G===Li){Zs===null?Zs=new Set([qt(D.type)]):Zs.add(qt(D.type));break}z=z.next}break;case F:case ae:case ue:if(D.memoizedState!==null&&D.memoizedState.baseUpdate!==null)for(var ne=D.memoizedState.baseUpdate;ne!==null;){var se=ne.priority;if(se===ei||se===Li){Zs===null?Zs=new Set([qt(D.type)]):Zs.add(qt(D.type));break}if(ne.next===D.memoizedState.baseUpdate)break;ne=ne.next}break;default:break}D=D.return}}}function p(){if(Zs!==null){var c=[];Zs.forEach(function(d){return c.push(d)}),Zs=null,c.length>0&&Ve(!1,`%s triggered a user-blocking update that suspended. diff --git a/.yarn/releases/yarn-3.7.0.cjs b/.yarn/releases/yarn-3.7.0.cjs index d5174e5a..ec24a52b 100755 --- a/.yarn/releases/yarn-3.7.0.cjs +++ b/.yarn/releases/yarn-3.7.0.cjs @@ -78,7 +78,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e. `),type:tr.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i}We.performRuntimeChecks=qEe;function JEe(r,e,t){var i=[],n=!1,s=(0,Se.compact)((0,Se.flatten)((0,Se.mapValues)(r.modes,function(l){return l}))),o=(0,Se.reject)(s,function(l){return l[ko]===tr.Lexer.NA}),a=gj(t);return e&&(0,Se.forEach)(o,function(l){var c=cj(l,a);if(c!==!1){var u=uj(l,c),g={message:u,type:c.issue,tokenType:l};i.push(g)}else(0,Se.has)(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(n=!0):(0,_g.canMatchCharCode)(a,l.PATTERN)&&(n=!0)}),e&&!n&&i.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:tr.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),i}We.performWarningRuntimeChecks=JEe;function WEe(r){var e={},t=(0,Se.keys)(r);return(0,Se.forEach)(t,function(i){var n=r[i];if((0,Se.isArray)(n))e[i]=[];else throw Error("non exhaustive match")}),e}We.cloneEmptyGroups=WEe;function Mv(r){var e=r.PATTERN;if((0,Se.isRegExp)(e))return!1;if((0,Se.isFunction)(e))return!0;if((0,Se.has)(e,"exec"))return!0;if((0,Se.isString)(e))return!1;throw Error("non exhaustive match")}We.isCustomPattern=Mv;function lj(r){return(0,Se.isString)(r)&&r.length===1?r.charCodeAt(0):!1}We.isShortPattern=lj;We.LineTerminatorOptimizedTester={test:function(r){for(var e=r.length,t=this.lastIndex;t Token Type `)+(" Root cause: "+e.errMsg+`. @@ -101,8 +101,8 @@ but found: '`+a+"'";if(n)return o+n+l;var c=(0,$s.reduce)(e,function(p,d){return but found: '`+o+"'";if(i)return s+i+a;var l=(0,$s.map)(e,function(u){return"["+(0,$s.map)(u,function(g){return(0,tf.tokenLabel)(g)}).join(",")+"]"}),c=`expecting at least one iteration which starts with one of these possible Token sequences:: `+("<"+l.join(" ,")+">");return s+c+a}};Object.freeze(Da.defaultParserErrorProvider);Da.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(r,e){var t="Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+r.name+"<-";return t}};Da.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(r,e){function t(u){return u instanceof zv.Terminal?u.terminalType.name:u instanceof zv.NonTerminal?u.nonTerminalName:""}var i=r.name,n=(0,$s.first)(e),s=n.idx,o=(0,Xj.getProductionDslName)(n),a=t(n),l=s>0,c="->"+o+(l?s:"")+"<- "+(a?"with argument: ->"+a+"<-":"")+` - appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + appears more than once (`+e.length+" times) in the top level rule: ->"+i+`<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,` `),c},buildNamespaceConflictError:function(r){var e=`Namespace conflict found in grammar. `+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+r.name+`>. @@ -121,7 +121,7 @@ This could lead to an infinite loop.`;return t},buildTokenNameError:function(r){ `+(" inside <"+r.topLevelRule.name+`> Rule. has `+(r.alternation.definition.length+1)+" alternatives.");return e},buildLeftRecursionError:function(r){var e=r.topLevelRule.name,t=vIe.map(r.leftRecursionPath,function(s){return s.name}),i=e+" --> "+t.concat([e]).join(" --> "),n=`Left Recursion found in grammar. `+("rule: <"+e+`> can be invoked from itself (directly or indirectly) -`)+(`without consuming any Tokens. The grammar path that causes this is: +`)+(`without consuming any Tokens. The grammar path that causes this is: `+i+` `)+` To fix this refactor your grammar to remove the left recursion. see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return n},buildInvalidRuleNameError:function(r){return"deprecated"},buildDuplicateRuleNameError:function(r){var e;r.topLevelRule instanceof zv.Rule?e=r.topLevelRule.name:e=r.topLevelRule;var t="Duplicate definition, rule: ->"+e+"<- is already defined in the grammar: ->"+r.grammarName+"<-";return t}}});var $j=I(TA=>{"use strict";var xIe=TA&&TA.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(TA,"__esModule",{value:!0});TA.GastRefResolverVisitor=TA.resolveGrammar=void 0;var PIe=Yn(),Zj=Kt(),kIe=ef();function DIe(r,e){var t=new _j(r,e);return t.resolveRefs(),t.errors}TA.resolveGrammar=DIe;var _j=function(r){xIe(e,r);function e(t,i){var n=r.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=i,n.errors=[],n}return e.prototype.resolveRefs=function(){var t=this;(0,Zj.forEach)((0,Zj.values)(this.nameToTopRule),function(i){t.currTopLevel=i,i.accept(t)})},e.prototype.visitNonTerminal=function(t){var i=this.nameToTopRule[t.nonTerminalName];if(i)t.referencedRule=i;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:PIe.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(kIe.GAstVisitor);TA.GastRefResolverVisitor=_j});var Rd=I(Rr=>{"use strict";var Ic=Rr&&Rr.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Rr,"__esModule",{value:!0});Rr.nextPossibleTokensAfter=Rr.possiblePathsFrom=Rr.NextTerminalAfterAtLeastOneSepWalker=Rr.NextTerminalAfterAtLeastOneWalker=Rr.NextTerminalAfterManySepWalker=Rr.NextTerminalAfterManyWalker=Rr.AbstractNextTerminalAfterProductionWalker=Rr.NextAfterTokenWalker=Rr.AbstractNextPossibleTokensWalker=void 0;var eq=ly(),Lt=Kt(),RIe=Jv(),Pt=mn(),tq=function(r){Ic(e,r);function e(t,i){var n=r.call(this)||this;return n.topProd=t,n.path=i,n.possibleTokTypes=[],n.nextProductionName="",n.nextProductionOccurrence=0,n.found=!1,n.isAtEndOfPath=!1,n}return e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=(0,Lt.cloneArr)(this.path.ruleStack).reverse(),this.occurrenceStack=(0,Lt.cloneArr)(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(t,i){i===void 0&&(i=[]),this.found||r.prototype.walk.call(this,t,i)},e.prototype.walkProdRef=function(t,i,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var s=i.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,s)}},e.prototype.updateExpectedNext=function(){(0,Lt.isEmpty)(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(eq.RestWalker);Rr.AbstractNextPossibleTokensWalker=tq;var FIe=function(r){Ic(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.path=i,n.nextTerminalName="",n.nextTerminalOccurrence=0,n.nextTerminalName=n.path.lastTok.name,n.nextTerminalOccurrence=n.path.lastTokOccurrence,n}return e.prototype.walkTerminal=function(t,i,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var s=i.concat(n),o=new Pt.Alternative({definition:s});this.possibleTokTypes=(0,RIe.first)(o),this.found=!0}},e}(tq);Rr.NextAfterTokenWalker=FIe;var Dd=function(r){Ic(e,r);function e(t,i){var n=r.call(this)||this;return n.topRule=t,n.occurrence=i,n.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},n}return e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(eq.RestWalker);Rr.AbstractNextTerminalAfterProductionWalker=Dd;var NIe=function(r){Ic(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkMany=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Lt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Pt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkMany.call(this,t,i,n)},e}(Dd);Rr.NextTerminalAfterManyWalker=NIe;var TIe=function(r){Ic(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkManySep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Lt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Pt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkManySep.call(this,t,i,n)},e}(Dd);Rr.NextTerminalAfterManySepWalker=TIe;var LIe=function(r){Ic(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOne=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Lt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Pt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOne.call(this,t,i,n)},e}(Dd);Rr.NextTerminalAfterAtLeastOneWalker=LIe;var OIe=function(r){Ic(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.walkAtLeastOneSep=function(t,i,n){if(t.idx===this.occurrence){var s=(0,Lt.first)(i.concat(n));this.result.isEndOfRule=s===void 0,s instanceof Pt.Terminal&&(this.result.token=s.terminalType,this.result.occurrence=s.idx)}else r.prototype.walkAtLeastOneSep.call(this,t,i,n)},e}(Dd);Rr.NextTerminalAfterAtLeastOneSepWalker=OIe;function rq(r,e,t){t===void 0&&(t=[]),t=(0,Lt.cloneArr)(t);var i=[],n=0;function s(c){return c.concat((0,Lt.drop)(r,n+1))}function o(c){var u=rq(s(c),e,t);return i.concat(u)}for(;t.length=0;ue--){var ee=B.definition[ue],O={idx:d,def:ee.definition.concat((0,Lt.drop)(p)),ruleStack:m,occurrenceStack:y};g.push(O),g.push(o)}else if(B instanceof Pt.Alternative)g.push({idx:d,def:B.definition.concat((0,Lt.drop)(p)),ruleStack:m,occurrenceStack:y});else if(B instanceof Pt.Rule)g.push(KIe(B,d,m,y));else throw Error("non exhaustive match")}}return u}Rr.nextPossibleTokensAfter=MIe;function KIe(r,e,t,i){var n=(0,Lt.cloneArr)(t);n.push(r.name);var s=(0,Lt.cloneArr)(i);return s.push(1),{idx:e,def:r.definition,ruleStack:n,occurrenceStack:s}}});var Fd=I(zt=>{"use strict";var sq=zt&&zt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(zt,"__esModule",{value:!0});zt.areTokenCategoriesNotUsed=zt.isStrictPrefixOfPath=zt.containsPath=zt.getLookaheadPathsForOptionalProd=zt.getLookaheadPathsForOr=zt.lookAheadSequenceFromAlternatives=zt.buildSingleAlternativeLookaheadFunction=zt.buildAlternativesLookAheadFunc=zt.buildLookaheadFuncForOptionalProd=zt.buildLookaheadFuncForOr=zt.getProdType=zt.PROD_TYPE=void 0;var ir=Kt(),iq=Rd(),UIe=ly(),py=$g(),LA=mn(),HIe=ef(),ni;(function(r){r[r.OPTION=0]="OPTION",r[r.REPETITION=1]="REPETITION",r[r.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",r[r.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",r[r.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",r[r.ALTERNATION=5]="ALTERNATION"})(ni=zt.PROD_TYPE||(zt.PROD_TYPE={}));function GIe(r){if(r instanceof LA.Option)return ni.OPTION;if(r instanceof LA.Repetition)return ni.REPETITION;if(r instanceof LA.RepetitionMandatory)return ni.REPETITION_MANDATORY;if(r instanceof LA.RepetitionMandatoryWithSeparator)return ni.REPETITION_MANDATORY_WITH_SEPARATOR;if(r instanceof LA.RepetitionWithSeparator)return ni.REPETITION_WITH_SEPARATOR;if(r instanceof LA.Alternation)return ni.ALTERNATION;throw Error("non exhaustive match")}zt.getProdType=GIe;function YIe(r,e,t,i,n,s){var o=aq(r,e,t),a=Zv(o)?py.tokenStructuredMatcherNoCategories:py.tokenStructuredMatcher;return s(o,i,a,n)}zt.buildLookaheadFuncForOr=YIe;function jIe(r,e,t,i,n,s){var o=Aq(r,e,n,t),a=Zv(o)?py.tokenStructuredMatcherNoCategories:py.tokenStructuredMatcher;return s(o[0],a,i)}zt.buildLookaheadFuncForOptionalProd=jIe;function qIe(r,e,t,i){var n=r.length,s=(0,ir.every)(r,function(l){return(0,ir.every)(l,function(c){return c.length===1})});if(e)return function(l){for(var c=(0,ir.map)(l,function(P){return P.GATE}),u=0;u{"use strict";var _v=Jt&&Jt.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(Jt,"__esModule",{value:!0});Jt.checkPrefixAlternativesAmbiguities=Jt.validateSomeNonEmptyLookaheadPath=Jt.validateTooManyAlts=Jt.RepetionCollector=Jt.validateAmbiguousAlternationAlternatives=Jt.validateEmptyOrAlternative=Jt.getFirstNoneTerminal=Jt.validateNoLeftRecursion=Jt.validateRuleIsOverridden=Jt.validateRuleDoesNotAlreadyExist=Jt.OccurrenceValidationCollector=Jt.identifyProductionForDuplicates=Jt.validateGrammar=void 0;var _t=Kt(),Br=Kt(),No=Yn(),$v=Pd(),rf=Fd(),XIe=Rd(),eo=mn(),ex=ef();function ZIe(r,e,t,i,n){var s=_t.map(r,function(p){return _Ie(p,i)}),o=_t.map(r,function(p){return tx(p,p,i)}),a=[],l=[],c=[];(0,Br.every)(o,Br.isEmpty)&&(a=(0,Br.map)(r,function(p){return hq(p,i)}),l=(0,Br.map)(r,function(p){return pq(p,e,i)}),c=mq(r,e,i));var u=tye(r,t,i),g=(0,Br.map)(r,function(p){return Cq(p,i)}),h=(0,Br.map)(r,function(p){return fq(p,r,n,i)});return _t.flatten(s.concat(c,o,a,l,u,g,h))}Jt.validateGrammar=ZIe;function _Ie(r,e){var t=new gq;r.accept(t);var i=t.allProductions,n=_t.groupBy(i,cq),s=_t.pick(n,function(a){return a.length>1}),o=_t.map(_t.values(s),function(a){var l=_t.first(a),c=e.buildDuplicateFoundError(r,a),u=(0,$v.getProductionDslName)(l),g={message:c,type:No.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:r.name,dslName:u,occurrence:l.idx},h=uq(l);return h&&(g.parameter=h),g});return o}function cq(r){return(0,$v.getProductionDslName)(r)+"_#_"+r.idx+"_#_"+uq(r)}Jt.identifyProductionForDuplicates=cq;function uq(r){return r instanceof eo.Terminal?r.terminalType.name:r instanceof eo.NonTerminal?r.nonTerminalName:""}var gq=function(r){_v(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}(ex.GAstVisitor);Jt.OccurrenceValidationCollector=gq;function fq(r,e,t,i){var n=[],s=(0,Br.reduce)(e,function(a,l){return l.name===r.name?a+1:a},0);if(s>1){var o=i.buildDuplicateRuleNameError({topLevelRule:r,grammarName:t});n.push({message:o,type:No.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:r.name})}return n}Jt.validateRuleDoesNotAlreadyExist=fq;function $Ie(r,e,t){var i=[],n;return _t.contains(e,r)||(n="Invalid rule override, rule: ->"+r+"<- cannot be overridden in the grammar: ->"+t+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:No.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:r})),i}Jt.validateRuleIsOverridden=$Ie;function tx(r,e,t,i){i===void 0&&(i=[]);var n=[],s=Nd(e.definition);if(_t.isEmpty(s))return[];var o=r.name,a=_t.contains(s,r);a&&n.push({message:t.buildLeftRecursionError({topLevelRule:r,leftRecursionPath:i}),type:No.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:o});var l=_t.difference(s,i.concat([r])),c=_t.map(l,function(u){var g=_t.cloneArr(i);return g.push(u),tx(r,u,t,g)});return n.concat(_t.flatten(c))}Jt.validateNoLeftRecursion=tx;function Nd(r){var e=[];if(_t.isEmpty(r))return e;var t=_t.first(r);if(t instanceof eo.NonTerminal)e.push(t.referencedRule);else if(t instanceof eo.Alternative||t instanceof eo.Option||t instanceof eo.RepetitionMandatory||t instanceof eo.RepetitionMandatoryWithSeparator||t instanceof eo.RepetitionWithSeparator||t instanceof eo.Repetition)e=e.concat(Nd(t.definition));else if(t instanceof eo.Alternation)e=_t.flatten(_t.map(t.definition,function(o){return Nd(o.definition)}));else if(!(t instanceof eo.Terminal))throw Error("non exhaustive match");var i=(0,$v.isOptionalProd)(t),n=r.length>1;if(i&&n){var s=_t.drop(r);return e.concat(Nd(s))}else return e}Jt.getFirstNoneTerminal=Nd;var rx=function(r){_v(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.alternations=[],t}return e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}(ex.GAstVisitor);function hq(r,e){var t=new rx;r.accept(t);var i=t.alternations,n=_t.reduce(i,function(s,o){var a=_t.dropRight(o.definition),l=_t.map(a,function(c,u){var g=(0,XIe.nextPossibleTokensAfter)([c],[],null,1);return _t.isEmpty(g)?{message:e.buildEmptyAlternationError({topLevelRule:r,alternation:o,emptyChoiceIdx:u}),type:No.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:r.name,occurrence:o.idx,alternative:u+1}:null});return s.concat(_t.compact(l))},[]);return n}Jt.validateEmptyOrAlternative=hq;function pq(r,e,t){var i=new rx;r.accept(i);var n=i.alternations;n=(0,Br.reject)(n,function(o){return o.ignoreAmbiguities===!0});var s=_t.reduce(n,function(o,a){var l=a.idx,c=a.maxLookahead||e,u=(0,rf.getLookaheadPathsForOr)(l,r,c,a),g=eye(u,a,r,t),h=Eq(u,a,r,t);return o.concat(g,h)},[]);return s}Jt.validateAmbiguousAlternationAlternatives=pq;var dq=function(r){_v(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.allProductions=[],t}return e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}(ex.GAstVisitor);Jt.RepetionCollector=dq;function Cq(r,e){var t=new rx;r.accept(t);var i=t.alternations,n=_t.reduce(i,function(s,o){return o.definition.length>255&&s.push({message:e.buildTooManyAlternativesError({topLevelRule:r,alternation:o}),type:No.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:r.name,occurrence:o.idx}),s},[]);return n}Jt.validateTooManyAlts=Cq;function mq(r,e,t){var i=[];return(0,Br.forEach)(r,function(n){var s=new dq;n.accept(s);var o=s.allProductions;(0,Br.forEach)(o,function(a){var l=(0,rf.getProdType)(a),c=a.maxLookahead||e,u=a.idx,g=(0,rf.getLookaheadPathsForOptionalProd)(u,n,l,c),h=g[0];if((0,Br.isEmpty)((0,Br.flatten)(h))){var p=t.buildEmptyRepetitionError({topLevelRule:n,repetition:a});i.push({message:p,type:No.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:n.name})}})}),i}Jt.validateSomeNonEmptyLookaheadPath=mq;function eye(r,e,t,i){var n=[],s=(0,Br.reduce)(r,function(a,l,c){return e.definition[c].ignoreAmbiguities===!0||(0,Br.forEach)(l,function(u){var g=[c];(0,Br.forEach)(r,function(h,p){c!==p&&(0,rf.containsPath)(h,u)&&e.definition[p].ignoreAmbiguities!==!0&&g.push(p)}),g.length>1&&!(0,rf.containsPath)(n,u)&&(n.push(u),a.push({alts:g,path:u}))}),a},[]),o=_t.map(s,function(a){var l=(0,Br.map)(a.alts,function(u){return u+1}),c=i.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:a.path});return{message:c,type:No.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:[a.alts]}});return o}function Eq(r,e,t,i){var n=[],s=(0,Br.reduce)(r,function(o,a,l){var c=(0,Br.map)(a,function(u){return{idx:l,path:u}});return o.concat(c)},[]);return(0,Br.forEach)(s,function(o){var a=e.definition[o.idx];if(a.ignoreAmbiguities!==!0){var l=o.idx,c=o.path,u=(0,Br.findAll)(s,function(h){return e.definition[h.idx].ignoreAmbiguities!==!0&&h.idx{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.validateGrammar=nf.resolveGrammar=void 0;var nx=Kt(),rye=$j(),iye=ix(),Iq=kd();function nye(r){r=(0,nx.defaults)(r,{errMsgProvider:Iq.defaultGrammarResolverErrorProvider});var e={};return(0,nx.forEach)(r.rules,function(t){e[t.name]=t}),(0,rye.resolveGrammar)(e,r.errMsgProvider)}nf.resolveGrammar=nye;function sye(r){return r=(0,nx.defaults)(r,{errMsgProvider:Iq.defaultGrammarValidatorErrorProvider}),(0,iye.validateGrammar)(r.rules,r.maxLookahead,r.tokenTypes,r.errMsgProvider,r.grammarName)}nf.validateGrammar=sye});var sf=I(In=>{"use strict";var Td=In&&In.__extends||function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}();Object.defineProperty(In,"__esModule",{value:!0});In.EarlyExitException=In.NotAllInputParsedException=In.NoViableAltException=In.MismatchedTokenException=In.isRecognitionException=void 0;var oye=Kt(),wq="MismatchedTokenException",Bq="NoViableAltException",Qq="EarlyExitException",bq="NotAllInputParsedException",Sq=[wq,Bq,Qq,bq];Object.freeze(Sq);function aye(r){return(0,oye.contains)(Sq,r.name)}In.isRecognitionException=aye;var dy=function(r){Td(e,r);function e(t,i){var n=this.constructor,s=r.call(this,t)||this;return s.token=i,s.resyncedTokens=[],Object.setPrototypeOf(s,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(s,s.constructor),s}return e}(Error),Aye=function(r){Td(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=wq,s}return e}(dy);In.MismatchedTokenException=Aye;var lye=function(r){Td(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=Bq,s}return e}(dy);In.NoViableAltException=lye;var cye=function(r){Td(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.name=bq,n}return e}(dy);In.NotAllInputParsedException=cye;var uye=function(r){Td(e,r);function e(t,i,n){var s=r.call(this,t,i)||this;return s.previousToken=n,s.name=Qq,s}return e}(dy);In.EarlyExitException=uye});var ox=I(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.attemptInRepetitionRecovery=Ki.Recoverable=Ki.InRuleRecoveryException=Ki.IN_RULE_RECOVERY_EXCEPTION=Ki.EOF_FOLLOW_KEY=void 0;var Cy=NA(),gs=Kt(),gye=sf(),fye=Wv(),hye=Yn();Ki.EOF_FOLLOW_KEY={};Ki.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException";function sx(r){this.name=Ki.IN_RULE_RECOVERY_EXCEPTION,this.message=r}Ki.InRuleRecoveryException=sx;sx.prototype=Error.prototype;var pye=function(){function r(){}return r.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=(0,gs.has)(e,"recoveryEnabled")?e.recoveryEnabled:hye.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=vq)},r.prototype.getTokenToInsert=function(e){var t=(0,Cy.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},r.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},r.prototype.tryInRepetitionRecovery=function(e,t,i,n){for(var s=this,o=this.findReSyncTokenType(),a=this.exportLexerState(),l=[],c=!1,u=this.LA(1),g=this.LA(1),h=function(){var p=s.LA(0),d=s.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:u,previous:p,ruleName:s.getCurrRuleFullName()}),m=new gye.MismatchedTokenException(d,u,s.LA(0));m.resyncedTokens=(0,gs.dropRight)(l),s.SAVE_ERROR(m)};!c;)if(this.tokenMatcher(g,n)){h();return}else if(i.call(this)){h(),e.apply(this,t);return}else this.tokenMatcher(g,o)?c=!0:(g=this.SKIP_TOKEN(),this.addToResyncTokens(g,l));this.importLexerState(a)},r.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,i){return!(i===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},r.prototype.getFollowsForInRuleRecovery=function(e,t){var i=this.getCurrentGrammarPath(e,t),n=this.getNextPossibleTokenTypes(i);return n},r.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t)){var i=this.getTokenToInsert(e);return i}if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new sx("sad sad panda")},r.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},r.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var i=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||(0,gs.isEmpty)(t))return!1;var n=this.LA(1),s=(0,gs.find)(t,function(o){return i.tokenMatcher(n,o)})!==void 0;return s},r.prototype.canRecoverWithSingleTokenDeletion=function(e){var t=this.tokenMatcher(this.LA(2),e);return t},r.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),i=this.getFollowSetFromFollowKey(t);return(0,gs.contains)(i,e)},r.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),i=2;;){var n=t.tokenType;if((0,gs.contains)(e,n))return n;t=this.LA(i),i++}},r.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return Ki.EOF_FOLLOW_KEY;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),i=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(i)}},r.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return(0,gs.map)(t,function(n,s){return s===0?Ki.EOF_FOLLOW_KEY:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:i[s],inRule:e.shortRuleNameToFullName(t[s-1])}})},r.prototype.flattenFollowSet=function(){var e=this,t=(0,gs.map)(this.buildFullFollowKeyStack(),function(i){return e.getFollowSetFromFollowKey(i)});return(0,gs.flatten)(t)},r.prototype.getFollowSetFromFollowKey=function(e){if(e===Ki.EOF_FOLLOW_KEY)return[Cy.EOF];var t=e.ruleName+e.idxInCallingRule+fye.IN+e.inRule;return this.resyncFollows[t]},r.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,Cy.EOF)||t.push(e),t},r.prototype.reSyncTo=function(e){for(var t=[],i=this.LA(1);this.tokenMatcher(i,e)===!1;)i=this.SKIP_TOKEN(),this.addToResyncTokens(i,t);return(0,gs.dropRight)(t)},r.prototype.attemptInRepetitionRecovery=function(e,t,i,n,s,o,a){},r.prototype.getCurrentGrammarPath=function(e,t){var i=this.getHumanReadableRuleStack(),n=(0,gs.cloneArr)(this.RULE_OCCURRENCE_STACK),s={ruleStack:i,occurrenceStack:n,lastTok:e,lastTokOccurrence:t};return s},r.prototype.getHumanReadableRuleStack=function(){var e=this;return(0,gs.map)(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},r}();Ki.Recoverable=pye;function vq(r,e,t,i,n,s,o){var a=this.getKeyForAutomaticLookahead(i,n),l=this.firstAfterRepMap[a];if(l===void 0){var c=this.getCurrRuleFullName(),u=this.getGAstProductions()[c],g=new s(u,n);l=g.startWalking(),this.firstAfterRepMap[a]=l}var h=l.token,p=l.occurrence,d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&h===void 0&&(h=Cy.EOF,p=1),this.shouldInRepetitionRecoveryBeTried(h,p,o)&&this.tryInRepetitionRecovery(r,e,t,h)}Ki.attemptInRepetitionRecovery=vq});var my=I(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.getKeyForAutomaticLookahead=Yt.AT_LEAST_ONE_SEP_IDX=Yt.MANY_SEP_IDX=Yt.AT_LEAST_ONE_IDX=Yt.MANY_IDX=Yt.OPTION_IDX=Yt.OR_IDX=Yt.BITS_FOR_ALT_IDX=Yt.BITS_FOR_RULE_IDX=Yt.BITS_FOR_OCCURRENCE_IDX=Yt.BITS_FOR_METHOD_TYPE=void 0;Yt.BITS_FOR_METHOD_TYPE=4;Yt.BITS_FOR_OCCURRENCE_IDX=8;Yt.BITS_FOR_RULE_IDX=12;Yt.BITS_FOR_ALT_IDX=8;Yt.OR_IDX=1<{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.LooksAhead=void 0;var Ra=Fd(),to=Kt(),xq=Yn(),Fa=my(),yc=Pd(),Cye=function(){function r(){}return r.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=(0,to.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:xq.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=(0,to.has)(e,"maxLookahead")?e.maxLookahead:xq.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=(0,to.isES2015MapSupported)()?new Map:[],(0,to.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},r.prototype.preComputeLookaheadFunctions=function(e){var t=this;(0,to.forEach)(e,function(i){t.TRACE_INIT(i.name+" Rule Lookahead",function(){var n=(0,yc.collectMethods)(i),s=n.alternation,o=n.repetition,a=n.option,l=n.repetitionMandatory,c=n.repetitionMandatoryWithSeparator,u=n.repetitionWithSeparator;(0,to.forEach)(s,function(g){var h=g.idx===0?"":g.idx;t.TRACE_INIT(""+(0,yc.getProductionDslName)(g)+h,function(){var p=(0,Ra.buildLookaheadFuncForOr)(g.idx,i,g.maxLookahead||t.maxLookahead,g.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),d=(0,Fa.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[i.name],Fa.OR_IDX,g.idx);t.setLaFuncCache(d,p)})}),(0,to.forEach)(o,function(g){t.computeLookaheadFunc(i,g.idx,Fa.MANY_IDX,Ra.PROD_TYPE.REPETITION,g.maxLookahead,(0,yc.getProductionDslName)(g))}),(0,to.forEach)(a,function(g){t.computeLookaheadFunc(i,g.idx,Fa.OPTION_IDX,Ra.PROD_TYPE.OPTION,g.maxLookahead,(0,yc.getProductionDslName)(g))}),(0,to.forEach)(l,function(g){t.computeLookaheadFunc(i,g.idx,Fa.AT_LEAST_ONE_IDX,Ra.PROD_TYPE.REPETITION_MANDATORY,g.maxLookahead,(0,yc.getProductionDslName)(g))}),(0,to.forEach)(c,function(g){t.computeLookaheadFunc(i,g.idx,Fa.AT_LEAST_ONE_SEP_IDX,Ra.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,g.maxLookahead,(0,yc.getProductionDslName)(g))}),(0,to.forEach)(u,function(g){t.computeLookaheadFunc(i,g.idx,Fa.MANY_SEP_IDX,Ra.PROD_TYPE.REPETITION_WITH_SEPARATOR,g.maxLookahead,(0,yc.getProductionDslName)(g))})})})},r.prototype.computeLookaheadFunc=function(e,t,i,n,s,o){var a=this;this.TRACE_INIT(""+o+(t===0?"":t),function(){var l=(0,Ra.buildLookaheadFuncForOptionalProd)(t,e,s||a.maxLookahead,a.dynamicTokensEnabled,n,a.lookAheadBuilderForOptional),c=(0,Fa.getKeyForAutomaticLookahead)(a.fullRuleNameToShort[e.name],i,t);a.setLaFuncCache(c,l)})},r.prototype.lookAheadBuilderForOptional=function(e,t,i){return(0,Ra.buildSingleAlternativeLookaheadFunction)(e,t,i)},r.prototype.lookAheadBuilderForAlternatives=function(e,t,i,n){return(0,Ra.buildAlternativesLookAheadFunc)(e,t,i,n)},r.prototype.getKeyForAutomaticLookahead=function(e,t){var i=this.getLastExplicitRuleShortName();return(0,Fa.getKeyForAutomaticLookahead)(i,e,t)},r.prototype.getLaFuncFromCache=function(e){},r.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},r.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},r.prototype.setLaFuncCache=function(e,t){},r.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},r.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},r}();Ey.LooksAhead=Cye});var kq=I(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.addNoneTerminalToCst=To.addTerminalToCst=To.setNodeLocationFull=To.setNodeLocationOnlyOffset=void 0;function mye(r,e){isNaN(r.startOffset)===!0?(r.startOffset=e.startOffset,r.endOffset=e.endOffset):r.endOffset{"use strict";Object.defineProperty(OA,"__esModule",{value:!0});OA.defineNameProp=OA.functionName=OA.classNameFromInstance=void 0;var wye=Kt();function Bye(r){return Rq(r.constructor)}OA.classNameFromInstance=Bye;var Dq="name";function Rq(r){var e=r.name;return e||"anonymous"}OA.functionName=Rq;function Qye(r,e){var t=Object.getOwnPropertyDescriptor(r,Dq);return(0,wye.isUndefined)(t)||t.configurable?(Object.defineProperty(r,Dq,{enumerable:!1,configurable:!0,writable:!1,value:e}),!0):!1}OA.defineNameProp=Qye});var Oq=I(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.validateRedundantMethods=vi.validateMissingCstMethods=vi.validateVisitor=vi.CstVisitorDefinitionError=vi.createBaseVisitorConstructorWithDefaults=vi.createBaseSemanticVisitorConstructor=vi.defaultVisit=void 0;var fs=Kt(),Ld=ax();function Fq(r,e){for(var t=(0,fs.keys)(r),i=t.length,n=0;n: @@ -168,7 +168,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis