@cortex-js/compute-engine 0.129.0 → 0.129.1
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/esm-min/chunks/{chunk-RKFNDUDQ.js → chunk-75MH3VS7.js} +3 -3
- package/dist/esm-min/chunks/{chunk-3XFZFOXD.js → chunk-S6UB43FH.js} +1 -1
- package/dist/esm-min/cli/epsil.js +1 -1
- package/dist/esm-min/compile.js +2 -2
- package/dist/esm-min/compute-engine.js +2 -2
- package/dist/esm-min/core.js +2 -2
- package/dist/esm-min/epsil.js +3 -3
- package/dist/esm-min/identities.js +2 -2
- package/dist/esm-min/integration-rules.js +3 -3
- package/dist/esm-min/interval.js +2 -2
- package/dist/esm-min/latex-syntax.js +2 -2
- package/dist/esm-min/math-json.js +2 -2
- package/dist/esm-min/numerics.js +2 -2
- package/dist/types/big-decimal/big-decimal.d.ts +1 -1
- package/dist/types/big-decimal/index.d.ts +1 -1
- package/dist/types/big-decimal/transcendentals.d.ts +1 -1
- package/dist/types/big-decimal/utils.d.ts +1 -1
- package/dist/types/common/ansi-codes.d.ts +1 -1
- package/dist/types/common/cache-stats.d.ts +1 -1
- package/dist/types/common/configuration-change.d.ts +1 -1
- package/dist/types/common/debug-hook.d.ts +1 -1
- package/dist/types/common/debug.d.ts +1 -1
- package/dist/types/common/fuzzy-string-match.d.ts +1 -1
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/interruptible.d.ts +1 -1
- package/dist/types/common/kleene.d.ts +1 -1
- package/dist/types/common/one-of.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/styled-text.d.ts +1 -1
- package/dist/types/common/terminal.d.ts +1 -1
- package/dist/types/common/type/ast-nodes.d.ts +1 -1
- package/dist/types/common/type/boxed-type.d.ts +1 -1
- package/dist/types/common/type/compatibility.d.ts +1 -1
- package/dist/types/common/type/conditional-conformance.d.ts +1 -1
- package/dist/types/common/type/effects.d.ts +1 -1
- package/dist/types/common/type/facts.d.ts +1 -1
- package/dist/types/common/type/immutable.d.ts +1 -1
- package/dist/types/common/type/instantiate.d.ts +1 -1
- package/dist/types/common/type/intern.d.ts +1 -1
- package/dist/types/common/type/lexer.d.ts +1 -1
- package/dist/types/common/type/numeric-range.d.ts +1 -1
- package/dist/types/common/type/parse.d.ts +1 -1
- package/dist/types/common/type/parser.d.ts +1 -1
- package/dist/types/common/type/primitive.d.ts +1 -1
- package/dist/types/common/type/reduce.d.ts +1 -1
- package/dist/types/common/type/reference.d.ts +1 -1
- package/dist/types/common/type/serialize.d.ts +1 -1
- package/dist/types/common/type/size-cap.d.ts +1 -1
- package/dist/types/common/type/subtype.d.ts +1 -1
- package/dist/types/common/type/type-builder.d.ts +1 -1
- package/dist/types/common/type/types.d.ts +1 -1
- package/dist/types/common/type/utils.d.ts +1 -1
- package/dist/types/common/type/variance.d.ts +1 -1
- package/dist/types/common/type/widen-value.d.ts +1 -1
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compile.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/ambient-chain.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/async-only-descendants.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/binders.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/binding-sites.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/binding-tombstone.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-character.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-object.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/broadcast-cell-widening.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/broadcast-lift-type.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/call-result-type.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/callback-arity.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/collection-element-memo.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/conditional-value.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/constants.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/constraint-subject.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/cycle-guard.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/definition-guards.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/derive-application-type.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/diophantine.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/effects-inference.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/effects-of.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/effects-provenance.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/error-value.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/exp-to-trig.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/explain-labels.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/explain.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/function-literal.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/generic-instantiation.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/hold.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/inequality-bounds.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/inferred-annotations.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/infinite-point.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/init-lazy-refs.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/invisible-operator.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/literal-tier.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/logarithm.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/machine-number.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/match-dispatch.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/modular-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/multivariate-gcd.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/multivariate-poly.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/named-arguments.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/number-set-types.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/object-deps.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/object-walk.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/operand-descriptor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/overload.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/pattern-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomial-degree.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/predicates.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/provisional-application.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/recursive-list-builder.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/rule-index.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve-congruence.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve-domain.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve-linear-system.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve-system.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/stochastic-equal.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/tensor-view.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/tuple-pattern.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/type-compatibility-error.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/type-guards.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/type-provenance.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/value-membership.d.ts +1 -1
- package/dist/types/compute-engine/checkpoint-journal.d.ts +1 -1
- package/dist/types/compute-engine/checkpoint.d.ts +1 -1
- package/dist/types/compute-engine/clause-identity.d.ts +1 -1
- package/dist/types/compute-engine/collection-utils.d.ts +1 -1
- package/dist/types/compute-engine/compilation/angular-unit.d.ts +1 -1
- package/dist/types/compute-engine/compilation/auto-escalation.d.ts +1 -1
- package/dist/types/compute-engine/compilation/base-compiler.d.ts +1 -1
- package/dist/types/compute-engine/compilation/builtin-callback.d.ts +1 -1
- package/dist/types/compute-engine/compilation/color-space-fact.d.ts +1 -1
- package/dist/types/compute-engine/compilation/compile-expression.d.ts +1 -1
- package/dist/types/compute-engine/compilation/constant-folding.d.ts +1 -1
- package/dist/types/compute-engine/compilation/cse.d.ts +1 -1
- package/dist/types/compute-engine/compilation/deprecation-warnings.d.ts +1 -1
- package/dist/types/compute-engine/compilation/derivative-closed-form.d.ts +1 -1
- package/dist/types/compute-engine/compilation/diagnostics.d.ts +1 -1
- package/dist/types/compute-engine/compilation/fixed-width-unroll.d.ts +1 -1
- package/dist/types/compute-engine/compilation/function-purity.d.ts +1 -1
- package/dist/types/compute-engine/compilation/glsl-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/gpu-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/gpu-value-facts.d.ts +1 -1
- package/dist/types/compute-engine/compilation/interval-javascript-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/javascript-selection-fusion.d.ts +1 -1
- package/dist/types/compute-engine/compilation/javascript-statements.d.ts +1 -1
- package/dist/types/compute-engine/compilation/javascript-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/javascript-value-facts.d.ts +1 -1
- package/dist/types/compute-engine/compilation/jet-derivative.d.ts +1 -1
- package/dist/types/compute-engine/compilation/protocol-dispatch.d.ts +1 -1
- package/dist/types/compute-engine/compilation/provable-kind.d.ts +1 -1
- package/dist/types/compute-engine/compilation/python-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/storage-hints.d.ts +1 -1
- package/dist/types/compute-engine/compilation/types.d.ts +1 -1
- package/dist/types/compute-engine/compilation/wgsl-target.d.ts +1 -1
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/declaration-origin.d.ts +1 -1
- package/dist/types/compute-engine/differential-equation-utils.d.ts +1 -1
- package/dist/types/compute-engine/engine-assumptions.d.ts +1 -1
- package/dist/types/compute-engine/engine-boxing-state.d.ts +1 -1
- package/dist/types/compute-engine/engine-cache.d.ts +1 -1
- package/dist/types/compute-engine/engine-common-symbols.d.ts +1 -1
- package/dist/types/compute-engine/engine-compilation-targets.d.ts +1 -1
- package/dist/types/compute-engine/engine-configuration-lifecycle.d.ts +1 -1
- package/dist/types/compute-engine/engine-declarations.d.ts +1 -1
- package/dist/types/compute-engine/engine-expression-entrypoints.d.ts +1 -1
- package/dist/types/compute-engine/engine-extension-contracts.d.ts +1 -1
- package/dist/types/compute-engine/engine-inspectable-scope.d.ts +1 -1
- package/dist/types/compute-engine/engine-library-bootstrap.d.ts +1 -1
- package/dist/types/compute-engine/engine-numeric-configuration.d.ts +1 -1
- package/dist/types/compute-engine/engine-protocols.d.ts +1 -1
- package/dist/types/compute-engine/engine-runtime-state.d.ts +1 -1
- package/dist/types/compute-engine/engine-scope.d.ts +1 -1
- package/dist/types/compute-engine/engine-sequences.d.ts +1 -1
- package/dist/types/compute-engine/engine-simplification-rules.d.ts +1 -1
- package/dist/types/compute-engine/engine-startup-coordinator.d.ts +1 -1
- package/dist/types/compute-engine/engine-type-resolver.d.ts +1 -1
- package/dist/types/compute-engine/engine-validation-entrypoints.d.ts +1 -1
- package/dist/types/compute-engine/free-functions.d.ts +1 -1
- package/dist/types/compute-engine/function-properties/index.d.ts +1 -1
- package/dist/types/compute-engine/function-properties/types.d.ts +1 -1
- package/dist/types/compute-engine/function-utils.d.ts +1 -1
- package/dist/types/compute-engine/fungrim/loader.d.ts +1 -1
- package/dist/types/compute-engine/fungrim/types.d.ts +1 -1
- package/dist/types/compute-engine/global-types.d.ts +1 -1
- package/dist/types/compute-engine/implicit-compile.d.ts +1 -1
- package/dist/types/compute-engine/index.d.ts +1 -1
- package/dist/types/compute-engine/inference-rollback.d.ts +1 -1
- package/dist/types/compute-engine/interpret-oeis.d.ts +1 -1
- package/dist/types/compute-engine/interval/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/interval/collections.d.ts +1 -1
- package/dist/types/compute-engine/interval/comparison.d.ts +1 -1
- package/dist/types/compute-engine/interval/elementary.d.ts +1 -1
- package/dist/types/compute-engine/interval/index.d.ts +1 -1
- package/dist/types/compute-engine/interval/integrate.d.ts +1 -1
- package/dist/types/compute-engine/interval/rounding.d.ts +1 -1
- package/dist/types/compute-engine/interval/trigonometric.d.ts +1 -1
- package/dist/types/compute-engine/interval/types.d.ts +1 -1
- package/dist/types/compute-engine/interval/util.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/delimiter-tables.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/default-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-colors.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-units.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/indexed-types.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-dms.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/style-options.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/types.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/utils.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +1 -1
- package/dist/types/compute-engine/library/colors.d.ts +1 -1
- package/dist/types/compute-engine/library/combinatorics.d.ts +1 -1
- package/dist/types/compute-engine/library/complex.d.ts +1 -1
- package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
- package/dist/types/compute-engine/library/core.d.ts +1 -1
- package/dist/types/compute-engine/library/distributions.d.ts +1 -1
- package/dist/types/compute-engine/library/fractals.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +1 -1
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic-analysis.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/map-auto-compile.d.ts +1 -1
- package/dist/types/compute-engine/library/map-broadcast-shape.d.ts +1 -1
- package/dist/types/compute-engine/library/map-exact-proof.d.ts +1 -1
- package/dist/types/compute-engine/library/map-lowering.d.ts +1 -1
- package/dist/types/compute-engine/library/measurement-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/missing-data.d.ts +1 -1
- package/dist/types/compute-engine/library/number-theory.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/quantity-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
- package/dist/types/compute-engine/library/random-utils.d.ts +1 -1
- package/dist/types/compute-engine/library/regexp.d.ts +1 -1
- package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/ring-constructions.d.ts +1 -1
- package/dist/types/compute-engine/library/sets.d.ts +1 -1
- package/dist/types/compute-engine/library/special-functions.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics-data.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics.d.ts +1 -1
- package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/type-handlers.d.ts +1 -1
- package/dist/types/compute-engine/library/type-value-utils.d.ts +1 -1
- package/dist/types/compute-engine/library/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/library/units.d.ts +1 -1
- package/dist/types/compute-engine/library/utils.d.ts +1 -1
- package/dist/types/compute-engine/map-auto-compile-stats.d.ts +1 -1
- package/dist/types/compute-engine/multi-clause.d.ts +1 -1
- package/dist/types/compute-engine/nonlinear-fit.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/exact-integer-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/bernoulli.d.ts +1 -1
- package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/complex-esm-augment.d.ts +1 -1
- package/dist/types/compute-engine/numerics/differential-equations.d.ts +1 -1
- package/dist/types/compute-engine/numerics/diophantine.d.ts +1 -1
- package/dist/types/compute-engine/numerics/distributions.d.ts +1 -1
- package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
- package/dist/types/compute-engine/numerics/gauss-kronrod.d.ts +1 -1
- package/dist/types/compute-engine/numerics/interval-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
- package/dist/types/compute-engine/numerics/levenberg-marquardt.d.ts +1 -1
- package/dist/types/compute-engine/numerics/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
- package/dist/types/compute-engine/numerics/oscillatory-quadrature.d.ts +1 -1
- package/dist/types/compute-engine/numerics/polynomial-roots.d.ts +1 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/random.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/special-functions.d.ts +1 -1
- package/dist/types/compute-engine/numerics/statistics.d.ts +1 -1
- package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
- package/dist/types/compute-engine/numerics/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/numerics/value-scaled-caps.d.ts +1 -1
- package/dist/types/compute-engine/oeis.d.ts +1 -1
- package/dist/types/compute-engine/rubi/compile.d.ts +1 -1
- package/dist/types/compute-engine/rubi/driver.d.ts +1 -1
- package/dist/types/compute-engine/rubi/explain-trace.d.ts +1 -1
- package/dist/types/compute-engine/rubi/loader.d.ts +1 -1
- package/dist/types/compute-engine/rubi/match.d.ts +1 -1
- package/dist/types/compute-engine/rubi/normal-form.d.ts +1 -1
- package/dist/types/compute-engine/rubi/rubi-utils.d.ts +1 -1
- package/dist/types/compute-engine/rubi/types.d.ts +1 -1
- package/dist/types/compute-engine/sequence.d.ts +1 -1
- package/dist/types/compute-engine/sum-representation.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/angular-unit.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/antiderivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/differential-equations.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/explain-derivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-cost.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-transforms.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/interior-pole.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/interpret.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/limit.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/logic-utils.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/recurrences.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/residue.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/series.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-abs.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-divide.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-factorial.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-hyperbolic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-infinity.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-log.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-logic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-power.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-product.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-trig.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/solver-utils.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/trig-rewrite.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensor-fields.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensors.d.ts +1 -1
- package/dist/types/compute-engine/type-constructors.d.ts +1 -1
- package/dist/types/compute-engine/types-definitions.d.ts +1 -1
- package/dist/types/compute-engine/types-engine.d.ts +1 -1
- package/dist/types/compute-engine/types-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-expression.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +1 -1
- package/dist/types/core.d.ts +1 -1
- package/dist/types/epsil/characters.d.ts +1 -1
- package/dist/types/epsil/definition-sites.d.ts +1 -1
- package/dist/types/epsil/diagnostics.d.ts +1 -1
- package/dist/types/epsil/error-location.d.ts +1 -1
- package/dist/types/epsil/execute-epsil.d.ts +1 -1
- package/dist/types/epsil/formatter.d.ts +1 -1
- package/dist/types/epsil/lexer.d.ts +1 -1
- package/dist/types/epsil/library-names.d.ts +1 -1
- package/dist/types/epsil/match-exhaustiveness.d.ts +1 -1
- package/dist/types/epsil/occurrences.d.ts +1 -1
- package/dist/types/epsil/operators.d.ts +1 -1
- package/dist/types/epsil/parse-epsil.d.ts +1 -1
- package/dist/types/epsil/parser.d.ts +1 -1
- package/dist/types/epsil/reserved-words.d.ts +1 -1
- package/dist/types/epsil/resolve-library-names.d.ts +1 -1
- package/dist/types/epsil/serialize-epsil.d.ts +1 -1
- package/dist/types/epsil/signature-notes.d.ts +1 -1
- package/dist/types/epsil/static-diagnostics.d.ts +1 -1
- package/dist/types/epsil/tokens.d.ts +1 -1
- package/dist/types/epsil.d.ts +2 -2
- package/dist/types/identities.d.ts +1 -1
- package/dist/types/integration-rules.d.ts +1 -1
- package/dist/types/interval.d.ts +1 -1
- package/dist/types/latex-syntax.d.ts +2 -2
- package/dist/types/math-json/symbols.d.ts +1 -1
- package/dist/types/math-json/types.d.ts +1 -1
- package/dist/types/math-json/utils.d.ts +1 -1
- package/dist/types/math-json.d.ts +2 -2
- package/dist/types/numerics.d.ts +1 -1
- package/dist/umd-min/compile.cjs +2 -2
- package/dist/umd-min/compute-engine.cjs +2 -2
- package/dist/umd-min/core.cjs +2 -2
- package/dist/umd-min/epsil.cjs +3 -3
- package/dist/umd-min/identities.cjs +2 -2
- package/dist/umd-min/integration-rules.cjs +2 -2
- package/dist/umd-min/interval.cjs +2 -2
- package/dist/umd-min/latex-syntax.cjs +2 -2
- package/dist/umd-min/math-json.cjs +2 -2
- package/dist/umd-min/numerics.cjs +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compute Engine 0.129.
|
|
1
|
+
/** Compute Engine 0.129.1 */
|
|
2
2
|
var Kp=new Map,E0=1e5;function z(e){if(e<=E0){let n=Kp.get(e);return n===void 0&&(n=10n**BigInt(e),Kp.set(e,n)),n}return 10n**BigInt(e)}function gt(e){if(e<0n&&(e=-e),e===0n)return 0;let n=0,t=1;for(;e>>BigInt(t)>0n;)t*=2;for(let i=t>>1;i>=1;i>>=1)e>>BigInt(i)>0n&&(n+=i,e>>=BigInt(i));return n+1}function Qp(e,n,t){return e*n>>BigInt(t)}function em(e,n,t){return(e<<BigInt(t))/n}function Ho(e,n){if(e===0n)return 0n;if(e<0n)throw new RangeError("fpsqrt: negative input");let t=e<<BigInt(n),i;if(n<T0){i=bl(t);let a;do a=i,i=(i+t/i)/2n;while(Sn(i-a)>1n)}else i=xl(t,gt(t));let r=(i+t/i)/2n,s=Sn(i*i-t);return Sn(r*r-t)<s?r:i}function bl(e){let n=gt(e);if(n<=1023){let o=Math.sqrt(Number(e));if(Number.isFinite(o)&&o>=1)return BigInt(Math.floor(o))}let t=n-52,i=Number(e>>BigInt(t)),r=Math.sqrt(i);t&1&&(r*=Math.SQRT2);let s=BigInt(Math.round(r))<<BigInt(t>>1);return s>0n?s:1n}var nm=1024,T0=640;function xl(e,n){if(n<nm){let s=bl(e),o;do o=s,s=(s+e/s)/2n;while(Sn(s-o)>1n);for(;s*s>e;)s-=1n;for(;(s+1n)*(s+1n)<=e;)s+=1n;return s}let t=n>>2<<1,i=xl(e>>BigInt(t),n-t)<<BigInt(t>>1),r;do r=i,i=(i+e/i)/2n;while(Sn(i-r)>1n);for(;i*i>e;)i-=1n;for(;(i+1n)*(i+1n)<=e;)i+=1n;return i}function Sn(e){return e<0n?-e:e}function Wi(e){if(e===0n)return 1;if(e<0n&&(e=-e),e<0x20000000000000n){let i=Number(e);return i<1e8?i<1e4?i<100?i<10?1:2:i<1e3?3:4:i<1e6?i<1e5?5:6:i<1e7?7:8:i<1e12?i<1e10?i<1e9?9:10:i<1e11?11:12:i<1e14?i<1e13?13:14:i<1e15?15:16}let n=e.toString(16).length*4,t=Math.ceil(n*.30102999566398);for(;e<z(t-1);)t--;for(;e>=z(t);)t++;return t}var v0=.7;function El(e,n){if(e===0n)return 1n<<BigInt(n);let t=Math.round(v0*Math.sqrt(n)),i=t+8,r=n+i,s=BigInt(r),o=1n<<s,a=BigInt(i),u=e<<a,l=u<0n,c=l?-u:u,f=Math.max(0,gt(c)-r+t);c>>=BigInt(f),u=l?-c:c;let d=o,p=u;d+=p;for(let g=2;p=(p*u>>s)/BigInt(g),p!==0n;g++)d+=p;for(let g=0;g<f;g++)d=d*d>>s;return d+(1n<<a-1n)>>a}var N0=4e4;function Tl(e,n){let t=1n<<BigInt(n);if(e<=0n)throw new RangeError("fpln: input must be positive");return e===t?0n:n>=N0?I0(e,n):S0(e,n)}function S0(e,n){let t=BigInt(n),i=1n<<t,r=52,s=n-r,o;if(s>0){let g=Number(e>>BigInt(s))/2**r;o=BigInt(Math.round(Math.log(g)*2**r))<<BigInt(s)}else{let g=Number(e)/Number(i);o=BigInt(Math.round(Math.log(g)*Number(i)))}let a=e*El(-o,n)>>t,l=(a-i<<t)/(a+i),c=l<0n?-l:l,f=c*c>>t,d=c,p=c;for(let g=3n;d=d*f>>t,d!==0n;g+=2n)p+=d/g;return o+(l<0n?-2n:2n)*p}var ai=null;function k0(e){if(ai!==null){if(ai.bits===e)return ai.value;if(ai.bits>e)return ai.value>>BigInt(ai.bits-e)}let n=Math.ceil(e*Yo)+12,t;if(n<=Xp.length){let i=Xp.slice(0,n);t=(BigInt(i)<<BigInt(e))/z(i.length)}else t=R0(e);return ai={bits:e,value:t},t}function I0(e,n){let t=BigInt(n),i=gt(e)-n,r=Math.max(2,Math.ceil(n/2+4-i)),s=e<<BigInt(r-2),o=1n<<t,a=s;for(;Sn(o-a)>1n;){let l=o+a>>1n;a=Qr(o*a),o=l}return Wo(n)*s/(2n*o)-BigInt(r)*k0(n)}var Zi="314159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692346034861045432664821339360726024914127372458700660631558817488152092096282925409171536436789259036001133053054882046652138414695194151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793818301194912983367336244065664308602139494639522473719070217986094370277053921717629317675238467481846766940513200056812714526356082778577134275778960917363717872146844090122495343014654958537105079227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105973173281609631859502445945534690830264252230825334468503526193118817101000313783875288658753320838142061717766914730359825349042875546873115956286388235378759375195778185778053217122680661300192787661119590921642019893809525720106548586327886593615338182796823030195203530185296899577362259941389124972177528347913151557485724245415069595082953311686172785588907509838175463746493931925506040092770167113900984882401285836160356370766010471018194295559619894676783744944825537977472684710404753464620804668425906949129331367702898915210475216205696602405803815019351125338243003558764024749647326391419927260426992279678235478163600934172164121992458631503028618297455570674983850549458858692699569092721079750930295532116534498720275596023648066549911988183479775356636980742654252786255181841757467289097777279380008164706001614524919217321721477235014144197356854816136115735255213347574184946843852332390739414333454776241686251898356948556209921922218427255025425688767179049460165346680498862723279178608578438382796797668145410095388378636095068006422512520511739298489608412848862694560424196528502221066118630674427862203919494504712371378696095636437191728746776465757396241389086583264599581339047802759009946576407895126946839835259570982582262052248940772671947826848260147699090264013639443745530506820349625245174939965143142980919065925093722169646151570985838741059788595977297549893016175392846813826868386894277415599185592524595395943104997252468084598727364469584865383673622262609912460805124388439045124413654976278079771569143599770012961608944169486855584840635",Yo=Math.log10(2),Xp="693147180559945309417232121458176568075500134360255254120680009493393621969694715605863326996418687542001481020570685733685520235758130557032670751635075961930727570828371435190307038623891673471123350115364497955239120475172681574932065155524734139525882950453007095326366642654104239157814952043740430385500801944170641671518644712839968171784546957026271631064546150257207402481637773389638550695260668341137273873722928956493547025762652098859693201965058554764703306793654432547632744951250406069438147104689946506220167720424524529612687946546193165174681392672504103802546259656869144192871608293803172714367782654877566485085674077648451464439940461422603193096735402574446070308096085047486638523138181676751438667476647890881437141985494231519973548803751658612753529166100071053558249879414729509293113897155998205654392871700072180857610252368892132449713893203784393530887748259701715591070882368362758984258918535302436342143670611892367891923723146723217205340164925687274778234453534764811494186423867767744060695626573796008670762571991847340226514628379048830620330611446300737194890027436439650025809365194430411911506080948793067865158870900605203468429736193841289652556539686022194122924207574321757489097706752687115817051137009158942665478595964890653058460258668382940022833005382074005677053046787001841624044188332327983863490015631218895606505531512721993983320307514084260914790012651682434438935724727882054862715527418772430024897945401961872339808608316648114909306675193393128904316413706813977764981769748689038877899912965036192707108892641052309247839173735012298424204995689359922066022046549415106139187885744245577510206837030866619480896412186807790208181588580001688115973056186676199187395200766719214592236720602539595436541655311295175989940056000366513567569051245926825743946483168332624901803824240824231452306140963805700702551387702681785163069025513703234053802145019015374029509942262995779647427138157363801729873940704242179972266962979939312706935747240493386530879758721699645129446491883771156701678598804981838896784134938314014073166472765327635919233511233389338709513209059272185471328975470797891384445466676192702885533423429899321803769154973340267546758873236778342916191810430116091695265547859732891763545556742863877463987101912431754255888301206779210280341206879759143081283307230300883494705792496591005860012341561757413272465943",w0=13591409n,M0=545140134n,_0=10939058860032000n,A0=47.11;function Zo(e,n){if(n-e===1){let l,c;if(e===0)l=1n,c=1n;else{l=BigInt(6*e-5)*BigInt(2*e-1)*BigInt(6*e-1);let d=BigInt(e);c=d*d*d*_0}let f=l*(w0+M0*BigInt(e));return e&1&&(f=-f),[l,c,f]}let t=e+n>>1,[i,r,s]=Zo(e,t),[o,a,u]=Zo(t,n);return[i*o,r*a,a*s+i*u]}function tm(e){return Math.max(2,Math.floor(e/A0)+3)}function D0(e){let[,n,t]=Zo(0,tm(e)),i=1n<<BigInt(e),r=Qr(10005n*i*i);return n*426880n*r/t}function im(e){let[,n,t]=Zo(0,tm(Math.ceil(e/Yo))),i=z(e),r=Qr(10005n*i*i);return n*426880n*r/t}function yl(e,n){if(n-e===1){let l=e===0?1n:BigInt(2*e-1),c=e===0?1n:9n*BigInt(2*e+1);return[l,c,l]}let t=e+n>>1,[i,r,s]=yl(e,t),[o,a,u]=yl(t,n);return[i*o,r*a,a*s+i*u]}function R0(e){let n=Math.max(2,Math.ceil(e/3.169925)+5),[,t,i]=yl(0,n);return(i<<BigInt(e+1))/(3n*t)}function Qr(e){if(e<0n)throw new RangeError("bigintSqrt: negative input");if(e===0n)return 0n;let n=gt(e);if(n>=nm)return xl(e,n);let t=bl(e),i;do i=t,t=(t+e/t)/2n;while(Sn(t-i)>1n);for(;t*t>e;)t-=1n;for(;(t+1n)*(t+1n)<=e;)t+=1n;return t}var ui=null;function Wo(e){if(ui!==null){if(ui.bits===e)return ui.value;if(ui.bits>e)return ui.value>>BigInt(ui.bits-e)}let n=P0(e);return ui={bits:e,value:n},n}function P0(e){let n=Math.ceil(e*Yo)+12;if(n+1<=Zi.length){let t=Zi.slice(0,n+1);return(BigInt(t)<<BigInt(e))/z(t.length-1)}return D0(e)}function Ko(e,n){let t=BigInt(n),i=1n<<t;if(e===0n)return[0n,i];let r=Wo(n),s=2n*r,o=r/2n,a,u=Sn(e);if(u>i<<30n){let B=gt(u)-n+64,ae=n+B,ee=e<<BigInt(B),le=2n*Wo(ae),Pn=ee%le;Pn<0n&&(Pn+=le),a=Pn>>BigInt(B)}else a=e%s;a<0n&&(a+=s);let l=1n,c=1n;a>3n*o?(a=s-a,l=-1n):a>r?(a=a-r,l=-1n,c=-1n):a>o&&(a=r-a,c=-1n);let f=Math.round(n*Yo),d=Math.min(18,Math.max(2,Math.ceil(.87*Math.sqrt(f)))),p=0,g=i>>BigInt(d);for(;a>g;)a=a/2n,p++;let y=a,E=i,S=a,I=i,M=a*a,A=2n*t;for(let B=2;;B+=2){if(I=(I*M>>A)/(BigInt(B)*BigInt(B-1)),I===0n){S=(S*M>>A)/(BigInt(B+1)*BigInt(B)),S!==0n&&(B%4===2?(E-=I,y-=S):(E+=I,y+=S));break}if(S=(S*M>>A)/(BigInt(B+1)*BigInt(B)),B%4===2?(E-=I,y-=S):(E+=I,y+=S),S===0n)break}for(let B=0;B<p;B++){let ae=2n*y*E>>t,ee=(2n*E*E>>t)-i;y=ae,E=ee}return[l*y,c*E]}function Xr(e,n){if(e===0n)return 0n;if(e<0n)return-Xr(-e,n);let t=BigInt(n),i=1n<<t,s=Wo(n)/2n;if(e>i){let p=(i<<t)/e;return s-Xr(p,n)}let o=4n*i/10n,a=0,u=e;for(;u>o;){let p=u*u,g=(i<<t)+p>>t,y=Ho(g,n);u=(u<<t)/(i+y),a++}let l=u,c=u,f=u*u,d=2n*t;for(let p=3;c=c*f>>d,c!==0n;p+=2)p%4===3?l-=c/BigInt(p):l+=c/BigInt(p);for(let p=0;p<a;p++)l=2n*l;return l}var vl=NaN,b=class e{static precision=50;static ZERO=Object.freeze(Object.assign(Object.create(e.prototype),{_digits:1,significand:0n,exponent:0}));static ONE=Object.freeze(Object.assign(Object.create(e.prototype),{_digits:1,significand:1n,exponent:0}));static TWO=Object.freeze(Object.assign(Object.create(e.prototype),{_digits:1,significand:2n,exponent:0}));static NEGATIVE_ONE=Object.freeze(Object.assign(Object.create(e.prototype),{_digits:1,significand:-1n,exponent:0}));static HALF=Object.freeze(Object.assign(Object.create(e.prototype),{_digits:1,significand:5n,exponent:-1}));static NAN=Object.freeze(Object.assign(Object.create(e.prototype),{_digits:1,significand:0n,exponent:NaN}));static POSITIVE_INFINITY=Object.freeze(Object.assign(Object.create(e.prototype),{_digits:1,significand:1n,exponent:1/0}));static NEGATIVE_INFINITY=Object.freeze(Object.assign(Object.create(e.prototype),{_digits:1,significand:-1n,exponent:1/0}));static _piFullPrecision=null;static _piCache=null;static _piCachePrecision=0;static _eulerGammaCache=null;static _eulerGammaCachePrecision=0;static get PI(){let n=e.precision;if(e._piCache!==null&&e._piCachePrecision===n)return e._piCache;let t=n+4,i;if(t+1<=Zi.length)e._piFullPrecision===null&&(e._piFullPrecision=new e(Zi[0]+"."+Zi.slice(1))),i=e._piFullPrecision.toPrecision(t);else{let r=t+4;i=q(im(r),-r).toPrecision(t)}return e._piCache=i,e._piCachePrecision=n,i}static get EULER_GAMMA(){let n=e.precision;if(e._eulerGammaCache!==null&&e._eulerGammaCachePrecision>=n)return e._eulerGammaCache.toPrecision(n);let t=B0(n);return e._eulerGammaCache=t,e._eulerGammaCachePrecision=n,t}significand;exponent;_digits;_digitCount(){return this._digits??(this._digits=Wi(this.significand))}constructor(n){if(n instanceof e){this.significand=n.significand,this.exponent=n.exponent;return}if(typeof n=="bigint"){[this.significand,this.exponent]=Xo(n,0);return}if(typeof n=="number"){[this.significand,this.exponent]=F0(n);return}[this.significand,this.exponent]=am(n)}isNaN(){return Number.isNaN(this.exponent)}isZero(){return this.exponent===0&&this.significand===0n}isFinite(){return Number.isFinite(this.exponent)}isInteger(){return this.isFinite()&&this.exponent>=0}isPositive(){return this.significand>0n}isNegative(){return this.significand<0n}cmp(n){if(typeof n=="number"){if(Number.isNaN(n))return vl;let p=this.exponent;if(Number.isNaN(p))return vl;if(n===0)return this.significand===0n?0:this.significand>0n?1:-1;if(!Number.isFinite(p))return n===1/0?this.significand>0n?0:-1:n===-1/0?this.significand<0n?0:1:this.significand>0n?1:-1;if(this.significand===0n)return n>0?-1:1;if(n===1/0)return-1;if(n===-1/0)return 1;if(this.significand>0n!=n>0)return this.significand>0n?1:-1;if(Number.isInteger(n)&&p>=0&&p<=15){let g=this.significand*z(p),y=BigInt(n);return g<y?-1:g>y?1:0}n=new e(n)}let t=this.exponent,i=n.exponent,r=this.significand,s=n.significand;if(t!==t||i!==i)return vl;if(!Number.isFinite(t)||!Number.isFinite(i))return!Number.isFinite(t)&&!Number.isFinite(i)?r===s?0:r>s?1:-1:Number.isFinite(t)?s>0n?-1:1:r>0n?1:-1;if(r===0n)return s===0n?0:s>0n?-1:1;if(s===0n)return r>0n?1:-1;if(r>0n&&s<0n)return 1;if(r<0n&&s>0n)return-1;if(t===i)return r<s?-1:r>s?1:0;let o=this._digitCount(),a=n._digitCount(),u=o+t,l=a+i;if(u!==l){let p=r>0n?1:-1;return u>l?p:-p}let c=r,f=s,d=Math.abs(t-i);if(d>1e3){let p=o,g=a,y=Math.max(p,g)+1;p<y&&(c=c*z(y-p)),g<y&&(f=f*z(y-g))}else t<i?f=f*z(d):c=c*z(d);return c<f?-1:c>f?1:0}eq(n){return typeof n=="number"?n===0?this.significand===0n&&this.exponent===0:n===1?this.significand===1n&&this.exponent===0:n===-1?this.significand===-1n&&this.exponent===0:Number.isInteger(n)&&Number.isFinite(this.exponent)&&this.exponent>=0&&this.exponent<=15?this.significand*z(this.exponent)===BigInt(n):this.cmp(n)===0:this.significand===n.significand&&this.exponent===n.exponent}lt(n){return this.cmp(n)===-1}lte(n){let t=this.cmp(n);return t===-1||t===0}gt(n){return this.cmp(n)===1}gte(n){let t=this.cmp(n);return t===1||t===0}add(n){typeof n=="number"&&(n=new e(n));let t=this.exponent,i=n.exponent;if(Number.isFinite(t)&&Number.isFinite(i)){if(t===i)return q(this.significand+n.significand,t);let o=t-i;return o>0?q(this.significand*z(o)+n.significand,i):q(this.significand+n.significand*z(-o),t)}if(t!==t||i!==i)return e.NAN;let r=!Number.isFinite(t),s=!Number.isFinite(i);return r&&s?this.significand!==n.significand?e.NAN:this.significand>0n?e.POSITIVE_INFINITY:e.NEGATIVE_INFINITY:r?this.significand>0n?e.POSITIVE_INFINITY:e.NEGATIVE_INFINITY:n.significand>0n?e.POSITIVE_INFINITY:e.NEGATIVE_INFINITY}sub(n){typeof n=="number"&&(n=new e(n));let t=this.exponent,i=n.exponent;if(Number.isFinite(t)&&Number.isFinite(i)){if(t===i)return q(this.significand-n.significand,t);let o=t-i;return o>0?q(this.significand*z(o)-n.significand,i):q(this.significand-n.significand*z(-o),t)}if(t!==t||i!==i)return e.NAN;let r=!Number.isFinite(t),s=!Number.isFinite(i);return r&&s?this.significand===n.significand?e.NAN:this.significand>0n?e.POSITIVE_INFINITY:e.NEGATIVE_INFINITY:r?this.significand>0n?e.POSITIVE_INFINITY:e.NEGATIVE_INFINITY:n.significand>0n?e.NEGATIVE_INFINITY:e.POSITIVE_INFINITY}mul(n){typeof n=="number"&&(n=new e(n));let t=this.exponent,i=n.exponent;if(Number.isFinite(t)&&Number.isFinite(i))return q(this.significand*n.significand,t+i);if(t!==t||i!==i||this.significand===0n||n.significand===0n)return e.NAN;let r=this.significand>0n?1n:-1n,s=n.significand>0n?1n:-1n;return r*s>0n?e.POSITIVE_INFINITY:e.NEGATIVE_INFINITY}_mulToPrecision(n,t){typeof n=="number"&&(n=new e(n));let i=this.exponent,r=n.exponent,s=this.significand,o=n.significand;if(s!==0n&&o!==0n&&Number.isFinite(i)&&Number.isFinite(r)){let a=s*o,u=i+r,l=this._digitCount()+n._digitCount()-1,f=(a<0n?-a:a)>=z(l)?l+1:l;return f<=t?q(a,u):rm(a,u).roundToPrecKnownDigits(t,f)}return this.mul(n).toPrecision(t)}neg(){let n=this.significand;return n===0n?this:Number.isFinite(this.exponent)?q(-n,this.exponent):n>0n?e.NEGATIVE_INFINITY:e.POSITIVE_INFINITY}abs(){return this.significand>=0n?this:Number.isFinite(this.exponent)?q(-this.significand,this.exponent):e.POSITIVE_INFINITY}floor(){let n=this.exponent;if(n>=0)return this;if(Number.isFinite(n)){let t=this.trunc();return this.significand<0n?t.sub(q(1n,0)):t}return this}ceil(){let n=this.exponent;if(n>=0)return this;if(Number.isFinite(n)){let t=this.trunc();return this.significand>0n?t.add(q(1n,0)):t}return this}round(){let n=this.exponent;if(n>=0)return this;if(Number.isFinite(n)){let t=q(5n,-1);return this.significand>0n?this.add(t).trunc():this.sub(t).trunc()}return this}trunc(){let n=this.exponent;if(n>=0)return this;if(Number.isFinite(n)){let t=this.significand/z(-n);return q(t===0n?0n:t,0)}return this}div(n){typeof n=="number"&&(n=new e(n));let t=this.exponent,i=n.exponent,r=this.significand,s=n.significand;if(Number.isFinite(t)&&Number.isFinite(i)){if(s===0n)return r===0n?e.NAN:r>0n?e.POSITIVE_INFINITY:e.NEGATIVE_INFINITY;if(r===0n)return q(0n,0);let u=e.precision,l=10,c=this._digitCount(),f=n._digitCount(),d=u+l+Math.max(0,f-c),p=z(d),g=r*p/s,y=t-i-d,E=g<0n?-g:g,S=c+d-f,I=E>=z(S)?S+1:S;return rm(g,y).roundToPrecKnownDigits(u,I)}if(t!==t||i!==i)return e.NAN;let o=!Number.isFinite(t),a=!Number.isFinite(i);if(o&&a)return e.NAN;if(o){let u=r>0n?1n:-1n,l=s>0n?1n:s<0n?-1n:1n;return u*l>0n?e.POSITIVE_INFINITY:e.NEGATIVE_INFINITY}return q(0n,0)}inv(){return q(1n,0).div(this)}divToward(n,t){typeof n=="number"&&(n=new e(n));let i=this.exponent,r=n.exponent,s=this.significand,o=n.significand;if(!Number.isFinite(i)||!Number.isFinite(r)||o===0n||s===0n)return this.div(n);let a=s<0n!=o<0n,u=s<0n?-s:s,l=o<0n?-o:o,c=e.precision,d=c+10+Math.max(0,n._digitCount()-this._digitCount()),p=u*z(d),g=p/l,y=p%l!==0n,E=i-r-d,S=this._digitCount()+d-n._digitCount(),I=g>=z(S)?S+1:S,M=a?t==="floor":t==="ceiling",[A,B]=Nl(g,y,E,c,M,I);return q(a?-A:A,B)}sqrtToward(n){if(this.significand===0n)return this.exponent!==this.exponent?this:e.ZERO;if(!Number.isFinite(this.exponent))return this.significand>0n?e.POSITIVE_INFINITY:e.NAN;if(this.significand<0n)return e.NAN;let t=e.precision,i=4,r=this.significand,s=this.exponent,o=s+this._digitCount()-1,a=Math.floor(o/2),u=t+i-a;s+2*u<0&&(u=Math.ceil(-s/2)+1);let l=s+2*u,c=l>=0?r*z(l):r/z(-l),f=Qr(c),d=f*f!==c,[p,g]=Nl(f,d,-u,t,n==="ceiling");return q(p,g)}mod(n){typeof n=="number"&&(n=new e(n));let t=this.exponent,i=n.exponent;if(Number.isFinite(t)&&Number.isFinite(i)){if(n.significand===0n)return e.NAN;if(this.significand===0n)return q(0n,0);let r=t-i,s=r>=0?this.significand*z(r):this.significand,o=r>=0?n.significand:n.significand*z(-r),a=s/o;return this.sub(q(a,0).mul(n))}return t!==t||i!==i||!Number.isFinite(t)?e.NAN:new e(this)}pow(n){if(typeof n=="number"&&(n=new e(n)),this.isNaN()||n.isNaN()||!n.isFinite())return e.NAN;if(n.isInteger()){let a=n.toBigInt();if(a===0n)return q(1n,0);if(!this.isFinite())return a>0n?this.significand<0n&&a%2n!==0n?e.NEGATIVE_INFINITY:e.POSITIVE_INFINITY:q(0n,0);if(this.isZero())return a>0n?q(0n,0):e.POSITIVE_INFINITY;if(a<0n)return this.pow(n.neg()).inv();let u=this.significand<0n?-this.significand:this.significand,l=this._digitCount(),c=l>15?l-15:0,f=c>0?Number(u/10n**BigInt(c)):Number(u),d=Math.log10(f)+c+this.exponent,p=Number(a)*d;if(p>9e15)return this.significand<0n&&a%2n!==0n?e.NEGATIVE_INFINITY:e.POSITIVE_INFINITY;if(p<-9e15)return q(0n,0);let g=e.precision,y=a.toString(2).length,E=Math.min(2*y+5,100),S=g+E,I=q(1n,0),M=this,A=a;for(;A>0n;)A&1n&&(I=I._mulToPrecision(M,S)),A>>=1n,A>0n&&(M=M._mulToPrecision(M,S));return I.toPrecision(g)}if(!this.isFinite())return this.significand<0n?e.NAN:n.significand>0n?e.POSITIVE_INFINITY:e.ZERO;if(this.isZero())return n.significand>0n?e.ZERO:e.POSITIVE_INFINITY;if(this.significand<0n)return e.NAN;let t=this.exponent+this._digitCount()-1,r=n.exponent+n._digitCount()-1+Math.log10(Math.abs(t)*2.303+3)+1,s=Math.min(20,Math.max(2,Math.ceil(r)+2)),o=e.precision;e.precision=o+s;try{let a=O0(this,o+s);return n.mul(a).exp().toPrecision(o)}finally{e.precision=o}}toNumber(){return Number.isFinite(this.exponent)?this.significand===0n?0:this.exponent===0?Number(this.significand):Number(this.toString()):this.exponent!==this.exponent?NaN:this.significand>0n?1/0:-1/0}toString(){if(!Number.isFinite(this.exponent))return this.exponent!==this.exponent?"NaN":this.significand>0n?"Infinity":"-Infinity";if(this.significand===0n)return"0";let n=this.significand<0n,t=(n?-this.significand:this.significand).toString(),i=t.length,r=i+this.exponent-1,s=n?"-":"";if(r>20||r<-6){let u=i===1?t:t[0]+"."+t.slice(1),l=r>=0?"+":"";return`${s}${u}e${l}${r}`}if(this.exponent>=0)return s+t+"0".repeat(this.exponent);let o=-this.exponent;if(o<i){let u=t.slice(0,i-o),l=t.slice(i-o);return`${s}${u}.${l}`}let a=o-i;return`${s}0.${"0".repeat(a)}${t}`}toFixed(n){let t=n??0;if(!Number.isFinite(this.exponent))return this.exponent!==this.exponent?"NaN":this.significand>0n?"Infinity":"-Infinity";let i=this.significand<0n,r=i?-this.significand:this.significand,s=this.exponent+t,o,a;if(s>=0)a=r===0n,o=a?"0":r.toString()+"0".repeat(s);else{let f=z(-s),d=r/f,p=r%f,g=f/2n,y;p>g?y=d+1n:p<g||f%2n!==0n||d%2n===0n?y=d:y=d+1n,a=y===0n,o=y.toString()}let u=i&&!a?"-":"";if(t===0)return`${u}${o}`;if(o.length<=t){let f=o.padStart(t,"0");return`${u}0.${f}`}let l=o.slice(0,o.length-t),c=o.slice(o.length-t);return`${u}${l}.${c}`}toPrecision(n){if(this.significand===0n||!Number.isFinite(this.exponent))return this;let t=this._digitCount();return t<=n?this:this.roundToPrecKnownDigits(n,t)}roundToPrecKnownDigits(n,t){let i=this.significand<0n?-this.significand:this.significand,r=t-n,s=z(r),o=i/s,a=i-o*s,u=s/2n;(a>u||a===u&&o%2n!==0n)&&(o+=1n);let l=this.significand<0n?-o:o;return q(l,this.exponent+r)}toPrecisionToward(n,t){if(this.significand===0n||!Number.isFinite(this.exponent))return this;let i=this._digitCount();if(i<=n)return this;let r=this.significand<0n,[s,o]=Nl(r?-this.significand:this.significand,!1,this.exponent,n,t==="ceiling"!==r,i);return q(r?-s:s,o)}toBigInt(){if(!Number.isFinite(this.exponent))throw this.exponent!==this.exponent?new RangeError("Cannot convert NaN to BigInt"):new RangeError("Cannot convert Infinity to BigInt");if(this.exponent>=0)return this.significand*z(this.exponent);let n=z(-this.exponent);return this.significand/n}},C0=8,es=[];function O0(e,n){let t=e.significand,i=e.exponent;for(let s=es.length-1;s>=0;s--){let o=es[s];if(o.prec===n&&o.exp===i&&o.sig===t)return o.ln}let r=e.ln();return es.push({sig:t,exp:i,prec:n,ln:r}),es.length>C0&&es.shift(),r}function B0(e){let n=e+20+Math.ceil(Math.log10(e+10)),t=b.precision;b.precision=n;try{let i=Math.ceil(n*Math.LN10/4)+5,r=new b(i),s=r.mul(r),o=b.ONE,a=b.ONE,u=b.ZERO,l=b.ZERO,c=b.ONE.div(new b(10).pow(n)),f=6*i+100;for(let d=1;d<=f;d++){let p=new b(d).mul(d);if(o=o.mul(s).div(p).toPrecision(n),l=l.add(b.ONE.div(d)).toPrecision(n),a=a.add(o).toPrecision(n),u=u.add(o.mul(l)).toPrecision(n),d>i&&o.lt(a.mul(c)))break}return u.div(a).sub(r.ln()).toPrecision(e)}finally{b.precision=t}}function q(e,n){let[t,i]=Xo(e,n),r=Object.create(b.prototype);return r.significand=t,r.exponent=i,r}function rm(e,n){let t=Object.create(b.prototype);return t.significand=e,t.exponent=n,t}function Nl(e,n,t,i,r,s){if(e===0n)return[r&&n?1n:0n,t];let o=s??Wi(e);if(o<=i)return[r&&n?e+1n:e,t];let a=o-i,u=z(a),l=e/u,c=n||e%u!==0n;return r&&c&&(l+=1n),[l,t+a]}var sm=1000000000n,om=1000n;function Xo(e,n){if(e===0n)return[0n,0];if((e&1n)!==0n)return[e,n];if(e%10n!==0n)return[e,n];for(;e%sm===0n;)e/=sm,n+=9;for(;e%om===0n;)e/=om,n+=3;for(;e%10n===0n;)e/=10n,n+=1;return[e,n]}function F0(e){return Number.isNaN(e)?[0n,NaN]:e===1/0?[1n,1/0]:e===-1/0?[-1n,1/0]:Number.isInteger(e)?Xo(BigInt(e),0):am(e.toString())}function am(e){if(e=e.trim(),e===""||e==="NaN")return[0n,NaN];if(e==="Infinity"||e==="+Infinity")return[1n,1/0];if(e==="-Infinity")return[-1n,1/0];let n,t=0,i=e.search(/[eE]/);if(i!==-1){if(n=e.slice(0,i),t=Number(e.slice(i+1)),!Number.isFinite(t))return[0n,NaN]}else n=e;let r=!1;n.startsWith("-")?(r=!0,n=n.slice(1)):n.startsWith("+")&&(n=n.slice(1));let s=n.indexOf("."),o,a;s===-1?(o=n,a=""):(o=n.slice(0,s),a=n.slice(s+1)),o=o.replace(/^0+/,"")||"0";let u=o+a;if(u.length===0||!/^\d+$/.test(u))return[0n,NaN];let l=BigInt(u);r&&(l=-l);let c=-a.length;return Xo(l,c+t)}var L0=Math.log2(10),cm=Math.log10(2),V0=16,kl=1e6;function ht(e,n){let t=Math.ceil(n*L0)+V0,i=BigInt(t);return e.exponent>=0?[e.significand*z(e.exponent)<<i,t]:[(e.significand<<i)/z(-e.exponent),t]}function yt(e,n,t){if(e===0n)return b.ZERO;let i=e<0n,r=i?-e:e,s=BigInt(n),o=gt(r)-n,a=Math.floor(o*cm),u=t+4-a,l,c;if(u>=0)l=r*z(u)+(1n<<s-1n)>>s,c=-u;else{let d=z(-u)<<s;l=(r+d/2n)/d,c=-u}if(l===0n)return b.ZERO;let f=Wi(l);if(f>t){let d=f-t,p=z(d),g=p/2n,y=l%p;l=l/p,y>=g&&(l+=1n),c+=d}return q(i?-l:l,c)}function We(e){return e.exponent+e._digitCount()-1}function Sl(e,n){if(e===0n)return 0;let t=e<0n?-e:e,i=n*cm-(Wi(t)-1);return i>0?Math.ceil(i):0}var fm=5,um=BigInt(Number.MAX_SAFE_INTEGER),li=null;function dm(e){if(li!==null){if(li.bits===e)return li.value;if(li.bits>e)return li.value>>BigInt(li.bits-e)}let n=Tl(10n<<BigInt(e),e);return li={bits:e,value:n},n}b.prototype.sqrt=function(){if(this.isNaN())return b.NAN;if(this.isZero())return b.ZERO;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.NAN;if(this.significand<0n)return b.NAN;let e=b.precision,n=e+10,t=We(this),i=Math.floor(t/2),r=q(this.significand,this.exponent-2*i),[s,o]=ht(r,n),a=Ho(s,o),u=yt(a,o,e);return q(u.significand,u.exponent+i)};b.prototype.cbrt=function(){if(this.isNaN())return b.NAN;if(this.isZero())return b.ZERO;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.NEGATIVE_INFINITY;if(this.significand<0n)return this.neg().cbrt().neg();let e=b.precision,n=e+10,t=We(this),i=Math.floor(t/3),r=q(this.significand,this.exponent-3*i),[s,o]=ht(r,n),a=s<<BigInt(2*o),u,l=r.toNumber();if(o<=1e3&&Number.isFinite(l)&&l>0){let d=Number(1n<<BigInt(o)),p=Math.cbrt(l);Number.isFinite(p)&&p>0?(u=BigInt(Math.floor(p*d)),u===0n&&(u=1n)):u=lm(a)}else u=lm(a);let c;do{c=u;let d=u*u;if(d===0n){u=1n;break}u=(2n*u+a/d)/3n}while(Sn(u-c)>1n);{let d=(2n*u+a/(u*u))/3n,p=Sn(u*u*u-a);Sn(d*d*d-a)<p&&(u=d)}let f=yt(u,o,e);return q(f.significand,f.exponent+i)};b.sqrt=function(e){return e.sqrt()};b.cbrt=function(e){return e.cbrt()};b.prototype.exp=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.ZERO;if(this.isZero())return b.ONE;if(We(this)>=17)return this.significand>0n?b.POSITIVE_INFINITY:b.ZERO;let e=b.precision,n=Math.max(0,this.exponent+this._digitCount()),t=e+20+n,[i,r]=ht(this,t),s=dm(r),o=i/s,a=i-o*s;if(a<0n&&(o-=1n,a+=s),o>um||o<-um)return o>0n?b.POSITIVE_INFINITY:b.ZERO;let u=yt(El(a,r),r,e),l=u.exponent+Number(o);return Number.isSafeInteger(l)?q(u.significand,l):o>0n?b.POSITIVE_INFINITY:b.ZERO};b.prototype.ln=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.NAN;if(this.isZero())return b.NEGATIVE_INFINITY;if(this.significand<0n)return b.NAN;if(this.eq(1))return b.ZERO;let e=b.precision,n=this.significand,t=this._digitCount(),i=this.exponent+t-1,r=q(n,-(t-1)),s=Math.abs(i).toString().length,o=0;if(i===0||i===-1){let d=this.sub(b.ONE);if(!d.isZero()){let p=We(d);p<0&&(o=-p)}}let a=e+20+s+o,[u,l]=ht(r,a),c=dm(l),f=Tl(u,l)+BigInt(i)*c;return yt(f,l,e)};b.prototype.log=function(e){let n=e instanceof b?e:new b(e),t=b.precision;b.precision=t+10;try{return this.ln().div(n.ln()).toPrecision(t)}finally{b.precision=t}};b.exp=function(e){return e.exp()};b.ln=function(e){return e.ln()};b.log10=function(e){return e.log(10)};b.log2=function(e){return e.log(2)};b.prototype.sin=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return b.NAN;if(this.isZero())return b.ZERO;let e=b.precision,n=We(this);if(n<0&&-2*n>=e+4)return this.toPrecision(e);let t=e+15+(n<0?-n:0);if(n+t+30>kl)return b.NAN;let[i,r]=ht(this,t),[s]=Ko(i,r);return yt(s,r,e)};b.prototype.cos=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return b.NAN;if(this.isZero())return b.ONE;let e=b.precision,n=We(this),t=0;for(let i=0;;i++){let r=e+15+t;if(n+r+30>kl)return b.NAN;let[s,o]=ht(this,r),[,a]=Ko(s,o);if(a===0n){if(i>=3)return b.ZERO;t+=e+30;continue}let u=Sl(a,o);if(u<=t+fm||i>=3)return yt(a,o,e);t=u+5}};b.prototype.tan=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return b.NAN;if(this.isZero())return b.ZERO;let e=b.precision,n=We(this);if(n<0&&-2*n>=e+4)return this.toPrecision(e);let t=n<0?-n:0,i=0;for(let r=0;;r++){let s=e+15+t+i;if(n+s+30>kl)return b.NAN;let[o,a]=ht(this,s),[u,l]=Ko(o,a);if(l===0n){if(r>=3)return u>0n?b.POSITIVE_INFINITY:b.NEGATIVE_INFINITY;i+=e+30;continue}let c=Math.max(u===0n?0:Sl(u,a),Sl(l,a));if(c<=i+fm||r>=3){let f=(u<<BigInt(a))/l;return yt(f,a,e)}i=c+5}};b.prototype.atan=function(){if(this.isNaN())return b.NAN;if(this.isZero())return b.ZERO;if(!this.isFinite()){let o=b.PI.div(b.TWO);return this.significand>0n?o:o.neg()}let e=b.precision,n=We(this);if(n<0&&-2*n>=e+4)return this.toPrecision(e);let t=e+15+(n<0?-n:0),[i,r]=ht(this,t),s=Xr(i,r);return yt(s,r,e)};b.prototype.asin=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return b.NAN;if(this.isZero())return b.ZERO;let e=this.abs(),n=b.ONE;if(e.gt(n))return b.NAN;if(e.eq(n)){let p=b.PI.div(b.TWO);return this.significand>0n?p:p.neg()}let t=b.precision,i=We(this);if(i<0&&-2*i>=t+4)return this.toPrecision(t);let r=t+20+(i<0?-i:0),[s,o]=ht(this,r),a=1n<<BigInt(o),u=Qp(s,s,o),l=a-u,c=Ho(l,o),f=em(s,c,o),d=Xr(f,o);return yt(d,o,t)};b.prototype.acos=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return b.NAN;if(this.abs().gt(b.ONE))return b.NAN;if(this.eq(1))return b.ZERO;if(this.eq(-1))return b.PI;let n=b.precision,t=b.precision;b.precision=n+10;try{let i=b.TWO;if(this.significand>=0n){let s=b.ONE.sub(this)._mulToPrecision(b.HALF,n+10).sqrt();return i._mulToPrecision(s.asin(),n)}let r=b.ONE.add(this)._mulToPrecision(b.HALF,n+10).sqrt();return b.PI.sub(i.mul(r.asin())).toPrecision(n)}finally{b.precision=t}};b.sin=function(e){return e.sin()};b.cos=function(e){return e.cos()};b.tan=function(e){return e.tan()};b.asin=function(e){return e.asin()};b.acos=function(e){return e.acos()};b.atan=function(e){return e.atan()};b.atan2=function(e,n){let t=e instanceof b?e:new b(e);if(t.isNaN()||n.isNaN())return b.NAN;let i=b.PI,r=i.div(b.TWO);if(n.isZero())return t.isZero()?b.ZERO:t.significand>0n?r:r.neg();let s=t.div(n);return n.significand>0n?s.atan():t.significand>=0n?s.atan().add(i):s.atan().sub(i)};b.prototype.sinh=function(){if(this.isNaN())return b.NAN;if(this.isZero())return b.ZERO;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.NEGATIVE_INFINITY;let e=b.precision,n=We(this);if(n<0){if(-2*n>=e+4)return this.toPrecision(e);let r=b.precision;b.precision=e-n+5;try{let s=this.exp();return s.sub(s.inv())._mulToPrecision(b.HALF,e)}finally{b.precision=r}}if(Math.abs(this.toNumber())>1.16*(e+3)){let r=this.abs().exp().div(b.TWO);return this.significand>0n?r:r.neg()}let t=this.exp(),i=t.inv();return t.sub(i).div(b.TWO)};b.prototype.cosh=function(){if(this.isNaN())return b.NAN;if(this.isZero())return b.ONE;if(!this.isFinite())return b.POSITIVE_INFINITY;let e=b.precision;if(Math.abs(this.toNumber())>1.16*(e+3))return this.abs().exp().div(b.TWO);let n=this.exp(),t=n.inv();return n.add(t).div(b.TWO)};b.prototype.tanh=function(){if(this.isNaN())return b.NAN;if(this.isZero())return b.ZERO;if(!this.isFinite())return this.significand>0n?b.ONE:b.NEGATIVE_ONE;let e=b.precision,n=We(this);if(n<0){if(-2*n>=e+4)return this.toPrecision(e);let i=b.precision;b.precision=e-n+5;try{let r=this.mul(b.TWO).exp();return r.sub(b.ONE).div(r.add(b.ONE)).toPrecision(e)}finally{b.precision=i}}if(Math.abs(this.toNumber())>1.16*(e+3))return this.significand>0n?b.ONE:b.NEGATIVE_ONE;let t=this.mul(b.TWO).exp();return t.sub(b.ONE).div(t.add(b.ONE))};b.sinh=function(e){return e.sinh()};b.cosh=function(e){return e.cosh()};b.tanh=function(e){return e.tanh()};b.prototype.expm1=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.NEGATIVE_ONE;if(this.isZero())return b.ZERO;let e=b.precision,n=We(this);if(n<0&&-n>=e+2)return this.toPrecision(e);if(n<0){let t=b.precision;b.precision=e-n+5;try{return this.exp().sub(b.ONE).toPrecision(e)}finally{b.precision=t}}return this.exp().sub(b.ONE)};b.prototype.log1p=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.NAN;if(this.isZero())return b.ZERO;let e=b.ONE.add(this);if(e.isZero())return b.NEGATIVE_INFINITY;if(e.significand<0n)return b.NAN;let n=b.precision,t=We(this);if(t<0&&-t>=n+2)return this.toPrecision(n);if(t<0){let i=b.precision;b.precision=n-t+5;try{return b.ONE.add(this).ln().toPrecision(n)}finally{b.precision=i}}return b.ONE.add(this).ln()};b.prototype.asinh=function(){if(this.isNaN())return b.NAN;if(this.isZero())return b.ZERO;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.NEGATIVE_INFINITY;let e=this.significand<0n,n=this.abs(),t=b.precision,i=We(this);if(i<0&&-2*i>=t+4)return this.toPrecision(t);let r=()=>n.add(n.mul(n).add(b.ONE).sqrt()).ln(),s;if(i<0){let o=b.precision;b.precision=t-i+5;try{s=r().toPrecision(t)}finally{b.precision=o}}else s=r();return e?s.neg():s};b.prototype.acosh=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:b.NAN;if(this.lt(b.ONE))return b.NAN;if(this.eq(1))return b.ZERO;let e=this.sub(b.ONE).div(b.TWO).sqrt();return b.TWO.mul(e.asinh())};b.prototype.atanh=function(){if(this.isNaN())return b.NAN;if(!this.isFinite())return b.NAN;if(this.isZero())return b.ZERO;let e=this.abs();if(e.eq(1))return this.significand>0n?b.POSITIVE_INFINITY:b.NEGATIVE_INFINITY;if(e.gt(b.ONE))return b.NAN;let n=b.precision,t=We(this);if(-2*t>=n+4)return this.toPrecision(n);let i=b.precision;b.precision=n-t+5;try{return b.ONE.add(this).div(b.ONE.sub(this)).ln()._mulToPrecision(b.HALF,n)}finally{b.precision=i}};b.prototype.nthRoot=function(e){if(this.isNaN()||!Number.isInteger(e)||e===0)return b.NAN;if(e===1)return this;if(e===2)return this.sqrt();if(e===3)return this.cbrt();if(e<0)return this.nthRoot(-e).inv();if(this.isZero())return b.ZERO;if(!this.isFinite())return this.significand>0n?b.POSITIVE_INFINITY:e%2===0?b.NAN:b.NEGATIVE_INFINITY;if(this.significand<0n)return e%2===0?b.NAN:this.neg().nthRoot(e).neg();let n=b.precision,t=b.precision;b.precision=n+8;try{return b.exp(this.ln().div(new b(e))).toPrecision(n)}finally{b.precision=t}};b.asinh=function(e){return e.asinh()};b.acosh=function(e){return e.acosh()};b.atanh=function(e){return e.atanh()};b.expm1=function(e){return e.expm1()};b.log1p=function(e){return e.log1p()};b.nthRoot=function(e,n){return e.nthRoot(n)};function lm(e){let n=gt(e);if(n<=1023){let u=Math.cbrt(Number(e));if(Number.isFinite(u)&&u>=1)return BigInt(Math.floor(u))}let t=n-51,i=Number(e>>BigInt(t)),r=Math.cbrt(i),s=Math.floor(t/3),o=t%3;o===1&&(r*=1.2599210498948732),o===2&&(r*=1.5874010519681994);let a=BigInt(Math.round(r))<<BigInt(s);return a>0n?a:1n}var pm=0;function v_(){return pm}var he=class extends Error{cause;value;attribution;spans;constructor({message:n,value:t,cause:i,attribution:r,spans:s}={}){super(n??"Operation canceled"),t&&(this.value=t),this.cause=i,r!==void 0&&(this.attribution=r),s!==void 0&&(this.spans=s),this.name="CancellationError",i==="iteration-limit-exceeded"&&(pm+=1)}};function en(e){if(e===void 0)return;let n=typeof e=="number"?e:e.at;if(Date.now()>=n)throw typeof e=="number"?new he({cause:"timeout",message:"Timeout exceeded"}):new he({cause:"timeout",message:"Timeout exceeded",attribution:e.owner,spans:e.spans})}function N_(e){return e instanceof Error&&e.name==="CancellationError"&&e.cause==="timeout"}var Qo;function ea(){return Qo}function mm(e,n){let t=Qo;Qo=e;try{return n()}finally{Qo=t}}async function S_(e,n,t,i){let r=performance.now(),s;for(;;){let o=performance.now(),a=16;for(;performance.now()-o<a;){let{done:u,value:l}=e.next(s);if(s=void 0,u)return l;if($0(l)&&(s=await l),t?.aborted)throw new he({value:l,cause:t.reason});if(performance.now()-r>=n)throw new he({value:l,cause:"timeout",message:`Timeout exceeded (${n}ms)`,attribution:i?.owner,spans:i?.spans})}await new Promise(u=>setTimeout(u,0))}}function $0(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function k_(e,n,t){let i=Date.now();for(;;){let{done:r,value:s}=e.next();if(r)return s;if(Date.now()-i>=n)throw new he({value:s,cause:"timeout",message:`Timeout exceeded (${n}ms)`,attribution:t?.owner,spans:t?.spans})}}var ci=[],gm=0;function w_(){return gm}var hm=!1,ym=new WeakSet;function M_(e){hm=!0,ym.add(e)}function ns(){return hm}function __(e){return ym.has(e)}function Il(){ci.push([])}function wl(){let e=ci.pop();return e===void 0||e.length===0?void 0:e}function A_(e,n){if(gm+=1,ci.length!==0)for(let t of ci)Ml(t,e,n)}function bm(e){if(!(e===void 0||ci.length===0))for(let[n,t]of e){let i=n.deref();if(i===void 0){for(let r of ci)r.push([n,t]);continue}for(let r of ci)Ml(r,i,t)}}function xm(e,n){if(n===void 0)return e;if(e===void 0)return n;for(let[t,i]of n){let r=t.deref();r===void 0?e.push([t,i]):Ml(e,r,i)}return e}function Em(e){if(e===void 0)return!0;for(let[n,t]of e){let i=n.deref();if(i===void 0||i._version!==t)return!1}return!0}function Ml(e,n,t){for(let i of e)if(i[0].deref()===n){t<i[1]&&(i[1]=t);return}e.push([new WeakRef(n),t])}function J0(e){let n=e;return n!=null&&typeof n=="object"&&"_kind"in n&&typeof n._kind=="string"}function P_(e){return J0(e)}function v(e){return e?._kind==="number"}function N(e,n){return e?._kind==="symbol"&&(n===void 0||e.symbol===n)}function C_(e){return N(e,"Missing")||v(e)&&e.isNaN===!0}function m(e,n){return e?._kind==="function"&&(n===void 0||e.operator===n)}function O(e){return e?._kind==="string"}function He(e){return e?._kind==="character"}function Al(e){if(!m(e,"List"))return!1;let n=e.type.type;return typeof n!="string"&&n.kind==="list"&&n.dimensions!==void 0}function Pe(e){return e?._kind==="dictionary"}function ye(e){return e?._kind==="object"}function O_(e,n){return e?._kind==="object"&&e.engine!==n}function _l(e,n,t){if(e===null||typeof e!="object")return!1;let i=e;if(i._kind===void 0)return!1;let r=t.get(i);if(r!==void 0)return r;let s;return ye(i)?s=i.engine!==n:m(i)?s=i.ops.some(o=>_l(o,n,t)):Pe(i)?s=i.values.some(o=>_l(o,n,t)):s=!1,t.set(i,s),s}function B_(e,n){if(!ns())return!1;let t=new Map;return e.some(i=>_l(i,n,t))}function F_(e){return e?.isCollection===!0}function L_(e){return e?.isIndexedCollection===!0}function Cn(e){if(N(e,"ContinuationPlaceholder"))return!0;if(m(e,"Negate")){let n=e;return n.nops===1&&N(n.ops[0],"ContinuationPlaceholder")}return!1}function ts(e){return Cn(e)?!0:m(e,"Multiply")||m(e,"Sequence")?e.ops.some(ts):!1}function Tm(e){return m(e,"Multiply")&&ts(e)}function mn(e){return v(e)?e.numericValue:void 0}function V(e){return e?._kind==="symbol"?e.symbol:void 0}var na=["number","complex","imaginary","real","rational","integer","infinity","nan"],Dl=["indexed_collection","list","tuple","range","string"],ta=Object.freeze({kind:"indexed_collection",elements:"integer"}),ia=Object.freeze({kind:"indexed_collection",elements:"character"}),Rl=Object.freeze({kind:"list",elements:"unknown"}),Pl=Object.freeze({kind:"set",elements:"unknown"}),is=Object.freeze({kind:"dictionary",values:"unknown"}),ra=Object.freeze({kind:"collection",elements:"unknown"}),rs=Object.freeze({kind:"indexed_collection",elements:"unknown"}),On=Object.freeze({kind:"collection",elements:"any"}),fi=Object.freeze({kind:"indexed_collection",elements:"any"}),$_=Object.freeze({kind:"dictionary",values:"any"}),ss=Object.freeze({kind:"union",types:[{kind:"value",value:1/0},{kind:"value",value:-1/0}]}),Cl=Object.freeze({kind:"union",types:["real",{kind:"value",value:1/0},{kind:"value",value:-1/0}]}),sa=[...Dl,"collection","set","record","dictionary"],oa=["scalar",...na,"boolean","character"],Ol=["value","color","regexp","type","object",...sa,...oa],Bl=["expression","symbol","function",...Ol],Fl=["any","unknown","nothing","missing","never","error",...Bl],nt=new Set(na),vm=new Set(sa),Nm=new Set(oa),di=new Set(Fl),os="Variadic arguments cannot be used with optional arguments";function nn(e){if(typeof e=="string")return!1;switch(e.kind){case"signature":return(e.optArgs?.length??0)>0&&e.variadicArg!==void 0?!0:nn(e.result)||(e.args?.some(n=>nn(n.type))??!1)||(e.optArgs?.some(n=>nn(n.type))??!1)||e.variadicArg!==void 0&&nn(e.variadicArg.type)||(e.typeParams?.some(n=>n.bound!==void 0&&nn(n.bound))??!1);case"record":case"object":return Object.values(e.elements).some(nn);case"union":case"intersection":return e.types.some(nn);case"negation":return nn(e.type);case"list":case"set":case"collection":case"indexed_collection":case"broadcastable":return nn(e.elements);case"dictionary":return nn(e.values);case"tuple":return e.elements.some(n=>nn(n.type));case"reference":return e.args?.some(nn)??!1;default:return!1}}function Hi(e){return typeof e!="string"?!1:di.has(e)}function as(e){return typeof e=="string"?di.has(e):typeof e!="object"||!("kind"in e)?!1:e.kind==="signature"||e.kind==="union"||e.kind==="intersection"||e.kind==="negation"||e.kind==="value"||e.kind==="tuple"||e.kind==="list"||e.kind==="record"||e.kind==="object"||e.kind==="dictionary"||e.kind==="set"||e.kind==="broadcastable"||e.kind==="symbol"||e.kind==="expression"||e.kind==="numeric"||e.kind==="collection"||e.kind==="indexed_collection"||e.kind==="variable"||e.kind==="reference"}function j0(e){return e==="\u211D"||e==="\u2124"||e==="\u211A"||e==="\u2102"||e==="\u2115"}var us=class{input;pos=0;line=1;column=1;tokens=[];tolerant;constructor(n,t){this.input=n,this.tolerant=t?.tolerant??!1}saveState(){return{pos:this.pos,line:this.line,column:this.column,tokens:[...this.tokens]}}restoreState(n){this.pos=n.pos,this.line=n.line,this.column=n.column,this.tokens=n.tokens}error(n){throw new Error(`Lexer error at line ${this.line}, column ${this.column}: ${n}`)}peek(n=0){let t=this.pos+n;return t<this.input.length?this.input[t]:""}advance(){let n=this.input[this.pos++];return n===`
|
|
3
3
|
`?(this.line++,this.column=1):this.column++,n}match(n){if(this.input.slice(this.pos,this.pos+n.length)===n){for(let t=0;t<n.length;t++)this.advance();return!0}return!1}isEOF(){return this.pos>=this.input.length}skipTrivia(){for(;!this.isEOF();){if(/\s/.test(this.peek())){this.advance();continue}if(this.peek()==="/"&&this.peek(1)==="/"){for(;!this.isEOF()&&!/[\n\r\u2028\u2029]/.test(this.peek());)this.advance();continue}if(this.peek()==="/"&&this.peek(1)==="*"){this.skipBlockComment();continue}break}}skipBlockComment(){this.advance(),this.advance();let n=1;for(;n>0&&!this.isEOF();)this.peek()==="/"&&this.peek(1)==="*"?(n++,this.advance(),this.advance()):this.peek()==="*"&&this.peek(1)==="/"?(n--,this.advance(),this.advance()):this.advance();n>0&&!this.tolerant&&this.error("Unterminated comment")}readIdentifier(){let n="";for(;!this.isEOF()&&/[a-zA-Z0-9_]/.test(this.peek());)n+=this.advance();return n}readVerbatimString(){if(!this.match("`"))return"";let n="";for(;!this.isEOF()&&this.peek()!=="`";)this.match("\\`")?n+="`":this.match("\\\\")?n+="\\":n+=this.advance();return this.isEOF()&&this.error("Unterminated verbatim string"),this.advance(),n}readStringLiteral(){let n=this.advance(),t="";for(;!this.isEOF()&&this.peek()!==n;)this.match("\\"+n)?t+=n:this.match("\\\\")?t+="\\":t+=this.advance();return this.isEOF()&&this.error("Unterminated string literal"),this.advance(),t}readNumber(){let n="";if((this.peek()==="-"||this.peek()==="+")&&(n+=this.advance()),this.match("0x")||this.match("0X")){for(n+="x";!this.isEOF()&&/[0-9a-fA-F]/.test(this.peek());)n+=this.advance();return"0"+n}if(this.match("0b")||this.match("0B")){for(n+="b";!this.isEOF()&&/[01]/.test(this.peek());)n+=this.advance();return"0"+n}for(;!this.isEOF()&&/[0-9]/.test(this.peek());)n+=this.advance();if(this.peek()==="."&&/[0-9]/.test(this.peek(1)))for(n+=this.advance();!this.isEOF()&&/[0-9]/.test(this.peek());)n+=this.advance();if(this.peek()==="e"||this.peek()==="E")for(n+=this.advance(),(this.peek()==="+"||this.peek()==="-")&&(n+=this.advance());!this.isEOF()&&/[0-9]/.test(this.peek());)n+=this.advance();return n}createToken(n,t){return{type:n,value:t,position:this.pos-t.length,line:this.line,column:this.column-t.length}}nextToken(){if(this.skipTrivia(),this.isEOF())return this.createToken("EOF","");let n=this.pos,t=this.peek();if(this.match("->"))return this.createToken("->","->");if(this.peek()==="<"&&this.input.startsWith("<..",this.pos)&&this.pos>0&&/[0-9.∞o+\-]/.test(this.input[this.pos-1]))return this.match("<.."),this.createToken("<..","<..");if(this.input.startsWith("..<",this.pos)&&this.pos+3<this.input.length&&!/\s/.test(this.input[this.pos+3]))return this.match("..<"),this.createToken("..<","..<");if(this.match(".."))return this.createToken("..","..");if(this.match("+\u221E")||this.match("+oo"))return this.createToken("PLUS_INFINITY",this.input.slice(n,this.pos));if(this.match("-\u221E")||this.match("-oo"))return this.createToken("MINUS_INFINITY",this.input.slice(n,this.pos));if(this.match("~\u221E")||this.match("~oo"))return this.createToken("COMPLEX_INFINITY",this.input.slice(n,this.pos));if(this.match("+infinity")||this.match("+Infinity"))return this.createToken("PLUS_INFINITY",this.input.slice(n,this.pos));if(this.match("-infinity")||this.match("-Infinity"))return this.createToken("MINUS_INFINITY",this.input.slice(n,this.pos));if(j0(t)&&!/[a-zA-Z0-9_]/.test(this.peek(1)))return this.advance(),this.createToken("IDENTIFIER",t);if(/[a-zA-Z_]/.test(t)){let i=this.readIdentifier();switch(i){case"true":return this.createToken("TRUE",i);case"false":return this.createToken("FALSE",i);case"NaN":return this.createToken("NAN",i);case"Infinity":case"oo":return this.createToken("INFINITY",i);default:return this.createToken("IDENTIFIER",i)}}switch(t){case"|":return this.advance(),this.createToken("|","|");case"&":return this.advance(),this.createToken("&","&");case"!":return this.advance(),this.createToken("!","!");case"^":return this.advance(),this.createToken("^","^");case"(":return this.advance(),this.createToken("(","(");case")":return this.advance(),this.createToken(")",")");case"<":return this.advance(),this.createToken("<","<");case">":return this.advance(),this.createToken(">",">");case"[":return this.advance(),this.createToken("[","[");case"]":return this.advance(),this.createToken("]","]");case"{":return this.advance(),this.createToken("{","{");case"}":return this.advance(),this.createToken("}","}");case",":return this.advance(),this.createToken(",",",");case":":return this.advance(),this.createToken(":",":");case"?":return this.advance(),this.createToken("?","?");case"*":return this.advance(),this.createToken("*","*");case".":return this.advance(),this.createToken(".",".");case"+":return/[0-9]/.test(this.peek(1))?this.createToken("NUMBER_LITERAL",this.readNumber()):(this.advance(),this.createToken("+","+"));case"x":return/[0-9]/.test(this.peek(1))?(this.advance(),this.createToken("x","x")):(this.advance(),this.createToken("x","x"))}if(t==='"'||t==="'")return this.createToken("STRING_LITERAL",this.readStringLiteral());if(t==="`")return this.createToken("VERBATIM_STRING",this.readVerbatimString());if(/[0-9]/.test(t)||t==="-"&&/[0-9]/.test(this.peek(1))){let i=this.readNumber();return this.peek()==="x"&&/[0-9]/.test(this.peek(1)),this.createToken("NUMBER_LITERAL",i)}if(t==="\u221E")return this.advance(),this.createToken("INFINITY","\u221E");if(this.tolerant)return this.createToken("EOF","");this.error(`Unexpected character: ${t}`)}tokenize(){let n=[];for(;!this.isEOF();){let t=this.nextToken();if(t&&(n.push(t),t.type==="EOF"))break}return n}peekToken(){if(this.tokens.length===0){let n=this.nextToken();n&&this.tokens.push(n)}return this.tokens[0]||this.createToken("EOF","")}consumeToken(){if(this.tokens.length===0){let n=this.nextToken();if(n)return n}return this.tokens.shift()||this.createToken("EOF","")}matchToken(n){return this.peekToken().type===n?(this.consumeToken(),!0):!1}expectToken(n){let t=this.consumeToken();return t.type!==n&&this.error(`Expected ${n}, got ${t.type}`),t}};var Sm=Object.freeze({complexInfinity:!0});function Ce(e){return typeof e=="object"&&e!==null&&e.complexInfinity===!0}var ls=["console","entropy","environment","fs_read","fs_write","network","random","scope","state","time"],q0=new Set(ls);function ua(e){return q0.has(e)}var z0=new Set(["console","entropy","environment","fs_read","fs_write","network","random","scope","state","time"]);function Ll(e){return e===void 0?!0:e==="any"?!1:!e.some(n=>z0.has(n))}function cs(e,n){return e===void 0||e==="any"||bt(e)?!1:e.includes(n)}function km(e){return e===void 0||e!=="any"&&e.length===0}function Yi(e){return Im(e,!1)}function fs(e){return Im(e,!0)}function Im(e,n){if(e===void 0)return;if(e==="any")return"any";if(typeof e=="string"||typeof e?.[Symbol.iterator]!="function")throw new Error(`Invalid effect set \`${String(e)}\`. Expected \`'any'\` or a collection of effect labels. The effect labels are ${ls.join(", ")}`);let t=[...new Set(e)].sort();for(let i of t)if(!ua(i))throw new Error(`Unknown effect label \`${i}\`. The effect labels are ${ls.join(", ")}`);return t.length>0?t:n?[]:void 0}function Bn(e,n){return km(e)||n==="any"?!0:e==="any"||km(n)?!1:e.every(t=>n.includes(t))}function Ki(e,n){return Bn(e,n)&&Bn(n,e)}function ds(e,n){return e===void 0||n===void 0||e==="any"||n==="any"?e===n:e.length===n.length&&e.every((t,i)=>n[i]===t)}function Le(e,n){return e===void 0?n===void 0?void 0:n:n===void 0?e:e==="any"||n==="any"?"any":fs([...e,...n])}function bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function aa(e){let n=Yi(e);if(n===void 0)return"any";if(n==="any")throw new Error("A co-finite complement cannot contain `any`");return{not:n}}function pi(e,n){if(e!==void 0)return n===void 0||n.length===0?e:e==="any"?aa(n):bt(e)?aa([...e.not,...n]):Yi(e.filter(t=>!n.includes(t)))}function kn(e,n){if(e==="any"||n==="any")return"any";let t=bt(e),i=bt(n);if(!t&&!i)return Le(e,n);if(t&&i)return aa(e.not.filter(o=>n.not.includes(o)));let r=t?e:n,s=t?n:e;return s===void 0?r:aa(r.not.filter(o=>!s.includes(o)))}function Vl(e){return bt(e)?!1:Ll(e)}function la(e){return e==="any"?"any":e.length===0?"pure":[...e].sort().join(" ")}var G0=Object.assign(Object.create(null),{finite_number:"complex",finite_complex:"complex",finite_real:"real",finite_rational:"rational",finite_integer:"integer"}),U0=Object.assign(Object.create(null),{\u211D:"real",\u2124:"integer",\u211A:"rational",\u2102:"complex"});function wm(e){return U0[e]??G0[e]??e}var ps=class{lexer;typeResolver;current;allowTrailing;_end=0;_typeVarScopes=[];allowWhere;allowObjectType;blockFollows;_sawWhere=!1;_sawForwardRef=!1;constructor(n,t){this.allowTrailing=t?.allowTrailing??!1,this.allowWhere=t?.allowWhere??!0,this.allowObjectType=t?.allowObjectType??!1,this.blockFollows=t?.blockFollows??!1,t?.typeVars!==void 0&&t.typeVars.length>0&&this._typeVarScopes.push(new Set(t.typeVars.map(i=>i.name))),this.lexer=new us(n,{tolerant:this.allowTrailing}),this.typeResolver=t?.typeResolver??{forward:()=>{},resolve:()=>{},get names(){return[]}},this.current=this.lexer.consumeToken()}get endOffset(){return this._end}get sawWhereClause(){return this._sawWhere}get sawForwardRef(){return this._sawForwardRef}error(n,t){this.errorAtToken(this.current,n,t)}errorAtToken(n,t,i,r){let s=this.lexer.input;this.allowTrailing&&(s=s.slice(0,n.position+n.value.length));let a=s.split(`
|
|
4
4
|
`)[n.line-1]||s,u=n.column,l=" ".repeat(Math.max(0,u-1))+"^",c=["","Invalid type",`| ${a}`,`| ${l}`,"|",`| ${t}`];i&&c.push(`| ${i}`),c.push("");let f=new Error(c.join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
/** Compute Engine 0.129.
|
|
2
|
+
/** Compute Engine 0.129.1 */
|
|
3
3
|
import{readFile as j1e}from"node:fs/promises";import{version as V1e}from"../epsil.js";import{parseArgs as h0}from"node:util";var cn=class extends Error{},JQ=1e4,zQ=10,UQ="127.0.0.1",GQ=8e3,HQ="/mcp";function dO(e,n=process.env){let t;try{t=h0({args:[...e],allowPositionals:!0,strict:!0,options:{eval:{type:"string",short:"e"},help:{type:"boolean",short:"h"},version:{type:"boolean",short:"v"},json:{type:"boolean"},epsil:{type:"boolean"},"fancy-symbols":{type:"boolean"},diagnostics:{type:"string"},"no-color":{type:"boolean"},"time-limit":{type:"string"}}})}catch(a){throw new cn(y0(a))}let{values:i,positionals:r}=t,o=typeof i.eval=="string"?i.eval:void 0,s=typeof i["time-limit"]=="string"?i["time-limit"]:void 0;if(r.length>1)throw new cn("Expected at most one Epsil source file.");if(o!==void 0&&r.length>0)throw new cn("The --eval option cannot be used with a file.");if(i.json===!0&&i.epsil===!0)throw new cn("The --json and --epsil output options are mutually exclusive.");let u=i.json===!0?"json":i.epsil===!0?"epsil":"value";if(i["fancy-symbols"]===!0&&i.epsil!==!0)throw new cn("The --fancy-symbols option requires --epsil.");return{eval:o,file:r[0],help:i.help===!0,version:i.version===!0,outputMode:u,fancySymbols:i["fancy-symbols"]===!0,diagnosticsFormat:KQ(i.diagnostics),color:i["no-color"]!==!0&&n.NO_COLOR===void 0,timeLimit:hO(s)}}function pO(e,n=process.env){let t;try{t=h0({args:[...e],allowPositionals:!0,strict:!0,options:{eval:{type:"string",short:"e"},json:{type:"boolean"},effects:{type:"boolean"},"no-color":{type:"boolean"}}})}catch(s){throw new cn(y0(s))}let{values:i,positionals:r}=t,o=typeof i.eval=="string"?i.eval:void 0;if(r.length>1)throw new cn("Expected at most one Epsil source file.");if(o!==void 0&&r.length>0)throw new cn("The --eval option cannot be used with a file.");return{eval:o,file:r[0],json:i.json===!0,effects:i.effects===!0,color:i["no-color"]!==!0&&n.NO_COLOR===void 0}}function mO(e){let n;try{n=h0({args:[...e],allowPositionals:!0,strict:!0,options:{json:{type:"boolean"},limit:{type:"string"}}})}catch(o){throw new cn(y0(o))}let{values:t,positionals:i}=n,r=i.join(" ").trim();if(r.length===0)throw new cn('Expected a symbol name or search keywords, e.g. "epsil doc Sin".');return{query:r,json:t.json===!0,limit:eX(typeof t.limit=="string"?t.limit:void 0)}}function gO(e){let n;try{n=h0({args:[...e],allowPositionals:!1,strict:!0,options:{"time-limit":{type:"string"},transport:{type:"string"},host:{type:"string"},port:{type:"string"},path:{type:"string"},"allow-origin":{type:"string",multiple:!0}}})}catch(l){throw new cn(y0(l))}let{values:t}=n,i=t["time-limit"],r=ZQ(t.transport),o=WQ(t.host),s=YQ(t.port),u=QQ(t.path),a=XQ(t["allow-origin"]);if(r==="stdio"&&(t.host!==void 0||t.port!==void 0||t.path!==void 0||t["allow-origin"]!==void 0))throw new cn('--host, --port, --path and --allow-origin require "--transport streamable-http".');return{timeLimit:hO(typeof i=="string"?i:void 0),transport:r,host:o,port:s,path:u,allowedOrigins:a}}function ZQ(e){if(e===void 0||e==="stdio")return"stdio";if(e==="streamable-http")return e;throw new cn('--transport must be "stdio" or "streamable-http".')}function WQ(e){if(e===void 0)return UQ;if(typeof e!="string"||e.length===0||e.trim()!==e||/[/?#\s]/u.test(e))throw new cn("--host must be a hostname or IP address.");return e}function YQ(e){if(e===void 0)return GQ;if(typeof e!="string"||!/^\d+$/u.test(e))throw new cn("--port must be an integer from 0 to 65535.");let n=Number(e);if(!Number.isSafeInteger(n)||n>65535)throw new cn("--port must be an integer from 0 to 65535.");return n}function QQ(e){if(e===void 0)return HQ;if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[?#\s]/u.test(e))throw new cn("--path must be an absolute URL path without a query or fragment.");return e}function XQ(e){if(e===void 0)return[];if(!Array.isArray(e))throw new cn("--allow-origin must be an HTTP(S) origin.");return e.map(n=>{if(typeof n!="string")throw new cn("--allow-origin must be an HTTP(S) origin.");let t;try{t=new URL(n)}catch{throw new cn(`Invalid --allow-origin value: ${JSON.stringify(n)}.`)}if(t.protocol!=="http:"&&t.protocol!=="https:"||t.origin!==n)throw new cn(`Invalid --allow-origin value: ${JSON.stringify(n)}.`);return n})}function KQ(e){if(e===void 0)return"text";if(e==="text"||e==="json")return e;throw new cn('--diagnostics must be "text" or "json".')}function eX(e){if(e===void 0)return zQ;if(!/^\d+$/.test(e)||Number(e)<1)throw new cn("--limit must be a positive integer.");return Math.min(Number(e),100)}function hO(e){if(e===void 0)return JQ;if(!/^\d+$/.test(e))throw new cn("--time-limit must be a non-negative integer.");let n=Number(e);if(!Number.isSafeInteger(n))throw new cn("--time-limit is too large.");return n}function y0(e){return e instanceof Error?e.message:String(e)}import{ComputeEngine as wQ,parseEpsil as i1e}from"../epsil.js";var nX=0;var Ee=class extends Error{cause;value;attribution;spans;constructor({message:n,value:t,cause:i,attribution:r,spans:o}={}){super(n??"Operation canceled"),t&&(this.value=t),this.cause=i,r!==void 0&&(this.attribution=r),o!==void 0&&(this.spans=o),this.name="CancellationError",i==="iteration-limit-exceeded"&&(nX+=1)}};function te(e){if(e===void 0)return;let n=typeof e=="number"?e:e.at;if(Date.now()>=n)throw typeof e=="number"?new Ee({cause:"timeout",message:"Timeout exceeded"}):new Ee({cause:"timeout",message:"Timeout exceeded",attribution:e.owner,spans:e.spans})}function pf(e){return e instanceof Error&&e.name==="CancellationError"&&e.cause==="timeout"}var b0;function go(){return b0}function mf(e,n){let t=b0;b0=e;try{return n()}finally{b0=t}}async function gf(e,n,t,i){let r=performance.now(),o;for(;;){let s=performance.now(),u=16;for(;performance.now()-s<u;){let{done:a,value:l}=e.next(o);if(o=void 0,a)return l;if(hf(l)&&(o=await l),t?.aborted)throw new Ee({value:l,cause:t.reason});if(performance.now()-r>=n)throw new Ee({value:l,cause:"timeout",message:`Timeout exceeded (${n}ms)`,attribution:i?.owner,spans:i?.spans})}await new Promise(a=>setTimeout(a,0))}}function hf(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Ti(e,n,t){let i=Date.now();for(;;){let{done:r,value:o}=e.next();if(r)return o;if(Date.now()-i>=n)throw new Ee({value:o,cause:"timeout",message:`Timeout exceeded (${n}ms)`,attribution:t?.owner,spans:t?.spans})}}var tg=["Error","'missing'"];function hr(e){return!!(typeof e=="number"||ho(e)||typeof e=="string"&&ju(e))}function ho(e){return e!==null&&typeof e=="object"&&"num"in e}function bd(e){return e!==null&&typeof e=="object"&&"sym"in e}function PN(e){return e!==null&&typeof e=="object"&&"str"in e}function E0(e){return e!==null&&typeof e=="object"&&"dict"in e&&typeof e.dict=="object"&&!Array.isArray(e.dict)&&e.dict!==null}function Ed(e){return e!==null&&typeof e=="object"&&"fn"in e&&Array.isArray(e.fn)&&e.fn.length>0&&typeof e.fn[0]=="string"}function se(e){return e==null?null:typeof e=="object"&&"str"in e?e.str:typeof e!="string"?null:e.length>=2&&e.at(0)==="'"&&e.at(-1)==="'"?e.substring(1,e.length-1):ju(e)||rg(e)?null:e}function DN(e){if(e==null||se(e)!==null)return null;let n=D(e);return n?[n,...L(e).map(t=>DN(t)).filter(t=>t!==null)]:e}function D(e){return Array.isArray(e)?e[0]:e==null?"":Ed(e)?e.fn[0]:""}function L(e){return Array.isArray(e)?e.slice(1):e!==void 0&&Ed(e)?e.fn.slice(1):[]}function k(e,n){return Array.isArray(e)?e[n]??null:e===null||!Ed(e)?null:e.fn[n]??null}function fe(e){return e==null?0:Array.isArray(e)?Math.max(0,e.length-1):Ed(e)?Math.max(0,e.fn.length-1):0}function ON(e){return e==null?null:D(e)==="Hold"?k(e,1):e}function j(e){return typeof e=="string"&&rg(e)?e.length>=2&&e.at(0)==="`"&&e.at(-1)==="`"?e.slice(1,-1):e:e==null?null:bd(e)?e.sym:null}function yO(e){let n=D(e);if(n==="KeyValuePair"||n==="Tuple"||n==="Pair"){let[t,i]=L(e),r=se(t);return r?[r,i??"Nothing"]:null}return null}function ig(e){if(e===null)return null;if(E0(e))return e;let n=yO(e);if(n)return{dict:{[n[0]]:bO(n[1])??"Nothing"}};if(D(e)==="Dictionary"){let t={};for(let i of L(e)){let r=yO(i);r&&(t[r[0]]=bO(r[1])??"Nothing")}return{dict:t}}return null}function x0(e){return{dict:Object.fromEntries(Object.entries(e).map(([t,i])=>[t,AN(i)??"Nothing"]))}}function tX(e){if(e=e.toLowerCase().replace(/[nd]$/,"").replace(/[\u0009-\u000d\u0020\u00a0]/g,""),e==="nan")return NaN;if(/^(infinity|\+infinity|oo|\+oo)$/i.test(e))return 1/0;if(/^(-infinity|-oo)$/.test(e))return-1/0;if(/\([0-9]+\)/.test(e)){let[n,t,i,r]=e.match(/(.+)\(([0-9]+)\)(.*)$/)??[];e=t+i.repeat(Math.ceil(16/i.length))+(r??"")}return parseFloat(e)}function pe(e){return typeof e=="number"?e:typeof e=="string"&&ju(e)?tX(e):e!==void 0&&ho(e)?pe(e.num):null}function yf(e){if(e==null)return null;if(j(e)==="Half")return[1,2];let n=D(e);if(!n)return null;let t=null,i=null;if(n==="Negate"){let r=yf(L(e)[0]);if(r)return[-r[0],r[1]]}if(n==="Rational"||n==="Divide"){let[r,o]=L(e);t=pe(r)??NaN,i=pe(o)??NaN}if(n==="Power"){let[r,o]=L(e),s=pe(o);s===1?(t=pe(r),i=1):s===-1&&(t=1,i=pe(r))}if(n==="Multiply"){let[r,o]=L(e);if(D(o)==="Power"){let[s,u]=L(o);pe(u)===-1&&(t=pe(r),i=pe(s))}}return t===null||i===null?null:Number.isInteger(t)&&Number.isInteger(i)?[t,i]:null}function Mi(e,n){let t=null;if(Array.isArray(e)&&(t=e),Ed(e)&&(t=e.fn),t===null)return[];let i=1,r=[];for(;i<t.length;)r.push(n(t[i])),i+=1;return r}function EO(e,n,t){let i=D(n),r=D(t);return i===e&&r===e?[e,...L(n),...L(t)]:i===e?[e,...L(n),t]:r===e?[e,n,...L(t)]:[e,n,t]}function $u(e){if(e==null)return null;let n=D(e);if(n==="Delimiter"){if(e=k(e,1),e===null)return[];if(n=D(e),n!=="Sequence")return[e]}return n!=="Sequence"?null:L(e)}function Ye(e){return e==null||e==="Nothing"?!0:D(e)==="Sequence"&&fe(e)===0}function $e(e){return Ye(e)?tg:e}function MN(e){return e[0]==="Square"?MN(e.slice(1))+2:e.reduce((n,t)=>n+xd(t),0)}function xd(e){if(e===null)return 0;if(typeof e=="number"||typeof e=="string"||hr(e)||bd(e)||PN(e))return 1;if(Array.isArray(e))return MN(e);if("fn"in e)return MN(e.fn);let n=ig(e);if(n){let t=n,i=Object.keys(t);return 1+i.length+i.reduce((r,o)=>r+xd(t[o]),0)}return 0}function ju(e){return/^(nan|oo|\+oo|-oo|infinity|\+infinity|-infinity)$/i.test(e)||/^[+-]?(0|[1-9][0-9]*)(\.([0-9]+(\([0-9]+\))?|\([0-9]+\)))?([eE][+-]?[0-9]+)?$/.test(e)}function rg(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)||e.length>=2&&e[0]==="`"&&e[e.length-1]==="`"}function v0(e){return e.length>=2&&e[0]==="'"&&e[e.length-1]==="'"?!0:!ju(e)&&!rg(e)}function AN(e){if(typeof e=="string")return{str:e};if(typeof e=="number")return{num:e.toString()};if(typeof e=="boolean")return e?"True":"False";if(Array.isArray(e))return["List",...e.map(n=>AN(n)??"Nothing")];if(e===null)return null;if(typeof e=="object"){let n={};for(let t in e)n[t]=AN(e[t])??"Nothing";return{dict:n}}return Ed(e)||bd(e)||ho(e)||PN(e)||E0(e)?e:null}function bO(e){return e==null?null:PN(e)?e.str:ho(e)?parseFloat(e.num):bd(e)?e.sym:typeof e=="string"||typeof e=="number"?e:Array.isArray(e)?{fn:e}:e}var FN=new WeakSet,iX=4096,T0=new Map;function bf(e,n,t,i=!1,r=!1){let o=`${e}:${Object.is(n,-0)?"-0":n}:${Object.is(t,-0)?"-0":t}:${i?1:0}${r?1:0}`,s=T0.get(o);if(s!==void 0)return s;let u={kind:"numeric",type:e};return n!==void 0&&(u.lower=n),t!==void 0&&(u.upper=t),i&&(u.lowerOpen=!0),r&&(u.upperOpen=!0),Object.freeze(u),FN.add(u),T0.size>=iX&&T0.clear(),T0.set(o,u),u}var rX=4096,S0=new Map;function Fa(e){let n=S0.get(e);return n!==void 0||(n=Object.freeze({kind:"value",value:e===0?0:e}),FN.add(n),S0.size>=rX&&S0.clear(),S0.set(e,n)),n}function xO(e){return FN.has(e)}function yr(e,n,t,i=!1,r=!1){let o=n===0?0:n,s=t===0?0:t;if(Number.isFinite(o)||(i=!1),Number.isFinite(s)||(r=!1),oX(e)){if(Number.isFinite(o)){let u=i?Math.floor(o)+1:Math.ceil(o);(!i||u!==o)&&(o=u,i=!1)}if(Number.isFinite(s)){let u=r?Math.ceil(s)-1:Math.floor(s);(!r||u!==s)&&(s=u,r=!1)}}return o>s||o===s&&(i||r)?"never":o===-1/0&&s===1/0?e:bf(e,o===-1/0?void 0:o,s===1/0?void 0:s,i,r)}function oX(e){return e==="integer"}var og=["console","entropy","environment","fs_read","fs_write","network","random","scope","state","time"],sX=new Set(og);function _0(e){return sX.has(e)}var uX=new Set(["console","entropy","environment","fs_read","fs_write","network","random","scope","state","time"]);function Ju(e){return e===void 0?!0:e==="any"?!1:!e.some(n=>uX.has(n))}function Ef(e,n){return e===void 0||e==="any"||Go(e)?!1:e.includes(n)}function vO(e){return e===void 0||e!=="any"&&e.length===0}function vd(e){return TO(e,!1)}function sg(e){return TO(e,!0)}function TO(e,n){if(e===void 0)return;if(e==="any")return"any";if(typeof e=="string"||typeof e?.[Symbol.iterator]!="function")throw new Error(`Invalid effect set \`${String(e)}\`. Expected \`'any'\` or a collection of effect labels. The effect labels are ${og.join(", ")}`);let t=[...new Set(e)].sort();for(let i of t)if(!_0(i))throw new Error(`Unknown effect label \`${i}\`. The effect labels are ${og.join(", ")}`);return t.length>0?t:n?[]:void 0}function Lt(e,n){return vO(e)||n==="any"?!0:e==="any"||vO(n)?!1:e.every(t=>n.includes(t))}function Ba(e,n){return Lt(e,n)&&Lt(n,e)}function ug(e,n){return e===void 0||n===void 0||e==="any"||n==="any"?e===n:e.length===n.length&&e.every((t,i)=>n[i]===t)}function yt(e,n){return e===void 0?n===void 0?void 0:n:n===void 0?e:e==="any"||n==="any"?"any":sg([...e,...n])}function Go(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function N0(e){let n=vd(e);if(n===void 0)return"any";if(n==="any")throw new Error("A co-finite complement cannot contain `any`");return{not:n}}function $s(e,n){if(e!==void 0)return n===void 0||n.length===0?e:e==="any"?N0(n):Go(e)?N0([...e.not,...n]):vd(e.filter(t=>!n.includes(t)))}function yo(e,n){if(e==="any"||n==="any")return"any";let t=Go(e),i=Go(n);if(!t&&!i)return yt(e,n);if(t&&i)return N0(e.not.filter(s=>n.not.includes(s)));let r=t?e:n,o=t?n:e;return o===void 0?r:N0(r.not.filter(s=>!o.includes(s)))}function k0(e){return Go(e)?!1:Ju(e)}function $r(e){return e==="any"?"any":e.length===0?"pure":[...e].sort().join(" ")}var w0=["number","complex","imaginary","real","rational","integer","infinity","nan"],BN=["indexed_collection","list","tuple","range","string"],I0=Object.freeze({kind:"indexed_collection",elements:"integer"}),R0=Object.freeze({kind:"indexed_collection",elements:"character"}),LN=Object.freeze({kind:"list",elements:"unknown"}),qN=Object.freeze({kind:"set",elements:"unknown"}),ag=Object.freeze({kind:"dictionary",values:"unknown"}),C0=Object.freeze({kind:"collection",elements:"unknown"}),lg=Object.freeze({kind:"indexed_collection",elements:"unknown"}),st=Object.freeze({kind:"collection",elements:"any"}),rn=Object.freeze({kind:"indexed_collection",elements:"any"}),M0=Object.freeze({kind:"dictionary",values:"any"}),hn=Object.freeze({kind:"union",types:[{kind:"value",value:1/0},{kind:"value",value:-1/0}]}),En=Object.freeze({kind:"union",types:["real",{kind:"value",value:1/0},{kind:"value",value:-1/0}]}),A0=[...BN,"collection","set","record","dictionary"],P0=["scalar",...w0,"boolean","character"],VN=["value","color","regexp","type","object",...A0,...P0],$N=["expression","symbol","function",...VN],jN=["any","unknown","nothing","missing","never","error",...$N],bo=new Set(w0),SO=new Set(A0),NO=new Set(P0),xf=new Set(jN),fg="Variadic arguments cannot be used with optional arguments";function br(e){if(typeof e=="string")return!1;switch(e.kind){case"signature":return(e.optArgs?.length??0)>0&&e.variadicArg!==void 0?!0:br(e.result)||(e.args?.some(n=>br(n.type))??!1)||(e.optArgs?.some(n=>br(n.type))??!1)||e.variadicArg!==void 0&&br(e.variadicArg.type)||(e.typeParams?.some(n=>n.bound!==void 0&&br(n.bound))??!1);case"record":case"object":return Object.values(e.elements).some(br);case"union":case"intersection":return e.types.some(br);case"negation":return br(e.type);case"list":case"set":case"collection":case"indexed_collection":case"broadcastable":return br(e.elements);case"dictionary":return br(e.values);case"tuple":return e.elements.some(n=>br(n.type));case"reference":return e.args?.some(br)??!1;default:return!1}}function La(e){return typeof e!="string"?!1:xf.has(e)}function Ho(e){return typeof e=="string"?xf.has(e):typeof e!="object"||!("kind"in e)?!1:e.kind==="signature"||e.kind==="union"||e.kind==="intersection"||e.kind==="negation"||e.kind==="value"||e.kind==="tuple"||e.kind==="list"||e.kind==="record"||e.kind==="object"||e.kind==="dictionary"||e.kind==="set"||e.kind==="broadcastable"||e.kind==="symbol"||e.kind==="expression"||e.kind==="numeric"||e.kind==="collection"||e.kind==="indexed_collection"||e.kind==="variable"||e.kind==="reference"}var D0=Object.freeze({complexInfinity:!0});function Si(e){return typeof e=="object"&&e!==null&&e.complexInfinity===!0}var aX=1,_O=2,kO=3,UN=4,lX=5,fX=6,cX=7,dX=8,pX=9,mX=10,gX=11,JN=UN,zN=!1;function jr(e){if(typeof e=="string")return e;zN=!0;try{return K(e)}finally{zN=!1}}function K(e,n=0){if(typeof e=="string")return e;let t="";switch(e.kind){case"value":typeof e.value=="string"?t=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:typeof e.value=="boolean"?t=e.value?"true":"false":Si(e.value)?t="~oo":e.value===1/0?t="+oo":e.value===-1/0?t="-oo":t=e.value.toString();break;case"reference":t=e.args===void 0?e.name:`${e.name}<${e.args.map(f=>K(f)).join(", ")}>`;break;case"variable":t=e.name;break;case"negation":t=`!${K(e.type,UN)}`;break;case"union":{let f=[],c=d=>{typeof d=="object"&&d.kind==="union"?d.types.forEach(c):f.push(K(d,_O))};if(e.types.forEach(c),f.includes("+oo")&&f.includes("-oo")){let d=f.filter(p=>p!=="+oo"&&p!=="-oo");d.push("signed_infinity"),t=d.sort().join(" | ")}else t=f.sort().join(" | ");break}case"intersection":t=e.types.map(f=>K(f,kO)).join(" & ");break;case"expression":t=`expression<${cg(e.operator)}>`;break;case"symbol":t=`symbol<${cg(e.name)}>`;break;case"numeric":{let f=Number.isFinite(e.lower)?`${e.lower}${e.lowerOpen?"<":""}`:"",c=Number.isFinite(e.upper)?`${e.upperOpen?"<":""}${e.upper}`:"";t=f===""&&c===""?`${e.type}`:`${e.type}<${f}..${c}>`;break}case"list":if(e.dimensions&&typeof e.elements=="string"&&bo.has(e.elements)){if(e.dimensions===void 0)e.elements==="number"&&(t="tensor");else if(e.dimensions.length===1)e.elements==="number"?e.dimensions[0]<0?t="vector":t=`vector<${e.dimensions[0]}>`:e.dimensions[0]<0?t=`vector<${K(e.elements)}>`:t=`vector<${K(e.elements)}^${e.dimensions[0]}>`;else if(e.dimensions.length===2){let f=e.dimensions;e.elements==="number"?f[0]<0&&f[1]<0?t="matrix":t=`matrix<${f[0]}x${f[1]}>`:f[0]<0&&f[1]<0?t=`matrix<${K(e.elements)}>`:t=`matrix<${K(e.elements)}^(${f[0]}x${f[1]})>`}}if(!t){let f=e.dimensions;if(f!==void 0&&f.length<=2&&f.every(c=>c<0))t=`${f.length===1?"vector":"matrix"}<${K(e.elements)}>`;else if(f!==void 0&&f.some(c=>c<0)){let c=K(e.elements);for(let d=f.length-1;d>=0;d--)c=f[d]<0?`list<${c}>`:`list<${c}^${f[d]}>`;t=c}else{let c=f?f.length===1?`^${f[0].toString()}`:`^(${f.join("x")})`:"";t=`list<${K(e.elements)}${c}>`}}break;case"record":t=`record{${Object.entries(e.elements).map(([f,c])=>`${cg(f)}: ${K(c)}`).join(", ")}}`;break;case"object":t=`object{${Object.entries(e.elements).map(([f,c])=>`${cg(f)}: ${K(c)}`).join(", ")}}`;break;case"dictionary":t=`dictionary<${K(e.values)}>`;break;case"set":t=`set<${K(e.elements)}>`;break;case"broadcastable":t=`broadcastable<${K(e.elements)}>`;break;case"collection":t=`collection<${K(e.elements)}>`;break;case"indexed_collection":t=`indexed_collection<${K(e.elements)}>`;break;case"tuple":if(e.elements.length===0)t="tuple";else if(e.elements.length===1){let[f]=e.elements;t=`tuple<${Td(f)}>`}else t="tuple<"+e.elements.map(f=>Td(f)).join(", ")+">";break;case"signature":let r=e.args?e.args.map(f=>Td(f)).join(", "):"",o=e.optArgs?e.optArgs.map(f=>Td(f,JN)+"?").join(", "):"",s=e.variadicArg?e.variadicMin===0?`${Td(e.variadicArg,JN)}*`:`${Td(e.variadicArg,JN)}+`:"",u=[r,o,s].filter(f=>f).join(", "),a=e.effects===void 0||zN&&e.effects!=="any"&&!e.effects.length?"":` ${$r(e.effects)}`,l=e.typeParams?.length?` where ${e.typeParams.map(f=>{let c=f.bound===void 0?void 0:K(f.bound),d=c===void 0||c==="unknown"?f.name:`${f.name}: ${c}`;return f.protocols?.length?`${d} is ${f.protocols.join(" & ")}`:d}).join(", ")}`:"";t=`(${u})${a} -> ${K(e.result)}${l}`;break;default:t="error"}return n>0&&n>hX(e.kind)?`(${t})`:t}function Td(e,n=0){return e.name?`${cg(e.name)}: ${K(e.type,n)}`:K(e.type,n)}function cg(e){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e)?e:`\`${e.replace(/\\/g,"\\\\").replace(/`/g,"\\`")}\``}function hX(e){switch(e){case"negation":return UN;case"union":return _O;case"intersection":return kO;case"list":return lX;case"record":case"object":return fX;case"dictionary":return cX;case"set":return dX;case"collection":case"indexed_collection":case"broadcastable":return pX;case"tuple":return mX;case"signature":return aX;case"value":case"variable":case"numeric":case"expression":case"symbol":case"reference":return gX;default:return 0}}function dg(e,n){let t={kind:"reference",name:e.name,args:n};return Object.defineProperty(t,"def",{get:()=>e.def,enumerable:!0,configurable:!0}),Object.defineProperty(t,"alias",{get:()=>e.alias,set:i=>{e.alias=i},enumerable:!0,configurable:!0}),Object.defineProperty(t,"decl",{value:e,enumerable:!1,configurable:!0}),t}function Nn(e){return e.decl??e}function GN(e,n){if(n===e.args)return e;let t=Object.getOwnPropertyDescriptors(e);return t.args={value:n,writable:!0,enumerable:!0,configurable:!0},Object.create(Object.getPrototypeOf(e),t)}var yX="_forwardArity";function HN(e,n){let t=e;t._forwardArity===void 0&&Object.defineProperty(e,yX,{value:new Set,enumerable:!1,writable:!0,configurable:!0}),t._forwardArity.add(n)}function wO(e){return e._forwardArity}function F0(e){return e==="out"?"in":e==="in"?"out":"inout"}function bX(e,n){return n==="inout"||e==="inout"?"inout":n==="out"?e:F0(e)}function EX(e,n){return e===void 0?n:e===n?e:"inout"}function qa(e,n){return e===""?n:n.startsWith("[")?`${e}${n}`:`${e}.${n}`}function IO(e){return e._varianceState===void 0||e._varianceState==="verified"}function Eo(e,n){if(typeof e=="object")switch(e.kind){case"signature":for(let t of e.args??[])Eo(t.type,n);for(let t of e.optArgs??[])Eo(t.type,n);e.variadicArg!==void 0&&Eo(e.variadicArg.type,n),Eo(e.result,n);return;case"union":case"intersection":for(let t of e.types)Eo(t,n);return;case"negation":Eo(e.type,n);return;case"list":case"set":case"collection":case"indexed_collection":case"broadcastable":Eo(e.elements,n);return;case"dictionary":Eo(e.values,n);return;case"tuple":for(let t of e.elements)Eo(t.type,n);return;case"record":case"object":for(let t of Object.values(e.elements))Eo(t,n);return;case"reference":if(e.args===void 0)return;n(e);for(let t of e.args)Eo(t,n);return;default:return}}function xX(e){let n=new Set([e]),t=[e];for(;t.length>0;){let i=t.pop();if(i.def===void 0)return!0;let r=!1;if(Eo(i.def,o=>{let s=Nn(o);if(s.def===void 0){r=!0;return}IO(s)||n.has(s)||(n.add(s),t.push(s))}),r)return!0}return!1}function vX(e,n,t){let i=new Set(n.map(a=>a.name)),r=[],o=new Set,s=(a,l,f,c,d)=>{if(typeof a=="object")switch(a.kind){case"variable":if(!i.has(a.name)||c?.has(a.name)===!0)return;r.push(d===void 0?{param:a.name,polarity:l,path:f}:{param:a.name,polarity:l,path:f,deferredVia:d});return;case"signature":{let p=c;if(a.typeParams!==void 0&&a.typeParams.length>0){p=new Set(c);for(let y of a.typeParams)p.add(y.name)}let m=F0(l),h=0;for(let y of a.args??[])s(y.type,m,qa(f,`(arg ${++h})`),p,d);for(let y of a.optArgs??[])s(y.type,m,qa(f,`(arg ${++h})`),p,d);a.variadicArg!==void 0&&s(a.variadicArg.type,m,qa(f,"(variadic arg)"),p,d),s(a.result,l,qa(f,"(result)"),p,d);return}case"union":case"intersection":for(let p of a.types)s(p,l,f,c,d);return;case"negation":s(a.type,F0(l),f,c,d);return;case"list":case"set":case"collection":case"indexed_collection":case"broadcastable":s(a.elements,l,f,c,d);return;case"dictionary":s(a.values,l,f,c,d);return;case"tuple":a.elements.forEach((p,m)=>s(p.type,l,qa(f,p.name??`[${m}]`),c,d));return;case"record":for(let[p,m]of Object.entries(a.elements))s(m,l,qa(f,p),c,d);return;case"object":for(let[p,m]of Object.entries(a.elements))s(m,"inout",qa(f,p),c,d);return;case"reference":{if(a.args===void 0)return;let p=Nn(a),m=p.name===t,h=!m&&(p.def===void 0||!IO(p)&&xX(p));h&&o.add(p.name),a.args.forEach((y,b)=>{let E=qa(f,`${p.name}<${b+1}>`);if(h){s(y,l,E,c,d??p.name);return}let x=(m?n[b]?.variance:p.typeParams?.[b]?.variance)??"out";s(y,bX(l,x),E,c,d)});return}default:return}};s(e,"out","",void 0,void 0);let u=new Map;for(let a of n)u.set(a.name,void 0);for(let a of r)a.deferredVia===void 0&&u.set(a.param,EX(u.get(a.param),a.polarity));return{observed:u,occurrences:r,blockedOn:o}}function B0(e,n,t,i){let r=vX(t,n,e),o=new Set(r.occurrences.map(u=>u.param)),s=n.filter(u=>!o.has(u.name));if(s.length>0)return{status:"violation",code:"generic-alias-unused-parameter",message:`The type parameter${s.length===1?"":"s"} \`${s.map(u=>u.name).join("`, `")}\` of "${e}" ${s.length===1?"is":"are"} never used in its definition`,analysis:r};if(r.blockedOn.size>0)return{status:"deferred",blockedOn:[...r.blockedOn],analysis:r};for(let u of n){let a=u.variance??"out",l=r.observed.get(u.name);if(!(a==="inout"||a===l))return{status:"violation",code:"variance-violation",message:SX(e,u,l,r,i),analysis:r}}return{status:"ok",analysis:r}}var O0={out:"covariant",in:"contravariant",inout:"invariant"};function TX(e){return e===""?"the body":`\`${e}\``}function ZN(e,n,t){return e.occurrences.find(i=>i.param===n&&i.deferredVia===void 0&&i.polarity===t)}function pg(e,n,t){return TX(ZN(e,n,t)?.path??"")}function SX(e,n,t,i,r){let o=n.name,s=n.variance??"out",u=n.variance===void 0?`is ${O0[s]} (\`out\` is the default when no marker is written)`:`is declared \`${s}\` (${O0[s]})`,a=ZN(i,o,"out")!==void 0,l=ZN(i,o,"in")!==void 0,f=t==="inout"&&!a&&!l,c;f?c=`but \`${o}\` appears in a read/write position (${pg(i,o,"inout")}), so it can only be invariant`:t==="inout"?c=`but \`${o}\` appears in both output (${pg(i,o,"out")}) and input (${pg(i,o,"in")}) positions, so it can only be invariant`:c=`but \`${o}\` appears only in ${t==="in"?"input":"output"} positions (${pg(i,o,t)}), so it is ${O0[t]}`;let d=[t];t!=="inout"&&d.push("inout");let p=d.map(y=>{let b=` \u2022 declare it \`${y}\`: type ${e}<${y} ${o}> = \u2026`;if(y!=="inout")return b;let E=/^[aeiou]/i.test(e)?"an":"a";return`${b}
|
|
4
4
|
(${E} \`${e}<integer>\` is then no longer usable as ${E} \`${e}<number>\`)`}),m=F0(s);f||p.push(` \u2022 or keep \`${e}\` ${O0[s]} by moving the ${m==="in"?"input":"output"} occurrence (${pg(i,o,m)}) out of the body \u2014 e.g. split it off into a type of its own`);let h=r?.triggeredBy===void 0?"":` (surfaced when \`${r.triggeredBy}\` was declared)`;return`parameter \`${o}\` of \`${e}\` ${u}${h}, ${c}.
|
|
5
5
|
${p.join(`
|
package/dist/esm-min/compile.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compute Engine 0.129.
|
|
1
|
+
/** Compute Engine 0.129.1 */
|
|
2
2
|
function zo(e){return typeof e=="string"||typeof e=="function"?e:e.source}function Dw(e){return typeof e=="object"&&e!==null&&"source"in e?e.pure!==void 0?e.pure:$w(Mw(e.source)):$w(Mw(e))}function Mw(e){return typeof e=="function"?e.toString():e}function $w(e){let n=GL(e).trim(),t=HL(n);return t===void 0?!1:KL(t.body,t.params)}function GL(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/[^\n]*/g," ")}function HL(e){let n=e;for(;n.startsWith("(")&&XL(n,0)===n.length-1;)n=n.slice(1,-1).trim();let t=/^function\s*[A-Za-z_$][\w$]*\s*\(([^)]*)\)\s*\{([\s\S]*)\}$/.exec(n),i=/^function\s*\(([^)]*)\)\s*\{([\s\S]*)\}$/.exec(n),r=t??i;if(r){let c=Pw(r[2]);if(c===void 0)return;let f=Ow(r[1]);return f===void 0?void 0:{params:f,body:c}}let o=/^\(([^)]*)\)\s*=>\s*([\s\S]+)$/.exec(n),s=/^([A-Za-z_$][\w$]*)\s*=>\s*([\s\S]+)$/.exec(n),a=o??s;if(!a)return;let u=Ow(a[1]);if(u===void 0)return;let l=a[2].trim();if(l.startsWith("{")){if(!l.endsWith("}"))return;let c=Pw(l.slice(1,-1));if(c===void 0)return;l=c}return{params:u,body:l}}function Pw(e){let n=/^\s*return\s+([\s\S]+?);?\s*$/.exec(e);if(n&&!n[1].includes(";"))return n[1].trim()}function Ow(e){let n=e.trim();if(n==="")return new Set;let t=new Set;for(let i of n.split(",")){let r=i.trim();if(!/^[A-Za-z_$][\w$]*$/.test(r))return;t.add(r)}return t}var WL=new Set(["abs","acos","acosh","asin","asinh","atan","atan2","atanh","cbrt","ceil","clz32","cos","cosh","exp","expm1","floor","fround","hypot","imul","log","log10","log1p","log2","max","min","pow","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"]),YL=new Set(["Infinity","NaN","true","false","null","undefined"]),ZL=/^[\s+\-*/%()<>!=&|?:.,]*$/;function KL(e,n){if(e===""||/[[\]{}`'";]/.test(e)||/\b(new|this|await|yield|delete|void|typeof|in|instanceof|function|var|let|const)\b/.test(e)||/\+\+|--/.test(e)||/=>/.test(e)||/(^|[^=!<>])=(?!=)/.test(e)||/\bMath\s*\.\s*([A-Za-z_$][\w$]*)/.test(e)&&[...e.matchAll(/\bMath\s*\.\s*([A-Za-z_$][\w$]*)/g)].some(r=>!WL.has(r[1])))return!1;let i=e.replace(/\bMath\s*\.\s*[A-Za-z_$][\w$]*/g," 0 ").replace(/\b\d+(\.\d+)?([eE][+-]?\d+)?\b/g," ");if(i.includes(".")||/[A-Za-z_$][\w$]*\s*\(/.test(i))return!1;for(let[r]of i.matchAll(/[A-Za-z_$][\w$]*/g))if(!n.has(r)&&!YL.has(r))return!1;return ZL.test(i.replace(/[A-Za-z_$][\w$]*/g," "))}function XL(e,n){let t=0;for(let i=n;i<e.length;i++)if(e[i]==="(")t++;else if(e[i]===")"&&(t--,t===0))return i;return-1}var QL=["sgn","type","effects","lazyValue","storedValue","elementMemo","collectionFacet","typeParse"],e6=["hit","hitConstant","hitFastPath","missCold","missGeneration","missGenerationWasted","missEpoch","missScope","missKeyShape","missDependency","declineCycle","declineStore","evictClear"],n6=["generation","mutationGeneration","semanticEpoch","valueWrite","ephemeralValueWrite"],t6=["clean","dirty"],Zr=(()=>{if(typeof process>"u")return!1;let e=process.env?.CE_CACHE_STATS;return e!==void 0&&e!=="0"})(),Qd=Zr||typeof process<"u"&&!1;function i6(){let e={};for(let n of e6)e[n]=0;return e}var r6=(()=>{let e={};for(let n of QL)e[n]=i6();return e})(),FK=(()=>{let e={};for(let n of n6)e[n]=0;return e})(),LK=(()=>{let e={};for(let n of t6)e[n]=0;return e})();function Xs(e,n){r6[e][n]+=1}var ep=["number","complex","imaginary","real","rational","integer","infinity","nan"],By=["indexed_collection","list","tuple","range","string"],np=Object.freeze({kind:"indexed_collection",elements:"integer"}),tp=Object.freeze({kind:"indexed_collection",elements:"character"}),Vy=Object.freeze({kind:"list",elements:"unknown"}),jy=Object.freeze({kind:"set",elements:"unknown"}),uc=Object.freeze({kind:"dictionary",values:"unknown"}),ip=Object.freeze({kind:"collection",elements:"unknown"}),lc=Object.freeze({kind:"indexed_collection",elements:"unknown"}),Ue=Object.freeze({kind:"collection",elements:"any"}),Ie=Object.freeze({kind:"indexed_collection",elements:"any"}),rp=Object.freeze({kind:"dictionary",values:"any"}),Ai=Object.freeze({kind:"union",types:[{kind:"value",value:1/0},{kind:"value",value:-1/0}]}),Kr=Object.freeze({kind:"union",types:["real",{kind:"value",value:1/0},{kind:"value",value:-1/0}]}),op=[...By,"collection","set","record","dictionary"],sp=["scalar",...ep,"boolean","character"],qy=["value","color","regexp","type","object",...op,...sp],zy=["expression","symbol","function",...qy],Uy=["any","unknown","nothing","missing","never","error",...zy],Ri=new Set(ep),Fw=new Set(op),Lw=new Set(sp),Qs=new Set(Uy),cc="Variadic arguments cannot be used with optional arguments";function Ot(e){if(typeof e=="string")return!1;switch(e.kind){case"signature":return(e.optArgs?.length??0)>0&&e.variadicArg!==void 0?!0:Ot(e.result)||(e.args?.some(n=>Ot(n.type))??!1)||(e.optArgs?.some(n=>Ot(n.type))??!1)||e.variadicArg!==void 0&&Ot(e.variadicArg.type)||(e.typeParams?.some(n=>n.bound!==void 0&&Ot(n.bound))??!1);case"record":case"object":return Object.values(e.elements).some(Ot);case"union":case"intersection":return e.types.some(Ot);case"negation":return Ot(e.type);case"list":case"set":case"collection":case"indexed_collection":case"broadcastable":return Ot(e.elements);case"dictionary":return Ot(e.values);case"tuple":return e.elements.some(n=>Ot(n.type));case"reference":return e.args?.some(Ot)??!1;default:return!1}}function ea(e){return typeof e!="string"?!1:Qs.has(e)}function fc(e){return typeof e=="string"?Qs.has(e):typeof e!="object"||!("kind"in e)?!1:e.kind==="signature"||e.kind==="union"||e.kind==="intersection"||e.kind==="negation"||e.kind==="value"||e.kind==="tuple"||e.kind==="list"||e.kind==="record"||e.kind==="object"||e.kind==="dictionary"||e.kind==="set"||e.kind==="broadcastable"||e.kind==="symbol"||e.kind==="expression"||e.kind==="numeric"||e.kind==="collection"||e.kind==="indexed_collection"||e.kind==="variable"||e.kind==="reference"}var Bw=Object.freeze({complexInfinity:!0});function ot(e){return typeof e=="object"&&e!==null&&e.complexInfinity===!0}function o6(e){return e==="\u211D"||e==="\u2124"||e==="\u211A"||e==="\u2102"||e==="\u2115"}var dc=class{input;pos=0;line=1;column=1;tokens=[];tolerant;constructor(n,t){this.input=n,this.tolerant=t?.tolerant??!1}saveState(){return{pos:this.pos,line:this.line,column:this.column,tokens:[...this.tokens]}}restoreState(n){this.pos=n.pos,this.line=n.line,this.column=n.column,this.tokens=n.tokens}error(n){throw new Error(`Lexer error at line ${this.line}, column ${this.column}: ${n}`)}peek(n=0){let t=this.pos+n;return t<this.input.length?this.input[t]:""}advance(){let n=this.input[this.pos++];return n===`
|
|
3
3
|
`?(this.line++,this.column=1):this.column++,n}match(n){if(this.input.slice(this.pos,this.pos+n.length)===n){for(let t=0;t<n.length;t++)this.advance();return!0}return!1}isEOF(){return this.pos>=this.input.length}skipTrivia(){for(;!this.isEOF();){if(/\s/.test(this.peek())){this.advance();continue}if(this.peek()==="/"&&this.peek(1)==="/"){for(;!this.isEOF()&&!/[\n\r\u2028\u2029]/.test(this.peek());)this.advance();continue}if(this.peek()==="/"&&this.peek(1)==="*"){this.skipBlockComment();continue}break}}skipBlockComment(){this.advance(),this.advance();let n=1;for(;n>0&&!this.isEOF();)this.peek()==="/"&&this.peek(1)==="*"?(n++,this.advance(),this.advance()):this.peek()==="*"&&this.peek(1)==="/"?(n--,this.advance(),this.advance()):this.advance();n>0&&!this.tolerant&&this.error("Unterminated comment")}readIdentifier(){let n="";for(;!this.isEOF()&&/[a-zA-Z0-9_]/.test(this.peek());)n+=this.advance();return n}readVerbatimString(){if(!this.match("`"))return"";let n="";for(;!this.isEOF()&&this.peek()!=="`";)this.match("\\`")?n+="`":this.match("\\\\")?n+="\\":n+=this.advance();return this.isEOF()&&this.error("Unterminated verbatim string"),this.advance(),n}readStringLiteral(){let n=this.advance(),t="";for(;!this.isEOF()&&this.peek()!==n;)this.match("\\"+n)?t+=n:this.match("\\\\")?t+="\\":t+=this.advance();return this.isEOF()&&this.error("Unterminated string literal"),this.advance(),t}readNumber(){let n="";if((this.peek()==="-"||this.peek()==="+")&&(n+=this.advance()),this.match("0x")||this.match("0X")){for(n+="x";!this.isEOF()&&/[0-9a-fA-F]/.test(this.peek());)n+=this.advance();return"0"+n}if(this.match("0b")||this.match("0B")){for(n+="b";!this.isEOF()&&/[01]/.test(this.peek());)n+=this.advance();return"0"+n}for(;!this.isEOF()&&/[0-9]/.test(this.peek());)n+=this.advance();if(this.peek()==="."&&/[0-9]/.test(this.peek(1)))for(n+=this.advance();!this.isEOF()&&/[0-9]/.test(this.peek());)n+=this.advance();if(this.peek()==="e"||this.peek()==="E")for(n+=this.advance(),(this.peek()==="+"||this.peek()==="-")&&(n+=this.advance());!this.isEOF()&&/[0-9]/.test(this.peek());)n+=this.advance();return n}createToken(n,t){return{type:n,value:t,position:this.pos-t.length,line:this.line,column:this.column-t.length}}nextToken(){if(this.skipTrivia(),this.isEOF())return this.createToken("EOF","");let n=this.pos,t=this.peek();if(this.match("->"))return this.createToken("->","->");if(this.peek()==="<"&&this.input.startsWith("<..",this.pos)&&this.pos>0&&/[0-9.∞o+\-]/.test(this.input[this.pos-1]))return this.match("<.."),this.createToken("<..","<..");if(this.input.startsWith("..<",this.pos)&&this.pos+3<this.input.length&&!/\s/.test(this.input[this.pos+3]))return this.match("..<"),this.createToken("..<","..<");if(this.match(".."))return this.createToken("..","..");if(this.match("+\u221E")||this.match("+oo"))return this.createToken("PLUS_INFINITY",this.input.slice(n,this.pos));if(this.match("-\u221E")||this.match("-oo"))return this.createToken("MINUS_INFINITY",this.input.slice(n,this.pos));if(this.match("~\u221E")||this.match("~oo"))return this.createToken("COMPLEX_INFINITY",this.input.slice(n,this.pos));if(this.match("+infinity")||this.match("+Infinity"))return this.createToken("PLUS_INFINITY",this.input.slice(n,this.pos));if(this.match("-infinity")||this.match("-Infinity"))return this.createToken("MINUS_INFINITY",this.input.slice(n,this.pos));if(o6(t)&&!/[a-zA-Z0-9_]/.test(this.peek(1)))return this.advance(),this.createToken("IDENTIFIER",t);if(/[a-zA-Z_]/.test(t)){let i=this.readIdentifier();switch(i){case"true":return this.createToken("TRUE",i);case"false":return this.createToken("FALSE",i);case"NaN":return this.createToken("NAN",i);case"Infinity":case"oo":return this.createToken("INFINITY",i);default:return this.createToken("IDENTIFIER",i)}}switch(t){case"|":return this.advance(),this.createToken("|","|");case"&":return this.advance(),this.createToken("&","&");case"!":return this.advance(),this.createToken("!","!");case"^":return this.advance(),this.createToken("^","^");case"(":return this.advance(),this.createToken("(","(");case")":return this.advance(),this.createToken(")",")");case"<":return this.advance(),this.createToken("<","<");case">":return this.advance(),this.createToken(">",">");case"[":return this.advance(),this.createToken("[","[");case"]":return this.advance(),this.createToken("]","]");case"{":return this.advance(),this.createToken("{","{");case"}":return this.advance(),this.createToken("}","}");case",":return this.advance(),this.createToken(",",",");case":":return this.advance(),this.createToken(":",":");case"?":return this.advance(),this.createToken("?","?");case"*":return this.advance(),this.createToken("*","*");case".":return this.advance(),this.createToken(".",".");case"+":return/[0-9]/.test(this.peek(1))?this.createToken("NUMBER_LITERAL",this.readNumber()):(this.advance(),this.createToken("+","+"));case"x":return/[0-9]/.test(this.peek(1))?(this.advance(),this.createToken("x","x")):(this.advance(),this.createToken("x","x"))}if(t==='"'||t==="'")return this.createToken("STRING_LITERAL",this.readStringLiteral());if(t==="`")return this.createToken("VERBATIM_STRING",this.readVerbatimString());if(/[0-9]/.test(t)||t==="-"&&/[0-9]/.test(this.peek(1))){let i=this.readNumber();return this.peek()==="x"&&/[0-9]/.test(this.peek(1)),this.createToken("NUMBER_LITERAL",i)}if(t==="\u221E")return this.advance(),this.createToken("INFINITY","\u221E");if(this.tolerant)return this.createToken("EOF","");this.error(`Unexpected character: ${t}`)}tokenize(){let n=[];for(;!this.isEOF();){let t=this.nextToken();if(t&&(n.push(t),t.type==="EOF"))break}return n}peekToken(){if(this.tokens.length===0){let n=this.nextToken();n&&this.tokens.push(n)}return this.tokens[0]||this.createToken("EOF","")}consumeToken(){if(this.tokens.length===0){let n=this.nextToken();if(n)return n}return this.tokens.shift()||this.createToken("EOF","")}matchToken(n){return this.peekToken().type===n?(this.consumeToken(),!0):!1}expectToken(n){let t=this.consumeToken();return t.type!==n&&this.error(`Expected ${n}, got ${t.type}`),t}};var pc=["console","entropy","environment","fs_read","fs_write","network","random","scope","state","time"],s6=new Set(pc);function up(e){return s6.has(e)}var a6=new Set(["console","entropy","environment","fs_read","fs_write","network","random","scope","state","time"]);function mc(e){return e===void 0?!0:e==="any"?!1:!e.some(n=>a6.has(n))}function hc(e,n){return e===void 0||e==="any"||Xr(e)?!1:e.includes(n)}function Vw(e){return e===void 0||e!=="any"&&e.length===0}function Eu(e){return jw(e,!1)}function gc(e){return jw(e,!0)}function jw(e,n){if(e===void 0)return;if(e==="any")return"any";if(typeof e=="string"||typeof e?.[Symbol.iterator]!="function")throw new Error(`Invalid effect set \`${String(e)}\`. Expected \`'any'\` or a collection of effect labels. The effect labels are ${pc.join(", ")}`);let t=[...new Set(e)].sort();for(let i of t)if(!up(i))throw new Error(`Unknown effect label \`${i}\`. The effect labels are ${pc.join(", ")}`);return t.length>0?t:n?[]:void 0}function Dt(e,n){return Vw(e)||n==="any"?!0:e==="any"||Vw(n)?!1:e.every(t=>n.includes(t))}function na(e,n){return Dt(e,n)&&Dt(n,e)}function lp(e,n){return e===void 0||n===void 0||e==="any"||n==="any"?e===n:e.length===n.length&&e.every((t,i)=>n[i]===t)}function Yn(e,n){return e===void 0?n===void 0?void 0:n:n===void 0?e:e==="any"||n==="any"?"any":gc([...e,...n])}function Xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ap(e){let n=Eu(e);if(n===void 0)return"any";if(n==="any")throw new Error("A co-finite complement cannot contain `any`");return{not:n}}function Uo(e,n){if(e!==void 0)return n===void 0||n.length===0?e:e==="any"?ap(n):Xr(e)?ap([...e.not,...n]):Eu(e.filter(t=>!n.includes(t)))}function fi(e,n){if(e==="any"||n==="any")return"any";let t=Xr(e),i=Xr(n);if(!t&&!i)return Yn(e,n);if(t&&i)return ap(e.not.filter(s=>n.not.includes(s)));let r=t?e:n,o=t?n:e;return o===void 0?r:ap(r.not.filter(s=>!o.includes(s)))}function xu(e){return Xr(e)?!1:mc(e)}function yc(e){return e==="any"?"any":e.length===0?"pure":[...e].sort().join(" ")}var u6=Object.assign(Object.create(null),{finite_number:"complex",finite_complex:"complex",finite_real:"real",finite_rational:"rational",finite_integer:"integer"}),l6=Object.assign(Object.create(null),{\u211D:"real",\u2124:"integer",\u211A:"rational",\u2102:"complex"});function qw(e){return l6[e]??u6[e]??e}var cp=class{lexer;typeResolver;current;allowTrailing;_end=0;_typeVarScopes=[];allowWhere;allowObjectType;blockFollows;_sawWhere=!1;_sawForwardRef=!1;constructor(n,t){this.allowTrailing=t?.allowTrailing??!1,this.allowWhere=t?.allowWhere??!0,this.allowObjectType=t?.allowObjectType??!1,this.blockFollows=t?.blockFollows??!1,t?.typeVars!==void 0&&t.typeVars.length>0&&this._typeVarScopes.push(new Set(t.typeVars.map(i=>i.name))),this.lexer=new dc(n,{tolerant:this.allowTrailing}),this.typeResolver=t?.typeResolver??{forward:()=>{},resolve:()=>{},get names(){return[]}},this.current=this.lexer.consumeToken()}get endOffset(){return this._end}get sawWhereClause(){return this._sawWhere}get sawForwardRef(){return this._sawForwardRef}error(n,t){this.errorAtToken(this.current,n,t)}errorAtToken(n,t,i,r){let o=this.lexer.input;this.allowTrailing&&(o=o.slice(0,n.position+n.value.length));let a=o.split(`
|
|
4
4
|
`)[n.line-1]||o,u=n.column,l=" ".repeat(Math.max(0,u-1))+"^",c=["","Invalid type",`| ${a}`,`| ${l}`,"|",`| ${t}`];i&&c.push(`| ${i}`),c.push("");let f=new Error(c.join(`
|
|
@@ -1797,7 +1797,7 @@ return function (_) { ${r} };`)(this.IA);return new Proxy(this,{apply:(s,a,u)=>{
|
|
|
1797
1797
|
`,l[p]=p):typeof g=="string"&&(l[p]=g)}let f=this.createTarget({mode:t.mode,constantFold:!1,varsKeys:s?new Set(Object.keys(s)):void 0,foldExcludedOps:Object.keys(l).length>0?new Set(Object.keys(l)):void 0,unrollSkipHeads:i,unrollMinWidth:1,unrollConstantLists:!0,foldEmittedConstant:t.constantFold===!1?void 0:(p,m)=>Zd(m,!1,Aw(f)),constant:p=>ky[p],functions:p=>l?.[p]?l[p]:xL(p),var:p=>{if(s&&Object.hasOwn(s,p))return s[p];let m=ky[p];if(m!==void 0)return m;if(u.includes(p))return bL(p);if(n.engine._getSymbolValue(p)===void 0)return bL(p)},preamble:(a??"")+c,userFunctions:{defs:new Map,compiling:new Set},naming:E.newNamingContext(n,[a,c,...Object.values(l),...s?Object.values(s):[]])});f.userFunctions.root=f,n=At(E.inlineCollectionValuedCallsAtRoot(n,f),r),u=n.unknowns,E.openCseSession(n,f,{enabled:t.cse,isOverriddenOperator:p=>Object.prototype.hasOwnProperty.call(l,p),isStringVar:p=>s!==void 0&&typeof s[p]=="string",isVarsKey:p=>s!==void 0&&Object.prototype.hasOwnProperty.call(s,p)});let d=OK(n,f);return E.withReferences(d,n,f,s?new Set(Object.keys(s)):void 0)}};function OK(e,n){SK(n);let t;try{let f=gK(e,n),d=f===void 0&&PL.has((jo(e,n)??e).operator);t=f!==void 0?E.compileCseRoot(e,n,0,()=>`[${f.map(p=>E.compileValueOperand(p,n)).join(", ")}]`):d?E.compileCseRoot(e,n,0,()=>Yr(e,n)??E.compile(e,n)):E.compileCseRoot(e,n)}catch(f){return{target:"interval-js",success:!1,code:"",error:f.message,diagnostic:Or(f),...E.modeReport()}}let i=E.userFunctionsPreamble(n),r=PK(i,t,n),o=r.expression,s=Oy.get(E.namingContext(n)),a=[s&&s.length>0?`let ${s.join(", ")};`:"",r.declarations].filter(f=>f).join(`
|
|
1798
1798
|
`),u=[n.preamble,r.definitions].filter(f=>f).join(`
|
|
1799
1799
|
`),l=[n.preamble,a,r.definitions].filter(f=>f).join(`
|
|
1800
|
-
`),c=new _w(o,u,a);return{target:"interval-js",success:!0,code:o,...l?{preamble:l}:{},calling:"expression",run:c}}var ICe="0.129.
|
|
1800
|
+
`),c=new _w(o,u,a);return{target:"interval-js",success:!0,code:o,...l?{preamble:l}:{},calling:"expression",run:c}}var ICe="0.129.1";export{E as BaseCompiler,uS as GLSLTarget,hu as GPUShaderTarget,Iw as IntervalJavaScriptTarget,R1 as JavaScriptTarget,yS as PythonTarget,lS as WGSLTarget,qU as compile,ICe as version};
|
|
1801
1801
|
/*! Bundled license information:
|
|
1802
1802
|
|
|
1803
1803
|
complex-esm/dist/src/complex.js:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Compute Engine 0.129.
|
|
2
|
-
import{A as ca,B as da,C as ea,D as fa,E as ga,F as ha,G as ia,l as P,m as Q,n as R,o as S,p as T,q as U,r as V,s as W,t as X,u as Y,v as Z,w as _,x as $,y as aa,z as ba}from"./chunks/chunk-
|
|
1
|
+
/** Compute Engine 0.129.1 */
|
|
2
|
+
import{A as ca,B as da,C as ea,D as fa,E as ga,F as ha,G as ia,l as P,m as Q,n as R,o as S,p as T,q as U,r as V,s as W,t as X,u as Y,v as Z,w as _,x as $,y as aa,z as ba}from"./chunks/chunk-75MH3VS7.js";import{Di as w,Gc as c,Hc as d,Ic as e,Kc as f,Ki as x,Lc as g,Mc as h,Nc as i,Oc as j,Pc as k,Pi as y,Qi as z,Ri as A,Sc as l,Si as B,Tc as m,Ti as C,Ui as D,Vi as E,Wi as F,Xc as n,Xi as G,Yc as o,Yi as H,b as a,ii as p,ji as q,jj as I,ki as r,kj as J,li as s,lj as K,mb as b,mi as t,mj as L,pj as M,qj as N,rj as O,si as u,ti as v}from"./chunks/chunk-S6UB43FH.js";export{A as ALGEBRA_DICTIONARY,C as ARITHMETIC_DICTIONARY,P as BaseCompiler,a as BigDecimal,F as CALCULUS_DICTIONARY,D as COMPLEX_DICTIONARY,z as CORE_DICTIONARY,b as CancellationError,ia as ComputeEngine,S as GLSLTarget,R as GPUShaderTarget,w as INEQUALITIES_DICTIONARY,V as IntervalJavaScriptTarget,Q as JavaScriptTarget,L as LATEX_DICTIONARY,G as LINEAR_ALGEBRA_DICTIONARY,x as LOGIC_DICTIONARY,M as LatexSyntax,$ as N,J as OTHERS_DICTIONARY,K as PHYSICS_DICTIONARY,U as PythonTarget,B as SETS_DICTIONARY,H as STATISTICS_DICTIONARY,y as SYMBOLS_DICTIONARY,E as TRIGONOMETRY_DICTIONARY,I as UNITS_DICTIONARY,T as WGSLTarget,ba as assign,ga as compile,aa as declare,_ as evaluate,ca as expand,ea as expandAll,Y as expr,fa as factor,W as getDefaultEngine,r as indexingSetSites,h as isCharacter,l as isCollection,j as isDictionary,c as isExpression,f as isFunction,m as isIndexedCollection,d as isNumber,k as isObject,g as isString,e as isSymbol,i as isTensor,v as labelFor,t as lambdaParamSites,s as limitsIndexSites,n as numericValue,p as operandSites,q as operandsFrom,X as parse,N as parseLatex,u as registerStepLabels,O as serializeLatex,Z as simplify,da as solve,o as sym,ha as version};
|