cueframe 0.4.8 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cueframe.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{A as G,B as L,C as ve,D as y,E as v,F as c,G as Jt,H as E,I as H,J as O,K as h,L as b,M as Qs,N as d,O as yr,P as re,Q as ue,R as Ce,S as V,T as se,U as K,V as Ee,W as Je,X as ge,Y as Np,a as Ve,b as Op,c as qe,d as Mp,e as kp,f as Pp,g as Lp,h as Dp,i as Rt,j as gr,k as wt,l as Yt,m as vp,n as Co,o as B,p as q,q as Oe,r as N,s as Qt,t as Fp,u as br,v as n,w as xe,x as i,y as A,z as P}from"./chunk-EGBS3VAH.js";import{a as vf,b as X,c as Ff}from"./chunk-MCQRX24V.js";var tf=vf(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});function Vce(o,e){if(o==null)return{};var t={};for(var r in o)if({}.hasOwnProperty.call(o,r)){if(e.indexOf(r)!==-1)continue;t[r]=o[r]}return t}var At=class{constructor(e,t,r){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=t,this.index=r}},zo=class{constructor(e,t){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=t}};function je(o,e){let{line:t,column:r,index:s}=o;return new At(t,r+e,s+e)}var Ih="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Uce={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Ih},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Ih}},Rh={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Hs=o=>o.type==="UpdateExpression"?Rh.UpdateExpression[`${o.prefix}`]:Rh[o.type],Hce={AccessorIsGenerator:({kind:o})=>`A ${o}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:o})=>`Missing initializer in ${o} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:o})=>`\`${o}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:o,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
2
+ import{A as G,B as L,C as ve,D as y,E as v,F as c,G as Jt,H as E,I as H,J as O,K as h,L as b,M as Qs,N as d,O as yr,P as re,Q as ue,R as Ce,S as V,T as se,U as K,V as Ee,W as Je,X as ge,Y as Np,a as Ve,b as Op,c as qe,d as Mp,e as kp,f as Pp,g as Lp,h as Dp,i as Rt,j as gr,k as wt,l as Yt,m as vp,n as Co,o as B,p as q,q as Oe,r as N,s as Qt,t as Fp,u as br,v as n,w as xe,x as i,y as A,z as P}from"./chunk-HFZRI4NX.js";import{a as vf,b as X,c as Ff}from"./chunk-MCQRX24V.js";var tf=vf(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});function Vce(o,e){if(o==null)return{};var t={};for(var r in o)if({}.hasOwnProperty.call(o,r)){if(e.indexOf(r)!==-1)continue;t[r]=o[r]}return t}var At=class{constructor(e,t,r){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=t,this.index=r}},zo=class{constructor(e,t){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=t}};function je(o,e){let{line:t,column:r,index:s}=o;return new At(t,r+e,s+e)}var Ih="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Uce={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Ih},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Ih}},Rh={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Hs=o=>o.type==="UpdateExpression"?Rh.UpdateExpression[`${o.prefix}`]:Rh[o.type],Hce={AccessorIsGenerator:({kind:o})=>`A ${o}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:o})=>`Missing initializer in ${o} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:o})=>`\`${o}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:o,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
3
3
  - Did you mean \`export { '${o}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:o})=>`'${o==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:o})=>`Unsyntactic ${o==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:o})=>`A string literal cannot be used as an imported binding.
4
4
  - Did you mean \`import { "${o}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:o})=>`Expected number in radix ${o}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:o})=>`Escape sequence in keyword ${o}.`,InvalidIdentifier:({identifierName:o})=>`Invalid identifier ${o}.`,InvalidLhs:({ancestor:o})=>`Invalid left-hand side in ${Hs(o)}.`,InvalidLhsBinding:({ancestor:o})=>`Binding invalid left-hand side in ${Hs(o)}.`,InvalidLhsOptionalChaining:({ancestor:o})=>`Invalid optional chaining in the left-hand side of ${Hs(o)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:o})=>`Unexpected character '${o}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:o})=>`Private name #${o} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:o})=>`Label '${o}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:o})=>`This experimental syntax requires enabling the parser plugin: ${o.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:o})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${o.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:o})=>`Duplicate key "${o}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:o})=>`An export name cannot include a lone surrogate, found '\\u${o.toString(16)}'.`,ModuleExportUndefined:({localName:o})=>`Export '${o}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:o})=>`Private names are only allowed in property accesses (\`obj.#${o}\`) or in \`in\` expressions (\`#${o} in obj\`).`,PrivateNameRedeclaration:({identifierName:o})=>`Duplicate private name #${o}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperCallNotNewExpression:"Cannot use new with super(...).",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:o})=>`Unexpected keyword '${o}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:o})=>`Unexpected reserved word '${o}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:o,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${o?`, expected "${o}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:o,onlyValidPropertyName:e})=>`The only valid meta property for ${o} is ${o}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:o})=>`Identifier '${o}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Wce={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:o})=>`Assigning to '${o}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:o})=>`Binding '${o}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},$ce={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:o})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(o)}\`.`},Gce=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Kce=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:o})=>`Invalid topic token ${o}. In order to use ${o} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${o}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:o})=>`Hack-style pipe body cannot be an unparenthesized ${Hs({type:o})}; please wrap it in parentheses.`},{PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'}),qce={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."},Yce=["message"];function wh(o,e,t){Object.defineProperty(o,e,{enumerable:!1,configurable:!0,value:t})}function Qce({toMessage:o,code:e,reasonCode:t,syntaxPlugin:r}){let s=t==="MissingPlugin"||t==="MissingOneOfPlugins",a={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};return a[t]&&(t=a[t]),function p(u,f){let m=new SyntaxError;return m.code=e,m.reasonCode=t,m.loc=u,m.pos=u.index,m.syntaxPlugin=r,s&&(m.missingPlugin=f.missingPlugin),wh(m,"clone",function(g={}){var z;let{line:w,column:k,index:F}=(z=g.loc)!=null?z:u;return p(new At(w,k,F),Object.assign({},f,g.details))}),wh(m,"details",f),Object.defineProperty(m,"message",{configurable:!0,get(){let x=`${o(f)} (${u.line}:${u.column})`;return this.message=x,x},set(x){Object.defineProperty(this,"message",{value:x,writable:!0})}}),m}}function ct(o,e){if(Array.isArray(o))return r=>ct(r,o[0]);let t={};for(let r of Object.keys(o)){let s=o[r],a=typeof s=="string"?{message:()=>s}:typeof s=="function"?{message:s}:s,{message:p}=a,u=Vce(a,Yce),f=typeof p=="string"?()=>p:p;t[r]=Qce(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:f},e?{syntaxPlugin:e}:{},u))}return t}var R=Object.assign({},ct(Uce),ct(Hce),ct(Wce),ct($ce),ct`pipelineOperator`(Kce),ct`functionBind`(qce));function Jce(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Zce(o){let e=Jce();if(o==null)return e;if(o.annexB!=null&&o.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let t of Object.keys(e))o[t]!=null&&(e[t]=o[t]);if(e.startLine===1)o.startIndex==null&&e.startColumn>0?e.startIndex=e.startColumn:o.startColumn==null&&e.startIndex>0&&(e.startColumn=e.startIndex);else if((o.startColumn==null||o.startIndex==null)&&o.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(e.sourceType==="commonjs"){if(o.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(o.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(o.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return e}var{defineProperty:Xce}=Object,Oh=(o,e)=>{o&&Xce(o,e,{enumerable:!1,value:o[e]})};function ir(o){return Oh(o.loc.start,"index"),Oh(o.loc.end,"index"),o}var epe=o=>class extends o{parse(){let t=ir(super.parse());return this.optionFlags&256&&(t.tokens=t.tokens.map(ir)),t}parseRegExpLiteral({pattern:t,flags:r}){let s=null;try{s=new RegExp(t,r)}catch{}let a=this.estreeParseLiteral(s);return a.regex={pattern:t,flags:r},a}parseBigIntLiteral(t){let r;try{r=BigInt(t)}catch{r=null}let s=this.estreeParseLiteral(r);return s.bigint=String(s.value||t),s}parseDecimalLiteral(t){let s=this.estreeParseLiteral(null);return s.decimal=String(s.value||t),s}estreeParseLiteral(t){return this.parseLiteral(t,"Literal")}parseStringLiteral(t){return this.estreeParseLiteral(t)}parseNumericLiteral(t){return this.estreeParseLiteral(t)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(t){return this.estreeParseLiteral(t)}estreeParseChainExpression(t,r){let s=this.startNodeAtNode(t);return s.expression=t,this.finishNodeAt(s,"ChainExpression",r)}directiveToStmt(t){let r=t.value;delete t.value,this.castNodeTo(r,"Literal"),r.raw=r.extra.raw,r.value=r.extra.expressionValue;let s=this.castNodeTo(t,"ExpressionStatement");return s.expression=r,s.directive=r.extra.rawValue,delete r.extra,s}fillOptionalPropertiesForTSESLint(t){}cloneEstreeStringLiteral(t){let{start:r,end:s,loc:a,range:p,raw:u,value:f}=t,m=Object.create(t.constructor.prototype);return m.type="Literal",m.start=r,m.end=s,m.loc=a,m.range=p,m.raw=u,m.value=f,m}initFunction(t,r){super.initFunction(t,r),t.expression=!1}checkDeclaration(t){t!=null&&this.isObjectProperty(t)?this.checkDeclaration(t.value):super.checkDeclaration(t)}getObjectOrClassMethodParams(t){return t.value.params}isValidDirective(t){var r;return t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&!((r=t.expression.extra)!=null&&r.parenthesized)}parseBlockBody(t,r,s,a,p){super.parseBlockBody(t,r,s,a,p);let u=t.directives.map(f=>this.directiveToStmt(f));t.body=u.concat(t.body),delete t.directives}parsePrivateName(){let t=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(t):t}convertPrivateNameToPrivateIdentifier(t){let r=super.getPrivateNameSV(t);return delete t.id,t.name=r,this.castNodeTo(t,"PrivateIdentifier")}isPrivateName(t){return this.getPluginOption("estree","classFeatures")?t.type==="PrivateIdentifier":super.isPrivateName(t)}getPrivateNameSV(t){return this.getPluginOption("estree","classFeatures")?t.name:super.getPrivateNameSV(t)}parseLiteral(t,r){let s=super.parseLiteral(t,r);return s.raw=s.extra.raw,delete s.extra,s}parseFunctionBody(t,r,s=!1){super.parseFunctionBody(t,r,s),t.expression=t.body.type!=="BlockStatement"}parseMethod(t,r,s,a,p,u,f=!1){let m=this.startNode();m.kind=t.kind,m=super.parseMethod(m,r,s,a,p,u,f),delete m.kind;let{typeParameters:x}=t;x&&(delete t.typeParameters,m.typeParameters=x,this.resetStartLocationFromNode(m,x));let g=this.castNodeTo(m,"FunctionExpression");return t.value=g,u==="ClassPrivateMethod"&&(t.computed=!1),u==="ObjectMethod"?(t.kind==="method"&&(t.kind="init"),t.shorthand=!1,this.finishNode(t,"Property")):this.finishNode(t,"MethodDefinition")}nameIsConstructor(t){return t.type==="Literal"?t.value==="constructor":super.nameIsConstructor(t)}parseClassProperty(...t){let r=super.parseClassProperty(...t);return this.getPluginOption("estree","classFeatures")&&this.castNodeTo(r,"PropertyDefinition"),r}parseClassPrivateProperty(...t){let r=super.parseClassPrivateProperty(...t);return this.getPluginOption("estree","classFeatures")&&(this.castNodeTo(r,"PropertyDefinition"),r.computed=!1),r}parseClassAccessorProperty(t){let r=super.parseClassAccessorProperty(t);return this.getPluginOption("estree","classFeatures")&&(r.abstract&&this.hasPlugin("typescript")?(delete r.abstract,this.castNodeTo(r,"TSAbstractAccessorProperty")):this.castNodeTo(r,"AccessorProperty")),r}parseObjectProperty(t,r,s,a){let p=super.parseObjectProperty(t,r,s,a);return p&&(p.kind="init",this.castNodeTo(p,"Property")),p}finishObjectProperty(t){return t.kind="init",this.finishNode(t,"Property")}isValidLVal(t,r,s,a){return t==="Property"?"value":super.isValidLVal(t,r,s,a)}isAssignable(t,r){return t!=null&&this.isObjectProperty(t)?this.isAssignable(t.value,r):super.isAssignable(t,r)}toAssignable(t,r=!1){if(t!=null&&this.isObjectProperty(t)){let{key:s,value:a}=t;this.isPrivateName(s)&&this.classScope.usePrivateName(this.getPrivateNameSV(s),s.loc.start),this.toAssignable(a,r)}else super.toAssignable(t,r)}toAssignableObjectExpressionProp(t,r,s){t.type==="Property"&&(t.kind==="get"||t.kind==="set")?this.raise(R.PatternHasAccessor,t.key):t.type==="Property"&&t.method?this.raise(R.PatternHasMethod,t.key):super.toAssignableObjectExpressionProp(t,r,s)}finishCallExpression(t,r){let s=super.finishCallExpression(t,r);if(s.callee.type==="Import"){var a,p;this.castNodeTo(s,"ImportExpression"),s.source=s.arguments[0],s.options=(a=s.arguments[1])!=null?a:null,s.attributes=(p=s.arguments[1])!=null?p:null,delete s.arguments,delete s.callee}else s.type==="OptionalCallExpression"?this.castNodeTo(s,"CallExpression"):s.optional=!1;return s}toReferencedArguments(t){t.type!=="ImportExpression"&&super.toReferencedArguments(t)}parseExport(t,r){let s=this.state.lastTokStartLoc,a=super.parseExport(t,r);switch(a.type){case"ExportAllDeclaration":a.exported=null;break;case"ExportNamedDeclaration":a.specifiers.length===1&&a.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(a,"ExportAllDeclaration"),a.exported=a.specifiers[0].exported,delete a.specifiers);case"ExportDefaultDeclaration":{var p;let{declaration:u}=a;u?.type==="ClassDeclaration"&&((p=u.decorators)==null?void 0:p.length)>0&&u.start===a.start&&this.resetStartLocation(a,s)}break}return a}stopParseSubscript(t,r){let s=super.stopParseSubscript(t,r);return r.optionalChainMember?this.estreeParseChainExpression(s,t.loc.end):s}parseMember(t,r,s,a,p){let u=super.parseMember(t,r,s,a,p);return u.type==="OptionalMemberExpression"?this.castNodeTo(u,"MemberExpression"):u.optional=!1,u}isOptionalMemberExpression(t){return t.type==="ChainExpression"?t.expression.type==="MemberExpression":super.isOptionalMemberExpression(t)}hasPropertyAsPrivateName(t){return t.type==="ChainExpression"&&(t=t.expression),super.hasPropertyAsPrivateName(t)}isObjectProperty(t){return t.type==="Property"&&t.kind==="init"&&!t.method}isObjectMethod(t){return t.type==="Property"&&(t.method||t.kind==="get"||t.kind==="set")}castNodeTo(t,r){let s=super.castNodeTo(t,r);return this.fillOptionalPropertiesForTSESLint(s),s}cloneIdentifier(t){let r=super.cloneIdentifier(t);return this.fillOptionalPropertiesForTSESLint(r),r}cloneStringLiteral(t){return t.type==="Literal"?this.cloneEstreeStringLiteral(t):super.cloneStringLiteral(t)}finishNodeAt(t,r,s){return ir(super.finishNodeAt(t,r,s))}finishNode(t,r){let s=super.finishNode(t,r);return this.fillOptionalPropertiesForTSESLint(s),s}resetStartLocation(t,r){super.resetStartLocation(t,r),ir(t)}resetEndLocation(t,r=this.state.lastTokEndLoc){super.resetEndLocation(t,r),ir(t)}},Gt=class{constructor(e,t){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!t}},ce={brace:new Gt("{"),j_oTag:new Gt("<tag"),j_cTag:new Gt("</tag"),j_expr:new Gt("<tag>...</tag>",!0)};ce.template=new Gt("`",!0);var te=!0,U=!0,mc=!0,ar=!0,Dt=!0,tpe=!0,Gs=class{constructor(e,t={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop!=null?t.binop:null,this.updateContext=null}},jc=new Map;function ae(o,e={}){e.keyword=o;let t=Q(o,e);return jc.set(o,t),t}function Be(o,e){return Q(o,{beforeExpr:te,binop:e})}var lr=-1,It=[],Vc=[],Uc=[],Hc=[],Wc=[],$c=[];function Q(o,e={}){var t,r,s,a;return++lr,Vc.push(o),Uc.push((t=e.binop)!=null?t:-1),Hc.push((r=e.beforeExpr)!=null?r:!1),Wc.push((s=e.startsExpr)!=null?s:!1),$c.push((a=e.prefix)!=null?a:!1),It.push(new Gs(o,e)),lr}function oe(o,e={}){var t,r,s,a;return++lr,jc.set(o,lr),Vc.push(o),Uc.push((t=e.binop)!=null?t:-1),Hc.push((r=e.beforeExpr)!=null?r:!1),Wc.push((s=e.startsExpr)!=null?s:!1),$c.push((a=e.prefix)!=null?a:!1),It.push(new Gs("name",e)),lr}var ope={bracketL:Q("[",{beforeExpr:te,startsExpr:U}),bracketHashL:Q("#[",{beforeExpr:te,startsExpr:U}),bracketBarL:Q("[|",{beforeExpr:te,startsExpr:U}),bracketR:Q("]"),bracketBarR:Q("|]"),braceL:Q("{",{beforeExpr:te,startsExpr:U}),braceBarL:Q("{|",{beforeExpr:te,startsExpr:U}),braceHashL:Q("#{",{beforeExpr:te,startsExpr:U}),braceR:Q("}"),braceBarR:Q("|}"),parenL:Q("(",{beforeExpr:te,startsExpr:U}),parenR:Q(")"),comma:Q(",",{beforeExpr:te}),semi:Q(";",{beforeExpr:te}),colon:Q(":",{beforeExpr:te}),doubleColon:Q("::",{beforeExpr:te}),dot:Q("."),question:Q("?",{beforeExpr:te}),questionDot:Q("?."),arrow:Q("=>",{beforeExpr:te}),template:Q("template"),ellipsis:Q("...",{beforeExpr:te}),backQuote:Q("`",{startsExpr:U}),dollarBraceL:Q("${",{beforeExpr:te,startsExpr:U}),templateTail:Q("...`",{startsExpr:U}),templateNonTail:Q("...${",{beforeExpr:te,startsExpr:U}),at:Q("@"),hash:Q("#",{startsExpr:U}),interpreterDirective:Q("#!..."),eq:Q("=",{beforeExpr:te,isAssign:ar}),assign:Q("_=",{beforeExpr:te,isAssign:ar}),slashAssign:Q("_=",{beforeExpr:te,isAssign:ar}),xorAssign:Q("_=",{beforeExpr:te,isAssign:ar}),moduloAssign:Q("_=",{beforeExpr:te,isAssign:ar}),incDec:Q("++/--",{prefix:Dt,postfix:tpe,startsExpr:U}),bang:Q("!",{beforeExpr:te,prefix:Dt,startsExpr:U}),tilde:Q("~",{beforeExpr:te,prefix:Dt,startsExpr:U}),doubleCaret:Q("^^",{startsExpr:U}),doubleAt:Q("@@",{startsExpr:U}),pipeline:Be("|>",0),nullishCoalescing:Be("??",1),logicalOR:Be("||",1),logicalAND:Be("&&",2),bitwiseOR:Be("|",3),bitwiseXOR:Be("^",4),bitwiseAND:Be("&",5),equality:Be("==/!=/===/!==",6),lt:Be("</>/<=/>=",7),gt:Be("</>/<=/>=",7),relational:Be("</>/<=/>=",7),bitShift:Be("<</>>/>>>",8),bitShiftL:Be("<</>>/>>>",8),bitShiftR:Be("<</>>/>>>",8),plusMin:Q("+/-",{beforeExpr:te,binop:9,prefix:Dt,startsExpr:U}),modulo:Q("%",{binop:10,startsExpr:U}),star:Q("*",{binop:10}),slash:Be("/",10),exponent:Q("**",{beforeExpr:te,binop:11,rightAssociative:!0}),_in:ae("in",{beforeExpr:te,binop:7}),_instanceof:ae("instanceof",{beforeExpr:te,binop:7}),_break:ae("break"),_case:ae("case",{beforeExpr:te}),_catch:ae("catch"),_continue:ae("continue"),_debugger:ae("debugger"),_default:ae("default",{beforeExpr:te}),_else:ae("else",{beforeExpr:te}),_finally:ae("finally"),_function:ae("function",{startsExpr:U}),_if:ae("if"),_return:ae("return",{beforeExpr:te}),_switch:ae("switch"),_throw:ae("throw",{beforeExpr:te,prefix:Dt,startsExpr:U}),_try:ae("try"),_var:ae("var"),_const:ae("const"),_with:ae("with"),_new:ae("new",{beforeExpr:te,startsExpr:U}),_this:ae("this",{startsExpr:U}),_super:ae("super",{startsExpr:U}),_class:ae("class",{startsExpr:U}),_extends:ae("extends",{beforeExpr:te}),_export:ae("export"),_import:ae("import",{startsExpr:U}),_null:ae("null",{startsExpr:U}),_true:ae("true",{startsExpr:U}),_false:ae("false",{startsExpr:U}),_typeof:ae("typeof",{beforeExpr:te,prefix:Dt,startsExpr:U}),_void:ae("void",{beforeExpr:te,prefix:Dt,startsExpr:U}),_delete:ae("delete",{beforeExpr:te,prefix:Dt,startsExpr:U}),_do:ae("do",{isLoop:mc,beforeExpr:te}),_for:ae("for",{isLoop:mc}),_while:ae("while",{isLoop:mc}),_as:oe("as",{startsExpr:U}),_assert:oe("assert",{startsExpr:U}),_async:oe("async",{startsExpr:U}),_await:oe("await",{startsExpr:U}),_defer:oe("defer",{startsExpr:U}),_from:oe("from",{startsExpr:U}),_get:oe("get",{startsExpr:U}),_let:oe("let",{startsExpr:U}),_meta:oe("meta",{startsExpr:U}),_of:oe("of",{startsExpr:U}),_sent:oe("sent",{startsExpr:U}),_set:oe("set",{startsExpr:U}),_source:oe("source",{startsExpr:U}),_static:oe("static",{startsExpr:U}),_using:oe("using",{startsExpr:U}),_yield:oe("yield",{startsExpr:U}),_asserts:oe("asserts",{startsExpr:U}),_checks:oe("checks",{startsExpr:U}),_exports:oe("exports",{startsExpr:U}),_global:oe("global",{startsExpr:U}),_implements:oe("implements",{startsExpr:U}),_intrinsic:oe("intrinsic",{startsExpr:U}),_infer:oe("infer",{startsExpr:U}),_is:oe("is",{startsExpr:U}),_mixins:oe("mixins",{startsExpr:U}),_proto:oe("proto",{startsExpr:U}),_require:oe("require",{startsExpr:U}),_satisfies:oe("satisfies",{startsExpr:U}),_keyof:oe("keyof",{startsExpr:U}),_readonly:oe("readonly",{startsExpr:U}),_unique:oe("unique",{startsExpr:U}),_abstract:oe("abstract",{startsExpr:U}),_declare:oe("declare",{startsExpr:U}),_enum:oe("enum",{startsExpr:U}),_module:oe("module",{startsExpr:U}),_namespace:oe("namespace",{startsExpr:U}),_interface:oe("interface",{startsExpr:U}),_type:oe("type",{startsExpr:U}),_opaque:oe("opaque",{startsExpr:U}),name:Q("name",{startsExpr:U}),placeholder:Q("%%",{startsExpr:U}),string:Q("string",{startsExpr:U}),num:Q("num",{startsExpr:U}),bigint:Q("bigint",{startsExpr:U}),decimal:Q("decimal",{startsExpr:U}),regexp:Q("regexp",{startsExpr:U}),privateName:Q("#name",{startsExpr:U}),eof:Q("eof"),jsxName:Q("jsxName"),jsxText:Q("jsxText",{beforeExpr:te}),jsxTagStart:Q("jsxTagStart",{startsExpr:U}),jsxTagEnd:Q("jsxTagEnd")};function pe(o){return o>=93&&o<=133}function rpe(o){return o<=92}function pt(o){return o>=58&&o<=133}function Vh(o){return o>=58&&o<=137}function spe(o){return Hc[o]}function pr(o){return Wc[o]}function npe(o){return o>=29&&o<=33}function Mh(o){return o>=129&&o<=131}function ipe(o){return o>=90&&o<=92}function Gc(o){return o>=58&&o<=92}function ape(o){return o>=39&&o<=59}function cpe(o){return o===34}function ppe(o){return $c[o]}function dpe(o){return o>=121&&o<=123}function lpe(o){return o>=124&&o<=130}function Ft(o){return Vc[o]}function Ws(o){return Uc[o]}function upe(o){return o===57}function Ks(o){return o>=24&&o<=25}function Ct(o){return It[o]}It[8].updateContext=o=>{o.pop()};It[5].updateContext=It[7].updateContext=It[23].updateContext=o=>{o.push(ce.brace)};It[22].updateContext=o=>{o[o.length-1]===ce.template?o.pop():o.push(ce.template)};It[143].updateContext=o=>{o.push(ce.j_expr,ce.j_oTag)};var Kc="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Uh="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",mpe=new RegExp("["+Kc+"]"),hpe=new RegExp("["+Kc+Uh+"]");Kc=Uh=null;var Hh=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],fpe=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function yc(o,e){let t=65536;for(let r=0,s=e.length;r<s;r+=2){if(t+=e[r],t>o)return!1;if(t+=e[r+1],t>=o)return!0}return!1}function yt(o){return o<65?o===36:o<=90?!0:o<97?o===95:o<=122?!0:o<=65535?o>=170&&mpe.test(String.fromCharCode(o)):yc(o,Hh)}function Kt(o){return o<48?o===36:o<58?!0:o<65?!1:o<=90?!0:o<97?o===95:o<=122?!0:o<=65535?o>=170&&hpe.test(String.fromCharCode(o)):yc(o,Hh)||yc(o,fpe)}var qc={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},xpe=new Set(qc.keyword),gpe=new Set(qc.strict),bpe=new Set(qc.strictBind);function Wh(o,e){return e&&o==="await"||o==="enum"}function $h(o,e){return Wh(o,e)||gpe.has(o)}function Gh(o){return bpe.has(o)}function Kh(o,e){return $h(o,e)||Gh(o)}function ype(o){return xpe.has(o)}function Ape(o,e,t){return o===64&&e===64&&yt(t)}var Spe=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function zpe(o){return Spe.has(o)}var ur=class{constructor(e){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=e}},mr=class{constructor(e,t){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inModule=t}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&(e&2)===0}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&128)return!0;if(t&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new ur(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,t,r){let s=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(s,e,t,r);let a=s.names.get(e)||0;t&16?a=a|4:(s.firstLexicalName||(s.firstLexicalName=e),a=a|2),s.names.set(e,a),t&8&&this.maybeExportDefined(s,e)}else if(t&4)for(let a=this.scopeStack.length-1;a>=0&&(s=this.scopeStack[a],this.checkRedeclarationInScope(s,e,t,r),s.names.set(e,(s.names.get(e)||0)|1),this.maybeExportDefined(s,e),!(s.flags&1667));--a);this.parser.inModule&&s.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,t){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(e,t,r,s){this.isRedeclaredInScope(e,t,r)&&this.parser.raise(R.VarRedeclaration,s,{identifierName:t})}isRedeclaredInScope(e,t,r){if(!(r&1))return!1;if(r&8)return e.names.has(t);let s=e.names.get(t)||0;return r&16?(s&2)>0||!this.treatFunctionsAsVarInScope(e)&&(s&1)>0:(s&2)>0&&!(e.flags&8&&e.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(e)&&(s&4)>0}checkLocalExport(e){let{name:t}=e;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,e.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&1667)return t}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:t}=this.scopeStack[e];if(t&1731&&!(t&4))return t}}},Ac=class extends ur{constructor(...e){super(...e),this.declareFunctions=new Set}},Sc=class extends mr{createScope(e){return new Ac(e)}declareName(e,t,r){let s=this.currentScope();if(t&2048){this.checkRedeclarationInScope(s,e,t,r),this.maybeExportDefined(s,e),s.declareFunctions.add(e);return}super.declareName(e,t,r)}isRedeclaredInScope(e,t,r){if(super.isRedeclaredInScope(e,t,r))return!0;if(r&2048&&!e.declareFunctions.has(t)){let s=e.names.get(t);return(s&4)>0||(s&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},Tpe=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),J=ct`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:o})=>`Cannot overwrite reserved type ${o}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:o,enumName:e})=>`Boolean enum members need to be initialized. Use either \`${o} = true,\` or \`${o} = false,\` in enum \`${e}\`.`,EnumDuplicateMemberName:({memberName:o,enumName:e})=>`Enum member names need to be unique, but the name \`${o}\` has already been used before in enum \`${e}\`.`,EnumInconsistentMemberValues:({enumName:o})=>`Enum \`${o}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:o,enumName:e})=>`Enum type \`${o}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:o})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${o}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:o,memberName:e,explicitType:t})=>`Enum \`${o}\` has type \`${t}\`, so the initializer of \`${e}\` needs to be a ${t} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:o,memberName:e})=>`Symbol enum members cannot be initialized. Use \`${e},\` in enum \`${o}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:o,memberName:e})=>`The enum member initializer for \`${e}\` needs to be a literal (either a boolean, number, or string) in enum \`${o}\`.`,EnumInvalidMemberName:({enumName:o,memberName:e,suggestion:t})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${e}\`, consider using \`${t}\`, in enum \`${o}\`.`,EnumNumberMemberNotInitialized:({enumName:o,memberName:e})=>`Number enum members need to be initialized, e.g. \`${e} = 1\` in enum \`${o}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:o})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${o}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:o})=>`Unexpected reserved type ${o}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:o,suggestion:e})=>`\`declare export ${o}\` is not supported. Use \`${e}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Epe(o){return o.type==="DeclareExportAllDeclaration"||o.type==="DeclareExportDeclaration"&&(!o.declaration||o.declaration.type!=="TypeAlias"&&o.declaration.type!=="InterfaceDeclaration")}function kh(o){return o.importKind==="type"||o.importKind==="typeof"}var Cpe={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Ipe(o,e){let t=[],r=[];for(let s=0;s<o.length;s++)(e(o[s],s,o)?t:r).push(o[s]);return[t,r]}var Rpe=/\*?\s*@((?:no)?flow)\b/,wpe=o=>class extends o{constructor(...t){super(...t),this.flowPragma=void 0}getScopeHandler(){return Sc}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(t,r){t!==134&&t!==13&&t!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(t,r)}addComment(t){if(this.flowPragma===void 0){let r=Rpe.exec(t.value);if(r)if(r[1]==="flow")this.flowPragma="flow";else if(r[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(t)}flowParseTypeInitialiser(t){let r=this.state.inType;this.state.inType=!0,this.expect(t||14);let s=this.flowParseType();return this.state.inType=r,s}flowParsePredicate(){let t=this.startNode(),r=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>r.index+1&&this.raise(J.UnexpectedSpaceBetweenModuloChecks,r),this.eat(10)?(t.value=super.parseExpression(),this.expect(11),this.finishNode(t,"DeclaredPredicate")):this.finishNode(t,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let t=this.state.inType;this.state.inType=!0,this.expect(14);let r=null,s=null;return this.match(54)?(this.state.inType=t,s=this.flowParsePredicate()):(r=this.flowParseType(),this.state.inType=t,this.match(54)&&(s=this.flowParsePredicate())),[r,s]}flowParseDeclareClass(t){return this.next(),this.flowParseInterfaceish(t,!0),this.finishNode(t,"DeclareClass")}flowParseDeclareFunction(t){this.next();let r=t.id=this.parseIdentifier(),s=this.startNode(),a=this.startNode();this.match(47)?s.typeParameters=this.flowParseTypeParameterDeclaration():s.typeParameters=null,this.expect(10);let p=this.flowParseFunctionTypeParams();return s.params=p.params,s.rest=p.rest,s.this=p._this,this.expect(11),[s.returnType,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),a.typeAnnotation=this.finishNode(s,"FunctionTypeAnnotation"),r.typeAnnotation=this.finishNode(a,"TypeAnnotation"),this.resetEndLocation(r),this.semicolon(),this.scope.declareName(t.id.name,2048,t.id.loc.start),this.finishNode(t,"DeclareFunction")}flowParseDeclare(t,r){if(this.match(80))return this.flowParseDeclareClass(t);if(this.match(68))return this.flowParseDeclareFunction(t);if(this.match(74))return this.flowParseDeclareVariable(t);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(t):(r&&this.raise(J.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(t));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(t);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(t);if(this.isContextual(129))return this.flowParseDeclareInterface(t);if(this.match(82))return this.flowParseDeclareExportDeclaration(t,r);throw this.unexpected()}flowParseDeclareVariable(t){return this.next(),t.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(t.id.name,5,t.id.loc.start),this.semicolon(),this.finishNode(t,"DeclareVariable")}flowParseDeclareModule(t){this.scope.enter(0),this.match(134)?t.id=super.parseExprAtom():t.id=this.parseIdentifier();let r=t.body=this.startNode(),s=r.body=[];for(this.expect(5);!this.match(8);){let u=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(J.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),s.push(super.parseImport(u))):(this.expectContextual(125,J.UnsupportedStatementInDeclareModule),s.push(this.flowParseDeclare(u,!0)))}this.scope.exit(),this.expect(8),this.finishNode(r,"BlockStatement");let a=null,p=!1;return s.forEach(u=>{Epe(u)?(a==="CommonJS"&&this.raise(J.AmbiguousDeclareModuleKind,u),a="ES"):u.type==="DeclareModuleExports"&&(p&&this.raise(J.DuplicateDeclareModuleExports,u),a==="ES"&&this.raise(J.AmbiguousDeclareModuleKind,u),a="CommonJS",p=!0)}),t.kind=a||"CommonJS",this.finishNode(t,"DeclareModule")}flowParseDeclareExportDeclaration(t,r){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?t.declaration=this.flowParseDeclare(this.startNode()):(t.declaration=this.flowParseType(),this.semicolon()),t.default=!0,this.finishNode(t,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!r){let s=this.state.value;throw this.raise(J.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:s,suggestion:Cpe[s]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return t.declaration=this.flowParseDeclare(this.startNode()),t.default=!1,this.finishNode(t,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return t=this.parseExport(t,null),t.type==="ExportNamedDeclaration"?(t.default=!1,delete t.exportKind,this.castNodeTo(t,"DeclareExportDeclaration")):this.castNodeTo(t,"DeclareExportAllDeclaration");throw this.unexpected()}flowParseDeclareModuleExports(t){return this.next(),this.expectContextual(111),t.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(t,"DeclareModuleExports")}flowParseDeclareTypeAlias(t){this.next();let r=this.flowParseTypeAlias(t);return this.castNodeTo(r,"DeclareTypeAlias"),r}flowParseDeclareOpaqueType(t){this.next();let r=this.flowParseOpaqueType(t,!0);return this.castNodeTo(r,"DeclareOpaqueType"),r}flowParseDeclareInterface(t){return this.next(),this.flowParseInterfaceish(t,!1),this.finishNode(t,"DeclareInterface")}flowParseInterfaceish(t,r){if(t.id=this.flowParseRestrictedIdentifier(!r,!0),this.scope.declareName(t.id.name,r?17:8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.extends=[],this.eat(81))do t.extends.push(this.flowParseInterfaceExtends());while(!r&&this.eat(12));if(r){if(t.implements=[],t.mixins=[],this.eatContextual(117))do t.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do t.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}t.body=this.flowParseObjectType({allowStatic:r,allowExact:!1,allowSpread:!1,allowProto:r,allowInexact:!1})}flowParseInterfaceExtends(){let t=this.startNode();return t.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?t.typeParameters=this.flowParseTypeParameterInstantiation():t.typeParameters=null,this.finishNode(t,"InterfaceExtends")}flowParseInterface(t){return this.flowParseInterfaceish(t,!1),this.finishNode(t,"InterfaceDeclaration")}checkNotUnderscore(t){t==="_"&&this.raise(J.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(t,r,s){Tpe.has(t)&&this.raise(s?J.AssignReservedType:J.UnexpectedReservedType,r,{reservedType:t})}flowParseRestrictedIdentifierName(t,r){return this.checkReservedType(this.state.value,this.state.startLoc,r),this.parseIdentifierName(t)}flowParseRestrictedIdentifier(t,r){let s=this.startNode(),a=this.flowParseRestrictedIdentifierName(t,r);return this.createIdentifier(s,a)}flowParseTypeAlias(t){return t.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(t.id.name,8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(t,"TypeAlias")}flowParseOpaqueType(t,r){return this.expectContextual(130),t.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(t.id.name,8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.supertype=null,this.match(14)&&(t.supertype=this.flowParseTypeInitialiser(14)),t.impltype=null,r||(t.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(t,"OpaqueType")}flowParseTypeParameterBound(){if(this.match(14)||this.isContextual(81)){let t=this.startNode();return this.next(),t.typeAnnotation=this.flowParseType(),this.finishNode(t,"TypeAnnotation")}}flowParseTypeParameter(t=!1){let r=this.state.startLoc,s=this.startNode(),a=this.flowParseVariance();return s.name=this.flowParseRestrictedIdentifierName(),s.variance=a,s.bound=this.flowParseTypeParameterBound(),this.match(29)?(this.eat(29),s.default=this.flowParseType()):t&&this.raise(J.MissingTypeParamDefault,r),this.finishNode(s,"TypeParameter")}flowParseTypeParameterDeclaration(){let t=this.state.inType,r=this.startNode();r.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let s=!1;do{let a=this.flowParseTypeParameter(s);r.params.push(a),a.default&&(s=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=t,this.finishNode(r,"TypeParameterDeclaration")}flowInTopLevelContext(t){if(this.curContext()!==ce.brace){let r=this.state.context;this.state.context=[r[0]];try{return t()}finally{this.state.context=r}}else return t()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let t=this.startNode(),r=this.state.inType;return this.state.inType=!0,t.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let s=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)t.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=s}),this.state.inType=r,!this.state.inType&&this.curContext()===ce.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(t,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;let t=this.startNode(),r=this.state.inType;for(t.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)t.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=r,this.finishNode(t,"TypeParameterInstantiation")}flowParseInterfaceType(){let t=this.startNode();if(this.expectContextual(129),t.extends=[],this.eat(81))do t.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return t.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(t,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(t,r,s){return t.static=r,this.lookahead().type===14?(t.id=this.flowParseObjectPropertyKey(),t.key=this.flowParseTypeInitialiser()):(t.id=null,t.key=this.flowParseType()),this.expect(3),t.value=this.flowParseTypeInitialiser(),t.variance=s,this.finishNode(t,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(t,r){return t.static=r,t.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(t.method=!0,t.optional=!1,t.value=this.flowParseObjectTypeMethodish(this.startNodeAt(t.loc.start))):(t.method=!1,this.eat(17)&&(t.optional=!0),t.value=this.flowParseTypeInitialiser()),this.finishNode(t,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(t){for(t.params=[],t.rest=null,t.typeParameters=null,t.this=null,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(t.this=this.flowParseFunctionTypeParam(!0),t.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)t.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(t.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),t.returnType=this.flowParseTypeInitialiser(),this.finishNode(t,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(t,r){let s=this.startNode();return t.static=r,t.value=this.flowParseObjectTypeMethodish(s),this.finishNode(t,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:t,allowExact:r,allowSpread:s,allowProto:a,allowInexact:p}){let u=this.state.inType;this.state.inType=!0;let f=this.startNode();f.callProperties=[],f.properties=[],f.indexers=[],f.internalSlots=[];let m,x,g=!1;for(r&&this.match(6)?(this.expect(6),m=9,x=!0):(this.expect(5),m=8,x=!1),f.exact=x;!this.match(m);){let w=!1,k=null,F=null,Y=this.startNode();if(a&&this.isContextual(118)){let ee=this.lookahead();ee.type!==14&&ee.type!==17&&(this.next(),k=this.state.startLoc,t=!1)}if(t&&this.isContextual(106)){let ee=this.lookahead();ee.type!==14&&ee.type!==17&&(this.next(),w=!0)}let W=this.flowParseVariance();if(this.eat(0))k!=null&&this.unexpected(k),this.eat(0)?(W&&this.unexpected(W.loc.start),f.internalSlots.push(this.flowParseObjectTypeInternalSlot(Y,w))):f.indexers.push(this.flowParseObjectTypeIndexer(Y,w,W));else if(this.match(10)||this.match(47))k!=null&&this.unexpected(k),W&&this.unexpected(W.loc.start),f.callProperties.push(this.flowParseObjectTypeCallProperty(Y,w));else{let ee="init";if(this.isContextual(99)||this.isContextual(104)){let Te=this.lookahead();Vh(Te.type)&&(ee=this.state.value,this.next())}let de=this.flowParseObjectTypeProperty(Y,w,k,W,ee,s,p??!x);de===null?(g=!0,F=this.state.lastTokStartLoc):f.properties.push(de)}this.flowObjectTypeSemicolon(),F&&!this.match(8)&&!this.match(9)&&this.raise(J.UnexpectedExplicitInexactInObject,F)}this.expect(m),s&&(f.inexact=g);let z=this.finishNode(f,"ObjectTypeAnnotation");return this.state.inType=u,z}flowParseObjectTypeProperty(t,r,s,a,p,u,f){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(u?f||this.raise(J.InexactInsideExact,this.state.lastTokStartLoc):this.raise(J.InexactInsideNonObject,this.state.lastTokStartLoc),a&&this.raise(J.InexactVariance,a),null):(u||this.raise(J.UnexpectedSpreadType,this.state.lastTokStartLoc),s!=null&&this.unexpected(s),a&&this.raise(J.SpreadVariance,a),t.argument=this.flowParseType(),this.finishNode(t,"ObjectTypeSpreadProperty"));{t.key=this.flowParseObjectPropertyKey(),t.static=r,t.proto=s!=null,t.kind=p;let m=!1;return this.match(47)||this.match(10)?(t.method=!0,s!=null&&this.unexpected(s),a&&this.unexpected(a.loc.start),t.value=this.flowParseObjectTypeMethodish(this.startNodeAt(t.loc.start)),(p==="get"||p==="set")&&this.flowCheckGetterSetterParams(t),!u&&t.key.name==="constructor"&&t.value.this&&this.raise(J.ThisParamBannedInConstructor,t.value.this)):(p!=="init"&&this.unexpected(),t.method=!1,this.eat(17)&&(m=!0),t.value=this.flowParseTypeInitialiser(),t.variance=a),t.optional=m,this.finishNode(t,"ObjectTypeProperty")}}flowCheckGetterSetterParams(t){let r=t.kind==="get"?0:1,s=t.value.params.length+(t.value.rest?1:0);t.value.this&&this.raise(t.kind==="get"?J.GetterMayNotHaveThisParam:J.SetterMayNotHaveThisParam,t.value.this),s!==r&&this.raise(t.kind==="get"?R.BadGetterArity:R.BadSetterArity,t),t.kind==="set"&&t.value.rest&&this.raise(R.BadSetterRestParameter,t)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(t,r){t??(t=this.state.startLoc);let s=r||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let a=this.startNodeAt(t);a.qualification=s,a.id=this.flowParseRestrictedIdentifier(!0),s=this.finishNode(a,"QualifiedTypeIdentifier")}return s}flowParseGenericType(t,r){let s=this.startNodeAt(t);return s.typeParameters=null,s.id=this.flowParseQualifiedTypeIdentifier(t,r),this.match(47)&&(s.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(s,"GenericTypeAnnotation")}flowParseTypeofType(){let t=this.startNode();return this.expect(87),t.argument=this.flowParsePrimaryType(),this.finishNode(t,"TypeofTypeAnnotation")}flowParseTupleType(){let t=this.startNode();for(t.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(t.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(t,"TupleTypeAnnotation")}flowParseFunctionTypeParam(t){let r=null,s=!1,a=null,p=this.startNode(),u=this.lookahead(),f=this.state.type===78;return u.type===14||u.type===17?(f&&!t&&this.raise(J.ThisParamMustBeFirst,p),r=this.parseIdentifier(f),this.eat(17)&&(s=!0,f&&this.raise(J.ThisParamMayNotBeOptional,p)),a=this.flowParseTypeInitialiser()):a=this.flowParseType(),p.name=r,p.optional=s,p.typeAnnotation=a,this.finishNode(p,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(t){let r=this.startNodeAt(t.loc.start);return r.name=null,r.optional=!1,r.typeAnnotation=t,this.finishNode(r,"FunctionTypeParam")}flowParseFunctionTypeParams(t=[]){let r=null,s=null;for(this.match(78)&&(s=this.flowParseFunctionTypeParam(!0),s.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)t.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(r=this.flowParseFunctionTypeParam(!1)),{params:t,rest:r,_this:s}}flowIdentToTypeAnnotation(t,r,s){switch(s.name){case"any":return this.finishNode(r,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(r,"BooleanTypeAnnotation");case"mixed":return this.finishNode(r,"MixedTypeAnnotation");case"empty":return this.finishNode(r,"EmptyTypeAnnotation");case"number":return this.finishNode(r,"NumberTypeAnnotation");case"string":return this.finishNode(r,"StringTypeAnnotation");case"symbol":return this.finishNode(r,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(s.name),this.flowParseGenericType(t,s)}}flowParsePrimaryType(){let t=this.state.startLoc,r=this.startNode(),s,a,p=!1,u=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,a=this.flowParseTupleType(),this.state.noAnonFunctionType=u,a;case 47:{let f=this.startNode();return f.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),s=this.flowParseFunctionTypeParams(),f.params=s.params,f.rest=s.rest,f.this=s._this,this.expect(11),this.expect(19),f.returnType=this.flowParseType(),this.finishNode(f,"FunctionTypeAnnotation")}case 10:{let f=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(pe(this.state.type)||this.match(78)){let m=this.lookahead().type;p=m!==17&&m!==14}else p=!0;if(p){if(this.state.noAnonFunctionType=!1,a=this.flowParseType(),this.state.noAnonFunctionType=u,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),a;this.eat(12)}return a?s=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(a)]):s=this.flowParseFunctionTypeParams(),f.params=s.params,f.rest=s.rest,f.this=s._this,this.expect(11),this.expect(19),f.returnType=this.flowParseType(),f.typeParameters=null,this.finishNode(f,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return r.value=this.match(85),this.next(),this.finishNode(r,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",r);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",r);throw this.raise(J.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(r,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(r,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(r,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(r,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Gc(this.state.type)){let f=Ft(this.state.type);return this.next(),super.createIdentifier(r,f)}else if(pe(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(t,r,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let t=this.state.startLoc,r=this.flowParsePrimaryType(),s=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let a=this.startNodeAt(t),p=this.eat(18);s=s||p,this.expect(0),!p&&this.match(3)?(a.elementType=r,this.next(),r=this.finishNode(a,"ArrayTypeAnnotation")):(a.objectType=r,a.indexType=this.flowParseType(),this.expect(3),s?(a.optional=p,r=this.finishNode(a,"OptionalIndexedAccessType")):r=this.finishNode(a,"IndexedAccessType"))}return r}flowParsePrefixType(){let t=this.startNode();return this.eat(17)?(t.typeAnnotation=this.flowParsePrefixType(),this.finishNode(t,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let t=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let r=this.startNodeAt(t.loc.start);return r.params=[this.reinterpretTypeAsFunctionTypeParam(t)],r.rest=null,r.this=null,r.returnType=this.flowParseType(),r.typeParameters=null,this.finishNode(r,"FunctionTypeAnnotation")}return t}flowParseIntersectionType(){let t=this.startNode();this.eat(45);let r=this.flowParseAnonFunctionWithoutParens();for(t.types=[r];this.eat(45);)t.types.push(this.flowParseAnonFunctionWithoutParens());return t.types.length===1?r:this.finishNode(t,"IntersectionTypeAnnotation")}flowParseUnionType(){let t=this.startNode();this.eat(43);let r=this.flowParseIntersectionType();for(t.types=[r];this.eat(43);)t.types.push(this.flowParseIntersectionType());return t.types.length===1?r:this.finishNode(t,"UnionTypeAnnotation")}flowParseType(){let t=this.state.inType;this.state.inType=!0;let r=this.flowParseUnionType();return this.state.inType=t,r}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let t=this.state.startLoc,r=this.parseIdentifier();return this.flowParseGenericType(t,r)}else return this.flowParseType()}flowParseTypeAnnotation(){let t=this.startNode();return t.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(t,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(){let t=this.startNode(),r=this.parseIdentifierName();return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(t,r)}typeCastToParameter(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.loc.end),t.expression}flowParseVariance(){let t=null;return this.match(53)?(t=this.startNode(),this.state.value==="+"?t.kind="plus":t.kind="minus",this.next(),this.finishNode(t,"Variance")):t}parseFunctionBody(t,r,s=!1){if(r){this.forwardNoArrowParamsConversionAt(t,()=>super.parseFunctionBody(t,!0,s));return}super.parseFunctionBody(t,!1,s)}parseFunctionBodyAndFinish(t,r,s=!1){if(this.match(14)){let a=this.startNode();[a.typeAnnotation,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),t.returnType=a.typeAnnotation?this.finishNode(a,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(t,r,s)}parseStatementLike(t){if(this.state.strict&&this.isContextual(129)){let s=this.lookahead();if(pt(s.type)){let a=this.startNode();return this.next(),this.flowParseInterface(a)}}else if(this.isContextual(126)){let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}let r=super.parseStatementLike(t);return this.flowPragma===void 0&&!this.isValidDirective(r)&&(this.flowPragma=null),r}parseExpressionStatement(t,r,s){if(r.type==="Identifier"){if(r.name==="declare"){if(this.match(80)||pe(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(t)}else if(pe(this.state.type)){if(r.name==="interface")return this.flowParseInterface(t);if(r.name==="type")return this.flowParseTypeAlias(t);if(r.name==="opaque")return this.flowParseOpaqueType(t,!1)}}return super.parseExpressionStatement(t,r,s)}shouldParseExportDeclaration(){let{type:t}=this.state;return t===126||Mh(t)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:t}=this.state;return t===126||Mh(t)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDefaultExpression()}parseConditional(t,r,s){if(!this.match(17))return t;if(this.state.maybeInArrowParameters){let z=this.lookaheadCharCode();if(z===44||z===61||z===58||z===41)return this.setOptionalParametersError(s),t}this.expect(17);let a=this.state.clone(),p=this.state.noArrowAt,u=this.startNodeAt(r),{consequent:f,failed:m}=this.tryParseConditionalConsequent(),[x,g]=this.getArrowLikeExpressions(f);if(m||g.length>0){let z=[...p];if(g.length>0){this.state=a,this.state.noArrowAt=z;for(let w=0;w<g.length;w++)z.push(g[w].start);({consequent:f,failed:m}=this.tryParseConditionalConsequent()),[x,g]=this.getArrowLikeExpressions(f)}m&&x.length>1&&this.raise(J.AmbiguousConditionalArrow,a.startLoc),m&&x.length===1&&(this.state=a,z.push(x[0].start),this.state.noArrowAt=z,{consequent:f,failed:m}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(f,!0),this.state.noArrowAt=p,this.expect(14),u.test=t,u.consequent=f,u.alternate=this.forwardNoArrowParamsConversionAt(u,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(u,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let t=this.parseMaybeAssignAllowIn(),r=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:t,failed:r}}getArrowLikeExpressions(t,r){let s=[t],a=[];for(;s.length!==0;){let p=s.pop();p.type==="ArrowFunctionExpression"&&p.body.type!=="BlockStatement"?(p.typeParameters||!p.returnType?this.finishArrowValidation(p):a.push(p),s.push(p.body)):p.type==="ConditionalExpression"&&(s.push(p.consequent),s.push(p.alternate))}return r?(a.forEach(p=>this.finishArrowValidation(p)),[a,[]]):Ipe(a,p=>p.params.every(u=>this.isAssignable(u,!0)))}finishArrowValidation(t){var r;this.toAssignableList(t.params,(r=t.extra)==null?void 0:r.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(t,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(t,r){let s;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),s=r(),this.state.noArrowParamsConversionAt.pop()):s=r(),s}parseParenItem(t,r){let s=super.parseParenItem(t,r);if(this.eat(17)&&(s.optional=!0,this.resetEndLocation(t)),this.match(14)){let a=this.startNodeAt(r);return a.expression=s,a.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(a,"TypeCastExpression")}return s}assertModuleNodeAllowed(t){t.type==="ImportDeclaration"&&(t.importKind==="type"||t.importKind==="typeof")||t.type==="ExportNamedDeclaration"&&t.exportKind==="type"||t.type==="ExportAllDeclaration"&&t.exportKind==="type"||super.assertModuleNodeAllowed(t)}parseExportDeclaration(t){if(this.isContextual(130)){t.exportKind="type";let r=this.startNode();return this.next(),this.match(5)?(t.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(t),null):this.flowParseTypeAlias(r)}else if(this.isContextual(131)){t.exportKind="type";let r=this.startNode();return this.next(),this.flowParseOpaqueType(r,!1)}else if(this.isContextual(129)){t.exportKind="type";let r=this.startNode();return this.next(),this.flowParseInterface(r)}else if(this.isContextual(126)){t.exportKind="value";let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}else return super.parseExportDeclaration(t)}eatExportStar(t){return super.eatExportStar(t)?!0:this.isContextual(130)&&this.lookahead().type===55?(t.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(t){let{startLoc:r}=this.state,s=super.maybeParseExportNamespaceSpecifier(t);return s&&t.exportKind==="type"&&this.unexpected(r),s}parseClassId(t,r,s){super.parseClassId(t,r,s),this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(t,r,s){let{startLoc:a}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(t,r))return;r.declare=!0}super.parseClassMember(t,r,s),r.declare&&(r.type!=="ClassProperty"&&r.type!=="ClassPrivateProperty"&&r.type!=="PropertyDefinition"?this.raise(J.DeclareClassElement,a):r.value&&this.raise(J.DeclareClassFieldInitializer,r.value))}isIterator(t){return t==="iterator"||t==="asyncIterator"}readIterator(){let t=super.readWord1(),r="@@"+t;(!this.isIterator(t)||!this.state.inType)&&this.raise(R.InvalidIdentifier,this.state.curPosition(),{identifierName:r}),this.finishToken(132,r)}getTokenFromCode(t){let r=this.input.charCodeAt(this.state.pos+1);t===123&&r===124?this.finishOp(6,2):this.state.inType&&(t===62||t===60)?this.finishOp(t===62?48:47,1):this.state.inType&&t===63?r===46?this.finishOp(18,2):this.finishOp(17,1):Ape(t,r,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(t)}isAssignable(t,r){return t.type==="TypeCastExpression"?this.isAssignable(t.expression,r):super.isAssignable(t,r)}toAssignable(t,r=!1){!r&&t.type==="AssignmentExpression"&&t.left.type==="TypeCastExpression"&&(t.left=this.typeCastToParameter(t.left)),super.toAssignable(t,r)}toAssignableList(t,r,s){for(let a=0;a<t.length;a++){let p=t[a];p?.type==="TypeCastExpression"&&(t[a]=this.typeCastToParameter(p))}super.toAssignableList(t,r,s)}toReferencedList(t,r){for(let a=0;a<t.length;a++){var s;let p=t[a];p&&p.type==="TypeCastExpression"&&!((s=p.extra)!=null&&s.parenthesized)&&(t.length>1||!r)&&this.raise(J.TypeCastInPattern,p.typeAnnotation)}return t}parseArrayLike(t,r,s){let a=super.parseArrayLike(t,r,s);return s!=null&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(t,r,s,a){return t==="TypeCastExpression"||super.isValidLVal(t,r,s,a)}parseClassProperty(t){return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(t)}parseClassPrivateProperty(t){return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(t)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(t){return!this.match(14)&&super.isNonstaticConstructor(t)}pushClassMethod(t,r,s,a,p,u){if(r.variance&&this.unexpected(r.variance.loc.start),delete r.variance,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(t,r,s,a,p,u),r.params&&p){let f=r.params;f.length>0&&this.isThisParam(f[0])&&this.raise(J.ThisParamBannedInConstructor,r)}else if(r.type==="MethodDefinition"&&p&&r.value.params){let f=r.value.params;f.length>0&&this.isThisParam(f[0])&&this.raise(J.ThisParamBannedInConstructor,r)}}pushClassPrivateMethod(t,r,s,a){r.variance&&this.unexpected(r.variance.loc.start),delete r.variance,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(t,r,s,a)}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass&&(this.match(47)||this.match(51))&&(t.superTypeParameters=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let r=t.implements=[];do{let s=this.startNode();s.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?s.typeParameters=this.flowParseTypeParameterInstantiation():s.typeParameters=null,r.push(this.finishNode(s,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(t){super.checkGetterSetterParams(t);let r=this.getObjectOrClassMethodParams(t);if(r.length>0){let s=r[0];this.isThisParam(s)&&t.kind==="get"?this.raise(J.GetterMayNotHaveThisParam,s):this.isThisParam(s)&&this.raise(J.SetterMayNotHaveThisParam,s)}}parsePropertyNamePrefixOperator(t){t.variance=this.flowParseVariance()}parseObjPropValue(t,r,s,a,p,u,f){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance;let m;this.match(47)&&!u&&(m=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let x=super.parseObjPropValue(t,r,s,a,p,u,f);return m&&((x.value||x).typeParameters=m),x}parseFunctionParamType(t){return this.eat(17)&&(t.type!=="Identifier"&&this.raise(J.PatternIsOptional,t),this.isThisParam(t)&&this.raise(J.ThisParamMayNotBeOptional,t),t.optional=!0),this.match(14)?t.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(t)&&this.raise(J.ThisParamAnnotationRequired,t),this.match(29)&&this.isThisParam(t)&&this.raise(J.ThisParamNoDefault,t),this.resetEndLocation(t),t}parseMaybeDefault(t,r){let s=super.parseMaybeDefault(t,r);return s.type==="AssignmentPattern"&&s.typeAnnotation&&s.right.start<s.typeAnnotation.start&&this.raise(J.TypeBeforeInitializer,s.typeAnnotation),s}checkImportReflection(t){super.checkImportReflection(t),t.module&&t.importKind!=="value"&&this.raise(J.ImportReflectionHasImportType,t.specifiers[0].loc.start)}parseImportSpecifierLocal(t,r,s){r.local=kh(t)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(r,s))}isPotentialImportPhase(t){if(super.isPotentialImportPhase(t))return!0;if(this.isContextual(130)){if(!t)return!0;let r=this.lookaheadCharCode();return r===123||r===42}return!t&&this.isContextual(87)}applyImportPhase(t,r,s,a){if(super.applyImportPhase(t,r,s,a),r){if(!s&&this.match(65))return;t.exportKind=s==="type"?s:"value"}else s==="type"&&this.match(55)&&this.unexpected(),t.importKind=s==="type"||s==="typeof"?s:"value"}parseImportSpecifier(t,r,s,a,p){let u=t.imported,f=null;u.type==="Identifier"&&(u.name==="type"?f="type":u.name==="typeof"&&(f="typeof"));let m=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let g=this.parseIdentifier(!0);f!==null&&!pt(this.state.type)?(t.imported=g,t.importKind=f,t.local=this.cloneIdentifier(g)):(t.imported=u,t.importKind=null,t.local=this.parseIdentifier())}else{if(f!==null&&pt(this.state.type))t.imported=this.parseIdentifier(!0),t.importKind=f;else{if(r)throw this.raise(R.ImportBindingIsString,t,{importName:u.value});t.imported=u,t.importKind=null}this.eatContextual(93)?t.local=this.parseIdentifier():(m=!0,t.local=this.cloneIdentifier(t.imported))}let x=kh(t);return s&&x&&this.raise(J.ImportTypeShorthandOnlyInPureImport,t),(s||x)&&this.checkReservedType(t.local.name,t.local.loc.start,!0),m&&!s&&!x&&this.checkReservedWord(t.local.name,t.loc.start,!0,!0),this.finishImportSpecifier(t,"ImportSpecifier")}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseFunctionParams(t,r){let s=t.kind;s!=="get"&&s!=="set"&&this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(t,r)}parseVarId(t,r){super.parseVarId(t,r),this.match(14)&&(t.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(t.id))}parseAsyncArrowFromCallExpression(t,r){if(this.match(14)){let s=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,t.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=s}return super.parseAsyncArrowFromCallExpression(t,r)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(t,r){var s;let a=null,p;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(a=this.state.clone(),p=this.tryParse(()=>super.parseMaybeAssign(t,r),a),!p.error)return p.node;let{context:m}=this.state,x=m[m.length-1];(x===ce.j_oTag||x===ce.j_expr)&&m.pop()}if((s=p)!=null&&s.error||this.match(47)){var u,f;a=a||this.state.clone();let m,x=this.tryParse(z=>{var w;m=this.flowParseTypeParameterDeclaration();let k=this.forwardNoArrowParamsConversionAt(m,()=>{let Y=super.parseMaybeAssign(t,r);return this.resetStartLocationFromNode(Y,m),Y});(w=k.extra)!=null&&w.parenthesized&&z();let F=this.maybeUnwrapTypeCastExpression(k);return F.type!=="ArrowFunctionExpression"&&z(),F.typeParameters=m,this.resetStartLocationFromNode(F,m),k},a),g=null;if(x.node&&this.maybeUnwrapTypeCastExpression(x.node).type==="ArrowFunctionExpression"){if(!x.error&&!x.aborted)return x.node.async&&this.raise(J.UnexpectedTypeParameterBeforeAsyncArrowFunction,m),x.node;g=x.node}if((u=p)!=null&&u.node)return this.state=p.failState,p.node;if(g)return this.state=x.failState,g;throw(f=p)!=null&&f.thrown?p.error:x.thrown?x.error:this.raise(J.UnexpectedTokenAfterTypeParameter,m)}return super.parseMaybeAssign(t,r)}parseArrow(t){if(this.match(14)){let r=this.tryParse(()=>{let s=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let a=this.startNode();return[a.typeAnnotation,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=s,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),a});if(r.thrown)return null;r.error&&(this.state=r.failState),t.returnType=r.node.typeAnnotation?this.finishNode(r.node,"TypeAnnotation"):null}return super.parseArrow(t)}shouldParseArrow(t){return this.match(14)||super.shouldParseArrow(t)}setArrowFunctionParameters(t,r){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start))?t.params=r:super.setArrowFunctionParameters(t,r)}checkParams(t,r,s,a=!0){if(!(s&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(t.start)))){for(let p=0;p<t.params.length;p++)this.isThisParam(t.params[p])&&p>0&&this.raise(J.ThisParamMustBeFirst,t.params[p]);super.checkParams(t,r,s,a)}}parseParenAndDistinguishExpression(t){return super.parseParenAndDistinguishExpression(t&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(t,r,s){if(t.type==="Identifier"&&t.name==="async"&&this.state.noArrowAt.includes(r.index)){this.next();let a=this.startNodeAt(r);a.callee=t,a.arguments=super.parseCallExpressionArguments(),t=this.finishNode(a,"CallExpression")}else if(t.type==="Identifier"&&t.name==="async"&&this.match(47)){let a=this.state.clone(),p=this.tryParse(f=>this.parseAsyncArrowWithTypeParameters(r)||f(),a);if(!p.error&&!p.aborted)return p.node;let u=this.tryParse(()=>super.parseSubscripts(t,r,s),a);if(u.node&&!u.error)return u.node;if(p.node)return this.state=p.failState,p.node;if(u.node)return this.state=u.failState,u.node;throw p.error||u.error}return super.parseSubscripts(t,r,s)}parseSubscript(t,r,s,a){if(this.match(18)&&this.isLookaheadToken_lt()){if(a.optionalChainMember=!0,s)return a.stop=!0,t;this.next();let p=this.startNodeAt(r);return p.callee=t,p.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),p.arguments=this.parseCallExpressionArguments(),p.optional=!0,this.finishCallExpression(p,!0)}else if(!s&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let p=this.startNodeAt(r);p.callee=t;let u=this.tryParse(()=>(p.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),p.arguments=super.parseCallExpressionArguments(),a.optionalChainMember&&(p.optional=!1),this.finishCallExpression(p,a.optionalChainMember)));if(u.node)return u.error&&(this.state=u.failState),u.node}return super.parseSubscript(t,r,s,a)}parseNewCallee(t){super.parseNewCallee(t);let r=null;this.shouldParseTypes()&&this.match(47)&&(r=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),t.typeArguments=r}parseAsyncArrowWithTypeParameters(t){let r=this.startNodeAt(t);if(this.parseFunctionParams(r,!1),!!this.parseArrow(r))return super.parseArrowExpression(r,void 0,!0)}readToken_mult_modulo(t){let r=this.input.charCodeAt(this.state.pos+1);if(t===42&&r===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(t)}readToken_pipe_amp(t){let r=this.input.charCodeAt(this.state.pos+1);if(t===124&&r===125){this.finishOp(9,2);return}super.readToken_pipe_amp(t)}parseTopLevel(t,r){let s=super.parseTopLevel(t,r);return this.state.hasFlowComment&&this.raise(J.UnterminatedFlowComment,this.state.curPosition()),s}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(J.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let t=this.skipFlowComment();t&&(this.state.pos+=t,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:t}=this.state,r=2;for(;[32,9].includes(this.input.charCodeAt(t+r));)r++;let s=this.input.charCodeAt(r+t),a=this.input.charCodeAt(r+t+1);return s===58&&a===58?r+2:this.input.slice(r+t,r+t+12)==="flow-include"?r+12:s===58&&a!==58?r:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(R.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(t,{enumName:r,memberName:s}){this.raise(J.EnumBooleanMemberNotInitialized,t,{memberName:s,enumName:r})}flowEnumErrorInvalidMemberInitializer(t,r){return this.raise(r.explicitType?r.explicitType==="symbol"?J.EnumInvalidMemberInitializerSymbolType:J.EnumInvalidMemberInitializerPrimaryType:J.EnumInvalidMemberInitializerUnknownType,t,r)}flowEnumErrorNumberMemberNotInitialized(t,r){this.raise(J.EnumNumberMemberNotInitialized,t,r)}flowEnumErrorStringMemberInconsistentlyInitialized(t,r){this.raise(J.EnumStringMemberInconsistentlyInitialized,t,r)}flowEnumMemberInit(){let t=this.state.startLoc,r=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let s=this.parseNumericLiteral(this.state.value);return r()?{type:"number",loc:s.loc.start,value:s}:{type:"invalid",loc:t}}case 134:{let s=this.parseStringLiteral(this.state.value);return r()?{type:"string",loc:s.loc.start,value:s}:{type:"invalid",loc:t}}case 85:case 86:{let s=this.parseBooleanLiteral(this.match(85));return r()?{type:"boolean",loc:s.loc.start,value:s}:{type:"invalid",loc:t}}default:return{type:"invalid",loc:t}}}flowEnumMemberRaw(){let t=this.state.startLoc,r=this.parseIdentifier(!0),s=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:t};return{id:r,init:s}}flowEnumCheckExplicitTypeMismatch(t,r,s){let{explicitType:a}=r;a!==null&&a!==s&&this.flowEnumErrorInvalidMemberInitializer(t,r)}flowEnumMembers({enumName:t,explicitType:r}){let s=new Set,a={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},p=!1;for(;!this.match(8);){if(this.eat(21)){p=!0;break}let u=this.startNode(),{id:f,init:m}=this.flowEnumMemberRaw(),x=f.name;if(x==="")continue;/^[a-z]/.test(x)&&this.raise(J.EnumInvalidMemberName,f,{memberName:x,suggestion:x[0].toUpperCase()+x.slice(1),enumName:t}),s.has(x)&&this.raise(J.EnumDuplicateMemberName,f,{memberName:x,enumName:t}),s.add(x);let g={enumName:t,explicitType:r,memberName:x};switch(u.id=f,m.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(m.loc,g,"boolean"),u.init=m.value,a.booleanMembers.push(this.finishNode(u,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(m.loc,g,"number"),u.init=m.value,a.numberMembers.push(this.finishNode(u,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(m.loc,g,"string"),u.init=m.value,a.stringMembers.push(this.finishNode(u,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(m.loc,g);case"none":switch(r){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(m.loc,g);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(m.loc,g);break;default:a.defaultedMembers.push(this.finishNode(u,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:a,hasUnknownMembers:p}}flowEnumStringMembers(t,r,{enumName:s}){if(t.length===0)return r;if(r.length===0)return t;if(r.length>t.length){for(let a of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:s});return r}else{for(let a of r)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:s});return t}}flowEnumParseExplicitType({enumName:t}){if(!this.eatContextual(102))return null;if(!pe(this.state.type))throw this.raise(J.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:t});let{value:r}=this.state;return this.next(),r!=="boolean"&&r!=="number"&&r!=="string"&&r!=="symbol"&&this.raise(J.EnumInvalidExplicitType,this.state.startLoc,{enumName:t,invalidEnumType:r}),r}flowEnumBody(t,r){let s=r.name,a=r.loc.start,p=this.flowEnumParseExplicitType({enumName:s});this.expect(5);let{members:u,hasUnknownMembers:f}=this.flowEnumMembers({enumName:s,explicitType:p});switch(t.hasUnknownMembers=f,p){case"boolean":return t.explicitType=!0,t.members=u.booleanMembers,this.expect(8),this.finishNode(t,"EnumBooleanBody");case"number":return t.explicitType=!0,t.members=u.numberMembers,this.expect(8),this.finishNode(t,"EnumNumberBody");case"string":return t.explicitType=!0,t.members=this.flowEnumStringMembers(u.stringMembers,u.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(t,"EnumStringBody");case"symbol":return t.members=u.defaultedMembers,this.expect(8),this.finishNode(t,"EnumSymbolBody");default:{let m=()=>(t.members=[],this.expect(8),this.finishNode(t,"EnumStringBody"));t.explicitType=!1;let x=u.booleanMembers.length,g=u.numberMembers.length,z=u.stringMembers.length,w=u.defaultedMembers.length;if(!x&&!g&&!z&&!w)return m();if(!x&&!g)return t.members=this.flowEnumStringMembers(u.stringMembers,u.defaultedMembers,{enumName:s}),this.expect(8),this.finishNode(t,"EnumStringBody");if(!g&&!z&&x>=w){for(let k of u.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(k.loc.start,{enumName:s,memberName:k.id.name});return t.members=u.booleanMembers,this.expect(8),this.finishNode(t,"EnumBooleanBody")}else if(!x&&!z&&g>=w){for(let k of u.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(k.loc.start,{enumName:s,memberName:k.id.name});return t.members=u.numberMembers,this.expect(8),this.finishNode(t,"EnumNumberBody")}else return this.raise(J.EnumInconsistentMemberValues,a,{enumName:s}),m()}}}flowParseEnumDeclaration(t){let r=this.parseIdentifier();return t.id=r,t.body=this.flowEnumBody(this.startNode(),r),this.finishNode(t,"EnumDeclaration")}jsxParseOpeningElementAfterName(t){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(t.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(t)}isLookaheadToken_lt(){let t=this.nextTokenStart();if(this.input.charCodeAt(t)===60){let r=this.input.charCodeAt(t+1);return r!==60&&r!==61}return!1}reScan_lt_gt(){let{type:t}=this.state;t===47?(this.state.pos-=1,this.readToken_lt()):t===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:t}=this.state;return t===51?(this.state.pos-=2,this.finishOp(47,1),47):t}maybeUnwrapTypeCastExpression(t){return t.type==="TypeCastExpression"?t.expression:t}},Ope={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},Mpe=/\r\n|[\r\n\u2028\u2029]/,Vs=new RegExp(Mpe.source,"g");function Ao(o){switch(o){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Ph(o,e,t){for(let r=e;r<t;r++)if(Ao(o.charCodeAt(r)))return!0;return!1}var hc=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,fc=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function kpe(o){switch(o){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var $t=ct`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:o})=>`Expected corresponding JSX closing tag for <${o}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:o,HTMLEntity:e})=>`Unexpected token \`${o}\`. Did you mean \`${e}\` or \`{'${o}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function vt(o){return o?o.type==="JSXOpeningFragment"||o.type==="JSXClosingFragment":!1}function yo(o){if(o.type==="JSXIdentifier")return o.name;if(o.type==="JSXNamespacedName")return o.namespace.name+":"+o.name.name;if(o.type==="JSXMemberExpression")return yo(o.object)+"."+yo(o.property);throw new Error("Node had unexpected type: "+o.type)}var Ppe=o=>class extends o{jsxReadToken(){let t="",r=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise($t.UnterminatedJsxContent,this.state.startLoc);let s=this.input.charCodeAt(this.state.pos);switch(s){case 60:case 123:if(this.state.pos===this.state.start){s===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(s);return}t+=this.input.slice(r,this.state.pos),this.finishToken(142,t);return;case 38:t+=this.input.slice(r,this.state.pos),t+=this.jsxReadEntity(),r=this.state.pos;break;default:Ao(s)?(t+=this.input.slice(r,this.state.pos),t+=this.jsxReadNewLine(!0),r=this.state.pos):++this.state.pos}}}jsxReadNewLine(t){let r=this.input.charCodeAt(this.state.pos),s;return++this.state.pos,r===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,s=t?`
5
5
  `:`\r
@@ -46,7 +46,7 @@ export default config;
46
46
  `)}se(e,{ok:!0,dryRun:t,name:o,component:s,dir:u,files:Object.keys(m),overwritten:f&&r},()=>{console.log(`\u2713 ${t?"Would scaffold":"Scaffolded"} custom component ${o} (${s}) into ${u}`);for(let g of Object.keys(m))console.log(` ${t?"would write":"wrote"} ${g}`);t||console.log(` stamped cueframe.json components.${o} (custom)`),console.log("Edit index.tsx, then `cueframe push "+o+"` to publish it to CueFrame.")})}import{existsSync as Or,readFileSync as Mr}from"fs";import{join as kr}from"path";import Ie from"typescript";var Mx="cueframe.json",kx=["effects","transitions","text","layouts"];function Px(o){return kx.includes(o??"")?o:"layouts"}function Lx(o){let e=o;for(;Ie.isAsExpression(e)||Ie.isParenthesizedExpression(e)||typeof Ie.isSatisfiesExpression=="function"&&Ie.isSatisfiesExpression(e);)e=e.expression;return e}function Dx(o,e){for(let t of o.statements)if(Ie.isImportDeclaration(t)&&Ie.isStringLiteral(t.moduleSpecifier)&&t.moduleSpecifier.text===e)return!0;return!1}function dd(o,e){let t=Ie.createSourceFile(e,o,Ie.ScriptTarget.Latest,!0,Ie.ScriptKind.TS),r;for(let a of t.statements)if(Ie.isVariableStatement(a)){for(let p of a.declarationList.declarations)if(Ie.isIdentifier(p.name)&&p.name.text==="config"&&p.initializer){let u=Lx(p.initializer);Ie.isObjectLiteralExpression(u)&&(r=u)}if(r)break}let s={};if(!r)return s;for(let a of r.properties){if(!Ie.isPropertyAssignment(a)||!(Ie.isIdentifier(a.name)||Ie.isStringLiteral(a.name)))continue;let p=a.name.text;Ie.isStringLiteralLike(a.initializer)&&(p==="name"?s.name=a.initializer.text:p==="category"?s.category=a.initializer.text:p==="version"&&(s.version=a.initializer.text))}return s}function vx(o){let e=kr(o,"config.ts");if(!Or(e))return{};let t=Mr(e,"utf8"),r=Ie.createSourceFile("config.ts",t,Ie.ScriptTarget.Latest,!0,Ie.ScriptKind.TS),s=kr(o,"_config.ts");return Dx(r,"./_config")&&Or(s)?dd(Mr(s,"utf8"),"_config.ts"):dd(t,"config.ts")}function Fx(o){return o.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function Nx(o,e){let t=kr(o.root,Mx);if(Or(t))try{let s=JSON.parse(Mr(t,"utf8")).components?.[e]?.ejectedFrom;return typeof s=="string"&&s.length>0?s:void 0}catch{return}}var wr="none \u2014 params are unvalidated server-side";function ld(o){let e=o.code;return e==="no_component_source"||e==="no_component_manifest"?B.UserError:q(o)}async function ud(o,e,t){let r=Er(o,e),s=kr(r,"index.tsx");if(!Or(s))throw Object.assign(new Error(`Component "${e}" has no index.tsx at ${r}. Scaffold it first: cueframe new component ${e}`),{code:"no_component_source"});let a=Mr(s,"utf8"),p=vx(r),u=p.name??Fx(e),f=Px(p.category),m=Nx(o,e),x=id(o,e),g=`Custom component "${e}" pushed from the local CueFrame workspace.`,z={type:"object",properties:{}};V(t,"push_component",{id:e,name:u,category:f,version:p.version,ejectedFrom:m,propSchema:wr});let w=!1;try{await Rt.getComponent(e),w=!0}catch(k){if(k instanceof Ve&&k.status===404)w=!1;else throw k}return w?(await Rt.updateComponent(e,{tsxSource:a,name:u,description:g,category:f,propSchema:z,origin:"customer-owned",manifest:x,...m?{ejectedFrom:m}:{}}),V(t,"pushed",{id:e,action:"updated"}),{id:e,action:"updated",name:u,category:f,propSchema:wr}):(await Rt.createComponent({componentId:e,tsxSource:a,name:u,description:g,category:f,propSchema:z,origin:"customer-owned",manifest:x,...m?{ejectedFrom:m}:{}}),V(t,"pushed",{id:e,action:"created"}),{id:e,action:"created",name:u,category:f,propSchema:wr})}async function md(o,e){o||(K(e,"push",new Error("Pass a component id (cueframe push <id>), or use `cueframe sync` to push all."),B.UserError),N(B.UserError)),ge(o,"id",e),re(e.target);let t=Io(process.cwd());t||(K(e,"push",new Error("No CueFrame workspace found (no cueframe.json up-tree). Run `cueframe init` first."),B.UserError),N(B.UserError)),V(e,"push_prepare",{id:o,target:e.target});try{let r=await ud(t,o,e);se(e,{ok:!0,target:e.target,...r},()=>{console.log(`\u2713 ${r.action} component ${r.id} (${r.name}) on CueFrame`),console.log(` propSchema: ${r.propSchema}`)})}catch(r){let s=ld(r);K(e,"push",r,s),N(s)}}async function hd(o){re(o.target);let e=Io(process.cwd());e||(K(o,"sync",new Error("No CueFrame workspace found (no cueframe.json up-tree). Run `cueframe init` first."),B.UserError),N(B.UserError));let t=Zp(e);V(o,"sync_prepare",{target:o.target,count:t.length,ids:t});let r=[],s=[];for(let a of t)try{r.push(await ud(e,a,o))}catch(p){let u=ld(p);Ee(o,"sync",p,u),s.push({id:a,error:p})}se(o,{ok:s.length===0,target:o.target,pushed:r,failed:s.map(a=>({id:a.id,error:ue(a.error)}))},()=>{if(r.length===0&&s.length===0){console.log("No components to sync. Scaffold one with `cueframe eject` or `cueframe new component`.");return}for(let a of r)console.log(`\u2713 ${a.action} ${a.id} (${a.name})`);r.length>0&&console.log(` propSchema: ${wr}`);for(let a of s)console.error(`\u2716 ${a.id}: ${ue(a.error)}`);console.log(`Synced ${r.length}/${t.length} component(s) to CueFrame.`)}),s.length>0&&N(q(s[0].error))}var Pr=["media","sessions","projects","renders","webhooks"],fd={readonly:Object.fromEntries(Pr.map(o=>[o,["read"]])),editall:Object.fromEntries(Pr.map(o=>[o,["read","write"]]))};function _x(o){if(o.preset){let e=fd[o.preset];return e||(console.error(`Unknown --preset "${o.preset}". Valid: ${Object.keys(fd).join(", ")}.`),N(B.UserError)),e}if(o.scope)return Bx(o.scope);console.error("Provide --scope or --preset (e.g. --preset readonly | editall)."),N(B.UserError)}function Bx(o){let e={};for(let t of o.split(",").map(r=>r.trim()).filter(Boolean)){let[r,s]=t.split(":");(!r||!s)&&(console.error(`Invalid --scope "${t}". Use resource:rw (e.g. renders:rw,media:r).`),N(B.UserError)),Pr.includes(r)||(console.error(`--scope "${t}": unknown resource "${r}". Valid: ${Pr.join(", ")}.`),N(B.UserError));let a=[];/r/i.test(s)&&a.push("read"),/w/i.test(s)&&a.push("write"),a.length===0&&(console.error(`--scope "${t}": actions must include r and/or w.`),N(B.UserError)),e[r]=a}return Object.keys(e).length===0&&(console.error("--scope is required, e.g. --scope media:rw,projects:rw,renders:rw"),N(B.UserError)),e}async function xd(o){re(o.target);let e=_x(o),t={name:o.name,permissions:e};if(o.expires){let r=Number(o.expires);(!Number.isFinite(r)||r<=0)&&(console.error("--expires must be a positive number of days."),N(B.UserError)),t.expiresIn=Math.round(r*86400)}try{let r=await Mp("/v1/api-keys",{method:"POST",body:JSON.stringify(t),headers:{"content-type":"application/json"}});se(o,{ok:!0,id:r.id,prefix:r.prefix,start:r.start,key:r.key},()=>{let s=Object.entries(e).map(([a,p])=>`${a}:${p.map(u=>u[0]).join("")}`).join(" ");console.log(`\u2713 API key "${o.name}" created \u2014 scopes: ${s}`),console.log(`
47
47
  ${r.key}
48
48
  `),console.log(" Shown ONCE \u2014 store it now (paste it into your integration; not saved here).")})}catch(r){K(o,"keys_create",r,q(r)),N(q(r))}}async function gd(o){re(o.target);let e;try{e=await qe("/api/auth/api-key/list",{method:"GET"})}catch(r){K(o,"keys_list",r,q(r)),N(q(r))}e.status>=400&&(K(o,"keys_list",new Error(`list failed (${e.status})`),Oe(e.status)),N(Oe(e.status)));let t=Array.isArray(e.body)?e.body:[];se(o,{ok:!0,keys:t},()=>{if(t.length===0){console.log("No API keys.");return}for(let r of t)console.log(` ${r.id} ${r.name??"(unnamed)"} ${r.start??""}\u2026`)})}async function bd(o,e){re(e.target);let t;try{t=await qe("/api/auth/api-key/delete",{method:"POST",body:JSON.stringify({keyId:o}),headers:{"content-type":"application/json"}})}catch(r){K(e,"keys_revoke",r,q(r)),N(q(r))}t.status>=400&&(K(e,"keys_revoke",new Error(`revoke failed (${t.status})`),Oe(t.status)),N(Oe(t.status))),se(e,{ok:!0,revoked:o},()=>console.log(`\u2713 Revoked ${o}`))}async function yd(o){re(o.target),V(o,"list_prepare",{target:o.target});try{let e=await Yt.listProjects(),t=o.limit,r=typeof t=="number"&&Number.isFinite(t)&&t>0?e.data.slice(0,t):e.data;if(V(o,"list_complete",{count:r.length,total:e.data.length,truncated:r.length<e.data.length,projects:r}),!o.json){if(e.data.length===0){console.log("No projects found.");return}for(let s of r){let a=new Date(s.createdAt).toLocaleDateString();console.log(` ${s.id} ${s.name} (${a})`)}r.length<e.data.length&&console.log(` \u2026 ${e.data.length-r.length} more (raise --limit to see all)`)}}catch(e){K(o,"list",e,q(e)),N(q(e))}}import{readFile as jx,stat as Vx}from"fs/promises";import{existsSync as Ux}from"fs";import{basename as Hx,extname as Wx}from"path";var $x=4e3,Ad=1800*1e3,Sd=5,zd={".mp4":"video/mp4",".mov":"video/quicktime",".webm":"video/webm",".mkv":"video/x-matroska",".wav":"audio/wav",".mp3":"audio/mpeg",".m4a":"audio/mp4",".aac":"audio/aac",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml"};function Gx(o,e){let t=Wx(o).toLowerCase(),r=zd[t];if(!r){let s=new Error(`Unsupported file extension "${t||"(none)"}" for ${o}. Supported: ${Object.keys(zd).join(", ")}.`);K(e,"preflight",s,B.UserError),N(B.UserError)}return r}var Td=["vo","music","sfx","ambience"];async function Lr(o,e){Ux(o)||(K(e,"preflight",new Error(`File not found: ${o}`),B.UserError),N(B.UserError));let t=Hx(o),r=(await Vx(o)).size,s=Gx(t,e);if(e.audioRole&&!Td.includes(e.audioRole)){let F=new Error(`--audio-role must be one of ${Td.join("|")} (got "${e.audioRole}")`);K(e,"preflight",F,B.UserError),N(B.UserError)}let a=e.audioRole;if(e.dryRun){V(e,"upload_dry_run",{file:t,sizeBytes:r,contentType:s,target:e.target,analyzeAfter:!!e.analyze,wouldCall:"POST /v1/media \u2192 presigned PUT \u2192 POST /v1/media/:id/finalize \u2192 poll processing"}),e.json||console.log(`[dry-run] Would upload ${t} (${(r/1024/1024).toFixed(1)} MB, ${s}) to ${e.target}.`);return}re(e.target),V(e,"upload_prepare",{file:t,sizeBytes:r,contentType:s,target:e.target});let p=Ce("Preparing upload\u2026",e.json),u,f;try{let F=await wt.createMediaUpload({filename:t,contentType:s,size:r});u=F.id,f=F.uploadUrl,p.succeed("Ready"),V(e,"upload_ready",{mediaItemId:u})}catch(F){p.fail(`Failed: ${ue(F)}`),Ee(e,"upload_prepare",F,q(F)),N(q(F))}let m=Date.now(),x=Ce(`Uploading ${t} (${(r/1024/1024).toFixed(1)} MB)\u2026`,e.json);try{let F=await jx(o),Y=await fetch(f,{method:"PUT",headers:{"Content-Type":s},body:F});if(!Y.ok)throw new Error(`presigned PUT failed: ${Y.status} ${Y.statusText}`);await wt.finalizeMedia(u,a?{audioRole:a}:{}),x.succeed(`Uploaded: ${t}`),V(e,"upload_complete",{mediaItemId:u,bytesUploaded:r,...a?{audioRole:a}:{},durationMs:Date.now()-m})}catch(F){x.fail(`Upload failed: ${ue(F)}`),Ee(e,"upload",F,B.NetworkError),N(B.NetworkError)}let g=Ce("Processing (transcription)\u2026",e.json),z=Date.now(),w=null,k=0;for(;;){if(await new Promise(F=>setTimeout(F,$x)),Date.now()-z>Ad){let F=`Processing did not complete within ${Math.round(Ad/6e4)}m. Media item ID: ${u}.`;g.fail(F),Ee(e,"process",new Error(F),B.ApiServerError),N(B.ApiServerError)}try{let F=await wt.getMedia(u);k=0;let Y=F?.processingStatus?.phase??"unknown",W=F?.processingStatus?.percent??null,ee=Math.round((Date.now()-z)/1e3),de=W!=null?` \xB7 ${Math.round(W*100)}%`:"";if(g.text=`Processing\u2026 ${Y}${de} (${ee}s)`,V(e,"process_progress",{phase:Y,percent:W,elapsedSec:ee}),Y==="complete"||Y==="completed"){g.succeed(`Ready: ${u}`),w=F,V(e,"process_complete",{mediaItemId:u,durationMs:Date.now()-z,item:F});break}if(Y==="error"){let Te=F?.processingStatus?.error??"unknown error";g.fail(`Processing failed: ${Te}`),Ee(e,"process",new Error(Te),B.ApiServerError),N(B.ApiServerError)}}catch(F){F instanceof Ve&&[401,403,404].includes(F.status)&&(g.fail(`Processing check failed: ${ue(F)}`),Ee(e,"process",F,q(F)),N(q(F))),k++,k>=Sd&&(g.fail(`Processing check failed: ${ue(F)}`),Ee(e,"process",new Error(`Processing status unreadable after ${Sd} consecutive failures: ${ue(F)}`),q(F)),N(q(F)))}}if(e.analyze){Je(`
49
- Media item ID: ${u}`,e);let{analyzeCommand:F}=await import("./analyze-4KYPG6F7.js");return await F(u,{target:e.target,wait:!0,json:e.json}),{mediaItemId:u,item:w}}return e.json||se(e,{mediaItemId:u,item:w},()=>{console.log(`
49
+ Media item ID: ${u}`,e);let{analyzeCommand:F}=await import("./analyze-Y2CE6BNM.js");return await F(u,{target:e.target,wait:!0,json:e.json}),{mediaItemId:u,item:w}}return e.json||se(e,{mediaItemId:u,item:w},()=>{console.log(`
50
50
  Media item ID: ${u}`),console.log(`
51
51
  Run \`cueframe analyze ${u} --target ${e.target}\` to generate clip suggestions.`)}),{mediaItemId:u,item:w}}function un(o){let e=Math.floor(o/60),t=Math.floor(o%60);return`${e}:${String(t).padStart(2,"0")}`}async function Ed(o,e){o!==void 0&&ge(o,"mediaItemId",e),re(e.target),V(e,"clips_prepare",{target:e.target,mode:o?"suggestions":"media-list",...o?{mediaItemId:o}:{}});try{if(!o){let r=await wt.listMedia();if(V(e,"clips_complete",{mode:"media-list",count:r.data.length,media:r.data}),!e.json){if(r.data.length===0){console.log("No media items found. Import a video first.");return}console.log("Media items (pass the ID to `cueframe clips <id>`):"),console.log("");for(let s of r.data){let a=s.duration?`${un(s.duration)} `:"",p=s.processingStatus?.phase??"unknown",u=p==="complete"?"":` [${p}]`;console.log(` ${s.id} ${s.name} ${a}${u}`)}}return}let t=await Dp.listMediaSuggestions(o);if(V(e,"clips_complete",{mode:"suggestions",mediaItemId:o,count:t.suggestions.length,suggestions:t.suggestions}),!e.json){if(t.suggestions.length===0){console.log("No clip suggestions found for this media item."),console.log("If analysis is still running, try again shortly. Otherwise the video may not have suitable clips.");return}console.log(`${t.suggestions.length} clip suggestion${t.suggestions.length!==1?"s":""}:`),console.log("");for(let r of t.suggestions){let s=`${un(r.trim.start)} \u2192 ${un(r.trim.end)}`,a=(r.trim.end-r.trim.start).toFixed(1);console.log(` ${r.id}`),console.log(` ${r.title}`),console.log(` ${s} (${a}s) ${r.format} score: ${r.score}`),r.reason&&console.log(` ${r.reason}`),console.log("")}}}catch(t){K(e,"clips",t,q(t)),N(q(t))}}import{readFileSync as Kx}from"fs";async function Cd(o,e){ge(o,"projectId",e),re(e.target),V(e,"composition_get_prepare",{projectId:o});let t=await Ro(`/v1/projects/${o}/composition`,{method:"GET"},e,"composition_get");t.status>=400&&(wo(t,e,"composition_get"),N(Oe(t.status)));let r=t.headers.etag,s=r&&Id(r);V(e,"composition_get_complete",{projectId:o,etag:s,status:t.status}),se(e,{etag:s,composition:t.body},()=>{s&&console.log(`# ETag: ${s}`),console.log(JSON.stringify(t.body,null,2))})}async function Dr(o,e){ge(o,"projectId",e),e.body||(console.error("--body is required (inline JSON, @file.json, or @- for stdin)"),N(B.UserError)),re(e.target);let t=await mn(o,e),r=await Rd(e.body);V(e,"composition_put_prepare",{projectId:o,ifMatch:t});let s=new Headers({"content-type":"application/json","if-match":t}),a=await Ro(`/v1/projects/${o}/composition`,{method:"PUT",headers:s,body:r},e,"composition_put");a.status>=400&&(wo(a,e,"composition_put"),N(Oe(a.status)));let p=a.headers.etag;return V(e,"composition_put_complete",{projectId:o,etag:p,status:a.status,response:a.body}),se(e,{etag:p,response:a.body},()=>{console.log(`Composition saved (ETag: ${p??"unknown"}).`),a.body&&typeof a.body=="object"&&console.log(JSON.stringify(a.body,null,2))}),{etag:p,response:a.body}}async function vr(o,e){ge(o,"projectId",e),e.suggestionId||(console.error("--suggestion <suggestionId> is required"),N(B.UserError)),re(e.target);let t=await mn(o,e),r;if(e.format)try{r=JSON.parse(e.format)}catch{console.error(`--format must be JSON, e.g. '{"aspectRatio":"9:16","fps":30,"resolution":"fhd"}'`),N(B.UserError)}let s=JSON.stringify({suggestionId:e.suggestionId,...r?{format:r}:{}});V(e,"composition_from_suggestion_prepare",{projectId:o,suggestionId:e.suggestionId,ifMatch:t});let a,p=t,u=0,f=3;for(;;){u++;let x=new Headers({"content-type":"application/json","if-match":p});if(a=await Ro(`/v1/projects/${o}/composition/from-suggestion`,{method:"POST",headers:x,body:s},e,"composition_from_suggestion"),!(a.status===409&&a.body?.error?.code==="stale_etag"))break;if(u>f){V(e,"composition_from_suggestion_etag_retries_exhausted",{projectId:o,attempts:f});break}V(e,"composition_from_suggestion_etag_retry",{projectId:o,attempt:u,reason:"stale_etag"}),p=await mn(o,e)}a.status>=400&&(wo(a,e,"composition_from_suggestion"),N(Oe(a.status)));let m=a.headers.etag;V(e,"composition_from_suggestion_complete",{projectId:o,suggestionId:e.suggestionId,etag:m,status:a.status,response:a.body,attempts:u}),se(e,{etag:m,response:a.body},()=>{console.log(`Composition built from suggestion ${e.suggestionId} (ETag: ${m??"unknown"}).`),a.body&&typeof a.body=="object"&&console.log(JSON.stringify(a.body,null,2))})}async function Fr(o){o.body||(console.error("--body is required (inline JSON, @file.json, or @- for stdin)"),N(B.UserError)),re(o.target);let e=await Rd(o.body);V(o,"composition_validate_prepare",{});let t=new Headers({"content-type":"application/json"}),r=await Ro("/v1/composition/validate",{method:"POST",headers:t,body:e},o,"composition_validate");return r.status>=400&&(wo(r,o,"composition_validate"),N(Oe(r.status))),V(o,"composition_validate_complete",{status:r.status}),se(o,{valid:!0},()=>{console.log("\u2713 Composition is valid.")}),{valid:!0}}function Id(o){return o.replace(/^W\//,"").replace(/-gzip(?=("?)$)/,"")}async function mn(o,e){if(e.force)return"*";if(e.ifMatch)return e.ifMatch;let t=await Ro(`/v1/projects/${o}/composition`,{method:"GET"},e,"composition_etag_fetch");if(t.status===404)return Je("No existing composition; treating as create (If-Match: *).",e),"*";t.status>=400&&(wo(t,e,"composition_etag_fetch"),N(Oe(t.status)));let r=t.headers.etag;return r||(K(e,"composition_etag_fetch",new Error("Server returned no ETag on composition GET; cannot safely thread If-Match. Pass --force to overwrite anyway."),B.ApiServerError),N(B.ApiServerError)),Id(r)}async function Rd(o){if(o.startsWith("@")){let e=o.slice(1);if(e==="-"){let t=[];for await(let r of process.stdin)t.push(Buffer.isBuffer(r)?r:Buffer.from(r));return Buffer.concat(t).toString("utf-8")}return Kx(e,"utf-8")}return o}async function Ro(o,e,t,r){try{return await qe(o,e)}catch(s){K(t,r,s,B.NetworkError),N(B.NetworkError)}}function wo(o,e,t){let r=o.body?.error,s=r?.code??"unknown",a=r?.message??o.statusText,p=qx(s,o.status,r?.details),u=Oe(o.status);e.json?K(e,t,Object.assign(new Error(a),{code:s,status:o.status,details:r?.details,advice:p}),u):(process.stderr.write(`\u2716 ${t}: ${a} (${s}, ${o.status})
52
52
  `),p&&process.stderr.write(` \u2192 ${p}
@@ -76,7 +76,7 @@ Recipe ready in project ${a.id}.`),m&&console.log(`Output: ${m.outputPath}`)}),x
76
76
  Export ID: ${r}
77
77
  Re-fetch via GET /v1/projects/${e.projectId}/exports/${r}.`),N(B.ApiServerError));let p=e.out??`./export-${r.slice(0,8)}.zip`,u=await Cde(s.outputUrl,p,e.json);V(e,"export_complete",{exportId:r,projectId:e.projectId,format:o,outputUrl:s.outputUrl,outputExpiresAt:s.outputExpiresAt,outputSizeBytes:s.outputSizeBytes,trimCacheHit:s.trimCacheHit,outputPath:u})}async function Ede(o,e,t){let r=Date.now()+(t.timeoutMs??Ef),s=t.pollIntervalMs??Tde,a=Date.now(),p=Ce("Exporting\u2026",t.json);try{for(;Date.now()<r;){let u;try{u=await gr.getExport(o,e)}catch(x){if(x instanceof Ve&&x.status>=500){await Cf(s);continue}throw p.fail(`Failed to poll: ${ue(x)}`),x}let f=Math.round((Date.now()-a)/1e3),m=Math.round((u.progress??0)*100);if(p.text=`Exporting\u2026 ${u.status}${m>0?` \xB7 ${m}%`:""} (${f}s)`,V(t,"export_progress",{exportId:e,status:u.status,progress:u.progress,elapsedSec:f}),u.status==="complete")return p.succeed(`Export complete (${f}s)`),{kind:"complete",outputUrl:u.outputUrl??null,outputExpiresAt:u.outputExpiresAt??null,outputSizeBytes:u.outputSizeBytes??null,trimCacheHit:u.trimCacheHit??null};if(u.status==="error"||u.status==="cancelled"){let x=u.error?.message??`Export ${u.status}`;return p.fail(x),{kind:"failed",message:x,error:u.error?{phase:u.error.phase,retryable:!!u.error.retryable}:null}}await Cf(s)}return p.fail(`Timed out waiting for export (${Math.round((Date.now()-a)/1e3)}s)`),{kind:"failed",message:`Timed out after ${Math.round((t.timeoutMs??Ef)/1e3)}s`,error:null}}catch(u){K(t,"export_progress",u,q(u)),N(q(u))}}async function Cde(o,e,t){let r=zde(e),s=Ce(`Downloading \u2192 ${r}\u2026`,t);try{let a=await fetch(o);if(!a.ok)throw new Error(`HTTP ${a.status}`);let p=Buffer.from(await a.arrayBuffer());return Sde(r,p),s.succeed(`Saved: ${r} (${(p.length/1024/1024).toFixed(1)} MB)`),r}catch(a){s.fail(`Download failed: ${ue(a)}`),t||console.error(`
78
78
  Export URL (7-day TTL): ${o}`),N(B.NetworkError)}}function Cf(o){return new Promise(e=>setTimeout(e,o))}async function If(o){re(o.target),V(o,"sessions_list_prepare",{});try{let e=await Co.listSessions();V(o,"sessions_list_complete",{count:e.data.length}),se(o,e,()=>{if(e.data.length===0){console.log("No sessions yet. Create one with `cueframe sessions create --name <n> --files <mediaId:role> \u2026`");return}for(let t of e.data){let r=t.muxStatus??"pending";console.log(`${t.id} ${t.fileCount} files mux:${r} ${t.name}`)}e.pagination.hasMore&&console.log(`# more \u2014 pass --after ${e.pagination.nextCursor} (raw via \`cueframe api\`)`)})}catch(e){K(o,"sessions_list",e,q(e)),N(q(e))}}async function Rf(o,e){ge(o,"sessionId",e),re(e.target),V(e,"sessions_get_prepare",{sessionId:o});try{let t=await Co.getSession(o);V(e,"sessions_get_complete",{sessionId:o}),se(e,t,()=>{console.log(JSON.stringify(t,null,2))})}catch(t){K(e,"sessions_get",t,q(t)),N(q(t))}}async function wf(o){o.name||(console.error("--name is required"),N(B.UserError)),(!o.files||o.files.length===0)&&(console.error("At least one --file <mediaId:role> is required"),N(B.UserError));let e=o.files.map((t,r)=>{let s=t.indexOf(":");return s===-1&&(console.error(`--file[${r}] must be <mediaId>:<role>. Got: ${t}`),N(B.UserError)),{mediaId:t.slice(0,s).trim(),role:t.slice(s+1).trim()}});re(o.target),V(o,"sessions_create_prepare",{name:o.name,fileCount:e.length});try{let t=await Co.createSession({name:o.name,files:e});V(o,"sessions_create_complete",{sessionId:t.id}),se(o,t,()=>{console.log(`Session created: ${t.id}`),console.log(JSON.stringify(t,null,2))})}catch(t){K(o,"sessions_create",t,q(t)),N(q(t))}}async function Of(o,e){ge(o,"sessionId",e),re(e.target),V(e,"sessions_delete_prepare",{sessionId:o});try{await Co.deleteSession(o),V(e,"sessions_delete_complete",{sessionId:o}),se(e,{ok:!0,sessionId:o},()=>{console.log(`Session ${o} deleted.`)})}catch(t){K(e,"sessions_delete",t,q(t)),N(q(t))}}function Mf(o){let e=o.commands.map(Mf);return{name:o.name(),description:o.description(),arguments:o.registeredArguments.map(t=>({name:t.name(),required:t.required,description:t.description})),options:o.options.map(t=>({flags:t.flags,description:t.description,...t.defaultValue!==void 0?{default:t.defaultValue}:{}})),...e.length>0?{subcommands:e}:{}}}function kf(o,e){let t=o.commands.map(Mf);if(e.json){V(e,"describe_complete",{name:o.name(),version:o.version()??null,commands:t});return}console.log(`${o.name()} ${o.version()??""}`.trim());for(let r of t){console.log(`
79
- ${r.name} \u2014 ${r.description}`);for(let s of r.subcommands??[])console.log(` ${r.name} ${s.name} \u2014 ${s.description}`)}}var Pf=["prod","dev","local"];function De(o){if(o===void 0)return"prod";if(Pf.includes(o))return o;console.error(`Invalid --target ${o}. Allowed: ${Pf.join(", ")}.`),N(B.UserError)}function Lf(o){if(!o)return;let e=parseInt(o,10);if(e===24||e===25||e===30||e===60)return e;console.error(`Invalid --fps ${o}. Allowed: 24, 25, 30, 60.`),N(B.UserError)}async function Df(){let o=new Ide;o.name("cueframe").description("AI-assisted video editing and rendering").version("0.4.8").option("--json","Emit a structured JSON document on stdout instead of human-formatted output. Spinners are silenced.").option("--dry-run","Validate inputs and report what would happen \u2014 no API calls, no mutations. Applies to upload, analyze, project create, render.");let e=()=>o.opts();o.command("install").description('One-line setup: wire the CueFrame MCP server into every installed agent (Claude Code / Cursor / Codex) and install the agent skills. No API key \u2014 auth is a browser "Allow" on first call.').option("-t, --target <target>","Target environment: prod (default), dev, local").option("-f, --force","Replace locally changed or untracked skills, retaining backups").action(g=>Kp({json:e().json,target:De(g.target),dryRun:e().dryRun,force:g.force})),o.command("init").description("Scaffold a CueFrame component workspace (cueframe.json + components dir) in the current repo, so `new component` has a home and the render harness can discover it.").action(()=>Qp({json:e().json,dryRun:e().dryRun})),o.command("new").description("Scaffold new owned source in the component workspace").command("component").description("Scaffold a blank custom component in cueframe/components/<name>").argument("<name>","Component id (e.g. my-badge)").option("-f, --force","Overwrite an existing non-empty component dir").action((g,z)=>pd(g,{json:e().json,dryRun:e().dryRun,force:z.force})),o.command("push").description("Publish a locally-authored component (cueframe/components/<id>/index.tsx) to CueFrame so it renders server-side. Upserts by id.").argument("[id]","Component id to push (omit and use `cueframe sync` to push all)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>md(g,{target:De(z.target),json:e().json})),o.command("sync").description("Publish EVERY component in the workspace (cueframe/components/*) to CueFrame. Upserts each by id.").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>hd({target:De(g.target),json:e().json}));let r=o.command("keys").description("Manage API keys. `keys create` mints a scoped key \u2014 run `cueframe login` first (keys cannot mint keys).");r.command("create").description("Mint a scoped API key (cf_*). Requires a logged-in session.").requiredOption("-n, --name <name>","Key name, e.g. ci-runner").option("-s, --scope <scope>","Comma-separated resource:actions, e.g. media:rw,projects:rw,renders:rw (resources: media,sessions,projects,renders,webhooks; actions r/w)").option("--preset <preset>","Scope preset instead of --scope: readonly (read all) | editall (read+write all)").option("--expires <days>","Expire after N days (default: never)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>xd({...g,target:De(g.target),json:e().json})),r.command("list").description("List your API keys.").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>gd({target:De(g.target),json:e().json})),r.command("revoke").description("Revoke an API key by id.").argument("<keyId>","Key id (from `cueframe keys list`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>bd(g,{target:De(z.target),json:e().json})),o.command("login").description("Browser-mediated sign-in (OAuth device flow). Recommended for laptops.").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--url <url>","Override the API base URL (advanced)").action(g=>gf({...g,target:De(g.target),json:e().json})),o.command("auth").description("Save a static API key (cf_live_\u2026 / cf_test_\u2026). Use for CI / headless environments.").argument("<api-key>","Your CueFrame API key").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--url <url>","Override the API base URL (advanced)").action((g,z)=>{let w=De(z.target);Fp(g),br(g,w,z.url),e().json?console.log(JSON.stringify({ok:!0,target:w},null,2)):console.log(`API key saved for target "${w}"`)}),o.command("list").description("List projects").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-n, --limit <n>","Max projects to show","10").action(g=>yd({target:De(g.target),limit:parseInt(g.limit),json:e().json}));let s=o.command("project").description("Project commands");s.command("create").description("Create a new project. With --from-suggestion, atomically build the composition from a clip suggestion in one round-trip \u2014 the project is then immediately renderable via `cueframe render <projectId>`.").requiredOption("-n, --name <name>","Project name").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --aspect <ratio>","Aspect ratio: 9:16, 1:1, 16:9","9:16").option("--fps <n>","Frame rate","30").option("--resolution <r>","Resolution: hd, fhd, 2k, 4k","fhd").option("--brand-kit <id>","Bind a brand kit id to the project").option("--from-suggestion <sug>","Clip suggestion publicId (sug_\u2026) \u2014 atomically builds the composition after project creation so render needs no further args").option("--cheap","With --from-suggestion: use the deterministic translator (no LLM, ~100ms) instead of the AI authoring pass. Useful for tests / programmatic flows.").action(async g=>{await Nr({name:g.name,target:De(g.target),aspect:g.aspect,fps:Lf(g.fps),resolution:g.resolution,brandKitId:g.brandKit,fromSuggestion:g.fromSuggestion,cheap:g.cheap,json:e().json,dryRun:e().dryRun})}),s.command("delete").description("Permanently delete a project (irreversible cleanup \u2014 removes the composition and render history).").argument("<projectId>","Project ID (from `cueframe list` or `project create`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>wd(g,{target:De(z.target),json:e().json})),o.command("media").description("Media library cleanup commands").command("delete").description("Permanently delete a media item (irreversible cleanup \u2014 removes the source and its derived assets).").argument("<mediaId>","Media item ID (from `cueframe clips`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Od(g,{target:De(z.target),json:e().json})),o.command("upload").description("Upload a video file and process it").argument("<file>","Path to video file").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --analyze","Run clip analysis after processing completes").option("-r, --audio-role <role>","Declare the audio role (vo|music|sfx|ambience) \u2014 routes ingest enrichment: vo\u2192transcript, music\u2192beat grid, sfx/ambience\u2192envelope").action(async(g,z)=>{await Lr(g,{target:De(z.target),analyze:z.analyze,audioRole:z.audioRole,json:e().json,dryRun:e().dryRun})}),o.command("analyze").description("Trigger AI clip suggestion analysis for a media item").argument("<mediaItemId>","Media item ID (from `cueframe clips`)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-w, --wait","Wait for analysis to complete and show results").action((g,z)=>Np(g,{target:De(z.target),wait:z.wait,json:e().json,dryRun:e().dryRun})),o.command("clips").description("List AI-generated clip suggestions for a media item").argument("[mediaItemId]","Media item ID (omit to list your media library)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Ed(g,{target:De(z.target),json:e().json}));let p=o.command("recipe").description("Package or run a portable CueFrame recipe");p.command("pack").description("Validate, pin authored source, and package a recipe offline. No login, upload, compilation, or rendering.").requiredOption("-b, --body <json|@file|@->","Version-1 packaging input: project draft and bundled component sources; @- reads stdin").requiredOption("-o, --out <path>","Generated .cueframe project path (replaced on success)").option("--check","Check that the output is current without writing it").action(async g=>{await xf({...g,json:e().json,dryRun:e().dryRun})}),p.command("run").description("Upload the source, create the recipe project, validate it, and render it").argument("[recipe]","Recipe slug from cueframe-ai/cueframe-recipes, local .cueframe template, or legacy directory",".").requiredOption("-m, --media <path>","Source media file for the recipe").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output MP4 path","./recipe-output.mp4").option("--no-render","Create the editable project without rendering it").action(async(g,z)=>{await Dd({directory:g,media:z.media,out:z.out,target:De(z.target),render:z.render!==!1,json:e().json,dryRun:e().dryRun})});let u=o.command("render").description("Render a project to MP4 (queues, watches via SSE, downloads). Renders whatever composition is saved on the project \u2014 build it first via `project create --from-suggestion` or `composition from-suggestion`.").allowExcessArguments(!1).argument("<projectId>","Project ID (from `cueframe list` or `project create`)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --aspect <ratio>","Aspect ratio: 9:16, 1:1, 16:9 (defaults to project format)").option("--fps <n>","Frame rate","30").option("--resolution <r>","Resolution: hd, fhd, 2k, 4k","fhd").option("-o, --out <path>","Output file path (default: ./reel-<id>.mp4)").option("--idempotency-key <key>",'Override the auto-derived Idempotency-Key. Default: sha256("render:<projectId>:<currentCompositionETag>"). Pass a fresh UUID to force a new render row.').option("--priority <p>","Routing intent: interactive (low-latency, access-gated), standard (default), background (lowest queue weight).").option("--intent <i>","Encode-quality hint: preview (fast / low-bitrate, for editor scrubbing) or final (default, full Format).").action(async(g,z)=>{await _r(g,{target:z.target,aspect:z.aspect,fps:Lf(z.fps),resolution:z.resolution,out:z.out,json:e().json,dryRun:e().dryRun,...z.idempotencyKey?{idempotencyKey:z.idempotencyKey}:{},...z.priority?{priority:z.priority}:{},...z.intent?{intent:z.intent}:{}})});o.command("api").description("Raw API call against the v1 surface (escape hatch \u2014 like `gh api`).").argument("<method>","HTTP method: GET, POST, PUT, PATCH, DELETE").argument("<path>","API path starting with /v1, e.g. /v1/projects").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-b, --body <body>","Request body (inline JSON, @file.json to read from disk, @- for stdin)").option("-H, --header <header...>",'Additional header (repeatable), e.g. -H "If-Match: \\"abc\\""').option("-i, --include","Include response status line + headers in stdout (curl-style). Lets agents read ETag etc.").action((g,z,w)=>Sf(g,z,{target:w.target,body:w.body,header:w.header,include:w.include,json:e().json})),o.command("schema").description("Print the live composition wire schema from the server (/v1/openapi.json) \u2014 discover the contract instead of guessing.").argument("[resource]","Schema to print (currently: composition)","composition").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Tf(g,{target:z.target,json:e().json}));let f=o.command("composition").description("Read/write a project's composition. ETag is threaded automatically.");f.command("validate").description("Validate a composition body against the live schema WITHOUT saving or rendering. Returns per-field errors \u2014 author safely before paying for a render.").requiredOption("-b, --body <body>","Composition JSON (inline, @file.json, or @- for stdin)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(async g=>{await Fr({target:g.target,body:g.body,json:e().json})}),f.command("get").description("Fetch the project's composition and ETag").argument("<projectId>","Project ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Cd(g,{target:z.target,json:e().json})),f.command("put").description("Replace the composition. GETs ETag first for safe concurrent writes.").argument("<projectId>","Project ID").option("-t, --target <target>","Target environment: prod (default), dev, local").requiredOption("-b, --body <body>","Composition JSON (inline, @file.json, or @- for stdin)").option("--if-match <etag>","Use this ETag (skip the GET round-trip)").option("--force","Use If-Match: * (unconditional overwrite \u2014 may clobber concurrent edits)").action(async(g,z)=>{await Dr(g,{target:z.target,body:z.body,ifMatch:z.ifMatch,force:z.force,json:e().json})}),f.command("from-suggestion").description("Build the composition from an existing clip suggestion").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--format <json>",`Optional format override, e.g. '{"aspectRatio":"9:16","fps":30,"resolution":"fhd"}'`).option("--if-match <etag>","Use this ETag (skip the GET round-trip)").option("--force","Use If-Match: * (unconditional overwrite)").action((g,z)=>vr(g,{target:z.target,suggestionId:z.suggestion,format:z.format,ifMatch:z.ifMatch,force:z.force,json:e().json})),u.command("watch").description("Reattach to an existing render and stream progress to terminal state").argument("<renderId>","Render ID (from `cueframe render` output)").requiredOption("-p, --project <projectId>","Project the render belongs to").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--no-download","Print the MP4 URL but skip downloading the file").option("-o, --out <path>","Output file path when downloading (default: ./reel-<id>.mp4)").action((g,z,w)=>{let k=w?.parent?.opts?.()?.target??z.target;return kd(g,{target:k,project:z.project,out:z.out,download:z.download!==!1,json:e().json})});let m=o.command("export").description("Hand the timeline off to a real NLE (Final Cut Pro / Premiere Pro)");m.command("fcpxml").description("Build a Final Cut Pro export zip and (optionally) wait to download it").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output zip path (default: ./export-<id>.zip)").option("--wait","Block until the export finishes, then download the artifact").action((g,z)=>Xc("fcpxml",{target:z.target,projectId:g,suggestionId:z.suggestion,out:z.out,wait:z.wait,json:e().json})),m.command("premiere").description("Build a Premiere Pro export zip and (optionally) wait to download it").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output zip path (default: ./export-<id>.zip)").option("--wait","Block until the export finishes, then download the artifact").action((g,z)=>Xc("premiere",{target:z.target,projectId:g,suggestionId:z.suggestion,out:z.out,wait:z.wait,json:e().json}));let x=o.command("sessions").description("Multi-file ingest sessions (camera A/B/screen \u2192 muxed composition)");x.command("list").description("List sessions in this org").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>If({target:g.target,json:e().json})),x.command("get").description("Get a single session by ID").argument("<sessionId>","Session ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Rf(g,{target:z.target,json:e().json})),x.command("create").description("Create a session from one or more media files").requiredOption("-n, --name <name>","Session name").requiredOption("-f, --file <entry...>","Each entry is <mediaId>:<role> (repeatable)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>wf({target:g.target,name:g.name,files:g.file,json:e().json})),x.command("delete").description("Delete a session (server checks for compositions referencing it)").argument("<sessionId>","Session ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Of(g,{target:z.target,json:e().json})),o.command("describe").description("Print the CLI command tree as structured JSON (agent introspection)").action(()=>kf(o,{json:e().json}));try{await o.parseAsync()}catch(g){let z=q(g);K(e(),"cli",Object.assign(new Error(ue(g)),{code:g?.code,status:g?.status}),z),N(z)}}await Df();
79
+ ${r.name} \u2014 ${r.description}`);for(let s of r.subcommands??[])console.log(` ${r.name} ${s.name} \u2014 ${s.description}`)}}var Pf=["prod","dev","local"];function De(o){if(o===void 0)return"prod";if(Pf.includes(o))return o;console.error(`Invalid --target ${o}. Allowed: ${Pf.join(", ")}.`),N(B.UserError)}function Lf(o){if(!o)return;let e=parseInt(o,10);if(e===24||e===25||e===30||e===60)return e;console.error(`Invalid --fps ${o}. Allowed: 24, 25, 30, 60.`),N(B.UserError)}async function Df(){let o=new Ide;o.name("cueframe").description("AI-assisted video editing and rendering").version("0.4.9").option("--json","Emit a structured JSON document on stdout instead of human-formatted output. Spinners are silenced.").option("--dry-run","Validate inputs and report what would happen \u2014 no API calls, no mutations. Applies to upload, analyze, project create, render.");let e=()=>o.opts();o.command("install").description('One-line setup: wire the CueFrame MCP server into every installed agent (Claude Code / Cursor / Codex) and install the agent skills. No API key \u2014 auth is a browser "Allow" on first call.').option("-t, --target <target>","Target environment: prod (default), dev, local").option("-f, --force","Replace locally changed or untracked skills, retaining backups").action(g=>Kp({json:e().json,target:De(g.target),dryRun:e().dryRun,force:g.force})),o.command("init").description("Scaffold a CueFrame component workspace (cueframe.json + components dir) in the current repo, so `new component` has a home and the render harness can discover it.").action(()=>Qp({json:e().json,dryRun:e().dryRun})),o.command("new").description("Scaffold new owned source in the component workspace").command("component").description("Scaffold a blank custom component in cueframe/components/<name>").argument("<name>","Component id (e.g. my-badge)").option("-f, --force","Overwrite an existing non-empty component dir").action((g,z)=>pd(g,{json:e().json,dryRun:e().dryRun,force:z.force})),o.command("push").description("Publish a locally-authored component (cueframe/components/<id>/index.tsx) to CueFrame so it renders server-side. Upserts by id.").argument("[id]","Component id to push (omit and use `cueframe sync` to push all)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>md(g,{target:De(z.target),json:e().json})),o.command("sync").description("Publish EVERY component in the workspace (cueframe/components/*) to CueFrame. Upserts each by id.").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>hd({target:De(g.target),json:e().json}));let r=o.command("keys").description("Manage API keys. `keys create` mints a scoped key \u2014 run `cueframe login` first (keys cannot mint keys).");r.command("create").description("Mint a scoped API key (cf_*). Requires a logged-in session.").requiredOption("-n, --name <name>","Key name, e.g. ci-runner").option("-s, --scope <scope>","Comma-separated resource:actions, e.g. media:rw,projects:rw,renders:rw (resources: media,sessions,projects,renders,webhooks; actions r/w)").option("--preset <preset>","Scope preset instead of --scope: readonly (read all) | editall (read+write all)").option("--expires <days>","Expire after N days (default: never)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>xd({...g,target:De(g.target),json:e().json})),r.command("list").description("List your API keys.").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>gd({target:De(g.target),json:e().json})),r.command("revoke").description("Revoke an API key by id.").argument("<keyId>","Key id (from `cueframe keys list`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>bd(g,{target:De(z.target),json:e().json})),o.command("login").description("Browser-mediated sign-in (OAuth device flow). Recommended for laptops.").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--url <url>","Override the API base URL (advanced)").action(g=>gf({...g,target:De(g.target),json:e().json})),o.command("auth").description("Save a static API key (cf_live_\u2026 / cf_test_\u2026). Use for CI / headless environments.").argument("<api-key>","Your CueFrame API key").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--url <url>","Override the API base URL (advanced)").action((g,z)=>{let w=De(z.target);Fp(g),br(g,w,z.url),e().json?console.log(JSON.stringify({ok:!0,target:w},null,2)):console.log(`API key saved for target "${w}"`)}),o.command("list").description("List projects").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-n, --limit <n>","Max projects to show","10").action(g=>yd({target:De(g.target),limit:parseInt(g.limit),json:e().json}));let s=o.command("project").description("Project commands");s.command("create").description("Create a new project. With --from-suggestion, atomically build the composition from a clip suggestion in one round-trip \u2014 the project is then immediately renderable via `cueframe render <projectId>`.").requiredOption("-n, --name <name>","Project name").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --aspect <ratio>","Aspect ratio: 9:16, 1:1, 16:9","9:16").option("--fps <n>","Frame rate","30").option("--resolution <r>","Resolution: hd, fhd, 2k, 4k","fhd").option("--brand-kit <id>","Bind a brand kit id to the project").option("--from-suggestion <sug>","Clip suggestion publicId (sug_\u2026) \u2014 atomically builds the composition after project creation so render needs no further args").option("--cheap","With --from-suggestion: use the deterministic translator (no LLM, ~100ms) instead of the AI authoring pass. Useful for tests / programmatic flows.").action(async g=>{await Nr({name:g.name,target:De(g.target),aspect:g.aspect,fps:Lf(g.fps),resolution:g.resolution,brandKitId:g.brandKit,fromSuggestion:g.fromSuggestion,cheap:g.cheap,json:e().json,dryRun:e().dryRun})}),s.command("delete").description("Permanently delete a project (irreversible cleanup \u2014 removes the composition and render history).").argument("<projectId>","Project ID (from `cueframe list` or `project create`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>wd(g,{target:De(z.target),json:e().json})),o.command("media").description("Media library cleanup commands").command("delete").description("Permanently delete a media item (irreversible cleanup \u2014 removes the source and its derived assets).").argument("<mediaId>","Media item ID (from `cueframe clips`)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Od(g,{target:De(z.target),json:e().json})),o.command("upload").description("Upload a video file and process it").argument("<file>","Path to video file").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --analyze","Run clip analysis after processing completes").option("-r, --audio-role <role>","Declare the audio role (vo|music|sfx|ambience) \u2014 routes ingest enrichment: vo\u2192transcript, music\u2192beat grid, sfx/ambience\u2192envelope").action(async(g,z)=>{await Lr(g,{target:De(z.target),analyze:z.analyze,audioRole:z.audioRole,json:e().json,dryRun:e().dryRun})}),o.command("analyze").description("Trigger AI clip suggestion analysis for a media item").argument("<mediaItemId>","Media item ID (from `cueframe clips`)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-w, --wait","Wait for analysis to complete and show results").action((g,z)=>Np(g,{target:De(z.target),wait:z.wait,json:e().json,dryRun:e().dryRun})),o.command("clips").description("List AI-generated clip suggestions for a media item").argument("[mediaItemId]","Media item ID (omit to list your media library)").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Ed(g,{target:De(z.target),json:e().json}));let p=o.command("recipe").description("Package or run a portable CueFrame recipe");p.command("pack").description("Validate, pin authored source, and package a recipe offline. No login, upload, compilation, or rendering.").requiredOption("-b, --body <json|@file|@->","Version-1 packaging input: project draft and bundled component sources; @- reads stdin").requiredOption("-o, --out <path>","Generated .cueframe project path (replaced on success)").option("--check","Check that the output is current without writing it").action(async g=>{await xf({...g,json:e().json,dryRun:e().dryRun})}),p.command("run").description("Upload the source, create the recipe project, validate it, and render it").argument("[recipe]","Recipe slug from cueframe-ai/cueframe-recipes, local .cueframe template, or legacy directory",".").requiredOption("-m, --media <path>","Source media file for the recipe").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output MP4 path","./recipe-output.mp4").option("--no-render","Create the editable project without rendering it").action(async(g,z)=>{await Dd({directory:g,media:z.media,out:z.out,target:De(z.target),render:z.render!==!1,json:e().json,dryRun:e().dryRun})});let u=o.command("render").description("Render a project to MP4 (queues, watches via SSE, downloads). Renders whatever composition is saved on the project \u2014 build it first via `project create --from-suggestion` or `composition from-suggestion`.").allowExcessArguments(!1).argument("<projectId>","Project ID (from `cueframe list` or `project create`)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-a, --aspect <ratio>","Aspect ratio: 9:16, 1:1, 16:9 (defaults to project format)").option("--fps <n>","Frame rate","30").option("--resolution <r>","Resolution: hd, fhd, 2k, 4k","fhd").option("-o, --out <path>","Output file path (default: ./reel-<id>.mp4)").option("--idempotency-key <key>",'Override the auto-derived Idempotency-Key. Default: sha256("render:<projectId>:<currentCompositionETag>"). Pass a fresh UUID to force a new render row.').option("--priority <p>","Routing intent: interactive (low-latency, access-gated), standard (default), background (lowest queue weight).").option("--intent <i>","Encode-quality hint: preview (fast / low-bitrate, for editor scrubbing) or final (default, full Format).").action(async(g,z)=>{await _r(g,{target:z.target,aspect:z.aspect,fps:Lf(z.fps),resolution:z.resolution,out:z.out,json:e().json,dryRun:e().dryRun,...z.idempotencyKey?{idempotencyKey:z.idempotencyKey}:{},...z.priority?{priority:z.priority}:{},...z.intent?{intent:z.intent}:{}})});o.command("api").description("Raw API call against the v1 surface (escape hatch \u2014 like `gh api`).").argument("<method>","HTTP method: GET, POST, PUT, PATCH, DELETE").argument("<path>","API path starting with /v1, e.g. /v1/projects").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-b, --body <body>","Request body (inline JSON, @file.json to read from disk, @- for stdin)").option("-H, --header <header...>",'Additional header (repeatable), e.g. -H "If-Match: \\"abc\\""').option("-i, --include","Include response status line + headers in stdout (curl-style). Lets agents read ETag etc.").action((g,z,w)=>Sf(g,z,{target:w.target,body:w.body,header:w.header,include:w.include,json:e().json})),o.command("schema").description("Print the live composition wire schema from the server (/v1/openapi.json) \u2014 discover the contract instead of guessing.").argument("[resource]","Schema to print (currently: composition)","composition").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Tf(g,{target:z.target,json:e().json}));let f=o.command("composition").description("Read/write a project's composition. ETag is threaded automatically.");f.command("validate").description("Validate a composition body against the live schema WITHOUT saving or rendering. Returns per-field errors \u2014 author safely before paying for a render.").requiredOption("-b, --body <body>","Composition JSON (inline, @file.json, or @- for stdin)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(async g=>{await Fr({target:g.target,body:g.body,json:e().json})}),f.command("get").description("Fetch the project's composition and ETag").argument("<projectId>","Project ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Cd(g,{target:z.target,json:e().json})),f.command("put").description("Replace the composition. GETs ETag first for safe concurrent writes.").argument("<projectId>","Project ID").option("-t, --target <target>","Target environment: prod (default), dev, local").requiredOption("-b, --body <body>","Composition JSON (inline, @file.json, or @- for stdin)").option("--if-match <etag>","Use this ETag (skip the GET round-trip)").option("--force","Use If-Match: * (unconditional overwrite \u2014 may clobber concurrent edits)").action(async(g,z)=>{await Dr(g,{target:z.target,body:z.body,ifMatch:z.ifMatch,force:z.force,json:e().json})}),f.command("from-suggestion").description("Build the composition from an existing clip suggestion").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--format <json>",`Optional format override, e.g. '{"aspectRatio":"9:16","fps":30,"resolution":"fhd"}'`).option("--if-match <etag>","Use this ETag (skip the GET round-trip)").option("--force","Use If-Match: * (unconditional overwrite)").action((g,z)=>vr(g,{target:z.target,suggestionId:z.suggestion,format:z.format,ifMatch:z.ifMatch,force:z.force,json:e().json})),u.command("watch").description("Reattach to an existing render and stream progress to terminal state").argument("<renderId>","Render ID (from `cueframe render` output)").requiredOption("-p, --project <projectId>","Project the render belongs to").option("-t, --target <target>","Target environment: prod (default), dev, local").option("--no-download","Print the MP4 URL but skip downloading the file").option("-o, --out <path>","Output file path when downloading (default: ./reel-<id>.mp4)").action((g,z,w)=>{let k=w?.parent?.opts?.()?.target??z.target;return kd(g,{target:k,project:z.project,out:z.out,download:z.download!==!1,json:e().json})});let m=o.command("export").description("Hand the timeline off to a real NLE (Final Cut Pro / Premiere Pro)");m.command("fcpxml").description("Build a Final Cut Pro export zip and (optionally) wait to download it").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output zip path (default: ./export-<id>.zip)").option("--wait","Block until the export finishes, then download the artifact").action((g,z)=>Xc("fcpxml",{target:z.target,projectId:g,suggestionId:z.suggestion,out:z.out,wait:z.wait,json:e().json})),m.command("premiere").description("Build a Premiere Pro export zip and (optionally) wait to download it").argument("<projectId>","Project ID").requiredOption("-s, --suggestion <suggestionId>","Clip suggestion publicId (sug_\u2026)").option("-t, --target <target>","Target environment: prod (default), dev, local").option("-o, --out <path>","Output zip path (default: ./export-<id>.zip)").option("--wait","Block until the export finishes, then download the artifact").action((g,z)=>Xc("premiere",{target:z.target,projectId:g,suggestionId:z.suggestion,out:z.out,wait:z.wait,json:e().json}));let x=o.command("sessions").description("Multi-file ingest sessions (camera A/B/screen \u2192 muxed composition)");x.command("list").description("List sessions in this org").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>If({target:g.target,json:e().json})),x.command("get").description("Get a single session by ID").argument("<sessionId>","Session ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Rf(g,{target:z.target,json:e().json})),x.command("create").description("Create a session from one or more media files").requiredOption("-n, --name <name>","Session name").requiredOption("-f, --file <entry...>","Each entry is <mediaId>:<role> (repeatable)").option("-t, --target <target>","Target environment: prod (default), dev, local").action(g=>wf({target:g.target,name:g.name,files:g.file,json:e().json})),x.command("delete").description("Delete a session (server checks for compositions referencing it)").argument("<sessionId>","Session ID").option("-t, --target <target>","Target environment: prod (default), dev, local").action((g,z)=>Of(g,{target:z.target,json:e().json})),o.command("describe").description("Print the CLI command tree as structured JSON (agent introspection)").action(()=>kf(o,{json:e().json}));try{await o.parseAsync()}catch(g){let z=q(g);K(e(),"cli",Object.assign(new Error(ue(g)),{code:g?.code,status:g?.status}),z),N(z)}}await Df();
80
80
  /*! Bundled license information:
81
81
 
82
82
  @noble/hashes/esm/utils.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cueframe",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "Agent-native CLI for CueFrame — author compositions and render video from the terminal (early-access preview).",
5
5
  "keywords": [
6
6
  "cueframe",
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "homepage": "https://docs.cueframe.ai",
16
16
  "author": "CueFrame, Inc.",
17
- "license": "FSL-1.1-ALv2",
17
+ "license": "AGPL-3.0-only",
18
18
  "type": "module",
19
19
  "bin": {
20
20
  "cueframe": "dist/cueframe.js"
@@ -45,10 +45,10 @@
45
45
  "tsup": "^8.5.1",
46
46
  "vitest": "^4.1.2",
47
47
  "@cueframe/component-runtime": "0.1.0",
48
+ "@cueframe/composition": "0.1.0",
48
49
  "@cueframe/plane": "0.1.0",
49
- "@cueframe/sdk": "0.2.1",
50
- "@cueframe/primitives": "0.1.0",
51
- "@cueframe/composition": "0.1.0"
50
+ "@cueframe/sdk": "0.2.2",
51
+ "@cueframe/primitives": "0.1.0"
52
52
  },
53
53
  "repository": {
54
54
  "type": "git",
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{Y as a}from"./chunk-EGBS3VAH.js";import"./chunk-MCQRX24V.js";export{a as analyzeCommand};