Full Code of LedgerHQ/speculos for AI

master c8324ac5b952 cached
426 files
21.0 MB
5.5M tokens
3464 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (22,095K chars total). Download the full file to get everything.
Repository: LedgerHQ/speculos
Branch: master
Commit: c8324ac5b952
Files: 426
Total size: 21.0 MB

Directory structure:
gitextract_zpn2g_yk/

├── .clang-format
├── .codespell-ignore
├── .dockerignore
├── .github/
│   ├── actionlint.yaml
│   └── workflows/
│       ├── continuous-integration-workflow.yml
│       ├── documentation.yml
│       ├── fast-checks.yml
│       ├── force-rebase.yml
│       └── reusable_ragger_tests_latest_speculos.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .vscode/
│   └── settings.json
├── CHANGELOG.md
├── CMakeLists.txt
├── COPYING
├── COPYING.LESSER
├── Dockerfiles/
│   ├── Dockerfile
│   └── build.Dockerfile
├── MANIFEST.in
├── Pipfile
├── README.md
├── apps/
│   ├── README.md
│   └── nanox#boil#25#6e728d99.elf
├── clang-armv7m.cmake
├── docker-compose.yml
├── docs/
│   ├── CNAME
│   ├── Makefile
│   ├── conf.py
│   ├── dev/
│   │   ├── ci.md
│   │   ├── getting_started.md
│   │   ├── index.rst
│   │   ├── internals.md
│   │   └── tests.md
│   ├── index.rst
│   ├── installation/
│   │   ├── build.md
│   │   ├── index.rst
│   │   └── wsl.md
│   ├── requirements.txt
│   └── user/
│       ├── api.md
│       ├── automation.md
│       ├── clients.md
│       ├── debug.md
│       ├── docker.md
│       ├── index.rst
│       ├── macm1.md
│       ├── semihosting.md
│       └── usage.md
├── gcc-arm.cmake
├── lgtm.yml
├── pyproject.toml
├── sdk/
│   └── bolos_syscalls.h
├── setup.py
├── speculos/
│   ├── __init__.py
│   ├── __main__.py
│   ├── api/
│   │   ├── README.md
│   │   ├── __init__.py
│   │   ├── apdu.py
│   │   ├── api.py
│   │   ├── automation.py
│   │   ├── button.py
│   │   ├── events.py
│   │   ├── finger.py
│   │   ├── resources/
│   │   │   ├── apdu.schema
│   │   │   ├── button.schema
│   │   │   ├── finger.schema
│   │   │   └── ticker.schema
│   │   ├── restful.py
│   │   ├── screenshot.py
│   │   ├── static/
│   │   │   ├── index.html
│   │   │   └── swagger/
│   │   │       ├── README.md
│   │   │       ├── index.html
│   │   │       ├── swagger-ui-bundle.js
│   │   │       ├── swagger-ui-standalone-preset.js
│   │   │       ├── swagger-ui.css
│   │   │       └── swagger.json
│   │   ├── swagger.py
│   │   ├── swagger.yaml
│   │   ├── ticker.py
│   │   └── web_interface.py
│   ├── client.py
│   ├── cxlib/
│   │   ├── flex-api-level-cx-22.elf
│   │   ├── nanosp-api-level-cx-22.elf
│   │   ├── nanox-api-level-cx-22.elf
│   │   └── stax-api-level-cx-22.elf
│   ├── main.py
│   ├── mcu/
│   │   ├── __init__.py
│   │   ├── apdu.py
│   │   ├── automation.py
│   │   ├── automation_server.py
│   │   ├── bagl.py
│   │   ├── bagl_font.py
│   │   ├── bagl_glyph.py
│   │   ├── button_tcp.py
│   │   ├── display.py
│   │   ├── finger_tcp.py
│   │   ├── headless.py
│   │   ├── nbgl.py
│   │   ├── nbgl_serialize.py
│   │   ├── ocr.py
│   │   ├── readerror.py
│   │   ├── resources/
│   │   │   └── automation.schema
│   │   ├── rle_custom.py
│   │   ├── screen.py
│   │   ├── screen_text.py
│   │   ├── seproxyhal.py
│   │   ├── struct.py
│   │   ├── transport/
│   │   │   ├── __init__.py
│   │   │   ├── interface.py
│   │   │   ├── nfc.py
│   │   │   └── usb.py
│   │   └── vnc.py
│   ├── observer.py
│   ├── resources_importer.py
│   └── sharedlib/
│       ├── apex_p-api-level-shared-25.elf
│       ├── apex_p-api-level-shared-26.elf
│       ├── flex-api-level-shared-24.elf
│       ├── flex-api-level-shared-25.elf
│       ├── flex-api-level-shared-26.elf
│       ├── nanosp-api-level-shared-24.elf
│       ├── nanosp-api-level-shared-25.elf
│       ├── nanosp-api-level-shared-26.elf
│       ├── nanox-api-level-shared-24.elf
│       ├── nanox-api-level-shared-25.elf
│       ├── nanox-api-level-shared-26.elf
│       ├── stax-api-level-shared-24.elf
│       ├── stax-api-level-shared-25.elf
│       └── stax-api-level-shared-26.elf
├── speculos.py
├── src/
│   ├── CMakeLists.txt
│   ├── bolos/
│   │   ├── bagl.c
│   │   ├── bagl.h
│   │   ├── cx.c
│   │   ├── cx.h
│   │   ├── cx_aes.c
│   │   ├── cx_aes.h
│   │   ├── cx_aes_sdk2.c
│   │   ├── cx_blake2.h
│   │   ├── cx_blake2b.c
│   │   ├── cx_bls.c
│   │   ├── cx_bls.h
│   │   ├── cx_bls_fp2.c
│   │   ├── cx_bls_g2.c
│   │   ├── cx_bn.c
│   │   ├── cx_common.h
│   │   ├── cx_crc.c
│   │   ├── cx_crc.h
│   │   ├── cx_curve25519.c
│   │   ├── cx_curve25519.h
│   │   ├── cx_ec.c
│   │   ├── cx_ec.h
│   │   ├── cx_ec_domain.c
│   │   ├── cx_ecpoint.c
│   │   ├── cx_ed25519.c
│   │   ├── cx_ed25519.h
│   │   ├── cx_hash.c
│   │   ├── cx_hash.h
│   │   ├── cx_hkdf.c
│   │   ├── cx_hkdf.h
│   │   ├── cx_hmac.c
│   │   ├── cx_hmac.h
│   │   ├── cx_math.c
│   │   ├── cx_math.h
│   │   ├── cx_montgomery.c
│   │   ├── cx_mpi.c
│   │   ├── cx_ripemd160.c
│   │   ├── cx_rng_rfc6979.c
│   │   ├── cx_rng_rfc6979.h
│   │   ├── cx_scc.c
│   │   ├── cx_sha256.c
│   │   ├── cx_sha3.c
│   │   ├── cx_sha512.c
│   │   ├── cx_twisted_edwards.c
│   │   ├── cx_utils.c
│   │   ├── cx_utils.h
│   │   ├── cx_weierstrass.c
│   │   ├── cxlib.c
│   │   ├── cxlib.h
│   │   ├── default.c
│   │   ├── endorsement.c
│   │   ├── endorsement.h
│   │   ├── exception.c
│   │   ├── exception.h
│   │   ├── fonts_info.c
│   │   ├── hdkey/
│   │   │   ├── include/
│   │   │   │   ├── hdkey.h
│   │   │   │   ├── hdkey_bip32.h
│   │   │   │   ├── hdkey_bls12377.h
│   │   │   │   ├── hdkey_validate.h
│   │   │   │   └── hdkey_zip32.h
│   │   │   └── src/
│   │   │       ├── hdkey.c
│   │   │       ├── hdkey_bip32.c
│   │   │       ├── hdkey_bls12377.c
│   │   │       ├── hdkey_validate.c
│   │   │       └── hdkey_zip32.c
│   │   ├── io/
│   │   │   ├── io.c
│   │   │   ├── io.h
│   │   │   ├── mock/
│   │   │   │   ├── include/
│   │   │   │   │   ├── checks.h
│   │   │   │   │   ├── cx_rng_internal.h
│   │   │   │   │   ├── decorators.h
│   │   │   │   │   ├── exceptions.h
│   │   │   │   │   ├── lcx_hash.h
│   │   │   │   │   ├── lcx_sha512.h
│   │   │   │   │   ├── os.h
│   │   │   │   │   ├── os_debug.h
│   │   │   │   │   ├── os_helpers.h
│   │   │   │   │   ├── os_id.h
│   │   │   │   │   ├── os_math.h
│   │   │   │   │   ├── os_pic.h
│   │   │   │   │   ├── os_pin.h
│   │   │   │   │   ├── os_pki.h
│   │   │   │   │   ├── os_registry.h
│   │   │   │   │   ├── os_seed.h
│   │   │   │   │   ├── os_utils.h
│   │   │   │   │   └── ux.h
│   │   │   │   └── src/
│   │   │   │       └── mock.c
│   │   │   └── sdk/
│   │   │       ├── include/
│   │   │       │   ├── appflags.h
│   │   │       │   ├── errors.h
│   │   │       │   ├── os_apdu.h
│   │   │       │   ├── os_app.h
│   │   │       │   ├── os_errors.h
│   │   │       │   └── seproxyhal_protocol.h
│   │   │       ├── io/
│   │   │       │   ├── include/
│   │   │       │   │   ├── os_io.h
│   │   │       │   │   ├── os_io_seph_cmd.h
│   │   │       │   │   └── os_io_seph_ux.h
│   │   │       │   └── src/
│   │   │       │       ├── os_io.c
│   │   │       │       ├── os_io_seph_cmd.c
│   │   │       │       └── os_io_seph_ux.c
│   │   │       ├── lib_nfc/
│   │   │       │   ├── doc/
│   │   │       │   │   └── mainpage.dox
│   │   │       │   ├── include/
│   │   │       │   │   ├── nfc_ledger.h
│   │   │       │   │   └── nfc_ndef.h
│   │   │       │   └── src/
│   │   │       │       ├── nfc_ledger.c
│   │   │       │       └── nfc_ndef.c
│   │   │       ├── lib_stusb/
│   │   │       │   ├── include/
│   │   │       │   │   ├── usbd_conf.h
│   │   │       │   │   ├── usbd_core.h
│   │   │       │   │   ├── usbd_ctlreq.h
│   │   │       │   │   ├── usbd_def.h
│   │   │       │   │   ├── usbd_desc.h
│   │   │       │   │   ├── usbd_ioreq.h
│   │   │       │   │   ├── usbd_ledger.h
│   │   │       │   │   ├── usbd_ledger_ccid.h
│   │   │       │   │   ├── usbd_ledger_cdc.h
│   │   │       │   │   ├── usbd_ledger_hid.h
│   │   │       │   │   ├── usbd_ledger_hid_kbd.h
│   │   │       │   │   ├── usbd_ledger_hid_u2f.h
│   │   │       │   │   ├── usbd_ledger_types.h
│   │   │       │   │   └── usbd_ledger_webusb.h
│   │   │       │   └── src/
│   │   │       │       ├── usbd_conf.c
│   │   │       │       ├── usbd_core.c
│   │   │       │       ├── usbd_ctlreq.c
│   │   │       │       ├── usbd_desc.c
│   │   │       │       ├── usbd_ioreq.c
│   │   │       │       ├── usbd_ledger.c
│   │   │       │       ├── usbd_ledger_hid.c
│   │   │       │       ├── usbd_ledger_hid_u2f.c
│   │   │       │       └── usbd_ledger_webusb.c
│   │   │       └── protocol/
│   │   │           ├── include/
│   │   │           │   └── ledger_protocol.h
│   │   │           └── src/
│   │   │               └── ledger_protocol.c
│   │   ├── nbgl.c
│   │   ├── nbgl.h
│   │   ├── nbgl_rle.c
│   │   ├── nbgl_rle.h
│   │   ├── os.c
│   │   ├── os_bip32.c
│   │   ├── os_bip32.h
│   │   ├── os_eip2333.c
│   │   ├── os_hdkey.c
│   │   ├── os_hdkey.h
│   │   ├── os_pki.c
│   │   ├── os_pki.h
│   │   ├── os_result.h
│   │   ├── os_signature.c
│   │   ├── os_signature.h
│   │   ├── os_types.h
│   │   ├── seproxyhal.c
│   │   ├── touch.c
│   │   └── touch.h
│   ├── emulate.c
│   ├── emulate.h
│   ├── environment.c
│   ├── environment.h
│   ├── fonts.h
│   ├── launcher.c
│   ├── launcher.h
│   ├── output/
│   │   └── parse_elf
│   ├── parse_elf
│   ├── sdk.h
│   ├── svc.c
│   ├── svc.h
│   └── vnc/
│       ├── CMakeLists.txt
│       ├── cursor.c
│       ├── cursor.h
│       ├── cursors/
│       │   ├── approved.h
│       │   ├── bitcoin.h
│       │   ├── blue.h
│       │   ├── fabrice.h
│       │   ├── frame_00.h
│       │   ├── frame_01.h
│       │   ├── frame_02.h
│       │   ├── frame_03.h
│       │   ├── frame_04.h
│       │   ├── frame_05.h
│       │   ├── frame_06.h
│       │   ├── frame_07.h
│       │   ├── frame_08.h
│       │   ├── frame_09.h
│       │   ├── frame_10.h
│       │   ├── frame_11.h
│       │   ├── frame_12.h
│       │   ├── frame_13.h
│       │   ├── frame_14.h
│       │   ├── frame_15.h
│       │   ├── frame_16.h
│       │   ├── frame_17.h
│       │   ├── frame_18.h
│       │   ├── frame_19.h
│       │   ├── frame_20.h
│       │   ├── frame_21.h
│       │   ├── pizza.h
│       │   ├── star.h
│       │   ├── sword.h
│       │   └── verynice.h
│       ├── seccomp-bpf.h
│       └── vnc_server.c
├── tests/
│   ├── c/
│   │   ├── CMakeLists.txt
│   │   ├── mocks.c
│   │   ├── syscalls/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── cavp/
│   │   │   │   ├── blake2b_kat.data
│   │   │   │   ├── groestl_224_long_msg.data
│   │   │   │   ├── groestl_224_short_msg.data
│   │   │   │   ├── groestl_256_long_msg.data
│   │   │   │   ├── groestl_256_short_msg.data
│   │   │   │   ├── groestl_384_long_msg.data
│   │   │   │   ├── groestl_384_short_msg.data
│   │   │   │   ├── groestl_512_long_msg.data
│   │   │   │   ├── groestl_512_short_msg.data
│   │   │   │   ├── hmac.data
│   │   │   │   ├── keccak_224_long_msg.data
│   │   │   │   ├── keccak_224_short_msg.data
│   │   │   │   ├── keccak_256_long_msg.data
│   │   │   │   ├── keccak_256_short_msg.data
│   │   │   │   ├── keccak_384_long_msg.data
│   │   │   │   ├── keccak_384_short_msg.data
│   │   │   │   ├── keccak_512_long_msg.data
│   │   │   │   ├── keccak_512_short_msg.data
│   │   │   │   ├── sha224_long_msg.data
│   │   │   │   ├── sha224_short_msg.data
│   │   │   │   ├── sha256_long_msg.data
│   │   │   │   ├── sha256_short_msg.data
│   │   │   │   ├── sha384_long_msg.data
│   │   │   │   ├── sha384_short_msg.data
│   │   │   │   ├── sha3_224_long_msg.data
│   │   │   │   ├── sha3_224_short_msg.data
│   │   │   │   ├── sha3_256_long_msg.data
│   │   │   │   ├── sha3_256_short_msg.data
│   │   │   │   ├── sha3_384_long_msg.data
│   │   │   │   ├── sha3_384_short_msg.data
│   │   │   │   ├── sha3_512_long_msg.data
│   │   │   │   ├── sha3_512_short_msg.data
│   │   │   │   ├── sha512_long_msg.data
│   │   │   │   ├── sha512_short_msg.data
│   │   │   │   ├── shake128_long_msg.data
│   │   │   │   ├── shake128_short_msg.data
│   │   │   │   ├── shake128_variable_output.data
│   │   │   │   ├── shake256_long_msg.data
│   │   │   │   ├── shake256_short_msg.data
│   │   │   │   └── shake256_variable_output.data
│   │   │   ├── hello.c
│   │   │   ├── nist_cavp.c
│   │   │   ├── nist_cavp.h
│   │   │   ├── test_aes.c
│   │   │   ├── test_bip32.c
│   │   │   ├── test_blake2.c
│   │   │   ├── test_bls.c
│   │   │   ├── test_bn.c
│   │   │   ├── test_crc16.c
│   │   │   ├── test_ec.c
│   │   │   ├── test_ecdh.c
│   │   │   ├── test_ecdsa.c
│   │   │   ├── test_ecpoint.c
│   │   │   ├── test_eddsa.c
│   │   │   ├── test_eip2333.c
│   │   │   ├── test_endorsement.c
│   │   │   ├── test_hdkey.c
│   │   │   ├── test_hmac.c
│   │   │   ├── test_math.c
│   │   │   ├── test_mpi_rng.c
│   │   │   ├── test_os_global_pin_is_validated.c
│   │   │   ├── test_rfc6979.c
│   │   │   ├── test_ripemd.c
│   │   │   ├── test_sha2.c
│   │   │   ├── test_sha3.c
│   │   │   ├── test_slip21.c
│   │   │   └── wycheproof/
│   │   │       ├── X25519.data
│   │   │       ├── X448.data
│   │   │       ├── ecdh_secp256k1.data
│   │   │       └── eddsa.data
│   │   ├── test_environment.c
│   │   ├── utils.c
│   │   └── utils.h
│   └── python/
│       ├── __init__.py
│       ├── api/
│       │   ├── __init__.py
│       │   ├── resources/
│       │   │   └── automation.json
│       │   └── test_api.py
│       ├── apps/
│       │   ├── __init__.py
│       │   ├── resources/
│       │   │   ├── __init__.py
│       │   │   └── boil_getpubkey_nanox.json
│       │   ├── test_boil.py
│       │   └── test_vnc.py
│       ├── conftest.py
│       ├── mcu/
│       │   ├── __init__.py
│       │   ├── resources/
│       │   │   ├── automation_invalid_action_args.json
│       │   │   ├── automation_invalid_action_name.json
│       │   │   ├── automation_invalid_rule_key.json
│       │   │   └── automation_valid.json
│       │   └── test_automation.py
│       ├── pytest.ini
│       ├── test_resources_importer.py
│       └── unit/
│           ├── __init__.py
│           ├── test_client_Api.py
│           └── test_client_SpeculosClient.py
└── tools/
    ├── clang-format.sh
    ├── cursor.py
    ├── debug.sh
    ├── gdbinit
    ├── gif-recorder.py
    ├── ledger-live-http-proxy.py
    └── winamp.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .clang-format
================================================
# https://stackoverflow.com/questions/29477654/how-to-make-clang-format-add-new-line-before-opening-brace-of-a-function
---
Language:        Cpp
# BasedOnStyle:  LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands:   true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
  AfterCaseLabel:  false
  AfterClass:      false
  AfterControlStatement: false
  AfterEnum:       false
  AfterFunction:   true
  AfterNamespace:  false
  AfterObjCDeclaration: false
  AfterStruct:     false
  AfterUnion:      false
  AfterExternBlock: false
  BeforeCatch:     false
  BeforeElse:      false
  IndentBraces:    false
  SplitEmptyFunction: true
  SplitEmptyRecord: true
  SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit:     80
CommentPragmas:  '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat:   false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
  - foreach
  - Q_FOREACH
  - BOOST_FOREACH
IncludeBlocks:   Preserve
IncludeCategories:
  - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
    Priority:        2
  - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
    Priority:        3
  - Regex:           '.*'
    Priority:        1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth:     2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd:   ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments:  true
SortIncludes:    true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles:  false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard:        Cpp11
StatementMacros:
  - Q_UNUSED
  - QT_REQUIRE_VERSION
TabWidth:        8
UseTab:          Never
...



================================================
FILE: .codespell-ignore
================================================
globaly
keypair
ontop
tolen
unstall
TE


================================================
FILE: .dockerignore
================================================
apps
node_server
Dockerfile
docker-compose.yml
.dockerignore
.git*
doc
README.md


================================================
FILE: .github/actionlint.yaml
================================================
version: 1
self-hosted-runner:
  labels:
    - public-ledgerhq-shared-small
    - speculos-builder-2c-arm64-ubuntu_2404


================================================
FILE: .github/workflows/continuous-integration-workflow.yml
================================================
name: Continuous Integration & Deployment

on:
  workflow_dispatch:
  push:
    tags:
      - '*'
    branches:
      - master
  pull_request:
    branches:
      - master
# Cancel previous runs on this reference
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  PYGAME_HIDE_SUPPORT_PROMPT: 1

jobs:
  build_builder_image:
    name: Build speculos-builder image
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3
    - name: Build speculos-builder locally
      uses: docker/build-push-action@v6
      with:
        context: .
        file: Dockerfiles/build.Dockerfile
        push: false
        load: true
        tags: speculos-builder:local
        cache-from: type=gha
        cache-to: type=gha,mode=max
    - name: Export image as artifact
      run: docker save speculos-builder:local > /tmp/speculos-builder-image.tar
    - name: Upload image artifact
      uses: actions/upload-artifact@v4
      with:
        name: speculos-builder-image
        path: /tmp/speculos-builder-image.tar
        retention-days: 1

  build_speculos_image:
    name: Build speculos image
    needs: build_builder_image
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
    - name: Download builder image artifact
      uses: actions/download-artifact@v4
      with:
        name: speculos-builder-image
        path: /tmp
    - name: Load builder image
      run: docker load -i /tmp/speculos-builder-image.tar
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3
      with:
        driver: docker
    - name: Build speculos image
      uses: docker/build-push-action@v6
      with:
        context: .
        file: Dockerfiles/Dockerfile
        push: false
        build-args: BUILDER_IMAGE=speculos-builder:local

  coverage:
    name: Code coverage
    needs: build_builder_image
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Download builder image artifact
      uses: actions/download-artifact@v4
      with:
        name: speculos-builder-image
        path: /tmp
    - name: Load builder image
      run: docker load -i /tmp/speculos-builder-image.tar
    - name: Build with code coverage instrumentation
      env:
        CTEST_OUTPUT_ON_FAILURE: 1
        RNG_SEED: 0
      run: |
        docker run --rm \
          -v "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" \
          -w "$GITHUB_WORKSPACE" \
          -e CTEST_OUTPUT_ON_FAILURE \
          -e RNG_SEED=0 \
          speculos-builder:local \
          sh -c "
            git config --global --add safe.directory $GITHUB_WORKSPACE &&
            cmake -Bbuild -H. -DPRECOMPILED_DEPENDENCIES_DIR=/install -DWITH_VNC=1 -DCODE_COVERAGE=ON &&
            make -C build clean &&
            make -C build &&
            make -C build test &&
            pip install pytest-cov &&
            pip install . &&
            PYTHONPATH=. pytest --cov=speculos --cov-report=xml
          "
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v4
      env:
        CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
      with:
        name: codecov-speculos

  build:
    name: Clone, build, test
    needs: build_builder_image
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        python_version: ['3.10', '3.11', '3.12', '3.13']

    steps:
    - name: Clone
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Download builder image artifact
      uses: actions/download-artifact@v4
      with:
        name: speculos-builder-image
        path: /tmp
    - name: Load builder image
      run: docker load -i /tmp/speculos-builder-image.tar
    - name: Setup Python version
      uses: actions/setup-python@v5
      with:
        python-version: ${{ matrix.python_version }}
    - name: Build and test
      run: |
        PYTHON_PATH=$(which python)
        PYTHON_DIR=$(dirname $(dirname $PYTHON_PATH))
        docker run --rm \
          -v "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" \
          -v "$PYTHON_DIR:$PYTHON_DIR" \
          -w "$GITHUB_WORKSPACE" \
          -e CTEST_OUTPUT_ON_FAILURE=1 \
          speculos-builder:local \
          sh -c "
            git config --global --add safe.directory $GITHUB_WORKSPACE &&
            cmake -Bbuild -H. -DPRECOMPILED_DEPENDENCIES_DIR=/install -DWITH_VNC=1 &&
            make -C build &&
            $PYTHON_PATH -m pip install pytest &&
            $PYTHON_PATH -m pip install . &&
            make -C build/ test &&
            $PYTHON_PATH -m pytest
          "

  deploy:
    name: Build and deploy speculos package
    needs: build
    uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_pypi_deployment.yml@v1
    with:
      package_name: speculos
      jfrog_deployment: true
      release: ${{ startsWith(github.ref, 'refs/tags/') }}
      publish: ${{ startsWith(github.ref, 'refs/tags/') }}
      docker_image_artifact: speculos-builder-image
      workspace_mark_safe: true
    secrets:
      pypi_token: ${{ secrets.PYPI_PUBLIC_API_TOKEN }}

  package_and_test_docker:
    name: Build and test the Speculos docker
    uses: ./.github/workflows/reusable_ragger_tests_latest_speculos.yml
    with:
      app_repository: LedgerHQ/app-boilerplate
      app_branch_name: master

  package_and_test_docker_rust:
    name: Build and test the Speculos docker with a Rust app
    uses: ./.github/workflows/reusable_ragger_tests_latest_speculos.yml
    with:
      app_repository: LedgerHQ/app-boilerplate-rust
      app_branch_name: main


================================================
FILE: .github/workflows/documentation.yml
================================================
name: Documentation generation & update

on:
  push:
    tags:
      - '*'
    branches:
      - develop
      - master
  pull_request:
    branches:
      - develop
      - master
# Cancel previous runs on this reference
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  generate:
    name: Generate the documentation
    runs-on: ubuntu-latest
    steps:
      - name: Clone
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Install Python dependencies
        run: |
          pip install -r docs/requirements.txt
      - name: Generate the documentation
        run: (cd docs && make html)
      - name: Upload documentation bundle
        uses: actions/upload-artifact@v4
        with:
          name: documentation
          path: docs/build/html/

  deploy:
    name: Deploy the documentation on Github pages
    runs-on: ubuntu-latest
    needs: generate
    if: github.event_name == 'push'  && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
    steps:
      - name: Download documentation bundle
        uses: actions/download-artifact@v4
      - name: Deploy documentation on pages
        uses: peaceiris/actions-gh-pages@v4
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: documentation/


================================================
FILE: .github/workflows/fast-checks.yml
================================================
name: Fast checks

on:
  workflow_dispatch:
  push:
    branches:
      - master
      - develop
  pull_request:
# Cancel previous runs on this reference
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  linter-python:
    name: Linter on Python code
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Python dependency
      run: pip install flake8 flake8-pyproject
    - name: Lint Python code
      run: flake8 speculos* setup.py

  linter-c:
    name: Linter on C code
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Lint C code
      uses: DoozyX/clang-format-lint-action@v0.16.1
      with:
        source: 'src tests'
        extensions: 'c,h'
        clangFormatVersion: 11

  mypy:
    name: Type checking
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
    - run: pip install mypy types-requests types-setuptools PyQt5-stubs
    - name: Mypy type checking
      run: mypy speculos

  bandit:
    name: Security checking
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
    - run: pip install bandit
    - name: Bandit security checking
      run: bandit -r speculos -ll || echo 0

  misspell:
    name: Check misspellings
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
      with:
        fetch-depth: 0
    - name: Check misspellings
      uses: codespell-project/actions-codespell@v1
      with:
        builtin: clear,rare
        check_filenames: true
        ignore_words_file: .codespell-ignore
        skip: ./speculos/api/static/swagger/swagger-ui.css,./speculos/api/static/swagger/swagger-ui-bundle.js,./speculos/api/static/swagger/swagger-ui-standalone-preset.js,./speculos/fonts


================================================
FILE: .github/workflows/force-rebase.yml
================================================
name: Force rebased

on: [pull_request]

jobs:
  force-rebase:
    runs-on: ubuntu-latest
    steps:

      - name: 'PR commits + 1'
        id: pr_commits
        run: echo "pr_fetch_depth=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_OUTPUT}"

      - name: 'Checkout PR branch and all PR commits'
        uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: ${{ steps.pr_commits.outputs.pr_fetch_depth }}

      - name: Check if PR branch is rebased on target branch
        shell: bash
        run: |
          git merge-base --is-ancestor ${{ github.event.pull_request.base.sha }} HEAD

      - name: Check if PR branch contains merge commits
        shell: bash
        run: |
          merges=$(git log --oneline HEAD~${{ github.event.pull_request.commits }}...HEAD --merges ); \
          echo "--- Merges ---"; \
          echo ${merges}; \
          [[ -z "${merges}" ]]


================================================
FILE: .github/workflows/reusable_ragger_tests_latest_speculos.yml
================================================
name: Functional tests using Ragger and latest speculos

on:
  workflow_call:
    inputs:
      app_repository:
        required: false
        default: ${{ github.repository }}
        type: string
      app_branch_name:
        required: false
        default: ${{ github.ref }}
        type: string

jobs:
  build_application:
    name: Build application using the reusable workflow
    uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
    with:
      app_repository: ${{ inputs.app_repository }}
      app_branch_name: ${{ inputs.app_branch_name }}
      upload_app_binaries_artifact: compiled_app_binaries-${{ inputs.app_branch_name }}
      builder: ledger-app-builder

  build_docker_image:
    name: Build Speculos Docker image
    runs-on: ubuntu-latest
    steps:
    - name: Clone
      uses: actions/checkout@v4
      with:
          submodules: recursive
          fetch-depth: 0

    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3

    - name: Build the Speculos docker
      uses: docker/build-push-action@v6
      with:
        push: false
        tags: ledgerhq/speculos:test
        context: .
        file: ./Dockerfiles/Dockerfile
        outputs: type=docker,dest=/tmp/speculos_image.tar

    - name: Upload artifact
      uses: actions/upload-artifact@v4
      with:
        name: speculos_image-${{ inputs.app_branch_name }}
        path: /tmp/speculos_image.tar

  call_get_app_metadata:
    name: Retrieve application metadata
    uses: LedgerHQ/ledger-app-workflows/.github/workflows/_get_app_metadata.yml@v1
    with:
      app_repository: ${{ inputs.app_repository }}
      app_branch_name: ${{ inputs.app_branch_name }}

  ragger_tests:
    name: Functional tests with Ragger
    runs-on: ubuntu-latest
    needs: [build_docker_image, build_application, call_get_app_metadata]
    strategy:
      fail-fast: false
      matrix:
        device: ${{ fromJSON(needs.call_get_app_metadata.outputs.compatible_devices) }}

    steps:
    - name: Clone
      uses: actions/checkout@v4
      with:
          repository: ${{ inputs.app_repository }}
          ref: ${{ inputs.app_branch_name }}
          path: app
          submodules: recursive
          fetch-depth: 0

    - name: Prepare test conditions
      shell: bash
      run: |
        pip install ledgered

        # Get Test directory from manifest
        TEST_DIR=$(ledger-manifest -otp "./app/ledger_app.toml")
        if [ -z "${TEST_DIR}" ]; then
          echo "No test directory found" && exit 1
        fi
        echo "TEST_DIR=${TEST_DIR}" >> $GITHUB_ENV

        # Get SDK from manifest
        SDK=$(ledger-manifest -os "./app/ledger_app.toml")
        if [ -z "${SDK}" ]; then
          echo "No sdk defined" && exit 1
        fi
        echo "SDK=${SDK,,}" >> $GITHUB_ENV

    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v2

    - name: Download artifact
      uses: actions/download-artifact@v4
      with:
        name: speculos_image-${{ inputs.app_branch_name }}
        path: /tmp

    - name: Load image
      run: |
        docker load --input /tmp/speculos_image.tar
        docker image ls -a

    - name: Download app binaries
      uses: actions/download-artifact@v4
      with:
        name: compiled_app_binaries-${{ inputs.app_branch_name }}
        path: ${{ github.workspace }}/app/${{ env.SDK == 'c' && 'build' || 'target' }}

    - name: Run and test Speculos docker for C apps
      if: ${{ env.SDK == 'c' }}
      run: |
          docker run --rm \
          --entrypoint /bin/bash \
          -v "${{ github.workspace }}/app:/app" \
          ledgerhq/speculos:test \
          -c "apt-get update && apt-get install -y gcc && \
              pip install -r /app/${{ env.TEST_DIR }}/requirements.txt && \
              pytest /app/${{ env.TEST_DIR }}/ --tb=short -v --device ${{ matrix.device }}"

    - name: Run and test Speculos docker for Rust apps
      if: ${{ env.SDK == 'rust' }}
      run: |
          docker run --rm \
          --entrypoint /bin/bash \
          -v "${{ github.workspace }}/app:/app" \
          ledgerhq/speculos:test \
          -c "
            apt-get update && \
            apt-get install -y gcc cargo && \
            pip install -r /app/${{ env.TEST_DIR }}/requirements.txt && \
            pytest /app/${{ env.TEST_DIR }}/ --tb=short -v --device ${{ matrix.device }} -k 'not test_version'
          "


================================================
FILE: .gitignore
================================================
*.a
*.o
.cache/
.idea/
.eggs/
__pycache__/
apps/*vault*
build/
core
TAGS
/speculos/resources/launcher
/speculos/resources/vnc_server

__version__.py

# python
*.pyc
dist/
*egg-info
.coverage


================================================
FILE: .pre-commit-config.yaml
================================================
# To install hooks, run:
# pre-commit install --hook-type pre-commit
# pre-commit install --hook-type commit-msg

---
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.3.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files

  - repo: https://github.com/psf/black
    rev: 22.10.0
    hooks:
      - id: black

  - repo: https://github.com/PyCQA/flake8
    rev: 5.0.4
    hooks:
      - id: flake8

  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v1.13.0
    hooks:
      - id: mypy
        additional_dependencies:
          - types-protobuf>=5.28,<6
          - types-requests
          - types-tabulate
          - types-toml

  - repo: https://github.com/PyCQA/bandit
    rev: 1.8.6
    hooks:
      - id: bandit
        args:
          - -c
          - pyproject.toml
        additional_dependencies:
          - bandit[toml]

  - repo: https://github.com/PyCQA/isort
    rev: 5.12.0
    hooks:
      - id: isort

  - repo: https://github.com/rhysd/actionlint
    rev: v1.6.27
    hooks:
      - id: actionlint
        types_or: [yaml]
        args: ["-config-file", ".github/actionlint.yaml", "-shellcheck","''", "-pyflakes", "''"]


================================================
FILE: .vscode/settings.json
================================================
{
    "files.associations": {
        "bolos_syscalls_blue_2.2.5.h": "c",
        "verynice.h": "c",
        "utils.h": "c",
        "bolos_syscalls.h": "c",
        "exception.h": "c",
        "numbers": "c",
        "sdk.h": "c",
        "stdbool.h": "c",
        "emulate.h": "c",
        "os.h": "c",
        "os_types.h": "c",
        "errors.h": "c",
        "launcher.h": "c"
    }
}

================================================
FILE: CHANGELOG.md
================================================
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.26.8] 2026-05-11

### Changed

- Include coordinates when reporting a TextEvent

## [0.26.7] 2026-05-06

### Changed

- Introduce NBGL text line SEPH messages, to fix OCR issues with API_LEVEL_26

## [0.26.6] 2026-04-23

### Changed

- Add Montgomery curves support to sys_cx_ecpoint_is_on_curve

## [0.26.5] 2026-04-22

### Changed

- Introduce NBGL serialized events, to fix OCR issues with API_LEVEL_26

## [0.26.4] 2026-04-16

### Changed

- Restore `os_registry_get_current_app_tag` syscall

## [0.26.3] 2026-04-09

### Added
- Add the support of ZIP32 Sapling, Orchard and Register derivations
- Add the support of BIP32-like derivation with BLS12-377 curve

## [0.26.2] 2026-03-26

### Changed
- Rework and fix CI

## [0.26.1] 2026-03-25

### Fix
- Fix packaging issue: remove usage of distutils

## [0.26.0] 2026-03-25

### Added
- Add the support of the curves `Pallas`, `Vesta` and `Jubjub`
- Support API_LEVEL_26
- Support new ENDORSEMENT syscalls
- Support `os_stack_operations` syscall, to be able to get Syscall Stack usage
- Log finger touch events to file for external consumers (when `SPECULOS_FINGER_LOG` is set)

### Changed
- Remove support of python 3.9

## [0.25.13] 2025-12-09

### Fix
- Fix not working '-p' option (Use production public key for PKI)

## [0.25.12] 2025-12-08

### Fix
- Fix VNC issue

## [0.25.11] 2025-12-05

### Fix
- Fix wrong derivation path when using libs (only use main app one)

## [0.25.10] 2025-12-04

### Added
- Support throwing exceptions from OS (mainly Cx syscalls) like on real devices
- Support retrieving appflags from elf and use it for derivation
- Support retrieving derivation_path from elf and use it for derivation

## [0.25.9] 2025-11-19

### Added
- support for os_perso_get_master_key_identifier syscall
- support for BLS12-377 and Edwards BLS12-377 curves

## [0.25.8] 2025-10-13

### Changed

- Updated shared libraries for API level 25

## [0.25.7] 2025-10-01

### Changed

- Remove support of old devices: Nano S & Blue
- Remove support of old SDK versions (lower than API Level 22)

- Last tag supporting Nano S & Blue is `NanoS_Blue_baseline`

## [0.25.6] 2025-09-25

### Added

- Add support of API level 25 on all products

### Fix

- Fix crash in Apps on API levels 24 & 25 on Nano X & S+ when using \b in strings

## [0.25.5] 2025-09-12

### Fix

- Limit useless logs
- Remove timestamp from debug logs
- Missing Apex_p keyboard navigation coordinates

## [0.25.4] 2025-09-04

### Fix

- Update shared.elf library for Apex to fix issue with "More" button in long tag/value case
- Force full screen refresh on Nano
- "Fix" a race condition between ragger and speculos

## [0.25.3] 2025-08-11

### Fix

- Add missing definitions for LedgerPKI (including Apex devices)

## [0.25.2] 2025-07-28

### Changed

- Update of fonts for Apex API_LEVEL_25

### Fix

- Avoid defining strlcpy starting from glibc 2.38

## [0.25.1] 2025-07-21

### Fix

- Fix missing check of API level 25 when loading fonts

## [0.25.0] 2025-07-16

### Added

- Add support of API level 25 (Apex)

## [0.24.0] 2025-07-10

### Added

- Automatically try to find an available apdu port
- Stax/Flex navigation with keyboard:
  - Arrow Left / Right keys: Previous / Next actions in bottom right corner
  - Return: Approve button in center
  - Escape: Cancel button (review) in bottom left corner
  - Backspace: Back button in top left corner
  - M: Menu (Setting/Info) in top right corner

### Fix

- Deploy workflow: regex to correctly set the `PUSH_FLAG`

## [0.23.0] 2025-07-02

### Added

- Add support of API level 24 (IO Revamp)
- Add Curve `cv25519` support

### Fix

- Support Rust apps on Nano devices with BAGL

### Changed

- Update Shared lib ELF files for API_LEVEL 23

## [0.22.0] 2025-06-02

### Fix

- Fix nb_fonts check and make OCR working again
- Fix issue with LNX/LNSP Apps using BAGL with API_LEVEL 23
- Fix crash in nano shared lib files

### Changed

- Modular exponentiation with exponent 0 is allowed in BOLOS
- Only load pygame with --sound & suppress pygame message

## [0.21.2] 2025-04-28

### Fix

- Incorrect syscall address for API level < 23

## [0.21.1] 2025-04-25

### Fix

- Incorrect font size/address computed when starting Speculos with libraries

## [0.21.0] 2025-04-23

### Added

- Add `key1_sign_without_code_hash` endorsement syscall.

## [0.20.0] 2025-04-23

### Added

- Add support of API level 23 (Cx -> Shared)
- Implement new endorsement syscalls"
- Implement NBGL adaptations to avoid drawing outside of area/screen
- Add option `-S/--sound` allowing to play the Tunes (including the wav files)

## [0.19.0] 2025-03-31

### Changed

- Ported the code to PyQt6

## [0.18.0] 2025-03-14

### Added

- Do not rely on C_bagl_fonts to check whether an app is BAGL or NBGL

## [0.17.0] 2025-03-14

### Added

- `--save-nvram` and `--load-nvram` parameters that allow NVRAM testing
- destination boundaries verification for `nvm_write()`
- Make BAGL-based applications able to call NBGL-based libraries, or NBGL-based applications able to call BAGL-based libraries

## [0.16.0] 2025-03-05

### Changed

- Allow CORS in order to be used directly from external website (ie: [DMK Playground](https://app.devicesdk.ledger.com/))

### Fixed

- Fixed `prod-pki` option in helper usage in the good group
- Fixed `logger.warn` deprecated API

### Added

- Add `-v/--verbose` to increase verbosity. Default behavior now is to limit _werkzeug_ logs and remove timestamp from logs

## [0.15.0] 2025-02-24

### Added

- Added support for Python versions 3.12 and 3.13

### Fixed

- Fixed prod-pki option

## [0.14.0] 2025-02-06

### Changed

- Increase number of sideloaded applications to 64

## [0.13.1] 2025-01-28

### Fixed

- Re-enable the support for Python 3.9

## [0.13.0] 2025-01-27

### Added

- Add arm64 host builder
- Enable the use of test key or prod key for PKI

### Changed

- Remove support for Python versions 3.8 and 3.9
- LedgerPKI: Allow any `key ID` and `key usage` values

## [0.12.0] 2024-11-25

### Added

- NFC communication available
- Starting Speculos with the `--transport` argument allows to choose U2F, HID or NFC transport
- Flex and Stax OSes emulation always consider NFC to be up (it can't be deactivated for now)

### Changed

- Update Python dependencies (certifi, urllib3, werkzeug, zipp, requests)

## [0.11.0] 2024-11-12

### Added

- Ledger PKI support (S+/X+Stax/Flex)
- API_LEVEL_22 support (S+/X+Stax/Flex)

## [0.10.0] 2024-10-03

### Added

- Enable support for secp521r1

## [0.9.7] 2024-07-31

### Fixed

- CRC computation for API levels >= 18

## [0.9.6] 2024-07-12

### Fixed

- Fix wrong display of some image files when BPP is not properly set in area

## [0.9.5] 2024-07-03

### Added

- cxlib and fonts for Flex on API_LEVEL_21

## [0.9.4] 2024-06-27

### Added

- Add support of API_LEVEL_21 for Stax and Flex

### Fixed

- Fix size of allocated buffer when redrawing VNC framebuffer

## [0.9.3] 2024-06-20

### Fixed

- Remove the vertical alignment assertion on multiples of 4 on Stax
- Fixed the actions versions for `upload-artifact` and `download-artifact` in v4

## [0.9.2] 2024-06-19

### Added

- Add support of API_LEVEL_20 for Stax and Flex

## [0.9.1] 2024-05-14

### Fixed

- `importlib.resources` does not exists on Python 3.8

## [0.9.0] - 2024-05-06

### Added

- Finger swipe capabilities (this feature is currently only available on Flex, using the capability
  will have no effect on other devices)
- Add support of API_LEVEL_19 for Flex

### Fixed

- Replacing deprecated `pkg_resources` usages with `importlib.resources` equivalents

## [0.8.6] - 2024-04-11

### Fixed

- Fix race condition on screenshot generation
- Fix ticker pause not waiting for end of tick processing

## [0.8.5] - 2024-04-11

### Fixed

- Fix race condition on screenshot generation

## [0.8.4] - 2024-04-10

### Fixed

- Removing PyQt5 from Speculos Docker images as it is unused and triggers error on MAC.
- Fix OCR screen content reset mechanism.
- Fix library mode fonts not unloaded at os_lib_end.

## [0.8.3] - 2024-04-08

### Fixed

- Fix library mode fonts not loaded.

## [0.8.2] - 2024-04-05

### Fixed

- Fix NanoX and NanoSP handling when BAGL is used but fonts are not found in the elf.

## [0.8.1] - 2024-04-04

### Fixed

- Fixed logger initialization that lead to root log handler not being propagated to children

## [0.8.0] - 2024-04-03

### Added

- NBGL support for non-Stax devices
- Add Flex support
- Add support of API_LEVEL_18 for NanoX, NanoS+ and Flex

## [0.7.1] - 2024-02-26

### Fixed

- Specific `cache` mechanism for Python3.8 (`functools.cache` does not exists yet)

## [0.7.0] - 2024-02-26

### Changed

- Significative performance improvement on display/snapshot management
- Simplified HTTP API thread management

## [0.6.0] - 2024-02-21

### Added

- Add support for API_LEVEL_15 for Stax

## [0.5.1] - 2024-02-15

### Added

- Add possibility to set up a timeout for APDU exchange with default value to 5min

## [0.5.0] - 2024-01-11

### Added

- Attestation key or user private keys can now be configured with the new `--attestation-key`
  and `--user-private-key` arguments (or `ATTESTATION_PRIVATE_KEY` and `USER_PRIVATE_KEY` through
  environment variables). User certificates are correctly calculated, signed from the user private
  keys and the attestation key.

### Changed

- Seed, RNG, application name and version are now fetched from the environment when Speculos starts
  then stored internally for further use, rather than fetched when needed during runtime. This
  avoids several Speculos instances from messing up with each other's environment variables.

## [0.4.1] - 2023-12-19

### Fixed

- CX: Fix AES implementation on NanoS

## [0.4.0] - 2023-12-04

### Fixed

- bolos/os_bip32.c: Improve syscall emulation

### Added

- API_LEVEL: Add support for API_LEVEL_14 for Ledger Stax

## [0.3.5] - 2023-11-10

### Fixed

- CX: Update AES implementation to be compatible with API levels >= 12

## [0.3.4] - 2023-11-07

### Features

- Implement cx_bn_gf2_n_mul()

### Miscellaneous Tasks

- Add missing `binutils-arm-none-eabi` package

### README

- Update Limitations section

## [0.3.3] - 2023-10-26

### Fixed

- Launcher: Fix missing RAM relocation emulation on NanoX, NanoSP and Stax

## [0.3.2] - 2023-09-28

### Fixed

- API: the API thread is asked to stop when Speculos exits

## [0.3.1] - 2023-09-28

### Fixed

- OCR: Prevent null dereference when expected font is not in ELF file

## [0.3.0] - 2023-09-11

### Added

- API_LEVEL: Add support for API_LEVEL_13 for corresponding device

## [0.2.10] - 2023-09-01

### Changed

- OCR: Apps using unified SDK don't use OCR anymore. Font info is parsed from .elf file.

## [0.2.9] - 2023-08-31

### Fixed

- Seproxyhal: default status_sent value upon app launch is unset.

## [0.2.8] - 2023-07-31

### Changed

- OCR: Change Stax OCR method. Don't use Tesseract anymore.
- CI: Remove CI job dependency to allow deployment if wanted

### Added

- API_LEVEL: Add support for API_LEVEL_12 for corresponding device

## [0.2.7] - 2023-06-30

### Fixed

- Seproxyhal: Fix SeProxyHal emulation

## [0.2.6] - 2023-06-26

### Fixed

- Seproxyhal: Fix SeProxyHal issue when on LNSP / LNX and HAVE_PRINTF is enabled

## [0.2.5] - 2023-06-21

### Added

- API: Add a ticker/ endpoint to allow control of the ticks sent to the app

### Fixed

- OCR: Fix OCR on NanoX and NanoSP based on API_LEVEL_5 and upper
- Seproxyhal: Fix SeProxyHal emulation to match real devices behavior

## [0.2.4] - 2023-06-13

### Changed

- OCR: Lazy evaluation of screenshot content, performance improvement on Stax

### Fixed

- OCR: screenshot publish is no longer desynchronized with event publish

## [0.2.3] - 2023-06-05

### Fixed

- svc: Fixed emulation of os_lib_call for latest SDK API levels

## [0.2.2] - 2023-06-01

### Changed

- docker: Add blst library to the docker image
- launcher: If Speculos is able to determine the location of the SVC_Call and SVC_cx_call symbols in
  the application elf, it will only try to patch `svc 1` inside the functions.

## [0.2.1] - 2023-05-30

### Fixed

- deployment: re-ordering pypi.org package automatic push in order to avoid incomplete deployments

## [0.2.0] - 2023-05-30

### Changed

- package: Version is not longer customly incremented, but inferred from tag then bundled into the
  package thanks to `setuptools_scm`

## [0.1.265] - 2023-05-12

## [0.1.0] - 2021-07-21

- First release of Speculos on PyPi


================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.10)

project(Speculos C)

include(CTest)
include(ExternalProject)

if (CMAKE_TOOLCHAIN_FILE)
  message(STATUS "Using toolchain ${CMAKE_TOOLCHAIN_FILE}")
else ()
  # By default, use gcc cross-compiler for ARM-Thumb
  set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
  add_compile_options(-mthumb)
  message(STATUS "Using default compiler ${CMAKE_C_COMPILER}")
endif ()

# add_link_options(-static) should be used but was introduced into CMake version 3.13
set(CMAKE_EXE_LINKER_FLAGS -static)

enable_testing()

option(WITH_VNC "Support for VNC" OFF)

# Set GIT_REVISION to the last commit hash.
# Please note that the variable is set at configuration time and might be
# outdated.
find_package(Git)
execute_process(
    COMMAND ${GIT_EXECUTABLE} describe --always HEAD
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
    OUTPUT_VARIABLE GIT_REVISION
    OUTPUT_STRIP_TRAILING_WHITESPACE)

add_compile_options(-W -Wall -fPIC)
add_definitions(-DOS_LITTLE_ENDIAN -DNATIVE_64BITS -DGIT_REVISION=\"${GIT_REVISION}\")

option(
  CODE_COVERAGE
  "Builds targets with code coverage instrumentation. (Requires GCC or Clang)"
  OFF
)
if (CODE_COVERAGE)
  # Always disable optimisations and build with debug symbols, when building for code coverage
  add_compile_options(-O0 -g)
  add_link_options(-g)
  if (CMAKE_C_COMPILER_ID MATCHES "(Apple)?[Cc]lang")
    # Options for clang
    message(STATUS "Building with clang code coverage...")
    add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
    add_link_options(-fprofile-instr-generate -fcoverage-mapping)
  elseif(CMAKE_C_COMPILER_ID MATCHES "GNU")
    # Options for gcc
    message(STATUS "Building with gcc code coverage...")
    add_compile_options(--coverage -fprofile-arcs -ftest-coverage)
    add_link_options(--coverage -fprofile-arcs -ftest-coverage)
  else()
    message(FATAL_ERROR "Unable to identify the compiler! Aborting...")
  endif()
endif()

include_directories(sdk src)

if (PRECOMPILED_DEPENDENCIES_DIR)
  message(STATUS "Using OpenSSL and cmocka from ${PRECOMPILED_DEPENDENCIES_DIR}")
  set(INSTALL_DIR ${PRECOMPILED_DEPENDENCIES_DIR})
  add_library(openssl STATIC IMPORTED)
else()
  message(STATUS "Building OpenSSL and cmocka...")
  set(INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/install)

  set(OPENSSL_CFLAGS "${CMAKE_C_FLAGS}")
  get_directory_property(compile_options COMPILE_OPTIONS)
  foreach (opt ${compile_options})
    string(APPEND OPENSSL_CFLAGS " ${opt}")
  endforeach ()
  if (CMAKE_C_COMPILER_TARGET)
    string(APPEND OPENSSL_CFLAGS " --target=${CMAKE_C_COMPILER_TARGET}")
  endif ()
  if (CMAKE_SYSROOT)
    string(APPEND OPENSSL_CFLAGS " -isystem${CMAKE_SYSROOT}/include")
  endif ()
  string(APPEND OPENSSL_CFLAGS " -Wno-unused-parameter -Wno-missing-field-initializers")

  ExternalProject_Add(
    openssl
    URL https://www.openssl.org/source/openssl-1.1.1k.tar.gz
    URL_HASH SHA256=892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
    CONFIGURE_COMMAND ./Configure "CC=${CMAKE_C_COMPILER}" "CFLAGS=${OPENSSL_CFLAGS}" no-afalgeng no-aria no-asan no-asm no-async no-autoalginit no-autoerrinit no-autoload-config no-bf no-buildtest-c++ no-camellia no-capieng no-cast no-chacha no-cmac no-cms no-comp no-crypto-mdebug no-crypto-mdebug-backtrace no-ct no-deprecated no-des no-devcryptoeng no-dgram no-dh no-dsa no-dso no-dtls no-ecdh no-egd no-engine no-err no-external-tests no-filenames no-fuzz-afl no-fuzz-libfuzzer no-gost no-heartbeats no-hw no-idea no-makedepend no-md2 no-md4 no-mdc2 no-msan no-multiblock no-nextprotoneg no-ocb no-ocsp no-pinshared no-poly1305 no-posix-io no-psk no-rc2 no-rc4 no-rc5 no-rdrand no-rfc3779 no-scrypt no-sctp no-seed no-shared no-siphash no-sm2 no-sm3 no-sm4 no-sock no-srp no-srtp no-sse2 no-ssl no-ssl3-method no-ssl-trace no-stdio no-tests no-threads no-tls no-ts no-ubsan no-ui-console no-unit-test no-whirlpool no-zlib no-zlib-dynamic linux-armv4 --prefix=${INSTALL_DIR}
    BUILD_COMMAND make
    INSTALL_COMMAND make install_sw
    BUILD_IN_SOURCE 1
  )

  ExternalProject_Add(
    blst
    URL https://github.com/supranational/blst/archive/d0bc304a132df43856d8302e15dabee97d3d8a95.tar.gz
    URL_HASH SHA256=70127766f8031cde3df4224d88f7b33dec6c33fc7ac6b8e4308d4f7d0bdffd7b
    CONFIGURE_COMMAND ""
    BUILD_COMMAND sh build.sh CC=arm-linux-gnueabihf-gcc
    INSTALL_COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/blst-prefix/src/blst/libblst.a ${INSTALL_DIR}/lib/
    COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/blst-prefix/src/blst/bindings/blst.h ${INSTALL_DIR}/include/
    COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/blst-prefix/src/blst/bindings/blst_aux.h ${INSTALL_DIR}/include/
    BUILD_IN_SOURCE 1
  )

  if (BUILD_TESTING)
    set(CMOCKA_CMAKE_ARGS
      -DWITH_STATIC_LIB=true
      "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
      "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
      "-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}"
    )
    if (CMAKE_TOOLCHAIN_FILE)
      get_filename_component(abs_cmake_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE)
      list(APPEND CMOCKA_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${abs_cmake_toolchain_file}")
    endif ()
    ExternalProject_Add(cmocka
      PREFIX ${CMAKE_CURRENT_BINARY_DIR}/cmocka
      URL https://cmocka.org/files/1.1/cmocka-1.1.5.tar.xz
      URL_HASH SHA256=f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6
      CMAKE_ARGS ${CMOCKA_CMAKE_ARGS}
    )
  endif()
endif()

if (BUILD_TESTING)
  add_library(cmocka-static STATIC SHARED IMPORTED)
  add_dependencies(cmocka-static cmocka)
endif()

include_directories(${INSTALL_DIR}/include)
link_directories(${INSTALL_DIR}/lib)

link_libraries(ssl crypto dl blst)

add_subdirectory(src)

if (BUILD_TESTING)
  add_subdirectory(tests/c/)
endif()

add_custom_target(
  copy-launcher ALL
  COMMAND ${CMAKE_COMMAND} -E copy_if_different
    ${CMAKE_CURRENT_BINARY_DIR}/src/launcher
    ${CMAKE_CURRENT_SOURCE_DIR}/speculos/resources/launcher
  DEPENDS src/launcher
  COMMENT Copy the launcher in the Python part of Speculos
  VERBATIM)

if (WITH_VNC)
  externalproject_add(vnc_server
    SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/vnc"
    BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/vnc"
    INSTALL_COMMAND ""
  )

  add_custom_target(
    copy-vnc-server ALL
    COMMAND ${CMAKE_COMMAND} -E copy_if_different
      ${CMAKE_CURRENT_BINARY_DIR}/vnc/vnc_server
      ${CMAKE_CURRENT_SOURCE_DIR}/speculos/resources/vnc_server
    DEPENDS vnc_server
    COMMENT Copy the launcher in the Python part of Speculos
    VERBATIM)
endif()


================================================
FILE: COPYING
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

================================================
FILE: COPYING.LESSER
================================================
                   GNU LESSER GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.


  This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

  0. Additional Definitions.

  As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

  "The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

  An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

  A "Combined Work" is a work produced by combining or linking an
Application with the Library.  The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

  The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

  The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

  1. Exception to Section 3 of the GNU GPL.

  You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

  2. Conveying Modified Versions.

  If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

   a) under this License, provided that you make a good faith effort to
   ensure that, in the event an Application does not supply the
   function or data, the facility still operates, and performs
   whatever part of its purpose remains meaningful, or

   b) under the GNU GPL, with none of the additional permissions of
   this License applicable to that copy.

  3. Object Code Incorporating Material from Library Header Files.

  The object code form of an Application may incorporate material from
a header file that is part of the Library.  You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

   a) Give prominent notice with each copy of the object code that the
   Library is used in it and that the Library and its use are
   covered by this License.

   b) Accompany the object code with a copy of the GNU GPL and this license
   document.

  4. Combined Works.

  You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

   a) Give prominent notice with each copy of the Combined Work that
   the Library is used in it and that the Library and its use are
   covered by this License.

   b) Accompany the Combined Work with a copy of the GNU GPL and this license
   document.

   c) For a Combined Work that displays copyright notices during
   execution, include the copyright notice for the Library among
   these notices, as well as a reference directing the user to the
   copies of the GNU GPL and this license document.

   d) Do one of the following:

       0) Convey the Minimal Corresponding Source under the terms of this
       License, and the Corresponding Application Code in a form
       suitable for, and under terms that permit, the user to
       recombine or relink the Application with a modified version of
       the Linked Version to produce a modified Combined Work, in the
       manner specified by section 6 of the GNU GPL for conveying
       Corresponding Source.

       1) Use a suitable shared library mechanism for linking with the
       Library.  A suitable mechanism is one that (a) uses at run time
       a copy of the Library already present on the user's computer
       system, and (b) will operate properly with a modified version
       of the Library that is interface-compatible with the Linked
       Version.

   e) Provide Installation Information, but only if you would otherwise
   be required to provide such information under section 6 of the
   GNU GPL, and only to the extent that such information is
   necessary to install and execute a modified version of the
   Combined Work produced by recombining or relinking the
   Application with a modified version of the Linked Version. (If
   you use option 4d0, the Installation Information must accompany
   the Minimal Corresponding Source and Corresponding Application
   Code. If you use option 4d1, you must provide the Installation
   Information in the manner specified by section 6 of the GNU GPL
   for conveying Corresponding Source.)

  5. Combined Libraries.

  You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

   a) Accompany the combined library with a copy of the same work based
   on the Library, uncombined with any other library facilities,
   conveyed under the terms of this License.

   b) Give prominent notice with the combined library that part of it
   is a work based on the Library, and explaining where to find the
   accompanying uncombined form of the same work.

  6. Revised Versions of the GNU Lesser General Public License.

  The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

  Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

  If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

================================================
FILE: Dockerfiles/Dockerfile
================================================
# This Dockerfile assembles an image with all the dependencies required to run
# speculos from the command-line (--display headless or --display console, no
# GUI).
#

# Building the Speculos environment
ARG BUILDER_IMAGE=ghcr.io/ledgerhq/speculos-builder:latest
FROM ${BUILDER_IMAGE} AS builder

ADD . /speculos
WORKDIR /speculos/

RUN cmake -Bbuild -H. -DPRECOMPILED_DEPENDENCIES_DIR=/install -DWITH_VNC=1
RUN make -C build


# Preparing final image
FROM docker.io/library/python:3.10-slim

ADD . /speculos
WORKDIR /speculos

# Copying artifacts from previous build
COPY --from=builder /speculos/speculos/resources/ /speculos/speculos/resources/

RUN pip install --upgrade pip pipenv
RUN pipenv install --deploy --system


RUN apt-get update && apt-get install -qy \
    qemu-user-static \
    libvncserver-dev \
    gdb-multiarch \
    binutils-arm-none-eabi \
    && apt-get clean

RUN apt-get clean && rm -rf /var/lib/apt/lists/

# default port for dev env
EXPOSE 1234
EXPOSE 1236
EXPOSE 9999
EXPOSE 40000
EXPOSE 41000
EXPOSE 42000

ENTRYPOINT [ "python", "./speculos.py" ]


================================================
FILE: Dockerfiles/build.Dockerfile
================================================
# Dockerfile to have a container with everything ready to build speculos,
# assuming that neither OpenSSL nor cmocka were updated.
#
# Support Debian buster & Ubuntu Bionic

FROM docker.io/library/python:3.10-slim
ENV LANG=C.UTF-8

RUN export DEBIAN_FRONTEND=noninteractive && \
  apt-get update && \
  apt-get install -qy \
    cmake \
    curl \
    gcc-arm-linux-gnueabihf \
    git \
    libc6-dev-armhf-cross \
    libvncserver-dev \
    python3-pip \
    qemu-user-static \
    wget && \
  apt-get clean && \
  rm -rf /var/lib/apt/lists/

# There are issues with PYTHONHOME if using distro packages, use pip instead.
RUN pip3 install construct flake8 flask flask_restful jsonschema mnemonic pycrypto pyelftools pbkdf2 pytest Pillow requests

# Create SHA256SUMS, download dependencies and verify their integrity
RUN \
  echo 892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5 openssl-1.1.1k.tar.gz >> SHA256SUMS && \
  echo f0ccd8242d55e2fd74b16ba518359151f6f8383ff8aef4976e48393f77bba8b6 cmocka-1.1.5.tar.xz >> SHA256SUMS && \
  echo 70127766f8031cde3df4224d88f7b33dec6c33fc7ac6b8e4308d4f7d0bdffd7b d0bc304a132df43856d8302e15dabee97d3d8a95.tar.gz && \
  wget --quiet https://www.openssl.org/source/openssl-1.1.1k.tar.gz && \
  wget --quiet https://cmocka.org/files/1.1/cmocka-1.1.5.tar.xz && \
  wget --quiet https://github.com/supranational/blst/archive/d0bc304a132df43856d8302e15dabee97d3d8a95.tar.gz && \
  sha256sum --check SHA256SUMS && \
  rm SHA256SUMS

# Build dependencies and install them in /install
RUN mkdir install && \
  tar xf openssl-1.1.1k.tar.gz && \
  cd openssl-1.1.1k && \
  ./Configure --cross-compile-prefix=arm-linux-gnueabihf- no-asm no-threads no-shared no-sock linux-armv4 --prefix=/install && \
  make -j CFLAGS=-mthumb && \
  make install_sw && \
  cd .. && \
  rm -r openssl-1.1.1k/ openssl-1.1.1k.tar.gz

RUN mkdir cmocka && \
  tar xf cmocka-1.1.5.tar.xz && \
  cd cmocka && \
  cmake ../cmocka-1.1.5 -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_C_FLAGS=-mthumb -DWITH_STATIC_LIB=true -DCMAKE_INSTALL_PREFIX=/install && \
  make install && \
  cd .. && \
  rm -r cmocka/ cmocka-1.1.5/ cmocka-1.1.5.tar.xz

RUN tar xf d0bc304a132df43856d8302e15dabee97d3d8a95.tar.gz && \
  cd blst-d0bc304a132df43856d8302e15dabee97d3d8a95 && \
  sh build.sh CC=arm-linux-gnueabihf-gcc && \
  cp libblst.a ../install/lib/ && \
  cp bindings/blst.h ../install/include/ && \
  cp bindings/blst_aux.h ../install/include/ && \
  cd .. && \
  rm -r blst-d0bc304a132df43856d8302e15dabee97d3d8a95/ d0bc304a132df43856d8302e15dabee97d3d8a95.tar.gz

CMD ["/bin/bash"]


================================================
FILE: MANIFEST.in
================================================
include CMakeLists.txt
recursive-include sdk *.h
recursive-include src *.c *.h *.txt
include speculos/api/resources/*.schema
include speculos/api/static/index.html
include speculos/api/static/swagger/*.css
include speculos/api/static/swagger/*.html
include speculos/api/static/swagger/*.js
include speculos/api/static/swagger/*.json
include speculos/api/static/swagger/*.md
include speculos/cxlib/*.elf
include speculos/fonts/*.bin
include speculos/mcu/resources/*.schema
include speculos/resources/launcher
include speculos/resources/vnc_server
graft build
exclude speculos.py


================================================
FILE: Pipfile
================================================
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
construct = ">=2.10.56,<3.0.0"
flask = ">=2.0.0,<3.0.0"
flask-restful = ">=0.3.9,<1.0"
jsonschema = ">=3.2.0,<4.18.0"
mnemonic = ">=0.19,<1.0"
pillow = ">=8.0.0,<11.0.0"
pyelftools = ">=0.27,<1.0"
requests = ">=2.25.1,<3.0.0"
ledgered = ">=0.14.0"
flask-cors = "*"
pygame = "*"

[requires]
python_version = "3.10"


================================================
FILE: README.md
================================================
# Speculos

[![codecov](https://codecov.io/gh/LedgerHQ/speculos/branch/master/graph/badge.svg)](https://codecov.io/gh/LedgerHQ/speculos)

![screenshot btc nano s](https://raw.githubusercontent.com/LedgerHQ/speculos/master/docs/_static/screenshot-api-nanos-btc.png)

The goal of this project is to emulate Ledger Nano S+, Nano X, Apex+, Flex and Stax apps on
standard desktop computers, without any hardware device. More information can
be found here in the
[documentation website](https://ledgerhq.github.io/speculos) (or in the
[docs/ folder](docs/) directly).

Usage example:

```shell
./speculos.py apps/btc.elf --model nanosp
# ... and open a browser on http://127.0.0.1:5000
```

## Installation

### From Python `pypi` packages

The easiest, stable way to install Speculos is with `pip`:

```
pip install speculos
```

It is advised to use Python virtualenv, otherwise admin rights will probably be
necessary.


### From sources

Installing Speculos from sources is a bit heavier and, depending on the platform,
complex, due to all the dependency needed for compiling the emulator.

On Debian (10 or later) or Ubuntu (18.04 or later):

```
sudo apt install \
    git cmake gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gdb-multiarch \
    python3-pyqt6 python3-construct python3-flask-restful python3-jsonschema \
    python3-mnemonic python3-pil python3-pyelftools python3-requests \
    qemu-user-static libvncserver-dev

# from the root directory of the source repository
pip install .
```

Dependency management will vary on other platforms; using Docker images and/or WSL
should facilitate the installation.

## Bugs and contributions

Feel free to open issues and create pull requests on this GitHub repository.

The `master` branch is protected to disable force pushing. Contributions should
be made through pull requests, which are reviewed by @LedgerHQ members before
being merged to `master`:

- @LedgerHQ members can create branches directly on the repository (if member of
  a team with write access to the repository)
- External contributors should fork the repository


## Limitations

There is absolutely no guarantee that apps will have the same behavior on
hardware devices and Speculos, though the differences are limited.

### Syscalls

The emulator handles only a few syscalls made by common apps. For instance,
syscalls related to app install, firmware update or OS info can't be
implemented.

### Memory alignment

Attempts to perform unaligned accesses when not allowed (eg. dereferencing a
misaligned pointer) will cause an alignment fault on a Ledger Nano S+ device but
not on Speculos. Note that such unaligned accesses are supported by other
Ledger devices.

Following code crashes on LNS device, but not on Speculos nor on other devices.
```
uint8_t buffer[20];
for (int i = 0; i < 20; i++) {
    buffer[i] = i;
}
uint32_t display_value = *((uint32_t*) (buffer + 1));
PRINTF("display_value: %d\n", display_value);
```

### Watchdog

NanoX, Flex, Apex+ and Stax devices use an internal watchdog enforcing usage of regular
calls to `io_seproxyhal_io_heartbeat();`. This watchdog is not emulated on
Speculos.


## Security

Apps can make arbitrary Linux system calls (and use QEMU
[semihosting](docs/user/semihosting.md) features), thus don't run Speculos on
untrusted apps.

It's worth noting that the syscall implementation (`src/`) doesn't expect
malicious input. By the way, in Speculos, there is no privilege separation
between the app and the syscalls. This doesn't reflect the security of the
firmware on hardware devices where app and OS isolation is enforced.

Speculos is not part of Ledger bug bounty program.


## Are you developing a Nano App as an external developer?

For a smooth and quick integration:
- Follow the developers documentation on the [Developer Portal](https://developers.ledger.com/docs/nano-app/introduction/) and
- [Go on Discord](https://developers.ledger.com/discord-pro/) to chat with developer support and the developer community.


================================================
FILE: apps/README.md
================================================
The files in these folder are consumed by the tests to ensure that speculos
works correctly across various devices and apps.

DO NOT use them to test apps or your integrations, as these  binaries are old
and unmantained. Rather, follow the instructions in the app's repository
in order to build the most recent version.

### Naming

Examples:

- `nanosp#btc#1.5#5b6693b8.elf`

If the examples aren't enough, here is the naming convention that should be
used:

```
device model # app name # SDK version # git revision .elf
```

where:

- `device model` is one of the following: `nanosp`, `stax`
- `git revision` is the short hash (8 bytes) of the last commit


================================================
FILE: clang-armv7m.cmake
================================================
# cmake-toolchain configuration to build with clang on Debian and Ubuntu
#
# Usage:
#
#   cmake -DCMAKE_TOOLCHAIN_FILE=clang-armv7m.cmake -Bbuild -H. && cmake --build build
#
# Documentation: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_C_COMPILER clang)
set(CMAKE_C_COMPILER_TARGET armv7m-linux-gnueabihf)

# Use files installed by libc6-dev-armhf-cross
# (This adds /usr/arm-linux-gnueabihf/include to CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES)
set(CMAKE_SYSROOT /usr/arm-linux-gnueabihf)

# Use LLVM linker to link ARM code, as using the system "ld" fails on Ubuntu with x86-64
add_link_options(-fuse-ld=lld)


================================================
FILE: docker-compose.yml
================================================
version: "3.7"

services:
  nanos:
    build: .
    image: ghcr.io/ledgerhq/speculos
    volumes:
      - ./apps:/speculos/apps
    ports:
      - "1234:1234" # gdb
      - "5000:5000" # api
      - "40000:40000" # apdu
      - "41000:41000" # vnc
    command: "--model nanos ./apps/btc.elf --sdk 2.0 --seed secret --display headless --apdu-port 40000 --vnc-port 41000"
    # Add `--vnc-password "<password>"` for macos users to use built-in vnc client.


================================================
FILE: docs/CNAME
================================================
speculos.ledger.com

================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS    ?=
SPHINXBUILD   ?= sphinx-build
SOURCEDIR     = .
BUILDDIR      = build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)


================================================
FILE: docs/conf.py
================================================
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Speculos'
copyright = '2024, Ledger'
author = 'Ledger'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['myst_parser', 'sphinxcontrib.rawfiles']

templates_path = ['_templates']
exclude_patterns = []

source_suffix = {
    '.rst': 'restructuredtext',
    '.txt': 'markdown',
    '.md': 'markdown',
}

rawfiles = ['CNAME']

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_static_path = ['_static']


================================================
FILE: docs/dev/ci.md
================================================
---
sort: 3
---

# Continuous Integration

## Speculos builder

The Dockerfile `build.Dockerfile` builds a container with all required
dependencies to build speculos:

```shell
docker build -f build.Dockerfile -t ghcr.io/ledgerhq/speculos-builder .
```

The resulting container is pushed on
[GitHub Packages](https://ghcr.io/ledgerhq/speculos-builder) by the CI and
can eventually be used by the CI itself.

The image can also be pushed manually with appropriate credentials:

```shell
docker push ghcr.io/ledgerhq/speculos-builder:latest
docker image tag ghcr.io/ledgerhq/speculos-builder:latest ghcr.io/ledgerhq/speculos-builder:$(git rev-parse --short HEAD)
docker push ghcr.io/ledgerhq/speculos-builder:$(git rev-parse --short HEAD)
```


## Speculos

The Dockerfile `Dockerfile` builds a container with all required dependencies to
run speculos from the command-line:

```shell
docker build -f Dockerfile -t ghcr.io/ledgerhq/speculos .
```

This should be done by the CI, which publish the resulting image on
[GitHub Packages](https://ghcr.io/ledgerhq/speculos).


================================================
FILE: docs/dev/getting_started.md
================================================
---
sort: 1
---

# Getting Started

## clang-format

clang-format is used by the CI to format C code according to a set of rules and
heuristics. The CI checks will fail if some code isn't formatted as expected by
the rules.

To ensure that the CI checks pass, please use the script `tools/clang-format.sh`
(the path to clang-format can be specified thanks to the `CLANG_FORMAT`
environment variable):

```shell
CLANG_FORMAT=clang-format-11 ./tools/clang-format.sh
```


================================================
FILE: docs/dev/index.rst
================================================
Developer documentation
=======================

.. toctree::
   :maxdepth: 1

   getting_started
   tests
   internals
   ci


================================================
FILE: docs/dev/internals.md
================================================
---
sort: 4
---

# Internals

The emulator is actually a userland application cross-compiled for the ARM
architecture. It opens the target app (`app.elf`) from the filesystem and maps
it as is in memory. The emulator is launched with `qemu-arm-static` and
eventually jumps to the app entrypoint.

Apps can be debugged with `gdb-multiarch` thanks to `qemu-arm-static`.


## Syscall hooks

The `svc` instruction is replaced with `udf` (undefined) to generate a `SIGILL`
signal upon execution. It allows to catch syscalls and emulate them. It can
unfortunately lead to unexpected bytes being patched if `\x01\xdf` is found in
the binary (and isn't the `svc` instruction).

A disassembler could give better results, but it doesn't look worth it. As a
side note, the `SVC_Call()` function can't be hooked because some syscalls are
inlined.


Other alternatives were considered (for instance `seccomp` or `ptrace`) but they
seem not practicable because QEMU don't support the
[associated syscalls](https://github.com/qemu/qemu/blob/1c4c6fcd1a2ae56e98be3a441e19a0933c508a51/linux-user/syscall.c#L7402).


================================================
FILE: docs/dev/tests.md
================================================
---
sort: 2
---

# Tests

## How to run tests

The application binaries launched by the tests should be placed in `apps/`.
Every type of app tested should have a dedicated test file that can be launched like this:

```shell
python3 -m pytest -s -v tests/apps/
```

Crypto syscalls are tested using the following command:

```shell
make -C build/ test
```

Arguments can be given to `ctest`. For instance, to make the output of a
specific test verbose:

```shell
make -C build/ test ARGS='-V -R test_bip32'
```

## Code coverage

In order to build with code coverage instrumentation, the CMake configuration supports `CODE_COVERAGE` macro:
```shell
cmake -B build/ -DCODE_COVERAGE=ON -S .
make -C build/ clean
make -C build/ all
```

When using gcc to build the project (which is by default), this enables instrumentation with gcov: these commands created `.gcno` files in `build/`.

[lcov](http://ltp.sourceforge.net/coverage/lcov.php) can be used to collect code coverage and generates a HTML report in `coverage/`:
```shell
lcov -d . --zerocounters
lcov -d . --capture --initial -o coverage.base
RNG_SEED=0 make -C build/ test
lcov -d . --rc lcov_branch_coverage=1 --capture -o coverage.capture
lcov -d . --add-tracefile coverage.base --add-tracefile coverage.capture -o coverage.total
genhtml coverage.total -o coverage
```


================================================
FILE: docs/index.rst
================================================
Speculos documentation
======================

`Source code <https://github.com/LedgerHQ/speculos>`_

.. toctree::
   :maxdepth: 1

   installation/index
   user/index
   dev/index


Users
-----

Installation and basic usage
++++++++++++++++++++++++++++

- Linux: :doc:`Requirements and build<installation/build>`
- Mac OS (and Linux) users: :doc:`How to use the Docker image<user/docker>` with VNC
- Mac M1 users: :doc:`How to build and use the Docker image<user/macm1>`
- Windows users: :doc:`Using speculos from WSL 2<installation/wsl>`
- :doc:`Usage<user/usage>`

Interaction with an app
+++++++++++++++++++++++

- :doc:`How to send APDUs to an app (and more)<user/clients>`
- :doc:`How to use gdb to debug an app<user/debug>`
- :doc:`How to automate actions thanks to the REST API<user/api>`

For advanced users
++++++++++++++++++

- :doc:`Automation: press buttons automatically<user/automation>`
- :doc:`Semihosting as an additional debug mechanism<user/semihosting>`

Speculos developers
-------------------

- :doc:`CI (Continuous Integration)<dev/ci>`
- :doc:`Internals<dev/internals>`
- :doc:`How to run tests<dev/tests>`


================================================
FILE: docs/installation/build.md
================================================
---
sort: 1
---

# Linux

## Requirements

For Debian (version 12 "Bookworm" or later) and Ubuntu (version 24.04 or later):

```shell
sudo apt install \
    git cmake gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gdb-multiarch \
    python3-pyqt6 python3-construct python3-flask-restful python3-jsonschema \
    python3-mnemonic python3-pil python3-pyelftools python3-requests \
    qemu-user-static libvncserver-dev
```

Please note that VNC support (the `libvncserver-dev` package), although necessary
for a Python installation, is optional when building only the launcher (see below).

## Build & install

Easiest way to build & install Speculos is with `pip`. It will not only compile
the launcher, but will also install the Python package wrapped around it, which
includes the high-level Speculos entrypoint, used (for instance) in the
[Ragger](https://ledgerhq.github.io/ragger/) framework.

Following command ought to be executed into a Python virtualenv, else admin
rights will be necessary.

```shell
pip install .
```

## Building the Speculos launcher only

### speculos

```shell
cmake -B build/ -S .
make -C build/
```

Please note that the first build can take some time because a tarball of OpenSSL
is downloaded (the integrity of the downloaded tarball is checked) before being
built. Further invocations of `make` skip this step.

The following command line can be used for a debug build:

```shell
cmake -B build/ -DCMAKE_BUILD_TYPE=Debug -S .
```

### VNC support (optional)

Pass the `WITH_VNC` option to CMake:

```shell
cmake -B build/ -DWITH_VNC=1 -S .
```


================================================
FILE: docs/installation/index.rst
================================================
Installation
============

.. toctree::
   :maxdepth: 1

   build
   wsl


================================================
FILE: docs/installation/wsl.md
================================================
---
sort: 2
---

# Windows (with WSL 2)

Building in WSL 2 (Windows Subsystem for Linux 2) is identical to the procedure in [building](build.md).

Using Speculos with display features requires correctly exporting the X display.

Rough steps to do so below, detailed procedure available on [this blogpost](https://techcommunity.microsoft.com/t5/windows-dev-appconsult/running-wsl-gui-apps-on-windows-10/ba-p/1493242).

- Add the following to your `.bashrc` within WSL2:

```bash
export DISPLAY="`sed -n 's/nameserver //p' /etc/resolv.conf`:0"
```

- Install an X server on your Windows host, like [VcXSrv](https://sourceforge.net/projects/vcxsrv/), and disable access control when prompted to do so.
- Simply launch the X server prior to launching an app through Speculos from WSL.


================================================
FILE: docs/requirements.txt
================================================
sphinx<7
# rtd-theme 2.0.0 needs sphinx<8, but is buggy with sphinx 7, so both are pinned
# rtd-theme v3 is still beta but should work with newer sphinx versions
sphinx-rtd-theme<=2
myst-parser
sphinxcontrib-rawfiles


================================================
FILE: docs/user/api.md
================================================
---
sort: 5
---

# REST API

A REST API is available at [http://127.0.0.1:5000](http://127.0.0.1:5000) (the port can be changed thanks to `--api-port`) when speculos is running. The specification of the API can be found at this URL, or from the swagger.io [demo website](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/LedgerHQ/speculos/master/speculos/api/static/swagger/swagger.json).

This API is meant to be used in test environments to automate actions on the device such as:

- Taking screenshot
- Pressing buttons
- Setting or updating [automation rules](automation.md)
- etc.

## Usage

For instance, pressing the left button is as simple as:

```shell
curl -d '{"action":"press-and-release"}' http://127.0.0.1:5000/button/left
```

and taking a screenshot of the device:

```shell
curl -o screenshot.png http://127.0.0.1:5000/screenshot
```

## Web UI

There is a web user interface running directly on [http://127.0.0.1:5000](http://127.0.0.1:5000), which communicates with the API:

![screenshot btc nano s](../_static/screenshot-api-nanos-btc.png)


================================================
FILE: docs/user/automation.md
================================================
---
sort: 6
---

# Automation: press buttons automatically

The `--automation` argument allows to apply a set of actions (eg. button press)
when a condition is met (usually some text is displayed on the screen). It is
especially useful to automate app testing.

A JSON file is expected (either a JSON document or a path prefixed by `file:`).


## Rules

Rules are a list of rules. Each rule is a dictionary with the following valid
keys:

- `text`: expected text (string)
- `regexp`: regular expression matching the expected text (string)
- `x`: x-coordinate of the text (int)
- `y`: y-coordinate of the text (int)
- `conditions`: list of conditions, described below
- `actions`: list of actions, described below

Each key is optional.

### Actions

4 actions are available:

- `[ "button", num, pressed ]`: press (`pressed=true`) or release
  (`pressed=false`) a button (`num=1` for left, `num=2` for right)
- `[ "finger", x, y, touched ]`: touch (`touched=true`) or release
  (`touched=false`) the screen (`x` and `y` coordinates)
- `[ "setbool", varname, value ]`: set a variable whose name is `varname` to a
  boolean value (either `true` or `false`)
- `[ "exit" ]`: exit speculos

The actions of a rule are executed if and only if each rule option matches.
These actions are applied successively according to the ordering of the `actions`
list.

The actions of the first rule matched are applied. Further matching rules are
discarded (it allows to implement a *default* rule).

### Conditions

Conditions are a list of variables of tuple `(varname, value)` where `varname`
is a variable name and `value` a boolean. These variables are set by the
`setbool` action and by default an unset variable is equal to `false`.

If a non-empty `conditions` list is specified in the rule, each condition should
be met (as well as the other options) to allow the actions to be applied.


## Example

As an example, one can consider the following automation JSON file:

```json
{
    "version": 1,
    "rules": [
        {
            "text": "Application",
            "x": 35,
            "y": 3,
            "conditions": [
                [ "seen", false ]
            ],
            "actions": [
                [ "button", 2, true ],
                [ "button", 2, false ],
                [ "setbool", "seen", true ]
            ]
        },
        {
            "regexp": "\\d+",
            "actions": [
                [ "exit" ]
            ]
        },
        {
            "actions": [
                [ "setbool", "default_match", true ]
            ]
        }
    ]
}
```

The first rule matches only if:

- the text displayed at `(35, 3)` is `Application`
- this rule was never matched before (because the variable `seen` is set to
  `true` in the `actions` and expected to be `false` in the `conditions`)

If the first rule is matched, the right button (`2`) is pressed then released
(`true` then `false`) and the variable `seen` is set to `true`.

The second rules matches if the text is a number  (regular expression `\d+`)
displayed at any coordinates (no `x` nor `y` specified). The action `exit` makes
speculos exit without any confirmation.

The last rule is a default rule (there are no options). If no previous rule is
matched, the variable `default_match` is set to `true`.


================================================
FILE: docs/user/clients.md
================================================
---
sort: 3
---

# Clients: how to send APDUs

Clients can communicate with the emulated device using APDUs, as usual. Speculos
embbeds a TCP server (listening on `127.0.0.1:9999`) to forward APDUs to the
target app.

## ledgerctl (ledgerwallet)

[ledgerwallet](https://github.com/LedgerHQ/ledgerctl) is a library to control
Ledger devices, also available through the command `ledgerctl` (it can be
installed thanks to [pip](https://pypi.org/project/ledgerwallet/)):

```shell
pip3 install ledgerwallet
```

If the environment variables `LEDGER_PROXY_ADDRESS` and `LEDGER_PROXY_PORT` are
set, the library tries to use the device emulated by Speculos. For instance, the
following command-line sends the APDU `e0 c4 00 00 00` (Bitcoin app APDU to get
the version):

```shell
$ echo 'e0c4000000' | LEDGER_PROXY_ADDRESS=127.0.0.1 LEDGER_PROXY_PORT=9999 ledgerctl send -
13:37:35.096:apdu: > e0c4000000
13:37:35.099:apdu: < 1b3001030e0100039000
1b3001030e0100039000
```

## blue-loader-python (ledgerblue)

Most clients relies on the
[blue-loader-python](https://github.com/LedgerHQ/blue-loader-python/) Python
library which supports Speculos since release
[0.1.24](https://pypi.org/project/ledgerblue/0.1.24/). This library can be
installed through pip using the following command-line:

```shell
pip3 install ledgerblue
```

The usage is similar to `ledgerctl`:

```shell
$ ./speculos.py ./apps/btc.elf &
$ echo 'e0c4000000' | LEDGER_PROXY_ADDRESS=127.0.0.1 LEDGER_PROXY_PORT=9999 python3 -m ledgerblue.runScript --apdu
=> b'e0c4000000'
<= b'1b30010308010003'9000
<= Clear bytearray(b'\x1b0\x01\x03\x08\x01\x00\x03')
```

## btchip-python

Use [btchip-python](https://github.com/LedgerHQ/btchip-python) without a real device:

```shell
PYTHONPATH=$(pwd) LEDGER_PROXY_ADDRESS=127.0.0.1 LEDGER_PROXY_PORT=9999 python tests/testMultisigArmory.py
```

Note: `btchip-python` relies on its own library to communicate with devices
(physical or emulated) instead of `ledgerblue` to transmit APDUs.

## ledger-live-common

```shell
./tools/ledger-live-http-proxy.py &
DEBUG_COMM_HTTP_PROXY=http://127.0.0.1:9998 ledger-live getAddress -c btc --path "m/49'/0'/0'/0/0" --derivationMode segwit
```


================================================
FILE: docs/user/debug.md
================================================
---
sort: 4
---

# Debug: how to use GDB

Debug an app thanks to GDB:

```shell
./speculos.py -d apps/btc.elf &
./tools/debug.sh apps/btc.elf
```

Some useful tricks:

- Use the `-t` (`--trace`) argument to trace every syscalls.
- [Semihosting](semihosting.md) features can be used as an additional debug mechanism.


================================================
FILE: docs/user/docker.md
================================================
# Docker

## How to use the Docker image

A docker image is available on [GitHub Packages](https://ghcr.io/ledgerhq/speculos). Pull the latest image:

```shell
docker pull ghcr.io/ledgerhq/speculos
docker image tag ghcr.io/ledgerhq/speculos speculos
```

And run the image with a few arguments from the root of the speculos project:

```shell
docker run --rm -it -v $(pwd)/apps:/speculos/apps --publish 41000:41000 speculos --display headless --vnc-port 41000 apps/btc.elf
```

- The app folder (here `$(pwd)/apps/`) is mounted thanks to `-v`
- The VNC server is available from the host thanks to `--publish`

The image can obviously run an interactive shell with `--entrypoint /bin/bash`.


### Arguments

All the arguments which are supported by `speculos.py` can be passed on the Docker command-line. Don't forget to publish container's ports when required using `-p`:

```shell
docker run --rm -it -v "$(pwd)"/apps:/speculos/apps \
-p 1234:1234 -p 5000:5000 -p 40000:40000 -p 41000:41000 speculos \
--model nanos ./apps/btc.elf --sdk 2.0 --seed "secret" --display headless --apdu-port 40000 --vnc-port 41000
```

### Debug

```shell
docker run --rm -it -v "$(pwd)"/apps:/speculos/apps -p 1234:1234 -p 5000:5000 -p 40000:40000 -p 41000:41000 --entrypoint /bin/bash speculos
```

### docker-compose setup

```shell
docker-compose up [-d]
```
> Default configuration is nanos / 2.0 / btc.elf / seed "secret"

Edit `docker-compose.yml` to configure port forwarding and environment variables that fit your needs.

## Build

The following command-line can be used to create a docker image based on a local
[build](../installation/build.md):

```shell
docker build ./ -t speculos
```


================================================
FILE: docs/user/index.rst
================================================
User
====

.. toctree::
   :maxdepth: 1

   api
   automation
   clients
   debug
   docker
   macm1
   semihosting
   usage


================================================
FILE: docs/user/macm1.md
================================================
# Docker - for Mac M1

## How to build the Docker image

Edit the `Dockerfile` and perform the following modification

Replace line #1

```
FROM ghcr.io/ledgerhq/speculos-builder:latest AS builder
```

with

```
FROM ghcr.io/ledgerhq/speculos-builder-aarch64:latest AS builder
```

Then build the Docker container image with the following command:

```shell
docker build ./ -t speculos
```

If the build is successful, you should have a docker image named speculos:

```shell
docker image ls

REPOSITORY                                  TAG       IMAGE ID       CREATED          SIZE
speculos                                    latest    634c66a13457   15 minutes ago   593MB
```


## How to use the Docker image

Run the image with a few arguments from the root of the speculos project:

```shell
docker run --rm -it -v $(pwd)/apps:/speculos/apps --publish 41000:41000 --publish 5001:5001 speculos --display headless --vnc-port 41000 --api-port 5001 apps/btc.elf
```

- The app folder (here `$(pwd)/apps/`) is mounted thanks to `-v`
- The VNC server is available from the host thanks to `--publish`

The image can obviously run an interactive shell with `--entrypoint /bin/bash`.


### Arguments

All the arguments which are supported by `speculos.py` can be passed on the Docker command-line. Don't forget to publish container's ports when required using `-p`:

```shell
docker run --rm -it -v "$(pwd)"/apps:/speculos/apps \
-p 1234:1234 -p 5000:5000 -p 40000:40000 -p 41000:41000 speculos \
--model nanos ./apps/btc.elf --sdk 2.0 --seed "secret" --display headless --apdu-port 40000 --vnc-port 41000
```

### Debug

```shell
docker run --rm -it -v "$(pwd)"/apps:/speculos/apps -p 1234:1234 -p 5000:5000 -p 40000:40000 -p 41000:41000 --entrypoint /bin/bash speculos
```

### docker-compose setup

```shell
docker-compose up [-d]
```
> Default configuration is nanos / 2.0 / btc.elf / seed "secret"

Edit `docker-compose.yml` to configure port forwarding and environment variables that fit your needs.


================================================
FILE: docs/user/semihosting.md
================================================
---
sort: 7
---

# Semihosting as an additional debug mechanism

QEMU implements some semihosted operations which can be triggered from the app.
For instance, messages can be printed to stderr with the following code:

## SYS_WRITE0

```C
void debug_write(char *buf)
{
  asm volatile (
     "movs r0, #0x04\n"
     "movs r1, %0\n"
     "svc      0xab\n"
     :: "r"(buf) : "r0", "r1"
  );
}
```

The operation number must be passed in `r0` (here `SYS_WRITE0` operation is
defined to `0x04`) and arguments are in `r1`, `r2` and `r3`.

Usage:

```C
debug_write("magic!\n");
```


## References

- [ARM semihosting](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Bgbjjgij.html)
- [Semihosting for AArch32 and AArch64 - Release 2.0](https://static.docs.arm.com/100863/0200/semihosting.pdf)
- [qemu/target/arm/arm-semi.c](https://github.com/qemu/qemu/blob/8de702cb677c8381fb702cae252d6b69aa4c653b/target/arm/arm-semi.c)


================================================
FILE: docs/user/usage.md
================================================
---
sort: 1
---

# Usage

After having [installed the requirements and built](../installation/build.md) speculos:

```shell
./speculos.py apps/btc.elf
```

The docker image can also be used directly, as detailed in the specific [docker documentation page](docker.md).

With applications built by recent SDKs, Speculos can automatically detect the targeted device. The Nano X, Nano S+, Flex, Stax and Apex+ can be specified on the command line:

```shell
./speculos.py --model nanox apps/nanox#btc#2.0.2#1c8db8da.elf
./speculos.py --model nanosp apps/nanosp#btc#1.0.3#17bf7619.elf
./speculos.py --model stax apps/btc.elf.elf
./speculos.py --model flex apps/btc.elf.elf
```

The last SDK version is automatically selected. However, a specific version
be specified if the target app is not build against the last version of the SDK,
thanks to the `-k`/`--sdk` argument. For instance, to launch an app built
against the SDK `1.5` on the Nano S:

```shell
./speculos.py --sdk 1.5 --model nanosp apps/btc.elf
```

Supported SDK values for each device are defined in [src/sdk.h](https://github.com/LedgerHQ/speculos/blob/master/src/sdk.h).
You main choose the SDK using `-k`/`--sdk` argument:

|     | Nano S+    | Nano X          |
|-----|------------|-----------------|
| SDK | 1.0, 1.0.3 | 1.2, 2.0, 2.0.2 |

For more options, pass the `-h` or `--help` flag.

## Keyboard control

- The keyboard left and right arrow keys are used instead of the Nano buttons.
  The down arrow can also be used as a more convenient shortcut.
- The `Q` key exits the application.

## Display

Several display options are available through the `--display` parameter:

- `qt`: default, requires a X server
- `headless`: nothing is displayed
- `text`: the UI is displayed in the console (handy on Windows)

These options can be used along `--vnc-port` which spawns a VNC server on the
specified port. macOS users should also add `--vnc-password <password>` if using
the built-in VNC client because unauthenticated sessions doesn't seem to be
supported (issue #34).

A recording of the screen can be saved as a GIF file thanks to the
`tools/gif-recorder.py` script.

## App name and version

On a real device, some parameters specific to the app to be installed (name and
version, icon, allowed derivation paths, etc.) are given during the
installation. This information isn't embedded in the .elf file itself and thus
cannot be retrieved by speculos.

The default app name and version are respectively `app` `1.33.7`, but these
values can be set through the `SPECULOS_APPNAME` environment variable. For
instance:

```shell
$ SPECULOS_APPNAME=blah:1.2.3.4 ./speculos.py ./apps/btc.elf &
$ echo 'b0 01 00 00 00' \
  | LEDGER_PROXY_ADDRESS=127.0.0.1 LEDGER_PROXY_PORT=9999 ledgerctl send - \
  | xxd -r -ps \
  | hd
00000000  01 04 62 6c 61 68 07 31  2e 32 2e 33 2e 34 01 00  |..blah.1.2.3.4..|
00000010  90 00                                             |..|
00000012
```

# Bitcoin Testnet app

Launch the Bitcoin Testnet app, which requires the Bitcoin app:

```shell
./speculos.py ./apps/btc-test.elf -l Bitcoin:./apps/btc.elf
```

## OCR

OCR is available for NanoX, Nanos S+, Flex, Stax and Apex+ with built in character recognition.


================================================
FILE: gcc-arm.cmake
================================================
# cmake-toolchain configuration to build with gcc on Debian and Ubuntu
#
# Usage:
#
#   cmake -DCMAKE_TOOLCHAIN_FILE=gcc-arm.cmake -Bbuild -H. && cmake --build build
#
# Documentation: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)

set(CMAKE_C_FLAGS "-mthumb" CACHE STRING "" FORCE)


================================================
FILE: lgtm.yml
================================================
# Test with:
# podman run --rm -v $(pwd):/code -ti ubuntu:19.10 bash
# apt update && apt install -y build-essential cmake gcc-arm-linux-gnueabihf gcc-arm-none-eabi libvncserver-dev
# cd /code
# # Run commands from "configure" and "build_command" sections
extraction:
  cpp:
    prepare:
      packages:
      - cmake
      - gcc-arm-linux-gnueabihf
      - gcc-arm-none-eabi
      - libvncserver-dev

    configure:
      command:
      - cmake -Bbuild -H. -DWITH_VNC=1

    index:
      build_command:
      - make -C build


================================================
FILE: pyproject.toml
================================================
[build-system]
requires = [
    "setuptools",
    "wheel",
    "setuptools_scm",
    "cmake"
]
build-backend = "setuptools.build_meta"

[project]
name = "speculos"
authors = [{name = "Ledger"}]
description = "Ledger Stax, Flex, Apex+ and Nano S+/X application emulator"
classifiers = [
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
    "Operating System :: POSIX :: Linux",
    "Operating System :: MacOS :: MacOS X",
]
requires-python = ">=3.10"
dependencies = [
    "construct>=2.10.56,<3.0.0",
    "flask>=2.0.0,<3.0.0",
    "flask-restful>=0.3.9,<1.0",
    "flask-cors>=5.0.0,<7.0.0",
    "jsonschema>=3.2.0,<4.18.0",
    "mnemonic>=0.19,<1.0",
    "pillow>=8.0.0,<11.0.0",
    "pyelftools>=0.27,<1.0",
    "pyqt6>=6.4.0,<7.0.0",
    "requests>=2.25.1,<3.0.0",
    "ledgered>=0.14.0",
    "pygame>=2.6.1",
]
dynamic = ["version"]

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.urls]
Homepage = "https://github.com/LedgerHQ/speculos"
"Bug Tracker" = "https://github.com/LedgerHQ/speculos/issues"

[project.optional-dependencies]
dev = [
    "pytest",
    "pytest-cov"
]

[project.scripts]
speculos = "speculos.main:main"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages]
find = {namespaces = false}

[tool.setuptools_scm]
write_to = "speculos/__version__.py"
local_scheme = "no-local-version"

[tool.mypy]
ignore_missing_imports = true

[tool.flake8]
max-line-length = 120


================================================
FILE: sdk/bolos_syscalls.h
================================================
#pragma once

/*********************
 *      INCLUDES
 *********************/

/*********************
 *      DEFINES
 *********************/
// the number of parameters of a syscall is stored in the syscall id
#define SYSCALL_NUMBER_OF_PARAMETERS(id) (((id) >> 24) & 0xf)

// clang-format off
#define SYSCALL_get_api_level_ID_IN                                   0x00000001
#define SYSCALL_halt_ID_IN                                            0x00000002
#define SYSCALL_nvm_write_ID_IN                                       0x03000003
#define SYSCALL_nvm_erase_ID_IN                                       0x02000121
#define SYSCALL_cx_aes_set_key_hw_ID_IN                               0x020000b2
#define SYSCALL_cx_aes_reset_hw_ID_IN                                 0x000000b3
#define SYSCALL_cx_aes_block_hw_ID_IN                                 0x020000b4
#define SYSCALL_cx_bn_lock_ID_IN                                      0x02000112
#define SYSCALL_cx_bn_unlock_ID_IN                                    0x000000b6
#define SYSCALL_cx_bn_is_locked_ID_IN                                 0x000000b7
#define SYSCALL_cx_bn_alloc_ID_IN                                     0x02000113
#define SYSCALL_cx_bn_alloc_init_ID_IN                                0x04000114
#define SYSCALL_cx_bn_destroy_ID_IN                                   0x010000bc
#define SYSCALL_cx_bn_nbytes_ID_IN                                    0x0200010d
#define SYSCALL_cx_bn_init_ID_IN                                      0x03000115
#define SYSCALL_cx_bn_rand_ID_IN                                      0x010000ea
#define SYSCALL_cx_bn_copy_ID_IN                                      0x020000c0
#define SYSCALL_cx_bn_set_u32_ID_IN                                   0x020000c1
#define SYSCALL_cx_bn_get_u32_ID_IN                                   0x020000eb
#define SYSCALL_cx_bn_export_ID_IN                                    0x030000c3
#define SYSCALL_cx_bn_cmp_ID_IN                                       0x030000c4
#define SYSCALL_cx_bn_cmp_u32_ID_IN                                   0x030000c5
#define SYSCALL_cx_bn_is_odd_ID_IN                                    0x02000118
#define SYSCALL_cx_bn_xor_ID_IN                                       0x030000c8
#define SYSCALL_cx_bn_or_ID_IN                                        0x030000c9
#define SYSCALL_cx_bn_and_ID_IN                                       0x030000ca
#define SYSCALL_cx_bn_tst_bit_ID_IN                                   0x030000cb
#define SYSCALL_cx_bn_set_bit_ID_IN                                   0x020000cc
#define SYSCALL_cx_bn_clr_bit_ID_IN                                   0x020000cd
#define SYSCALL_cx_bn_shr_ID_IN                                       0x020000ce
#define SYSCALL_cx_bn_shl_ID_IN                                       0x0200011c
#define SYSCALL_cx_bn_cnt_bits_ID_IN                                  0x020000ec
#define SYSCALL_cx_bn_add_ID_IN                                       0x03000119
#define SYSCALL_cx_bn_sub_ID_IN                                       0x0300011a
#define SYSCALL_cx_bn_mul_ID_IN                                       0x030000d2
#define SYSCALL_cx_bn_mod_add_ID_IN                                   0x040000d3
#define SYSCALL_cx_bn_mod_sub_ID_IN                                   0x040000d4
#define SYSCALL_cx_bn_mod_mul_ID_IN                                   0x040000d5
#define SYSCALL_cx_bn_reduce_ID_IN                                    0x030000d6
#define SYSCALL_cx_bn_mod_sqrt_ID_IN                                  0x0400011d
#define SYSCALL_cx_bn_mod_pow_bn_ID_IN                                0x040000d7
#define SYSCALL_cx_bn_mod_pow_ID_IN                                   0x050000ed
#define SYSCALL_cx_bn_mod_pow2_ID_IN                                  0x050000ee
#define SYSCALL_cx_bn_mod_invert_nprime_ID_IN                         0x030000da
#define SYSCALL_cx_bn_mod_u32_invert_ID_IN                            0x03000116
#define SYSCALL_cx_bn_is_prime_ID_IN                                  0x020000ef
#define SYSCALL_cx_bn_next_prime_ID_IN                                0x010000f0
#define SYSCALL_cx_bn_rng_ID_IN                                       0x020001dd
#define SYSCALL_cx_bn_gf2_n_mul_ID_IN                                 0x05000046
#define SYSCALL_cx_mont_alloc_ID_IN                                   0x020000dc
#define SYSCALL_cx_mont_init_ID_IN                                    0x020000dd
#define SYSCALL_cx_mont_init2_ID_IN                                   0x030000de
#define SYSCALL_cx_mont_to_montgomery_ID_IN                           0x030000df
#define SYSCALL_cx_mont_from_montgomery_ID_IN                         0x030000e0
#define SYSCALL_cx_mont_mul_ID_IN                                     0x040000e1
#define SYSCALL_cx_mont_pow_ID_IN                                     0x050000e2
#define SYSCALL_cx_mont_pow_bn_ID_IN                                  0x040000e3
#define SYSCALL_cx_mont_invert_nprime_ID_IN                           0x030000e4
#define SYSCALL_cx_ecdomain_size_ID_IN                                0x0200012e
#define SYSCALL_cx_ecdomain_parameters_length_ID_IN                   0x0200012f
#define SYSCALL_cx_ecdomain_parameter_ID_IN                           0x04000130
#define SYSCALL_cx_ecdomain_parameter_bn_ID_IN                        0x03000131
#define SYSCALL_cx_ecdomain_generator_ID_IN                           0x04000132
#define SYSCALL_cx_ecdomain_generator_bn_ID_IN                        0x02000133
#define SYSCALL_cx_ecpoint_alloc_ID_IN                                0x020000f1
#define SYSCALL_cx_ecpoint_destroy_ID_IN                              0x010000f2
#define SYSCALL_cx_ecpoint_init_ID_IN                                 0x050000f3
#define SYSCALL_cx_ecpoint_init_bn_ID_IN                              0x030000f4
#define SYSCALL_cx_ecpoint_export_ID_IN                               0x050000f5
#define SYSCALL_cx_ecpoint_export_bn_ID_IN                            0x030000f6
#define SYSCALL_cx_ecpoint_compress_ID_IN                             0x0400012c
#define SYSCALL_cx_ecpoint_decompress_ID_IN                           0x0400012d
#define SYSCALL_cx_ecpoint_add_ID_IN                                  0x0300010e
#define SYSCALL_cx_ecpoint_neg_ID_IN                                  0x0100010f
#define SYSCALL_cx_ecpoint_scalarmul_ID_IN                            0x03000110
#define SYSCALL_cx_ecpoint_scalarmul_bn_ID_IN                         0x02000111
#define SYSCALL_cx_ecpoint_rnd_scalarmul_ID_IN                        0x03000127
#define SYSCALL_cx_ecpoint_rnd_scalarmul_bn_ID_IN                     0x02000128

#define SYSCALL_cx_ecpoint_rnd_fixed_scalarmul_ID_IN                  0x03000129

#define SYSCALL_cx_ecpoint_double_scalarmul_ID_IN                     0x07000148
#define SYSCALL_cx_ecpoint_double_scalarmul_bn_ID_IN                  0x0500014a
#define SYSCALL_cx_ecpoint_cmp_ID_IN                                  0x030000fb
#define SYSCALL_cx_ecpoint_is_on_curve_ID_IN                          0x020000fc
#define SYSCALL_cx_ecpoint_is_at_infinity_ID_IN                       0x0200014b

#define SYSCALL_cx_ecpoint_x25519_ID_IN 0x0300001b

#define SYSCALL_cx_ecpoint_x448_ID_IN 0x03000060

#define SYSCALL_cx_vss_generate_shares_ID_IN 0x0a000001
#define SYSCALL_cx_vss_combine_shares_ID_IN  0x04000002
#define SYSCALL_cx_vss_verify_commits_ID_IN  0x05000003

#define SYSCALL_cx_crc_hw_ID_IN 0x04000102

#define SYSCALL_ox_bls12381_sign_ID_IN      0x05000103
#define SYSCALL_cx_hash_to_field_ID_IN      0x06000104
#define SYSCALL_cx_bls12381_aggregate_ID_IN 0x05000105
#define SYSCALL_cx_bls12381_key_gen_ID_IN   0x03000108

#define SYSCALL_cx_get_random_bytes_ID_IN     0x02000107
#define SYSCALL_cx_trng_get_random_data_ID_IN 0x02000106

#define SYSCALL_RESERVED_7_ID_IN                         0x0000004b
#define SYSCALL_RESERVED_8_ID_IN                         0x0400004e
#define SYSCALL_RESERVED_9_ID_IN                         0x0700004f
#define SYSCALL_RESERVED_10_ID_IN                        0x02000050
#define SYSCALL_RESERVED_11_ID_IN                        0x01000051
#define SYSCALL_os_perso_is_pin_set_ID_IN                0x0000009e
#define SYSCALL_os_perso_isonboarded_ID_IN               0x0000009f
#define SYSCALL_RESERVED_12_ID_IN                        0x03000094
#define SYSCALL_os_perso_derive_node_bip32_ID_IN         0x05000053
#define SYSCALL_os_perso_derive_node_with_seed_key_ID_IN 0x080000a6
#define SYSCALL_os_perso_derive_eip2333_ID_IN            0x040000a7
#define SYSCALL_HDKEY_derive_ID_IN                       0x0a000002

#define SYSCALL_RESERVED_13_ID_IN 0x02000052
#define SYSCALL_RESERVED_14_ID_IN 0x02000054

#define SYSCALL_os_perso_get_master_key_identifier_ID_IN 0x02000055

#define SYSCALL_ENDORSEMENT_GET_CODE_HASH_ID_IN               0x01000055
#define SYSCALL_ENDORSEMENT_GET_PUB_KEY_ID_IN                 0x03000056
#define SYSCALL_ENDORSEMENT_GET_PUB_KEY_SIG_ID_IN             0x03000057
#define SYSCALL_ENDORSEMENT_KEY1_GET_APP_SECRET_ID_IN         0x01000058
#define SYSCALL_ENDORSEMENT_KEY1_SIGN_DATA_ID_IN              0x04000059
#define SYSCALL_ENDORSEMENT_KEY2_DERIVE_AND_SIGN_DATA_ID_IN   0x0400005a
#define SYSCALL_ENDORSEMENT_KEY1_SIGN_WITHOUT_CODE_HASH_ID_IN 0x0400005b
#define SYSCALL_RESERVED_15_ID_IN                             0x0400004c
#define SYSCALL_RESERVED_16_ID_IN                             0x0200004d
#define SYSCALL_os_global_pin_is_validated_ID_IN              0x000000a0
#define SYSCALL_os_global_pin_check_ID_IN                     0x020000a1
#define SYSCALL_os_global_pin_invalidate_ID_IN                0x0000005d
#define SYSCALL_os_global_pin_retries_ID_IN                   0x0000005e
#define SYSCALL_RESERVED_3_ID_IN                              0x0000005f
#define SYSCALL_RESERVED_4_ID_IN                              0x02000122
#define SYSCALL_os_ux_ID_IN                                   0x01000064
#define SYSCALL_os_lib_call_ID_IN                             0x01000067
#define SYSCALL_os_lib_end_ID_IN                              0x00000068
#define SYSCALL_os_flags_ID_IN                                0x0000006a
#define SYSCALL_os_version_ID_IN                              0x0200006b
#define SYSCALL_os_serial_ID_IN                               0x0200006c
#define SYSCALL_os_seph_features_ID_IN                        0x0000006e
#define SYSCALL_os_seph_version_ID_IN                         0x0200006f
#define SYSCALL_os_bootloader_version_ID_IN                   0x02000073
#define SYSCALL_os_factory_setting_get_ID_IN                  0x0300014c
#define SYSCALL_os_setting_get_ID_IN                          0x03000070
#define SYSCALL_os_setting_set_ID_IN                          0x03000071
#define SYSCALL_RESERVED_5_ID_IN                              0x06000123
#define SYSCALL_RESERVED_6_ID_IN                              0x00000125
#define SYSCALL_RESERVED_34_ID_IN                             0x01000126
#define SYSCALL_os_sched_exit_ID_IN                           0x0100009a
#define SYSCALL_os_sched_is_running_ID_IN                     0x0100009b
#define SYSCALL_os_sched_create_ID_IN                         0x0700011b
#define SYSCALL_os_sched_kill_ID_IN                           0x01000078
#define SYSCALL_os_io_seph_tx_ID_IN                           0x03000082
#define SYSCALL_os_io_seph_se_rx_event_ID_IN                  0x05000083
#define SYSCALL_os_io_init_ID_IN                              0x01000084
#define SYSCALL_os_io_start_ID_IN                             0x01000085
#define SYSCALL_os_io_stop_ID_IN                              0x01000086
#define SYSCALL_os_io_tx_cmd_ID_IN                            0x04000088
#define SYSCALL_os_io_rx_evt_ID_IN                            0x03000089
#define SYSCALL_nvm_write_page_ID_IN                          0x0100010a
#define SYSCALL_nvm_erase_page_ID_IN                          0x01000136
#define SYSCALL_try_context_get_ID_IN                         0x00000087
#define SYSCALL_try_context_set_ID_IN                         0x0100010b
#define SYSCALL_os_sched_last_status_ID_IN                    0x0100009c
#define SYSCALL_os_sched_yield_ID_IN                          0x0100009d
#define SYSCALL_os_sched_switch_ID_IN                         0x0200009e
#define SYSCALL_os_sched_current_task_ID_IN                   0x0000008b
#define SYSCALL_os_allow_protected_flash_ID_IN                0x0000008e
#define SYSCALL_os_deny_protected_flash_ID_IN                 0x00000091
#define SYSCALL_os_allow_protected_ram_ID_IN                  0x00000092
#define SYSCALL_os_deny_protected_ram_ID_IN                   0x00000093
#define SYSCALL_os_set_ux_time_ms_ID_IN                       0x010000a2
#define SYSCALL_os_pki_load_certificate_ID_IN 0x060000aa
#define SYSCALL_os_pki_verify_ID_IN           0x040000ab
#define SYSCALL_os_pki_get_info_ID_IN         0x040000ac

#define SYSCALL_RESERVED_20_ID_IN 0x02000150
#define SYSCALL_RESERVED_21_ID_IN 0x03000151
#define SYSCALL_RESERVED_22_ID_IN 0x01000152
#define SYSCALL_RESERVED_23_ID_IN 0x01000155

#define SYSCALL_RESERVED_24_ID_IN 0x01000CA0
#define SYSCALL_RESERVED_25_ID_IN 0x00000CA1

#define SYSCALL_RESERVED_2_ID_IN               0x010001ED
#define SYSCALL_RESERVED_1_ID_IN               0x010001EE
#define SYSCALL_ENDORSEMENT_GET_METADATA_ID_IN 0x02000138

#define SYSCALL_RESERVED_17_ID_IN 0x02000137
#define SYSCALL_RESERVED_18_ID_IN 0x00000149
#define SYSCALL_RESERVED_19_ID_IN 0x00000152

#define SYSCALL_screen_clear_ID_IN       0x00000079
#define SYSCALL_screen_update_ID_IN      0x0000007a
#define SYSCALL_screen_set_keepout_ID_IN 0x0400007b
#define SYSCALL_screen_set_brightness_ID_IN 0x0100008c
#define SYSCALL_bagl_hal_draw_bitmap_within_rect_ID_IN 0x0900007c
#define SYSCALL_bagl_hal_draw_rect_ID_IN               0x0500007d

#define SYSCALL_os_ux_set_status_ID_IN 0x02000134
#define SYSCALL_os_ux_get_status_ID_IN 0x01000135

#define SYSCALL_io_button_read_ID_IN 0x0000008f

#define SYSCALL_os_standby_ID_IN 0x0000d0d0

#define SYSCALL_os_seph_serial_ID_IN 0x0200006d

#define SYSCALL_RESERVED_26_ID_IN 0x01000153
#define SYSCALL_RESERVED_27_ID_IN 0x01000154

#define SYSCALL_os_stack_operations_ID_IN 0x01000199

#define SYSCALL_nbgl_front_draw_rect_ID_IN            0x01fa0000
#define SYSCALL_nbgl_front_draw_horizontal_line_ID_IN            0x03fa0001
#define SYSCALL_nbgl_front_draw_img_ID_IN             0x04fa0002
#define SYSCALL_nbgl_front_refresh_area_ID_IN         0x03fa0003
#define SYSCALL_nbgl_front_draw_img_file_ID_IN        0x05fa0004
#define SYSCALL_nbgl_side_draw_rect_ID_IN             0x01fa0005
#define SYSCALL_nbgl_side_draw_horizontal_line_ID_IN  0x03fa0006
#define SYSCALL_nbgl_side_draw_img_ID_IN              0x04fa0007
#define SYSCALL_nbgl_side_refresh_area_ID_IN          0x02fa0008
#define SYSCALL_nbgl_screen_reinit_ID_IN              0x00fa000d
#define SYSCALL_nbgl_front_draw_img_rle_ID_IN         0x05fa0010
#define SYSCALL_nbgl_front_control_area_masking_ID_IN 0x03fa0012

#define SYSCALL_nbgl_wait_pipeline_ID_IN 0x00fa0011

#define SYSCALL_nbgl_screen_update_temperature_ID_IN 0x01fa0011

#define SYSCALL_nbgl_screen_config_fast_mode_ID_IN 0x00fa0012

#define SYSCALL_fetch_background_img  0x01fa0009
#define SYSCALL_delete_background_img 0x01fa000a

#define SYSCALL_touch_get_last_info_ID_IN   0x01fa000b
#define SYSCALL_touch_exclude_borders_ID_IN 0x01fa000d
#define SYSCALL_touch_set_state_ID_IN       0x01fa000e
#define SYSCALL_touch_debug_ID_IN 0x03fa000f

// -- Pre API_LEVEL_23
#define SYSCALL_os_endorsement_get_code_hash_ID_IN                    0x01000055
#define SYSCALL_os_endorsement_get_public_key_ID_IN                   0x03000056
#define SYSCALL_os_endorsement_get_public_key_certificate_ID_IN       0x03000057
#define SYSCALL_os_endorsement_key1_get_app_secret_ID_IN              0x01000058
#define SYSCALL_os_endorsement_key1_sign_data_ID_IN                   0x03000059
#define SYSCALL_os_endorsement_key2_derive_sign_data_ID_IN            0x0300005a
#define SYSCALL_os_endorsement_key1_sign_without_code_hash_ID_IN      0x0300005b

// -- Pre API_LEVEL_26
#define SYSCALL_ENDORSEMENT_get_code_hash_ID_IN               0x01000055
#define SYSCALL_ENDORSEMENT_get_public_key_ID_IN              0x03000056
#define SYSCALL_ENDORSEMENT_get_public_key_certificate_ID_IN  0x03000057
#define SYSCALL_ENDORSEMENT_key1_get_app_secret_ID_IN         0x01000058
#define SYSCALL_ENDORSEMENT_key1_sign_data_ID_IN              0x03000059
#define SYSCALL_ENDORSEMENT_key2_derive_and_sign_data_ID_IN   0x0300005a
#define SYSCALL_ENDORSEMENT_key1_sign_without_code_hash_ID_IN 0x0300005b

// -- Pre API_LEVEL_25
#define SYSCALL_io_seph_send_ID_IN                                    0x02000083
#define SYSCALL_io_seph_is_status_sent_ID_IN                          0x00000084
#define SYSCALL_io_seph_recv_ID_IN                                    0x03000085

#define SYSCALL_os_registry_get_current_app_tag_ID_IN                 0x03000074

#define SYSCALL_nbgl_get_font_ID_IN                                   0x01fa000c

#define SYSCALL_hdkey_derive_ID_IN 0x0a000002

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 * STATIC VARIABLES
 **********************/

/**********************
 * STATIC INLINE
 **********************/

/**********************
 * GLOBAL PROTOTYPES
 **********************/
// clang-format on


================================================
FILE: setup.py
================================================
#!/usr/bin/env python3
"""Install Speculos"""
import pathlib
import shutil
import tempfile
from setuptools.command.build_py import build_py as _build_py
from setuptools import setup


class BuildSpeculos(_build_py):
    """
    Extend "setup.py build_py" to build Speculos launcher and VNC server using cmake.

    This command requires some system dependencies (ARM compiler, libvncserver
    headers...) which are documented on https://speculos.ledger.com/installation/build.html

    distutils documentation about extending the build command:
    https://docs.python.org/3.8/distutils/extending.html#integrating-new-commands
    """

    def run(self):
        if not shutil.which("cmake"):
            raise RuntimeError("cmake is not found and is required to build Speculos")

        if not self.dry_run:
            pathlib.Path(self.build_lib).mkdir(parents=True, exist_ok=True)
            with tempfile.TemporaryDirectory(prefix="build-", dir=self.build_lib) as build_dir:
                self.spawn(
                    [
                        "cmake",
                        "-H.",
                        "-B" + build_dir,
                        "-DCMAKE_BUILD_TYPE=Release",
                        "-DBUILD_TESTING=0",
                        "-DWITH_VNC=1",
                    ]
                )
                self.spawn(["cmake", "--build", build_dir])

        super().run()


setup(
    cmdclass={
        "build_py": BuildSpeculos,
    },
)


================================================
FILE: speculos/__init__.py
================================================
from . import api  # noqa: F401
from . import client  # noqa: F401
from . import mcu  # noqa: F401

try:
    from speculos.__version__ import __version__  # noqa
except ImportError:
    __version__ = "unknown version"  # noqa


================================================
FILE: speculos/__main__.py
================================================
from . import main


if __name__ == "__main__":
    main.main(prog="speculos")


================================================
FILE: speculos/api/README.md
================================================
## Generate

Convert the specification file from YAML to JSON:

```shell
docker pull docker.io/swaggerapi/swagger-converter:v1.0.2
docker run --rm -it -p 8080:8080 docker.io/swaggerapi/swagger-converter:v1.0.2
wget --quiet -O- --header 'content-type: application/yaml' --post-file api/swagger.yaml \
    http://127.0.0.1:8080/api/convert | jq . > api/static/swagger/swagger.json
```

The following command can be used to serve (and retrieve) the swagger-ui using the generated JSON file:

```shell
docker run --rm -p 8080:8080 -e SWAGGER_JSON=/api/swagger/swagger.json -v "$(pwd)/speculos/api:/api" docker.io/swaggerapi/swagger-ui
for f in index.html swagger-ui.css favicon-32x32.png favicon-16x16.png swagger-ui-bundle.js swagger-ui-standalone-preset.js; do
    wget --quiet -O "speculos/api/static/swagger/$f" "http://127.0.0.1:8080/$f"
done
```

## References

- https://editor.swagger.io/
- https://swagger.io/specification/
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md
- https://openapi-generator.tech/docs/online/


================================================
FILE: speculos/api/__init__.py
================================================
from .api import ApiRunner  # noqa: F401
from .events import EventsBroadcaster  # noqa: F401


================================================
FILE: speculos/api/apdu.py
================================================
import json
import threading
import jsonschema
from flask import stream_with_context, Response, request
from typing import Generator, Optional

from speculos.resources_importer import get_resource_schema_as_json
from ..mcu.seproxyhal import SeProxyHal
from .restful import SephResource


class APDUBridge:
    def __init__(self, seph: SeProxyHal):
        # We want to be notified when APDU response is transmitted from the SE
        self.endpoint_lock = threading.Lock()
        self.response_condition = threading.Condition()
        self._seph = seph
        self._seph.apdu_callbacks.append(self.seph_apdu_callback)
        self.response: Optional[bytes]

    def exchange(self, data: bytes, tick_timeout: int = 5 * 60 * 10) -> Generator[bytes, None, None]:
        # force headers to be sent
        yield b""

        tick_count_before_exchange = self._seph.get_tick_count()

        with self.endpoint_lock:  # Lock for a command/response for one client
            with self.response_condition:
                self.response = None
            self._seph.to_app(data)
            with self.response_condition:
                while self.response is None:
                    self.response_condition.wait(0.1)
                    exchange_tick_count = self._seph.get_tick_count() - tick_count_before_exchange

                    if tick_timeout != 0 and exchange_tick_count > tick_timeout:
                        raise TimeoutError()
            yield json.dumps({"data": self.response.hex()}).encode()

    def seph_apdu_callback(self, data: bytes) -> None:
        """
        Called by seph when data is transmitted by the SE. That data should
        be the response to a prior APDU request
        """
        with self.response_condition:
            self.response = data
            self.response_condition.notify()


class APDU(SephResource):
    schema = get_resource_schema_as_json("api", "apdu.schema")

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._bridge = APDUBridge(self.seph)

    def post(self):
        args = request.get_json(force=True)
        try:
            jsonschema.validate(instance=args, schema=self.schema)
        except jsonschema.exceptions.ValidationError as e:
            return {"error": f"{e}"}, 400

        data = bytes.fromhex(args.get("data"))

        if "tick_timeout" in args:
            tick_timeout = args["tick_timeout"]
            return Response(stream_with_context(self._bridge.exchange(data, tick_timeout)),
                            content_type="application/json")

        return Response(stream_with_context(self._bridge.exchange(data)), content_type="application/json")


================================================
FILE: speculos/api/api.py
================================================
import socket
import threading
from typing import Any, Dict
from flask import Flask
from flask_restful import Api
from flask_cors import CORS
import flask.cli

from speculos.mcu.display import DisplayNotifier, IODevice
from speculos.mcu.readerror import ReadError
from speculos.mcu.seproxyhal import SeProxyHal
from speculos.observer import BroadcastInterface
from speculos.resources_importer import resources
from .apdu import APDU
from .automation import Automation
from .button import Button
from .events import Events
from .finger import Finger
from .screenshot import Screenshot
from .swagger import Swagger
from .web_interface import WebInterface
from .ticker import Ticker


class ApiRunner(IODevice):
    """Run the Speculos API server in a dedicated thread, with a notification when it stops"""
    def __init__(self, api_port: int) -> None:
        self._api_wrapper: ApiWrapper
        # self.sock is used by Screen.add_notifier. Closing self._notify_exit
        # signals it that the API is no longer running.
        self.sock: socket.socket
        self._notify_exit: socket.socket
        self.sock, self._notify_exit = socket.socketpair()
        self._port: int = api_port
        self._api_thread: threading.Thread

    @property
    def file(self):
        return self.sock

    def can_read(self, screen: DisplayNotifier) -> None:
        # Being able to read from the socket only happens when the API server exited.
        raise ReadError("API server exited")

    def start_server_thread(self,
                            screen_: DisplayNotifier,
                            seph_: SeProxyHal,
                            automation_server: BroadcastInterface) -> None:
        self._api_wrapper = ApiWrapper(self._port, screen_, seph_, automation_server)
        self._api_thread = threading.Thread(target=self._api_wrapper.run, name="API-server", daemon=True)
        self._api_thread.start()

    def stop(self):
        self._notify_exit.close()


class ApiWrapper:
    def __init__(self,
                 api_port: int,
                 screen: DisplayNotifier,
                 seph: SeProxyHal,
                 automation_server: BroadcastInterface):
        self._port = api_port
        static_folder = str(resources.files(__package__) / "static")
        # Remove the Flask startup banner
        flask.cli.show_server_banner = lambda *a: None
        self._app = Flask(__name__, static_url_path="", static_folder=static_folder)
        self._app.env = "development"
        CORS(self._app, resources={r"*": {"origins": "*"}}, supports_credentials=True)

        screen_kwargs = {"screen": screen}
        seph_kwargs = {"seph": seph}
        app_kwargs = {"app": self._app}
        event_kwargs: Dict[str, Any] = {**app_kwargs, "automation_server": automation_server}

        self._api = Api(self._app)

        self._api.add_resource(APDU, "/apdu", resource_class_kwargs=seph_kwargs)
        self._api.add_resource(Automation, "/automation", resource_class_kwargs=seph_kwargs)
        self._api.add_resource(Button,
                               "/button/left",
                               "/button/right",
                               "/button/both",
                               resource_class_kwargs=seph_kwargs)
        self._api.add_resource(Events, "/events", resource_class_kwargs=event_kwargs)
        self._api.add_resource(Finger, "/finger", resource_class_kwargs=seph_kwargs)
        self._api.add_resource(Screenshot, "/screenshot", resource_class_kwargs=screen_kwargs)
        self._api.add_resource(Swagger, "/swagger/", resource_class_kwargs=app_kwargs)
        self._api.add_resource(WebInterface, "/", resource_class_kwargs=app_kwargs)
        self._api.add_resource(Ticker, "/ticker/", resource_class_kwargs=seph_kwargs)

    def run(self):
        # threaded must be set to allow serving requests along events streaming
        self._app.run(host="0.0.0.0", port=self._port, threaded=True, use_reloader=False)


================================================
FILE: speculos/api/automation.py
================================================
import json
import jsonschema
from flask import request

from ..mcu import automation as mcu_automation
from .restful import SephResource


class Automation(SephResource):
    def post(self):
        document = request.get_data()

        try:
            document = document.decode("ascii")
        except UnicodeDecodeError:
            return "invalid encoding", 400

        if document.startswith("file:"):
            return "invalid document", 400

        try:
            rules = mcu_automation.Automation(document)
        except json.decoder.JSONDecodeError:
            return "invalid document", 400
        except jsonschema.exceptions.ValidationError:
            return "invalid document", 400

        self.seph.automation = rules

        return {}, 200


================================================
FILE: speculos/api/button.py
================================================
import jsonschema
from flask import request

from speculos.resources_importer import get_resource_schema_as_json
from .restful import SephResource


class Button(SephResource):
    schema = get_resource_schema_as_json("api", "button.schema")

    def post(self):
        args = request.get_json(force=True)
        try:
            jsonschema.validate(instance=args, schema=self.schema)
        except jsonschema.exceptions.ValidationError as e:
            return {"error": f"{e}"}, 400

        button = request.base_url.split("/")[-1]
        buttons = {"left": [1], "right": [2], "both": [1, 2]}
        action = args["action"]
        delay = args.get("delay", 0.1)

        if action == "press-and-release":
            for b in buttons[button]:
                self.seph.handle_button(b, True)
            self.seph.handle_wait(delay)
            for b in buttons[button]:
                self.seph.handle_button(b, False)
            # Some app tests rely on this delay to make sure the screen is updated
            # and the app is ready to process next button press.
            # This is dangerous but we keep it as is to not break everything.
            self.seph.handle_wait(delay)
        else:
            for b in buttons[button]:
                self.seph.handle_button(b, action == "press")

        return {}, 200


================================================
FILE: speculos/api/events.py
================================================
import json
import logging
import threading
from typing import Dict, Generator, List, Optional, Tuple, Union
from dataclasses import asdict
from flask import stream_with_context, Response
from flask_restful import inputs, reqparse

from speculos.observer import BroadcastInterface, ObserverInterface, TextEvent
from .restful import AppResource


class EventsBroadcaster(BroadcastInterface):
    """This used to be the 'Automation Server'."""

    def __init__(self) -> None:
        super().__init__()
        self.screen_content: List[TextEvent] = []
        self.events: List[TextEvent] = []
        self.condition = threading.Condition()
        self.logger = logging.getLogger("events")

    def clear_events(self) -> None:
        self.logger.debug("Clearing events")
        self.screen_content = []

    def broadcast(self, event: TextEvent) -> None:
        if event.clear:
            self.clear_events()
            return

        self.logger.debug("events: broadcasting %s to %d client(s)", asdict(event), len(self.clients))
        self.screen_content.append(event)
        self.events.append(event)
        for client in self.clients:
            client.send_screen_event(event)
        with self.condition:
            self.condition.notify_all()


class EventClient(ObserverInterface):
    def __init__(self, broadcaster: EventsBroadcaster) -> None:
        self.events: List[TextEvent] = []
        self._broadcaster = broadcaster

    def generate(self) -> Generator[bytes, None, None]:
        try:
            # force headers to be sent
            yield b""

            while True:
                with self._broadcaster.condition:
                    self._broadcaster.condition.wait(1)

                while self.events:
                    event = self.events.pop(0)
                    data = json.dumps(asdict(event))
                    # Format the event as specified in the specification:
                    # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
                    yield f"data: {data}\n\n".encode()
        finally:
            self._broadcaster.remove_client(self)

    def send_screen_event(self, event: TextEvent) -> None:
        self.events.append(event)


class Events(AppResource):
    def __init__(self, *args, automation_server: Optional[EventsBroadcaster] = None, **kwargs) -> None:
        if automation_server is None:
            raise RuntimeError("Argument 'automation_server' must not be None")
        self._broadcaster = automation_server
        self.parser = reqparse.RequestParser()
        self.parser.add_argument("stream", type=inputs.boolean, default=False, location='values')
        self.parser.add_argument("currentscreenonly", type=inputs.boolean, default=False, location='values')
        super().__init__(*args, **kwargs)

    def get(self) -> Union[Response, Tuple[Dict[str, List], int]]:
        args = self.parser.parse_args()
        if args.stream:
            client = EventClient(self._broadcaster)
            self._broadcaster.add_client(client)
            return Response(stream_with_context(client.generate()), content_type="text/event-stream")
        elif args.currentscreenonly:
            event_list = self._broadcaster.screen_content
        else:
            event_list = self._broadcaster.events
        return {"events": [asdict(e) for e in event_list]}, 200

    def delete(self) -> Tuple[Dict, int]:
        self._broadcaster.events.clear()
        return {}, 200


================================================
FILE: speculos/api/finger.py
================================================
import jsonschema
from flask import request

from speculos.resources_importer import get_resource_schema_as_json
from .restful import SephResource


class Finger(SephResource):
    schema = get_resource_schema_as_json("api", "finger.schema")

    def post(self):
        args = request.get_json(force=True)
        try:
            jsonschema.validate(instance=args, schema=self.schema)
        except jsonschema.exceptions.ValidationError as e:
            return {"error": f"{e}"}, 400

        action = args["action"]
        delay = args.get("delay", 0.1)

        x1, y1 = args["x"], args["y"]
        if action == "press-and-release":
            self.seph.handle_finger(x1, y1, True)
            self.seph.handle_wait(delay)
            x2, y2 = args.get("x2", x1), args.get("y2", y1)
            self.seph.handle_finger(x2, y2, False)
        else:
            self.seph.handle_finger(x1, y1, action == "press")

        return {}, 200


================================================
FILE: speculos/api/resources/apdu.schema
================================================
{
    "$schema": "http://json-schema.org/draft-07/schema#",

    "type": "object",
    "properties": {
        "data": { "type": "string", "pattern": "^([a-fA-F0-9]{2})+$" },
        "tick_timeout": { "type": "number"}
    },
    "required": [ "data" ],
    "additionalProperties": false
}


================================================
FILE: speculos/api/resources/button.schema
================================================
{
    "$schema": "http://json-schema.org/draft-07/schema#",

    "type": "object",
    "properties": {
        "action": { "enum": [ "press", "release", "press-and-release" ] },
        "delay": { "type": "number" }
    },
    "required": [ "action" ],
    "additionalProperties": false
}


================================================
FILE: speculos/api/resources/finger.schema
================================================
{
    "$schema": "http://json-schema.org/draft-07/schema#",

    "type": "object",
    "properties": {
        "x": { "type": "integer", "minimum": 0 },
        "y": { "type": "integer", "minimum": 0 },
        "x2": { "type": "integer", "minimum": 0 },
        "y2": { "type": "integer", "minimum": 0 },
        "action": { "enum": [ "press", "release", "press-and-release" ] },
        "delay": { "type": "number" }
    },
    "required": [ "action", "x", "y" ],
    "additionalProperties": false
}


================================================
FILE: speculos/api/resources/ticker.schema
================================================
{
    "$schema": "http://json-schema.org/draft-07/schema#",

    "type": "object",
    "properties": {
        "action": { "enum": [ "pause", "resume", "single-step"] }
    },
    "required": [ "action" ],
    "additionalProperties": false
}


================================================
FILE: speculos/api/restful.py
================================================
from flask import Flask
from typing import Optional
from flask_restful import Resource

from ..mcu.seproxyhal import SeProxyHal


class SephResource(Resource):
    def __init__(self, *args, seph: Optional[SeProxyHal] = None, **kwargs):
        if seph is None:
            raise RuntimeError("Argument 'seph' must not be None")
        super().__init__(*args, **kwargs)
        self._seph = seph

    @property
    def seph(self):
        return self._seph


class AppResource(Resource):
    def __init__(self, *args, app: Optional[Flask] = None, **kwargs):
        if app is None:
            raise RuntimeError("Argument 'app' must not be None")
        super().__init__(*args, **kwargs)
        self._app = app

    @property
    def app(self):
        return self._app


class ScreenResource(Resource):
    def __init__(self, *args, screen=None, **kwargs):
        if screen is None:
            raise RuntimeError("Argument 'screen' must not be None")
        super().__init__(*args, **kwargs)
        self._screen = screen

    @property
    def screen(self):
        return self._screen


================================================
FILE: speculos/api/screenshot.py
================================================
from flask import Response

from .restful import ScreenResource


class Screenshot(ScreenResource):
    def get(self):
        iobytes_value = self.screen.display.m.get_public_screenshot()
        response = Response(iobytes_value, mimetype="image/png")
        response.headers.add("Cache-control", "no-cache,no-store")
        return response


================================================
FILE: speculos/api/static/index.html
================================================
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Speculos Web Interface</title>
    <link rel="icon" type="image/png" sizes="225x225" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAgVBMVEUQJTT///8AAB7Lzc+PlZoAEyciM0EAFyp8gofR09UAHS4MIzIAAA4AESYAGCoAABMAABlFUFr4+fkABCCytrm8v8IACiIAABfq6+zEx8qhpqqBh41nbnUwP0tweH5ianGrr7MXKznd3+A+SlRQWmPi5OUsOkaUmZ4AAAUAAADw8PFvU0lGAAAEn0lEQVR4nO3da3OiMBSH8QNUbROugrTipdZa7fL9P+BirfVGhGRGzGn/z9udk+E3YGyH7C45V3oZF5NpMuufR5trU1WeuJi5TbNkOim88tq1kOoPhqN5L0qDgZCX9R6ahG7N1G0SYZBGcj7SFY5f/TyUpKiFUDV6m2SYRlNPQ7h4i8W1Ba0TbgvjftZSmMlUefd2WSms7qT7VvOwXgiXM7fBZ62wMsbJR5Pwwb/6fO6yVkgkouKqsHxP2yxjsZDIXQ3VwmWvxQ0ky4UUypMn9Vg4jho/gbvsFlY7zlO9MPNbAm0XkoyOvhsPwrHfegXbhRXxcBd/hE9tH1FiIKwe1J/P4l5YBu2BDIQk5X5H3Qvf2+2iuxgIKVydCh9ynWkOQnKLY+Gy/S6zjYWQoo8j4VrnGeUiFMlBuNC8IB5Cikc/wp7GPrqNiVC+7YWF1jZDbITkZt9CoXkL2QhlfyccaV8OFyHF3pdwpbeREiNhON0KS73vwm1shBRthQvdfYaTMB1Vwlfth5SRMJxXwmf9OT5CKR1axvpzfIQUlTTS/xhyEqYebQb6Y4yEQUFz/Y2GkzCc0Er3RzZiJRRTWv9uoUyMxjgJZ0ZjnIR9ozEIIewwCBVBCGGHQagIQgg7DEJFEELYYX9CODAoZiV8NKn2MK6twoZrNQvC7oIQQgjvH4QQQnj/IIQQwvsHIYQQ3j8IIYTw/kEIIYT3D0IIIbx/f0L4ZNLFPwJjs9A16HPCSWgSr/f4JkEIYYdBqAhCCDsMQkUQQthhECqCEMIOg1ARhBB2GISKIISwwyBUBCGEHQahIggh7DAIFUEIYYdBqAhCCDsMQkUQQthhECqCEMIOg1ARhHYJjc55Nwr/mSx7kwR5JjWd1S+NVr1Nt/n7FjYFIf8g5B+E/IOQfxDyD0L+Qcg/CPkHIf8g5B+E/IOQfxDyD0L+Qcg/ejBp3LDqh8mik6a3kpnJqhvqGfTc+A7402DVz6eGVR9jg1XNXo7f5j2+2yg0+I/urTqpACGEtUGoCEII64MQwtogVAQhhPVBCGFtf0IoDa6Fk3BGawMiJ2FCye8WiinNhf4YI+FgQhuDMUbCoKAs1x9jJEzHtIz1xxgJoxdyIv0xPkLZc8hZ6W81fIThvBIuAu05PsJ8VAlLX3uOj9Afbt+uJdqPKRuheP16f5iluoNshPF494Y00P3BjYtQvjk74UZ3r+EiTBffwmGueROZCKVwvoVOofmTGxOhm/0Inb7eTeQhFDPnIPT0vhN5CP3lkdB51NpsWAjT74vcn6dZ63ztcxCKd+dU+OJqfBQZCGWvPBNqfRTtF8pouZ86nPrK2hPtF/qHU1tH59oWrYm2C6WfHaaOT+5lfsvPouVCGR2fuzs5m+i57XZUu4UiOFno9PTly7rV96LVwvy9PJk6P1/62OZJtVgo/PNruzhB6/Wbf9OwVijd9fJ8quaMcJE3/UpsqVDmvcXlVN0p6OEmSK9uOVYKhSuKuinFOe8s8QM10j6hyP3VqH5KeZK9XKyiOB8IWfPEWiSUUgzy+Pl1Uaqmrp7VX2abeVLzCtUi4Xo134wudpfj/gO/lI+IYqIlLwAAAABJRU5ErkJggg==" />
    <style>
body {
  display: block;
  background-color: #eee;
}

body.dark-mode {
  background-color: #121212;
  color: #00fffb;
}

.main {
  /* center to the middle of the screen */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 95vh;
}

.device {
  text-align: center;
  vertical-align: middle;
  display: block;
}

.infos {
  display: block;
  text-align: center;
  margin-bottom: 2.5em;
}

.container-textarea {
  display: inline-block;
  padding: 10px;
}

textarea, input {
  background-color: #fff;
  border-radius: 4px;
  border-color: #888;
  color: inherit;
}

body.dark-mode input {
  background-color: #222;
}

body.dark-mode textarea {
  background-color: #222;
}

.container-device {
  display: inline-block;
}

.screenshot {
  background-color: #111;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 20px;
  padding-right: 20px;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.button-device {
  background-color: #41ccb4;
  color: #fff;
  font-weight: bold;
  border-color: #41ccb4;
  border-radius: 4px;
  padding-top: 5px;
  padding-right: 10px;
  padding-bottom: 5px;
  padding-left: 10px;
}

body.dark-mode .button-device {
  background-color: #00fffb;
  color: black;
}

a {
  color: #41ccb4;
  font-weight: bold;
}

body.dark-mode a {
  color: inherit;
}

.buttons {
  padding-top: 10px;
}

.send-apdu {
  text-align: left;
  width: 100%;
  padding-top: 10px;
  padding-bottom: 10px;
  display: flex;
}

.button-send {
}

body.dark-mode .button-send {
  background-color: #00fffb;
  color: black;
  font-weight: bold;
  border-color: #41ccb4;
  border-radius: 4px;
}

.input-apdu-container {
  display: inline-block;
  flex-grow: 1;
  padding-right: 5px;
}

.input-apdu {
  min-width: 100%;
  max-width: 100%;
}

.button-apdu {
  display: inline-block;
  padding-left: 5px;
  float: right;
}

.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #fff;
  border-top: solid 1px #888;
}

body.dark-mode .footer {
  background-color: #121212;
}
    </style>
    <script>
"use strict";

function post_request(url, data, callback) {
  var http = new XMLHttpRequest();
  http.open("POST", url, true);
  http.setRequestHeader("Content-type", "application/json");
  http.onreadystatechange = function() {
    if (http.readyState == 4 && http.status == 200 && callback !== null) {
      callback(http);
    }
  }
  http.send(JSON.stringify(data));
}

function click_button(button) {
  post_request("/button/" + button, {"action": "press-and-release"}, null);
}

function add_apdu(data, received) {
  var element = document.getElementById("apdus");
  element.value += (received ? "<" : ">") + " " + data + "\n";
  element.scrollTop = element.scrollHeight;
}

function send_apdu() {
  var element = document.getElementById("apdu");
  var apdu = element.value.replace(" ", "");
  if (apdu == "") {
    return;
  }
  add_apdu(apdu, true);
  post_request("/apdu", {"data": apdu}, function (http) {
    var data = JSON.parse(http.responseText)["data"];
    add_apdu(data, false);
  });
  // Clear the command which was sent, to prevent from accidentally sending it twice.
  // Users who want to send the same command several times can copy it again from the "APDUs" text area.
  element.value = "";
}

function refresh_screen() {
  var element = document.getElementById("screenshot");
  /* 
   * A new event might be received while the current request to /screenshot
   * isn't finished. The browser doesn't make a new request and the resulting
   * screenshot is outdated. Appending Date.now() forces the browser to cancel
   * the current request and make a new one.
   */
  element.src = "/screenshot?force=" + Date.now();
}

function stream_events() {
  var source = new EventSource('/events?stream=true');
  var element = document.getElementById("events");
  source.onmessage = function (event) {
    refresh_screen();
    element.value += event.data + "\n";
    element.scrollTop = element.scrollHeight;
  };
}

function on_keydown(e) {
  e = e || window.event;
  if (document.activeElement.id == "apdu") {
    if (e.code == "Enter" || e.keyCode == 13) {
      send_apdu();
    }
  } else {
    // Only send buttons when the APDU input does not have the focus
    if (e.code == "ArrowDown" || e.keyCode == 40) {
      click_button("both");
    } else if (e.code == "ArrowLeft" || e.keyCode == 37) {
      click_button("left");
    } else if (e.code == "ArrowRight" || e.keyCode == 39) {
      click_button("right");
    } else if (e.code == "KeyD" || e.keyCode == 68) {
      document.body.classList.toggle("dark-mode");
    }
  }
}

function zoom_screenshot() {
  var element = document.getElementById("screenshot");
  element.width = element.naturalWidth * 2;
  element.height = element.naturalHeight * 2;
}

function main() {
  zoom_screenshot();
  refresh_screen();
  stream_events();
  document.onkeydown = on_keydown;
}
    </script>
  </head>
  <body onLoad="main();">
    <div class="main">
      <div class="device">
        <div class="container-device">
          <div>
            <img src="/screenshot" id="screenshot" class="screenshot" alt="Device screen" title="Device screen" />
          </div>
          <div class="buttons">
            <button type="button" class="button-device" onClick="click_button('left');" title="Press the left button (&larr;)">&lt;&nbsp;left</button>
            <button type="button" class="button-device" onClick="click_button('both');" title="Press both buttons (&darr;)">both</button>
            <button type="button" class="button-device" onClick="click_button('right');" title="Press the right button (&rarr;)">right&nbsp;&gt;</button>
          </div>
        </div>
      </div>
      <div class="infos">
        <div class="container-textarea">
          <div class="send-apdu">
            <div class="input-apdu-container">
              <input type="text" class="input-apdu" placeholder="APDU (in hexadecimal)" id="apdu" title="Input data sent to the application" />
            </div>
            <div class="button-apdu">
              <button type="button" class="button-send" onClick="send_apdu();">send</button>
            </div>
          </div>
          <div>
            <textarea id="apdus" readonly rows="20" cols="50" title="Data exchanged with the application"></textarea>
            <p>APDUs</p>
          </div>
        </div>
        <div class="container-textarea">
          <textarea id="events" readonly rows="20" cols="50" title="Events received from the virtual device"></textarea>
          <p>Events</p>
        </div>
      </div>
      <div class="footer">
        <p>
Speculos (<a href="https://ledgerhq.github.io/speculos">documentation</a>, <a href="/swagger/">API</a>) is open source, please contribute on <a href="https://github.com/LedgerHQ/speculos">GitHub</a>.
        </p>
      </div>
    </div>
  </body>
</html>


================================================
FILE: speculos/api/static/swagger/README.md
================================================
This directory is automatically generated using instructions from ../../README.md.


================================================
FILE: speculos/api/static/swagger/index.html
================================================

<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Swagger UI</title>
    <link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
    <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
    <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
    <style>
      html
      {
        box-sizing: border-box;
        overflow: -moz-scrollbars-vertical;
        overflow-y: scroll;
      }

      *,
      *:before,
      *:after
      {
        box-sizing: inherit;
      }

      body
      {
        margin:0;
        background: #fafafa;
      }
    </style>
  </head>

  <body>
    <div id="swagger-ui"></div>

    <script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
    <script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
    <script>
    window.onload = function() {
      
      // Begin Swagger UI call region
      const ui = SwaggerUIBundle({
        url: "./swagger.json",
        "dom_id": "#swagger-ui",
        deepLinking: true,
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIStandalonePreset
        ],
        plugins: [
          SwaggerUIBundle.plugins.DownloadUrl
        ],
        layout: "StandaloneLayout",
      })
      
      
      // End Swagger UI call region


      window.ui = ui;
    };
  </script>
  </body>
</html>


================================================
FILE: speculos/api/static/swagger/swagger-ui-bundle.js
================================================
/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("esprima")}catch(e){}}()):"function"==typeof define&&define.amd?define(["esprima"],t):"object"==typeof exports?exports.SwaggerUIBundle=t(function(){try{return require("esprima")}catch(e){}}()):e.SwaggerUIBundle=t(e.esprima)}(this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=555)}([function(e,t,n){"use strict";e.exports=n(131)},function(e,t,n){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function n(e){return i(e)?e:J(e)}function r(e){return s(e)?e:K(e)}function o(e){return u(e)?e:Y(e)}function a(e){return i(e)&&!c(e)?e:G(e)}function i(e){return!(!e||!e[p])}function s(e){return!(!e||!e[f])}function u(e){return!(!e||!e[h])}function c(e){return s(e)||u(e)}function l(e){return!(!e||!e[d])}t(r,n),t(o,n),t(a,n),n.isIterable=i,n.isKeyed=s,n.isIndexed=u,n.isAssociative=c,n.isOrdered=l,n.Keyed=r,n.Indexed=o,n.Set=a;var p="@@__IMMUTABLE_ITERABLE__@@",f="@@__IMMUTABLE_KEYED__@@",h="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m="delete",v=5,g=1<<v,y=g-1,b={},_={value:!1},x={value:!1};function w(e){return e.value=!1,e}function E(e){e&&(e.value=!0)}function S(){}function C(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o=0;o<n;o++)r[o]=e[o+t];return r}function A(e){return void 0===e.size&&(e.size=e.__iterate(k)),e.size}function O(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?A(e)+t:t}function k(){return!0}function j(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function T(e,t){return P(e,t,0)}function I(e,t){return P(e,t,t)}function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var N=0,M=1,R=2,D="function"==typeof Symbol&&Symbol.iterator,L="@@iterator",B=D||L;function F(e){this.next=e}function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function z(e){return!!H(e)}function V(e){return e&&"function"==typeof e.next}function W(e){var t=H(e);return t&&t.call(e)}function H(e){var t=e&&(D&&e[D]||e[L]);if("function"==typeof t)return t}function $(e){return e&&"number"==typeof e.length}function J(e){return null==e?ie():i(e)?e.toSeq():ce(e)}function K(e){return null==e?ie().toKeyedSeq():i(e)?s(e)?e.toSeq():e.fromEntrySeq():se(e)}function Y(e){return null==e?ie():i(e)?s(e)?e.entrySeq():e.toIndexedSeq():ue(e)}function G(e){return(null==e?ie():i(e)?s(e)?e.entrySeq():e:ue(e)).toSetSeq()}F.prototype.toString=function(){return"[Iterator]"},F.KEYS=N,F.VALUES=M,F.ENTRIES=R,F.prototype.inspect=F.prototype.toSource=function(){return this.toString()},F.prototype[B]=function(){return this},t(J,n),J.of=function(){return J(arguments)},J.prototype.toSeq=function(){return this},J.prototype.toString=function(){return this.__toString("Seq {","}")},J.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},J.prototype.__iterate=function(e,t){return pe(this,e,t,!0)},J.prototype.__iterator=function(e,t){return fe(this,e,t,!0)},t(K,J),K.prototype.toKeyedSeq=function(){return this},t(Y,J),Y.of=function(){return Y(arguments)},Y.prototype.toIndexedSeq=function(){return this},Y.prototype.toString=function(){return this.__toString("Seq [","]")},Y.prototype.__iterate=function(e,t){return pe(this,e,t,!1)},Y.prototype.__iterator=function(e,t){return fe(this,e,t,!1)},t(G,J),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},J.isSeq=ae,J.Keyed=K,J.Set=G,J.Indexed=Y;var Z,X,Q,ee="@@__IMMUTABLE_SEQ__@@";function te(e){this._array=e,this.size=e.length}function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function re(e){this._iterable=e,this.size=e.length||e.size}function oe(e){this._iterator=e,this._iteratorCache=[]}function ae(e){return!(!e||!e[ee])}function ie(){return Z||(Z=new te([]))}function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new oe(e).fromEntrySeq():z(e)?new re(e).fromEntrySeq():"object"==typeof e?new ne(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function ue(e){var t=le(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ce(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function le(e){return $(e)?new te(e):V(e)?new oe(e):z(e)?new re(e):void 0}function pe(e,t,n,r){var o=e._cache;if(o){for(var a=o.length-1,i=0;i<=a;i++){var s=o[n?a-i:i];if(!1===t(s[1],r?s[0]:i,e))return i+1}return i}return e.__iterateUncached(t,n)}function fe(e,t,n,r){var o=e._cache;if(o){var a=o.length-1,i=0;return new F((function(){var e=o[n?a-i:i];return i++>a?q():U(t,r?e[0]:i-1,e[1])}))}return e.__iteratorUncached(t,n)}function he(e,t){return t?de(t,e,"",{"":e}):me(e)}function de(e,t,n,r){return Array.isArray(t)?e.call(r,n,Y(t).map((function(n,r){return de(e,n,r,t)}))):ve(t)?e.call(r,n,K(t).map((function(n,r){return de(e,n,r,t)}))):t}function me(e){return Array.isArray(e)?Y(e).map(me).toList():ve(e)?K(e).map(me).toMap():e}function ve(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ge(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function ye(e,t){if(e===t)return!0;if(!i(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||u(e)!==u(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!c(e);if(l(e)){var r=e.entries();return t.every((function(e,t){var o=r.next().value;return o&&ge(o[1],e)&&(n||ge(o[0],t))}))&&r.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var a=e;e=t,t=a}var p=!0,f=t.__iterate((function(t,r){if(n?!e.has(t):o?!ge(t,e.get(r,b)):!ge(e.get(r,b),t))return p=!1,!1}));return p&&e.size===f}function be(e,t){if(!(this instanceof be))return new be(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(X)return X;X=this}}function _e(e,t){if(!e)throw new Error(t)}function xe(e,t,n){if(!(this instanceof xe))return new xe(e,t,n);if(_e(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t<e&&(n=-n),this._start=e,this._end=t,this._step=n,this.size=Math.max(0,Math.ceil((t-e)/n-1)+1),0===this.size){if(Q)return Q;Q=this}}function we(){throw TypeError("Abstract")}function Ee(){}function Se(){}function Ce(){}J.prototype[ee]=!0,t(te,Y),te.prototype.get=function(e,t){return this.has(e)?this._array[O(this,e)]:t},te.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length-1,o=0;o<=r;o++)if(!1===e(n[t?r-o:o],o,this))return o+1;return o},te.prototype.__iterator=function(e,t){var n=this._array,r=n.length-1,o=0;return new F((function(){return o>r?q():U(e,o,n[t?r-o++:o++])}))},t(ne,K),ne.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},ne.prototype.has=function(e){return this._object.hasOwnProperty(e)},ne.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length-1,a=0;a<=o;a++){var i=r[t?o-a:a];if(!1===e(n[i],i,this))return a+1}return a},ne.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length-1,a=0;return new F((function(){var i=r[t?o-a:a];return a++>o?q():U(e,i,n[i])}))},ne.prototype[d]=!0,t(re,Y),re.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=W(this._iterable),r=0;if(V(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},re.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=W(this._iterable);if(!V(n))return new F(q);var r=0;return new F((function(){var t=n.next();return t.done?t:U(e,r++,t.value)}))},t(oe,Y),oe.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n,r=this._iterator,o=this._iteratorCache,a=0;a<o.length;)if(!1===e(o[a],a++,this))return a;for(;!(n=r.next()).done;){var i=n.value;if(o[a]=i,!1===e(i,a++,this))break}return a},oe.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterator,r=this._iteratorCache,o=0;return new F((function(){if(o>=r.length){var t=n.next();if(t.done)return t;r[o]=t.value}return U(e,o,r[o++])}))},t(be,Y),be.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},be.prototype.get=function(e,t){return this.has(e)?this._value:t},be.prototype.includes=function(e){return ge(this._value,e)},be.prototype.slice=function(e,t){var n=this.size;return j(e,t,n)?this:new be(this._value,I(t,n)-T(e,n))},be.prototype.reverse=function(){return this},be.prototype.indexOf=function(e){return ge(this._value,e)?0:-1},be.prototype.lastIndexOf=function(e){return ge(this._value,e)?this.size:-1},be.prototype.__iterate=function(e,t){for(var n=0;n<this.size;n++)if(!1===e(this._value,n,this))return n+1;return n},be.prototype.__iterator=function(e,t){var n=this,r=0;return new F((function(){return r<n.size?U(e,r++,n._value):q()}))},be.prototype.equals=function(e){return e instanceof be?ge(this._value,e._value):ye(e)},t(xe,Y),xe.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},xe.prototype.get=function(e,t){return this.has(e)?this._start+O(this,e)*this._step:t},xe.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},xe.prototype.slice=function(e,t){return j(e,t,this.size)?this:(e=T(e,this.size),(t=I(t,this.size))<=e?new xe(0,0):new xe(this.get(e,this._end),this.get(t,this._end),this._step))},xe.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var n=t/this._step;if(n>=0&&n<this.size)return n}return-1},xe.prototype.lastIndexOf=function(e){return this.indexOf(e)},xe.prototype.__iterate=function(e,t){for(var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,a=0;a<=n;a++){if(!1===e(o,a,this))return a+1;o+=t?-r:r}return a},xe.prototype.__iterator=function(e,t){var n=this.size-1,r=this._step,o=t?this._start+n*r:this._start,a=0;return new F((function(){var i=o;return o+=t?-r:r,a>n?q():U(e,a++,i)}))},xe.prototype.equals=function(e){return e instanceof xe?this._start===e._start&&this._end===e._end&&this._step===e._step:ye(this,e)},t(we,n),t(Ee,we),t(Se,we),t(Ce,we),we.Keyed=Ee,we.Indexed=Se,we.Set=Ce;var Ae="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function Oe(e){return e>>>1&1073741824|3221225471&e}function ke(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)n^=e/=4294967295;return Oe(n)}if("string"===t)return e.length>Fe?je(e):Te(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return Ie(e);if("function"==typeof e.toString)return Te(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function je(e){var t=ze[e];return void 0===t&&(t=Te(e),qe===Ue&&(qe=0,ze={}),qe++,ze[e]=t),t}function Te(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Oe(t)}function Ie(e){var t;if(De&&void 0!==(t=Re.get(e)))return t;if(void 0!==(t=e[Be]))return t;if(!Ne){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Be]))return t;if(void 0!==(t=Me(e)))return t}if(t=++Le,1073741824&Le&&(Le=0),De)Re.set(e,t);else{if(void 0!==Pe&&!1===Pe(e))throw new Error("Non-extensible objects are not allowed as keys.");if(Ne)Object.defineProperty(e,Be,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Be]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Be]=t}}return t}var Pe=Object.isExtensible,Ne=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();function Me(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}var Re,De="function"==typeof WeakMap;De&&(Re=new WeakMap);var Le=0,Be="__immutablehash__";"function"==typeof Symbol&&(Be=Symbol(Be));var Fe=16,Ue=255,qe=0,ze={};function Ve(e){_e(e!==1/0,"Cannot perform this action with an infinite size.")}function We(e){return null==e?ot():He(e)&&!l(e)?e:ot().withMutations((function(t){var n=r(e);Ve(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}function He(e){return!(!e||!e[Je])}t(We,Ee),We.of=function(){var t=e.call(arguments,0);return ot().withMutations((function(e){for(var n=0;n<t.length;n+=2){if(n+1>=t.length)throw new Error("Missing value for key: "+t[n]);e.set(t[n],t[n+1])}}))},We.prototype.toString=function(){return this.__toString("Map {","}")},We.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},We.prototype.set=function(e,t){return at(this,e,t)},We.prototype.setIn=function(e,t){return this.updateIn(e,b,(function(){return t}))},We.prototype.remove=function(e){return at(this,e,b)},We.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return b}))},We.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},We.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=vt(this,wn(e),t,n);return r===b?void 0:r},We.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):ot()},We.prototype.merge=function(){return ft(this,void 0,arguments)},We.prototype.mergeWith=function(t){return ft(this,t,e.call(arguments,1))},We.prototype.mergeIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,ot(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,n):n[n.length-1]}))},We.prototype.mergeDeep=function(){return ft(this,ht,arguments)},We.prototype.mergeDeepWith=function(t){var n=e.call(arguments,1);return ft(this,dt(t),n)},We.prototype.mergeDeepIn=function(t){var n=e.call(arguments,1);return this.updateIn(t,ot(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,n):n[n.length-1]}))},We.prototype.sort=function(e){return zt(pn(this,e))},We.prototype.sortBy=function(e,t){return zt(pn(this,t,e))},We.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},We.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new S)},We.prototype.asImmutable=function(){return this.__ensureOwner()},We.prototype.wasAltered=function(){return this.__altered},We.prototype.__iterator=function(e,t){return new et(this,e,t)},We.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},We.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?rt(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},We.isMap=He;var $e,Je="@@__IMMUTABLE_MAP__@@",Ke=We.prototype;function Ye(e,t){this.ownerID=e,this.entries=t}function Ge(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function Ze(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function Xe(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function Qe(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function et(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&nt(e._root)}function tt(e,t){return U(e,t[0],t[1])}function nt(e,t){return{node:e,index:0,__prev:t}}function rt(e,t,n,r){var o=Object.create(Ke);return o.size=e,o._root=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function ot(){return $e||($e=rt(0))}function at(e,t,n){var r,o;if(e._root){var a=w(_),i=w(x);if(r=it(e._root,e.__ownerID,0,void 0,t,n,a,i),!i.value)return e;o=e.size+(a.value?n===b?-1:1:0)}else{if(n===b)return e;o=1,r=new Ye(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=o,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?rt(o,r):ot()}function it(e,t,n,r,o,a,i,s){return e?e.update(t,n,r,o,a,i,s):a===b?e:(E(s),E(i),new Qe(t,r,[o,a]))}function st(e){return e.constructor===Qe||e.constructor===Xe}function ut(e,t,n,r,o){if(e.keyHash===r)return new Xe(t,r,[e.entry,o]);var a,i=(0===n?e.keyHash:e.keyHash>>>n)&y,s=(0===n?r:r>>>n)&y;return new Ge(t,1<<i|1<<s,i===s?[ut(e,t,n+v,r,o)]:(a=new Qe(t,r,o),i<s?[e,a]:[a,e]))}function ct(e,t,n,r){e||(e=new S);for(var o=new Qe(e,ke(n),[n,r]),a=0;a<t.length;a++){var i=t[a];o=o.update(e,0,void 0,i[0],i[1])}return o}function lt(e,t,n,r){for(var o=0,a=0,i=new Array(n),s=0,u=1,c=t.length;s<c;s++,u<<=1){var l=t[s];void 0!==l&&s!==r&&(o|=u,i[a++]=l)}return new Ge(e,o,i)}function pt(e,t,n,r,o){for(var a=0,i=new Array(g),s=0;0!==n;s++,n>>>=1)i[s]=1&n?t[a++]:void 0;return i[r]=o,new Ze(e,a+1,i)}function ft(e,t,n){for(var o=[],a=0;a<n.length;a++){var s=n[a],u=r(s);i(s)||(u=u.map((function(e){return he(e)}))),o.push(u)}return mt(e,t,o)}function ht(e,t,n){return e&&e.mergeDeep&&i(t)?e.mergeDeep(t):ge(e,t)?e:t}function dt(e){return function(t,n,r){if(t&&t.mergeDeepWith&&i(n))return t.mergeDeepWith(e,n);var o=e(t,n,r);return ge(t,o)?t:o}}function mt(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var r=t?function(n,r){e.update(r,b,(function(e){return e===b?n:t(e,n,r)}))}:function(t,n){e.set(n,t)},o=0;o<n.length;o++)n[o].forEach(r)})):e.constructor(n[0])}function vt(e,t,n,r){var o=e===b,a=t.next();if(a.done){var i=o?n:e,s=r(i);return s===i?e:s}_e(o||e&&e.set,"invalid keyPath");var u=a.value,c=o?b:e.get(u,b),l=vt(c,t,n,r);return l===c?e:l===b?e.remove(u):(o?ot():e).set(u,l)}function gt(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function yt(e,t,n,r){var o=r?e:C(e);return o[t]=n,o}function bt(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(var a=new Array(o),i=0,s=0;s<o;s++)s===t?(a[s]=n,i=-1):a[s]=e[s+i];return a}function _t(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),a=0,i=0;i<r;i++)i===t&&(a=1),o[i]=e[i+a];return o}Ke[Je]=!0,Ke[m]=Ke.remove,Ke.removeIn=Ke.deleteIn,Ye.prototype.get=function(e,t,n,r){for(var o=this.entries,a=0,i=o.length;a<i;a++)if(ge(n,o[a][0]))return o[a][1];return r},Ye.prototype.update=function(e,t,n,r,o,a,i){for(var s=o===b,u=this.entries,c=0,l=u.length;c<l&&!ge(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(E(i),(s||!p)&&E(a),!s||1!==u.length){if(!p&&!s&&u.length>=xt)return ct(e,u,r,o);var f=e&&e===this.ownerID,h=f?u:C(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Ye(e,h)}},Ge.prototype.get=function(e,t,n,r){void 0===t&&(t=ke(n));var o=1<<((0===e?t:t>>>e)&y),a=this.bitmap;return 0==(a&o)?r:this.nodes[gt(a&o-1)].get(e+v,t,n,r)},Ge.prototype.update=function(e,t,n,r,o,a,i){void 0===n&&(n=ke(r));var s=(0===t?n:n>>>t)&y,u=1<<s,c=this.bitmap,l=0!=(c&u);if(!l&&o===b)return this;var p=gt(c&u-1),f=this.nodes,h=l?f[p]:void 0,d=it(h,e,t+v,n,r,o,a,i);if(d===h)return this;if(!l&&d&&f.length>=wt)return pt(e,f,c,s,d);if(l&&!d&&2===f.length&&st(f[1^p]))return f[1^p];if(l&&d&&1===f.length&&st(d))return d;var m=e&&e===this.ownerID,g=l?d?c:c^u:c|u,_=l?d?yt(f,p,d,m):_t(f,p,m):bt(f,p,d,m);return m?(this.bitmap=g,this.nodes=_,this):new Ge(e,g,_)},Ze.prototype.get=function(e,t,n,r){void 0===t&&(t=ke(n));var o=(0===e?t:t>>>e)&y,a=this.nodes[o];return a?a.get(e+v,t,n,r):r},Ze.prototype.update=function(e,t,n,r,o,a,i){void 0===n&&(n=ke(r));var s=(0===t?n:n>>>t)&y,u=o===b,c=this.nodes,l=c[s];if(u&&!l)return this;var p=it(l,e,t+v,n,r,o,a,i);if(p===l)return this;var f=this.count;if(l){if(!p&&--f<Et)return lt(e,c,f,s)}else f++;var h=e&&e===this.ownerID,d=yt(c,s,p,h);return h?(this.count=f,this.nodes=d,this):new Ze(e,f,d)},Xe.prototype.get=function(e,t,n,r){for(var o=this.entries,a=0,i=o.length;a<i;a++)if(ge(n,o[a][0]))return o[a][1];return r},Xe.prototype.update=function(e,t,n,r,o,a,i){void 0===n&&(n=ke(r));var s=o===b;if(n!==this.keyHash)return s?this:(E(i),E(a),ut(this,e,t,n,[r,o]));for(var u=this.entries,c=0,l=u.length;c<l&&!ge(r,u[c][0]);c++);var p=c<l;if(p?u[c][1]===o:s)return this;if(E(i),(s||!p)&&E(a),s&&2===l)return new Qe(e,this.keyHash,u[1^c]);var f=e&&e===this.ownerID,h=f?u:C(u);return p?s?c===l-1?h.pop():h[c]=h.pop():h[c]=[r,o]:h.push([r,o]),f?(this.entries=h,this):new Xe(e,this.keyHash,h)},Qe.prototype.get=function(e,t,n,r){return ge(n,this.entry[0])?this.entry[1]:r},Qe.prototype.update=function(e,t,n,r,o,a,i){var s=o===b,u=ge(r,this.entry[0]);return(u?o===this.entry[1]:s)?this:(E(i),s?void E(a):u?e&&e===this.ownerID?(this.entry[1]=o,this):new Qe(e,this.keyHash,[r,o]):(E(a),ut(this,e,t,ke(r),[r,o])))},Ye.prototype.iterate=Xe.prototype.iterate=function(e,t){for(var n=this.entries,r=0,o=n.length-1;r<=o;r++)if(!1===e(n[t?o-r:r]))return!1},Ge.prototype.iterate=Ze.prototype.iterate=function(e,t){for(var n=this.nodes,r=0,o=n.length-1;r<=o;r++){var a=n[t?o-r:r];if(a&&!1===a.iterate(e,t))return!1}},Qe.prototype.iterate=function(e,t){return e(this.entry)},t(et,F),et.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var n,r=t.node,o=t.index++;if(r.entry){if(0===o)return tt(e,r.entry)}else if(r.entries){if(o<=(n=r.entries.length-1))return tt(e,r.entries[this._reverse?n-o:o])}else if(o<=(n=r.nodes.length-1)){var a=r.nodes[this._reverse?n-o:o];if(a){if(a.entry)return tt(e,a.entry);t=this._stack=nt(a,t)}continue}t=this._stack=this._stack.__prev}return q()};var xt=g/4,wt=g/2,Et=g/4;function St(e){var t=Mt();if(null==e)return t;if(Ct(e))return e;var n=o(e),r=n.size;return 0===r?t:(Ve(r),r>0&&r<g?Nt(0,r,v,null,new kt(n.toArray())):t.withMutations((function(e){e.setSize(r),n.forEach((function(t,n){return e.set(n,t)}))})))}function Ct(e){return!(!e||!e[At])}t(St,Se),St.of=function(){return this(arguments)},St.prototype.toString=function(){return this.__toString("List [","]")},St.prototype.get=function(e,t){if((e=O(this,e))>=0&&e<this.size){var n=Bt(this,e+=this._origin);return n&&n.array[e&y]}return t},St.prototype.set=function(e,t){return Rt(this,e,t)},St.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},St.prototype.insert=function(e,t){return this.splice(e,0,t)},St.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=v,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Mt()},St.prototype.push=function(){var e=arguments,t=this.size;re
Download .txt
gitextract_zpn2g_yk/

├── .clang-format
├── .codespell-ignore
├── .dockerignore
├── .github/
│   ├── actionlint.yaml
│   └── workflows/
│       ├── continuous-integration-workflow.yml
│       ├── documentation.yml
│       ├── fast-checks.yml
│       ├── force-rebase.yml
│       └── reusable_ragger_tests_latest_speculos.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .vscode/
│   └── settings.json
├── CHANGELOG.md
├── CMakeLists.txt
├── COPYING
├── COPYING.LESSER
├── Dockerfiles/
│   ├── Dockerfile
│   └── build.Dockerfile
├── MANIFEST.in
├── Pipfile
├── README.md
├── apps/
│   ├── README.md
│   └── nanox#boil#25#6e728d99.elf
├── clang-armv7m.cmake
├── docker-compose.yml
├── docs/
│   ├── CNAME
│   ├── Makefile
│   ├── conf.py
│   ├── dev/
│   │   ├── ci.md
│   │   ├── getting_started.md
│   │   ├── index.rst
│   │   ├── internals.md
│   │   └── tests.md
│   ├── index.rst
│   ├── installation/
│   │   ├── build.md
│   │   ├── index.rst
│   │   └── wsl.md
│   ├── requirements.txt
│   └── user/
│       ├── api.md
│       ├── automation.md
│       ├── clients.md
│       ├── debug.md
│       ├── docker.md
│       ├── index.rst
│       ├── macm1.md
│       ├── semihosting.md
│       └── usage.md
├── gcc-arm.cmake
├── lgtm.yml
├── pyproject.toml
├── sdk/
│   └── bolos_syscalls.h
├── setup.py
├── speculos/
│   ├── __init__.py
│   ├── __main__.py
│   ├── api/
│   │   ├── README.md
│   │   ├── __init__.py
│   │   ├── apdu.py
│   │   ├── api.py
│   │   ├── automation.py
│   │   ├── button.py
│   │   ├── events.py
│   │   ├── finger.py
│   │   ├── resources/
│   │   │   ├── apdu.schema
│   │   │   ├── button.schema
│   │   │   ├── finger.schema
│   │   │   └── ticker.schema
│   │   ├── restful.py
│   │   ├── screenshot.py
│   │   ├── static/
│   │   │   ├── index.html
│   │   │   └── swagger/
│   │   │       ├── README.md
│   │   │       ├── index.html
│   │   │       ├── swagger-ui-bundle.js
│   │   │       ├── swagger-ui-standalone-preset.js
│   │   │       ├── swagger-ui.css
│   │   │       └── swagger.json
│   │   ├── swagger.py
│   │   ├── swagger.yaml
│   │   ├── ticker.py
│   │   └── web_interface.py
│   ├── client.py
│   ├── cxlib/
│   │   ├── flex-api-level-cx-22.elf
│   │   ├── nanosp-api-level-cx-22.elf
│   │   ├── nanox-api-level-cx-22.elf
│   │   └── stax-api-level-cx-22.elf
│   ├── main.py
│   ├── mcu/
│   │   ├── __init__.py
│   │   ├── apdu.py
│   │   ├── automation.py
│   │   ├── automation_server.py
│   │   ├── bagl.py
│   │   ├── bagl_font.py
│   │   ├── bagl_glyph.py
│   │   ├── button_tcp.py
│   │   ├── display.py
│   │   ├── finger_tcp.py
│   │   ├── headless.py
│   │   ├── nbgl.py
│   │   ├── nbgl_serialize.py
│   │   ├── ocr.py
│   │   ├── readerror.py
│   │   ├── resources/
│   │   │   └── automation.schema
│   │   ├── rle_custom.py
│   │   ├── screen.py
│   │   ├── screen_text.py
│   │   ├── seproxyhal.py
│   │   ├── struct.py
│   │   ├── transport/
│   │   │   ├── __init__.py
│   │   │   ├── interface.py
│   │   │   ├── nfc.py
│   │   │   └── usb.py
│   │   └── vnc.py
│   ├── observer.py
│   ├── resources_importer.py
│   └── sharedlib/
│       ├── apex_p-api-level-shared-25.elf
│       ├── apex_p-api-level-shared-26.elf
│       ├── flex-api-level-shared-24.elf
│       ├── flex-api-level-shared-25.elf
│       ├── flex-api-level-shared-26.elf
│       ├── nanosp-api-level-shared-24.elf
│       ├── nanosp-api-level-shared-25.elf
│       ├── nanosp-api-level-shared-26.elf
│       ├── nanox-api-level-shared-24.elf
│       ├── nanox-api-level-shared-25.elf
│       ├── nanox-api-level-shared-26.elf
│       ├── stax-api-level-shared-24.elf
│       ├── stax-api-level-shared-25.elf
│       └── stax-api-level-shared-26.elf
├── speculos.py
├── src/
│   ├── CMakeLists.txt
│   ├── bolos/
│   │   ├── bagl.c
│   │   ├── bagl.h
│   │   ├── cx.c
│   │   ├── cx.h
│   │   ├── cx_aes.c
│   │   ├── cx_aes.h
│   │   ├── cx_aes_sdk2.c
│   │   ├── cx_blake2.h
│   │   ├── cx_blake2b.c
│   │   ├── cx_bls.c
│   │   ├── cx_bls.h
│   │   ├── cx_bls_fp2.c
│   │   ├── cx_bls_g2.c
│   │   ├── cx_bn.c
│   │   ├── cx_common.h
│   │   ├── cx_crc.c
│   │   ├── cx_crc.h
│   │   ├── cx_curve25519.c
│   │   ├── cx_curve25519.h
│   │   ├── cx_ec.c
│   │   ├── cx_ec.h
│   │   ├── cx_ec_domain.c
│   │   ├── cx_ecpoint.c
│   │   ├── cx_ed25519.c
│   │   ├── cx_ed25519.h
│   │   ├── cx_hash.c
│   │   ├── cx_hash.h
│   │   ├── cx_hkdf.c
│   │   ├── cx_hkdf.h
│   │   ├── cx_hmac.c
│   │   ├── cx_hmac.h
│   │   ├── cx_math.c
│   │   ├── cx_math.h
│   │   ├── cx_montgomery.c
│   │   ├── cx_mpi.c
│   │   ├── cx_ripemd160.c
│   │   ├── cx_rng_rfc6979.c
│   │   ├── cx_rng_rfc6979.h
│   │   ├── cx_scc.c
│   │   ├── cx_sha256.c
│   │   ├── cx_sha3.c
│   │   ├── cx_sha512.c
│   │   ├── cx_twisted_edwards.c
│   │   ├── cx_utils.c
│   │   ├── cx_utils.h
│   │   ├── cx_weierstrass.c
│   │   ├── cxlib.c
│   │   ├── cxlib.h
│   │   ├── default.c
│   │   ├── endorsement.c
│   │   ├── endorsement.h
│   │   ├── exception.c
│   │   ├── exception.h
│   │   ├── fonts_info.c
│   │   ├── hdkey/
│   │   │   ├── include/
│   │   │   │   ├── hdkey.h
│   │   │   │   ├── hdkey_bip32.h
│   │   │   │   ├── hdkey_bls12377.h
│   │   │   │   ├── hdkey_validate.h
│   │   │   │   └── hdkey_zip32.h
│   │   │   └── src/
│   │   │       ├── hdkey.c
│   │   │       ├── hdkey_bip32.c
│   │   │       ├── hdkey_bls12377.c
│   │   │       ├── hdkey_validate.c
│   │   │       └── hdkey_zip32.c
│   │   ├── io/
│   │   │   ├── io.c
│   │   │   ├── io.h
│   │   │   ├── mock/
│   │   │   │   ├── include/
│   │   │   │   │   ├── checks.h
│   │   │   │   │   ├── cx_rng_internal.h
│   │   │   │   │   ├── decorators.h
│   │   │   │   │   ├── exceptions.h
│   │   │   │   │   ├── lcx_hash.h
│   │   │   │   │   ├── lcx_sha512.h
│   │   │   │   │   ├── os.h
│   │   │   │   │   ├── os_debug.h
│   │   │   │   │   ├── os_helpers.h
│   │   │   │   │   ├── os_id.h
│   │   │   │   │   ├── os_math.h
│   │   │   │   │   ├── os_pic.h
│   │   │   │   │   ├── os_pin.h
│   │   │   │   │   ├── os_pki.h
│   │   │   │   │   ├── os_registry.h
│   │   │   │   │   ├── os_seed.h
│   │   │   │   │   ├── os_utils.h
│   │   │   │   │   └── ux.h
│   │   │   │   └── src/
│   │   │   │       └── mock.c
│   │   │   └── sdk/
│   │   │       ├── include/
│   │   │       │   ├── appflags.h
│   │   │       │   ├── errors.h
│   │   │       │   ├── os_apdu.h
│   │   │       │   ├── os_app.h
│   │   │       │   ├── os_errors.h
│   │   │       │   └── seproxyhal_protocol.h
│   │   │       ├── io/
│   │   │       │   ├── include/
│   │   │       │   │   ├── os_io.h
│   │   │       │   │   ├── os_io_seph_cmd.h
│   │   │       │   │   └── os_io_seph_ux.h
│   │   │       │   └── src/
│   │   │       │       ├── os_io.c
│   │   │       │       ├── os_io_seph_cmd.c
│   │   │       │       └── os_io_seph_ux.c
│   │   │       ├── lib_nfc/
│   │   │       │   ├── doc/
│   │   │       │   │   └── mainpage.dox
│   │   │       │   ├── include/
│   │   │       │   │   ├── nfc_ledger.h
│   │   │       │   │   └── nfc_ndef.h
│   │   │       │   └── src/
│   │   │       │       ├── nfc_ledger.c
│   │   │       │       └── nfc_ndef.c
│   │   │       ├── lib_stusb/
│   │   │       │   ├── include/
│   │   │       │   │   ├── usbd_conf.h
│   │   │       │   │   ├── usbd_core.h
│   │   │       │   │   ├── usbd_ctlreq.h
│   │   │       │   │   ├── usbd_def.h
│   │   │       │   │   ├── usbd_desc.h
│   │   │       │   │   ├── usbd_ioreq.h
│   │   │       │   │   ├── usbd_ledger.h
│   │   │       │   │   ├── usbd_ledger_ccid.h
│   │   │       │   │   ├── usbd_ledger_cdc.h
│   │   │       │   │   ├── usbd_ledger_hid.h
│   │   │       │   │   ├── usbd_ledger_hid_kbd.h
│   │   │       │   │   ├── usbd_ledger_hid_u2f.h
│   │   │       │   │   ├── usbd_ledger_types.h
│   │   │       │   │   └── usbd_ledger_webusb.h
│   │   │       │   └── src/
│   │   │       │       ├── usbd_conf.c
│   │   │       │       ├── usbd_core.c
│   │   │       │       ├── usbd_ctlreq.c
│   │   │       │       ├── usbd_desc.c
│   │   │       │       ├── usbd_ioreq.c
│   │   │       │       ├── usbd_ledger.c
│   │   │       │       ├── usbd_ledger_hid.c
│   │   │       │       ├── usbd_ledger_hid_u2f.c
│   │   │       │       └── usbd_ledger_webusb.c
│   │   │       └── protocol/
│   │   │           ├── include/
│   │   │           │   └── ledger_protocol.h
│   │   │           └── src/
│   │   │               └── ledger_protocol.c
│   │   ├── nbgl.c
│   │   ├── nbgl.h
│   │   ├── nbgl_rle.c
│   │   ├── nbgl_rle.h
│   │   ├── os.c
│   │   ├── os_bip32.c
│   │   ├── os_bip32.h
│   │   ├── os_eip2333.c
│   │   ├── os_hdkey.c
│   │   ├── os_hdkey.h
│   │   ├── os_pki.c
│   │   ├── os_pki.h
│   │   ├── os_result.h
│   │   ├── os_signature.c
│   │   ├── os_signature.h
│   │   ├── os_types.h
│   │   ├── seproxyhal.c
│   │   ├── touch.c
│   │   └── touch.h
│   ├── emulate.c
│   ├── emulate.h
│   ├── environment.c
│   ├── environment.h
│   ├── fonts.h
│   ├── launcher.c
│   ├── launcher.h
│   ├── output/
│   │   └── parse_elf
│   ├── parse_elf
│   ├── sdk.h
│   ├── svc.c
│   ├── svc.h
│   └── vnc/
│       ├── CMakeLists.txt
│       ├── cursor.c
│       ├── cursor.h
│       ├── cursors/
│       │   ├── approved.h
│       │   ├── bitcoin.h
│       │   ├── blue.h
│       │   ├── fabrice.h
│       │   ├── frame_00.h
│       │   ├── frame_01.h
│       │   ├── frame_02.h
│       │   ├── frame_03.h
│       │   ├── frame_04.h
│       │   ├── frame_05.h
│       │   ├── frame_06.h
│       │   ├── frame_07.h
│       │   ├── frame_08.h
│       │   ├── frame_09.h
│       │   ├── frame_10.h
│       │   ├── frame_11.h
│       │   ├── frame_12.h
│       │   ├── frame_13.h
│       │   ├── frame_14.h
│       │   ├── frame_15.h
│       │   ├── frame_16.h
│       │   ├── frame_17.h
│       │   ├── frame_18.h
│       │   ├── frame_19.h
│       │   ├── frame_20.h
│       │   ├── frame_21.h
│       │   ├── pizza.h
│       │   ├── star.h
│       │   ├── sword.h
│       │   └── verynice.h
│       ├── seccomp-bpf.h
│       └── vnc_server.c
├── tests/
│   ├── c/
│   │   ├── CMakeLists.txt
│   │   ├── mocks.c
│   │   ├── syscalls/
│   │   │   ├── CMakeLists.txt
│   │   │   ├── cavp/
│   │   │   │   ├── blake2b_kat.data
│   │   │   │   ├── groestl_224_long_msg.data
│   │   │   │   ├── groestl_224_short_msg.data
│   │   │   │   ├── groestl_256_long_msg.data
│   │   │   │   ├── groestl_256_short_msg.data
│   │   │   │   ├── groestl_384_long_msg.data
│   │   │   │   ├── groestl_384_short_msg.data
│   │   │   │   ├── groestl_512_long_msg.data
│   │   │   │   ├── groestl_512_short_msg.data
│   │   │   │   ├── hmac.data
│   │   │   │   ├── keccak_224_long_msg.data
│   │   │   │   ├── keccak_224_short_msg.data
│   │   │   │   ├── keccak_256_long_msg.data
│   │   │   │   ├── keccak_256_short_msg.data
│   │   │   │   ├── keccak_384_long_msg.data
│   │   │   │   ├── keccak_384_short_msg.data
│   │   │   │   ├── keccak_512_long_msg.data
│   │   │   │   ├── keccak_512_short_msg.data
│   │   │   │   ├── sha224_long_msg.data
│   │   │   │   ├── sha224_short_msg.data
│   │   │   │   ├── sha256_long_msg.data
│   │   │   │   ├── sha256_short_msg.data
│   │   │   │   ├── sha384_long_msg.data
│   │   │   │   ├── sha384_short_msg.data
│   │   │   │   ├── sha3_224_long_msg.data
│   │   │   │   ├── sha3_224_short_msg.data
│   │   │   │   ├── sha3_256_long_msg.data
│   │   │   │   ├── sha3_256_short_msg.data
│   │   │   │   ├── sha3_384_long_msg.data
│   │   │   │   ├── sha3_384_short_msg.data
│   │   │   │   ├── sha3_512_long_msg.data
│   │   │   │   ├── sha3_512_short_msg.data
│   │   │   │   ├── sha512_long_msg.data
│   │   │   │   ├── sha512_short_msg.data
│   │   │   │   ├── shake128_long_msg.data
│   │   │   │   ├── shake128_short_msg.data
│   │   │   │   ├── shake128_variable_output.data
│   │   │   │   ├── shake256_long_msg.data
│   │   │   │   ├── shake256_short_msg.data
│   │   │   │   └── shake256_variable_output.data
│   │   │   ├── hello.c
│   │   │   ├── nist_cavp.c
│   │   │   ├── nist_cavp.h
│   │   │   ├── test_aes.c
│   │   │   ├── test_bip32.c
│   │   │   ├── test_blake2.c
│   │   │   ├── test_bls.c
│   │   │   ├── test_bn.c
│   │   │   ├── test_crc16.c
│   │   │   ├── test_ec.c
│   │   │   ├── test_ecdh.c
│   │   │   ├── test_ecdsa.c
│   │   │   ├── test_ecpoint.c
│   │   │   ├── test_eddsa.c
│   │   │   ├── test_eip2333.c
│   │   │   ├── test_endorsement.c
│   │   │   ├── test_hdkey.c
│   │   │   ├── test_hmac.c
│   │   │   ├── test_math.c
│   │   │   ├── test_mpi_rng.c
│   │   │   ├── test_os_global_pin_is_validated.c
│   │   │   ├── test_rfc6979.c
│   │   │   ├── test_ripemd.c
│   │   │   ├── test_sha2.c
│   │   │   ├── test_sha3.c
│   │   │   ├── test_slip21.c
│   │   │   └── wycheproof/
│   │   │       ├── X25519.data
│   │   │       ├── X448.data
│   │   │       ├── ecdh_secp256k1.data
│   │   │       └── eddsa.data
│   │   ├── test_environment.c
│   │   ├── utils.c
│   │   └── utils.h
│   └── python/
│       ├── __init__.py
│       ├── api/
│       │   ├── __init__.py
│       │   ├── resources/
│       │   │   └── automation.json
│       │   └── test_api.py
│       ├── apps/
│       │   ├── __init__.py
│       │   ├── resources/
│       │   │   ├── __init__.py
│       │   │   └── boil_getpubkey_nanox.json
│       │   ├── test_boil.py
│       │   └── test_vnc.py
│       ├── conftest.py
│       ├── mcu/
│       │   ├── __init__.py
│       │   ├── resources/
│       │   │   ├── automation_invalid_action_args.json
│       │   │   ├── automation_invalid_action_name.json
│       │   │   ├── automation_invalid_rule_key.json
│       │   │   └── automation_valid.json
│       │   └── test_automation.py
│       ├── pytest.ini
│       ├── test_resources_importer.py
│       └── unit/
│           ├── __init__.py
│           ├── test_client_Api.py
│           └── test_client_SpeculosClient.py
└── tools/
    ├── clang-format.sh
    ├── cursor.py
    ├── debug.sh
    ├── gdbinit
    ├── gif-recorder.py
    ├── ledger-live-http-proxy.py
    └── winamp.py
Download .txt
Showing preview only (391K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3464 symbols across 201 files)

FILE: setup.py
  class BuildSpeculos (line 10) | class BuildSpeculos(_build_py):
    method run (line 21) | def run(self):

FILE: speculos/api/apdu.py
  class APDUBridge (line 12) | class APDUBridge:
    method __init__ (line 13) | def __init__(self, seph: SeProxyHal):
    method exchange (line 21) | def exchange(self, data: bytes, tick_timeout: int = 5 * 60 * 10) -> Ge...
    method seph_apdu_callback (line 40) | def seph_apdu_callback(self, data: bytes) -> None:
  class APDU (line 50) | class APDU(SephResource):
    method __init__ (line 53) | def __init__(self, *args, **kwargs):
    method post (line 57) | def post(self):

FILE: speculos/api/api.py
  class ApiRunner (line 25) | class ApiRunner(IODevice):
    method __init__ (line 27) | def __init__(self, api_port: int) -> None:
    method file (line 38) | def file(self):
    method can_read (line 41) | def can_read(self, screen: DisplayNotifier) -> None:
    method start_server_thread (line 45) | def start_server_thread(self,
    method stop (line 53) | def stop(self):
  class ApiWrapper (line 57) | class ApiWrapper:
    method __init__ (line 58) | def __init__(self,
    method run (line 92) | def run(self):

FILE: speculos/api/automation.py
  class Automation (line 9) | class Automation(SephResource):
    method post (line 10) | def post(self):

FILE: speculos/api/button.py
  class Button (line 8) | class Button(SephResource):
    method post (line 11) | def post(self):

FILE: speculos/api/events.py
  class EventsBroadcaster (line 13) | class EventsBroadcaster(BroadcastInterface):
    method __init__ (line 16) | def __init__(self) -> None:
    method clear_events (line 23) | def clear_events(self) -> None:
    method broadcast (line 27) | def broadcast(self, event: TextEvent) -> None:
  class EventClient (line 41) | class EventClient(ObserverInterface):
    method __init__ (line 42) | def __init__(self, broadcaster: EventsBroadcaster) -> None:
    method generate (line 46) | def generate(self) -> Generator[bytes, None, None]:
    method send_screen_event (line 64) | def send_screen_event(self, event: TextEvent) -> None:
  class Events (line 68) | class Events(AppResource):
    method __init__ (line 69) | def __init__(self, *args, automation_server: Optional[EventsBroadcaste...
    method get (line 78) | def get(self) -> Union[Response, Tuple[Dict[str, List], int]]:
    method delete (line 90) | def delete(self) -> Tuple[Dict, int]:

FILE: speculos/api/finger.py
  class Finger (line 8) | class Finger(SephResource):
    method post (line 11) | def post(self):

FILE: speculos/api/restful.py
  class SephResource (line 8) | class SephResource(Resource):
    method __init__ (line 9) | def __init__(self, *args, seph: Optional[SeProxyHal] = None, **kwargs):
    method seph (line 16) | def seph(self):
  class AppResource (line 20) | class AppResource(Resource):
    method __init__ (line 21) | def __init__(self, *args, app: Optional[Flask] = None, **kwargs):
    method app (line 28) | def app(self):
  class ScreenResource (line 32) | class ScreenResource(Resource):
    method __init__ (line 33) | def __init__(self, *args, screen=None, **kwargs):
    method screen (line 40) | def screen(self):

FILE: speculos/api/screenshot.py
  class Screenshot (line 6) | class Screenshot(ScreenResource):
    method get (line 7) | def get(self):

FILE: speculos/api/static/swagger/swagger-ui-bundle.js
  function n (line 2) | function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function t (line 2) | function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype....
  function n (line 2) | function n(e){return i(e)?e:J(e)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function r (line 2) | function r(e){return s(e)?e:K(e)}
  function o (line 2) | function o(e){return u(e)?e:Y(e)}
  function a (line 2) | function a(e){return i(e)&&!c(e)?e:G(e)}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e){return!(!e||!e[p])}
  function s (line 2) | function s(e){return!(!e||!e[f])}
  function u (line 2) | function u(e){return!(!e||!e[h])}
  function c (line 2) | function c(e){return s(e)||u(e)}
  function l (line 2) | function l(e){return!(!e||!e[d])}
  function w (line 2) | function w(e){return e.value=!1,e}
  function E (line 2) | function E(e){e&&(e.value=!0)}
  function S (line 2) | function S(){}
  function C (line 2) | function C(e,t){t=t||0;for(var n=Math.max(0,e.length-t),r=new Array(n),o...
  function A (line 2) | function A(e){return void 0===e.size&&(e.size=e.__iterate(k)),e.size}
  function O (line 2) | function O(e,t){if("number"!=typeof t){var n=t>>>0;if(""+n!==t||42949672...
  function k (line 2) | function k(){return!0}
  function j (line 2) | function j(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!...
  function T (line 2) | function T(e,t){return P(e,t,0)}
  function I (line 2) | function I(e,t){return P(e,t,t)}
  function P (line 2) | function P(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:M...
  function F (line 2) | function F(e){this.next=e}
  function U (line 2) | function U(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={va...
  function q (line 2) | function q(){return{value:void 0,done:!0}}
  function z (line 2) | function z(e){return!!H(e)}
  function V (line 2) | function V(e){return e&&"function"==typeof e.next}
  function W (line 2) | function W(e){var t=H(e);return t&&t.call(e)}
  function H (line 2) | function H(e){var t=e&&(D&&e[D]||e[L]);if("function"==typeof t)return t}
  function $ (line 2) | function $(e){return e&&"number"==typeof e.length}
  function J (line 2) | function J(e){return null==e?ie():i(e)?e.toSeq():ce(e)}
  function K (line 2) | function K(e){return null==e?ie().toKeyedSeq():i(e)?s(e)?e.toSeq():e.fro...
  function Y (line 2) | function Y(e){return null==e?ie():i(e)?s(e)?e.entrySeq():e.toIndexedSeq(...
  function G (line 2) | function G(e){return(null==e?ie():i(e)?s(e)?e.entrySeq():e:ue(e)).toSetS...
  function te (line 2) | function te(e){this._array=e,this.size=e.length}
  function ne (line 2) | function ne(e){var t=Object.keys(e);this._object=e,this._keys=t,this.siz...
  function re (line 2) | function re(e){this._iterable=e,this.size=e.length||e.size}
  function oe (line 2) | function oe(e){this._iterator=e,this._iteratorCache=[]}
  function ae (line 2) | function ae(e){return!(!e||!e[ee])}
  function ie (line 2) | function ie(){return Z||(Z=new te([]))}
  function se (line 2) | function se(e){var t=Array.isArray(e)?new te(e).fromEntrySeq():V(e)?new ...
  function ue (line 2) | function ue(e){var t=le(e);if(!t)throw new TypeError("Expected Array or ...
  function ce (line 2) | function ce(e){var t=le(e)||"object"==typeof e&&new ne(e);if(!t)throw ne...
  function le (line 2) | function le(e){return $(e)?new te(e):V(e)?new oe(e):z(e)?new re(e):void 0}
  function pe (line 2) | function pe(e,t,n,r){var o=e._cache;if(o){for(var a=o.length-1,i=0;i<=a;...
  function fe (line 2) | function fe(e,t,n,r){var o=e._cache;if(o){var a=o.length-1,i=0;return ne...
  function he (line 2) | function he(e,t){return t?de(t,e,"",{"":e}):me(e)}
  function de (line 2) | function de(e,t,n,r){return Array.isArray(t)?e.call(r,n,Y(t).map((functi...
  function me (line 2) | function me(e){return Array.isArray(e)?Y(e).map(me).toList():ve(e)?K(e)....
  function ve (line 2) | function ve(e){return e&&(e.constructor===Object||void 0===e.constructor)}
  function ge (line 2) | function ge(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("fu...
  function ye (line 2) | function ye(e,t){if(e===t)return!0;if(!i(t)||void 0!==e.size&&void 0!==t...
  function be (line 2) | function be(e,t){if(!(this instanceof be))return new be(e,t);if(this._va...
  function _e (line 2) | function _e(e,t){if(!e)throw new Error(t)}
  function xe (line 2) | function xe(e,t,n){if(!(this instanceof xe))return new xe(e,t,n);if(_e(0...
  function we (line 2) | function we(){throw TypeError("Abstract")}
  function Ee (line 2) | function Ee(){}
  function Se (line 2) | function Se(){}
  function Ce (line 2) | function Ce(){}
  function Oe (line 2) | function Oe(e){return e>>>1&1073741824|3221225471&e}
  function ke (line 2) | function ke(e){if(!1===e||null==e)return 0;if("function"==typeof e.value...
  function je (line 2) | function je(e){var t=ze[e];return void 0===t&&(t=Te(e),qe===Ue&&(qe=0,ze...
  function Te (line 2) | function Te(e){for(var t=0,n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;r...
  function Ie (line 2) | function Ie(e){var t;if(De&&void 0!==(t=Re.get(e)))return t;if(void 0!==...
  function Me (line 2) | function Me(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uni...
  function Ve (line 2) | function Ve(e){_e(e!==1/0,"Cannot perform this action with an infinite s...
  function We (line 2) | function We(e){return null==e?ot():He(e)&&!l(e)?e:ot().withMutations((fu...
  function He (line 2) | function He(e){return!(!e||!e[Je])}
  function Ye (line 2) | function Ye(e,t){this.ownerID=e,this.entries=t}
  function Ge (line 2) | function Ge(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}
  function Ze (line 2) | function Ze(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}
  function Xe (line 2) | function Xe(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}
  function Qe (line 2) | function Qe(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}
  function et (line 2) | function et(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&nt(...
  function tt (line 2) | function tt(e,t){return U(e,t[0],t[1])}
  function nt (line 2) | function nt(e,t){return{node:e,index:0,__prev:t}}
  function rt (line 2) | function rt(e,t,n,r){var o=Object.create(Ke);return o.size=e,o._root=t,o...
  function ot (line 2) | function ot(){return $e||($e=rt(0))}
  function at (line 2) | function at(e,t,n){var r,o;if(e._root){var a=w(_),i=w(x);if(r=it(e._root...
  function it (line 2) | function it(e,t,n,r,o,a,i,s){return e?e.update(t,n,r,o,a,i,s):a===b?e:(E...
  function st (line 2) | function st(e){return e.constructor===Qe||e.constructor===Xe}
  function ut (line 2) | function ut(e,t,n,r,o){if(e.keyHash===r)return new Xe(t,r,[e.entry,o]);v...
  function ct (line 2) | function ct(e,t,n,r){e||(e=new S);for(var o=new Qe(e,ke(n),[n,r]),a=0;a<...
  function lt (line 2) | function lt(e,t,n,r){for(var o=0,a=0,i=new Array(n),s=0,u=1,c=t.length;s...
  function pt (line 2) | function pt(e,t,n,r,o){for(var a=0,i=new Array(g),s=0;0!==n;s++,n>>>=1)i...
  function ft (line 2) | function ft(e,t,n){for(var o=[],a=0;a<n.length;a++){var s=n[a],u=r(s);i(...
  function ht (line 2) | function ht(e,t,n){return e&&e.mergeDeep&&i(t)?e.mergeDeep(t):ge(e,t)?e:t}
  function dt (line 2) | function dt(e){return function(t,n,r){if(t&&t.mergeDeepWith&&i(n))return...
  function mt (line 2) | function mt(e,t,n){return 0===(n=n.filter((function(e){return 0!==e.size...
  function vt (line 2) | function vt(e,t,n,r){var o=e===b,a=t.next();if(a.done){var i=o?n:e,s=r(i...
  function gt (line 2) | function gt(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993...
  function yt (line 2) | function yt(e,t,n,r){var o=r?e:C(e);return o[t]=n,o}
  function bt (line 2) | function bt(e,t,n,r){var o=e.length+1;if(r&&t+1===o)return e[t]=n,e;for(...
  function _t (line 2) | function _t(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var...
  function St (line 2) | function St(e){var t=Mt();if(null==e)return t;if(Ct(e))return e;var n=o(...
  function Ct (line 2) | function Ct(e){return!(!e||!e[At])}
  function kt (line 2) | function kt(e,t){this.array=e,this.ownerID=t}
  function Pt (line 2) | function Pt(e,t){var n=e._origin,r=e._capacity,o=qt(r),a=e._tail;return ...
  function Nt (line 2) | function Nt(e,t,n,r,o,a,i){var s=Object.create(Ot);return s.size=t-e,s._...
  function Mt (line 2) | function Mt(){return jt||(jt=Nt(0,0,v))}
  function Rt (line 2) | function Rt(e,t,n){if((t=O(e,t))!=t)return e;if(t>=e.size||t<0)return e....
  function Dt (line 2) | function Dt(e,t,n,r,o,a){var i,s=r>>>n&y,u=e&&s<e.array.length;if(!u&&vo...
  function Lt (line 2) | function Lt(e,t){return t&&e&&t===e.ownerID?e:new kt(e?e.array.slice():[...
  function Bt (line 2) | function Bt(e,t){if(t>=qt(e._capacity))return e._tail;if(t<1<<e._level+v...
  function Ft (line 2) | function Ft(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__owner...
  function Ut (line 2) | function Ut(e,t,n){for(var r=[],a=0,s=0;s<n.length;s++){var u=n[s],c=o(u...
  function qt (line 2) | function qt(e){return e<g?0:e-1>>>v<<v}
  function zt (line 2) | function zt(e){return null==e?Ht():Vt(e)?e:Ht().withMutations((function(...
  function Vt (line 2) | function Vt(e){return He(e)&&l(e)}
  function Wt (line 2) | function Wt(e,t,n,r){var o=Object.create(zt.prototype);return o.size=e?e...
  function Ht (line 2) | function Ht(){return Tt||(Tt=Wt(ot(),Mt()))}
  function $t (line 2) | function $t(e,t,n){var r,o,a=e._map,i=e._list,s=a.get(t),u=void 0!==s;if...
  function Jt (line 2) | function Jt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}
  function Kt (line 2) | function Kt(e){this._iter=e,this.size=e.size}
  function Yt (line 2) | function Yt(e){this._iter=e,this.size=e.size}
  function Gt (line 2) | function Gt(e){this._iter=e,this.size=e.size}
  function Zt (line 2) | function Zt(e){var t=bn(e);return t._iter=e,t.size=e.size,t.flip=functio...
  function Xt (line 2) | function Xt(e,t,n){var r=bn(e);return r.size=e.size,r.has=function(t){re...
  function Qt (line 2) | function Qt(e,t){var n=bn(e);return n._iter=e,n.size=e.size,n.reverse=fu...
  function en (line 2) | function en(e,t,n,r){var o=bn(e);return r&&(o.has=function(r){var o=e.ge...
  function tn (line 2) | function tn(e,t,n){var r=We().asMutable();return e.__iterate((function(o...
  function nn (line 2) | function nn(e,t,n){var r=s(e),o=(l(e)?zt():We()).asMutable();e.__iterate...
  function rn (line 2) | function rn(e,t,n,r){var o=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n==...
  function on (line 2) | function on(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,o){...
  function an (line 2) | function an(e,t,n,r){var o=bn(e);return o.__iterateUncached=function(o,a...
  function sn (line 2) | function sn(e,t){var n=s(e),o=[e].concat(t).map((function(e){return i(e)...
  function un (line 2) | function un(e,t,n){var r=bn(e);return r.__iterateUncached=function(r,o){...
  function cn (line 2) | function cn(e,t,n){var r=yn(e);return e.toSeq().map((function(o,a){retur...
  function ln (line 2) | function ln(e,t){var n=bn(e);return n.size=e.size&&2*e.size-1,n.__iterat...
  function pn (line 2) | function pn(e,t,n){t||(t=xn);var r=s(e),o=0,a=e.toSeq().map((function(t,...
  function fn (line 2) | function fn(e,t,n){if(t||(t=xn),n){var r=e.toSeq().map((function(t,r){re...
  function hn (line 2) | function hn(e,t,n){var r=e(n,t);return 0===r&&n!==t&&(null==n||n!=n)||r>0}
  function dn (line 2) | function dn(e,t,r){var o=bn(e);return o.size=new te(r).map((function(e){...
  function mn (line 2) | function mn(e,t){return ae(e)?t:e.constructor(t)}
  function vn (line 2) | function vn(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tup...
  function gn (line 2) | function gn(e){return Ve(e.size),A(e)}
  function yn (line 2) | function yn(e){return s(e)?r:u(e)?o:a}
  function bn (line 2) | function bn(e){return Object.create((s(e)?K:u(e)?Y:G).prototype)}
  function _n (line 2) | function _n(){return this._iter.cacheResult?(this._iter.cacheResult(),th...
  function xn (line 2) | function xn(e,t){return e>t?1:e<t?-1:0}
  function wn (line 2) | function wn(e){var t=W(e);if(!t){if(!$(e))throw new TypeError("Expected ...
  function En (line 2) | function En(e,t){var n,r=function(a){if(a instanceof r)return a;if(!(thi...
  function Cn (line 2) | function Cn(e,t,n){var r=Object.create(Object.getPrototypeOf(e));return ...
  function An (line 2) | function An(e){return e._name||e.constructor.name||"Record"}
  function On (line 2) | function On(e,t){try{t.forEach(kn.bind(void 0,e))}catch(e){}}
  function kn (line 2) | function kn(e,t){Object.defineProperty(e,t,{get:function(){return this.g...
  function jn (line 2) | function jn(e){return null==e?Dn():Tn(e)&&!l(e)?e:Dn().withMutations((fu...
  function Tn (line 2) | function Tn(e){return!(!e||!e[Pn])}
  function Mn (line 2) | function Mn(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._ma...
  function Rn (line 2) | function Rn(e,t){var n=Object.create(Nn);return n.size=e?e.size:0,n._map...
  function Dn (line 2) | function Dn(){return In||(In=Rn(ot()))}
  function Ln (line 2) | function Ln(e){return null==e?zn():Bn(e)?e:zn().withMutations((function(...
  function Bn (line 2) | function Bn(e){return Tn(e)&&l(e)}
  function qn (line 2) | function qn(e,t){var n=Object.create(Un);return n.size=e?e.size:0,n._map...
  function zn (line 2) | function zn(){return Fn||(Fn=qn(Ht()))}
  function Vn (line 2) | function Vn(e){return null==e?Yn():Wn(e)?e:Yn().unshiftAll(e)}
  function Wn (line 2) | function Wn(e){return!(!e||!e[$n])}
  function Kn (line 2) | function Kn(e,t,n,r){var o=Object.create(Jn);return o.size=e,o._head=t,o...
  function Yn (line 2) | function Yn(){return Hn||(Hn=Kn(0))}
  function Gn (line 2) | function Gn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.ke...
  function Qn (line 2) | function Qn(e,t){return t}
  function er (line 2) | function er(e,t){return[t,e]}
  function tr (line 2) | function tr(e){return function(){return!e.apply(this,arguments)}}
  function nr (line 2) | function nr(e){return function(){return-e.apply(this,arguments)}}
  function rr (line 2) | function rr(e){return"string"==typeof e?JSON.stringify(e):String(e)}
  function or (line 2) | function or(){return C(arguments)}
  function ar (line 2) | function ar(e,t){return e<t?1:e>t?-1:0}
  function ir (line 2) | function ir(e){if(e.size===1/0)return 0;var t=l(e),n=s(e),r=t?1:0;return...
  function sr (line 2) | function sr(e,t){return t=Ae(t,3432918353),t=Ae(t<<15|t>>>-15,461845907)...
  function ur (line 2) | function ur(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}
  function be (line 2) | function be(e){return Ee(e)?ye(e)?e.toJS():e:{}}
  function _e (line 2) | function _e(e){var t,n;if(ye(e))return e;if(e instanceof se.a.File)retur...
  function xe (line 2) | function xe(e){return l()(e)?e:[e]}
  function we (line 2) | function we(e){return"function"==typeof e}
  function Ee (line 2) | function Ee(e){return!!e&&"object"===i()(e)}
  function Se (line 2) | function Se(e){return"function"==typeof e}
  function Ce (line 2) | function Ce(e){return l()(e)}
  function Oe (line 2) | function Oe(e,t){var n;return S()(n=w()(e)).call(n,(function(n,r){return...
  function ke (line 2) | function ke(e,t){var n;return S()(n=w()(e)).call(n,(function(n,r){var o=...
  function je (line 2) | function je(e){return function(t){t.dispatch,t.getState;return function(...
  function Te (line 2) | function Te(e){var t,n=e.keySeq();return n.contains(ge)?ge:k()(t=_()(n)....
  function Ie (line 2) | function Ie(e,t){if(!W.a.Iterable.isIterable(e))return W.a.List();var n=...
  function Pe (line 2) | function Pe(e){var t,n=[/filename\*=[^']+'\w*'"([^"]+)";?/i,/filename\*=...
  function Ne (line 2) | function Ne(e){return t=e.replace(/\.[^./]*$/,""),Y()(J()(t));var t}
  function Me (line 2) | function Me(e,t,n,r,a){if(!t)return[];var s=[],u=t.get("nullable"),c=t.g...
  function Je (line 2) | function Je(e){return"string"!=typeof e||""===e?"":Object(H.sanitizeUrl)...
  function Ke (line 2) | function Ke(e){return!(!e||D()(e).call(e,"localhost")>=0||D()(e).call(e,...
  function Ye (line 2) | function Ye(e){if(!W.a.OrderedMap.isOrderedMap(e))return null;if(!e.size...
  function et (line 2) | function et(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?argum...
  function tt (line 2) | function tt(e){if("string"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS())...
  function nt (line 2) | function nt(e){return"number"==typeof e?e.toString():e}
  function rt (line 2) | function rt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments...
  function ot (line 2) | function ot(e,t){var n,r=rt(e,{returnAll:!0});return _()(n=f()(r).call(r...
  function at (line 2) | function at(){return st(fe()(32).toString("base64"))}
  function it (line 2) | function it(e){return st(de()("sha256").update(e).digest("base64"))}
  function st (line 2) | function st(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=...
  function o (line 2) | function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.en...
  function r (line 2) | function r(e,t){return e===t}
  function o (line 2) | function o(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;fo...
  function a (line 2) | function a(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function a (line 2) | function a(t){return"function"==typeof r&&"symbol"==typeof o?(e.exports=...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function f (line 2) | function f(e,t){var n=r(e);if(o){var s=o(e);t&&(s=a(s).call(s,(function(...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function u (line 2) | function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceo...
  function c (line 2) | function c(e){function t(t,n,r,o,i,s){for(var u=arguments.length,c=Array...
  function l (line 2) | function l(e,t){return n="Iterable."+e,r=function(e){return o.Iterable.i...
  function o (line 2) | function o(){return e.exports=o=r||function(e){for(var t=1;t<arguments.l...
  function c (line 2) | function c(e){var t=e.get("openapi");return"string"==typeof t&&(i()(t).c...
  function l (line 2) | function l(e){var t=e.get("swagger");return"string"==typeof t&&i()(t).ca...
  function p (line 2) | function p(e){return function(t,n){return function(r){return n&&n.specSe...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function i (line 2) | function i(e){if(null==e)throw new TypeError("Object.assign cannot be ca...
  function c (line 2) | function c(e,t){return 1===e.nodeType&&e.getAttribute(i)===String(t)||8=...
  function l (line 2) | function l(e){for(var t;t=e._renderedComponent;)e=t;return e}
  function p (line 2) | function p(e,t){var n=l(e);n._hostNode=t,t[u]=n}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e,t){if(!(e._flags&s.hasCachedChildNodes)){var n=e._renderedC...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){if(e[u])return e[u];for(var t,n,r=[];!e[u];){if(r.push(e),...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function ge (line 2) | function ge(e){var t,n=(t=e,K()(t)?t:"").replace(/\t/g,"  ");if("string"...
  function ye (line 2) | function ye(e){return{type:de,payload:e}}
  function be (line 2) | function be(e){return{type:te,payload:e}}
  function _e (line 2) | function _e(e){return{type:ne,payload:e}}
  function Oe (line 2) | function Oe(e,t,n,r,o){return{type:re,payload:{path:e,value:r,paramName:...
  function ke (line 2) | function ke(e,t,n,r){return{type:re,payload:{path:e,param:t,value:n,isXm...
  function Ne (line 2) | function Ne(e){return{type:fe,payload:{pathMethod:e}}}
  function Me (line 2) | function Me(e,t){return{type:he,payload:{path:e,value:t,key:"consumes_va...
  function Re (line 2) | function Re(e,t){return{type:he,payload:{path:e,value:t,key:"produces_va...
  function ze (line 2) | function ze(e,t){return{type:le,payload:{path:e,method:t}}}
  function Ve (line 2) | function Ve(e,t){return{type:pe,payload:{path:e,method:t}}}
  function We (line 2) | function We(e,t,n){return{type:ve,payload:{scheme:e,path:t,method:n}}}
  function d (line 2) | function d(e,t){return{type:r,payload:{selectedServerUrl:e,namespace:t}}}
  function m (line 2) | function m(e){var t=e.value,n=e.pathMethod;return{type:o,payload:{value:...
  function g (line 2) | function g(e){var t=e.value,n=e.pathMethod,r=e.name;return{type:i,payloa...
  function y (line 2) | function y(e){var t=e.name,n=e.pathMethod,r=e.contextType,o=e.contextNam...
  function b (line 2) | function b(e){var t=e.value,n=e.pathMethod;return{type:u,payload:{value:...
  function _ (line 2) | function _(e){var t=e.value,n=e.path,r=e.method;return{type:c,payload:{v...
  function x (line 2) | function x(e){var t=e.server,n=e.namespace,r=e.key,o=e.val;return{type:l...
  function m (line 2) | function m(e){var t=e.openapi;return!!t&&f()(t,"3")}
  function v (line 2) | function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]?argument...
  function g (line 2) | function g(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?argume...
  function y (line 2) | function y(e,t){var n;return u()(n="".concat(h(t),"-")).call(n,e)}
  function b (line 2) | function b(e,t){return e&&e.paths?function(e,t){return function(e,t,n){i...
  function _ (line 2) | function _(e){var t=e.spec,n=t.paths,r={};if(!n||t.$$normalized)return e...
  function p (line 2) | function p(e){return{type:o,payload:Object(r.serializeError)(e)}}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){return{type:a,payload:e}}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){return{type:i,payload:e}}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e){return{type:s,payload:e}}
  function m (line 2) | function m(e){return{type:u,payload:e}}
  function v (line 2) | function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0...
  function g (line 2) | function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0...
  function a (line 2) | function a(e,t){for(var n in e)t[n]=e[n]}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e,t,n){return o(e,t,n)}
  function i (line 2) | function i(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}
  function s (line 2) | function s(e,t){if(i()<t)throw new RangeError("Invalid typed array lengt...
  function u (line 2) | function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return ...
  function c (line 2) | function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" a...
  function l (line 2) | function l(e){if("number"!=typeof e)throw new TypeError('"size" argument...
  function p (line 2) | function p(e,t){if(l(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(v...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ...
  function m (line 2) | function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)ret...
  function v (line 2) | function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}
  function g (line 2) | function g(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=...
  function y (line 2) | function y(e,t,n,r,o){var a,i=1,s=e.length,u=t.length;if(void 0!==r&&("u...
  function b (line 2) | function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(...
  function _ (line 2) | function _(e,t,n,r){return V(q(t,e.length-n),e,n,r)}
  function x (line 2) | function x(e,t,n,r){return V(function(e){for(var t=[],n=0;n<e.length;++n...
  function w (line 2) | function w(e,t,n,r){return x(e,t,n,r)}
  function E (line 2) | function E(e,t,n,r){return V(z(t),e,n,r)}
  function S (line 2) | function S(e,t,n,r){return V(function(e,t){for(var n,r,o,a=[],i=0;i<e.le...
  function C (line 2) | function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromBy...
  function A (line 2) | function A(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var a,i,...
  function k (line 2) | function k(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+...
  function j (line 2) | function j(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+...
  function T (line 2) | function T(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);...
  function I (line 2) | function I(e,t,n){for(var r=e.slice(t,n),o="",a=0;a<r.length;a+=2)o+=Str...
  function P (line 2) | function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uin...
  function N (line 2) | function N(e,t,n,r,o,a){if(!u.isBuffer(e))throw new TypeError('"buffer" ...
  function M (line 2) | function M(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,a=Math.min(e.length-n...
  function R (line 2) | function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,a=Math.min(e.len...
  function D (line 2) | function D(e,t,n,r,o,a){if(n+r>e.length)throw new RangeError("Index out ...
  function L (line 2) | function L(e,t,n,r,a){return a||D(e,0,n,4),o.write(e,t,n,r,23,4),n+4}
  function B (line 2) | function B(e,t,n,r,a){return a||D(e,0,n,8),o.write(e,t,n,r,52,8),n+8}
  function U (line 2) | function U(e){return e<16?"0"+e.toString(16):e.toString(16)}
  function q (line 2) | function q(e,t){var n;t=t||1/0;for(var r=e.length,o=null,a=[],i=0;i<r;++...
  function z (line 2) | function z(e){return r.toByteArray(function(e){if((e=function(e){return ...
  function V (line 2) | function V(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t...
  function o (line 2) | function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t]...
  function o (line 2) | function o(e,t,n,o,a,i,s){try{var u=e[i](s),c=u.value}catch(e){return vo...
  function s (line 2) | function s(e){o(i,r,a,s,u,"next",e)}
  function u (line 2) | function u(e){o(i,r,a,s,u,"throw",e)}
  function r (line 2) | function r(e){return function(){return e}}
  function v (line 2) | function v(){w.ReactReconcileTransaction&&m||r("123")}
  function y (line 2) | function y(){this.reinitializeTransaction(),this.dirtyComponentsLength=n...
  function b (line 2) | function b(e,t){return e._mountOrder-t._mountOrder}
  function _ (line 2) | function _(e){var t=e.dirtyComponentsLength;t!==p.length&&r("124",t,p.le...
  function n (line 2) | function n(e){return e instanceof t||e instanceof Date||e instanceof Reg...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function r (line 2) | function r(e){if(e instanceof t){var n=t.alloc?t.alloc(e.length):new t(e...
  function o (line 2) | function o(e){var t=[];return e.forEach((function(e,a){"object"==typeof ...
  function a (line 2) | function a(e,t){return"__proto__"===t?void 0:e[t]}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function a (line 2) | function a(){this.protocol=null,this.slashes=null,this.auth=null,this.ho...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function b (line 2) | function b(e,t,n){if(e&&o.isObject(e)&&e instanceof a)return e;var r=new...
  function x (line 2) | function x(e){return{type:h,payload:e}}
  function w (line 2) | function w(e){return{type:d,payload:e}}
  function S (line 2) | function S(e){return{type:m,payload:e}}
  function O (line 2) | function O(e){return{type:g,payload:e}}
  function M (line 2) | function M(e){return{type:b,payload:e}}
  function R (line 2) | function R(e){return{type:_,payload:e}}
  function a (line 2) | function a(){throw new Error("setTimeout has not been defined")}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(){throw new Error("clearTimeout has not been defined")}
  function s (line 2) | function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&s...
  function f (line 2) | function f(){l&&u&&(l=!1,u.length?c=u.concat(c):p=-1,c.length&&h())}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t){this.fun=e,this.array=t}
  function m (line 2) | function m(){}
  function u (line 2) | function u(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.native...
  function we (line 2) | function we(e,t,n,r){var o;t=t||[];var a=e.getIn(u()(o=["meta","paths"])...
  function Se (line 2) | function Se(e,t,n){var r;t=t||[];var o=xe.apply(void 0,u()(r=[e]).call(r...
  function Ce (line 2) | function Ce(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments...
  function Ae (line 2) | function Ae(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments...
  function Oe (line 2) | function Oe(e,t){var n,r;t=t||[];var o=z(e).getIn(u()(n=["paths"]).call(...
  function ke (line 2) | function ke(e,t){var n,r;t=t||[];var o=z(e).getIn(u()(n=["paths"]).call(...
  function je (line 2) | function je(e,t){var n;t=t||[];var r=z(e),a=r.getIn(u()(n=["paths"]).cal...
  function Te (line 2) | function Te(e,t){var n;t=t||[];var r=z(e),a=r.getIn(u()(n=["paths"]).cal...
  function De (line 2) | function De(e){return I.Map.isMap(e)?e:new I.Map}
  function u (line 2) | function u(e){return(e||"").toString().replace(s,"")}
  function p (line 2) | function p(e){var n,r=("undefined"!=typeof window?window:void 0!==t?t:"u...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){e=u(e);var t=i.exec(e);return{protocol:t[1]?t[1].toLowerCa...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t,n){if(e=u(e),!(this instanceof h))return new h(e,t,n);var...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function y (line 2) | function y(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join("....
  function b (line 2) | function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[...
  function _ (line 2) | function _(e){return e.join(" ")}
  function x (line 2) | function x(e){var t=e.node,n=e.stylesheet,r=e.style,o=void 0===r?{}:r,a=...
  function E (line 2) | function E(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,o=void...
  function S (line 2) | function S(e,t){return{type:"element",tagName:"span",properties:{key:"li...
  function C (line 2) | function C(e,t,n){var r,o={display:"inline-block",minWidth:(r=n,"".conca...
  function A (line 2) | function A(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,o=e.la...
  function O (line 2) | function O(e){for(var t=arguments.length>1&&void 0!==arguments[1]?argume...
  function k (line 2) | function k(e,t,n,r,o,a,i,s,u){var c,l=O(e.value),p=[],f=-1,h=0;function ...
  function j (line 2) | function j(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.m...
  function T (line 2) | function T(e){return e&&void 0!==e.highlightAuto}
  function r (line 2) | function r(e){return function(e){try{return!!JSON.parse(e)}catch(e){retu...
  function u (line 2) | function u(e){return{type:o,payload:e}}
  function c (line 2) | function c(e){return{type:a,payload:e}}
  function l (line 2) | function l(e){var t=!(arguments.length>1&&void 0!==arguments[1])||argume...
  function p (line 2) | function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function p (line 2) | function p(e){if(!(this instanceof p))return new p(e);i.call(this,e),s.c...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){e.end()}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function l (line 2) | function l(e){var t,n={jsSpec:{}},r=u()(c,(function(e,t){try{var r=t.tra...
  function u (line 2) | function u(e){return void 0!==e.ref}
  function c (line 2) | function c(e){return void 0!==e.key}
  function o (line 2) | function o(e,t){this._block=r.alloc(e),this._finalSize=t,this._blockSize...
  function r (line 2) | function r(e){return null==e}
  function i (line 2) | function i(e,t,n){var r=[];return e.include.forEach((function(e){n=i(e,t...
  function s (line 2) | function s(e){this.include=e.include||[],this.implicit=e.implicit||[],th...
  function o (line 2) | function o(e,t){return(e&t)===t}
  function o (line 2) | function o(){r.attachRefs(this,this._currentElement)}
  function u (line 2) | function u(e){if(s){var t=e.node,n=e.children;if(n.length)for(var r=0;r<...
  function l (line 2) | function l(){return this.node.nodeName}
  function p (line 2) | function p(e){return{node:e,children:[],html:null,text:null,toString:l}}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  class n (line 2) | class n extends Error{constructor(e){super(n._prepareSuperMessage(e)),Ob...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function s (line 2) | function s(e,t){return{type:a,payload:o()({},e,t)}}
  function u (line 2) | function u(e){return{type:i,payload:e}}
  function l (line 2) | function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[...
  function C (line 2) | function C(e,t,n){var r;if("function"==typeof t&&void 0===n&&(n=t,t=void...
  function A (line 2) | function A(e,t){var n=t&&t.type;return"Given action "+(n&&'"'+n.toString...
  function O (line 2) | function O(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[...
  function k (line 2) | function k(e,t){return function(){return t(e.apply(void 0,arguments))}}
  function j (line 2) | function j(e,t){if("function"==typeof e)return k(e,t);if("object"!=typeo...
  function T (line 2) | function T(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=argu...
  function P (line 2) | function P(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=argu...
  function n (line 2) | function n(e){return Object.prototype.toString.call(e)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function r (line 2) | function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e...
  function u (line 2) | function u(e,t,n){var r=function(e,t,n){var r=t.dispatchConfig.phasedReg...
  function c (line 2) | function c(e){e&&e.dispatchConfig.phasedRegistrationNames&&o.traverseTwo...
  function l (line 2) | function l(e){if(e&&e.dispatchConfig.phasedRegistrationNames){var t=e._t...
  function p (line 2) | function p(e,t,n){if(n&&n.dispatchConfig.registrationName){var r=n.dispa...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){e&&e.dispatchConfig.registrationName&&p(e._targetInst,0,e)}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function i (line 2) | function i(e,t,n,o){return r.call(this,e,t,n,o)}
  function I (line 2) | function I(e){var t,n=[],r=u()(e.get("body").entrySeq());try{for(r.s();!...
  function o (line 2) | function o(){return u()(this,o),r.apply(this,arguments)}
  function o (line 2) | function o(){return u()(this,o),r.apply(this,arguments)}
  function i (line 2) | function i(t,n){var o;return u()(this,i),o=r.call(this,t,n),O(e,a,t,{}),o}
  function r (line 2) | function r(){return u()(this,r),n.apply(this,arguments)}
  function u (line 2) | function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var...
  function i (line 2) | function i(e,t,n,o){return r.call(this,e,t,n,o)}
  function a (line 2) | function a(t){return e.exports=a=r?o:function(e){return e.__proto__||o(e...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function n (line 2) | function n(e,r){var o;i()(this,n),o=t.call(this,e,r),v()(l()(o),"getDefi...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e){var r;return i()(this,n),(r=t.call(this,e)).state={loaded:...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function o (line 2) | function o(e){return(r=r||document.createElement("textarea")).innerHTML=...
  function i (line 2) | function i(e,t){return!!e&&a.call(e,t)}
  function s (line 2) | function s(e){var t=[].slice.call(arguments,1);return t.forEach((functio...
  function c (line 2) | function c(e){return e.indexOf("\\")<0?e:e.replace(u,"$1")}
  function l (line 2) | function l(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(6553...
  function p (line 2) | function p(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function d (line 2) | function d(e,t){var n=0,r=o(t);return t!==r?r:35===t.charCodeAt(0)&&h.te...
  function m (line 2) | function m(e){return e.indexOf("&")<0?e:e.replace(f,d)}
  function b (line 2) | function b(e){return y[e]}
  function _ (line 2) | function _(e){return v.test(e)?e.replace(g,b):e}
  function w (line 2) | function w(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[...
  function S (line 2) | function S(){this.rules=s({},x),this.getBreak=x.getBreak}
  function C (line 2) | function C(){this.__rules__=[],this.__cache__=null}
  function A (line 2) | function A(e,t,n,r,o){this.src=e,this.env=r,this.options=n,this.parser=t...
  function O (line 2) | function O(e,t){var n,r,o,a=-1,i=e.posMax,s=e.pos,u=e.isInLabel;if(e.isI...
  function k (line 2) | function k(e,t,n,r){var o,a,i,s,u,c;if(42!==e.charCodeAt(0))return-1;if(...
  function j (line 2) | function j(e){var t=m(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}
  function T (line 2) | function T(e,t){var n,r,o,a=t,i=e.posMax;if(60===e.src.charCodeAt(t)){fo...
  function I (line 2) | function I(e,t){var n,r=t,o=e.posMax,a=e.src.charCodeAt(t);if(34!==a&&39...
  function P (line 2) | function P(e){return e.trim().replace(/\s+/g," ").toUpperCase()}
  function N (line 2) | function N(e,t,n,r){var o,a,i,s,u,c,l,p,f;if(91!==e.charCodeAt(0))return...
  function R (line 2) | function R(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}
  function z (line 2) | function z(e,t){return!(t<0||t>=e.length)&&!q.test(e[t])}
  function V (line 2) | function V(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}
  function H (line 2) | function H(){this.options={},this.ruler=new C;for(var e=0;e<W.length;e++...
  function $ (line 2) | function $(e,t,n,r,o){var a,i,s,u,c,l,p;for(this.src=e,this.parser=t,thi...
  function J (line 2) | function J(e,t){var n,r,o;return(r=e.bMarks[t]+e.tShift[t])>=(o=e.eMarks...
  function K (line 2) | function K(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(r+1>=o)...
  function X (line 2) | function X(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src...
  function Q (line 2) | function Q(e,t){var n,r,o=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return o...
  function te (line 2) | function te(){this.ruler=new C;for(var e=0;e<ee.length;e++)this.ruler.pu...
  function ae (line 2) | function ae(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94...
  function ue (line 2) | function ue(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}
  function ce (line 2) | function ce(e,t){var n,r,o,a=t,i=!0,s=!0,u=e.posMax,c=e.src.charCodeAt(t...
  function me (line 2) | function me(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o...
  function Ee (line 2) | function Ee(){this.ruler=new C;for(var e=0;e<we.length;e++)this.ruler.pu...
  function Se (line 2) | function Se(e){var t=e.trim().toLowerCase();return-1===(t=m(t)).indexOf(...
  function Ae (line 2) | function Ae(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tok...
  function Oe (line 2) | function Oe(e,t){"string"!=typeof e&&(t=e,e="default"),t&&null!=t.linkif...
  function i (line 2) | function i(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n...
  function s (line 2) | function s(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}
  function u (line 2) | function u(e){throw new Error("Unhandled case for value: '"+e+"'")}
  function e (line 2) | function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.inne...
  function e (line 2) | function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this...
  function e (line 2) | function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.of...
  function h (line 2) | function h(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null=...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function t (line 2) | function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.ema...
  function t (line 2) | function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hasht...
  function t (line 2) | function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",...
  function t (line 2) | function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!...
  function t (line 2) | function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType=...
  function t (line 2) | function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loca...
  function h (line 2) | function h(e){"m"===e?E(1):n.test(e)&&E()}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function m (line 2) | function m(e,t){":"===e?n.test(t)?(l=2,p=new z(d({},p,{hasMailtoPrefix:!...
  function g (line 2) | function g(e){"."===e?l=3:"@"===e?l=4:n.test(e)||S()}
  function y (line 2) | function y(e){"."===e||"@"===e?S():n.test(e)?l=2:S()}
  function b (line 2) | function b(e){L.test(e)?l=5:S()}
  function _ (line 2) | function _(e){"."===e?l=7:"-"===e?l=6:L.test(e)||C()}
  function x (line 2) | function x(e){"-"===e||"."===e?C():L.test(e)?l=5:C()}
  function w (line 2) | function w(e){"."===e||"-"===e?C():L.test(e)?(l=5,p=new z(d({},p,{hasDom...
  function E (line 2) | function E(e){void 0===e&&(e=2),l=e,p=new z({idx:c})}
  function S (line 2) | function S(){l=0,p=i}
  function C (line 2) | function C(){if(p.hasDomainDot){var n=e.slice(p.idx,c);/[-.]$/.test(n)&&...
  function e (line 2) | function e(){}
  function t (line 2) | function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0...
  function t (line 2) | function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",...
  function t (line 2) | function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matc...
  function t (line 2) | function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",...
  function re (line 2) | function re(e,t){for(var n,r=t.onOpenTag,o=t.onCloseTag,a=t.onText,i=t.o...
  function e (line 2) | function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},thi...
  function se (line 2) | function se(e){return/^<\/a\s*>/i.test(e)}
  function ue (line 2) | function ue(){var e=[],t=new ae({stripPrefix:!1,url:!0,email:!0,replaceF...
  function ce (line 2) | function ce(e){var t,n,r,o,a,i,s,u,c,l,p,f,h,d,m=e.tokens,v=null;for(n=0...
  function le (line 2) | function le(e){e.core.ruler.push("linkify",ce)}
  function me (line 2) | function me(e){var t=e.source,n=e.className,r=void 0===n?"":n,i=e.getCon...
  function ve (line 2) | function ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments...
  function e (line 2) | function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.en...
  function k (line 2) | function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a ...
  function j (line 2) | function j(e,t){if(!e)throw new ReferenceError("this hasn't been initial...
  function t (line 2) | function t(){return k(this,t),j(this,(t.__proto__||Object.getPrototypeOf...
  function r (line 2) | function r(){var e,n;i()(this,r);for(var o=arguments.length,a=new Array(...
  function e (line 2) | function e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.len...
  function w (line 2) | function w(e){return function(t){for(var n=arguments.length,r=Array(n>1?...
  function E (line 2) | function E(e){return function(){for(var t=arguments.length,n=Array(t),r=...
  function S (line 2) | function S(e,t){n&&n(e,null);for(var o=t.length;o--;){var a=t[o];if("str...
  function C (line 2) | function C(e){var n=u(null),r=void 0;for(r in e)l(t,e,[r])&&(n[r]=e[r]);...
  function A (line 2) | function A(e,t){for(;null!==e;){var n=a(e,t);if(n){if(n.get)return w(n.g...
  function $ (line 2) | function $(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.len...
  function Y (line 2) | function Y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0...
  function u (line 2) | function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var...
  function c (line 2) | function c(e){var t=this.__data__=new r(e);this.size=t.size}
  function s (line 2) | function s(){s.init.call(this)}
  function o (line 2) | function o(){void 0!==a&&e.removeListener("error",a),n([].slice.call(arg...
  function c (line 2) | function c(e){if("function"!=typeof e)throw new TypeError('The "listener...
  function l (line 2) | function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._m...
  function p (line 2) | function p(e,t,n,r){var o,a,i,s;if(c(n),void 0===(a=e._events)?(a=e._eve...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(){if(!this.fired)return this.target.removeListener(this.type,...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];retu...
  function m (line 2) | function m(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"...
  function v (line 2) | function v(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}
  function i (line 2) | function i(e){var t=this;this.next=null,this.entry=null,this.finish=func...
  function v (line 2) | function v(){}
  function g (line 2) | function g(e,t){s=s||n(118),e=e||{};var r=t instanceof s;this.objectMode...
  function y (line 2) | function y(e){if(s=s||n(118),!(d.call(y,this)||this instanceof s))return...
  function b (line 2) | function b(e,t,n,r,o,a,i){t.writelen=r,t.writecb=i,t.writing=!0,t.sync=!...
  function _ (line 2) | function _(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needD...
  function x (line 2) | function x(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writ...
  function w (line 2) | function w(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!...
  function E (line 2) | function E(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n)...
  function S (line 2) | function S(e,t){var n=w(t);return n&&(!function(e,t){t.prefinished||t.fi...
  function i (line 2) | function i(){if(o)for(var e in a){var t=a[e],n=o.indexOf(e);if(n>-1||r("...
  function s (line 2) | function s(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)&&r("99",n...
  function u (line 2) | function u(e,t,n){c.registrationNameModules[e]&&r("100",e),c.registratio...
  function s (line 2) | function s(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=u.getN...
  function o (line 2) | function o(e,t,n){try{t(n)}catch(e){null===r&&(r=e)}}
  function o (line 2) | function o(e){var t=this.nativeEvent;if(t.getModifierState)return t.getM...
  function u (line 2) | function u(e,t){return Array.isArray(t)&&(t=t[1]),t?t.nextSibling:e.firs...
  function l (line 2) | function l(e,t,n){r.insertTreeBefore(e,t,n)}
  function p (line 2) | function p(e,t,n){Array.isArray(t)?function(e,t,n,r){var o=t;for(;;){var...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e,t){if(Array.isArray(t)){var n=t[1];h(e,t=t[0],n),e.removeCh...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t,n){for(;;){var r=t.nextSibling;if(r===n)break;e.removeChi...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function s (line 2) | function s(e){null!=e.checkedLink&&null!=e.valueLink&&r("87")}
  function u (line 2) | function u(e){s(e),(null!=e.value||null!=e.onChange)&&r("88")}
  function c (line 2) | function c(e){s(e),(null!=e.checked||null!=e.onChange)&&r("89")}
  function f (line 2) | function f(e){if(e){var t=e.getName();if(t)return" Check the render meth...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function o (line 2) | function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}
  function i (line 2) | function i(e){a.enqueueUpdate(e)}
  function s (line 2) | function s(e,t){var n=o.get(e);return n||null}
  function o (line 2) | function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)t...
  function p (line 2) | function p(e){return o()(e).call(e,(function(e){var t,n="is not of a typ...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function r (line 2) | function r(e,t){t.jsSpec;return e}
  function n (line 2) | function n(){var e,r,o,a,s,u;return i()(this,n),(u=t.call(this)).state={...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function s (line 2) | function s(e){for(var t,n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<...
  function h (line 2) | function h(e,t,n,r){var a,i=e.authActions.authorize,s=e.specSelectors,c=...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t,n){var r,a=e.authActions.authorize,i=e.specSelectors,s=i....
  function v (line 2) | function v(e){var t=e.fn;return{statePlugins:{spec:{actions:{download:fu...
  function a (line 2) | function a(n){n instanceof Error||n.status>=400?(o.updateLoadingStatus("...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function a (line 2) | function a(){var e,n;o()(this,a);for(var i=arguments.length,s=new Array(...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function a (line 2) | function a(){var e,n;o()(this,a);for(var i=arguments.length,s=new Array(...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function s (line 2) | function s(e){return function(t,n){return function(){var r=n.getSystem()...
  function n (line 2) | function n(){return o()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;i()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return o()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var a;return o()(this,n),a=t.call(this,e,r),d()(u()(a),"...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var a;o()(this,n),a=t.call(this,e,r),d()(u()(a),"onChang...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;i()(this,n);for(var a=arguments.length,s=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return i()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function b (line 2) | function b(e){return function(){for(var t=arguments.length,n=new Array(t...
  function r (line 2) | function r(e){var t;return W()(this,r),(t=n.call(this,e)).entryList=[],t}
  function fe (line 2) | function fe(e){var t,n=arguments.length>1&&void 0!==arguments[1]?argumen...
  function he (line 2) | function he(e){var t=e.value;return Array.isArray(t)?function(e){var t=e...
  function me (line 2) | function me(e){return ve.apply(this,arguments)}
  function ve (line 2) | function ve(){return(ve=c()(p.a.mark((function e(t){var n,r,o,a,i,s=argu...
  function ye (line 2) | function ye(e,t){return t&&(0===t.indexOf("application/json")||t.indexOf...
  function be (line 2) | function be(e,t){var n=arguments.length>2&&void 0!==arguments[2]?argumen...
  function _e (line 2) | function _e(e){return b()(e).call(e,", ")?e.split(", "):e}
  function xe (line 2) | function xe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[...
  function we (line 2) | function we(e,t){return t||"undefined"==typeof navigator||(t=navigator),...
  function Ee (line 2) | function Ee(e,t){return Array.isArray(e)&&e.some((function(e){return we(...
  function Ae (line 2) | function Ae(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&argume...
  function Oe (line 2) | function Oe(e,t,n,r){var o,a,i,u=r.style||"form",c=void 0===r.explode?"f...
  function ke (line 2) | function ke(e){return I()(e).reduce((function(e,t){var n,r=g()(t,2),o=r[...
  function je (line 2) | function je(e){var t=j()(e).reduce((function(t,n){var r,o=h()(Ae(n,e[n])...
  function Te (line 2) | function Te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[...
  function n (line 2) | function n(){this.constructor=e}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function Ke (line 2) | function Ke(e,t){return Je.call(e,t)}
  function Ye (line 2) | function Ye(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<...
  function Ge (line 2) | function Ge(e){switch(typeof e){case"object":return JSON.parse(JSON.stri...
  function Ze (line 2) | function Ze(e){for(var t,n=0,r=e.length;n<r;){if(!((t=e.charCodeAt(n))>=...
  function Xe (line 2) | function Xe(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replac...
  function Qe (line 2) | function Qe(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}
  function et (line 2) | function et(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var ...
  function tt (line 2) | function tt(e,t){var n=[e];for(var r in t){var o="object"==typeof t[r]?J...
  function t (line 2) | function t(t,n,r,o,a){var i=this.constructor,s=e.call(this,tt(t,{name:n,...
  function st (line 2) | function st(e,t){if(""==t)return e;var n={op:"_get",path:t};return ut(e,...
  function ut (line 2) | function ut(e,t,n,r,o,a){if(void 0===n&&(n=!1),void 0===r&&(r=!0),void 0...
  function ct (line 2) | function ct(e,t,n,r,o){if(void 0===r&&(r=!0),void 0===o&&(o=!0),n&&!Arra...
  function lt (line 2) | function lt(e,t,n){var r=ut(e,t);if(!1===r.test)throw new rt("Test opera...
  function pt (line 2) | function pt(e,t,n,r){if("object"!=typeof e||null===e||Array.isArray(e))t...
  function ft (line 2) | function ft(e,t,n){try{if(!Array.isArray(e))throw new rt("Patch sequence...
  function ht (line 2) | function ht(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"...
  function gt (line 2) | function gt(e,t){t.unobserve()}
  function yt (line 2) | function yt(e,t){var n,r=function(e){return dt.get(e)}(e);if(r){var o=fu...
  function bt (line 2) | function bt(e,t){void 0===t&&(t=!1);var n=dt.get(e.object);_t(n.value,e....
  function _t (line 2) | function _t(e,t,n,r,o){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSO...
  function xt (line 2) | function xt(e,t,n){void 0===n&&(n=!1);var r=[];return _t(e,t,r,"",n),r}
  function Ot (line 2) | function Ot(e){return Array.isArray(e)?e.length<1?"":"/".concat(O()(e).c...
  function kt (line 2) | function kt(e,t,n){return{op:"replace",path:e,value:t,meta:n}}
  function jt (line 2) | function jt(e,t,n){var r;return Mt(Nt(O()(r=N()(e).call(e,Ft)).call(r,(f...
  function Tt (line 2) | function Tt(e,t,n){return n=n||[],Array.isArray(e)?O()(e).call(e,(functi...
  function It (line 2) | function It(e,t,n){var r=[];if((n=n||[]).length>0){var o=t(e,n[n.length-...
  function Pt (line 2) | function Pt(e){return Array.isArray(e)?e:[e]}
  function Nt (line 2) | function Nt(e){var t;return s()(t=[]).apply(t,ie()(O()(e).call(e,(functi...
  function Mt (line 2) | function Mt(e){return N()(e).call(e,(function(e){return void 0!==e}))}
  function Rt (line 2) | function Rt(e){return e&&"object"===m()(e)}
  function Dt (line 2) | function Dt(e){return e&&"function"==typeof e}
  function Lt (line 2) | function Lt(e){if(Ut(e)){var t=e.op;return"add"===t||"remove"===t||"repl...
  function Bt (line 2) | function Bt(e){return Lt(e)||Ut(e)&&"mutation"===e.type}
  function Ft (line 2) | function Ft(e){return Bt(e)&&("add"===e.op||"replace"===e.op||"merge"===...
  function Ut (line 2) | function Ut(e){return e&&"object"===m()(e)}
  function qt (line 2) | function qt(e,t){try{return st(e,t)}catch(e){return console.error(e),{}}}
  function Yt (line 2) | function Yt(e,t){function n(){Error.captureStackTrace?Error.captureStack...
  function on (line 2) | function on(e){var t=e[e.length-1],n=e[e.length-2],r=e.join("/");return ...
  function an (line 2) | function an(e,t){var n,r=e.split("#"),o=g()(r,2),a=o[0],i=o[1],u=Kt.a.re...
  function r (line 2) | function r(e){return At.isObject(e)&&(n.indexOf(e)>=0||j()(e).some((func...
  function vn (line 2) | function vn(e,t){if(!un.test(e)){var n;if(!t)throw new cn(s()(n="Tried t...
  function gn (line 2) | function gn(e,t){var n,r;e&&e.response&&e.response.body?n=s()(r="".conca...
  function yn (line 2) | function yn(e){return(e+"").split("#")}
  function bn (line 2) | function bn(e,t){var n=ln[e];if(n&&!At.isPromise(n))try{var r=xn(t,n);re...
  function _n (line 2) | function _n(e){var t=ln[e];return t?At.isPromise(t)?t:Le.a.resolve(t):(l...
  function xn (line 2) | function xn(e,t){var n=wn(e);if(n.length<1)return t;var r=At.getIn(t,n);...
  function wn (line 2) | function wn(e){var t;if("string"!=typeof e)throw new TypeError("Expected...
  function En (line 2) | function En(e){return"string"!=typeof e?e:$t.a.unescape(e.replace(/~1/g,...
  function Sn (line 2) | function Sn(e){return $t.a.escape(e.replace(/~/g,"~0").replace(/\//g,"~1...
  function Cn (line 2) | function Cn(e,t){if(!(n=t)||"/"===n||"#"===n)return!0;var n,r=e.charAt(t...
  function e (line 2) | function e(t){W()(this,e),this.root=Pn(t||{})}
  function Pn (line 2) | function Pn(e,t){return Nn({children:{}},e,t)}
  function Nn (line 2) | function Nn(e,t,n){return e.value=t||{},e.protoValue=n?Ne()(Ne()({},n.pr...
  function e (line 2) | function e(t){var n,r,o=this;W()(this,e),Re()(this,{spec:"",debugLevel:"...
  function c (line 2) | function c(e){e&&(e=At.fullyNormalizeArray(e),n.updatePatches(e,r))}
  function Ln (line 2) | function Ln(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments...
  function Bn (line 2) | function Bn(e){var t=e.fetch,n=e.spec,r=e.url,o=e.mode,a=e.allowMetaPatc...
  function Gn (line 2) | function Gn(e,t){return b()(t).call(t,"application/json")?"string"==type...
  function Zn (line 2) | function Zn(e){var t=e.req,n=e.value,r=e.parameter,o=r.name,a=r.style,i=...
  function Xn (line 2) | function Xn(e){var t=e.req,n=e.value,r=e.parameter;if(t.query=t.query||{...
  function er (line 2) | function er(e){var t=e.req,n=e.parameter,r=e.value;if(t.headers=t.header...
  function tr (line 2) | function tr(e){var t=e.req,n=e.parameter,r=e.value;t.headers=t.headers||...
  function ir (line 2) | function ir(e,t){var n=e.operation,r=e.requestBody,o=e.securities,a=e.sp...
  function sr (line 2) | function sr(e,t){var n,r,o=e.spec,a=e.operation,i=e.securities,u=e.reque...
  function pr (line 2) | function pr(e){var t=e.http,n=e.fetch,r=e.spec,o=e.operationId,a=e.pathN...
  function fr (line 2) | function fr(e){var t,n,r=e.spec,o=e.operationId,i=e.responseContentType,...
  function dr (line 2) | function dr(e,t){return mr.apply(this,arguments)}
  function mr (line 2) | function mr(){return(mr=c()(p.a.mark((function e(t,n){var r,o,a,i,s,u,c,...
  function c (line 2) | function c(){return{statePlugins:{spec:{actions:a,selectors:u},configs:{...
  function a (line 2) | function a(e){return e&&e.__esModule?e:{default:e}}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e,t,n){var i,u=r.configure({}),c=(n||{}).prefix;if("string"!=...
  function s (line 2) | function s(e){this.options=e,this.rootNode={children:[]},this.stack=[thi...
  function u (line 2) | function u(){}
  function a (line 2) | function a(e,t){try{return decodeURIComponent(e)}catch(n){return r.unesc...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function c (line 2) | function c(e,t){try{return t(e)}catch(t){return r.unescape(e,!0)}}
  function e (line 2) | function e(){}
  function s (line 2) | function s(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n...
  function u (line 2) | function u(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n...
  function c (line 2) | function c(){}
  function y (line 2) | function y(e,t){e=e||{};var r=t instanceof(a=a||n(118));this.objectMode=...
  function b (line 2) | function b(e){if(a=a||n(118),!(this instanceof b))return new b(e);this._...
  function _ (line 2) | function _(e,t,n,r,o){var a,i=e._readableState;null===t?(i.reading=!1,fu...
  function x (line 2) | function x(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e...
  function E (line 2) | function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e...
  function S (line 2) | function S(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable...
  function C (line 2) | function C(e){h("emit readable"),e.emit("readable"),T(e)}
  function A (line 2) | function A(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(O,e,t))}
  function O (line 2) | function O(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.l...
  function k (line 2) | function k(e){h("readable nexttick read 0"),e.read(0)}
  function j (line 2) | function j(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeSchedu...
  function T (line 2) | function T(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&...
  function I (line 2) | function I(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift(...
  function P (line 2) | function P(e){var t=e._readableState;if(t.length>0)throw new Error('"end...
  function N (line 2) | function N(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=...
  function M (line 2) | function M(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;retu...
  function c (line 2) | function c(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped...
  function l (line 2) | function l(){h("onend"),e.end()}
  function m (line 2) | function m(t){h("ondata"),d=!1,!1!==e.write(t)||d||((1===a.pipesCount&&a...
  function v (line 2) | function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"er...
  function g (line 2) | function g(){e.removeListener("finish",y),b()}
  function y (line 2) | function y(){h("onfinish"),e.removeListener("close",g),b()}
  function b (line 2) | function b(){h("unpipe"),n.unpipe(e)}
  function o (line 2) | function o(e,t){e.emit("error",t)}
  function a (line 2) | function a(e,t){this._id=e,this._clearFn=t}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function a (line 2) | function a(e){var t;switch(this.encoding=function(e){var t=function(e){i...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1...
  function s (line 2) | function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(12...
  function u (line 2) | function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n...
  function c (line 2) | function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n...
  function l (line 2) | function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t)...
  function p (line 2) | function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){return e.toString(this.encoding)}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){return e&&e.length?this.write(e):""}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function a (line 2) | function a(e,t){var n=this._transformState;n.transforming=!1;var r=n.wri...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e){if(!(this instanceof i))return new i(e);r.call(this,e),thi...
  function s (line 2) | function s(){var e=this;"function"==typeof this._flush?this._flush((func...
  function u (line 2) | function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e....
  function n (line 2) | function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"fu...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function u (line 2) | function u(){this.init(),this._w=s,o.call(this,64,56)}
  function c (line 2) | function c(e,t,n){return n^e&(t^n)}
  function l (line 2) | function l(e,t,n){return e&t|n&(e|t)}
  function p (line 2) | function p(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function u (line 2) | function u(){this.init(),this._w=s,o.call(this,128,112)}
  function c (line 2) | function c(e,t,n){return n^e&(t^n)}
  function l (line 2) | function l(e,t,n){return e&t|n&(e|t)}
  function p (line 2) | function p(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}
  function m (line 2) | function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}
  function v (line 2) | function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}
  function g (line 2) | function g(e,t){return e>>>0<t>>>0?1:0}
  function t (line 2) | function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}
  function e (line 2) | function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("C...
  function o (line 2) | function o(e){var t=e.type,n=e.nodeName;return n&&"input"===n.toLowerCas...
  function a (line 2) | function a(e){return e._wrapperState.valueTracker}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function u (line 2) | function u(e){return!!s.hasOwnProperty(e)||!i.hasOwnProperty(e)&&(a.test...
  function c (line 2) | function c(e,t){return null==t||e.hasBooleanValue&&!t||e.hasNumericValue...
  function u (line 2) | function u(){if(this._rootNodeID&&this._wrapperState.pendingUpdate){this...
  function c (line 2) | function c(e,t,n){var r,o,i=a.getNodeFromInstance(e).options;if(t){for(r...
  function p (line 2) | function p(e){var t=this._currentElement.props,n=o.executeOnChange(t,e);...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function c (line 2) | function c(e,t){var n;if(null===e||!1===e)n=i.create(c);else if("object"...
  function s (line 2) | function s(e,t){return e&&"object"==typeof e&&null!=e.key?i.escape(e.key...
  function u (line 2) | function u(e,t,n,c){var l,p=typeof e;if("undefined"!==p&&"boolean"!==p||...
  function f (line 2) | function f(e){var t=Function.prototype.toString,n=Object.prototype.hasOw...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function _ (line 2) | function _(e){var t=o(e);if(t){var n=t.childIDs;a(e),n.forEach(_)}}
  function x (line 2) | function x(e,t,n){return"\n    in "+(e||"Unknown")+(t?" (at "+t.fileName...
  function w (line 2) | function w(e){return null==e?"#empty":"string"==typeof e||"number"==type...
  function E (line 2) | function E(e){var t,n=S.getDisplayName(e),r=S.getElement(e),o=S.getOwner...
  function S (line 2) | function S(e){return e?9===e.nodeType?e.documentElement:e.firstChild:null}
  function C (line 2) | function C(e,t,n,r,o){var a;if(p.logTopLevelRenders){var i=e._currentEle...
  function A (line 2) | function A(e,t,n,r){var o=v.ReactReconcileTransaction.getPooled(!n&&l.us...
  function O (line 2) | function O(e,t,n){for(0,d.unmountComponent(e,n),9===t.nodeType&&(t=t.doc...
  function k (line 2) | function k(e){var t=S(e);if(t){var n=u.getInstanceFromNode(t);return!(!n...
  function j (line 2) | function j(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}
  function T (line 2) | function T(e){var t=function(e){var t=S(e),n=t&&u.getInstanceFromNode(t)...
  function r (line 2) | function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t...
  function o (line 2) | function o(e){return null===e?"null":void 0===e?"undefined":"object"===(...
  function a (line 2) | function a(e){return"object"===o(e)?s(e):"array"===o(e)?i(e):e}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e){return e.map(a)}
  function s (line 2) | function s(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=a(e[n])...
  function u (line 2) | function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?argume...
  function a (line 2) | function a(e,t,n){n=n||0;var o,i,s=(o=t,new Array(n||0).join(o||"")),u=e...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e,t,n){if("object"!=typeof t)return e(!1,t);var r=t.interrupt...
  function h (line 2) | function h(e){f?t.nextTick(e):e()}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t){if(void 0!==t&&(c+=t),e&&!l&&(u=u||new o,l=!0),e&&l){var...
  function m (line 2) | function m(e,t){i(d,a(e,p,p?1:0),t)}
  function v (line 2) | function v(){if(u){var e=c;h((function(){u.emit("data",e),u.emit("end"),...
  function y (line 2) | function y(t){var n=u,r=c;return u=c=void 0,d=t,p=e.apply(r,n)}
  function b (line 2) | function b(e){return d=e,f=setTimeout(x,t),m?y(e):p}
  function _ (line 2) | function _(e){var n=e-h;return void 0===h||n>=t||n<0||v&&e-d>=l}
  function x (line 2) | function x(){var e=o();if(_(e))return w(e);f=setTimeout(x,function(e){va...
  function w (line 2) | function w(e){return f=void 0,g&&u?y(e):(u=c=void 0,p)}
  function E (line 2) | function E(){var e=o(),n=_(e);if(u=arguments,c=this,h=e,n){if(void 0===f...
  function n (line 2) | function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function i (line 2) | function i(e){return s("(?=",e,")")}
  function s (line 2) | function s(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.so...
  function n (line 2) | function n(e){return e?"string"==typeof e?e:e.source:null}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function r (line 2) | function r(e){return o("(?=",e,")")}
  function o (line 2) | function o(...e){return e.map((e=>n(e))).join("")}
  function a (line 2) | function a(...e){return"("+e.map((e=>n(e))).join("|")+")"}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function n (line 2) | function n(...e){return e.map((e=>{return(t=e)?"string"==typeof t?t:t.so...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function i (line 2) | function i(t,n,s){return"undefined"!=typeof Reflect&&r?(e.exports=i=r,e....
  function e (line 2) | function e(){this.fetch=!1,this.DOMException=n.DOMException}
  function c (line 2) | function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_...
  function l (line 2) | function l(e){return"string"!=typeof e&&(e=String(e)),e}
  function p (line 2) | function p(e){var t={next:function(){var t=e.shift();return{done:void 0=...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.a...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e){return new Promise((function(t,n){e.onload=function(){t(e....
  function m (line 2) | function m(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}
  function v (line 2) | function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLe...
  function g (line 2) | function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;th...
  function b (line 2) | function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUse...
  function _ (line 2) | function _(e){var t=new FormData;return e.trim().split("&").forEach((fun...
  function x (line 2) | function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.sta...
  function E (line 2) | function E(e,n){return new Promise((function(r,a){var i=new b(e,n);if(i....
  function r (line 2) | function r(e){this.value=e}
  function o (line 2) | function o(e,t,n){var r=[],o=[],s=!0;return function e(p){var f=n?a(p):p...
  function a (line 2) | function a(e){if("object"==typeof e&&null!==e){var t;if(u(e))t=[];else i...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function s (line 2) | function s(e){return Object.prototype.toString.call(e)}
  function s (line 2) | function s(e,t){try{return t(e)}catch(t){return e}}
  function i (line 2) | function i(e){return e.split(/(<\/?[^>]+>)/g).filter((function(e){return...
  function s (line 2) | function s(e){return o(e)?"ClosingTag":function(e){return function(e){re...
  function c (line 2) | function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. L...
  function l (line 2) | function l(e,t,n){for(var o,a,i=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e...
  function l (line 2) | function l(e){return(""+e).replace(c,"$&/")}
  function p (line 2) | function p(e,t){this.func=e,this.context=t,this.count=0}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.cont...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t,n){var r=e.result,i=e.keyPrefix,s=e.func,u=e.context,c=s....
  function m (line 2) | function m(e,t,n,r,o){var a="";null!=n&&(a=l(n)+"/");var s=h.getPooled(t...
  function v (line 2) | function v(e,t,n){return null}
  function s (line 2) | function s(e,t){return e&&"object"==typeof e&&null!=e.key?i.escape(e.key...
  function u (line 2) | function u(e,t,n,c){var l,p=typeof e;if("undefined"!==p&&"boolean"!==p||...
  function u (line 2) | function u(){return null}
  function p (line 2) | function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){this.message=e,this.stack=""}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){function n(n,r,o,i,s,u,l){if((i=i||c,u=u||o,l!==a)&&t){var...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e){return h((function(t,n,r,o,a,i){var s=t[n];return v(s)!==e...
  function m (line 2) | function m(t){switch(typeof t){case"number":case"string":case"undefined"...
  function v (line 2) | function v(e){var t=typeof e;return Array.isArray(e)?"array":e instanceo...
  function g (line 2) | function g(e){if(null==e)return""+e;var t=v(e);if("object"===t){if(e ins...
  function y (line 2) | function y(e){var t=g(e);switch(t){case"array":case"object":return"an "+...
  function g (line 2) | function g(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t...
  function y (line 2) | function y(e){return g(e)===f}
  function r (line 2) | function r(e,t,n,r,o){}
  function a (line 2) | function a(e,t,n,r,o,a,i,s){if(!e){var u;if(void 0===t)u=new Error("Mini...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function p (line 2) | function p(e,t){var n=u.hasOwnProperty(t)?u[t]:null;b.hasOwnProperty(t)&...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e,n){if(n){a("function"!=typeof n,"ReactClass: You're attempt...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t){for(var n in a(e&&t&&"object"==typeof e&&"object"==typeo...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t){return function(){var n=e.apply(this,arguments),r=t.appl...
  function m (line 2) | function m(e,t){return function(){e.apply(this,arguments),t.apply(this,a...
  function v (line 2) | function v(e,t){return t.bind(e)}
  function i (line 2) | function i(e){return e&&e.__esModule?e:{default:e}}
  function a (line 2) | function a(e){return e&&e.__esModule?e:{default:e}}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function u (line 2) | function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var...
  function i (line 2) | function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<...
  function o (line 2) | function o(){r.call(this)}
  function o (line 2) | function o(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}
  function a (line 2) | function a(){n.readable&&n.resume&&n.resume()}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function s (line 2) | function s(){i||(i=!0,e.end())}
  function u (line 2) | function u(){i||(i=!0,"function"==typeof e.destroy&&e.destroy())}
  function c (line 2) | function c(e){if(l(),0===r.listenerCount(this,"error"))throw e}
  function l (line 2) | function l(){n.removeListener("data",o),e.removeListener("drain",a),n.re...
  function e (line 2) | function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Ca...
  function h (line 2) | function h(e){delete c[e]}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e){if(l)setTimeout(d,0,e);else{var t=c[e];if(t){l=!0;try{!fun...
  function n (line 2) | function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t....
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function a (line 2) | function a(e){if(!(this instanceof a))return new a(e);r.call(this,e)}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function u (line 2) | function u(){this.init(),this._w=s,o.call(this,64,56)}
  function c (line 2) | function c(e){return e<<30|e>>>2}
  function l (line 2) | function l(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}
  function u (line 2) | function u(){this.init(),this._w=s,o.call(this,64,56)}
  function c (line 2) | function c(e){return e<<5|e>>>27}
  function l (line 2) | function l(e){return e<<30|e>>>2}
  function p (line 2) | function p(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function u (line 2) | function u(){this.init(),this._w=s,a.call(this,64,56)}
  function u (line 2) | function u(){this.init(),this._w=s,a.call(this,128,112)}
  function t (line 2) | function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+4)}
  function a (line 2) | function a(e){return function(){throw new Error("Function "+e+" is depre...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function d (line 2) | function d(e){return Object.prototype.toString.call(e)}
  function m (line 2) | function m(e){return 10===e||13===e}
  function v (line 2) | function v(e){return 9===e||32===e}
  function g (line 2) | function g(e){return 9===e||32===e||10===e||13===e}
  function y (line 2) | function y(e){return 44===e||91===e||93===e||123===e||125===e}
  function b (line 2) | function b(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+1...
  function _ (line 2) | function _(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"...
  function x (line 2) | function x(e){return e<=65535?String.fromCharCode(e):String.fromCharCode...
  function C (line 2) | function C(e,t){this.input=e,this.filename=t.filename||null,this.schema=...
  function A (line 2) | function A(e,t){return new o(t,new a(e.filename,e.input,e.position,e.lin...
  function O (line 2) | function O(e,t){throw A(e,t)}
  function k (line 2) | function k(e,t){e.onWarning&&e.onWarning.call(null,A(e,t))}
  function T (line 2) | function T(e,t,n,r){var o,a,i,s;if(t<n){if(s=e.input.slice(t,n),r)for(o=...
  function I (line 2) | function I(e,t,n,o){var a,i,s,c;for(r.isObject(n)||O(e,"cannot merge map...
  function P (line 2) | function P(e,t,n,r,o,a,i,s){var c,l;if(Array.isArray(o))for(c=0,l=(o=Arr...
  function N (line 2) | function N(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++...
  function M (line 2) | function M(e,t,n){for(var r=0,o=e.input.charCodeAt(e.position);0!==o;){f...
  function R (line 2) | function R(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&...
  function D (line 2) | function D(e,t){1===t?e.result+=" ":t>1&&(e.result+=r.repeat("\n",t-1))}
  function L (line 2) | function L(e,t){var n,r,o=e.tag,a=e.anchor,i=[],s=!1;for(null!==e.anchor...
  function B (line 2) | function B(e){var t,n,r,o,a=!1,i=!1;if(33!==(o=e.input.charCodeAt(e.posi...
  function F (line 2) | function F(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!...
  function U (line 2) | function U(e,t,n,o,a){var i,s,c,l,p,f,h,d,_=1,S=!1,C=!1;if(null!==e.list...
  function q (line 2) | function q(e){var t,n,r,o,a=e.position,i=!1;for(e.version=null,e.checkLi...
  function z (line 2) | function z(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.l...
  function V (line 2) | function V(e,t,n){var r,o,a=z(e,n);if("function"!=typeof t)return a;for(...
  function W (line 2) | function W(e,t){var n=z(e,t);if(0!==n.length){if(1===n.length)return n[0...
  function o (line 2) | function o(e,t,n,r,o){this.name=e,this.buffer=t,this.position=n,this.lin...
  function a (line 2) | function a(e){return 48<=e&&e<=55}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e){return 48<=e&&e<=57}
  function p (line 2) | function p(e){var t,n,a;if(t=e.toString(16).toUpperCase(),e<=255)n="x",a...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){this.schema=e.schema||a,this.indent=Math.max(1,e.indent||2...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t){for(var n,o=r.repeat(" ",t),a=0,i=-1,s="",u=e.length;a<u...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t){return"\n"+r.repeat(" ",e.indent*t)}
  function m (line 2) | function m(e){return 32===e||9===e}
  function v (line 2) | function v(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e...
  function g (line 2) | function g(e){return v(e)&&65279!==e&&44!==e&&91!==e&&93!==e&&123!==e&&1...
  function y (line 2) | function y(e){return/^\n* /.test(e)}
  function b (line 2) | function b(e,t,n,r,o){var a,i,s,u=!1,c=!1,l=-1!==r,p=-1,f=v(s=e.charCode...
  function _ (line 2) | function _(e,t,n,r){e.dump=function(){if(0===t.length)return"''";if(!e.n...
  function x (line 2) | function x(e,t){var n=y(e)?String(t):"",r="\n"===e[e.length-1];return n+...
  function w (line 2) | function w(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}
  function E (line 2) | function E(e,t){if(""===e||" "===e[0])return e;for(var n,r,o=/ [^ ]/g,a=...
  function S (line 2) | function S(e,t,n){var r,a,i,c,l,p;for(i=0,c=(a=n?e.explicitTypes:e.impli...
  function C (line 2) | function C(e,t,n,r,a,i){e.tag=null,e.dump=n,S(e,n,!1)||S(e,n,!0);var u=s...
  function A (line 2) | function A(e,t){var n,r,o=[],a=[];for(O(e,o,a),n=0,r=a.length;n<r;n+=1)t...
  function O (line 2) | function O(e,t,n){var r,o,a;if(null!==e&&"object"==typeof e)if(-1!==(o=t...
  function k (line 2) | function k(e,t){var n=new f(t=t||{});return n.noRefs||A(e,n),C(n,0,e,!0,...
  function u (line 2) | function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!...
  function c (line 2) | function c(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,a=Object.creat...
  function l (line 2) | function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){ret...
  function v (line 2) | function v(){}
  function g (line 2) | function g(){}
  function y (line 2) | function y(){}
  function E (line 2) | function E(e){["next","throw","return"].forEach((function(t){u(e,t,(func...
  function S (line 2) | function S(e,t){function n(o,a,i,s){var u=l(e[o],e,a);if("throw"!==u.typ...
  function C (line 2) | function C(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,...
  function A (line 2) | function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.f...
  function O (line 2) | function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.comp...
  function k (line 2) | function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.r...
  function j (line 2) | function j(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==type...
  function T (line 2) | function T(){return{value:t,done:!0}}
  function o (line 2) | function o(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="nex...
  function o (line 2) | function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(...
  function a (line 2) | function a(e){try{return encodeURIComponent(e)}catch(e){return null}}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function o (line 2) | function o(t,n){return e.exports=o=r||function(e,t){return e.__proto__=t...
  function e (line 2) | function e(){}
  function g (line 2) | function g(e,t){switch(e){case"topKeyUp":return-1!==u.indexOf(t.keyCode)...
  function y (line 2) | function y(e){var t=e.detail;return"object"==typeof t&&"data"in t?t.data...
  function _ (line 2) | function _(e,t,n,o){var s,u;if(c?s=function(e){switch(e){case"topComposi...
  function x (line 2) | function x(e,t,n,o){var i;if(!(i=f?function(e,t){switch(e){case"topCompo...
  function i (line 2) | function i(e){this._root=e,this._startText=this.getText(),this._fallback...
  function o (line 2) | function o(e,t,n,o){return r.call(this,e,t,n,o)}
  function o (line 2) | function o(e,t,n,o){return r.call(this,e,t,n,o)}
  function d (line 2) | function d(e,t,n){var r=u.getPooled(h.change,e,t,n);return r.type="chang...
  function y (line 2) | function y(e){var t=d(v,e,l(e));s.batchedUpdates(b,t)}
  function b (line 2) | function b(e){r.enqueueEvents(e),r.processEventQueue(!1)}
  function _ (line 2) | function _(){m&&(m.detachEvent("onchange",y),m=null,v=null)}
  function x (line 2) | function x(e,t){var n=c.updateValueIfChanged(e),r=!0===t.simulated&&I._a...
  function w (line 2) | function w(e,t){if("topChange"===e)return t}
  function E (line 2) | function E(e,t,n){"topFocus"===e?(_(),function(e,t){v=t,(m=e).attachEven...
  function C (line 2) | function C(){m&&(m.detachEvent("onpropertychange",A),m=null,v=null)}
  function A (line 2) | function A(e){"value"===e.propertyName&&x(v,e)&&y(e)}
  function O (line 2) | function O(e,t,n){"topFocus"===e?(C(),function(e,t){v=t,(m=e).attachEven...
  function k (line 2) | function k(e,t,n){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDo...
  function j (line 2) | function j(e,t,n){if("topClick"===e)return x(t,n)}
  function T (line 2) | function T(e,t,n){if("topInput"===e||"topChange"===e)return x(t,n)}
  function o (line 2) | function o(e){return!(!e||"function"!=typeof e.attachRef||"function"!=ty...
  function P (line 2) | function P(e,t){t&&(W[e._tag]&&(null!=t.children||null!=t.dangerouslySet...
  function N (line 2) | function N(e,t,n,r){if(!(r instanceof x)){0;var o=e._hostContainerInfo,a...
  function M (line 2) | function M(){var e=this;p.putListener(e.inst,e.registrationName,e.listen...
  function R (line 2) | function R(){v.postMountWrapper(this)}
  function D (line 2) | function D(){b.postMountWrapper(this)}
  function L (line 2) | function L(){g.postMountWrapper(this)}
  function F (line 2) | function F(){E.track(this)}
  function U (line 2) | function U(){var e=this;e._rootNodeID||r("63");var t=A(e);switch(t||r("6...
  function q (line 2) | function q(){y.postUpdateWrapper(this)}
  function K (line 2) | function K(e,t){return e.indexOf("-")>=0||null!=t.is}
  function G (line 2) | function G(e){var t=e.type;!function(e){J.call($,e)||(H.test(e)||r("65",...
  function o (line 2) | function o(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["We...
  function c (line 2) | function c(){this._rootNodeID&&p.updateWrapper(this)}
  function l (line 2) | function l(e){return"checkbox"===e.type||"radio"===e.type?null!=e.checke...
  function f (line 2) | function f(e){var t=this._currentElement.props,n=i.executeOnChange(t,e);...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function u (line 2) | function u(e){var t="";return o.Children.forEach(e,(function(e){null!=e&...
  function u (line 2) | function u(){this._rootNodeID&&c.updateWrapper(this)}
  function l (line 2) | function l(e){var t=this._currentElement.props,n=a.executeOnChange(t,e);...
  function u (line 2) | function u(e,t){return t&&(e=e||[]).push(t),e}
  function c (line 2) | function c(e,t){o.processChildrenUpdates(e,t)}
  function s (line 2) | function s(e,t,n,r){var a=void 0===e[n];null!=t&&a&&(e[n]=o(t,!0))}
  function y (line 2) | function y(e){}
  function b (line 2) | function b(e,t){0}
  function o (line 2) | function o(e,t,n,r){if(e&&"object"==typeof e){var o=e;0,void 0===o[n]&&n...
  function c (line 2) | function c(e){this.reinitializeTransaction(),this.renderToStaticMarkup=e...
  function e (line 2) | function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("C...
  function o (line 2) | function o(e,t){"_hostNode"in e||r("33"),"_hostNode"in t||r("33");for(va...
  function c (line 2) | function c(){this.reinitializeTransaction()}
  function p (line 2) | function p(e){for(;e._hostParent;)e=e._hostParent;var t=s.getNodeFromIns...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){var t=c(e.nativeEvent),n=s.getClosestInstanceFromNode(t),r...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e){e(l(window))}
  function p (line 2) | function p(e){this.reinitializeTransaction(),this.renderToStaticMarkup=!...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function i (line 2) | function i(e,t,n,r){return e===n&&t===r}
  function r (line 2) | function r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}
  function o (line 2) | function o(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentN...
  function y (line 2) | function y(e,t){if(v||null==h||h!==u())return null;var n=function(e){if(...
  function E (line 2) | function E(e){return"."+e._rootNodeID}
  function S (line 2) | function S(e){return"button"===e||"input"===e||"select"===e||"textarea"=...
  function o (line 2) | function o(e,t,n,o){return r.call(this,e,t,n,o)}
  function a (line 2) | function a(e,t,n,o){return r.call(this,e,t,n,o)}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function o (line 2) | function o(e,t,n,o){return r.call(this,e,t,n,o)}
  function i (line 2) | function i(e,t,n,o){return r.call(this,e,t,n,o)}
  function o (line 2) | function o(e,t,n,o){return r.call(this,e,t,n,o)}
  function a (line 2) | function a(e,t,n,o){return r.call(this,e,t,n,o)}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function o (line 2) | function o(e,t,n,o){return r.call(this,e,t,n,o)}
  function o (line 2) | function o(e,t,n,o){return r.call(this,e,t,n,o)}
  function i (line 2) | function i(e){return e&&e.__esModule?e:{default:e}}
  function t (line 2) | function t(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError(...
  function o (line 2) | function o(){}
  function a (line 2) | function a(){}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function e (line 2) | function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes val...
  function t (line 2) | function t(){return e}
  function a (line 2) | function a(e,r){p(this,a);var o=f(this,n.call(this,e,r));o.version=T,o.s...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function l (line 2) | function l(e){return e&&e.__esModule?e:{default:e}}
  function p (line 2) | function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a ...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e,t){if(!e)throw new ReferenceError("this hasn't been initial...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("S...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function g (line 2) | function g(e){return e.displayName||e.name||"Component"}
  function b (line 2) | function b(e,t){try{return e.apply(t)}catch(e){return y.value=e,y}}
  function u (line 2) | function u(e){return r.isMemo(e)?i:s[e.$$typeof]||o}
  function e (line 2) | function e(){}
  function a (line 2) | function a(e){return e&&e.__esModule?e:{default:e}}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbo...
  function s (line 2) | function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){va...
  function u (line 2) | function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)r...
  function c (line 2) | function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a ...
  function l (line 2) | function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.en...
  function p (line 2) | function p(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?h(e):t}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:funct...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){if(void 0===e)throw new ReferenceError("this hasn't been i...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e._...
  function m (line 2) | function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enume...
  function t (line 2) | function t(){var e,n;c(this,t);for(var a=arguments.length,i=new Array(a)...
  function n (line 2) | function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  class a (line 2) | class a{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ign...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replac...
  function s (line 2) | function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t...
  function u (line 2) | function u(e){return e.nodeName.toLowerCase()}
  function s (line 2) | function s(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].of...
  function c (line 2) | function c(e){o+="<"+u(e)+[].map.call(e.attributes,(function(e){return" ...
  function l (line 2) | function l(e){o+="</"+u(e)+">"}
  function p (line 2) | function p(e){("start"===e.event?c:l)(e.node)}
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  class p (line 2) | class p{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  class f (line 2) | class f{constructor(){this.rootNode={children:[]},this.stack=[this.rootN...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  class h (line 2) | class h extends f{constructor(e){super(),this.options=e}addKeyword(e,t){...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e){return e?"string"==typeof e?e:e.source:null}
  function B (line 2) | function B(e){function t(t,n){return new RegExp(d(t),"m"+(e.case_insensi...
  function F (line 2) | function F(e){return!!e&&(e.endsWithParent||F(e.starts))}
  function U (line 2) | function U(e,t){return t?Number(t):function(e){return L.includes(e.toLow...
  function q (line 2) | function q(e){const t={props:["language","code","autodetect"],data:funct...
  function f (line 2) | function f(e){return p.noHighlightRe.test(e)}
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function d (line 2) | function d(e,t,n,r){const o={code:t,language:e};E("before:highlight",o);...
  function m (line 2) | function m(e,t,r,o){const i=t;function u(e,t){const n=w.case_insensitive...
  function v (line 2) | function v(e,t){t=t||p.languages||Object.keys(n);const r=function(e){con...
  function g (line 2) | function g(e){return p.tabReplace||p.useBR?e.replace(u,(e=>"\n"===e?p.us...
  function y (line 2) | function y(e){let t=null;const n=function(e){let t=e.className+" ";t+=e....
  function _ (line 2) | function _(e){return e=(e||"").toLowerCase(),n[e]||n[o[e]]}
  function x (line 2) | function x(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=...
  function w (line 2) | function w(e){const t=_(e);return t&&!t.disableAutodetect}
  function E (line 2) | function E(e,t){const n=e;i.forEach((function(e){e[n]&&e[n](t)}))}
  function a (line 2) | function a(e){return t.displayName=e.displayName||e.name,t;function t(t)...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function n (line 2) | function n(e){for(var t,n,r,o,a=1,i=[].slice.call(arguments),s=0,u=e.len...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function c (line 2) | function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_...
  function l (line 2) | function l(e){return"string"!=typeof e&&(e=String(e)),e}
  function p (line 2) | function p(e){var t={next:function(){var t=e.shift();return{done:void 0=...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.a...
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already...
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e){return new Promise((function(t,n){e.onload=function(){t(e....
  function m (line 2) | function m(e){var t=new FileReader,n=d(t);return t.readAsArrayBuffer(e),n}
  function v (line 2) | function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLe...
  function g (line 2) | function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;th...
  function b (line 2) | function b(e,t){var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUse...
  function _ (line 2) | function _(e){var t=new FormData;return e.trim().split("&").forEach((fun...
  function x (line 2) | function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.sta...
  function E (line 2) | function E(e,n){return new Promise((function(r,a){var i=new b(e,n);if(i....
  function E (line 2) | function E(e,t,n){var r="double"===(n.quoteStyle||t)?'"':"'";return r+e+r}
  function S (line 2) | function S(e){return String(e).replace(/"/g,"&quot;")}
  function C (line 2) | function C(e){return"[object Array]"===j(e)}
  function A (line 2) | function A(e){return"[object Symbol]"===j(e)}
  function _ (line 2) | function _(t,n,a){if(n&&(o=o.slice()).push(n),a){var i={depth:s.depth};r...
  function k (line 2) | function k(e,t){return O.call(e,t)}
  function j (line 2) | function j(e){return d.call(e)}
  function T (line 2) | function T(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;...
  function I (line 2) | function I(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStrin...
  function P (line 2) | function P(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}...
  function N (line 2) | function N(e){return"Object("+e+")"}
  function M (line 2) | function M(e){return e+" { ? }"}
  function R (line 2) | function R(e,t,n,r){return e+" ("+t+") {"+(r?D(n,r):n.join(", "))+"}"}
  function D (line 2) | function D(e,t){if(0===e.length)return"";var n="\n"+t.prev+t.base;return...
  function L (line 2) | function L(e,t){var n=C(e),r=[];if(n){r.length=e.length;for(var o=0;o<e....
  function v (line 2) | function v(e){throw RangeError(h[e])}
  function g (line 2) | function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}
  function y (line 2) | function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e...
  function b (line 2) | function b(e){for(var t,n,r=[],o=0,a=e.length;o<a;)(t=e.charCodeAt(o++))...
  function _ (line 2) | function _(e){return g(e,(function(e){var t="";return e>65535&&(t+=m((e-...
  function x (line 2) | function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}
  function w (line 2) | function w(e,t,n){var r=0;for(e=n?d(e/700):e>>1,e+=d(e/t);e>455;r+=c)e=d...
  function E (line 2) | function E(e){var t,n,r,o,a,i,s,l,p,f,h,m=[],g=e.length,y=0,b=128,x=72;f...
  function S (line 2) | function S(e){var t,n,r,o,a,i,s,l,p,f,h,g,y,_,E,S=[];for(g=(e=b(e)).leng...
  function r (line 2) | function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}
  function a (line 2) | function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function a (line 2) | function a(e){return e&&e.__esModule?e:{default:e}}
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function i (line 2) | function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbo...
  function s (line 2) | function s(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)r...
  function u (line 2) | function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){va...
  function c (line 2) | function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[...
  function l (line 2) | function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.en...
  function p (line 2) | function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e._...
    method constructor (line 2) | constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(...
    method addText (line 2) | addText(e){this.buffer+=i(e)}
    method openNode (line 2) | openNode(e){if(!l(e))return;let t=e.kind;e.sublanguage||(t=`${this.cla...
    method closeNode (line 2) | closeNode(e){l(e)&&(this.buffer+="</span>")}
    method value (line 2) | value(){return this.buffer}
    method span (line 2) | span(e){this.buffer+=`<span class="${e}">`}
  function f (line 2) | function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect....
    method constructor (line 2) | constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}
    method top (line 2) | get top(){return this.stack[this.stack.length-1]}
    method root (line 2) | get root(){return this.rootNode}
    method add (line 2) | add(e){this.top.children.push(e)}
    method openNode (line 2) | openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}
    method closeNode (line 2) | closeNode(){if(this.stack.length>1)return this.stack.pop()}
    method closeAllNodes (line 2) | closeAllNodes(){for(;this.closeNode(););}
    method toJSON (line 2) | toJSON(){return JSON.stringify(this.rootNode,null,4)}
    method walk (line 2) | walk(e){return this.constructor._walk(e,this.rootNode)}
    method _walk (line 2) | static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e...
    method _collapse (line 2) | static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(...
  function h (line 2) | function h(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?d(e):t}
    method constructor (line 2) | constructor(e){super(),this.options=e}
    method addKeyword (line 2) | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNo...
    method addText (line 2) | addText(e){""!==e&&this.add(e)}
    method addSublanguage (line 2) | addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}
    method toHTML (line 2) | toHTML(){return new p(this,this.options).value()}
    method finalize (line 2) | finalize(){return!0}
  function d (line 2) | function d(e){if(void 0===e)throw new ReferenceError("this hasn't been i...
  function m (line 2) | function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:funct...
  function v (line 2) | function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enume...
  function u (line 2) | function u(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeEr...
  function d (line 2) | function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}
  function m (line 2) | function m(e){if("number"==typeof e)return e;if(function(e){return"symbo...
  function y (line 2) | function y(t){var n=r,a=o;return r=o=void 0,c=t,i=e.apply(a,n)}
  function b (line 2) | function b(e){return c=e,s=setTimeout(x,t),l?y(e):i}
  function _ (line 2) | function _(e){var n=e-u;return void 0===u||n>=t||n<0||v&&e-c>=a}
  function x (line 2) | function x(){var e=h();if(_(e))return w(e);s=setTimeout(x,function(e){va...
  function w (line 2) | function w(e){return s=void 0,g&&r?y(e):(r=o=void 0,i)}
  function E (line 2) | function E(){var e=h(),n=_(e);if(r=arguments,o=this,u=e,n){if(void 0===s...
  function o (line 2) | function o(e){var t=a(e);return n(t)}
  function a (line 2) | function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'"...
    method constructor (line 2) | constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}
    method ignoreMatch (line 2) | ignoreMatch(){this.ignore=!0}
  function e (line 2) | function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments...
  function Y (line 2) | function Y(e,t,n){if(Object($.t)(e)&&!Object($.p)(e))return V()({},e);if...
  function G (line 2) | function G(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?a...
  function Z (line 2) | function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0...
  function X (line 2) | function X(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[...
  function Q (line 2) | function Q(e,t,n){return function(e,t,n){var r=[Object($.J)(n)],o=H.a.__...
  function n (line 2) | function n(e,r){var o;_()(this,n),o=t.call(this,e,r),y()(ve()(o),"toggle...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;return _()(this,n),o=t.call(this,e,r),y()(ve()(o),...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;_()(this,n),o=t.call(this,e,r),y()(ve()(o),"onChan...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;_()(this,n),o=t.call(this,e,r),y()(ve()(o),"onChan...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function Re (line 2) | function Re(e){var t=e.example,n=e.showValue,r=e.getComponent,o=e.getCon...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e){var r;_()(this,n),r=t.call(this,e),y()(ve()(r),"_getStateF...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;_()(this,n),o=t.call(this,e,r),y()(ve()(o),"close"...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function it (line 2) | function it(e){return e.match(/^(?:[a-z]+:)?\/\//i)}
  function st (line 2) | function st(e,t){return e?it(e)?(n=e).match(/^\/\//i)?u()(r="".concat(wi...
  function ut (line 2) | function ut(e,t){var n=arguments.length>2&&void 0!==arguments[2]?argumen...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function r (line 2) | function r(){return _()(this,r),t.apply(this,arguments)}
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;return _()(this,n),o=t.call(this,e,r),y()(ve()(o),...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e){var r;return _()(this,n),r=t.call(this,e),y()(ve()(r),"onC...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;return _()(this,n),o=t.call(this,e,r),y()(ve()(o),...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function ln (line 2) | function ln(e){var t;return M()(t=(e||"").split(" ")).call(t,(function(e...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function yn (line 2) | function yn(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o,a;return _()(this,n),o=t.call(this,e,r),y()(ve()(o...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r,o;_()(this,n);for(var a=arguments.length,i=new Arra...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e){var r,o;return _()(this,n),(o=t.call(this,e)).onClick=S()(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;return _()(this,n),o=t.call(this,e,r),y()(ve()(o),...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;_()(this,n),o=t.call(this,e,r),y()(ve()(o),"toggle...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;_()(this,n),o=t.call(this,e,r),y()(ve()(o),"active...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){return _()(this,n),t.apply(this,arguments)}
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(e,r){var o;return _()(this,n),o=t.call(this,e,r),y()(ve()(o),...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e,r;_()(this,n);for(var o=arguments.length,a=new Array(...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function n (line 2) | function n(){var e;return _()(this,n),e=t.call(this),y()(ve()(e),"onChan...
    method constructor (line 2) | constructor(e){super(n._prepareSuperMessage(e)),Object.defineProperty(...
    method _prepareSuperMessage (line 2) | static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{retu...
  function Er (line 2) | function Er(e){return B.List.isList(e)?e:T()(e)?Object(B.fromJS)(e):Obje...
  function Ar (line 2) | function Ar(){return[Sr,Cr.default]}
  function Nr (line 2) | function Nr(e){var t;H.a.versions=H.a.versions||{},H.a.versions.swaggerU...

FILE: speculos/api/static/swagger/swagger-ui-standalone-preset.js
  function n (line 2) | function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{...
  function e (line 2) | function e(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype....
  function n (line 2) | function n(t){return u(t)?t:J(t)}
  function r (line 2) | function r(t){return s(t)?t:Z(t)}
  function i (line 2) | function i(t){return a(t)?t:V(t)}
  function o (line 2) | function o(t){return u(t)&&!c(t)?t:X(t)}
  function u (line 2) | function u(t){return!(!t||!t[l])}
  function s (line 2) | function s(t){return!(!t||!t[p])}
  function a (line 2) | function a(t){return!(!t||!t[h])}
  function c (line 2) | function c(t){return s(t)||a(t)}
  function f (line 2) | function f(t){return!(!t||!t[d])}
  function L (line 2) | function L(t){return t.value=!1,t}
  function x (line 2) | function x(t){t&&(t.value=!0)}
  function b (line 2) | function b(){}
  function j (line 2) | function j(t,e){e=e||0;for(var n=Math.max(0,t.length-e),r=new Array(n),i...
  function N (line 2) | function N(t){return void 0===t.size&&(t.size=t.__iterate(D)),t.size}
  function S (line 2) | function S(t,e){if("number"!=typeof e){var n=e>>>0;if(""+n!==e||42949672...
  function D (line 2) | function D(){return!0}
  function I (line 2) | function I(t,e,n){return(0===t||void 0!==n&&t<=-n)&&(void 0===e||void 0!...
  function A (line 2) | function A(t,e){return E(t,e,0)}
  function O (line 2) | function O(t,e){return E(t,e,e)}
  function E (line 2) | function E(t,e,n){return void 0===t?n:t<0?Math.max(0,e+t):void 0===e?t:M...
  function P (line 2) | function P(t){this.next=t}
  function R (line 2) | function R(t,e,n,r){var i=0===t?e:1===t?n:[e,n];return r?r.value=i:r={va...
  function Q (line 2) | function Q(){return{value:void 0,done:!0}}
  function F (line 2) | function F(t){return!!W(t)}
  function B (line 2) | function B(t){return t&&"function"==typeof t.next}
  function G (line 2) | function G(t){var e=W(t);return e&&e.call(t)}
  function W (line 2) | function W(t){var e=t&&(k&&t[k]||t[U]);if("function"==typeof e)return e}
  function q (line 2) | function q(t){return t&&"number"==typeof t.length}
  function J (line 2) | function J(t){return null==t?ut():u(t)?t.toSeq():ct(t)}
  function Z (line 2) | function Z(t){return null==t?ut().toKeyedSeq():u(t)?s(t)?t.toSeq():t.fro...
  function V (line 2) | function V(t){return null==t?ut():u(t)?s(t)?t.entrySeq():t.toIndexedSeq(...
  function X (line 2) | function X(t){return(null==t?ut():u(t)?s(t)?t.entrySeq():t:at(t)).toSetS...
  function et (line 2) | function et(t){this._array=t,this.size=t.length}
  function nt (line 2) | function nt(t){var e=Object.keys(t);this._object=t,this._keys=e,this.siz...
  function rt (line 2) | function rt(t){this._iterable=t,this.size=t.length||t.size}
  function it (line 2) | function it(t){this._iterator=t,this._iteratorCache=[]}
  function ot (line 2) | function ot(t){return!(!t||!t[tt])}
  function ut (line 2) | function ut(){return H||(H=new et([]))}
  function st (line 2) | function st(t){var e=Array.isArray(t)?new et(t).fromEntrySeq():B(t)?new ...
  function at (line 2) | function at(t){var e=ft(t);if(!e)throw new TypeError("Expected Array or ...
  function ct (line 2) | function ct(t){var e=ft(t)||"object"==typeof t&&new nt(t);if(!e)throw ne...
  function ft (line 2) | function ft(t){return q(t)?new et(t):B(t)?new it(t):F(t)?new rt(t):void 0}
  function lt (line 2) | function lt(t,e,n,r){var i=t._cache;if(i){for(var o=i.length-1,u=0;u<=o;...
  function pt (line 2) | function pt(t,e,n,r){var i=t._cache;if(i){var o=i.length-1,u=0;return ne...
  function ht (line 2) | function ht(t,e){return e?dt(e,t,"",{"":t}):yt(t)}
  function dt (line 2) | function dt(t,e,n,r){return Array.isArray(e)?t.call(r,n,V(e).map((functi...
  function yt (line 2) | function yt(t){return Array.isArray(t)?V(t).map(yt).toList():vt(t)?Z(t)....
  function vt (line 2) | function vt(t){return t&&(t.constructor===Object||void 0===t.constructor)}
  function gt (line 2) | function gt(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("fu...
  function wt (line 2) | function wt(t,e){if(t===e)return!0;if(!u(e)||void 0!==t.size&&void 0!==e...
  function Mt (line 2) | function Mt(t,e){if(!(this instanceof Mt))return new Mt(t,e);if(this._va...
  function mt (line 2) | function mt(t,e){if(!t)throw new Error(e)}
  function _t (line 2) | function _t(t,e,n){if(!(this instanceof _t))return new _t(t,e,n);if(mt(0...
  function Lt (line 2) | function Lt(){throw TypeError("Abstract")}
  function xt (line 2) | function xt(){}
  function bt (line 2) | function bt(){}
  function jt (line 2) | function jt(){}
  function St (line 2) | function St(t){return t>>>1&1073741824|3221225471&t}
  function Dt (line 2) | function Dt(t){if(!1===t||null==t)return 0;if("function"==typeof t.value...
  function It (line 2) | function It(t){var e=Ft[t];return void 0===e&&(e=At(t),Qt===Rt&&(Qt=0,Ft...
  function At (line 2) | function At(t){for(var e=0,n=0;n<t.length;n++)e=31*e+t.charCodeAt(n)|0;r...
  function Ot (line 2) | function Ot(t){var e;if(kt&&void 0!==(e=zt.get(t)))return e;if(void 0!==...
  function Tt (line 2) | function Tt(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uni...
  function Bt (line 2) | function Bt(t){mt(t!==1/0,"Cannot perform this action with an infinite s...
  function Gt (line 2) | function Gt(t){return null==t?ie():Wt(t)&&!f(t)?t:ie().withMutations((fu...
  function Wt (line 2) | function Wt(t){return!(!t||!t[Jt])}
  function Vt (line 2) | function Vt(t,e){this.ownerID=t,this.entries=e}
  function Xt (line 2) | function Xt(t,e,n){this.ownerID=t,this.bitmap=e,this.nodes=n}
  function Ht (line 2) | function Ht(t,e,n){this.ownerID=t,this.count=e,this.nodes=n}
  function Kt (line 2) | function Kt(t,e,n){this.ownerID=t,this.keyHash=e,this.entries=n}
  function $t (line 2) | function $t(t,e,n){this.ownerID=t,this.keyHash=e,this.entry=n}
  function te (line 2) | function te(t,e,n){this._type=e,this._reverse=n,this._stack=t._root&&ne(...
  function ee (line 2) | function ee(t,e){return R(t,e[0],e[1])}
  function ne (line 2) | function ne(t,e){return{node:t,index:0,__prev:e}}
  function re (line 2) | function re(t,e,n,r){var i=Object.create(Zt);return i.size=t,i._root=e,i...
  function ie (line 2) | function ie(){return qt||(qt=re(0))}
  function oe (line 2) | function oe(t,e,n){var r,i;if(t._root){var o=L(m),u=L(_);if(r=ue(t._root...
  function ue (line 2) | function ue(t,e,n,r,i,o,u,s){return t?t.update(e,n,r,i,o,u,s):o===M?t:(x...
  function se (line 2) | function se(t){return t.constructor===$t||t.constructor===Kt}
  function ae (line 2) | function ae(t,e,n,r,i){if(t.keyHash===r)return new Kt(e,r,[t.entry,i]);v...
  function ce (line 2) | function ce(t,e,n,r){t||(t=new b);for(var i=new $t(t,Dt(n),[n,r]),o=0;o<...
  function fe (line 2) | function fe(t,e,n,r){for(var i=0,o=0,u=new Array(n),s=0,a=1,c=e.length;s...
  function le (line 2) | function le(t,e,n,r,i){for(var o=0,u=new Array(g),s=0;0!==n;s++,n>>>=1)u...
  function pe (line 2) | function pe(t,e,n){for(var i=[],o=0;o<n.length;o++){var s=n[o],a=r(s);u(...
  function he (line 2) | function he(t,e,n){return t&&t.mergeDeep&&u(e)?t.mergeDeep(e):gt(t,e)?t:e}
  function de (line 2) | function de(t){return function(e,n,r){if(e&&e.mergeDeepWith&&u(n))return...
  function ye (line 2) | function ye(t,e,n){return 0===(n=n.filter((function(t){return 0!==t.size...
  function ve (line 2) | function ve(t,e,n,r){var i=t===M,o=e.next();if(o.done){var u=i?n:t,s=r(u...
  function ge (line 2) | function ge(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993...
  function we (line 2) | function we(t,e,n,r){var i=r?t:j(t);return i[e]=n,i}
  function Me (line 2) | function Me(t,e,n,r){var i=t.length+1;if(r&&e+1===i)return t[e]=n,t;for(...
  function me (line 2) | function me(t,e,n){var r=t.length-1;if(n&&e===r)return t.pop(),t;for(var...
  function be (line 2) | function be(t){var e=Te();if(null==t)return e;if(je(t))return t;var n=i(...
  function je (line 2) | function je(t){return!(!t||!t[Ne])}
  function De (line 2) | function De(t,e){this.array=t,this.ownerID=e}
  function Ee (line 2) | function Ee(t,e){var n=t._origin,r=t._capacity,i=Qe(r),o=t._tail;return ...
  function Ce (line 2) | function Ce(t,e,n,r,i,o,u){var s=Object.create(Se);return s.size=e-t,s._...
  function Te (line 2) | function Te(){return Ie||(Ie=Ce(0,0,v))}
  function ze (line 2) | function ze(t,e,n){if((e=S(t,e))!=e)return t;if(e>=t.size||e<0)return t....
  function ke (line 2) | function ke(t,e,n,r,i,o){var u,s=r>>>n&w,a=t&&s<t.array.length;if(!a&&vo...
  function Ue (line 2) | function Ue(t,e){return e&&t&&e===t.ownerID?t:new De(t?t.array.slice():[...
  function Ye (line 2) | function Ye(t,e){if(e>=Qe(t._capacity))return t._tail;if(e<1<<t._level+v...
  function Pe (line 2) | function Pe(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var r=t.__owner...
  function Re (line 2) | function Re(t,e,n){for(var r=[],o=0,s=0;s<n.length;s++){var a=n[s],c=i(a...
  function Qe (line 2) | function Qe(t){return t<g?0:t-1>>>v<<v}
  function Fe (line 2) | function Fe(t){return null==t?We():Be(t)?t:We().withMutations((function(...
  function Be (line 2) | function Be(t){return Wt(t)&&f(t)}
  function Ge (line 2) | function Ge(t,e,n,r){var i=Object.create(Fe.prototype);return i.size=t?t...
  function We (line 2) | function We(){return Ae||(Ae=Ge(ie(),Te()))}
  function qe (line 2) | function qe(t,e,n){var r,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if...
  function Je (line 2) | function Je(t,e){this._iter=t,this._useKeys=e,this.size=t.size}
  function Ze (line 2) | function Ze(t){this._iter=t,this.size=t.size}
  function Ve (line 2) | function Ve(t){this._iter=t,this.size=t.size}
  function Xe (line 2) | function Xe(t){this._iter=t,this.size=t.size}
  function He (line 2) | function He(t){var e=Mn(t);return e._iter=t,e.size=t.size,e.flip=functio...
  function Ke (line 2) | function Ke(t,e,n){var r=Mn(t);return r.size=t.size,r.has=function(e){re...
  function $e (line 2) | function $e(t,e){var n=Mn(t);return n._iter=t,n.size=t.size,n.reverse=fu...
  function tn (line 2) | function tn(t,e,n,r){var i=Mn(t);return r&&(i.has=function(r){var i=t.ge...
  function en (line 2) | function en(t,e,n){var r=Gt().asMutable();return t.__iterate((function(i...
  function nn (line 2) | function nn(t,e,n){var r=s(t),i=(f(t)?Fe():Gt()).asMutable();t.__iterate...
  function rn (line 2) | function rn(t,e,n,r){var i=t.size;if(void 0!==e&&(e|=0),void 0!==n&&(n==...
  function on (line
Copy disabled (too large) Download .json
Condensed preview — 426 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (22,180K chars).
[
  {
    "path": ".clang-format",
    "chars": 3787,
    "preview": "# https://stackoverflow.com/questions/29477654/how-to-make-clang-format-add-new-line-before-opening-brace-of-a-function\n"
  },
  {
    "path": ".codespell-ignore",
    "chars": 39,
    "preview": "globaly\nkeypair\nontop\ntolen\nunstall\nTE\n"
  },
  {
    "path": ".dockerignore",
    "chars": 81,
    "preview": "apps\nnode_server\nDockerfile\ndocker-compose.yml\n.dockerignore\n.git*\ndoc\nREADME.md\n"
  },
  {
    "path": ".github/actionlint.yaml",
    "chars": 120,
    "preview": "version: 1\nself-hosted-runner:\n  labels:\n    - public-ledgerhq-shared-small\n    - speculos-builder-2c-arm64-ubuntu_2404\n"
  },
  {
    "path": ".github/workflows/continuous-integration-workflow.yml",
    "chars": 5738,
    "preview": "name: Continuous Integration & Deployment\n\non:\n  workflow_dispatch:\n  push:\n    tags:\n      - '*'\n    branches:\n      - "
  },
  {
    "path": ".github/workflows/documentation.yml",
    "chars": 1355,
    "preview": "name: Documentation generation & update\n\non:\n  push:\n    tags:\n      - '*'\n    branches:\n      - develop\n      - master\n"
  },
  {
    "path": ".github/workflows/fast-checks.yml",
    "chars": 1940,
    "preview": "name: Fast checks\n\non:\n  workflow_dispatch:\n  push:\n    branches:\n      - master\n      - develop\n  pull_request:\n# Cance"
  },
  {
    "path": ".github/workflows/force-rebase.yml",
    "chars": 999,
    "preview": "name: Force rebased\r\n\r\non: [pull_request]\r\n\r\njobs:\r\n  force-rebase:\r\n    runs-on: ubuntu-latest\r\n    steps:\r\n\r\n      - n"
  },
  {
    "path": ".github/workflows/reusable_ragger_tests_latest_speculos.yml",
    "chars": 4432,
    "preview": "name: Functional tests using Ragger and latest speculos\n\non:\n  workflow_call:\n    inputs:\n      app_repository:\n        "
  },
  {
    "path": ".gitignore",
    "chars": 191,
    "preview": "*.a\n*.o\n.cache/\n.idea/\n.eggs/\n__pycache__/\napps/*vault*\nbuild/\ncore\nTAGS\n/speculos/resources/launcher\n/speculos/resource"
  },
  {
    "path": ".pre-commit-config.yaml",
    "chars": 1258,
    "preview": "# To install hooks, run:\n# pre-commit install --hook-type pre-commit\n# pre-commit install --hook-type commit-msg\n\n---\nre"
  },
  {
    "path": ".vscode/settings.json",
    "chars": 390,
    "preview": "{\n    \"files.associations\": {\n        \"bolos_syscalls_blue_2.2.5.h\": \"c\",\n        \"verynice.h\": \"c\",\n        \"utils.h\": "
  },
  {
    "path": "CHANGELOG.md",
    "chars": 12727,
    "preview": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Change"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 6503,
    "preview": "cmake_minimum_required(VERSION 3.10)\n\nproject(Speculos C)\n\ninclude(CTest)\ninclude(ExternalProject)\n\nif (CMAKE_TOOLCHAIN_"
  },
  {
    "path": "COPYING",
    "chars": 35148,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "COPYING.LESSER",
    "chars": 7651,
    "preview": "                   GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007"
  },
  {
    "path": "Dockerfiles/Dockerfile",
    "chars": 1079,
    "preview": "# This Dockerfile assembles an image with all the dependencies required to run\n# speculos from the command-line (--displ"
  },
  {
    "path": "Dockerfiles/build.Dockerfile",
    "chars": 2599,
    "preview": "# Dockerfile to have a container with everything ready to build speculos,\n# assuming that neither OpenSSL nor cmocka wer"
  },
  {
    "path": "MANIFEST.in",
    "chars": 578,
    "preview": "include CMakeLists.txt\nrecursive-include sdk *.h\nrecursive-include src *.c *.h *.txt\ninclude speculos/api/resources/*.sc"
  },
  {
    "path": "Pipfile",
    "chars": 417,
    "preview": "[[source]]\nname = \"pypi\"\nurl = \"https://pypi.org/simple\"\nverify_ssl = true\n\n[dev-packages]\n\n[packages]\nconstruct = \">=2."
  },
  {
    "path": "README.md",
    "chars": 3999,
    "preview": "# Speculos\n\n[![codecov](https://codecov.io/gh/LedgerHQ/speculos/branch/master/graph/badge.svg)](https://codecov.io/gh/Le"
  },
  {
    "path": "apps/README.md",
    "chars": 658,
    "preview": "The files in these folder are consumed by the tests to ensure that speculos\nworks correctly across various devices and a"
  },
  {
    "path": "clang-armv7m.cmake",
    "chars": 702,
    "preview": "# cmake-toolchain configuration to build with clang on Debian and Ubuntu\n#\n# Usage:\n#\n#   cmake -DCMAKE_TOOLCHAIN_FILE=c"
  },
  {
    "path": "docker-compose.yml",
    "chars": 454,
    "preview": "version: \"3.7\"\n\nservices:\n  nanos:\n    build: .\n    image: ghcr.io/ledgerhq/speculos\n    volumes:\n      - ./apps:/specul"
  },
  {
    "path": "docs/CNAME",
    "chars": 19,
    "preview": "speculos.ledger.com"
  },
  {
    "path": "docs/Makefile",
    "chars": 633,
    "preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the "
  },
  {
    "path": "docs/conf.py",
    "chars": 1064,
    "preview": "# Configuration file for the Sphinx documentation builder.\n#\n# For the full list of built-in configuration values, see t"
  },
  {
    "path": "docs/dev/ci.md",
    "chars": 1068,
    "preview": "---\nsort: 3\n---\n\n# Continuous Integration\n\n## Speculos builder\n\nThe Dockerfile `build.Dockerfile` builds a container wit"
  },
  {
    "path": "docs/dev/getting_started.md",
    "chars": 468,
    "preview": "---\nsort: 1\n---\n\n# Getting Started\n\n## clang-format\n\nclang-format is used by the CI to format C code according to a set "
  },
  {
    "path": "docs/dev/index.rst",
    "chars": 126,
    "preview": "Developer documentation\n=======================\n\n.. toctree::\n   :maxdepth: 1\n\n   getting_started\n   tests\n   internals\n"
  },
  {
    "path": "docs/dev/internals.md",
    "chars": 1096,
    "preview": "---\nsort: 4\n---\n\n# Internals\n\nThe emulator is actually a userland application cross-compiled for the ARM\narchitecture. I"
  },
  {
    "path": "docs/dev/tests.md",
    "chars": 1327,
    "preview": "---\nsort: 2\n---\n\n# Tests\n\n## How to run tests\n\nThe application binaries launched by the tests should be placed in `apps/"
  },
  {
    "path": "docs/index.rst",
    "chars": 1133,
    "preview": "Speculos documentation\n======================\n\n`Source code <https://github.com/LedgerHQ/speculos>`_\n\n.. toctree::\n   :m"
  },
  {
    "path": "docs/installation/build.md",
    "chars": 1580,
    "preview": "---\nsort: 1\n---\n\n# Linux\n\n## Requirements\n\nFor Debian (version 12 \"Bookworm\" or later) and Ubuntu (version 24.04 or late"
  },
  {
    "path": "docs/installation/index.rst",
    "chars": 73,
    "preview": "Installation\n============\n\n.. toctree::\n   :maxdepth: 1\n\n   build\n   wsl\n"
  },
  {
    "path": "docs/installation/wsl.md",
    "chars": 781,
    "preview": "---\nsort: 2\n---\n\n# Windows (with WSL 2)\n\nBuilding in WSL 2 (Windows Subsystem for Linux 2) is identical to the procedure"
  },
  {
    "path": "docs/requirements.txt",
    "chars": 217,
    "preview": "sphinx<7\n# rtd-theme 2.0.0 needs sphinx<8, but is buggy with sphinx 7, so both are pinned\n# rtd-theme v3 is still beta b"
  },
  {
    "path": "docs/user/api.md",
    "chars": 1079,
    "preview": "---\nsort: 5\n---\n\n# REST API\n\nA REST API is available at [http://127.0.0.1:5000](http://127.0.0.1:5000) (the port can be "
  },
  {
    "path": "docs/user/automation.md",
    "chars": 3294,
    "preview": "---\nsort: 6\n---\n\n# Automation: press buttons automatically\n\nThe `--automation` argument allows to apply a set of actions"
  },
  {
    "path": "docs/user/clients.md",
    "chars": 2183,
    "preview": "---\nsort: 3\n---\n\n# Clients: how to send APDUs\n\nClients can communicate with the emulated device using APDUs, as usual. S"
  },
  {
    "path": "docs/user/debug.md",
    "chars": 316,
    "preview": "---\nsort: 4\n---\n\n# Debug: how to use GDB\n\nDebug an app thanks to GDB:\n\n```shell\n./speculos.py -d apps/btc.elf &\n./tools/"
  },
  {
    "path": "docs/user/docker.md",
    "chars": 1681,
    "preview": "# Docker\n\n## How to use the Docker image\n\nA docker image is available on [GitHub Packages](https://ghcr.io/ledgerhq/spec"
  },
  {
    "path": "docs/user/index.rst",
    "chars": 125,
    "preview": "User\n====\n\n.. toctree::\n   :maxdepth: 1\n\n   api\n   automation\n   clients\n   debug\n   docker\n   macm1\n   semihosting\n   u"
  },
  {
    "path": "docs/user/macm1.md",
    "chars": 2003,
    "preview": "# Docker - for Mac M1\n\n## How to build the Docker image\n\nEdit the `Dockerfile` and perform the following modification\n\nR"
  },
  {
    "path": "docs/user/semihosting.md",
    "chars": 937,
    "preview": "---\nsort: 7\n---\n\n# Semihosting as an additional debug mechanism\n\nQEMU implements some semihosted operations which can be"
  },
  {
    "path": "docs/user/usage.md",
    "chars": 3212,
    "preview": "---\nsort: 1\n---\n\n# Usage\n\nAfter having [installed the requirements and built](../installation/build.md) speculos:\n\n```sh"
  },
  {
    "path": "gcc-arm.cmake",
    "chars": 413,
    "preview": "# cmake-toolchain configuration to build with gcc on Debian and Ubuntu\n#\n# Usage:\n#\n#   cmake -DCMAKE_TOOLCHAIN_FILE=gcc"
  },
  {
    "path": "lgtm.yml",
    "chars": 525,
    "preview": "# Test with:\n# podman run --rm -v $(pwd):/code -ti ubuntu:19.10 bash\n# apt update && apt install -y build-essential cmak"
  },
  {
    "path": "pyproject.toml",
    "chars": 1685,
    "preview": "[build-system]\nrequires = [\n    \"setuptools\",\n    \"wheel\",\n    \"setuptools_scm\",\n    \"cmake\"\n]\nbuild-backend = \"setuptoo"
  },
  {
    "path": "sdk/bolos_syscalls.h",
    "chars": 17339,
    "preview": "#pragma once\n\n/*********************\n *      INCLUDES\n *********************/\n\n/*********************\n *      DEFINES\n *"
  },
  {
    "path": "setup.py",
    "chars": 1469,
    "preview": "#!/usr/bin/env python3\n\"\"\"Install Speculos\"\"\"\nimport pathlib\nimport shutil\nimport tempfile\nfrom setuptools.command.build"
  },
  {
    "path": "speculos/__init__.py",
    "chars": 226,
    "preview": "from . import api  # noqa: F401\nfrom . import client  # noqa: F401\nfrom . import mcu  # noqa: F401\n\ntry:\n    from specul"
  },
  {
    "path": "speculos/__main__.py",
    "chars": 79,
    "preview": "from . import main\n\n\nif __name__ == \"__main__\":\n    main.main(prog=\"speculos\")\n"
  },
  {
    "path": "speculos/api/README.md",
    "chars": 1050,
    "preview": "## Generate\n\nConvert the specification file from YAML to JSON:\n\n```shell\ndocker pull docker.io/swaggerapi/swagger-conver"
  },
  {
    "path": "speculos/api/__init__.py",
    "chars": 93,
    "preview": "from .api import ApiRunner  # noqa: F401\nfrom .events import EventsBroadcaster  # noqa: F401\n"
  },
  {
    "path": "speculos/api/apdu.py",
    "chars": 2692,
    "preview": "import json\nimport threading\nimport jsonschema\nfrom flask import stream_with_context, Response, request\nfrom typing impo"
  },
  {
    "path": "speculos/api/api.py",
    "chars": 3976,
    "preview": "import socket\nimport threading\nfrom typing import Any, Dict\nfrom flask import Flask\nfrom flask_restful import Api\nfrom f"
  },
  {
    "path": "speculos/api/automation.py",
    "chars": 772,
    "preview": "import json\nimport jsonschema\nfrom flask import request\n\nfrom ..mcu import automation as mcu_automation\nfrom .restful im"
  },
  {
    "path": "speculos/api/button.py",
    "chars": 1335,
    "preview": "import jsonschema\nfrom flask import request\n\nfrom speculos.resources_importer import get_resource_schema_as_json\nfrom .r"
  },
  {
    "path": "speculos/api/events.py",
    "chars": 3503,
    "preview": "import json\nimport logging\nimport threading\nfrom typing import Dict, Generator, List, Optional, Tuple, Union\nfrom datacl"
  },
  {
    "path": "speculos/api/finger.py",
    "chars": 944,
    "preview": "import jsonschema\nfrom flask import request\n\nfrom speculos.resources_importer import get_resource_schema_as_json\nfrom .r"
  },
  {
    "path": "speculos/api/resources/apdu.schema",
    "chars": 290,
    "preview": "{\n    \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\n    \"type\": \"object\",\n    \"properties\": {\n        \"data\": {"
  },
  {
    "path": "speculos/api/resources/button.schema",
    "chars": 289,
    "preview": "{\n    \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\n    \"type\": \"object\",\n    \"properties\": {\n        \"action\":"
  },
  {
    "path": "speculos/api/resources/finger.schema",
    "chars": 501,
    "preview": "{\n    \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\n    \"type\": \"object\",\n    \"properties\": {\n        \"x\": { \"t"
  },
  {
    "path": "speculos/api/resources/ticker.schema",
    "chars": 242,
    "preview": "{\n    \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\n    \"type\": \"object\",\n    \"properties\": {\n        \"action\":"
  },
  {
    "path": "speculos/api/restful.py",
    "chars": 1094,
    "preview": "from flask import Flask\nfrom typing import Optional\nfrom flask_restful import Resource\n\nfrom ..mcu.seproxyhal import SeP"
  },
  {
    "path": "speculos/api/screenshot.py",
    "chars": 345,
    "preview": "from flask import Response\n\nfrom .restful import ScreenResource\n\n\nclass Screenshot(ScreenResource):\n    def get(self):\n "
  },
  {
    "path": "speculos/api/static/index.html",
    "chars": 8972,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Speculos Web Interface</title>\n    <link rel=\"icon\" type=\"image/png"
  },
  {
    "path": "speculos/api/static/swagger/README.md",
    "chars": 83,
    "preview": "This directory is automatically generated using instructions from ../../README.md.\n"
  },
  {
    "path": "speculos/api/static/swagger/index.html",
    "chars": 1456,
    "preview": "\n<!-- HTML for static distribution bundle build -->\n<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\">"
  },
  {
    "path": "speculos/api/static/swagger/swagger-ui-bundle.js",
    "chars": 1099281,
    "preview": "/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */\n!function(e,t){\"object\"==typeof exports&&\"obj"
  },
  {
    "path": "speculos/api/static/swagger/swagger-ui-standalone-preset.js",
    "chars": 336257,
    "preview": "/*! For license information please see swagger-ui-standalone-preset.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof ex"
  },
  {
    "path": "speculos/api/static/swagger/swagger-ui.css",
    "chars": 143554,
    "preview": ".swagger-ui{color:#3b4151;\n  /*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */font-family:san"
  },
  {
    "path": "speculos/api/static/swagger/swagger.json",
    "chars": 11332,
    "preview": "{\n  \"openapi\": \"3.0.0\",\n  \"info\": {\n    \"title\": \"Speculos API\",\n    \"version\": \"1.0.0\"\n  },\n  \"servers\": [\n    {\n      "
  },
  {
    "path": "speculos/api/swagger.py",
    "chars": 145,
    "preview": "from .restful import AppResource\n\n\nclass Swagger(AppResource):\n    def get(self):\n        return self.app.send_static_fi"
  },
  {
    "path": "speculos/api/swagger.yaml",
    "chars": 6104,
    "preview": "openapi: 3.0.0\n\ninfo:\n  title: \"Speculos API\"\n  version: \"1.0.0\"\n\nservers:\n  - url: \"http://127.0.0.1:5000\"\n\npaths:\n  /a"
  },
  {
    "path": "speculos/api/ticker.py",
    "chars": 592,
    "preview": "import jsonschema\nfrom flask import request\n\nfrom speculos.resources_importer import get_resource_schema_as_json\nfrom .r"
  },
  {
    "path": "speculos/api/web_interface.py",
    "chars": 142,
    "preview": "from .restful import AppResource\n\n\nclass WebInterface(AppResource):\n    def get(self):\n        return self.app.send_stat"
  },
  {
    "path": "speculos/client.py",
    "chars": 10144,
    "preview": "import json\nimport logging\nimport requests\nimport socket\nimport sys\nimport subprocess\nimport time\nfrom contextlib import"
  },
  {
    "path": "speculos/main.py",
    "chars": 28560,
    "preview": "#!/usr/bin/env python3\n\n'''\nEmulate the target app along the SE Proxy Hal server.\n'''\n\nimport argparse\nimport binascii\ni"
  },
  {
    "path": "speculos/mcu/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "speculos/mcu/apdu.py",
    "chars": 3441,
    "preview": "from __future__ import annotations\n\n'''\nForward packets between an external application and the emulated device.\n\nIntern"
  },
  {
    "path": "speculos/mcu/automation.py",
    "chars": 1800,
    "preview": "import json\nimport jsonschema\nimport logging\nimport re\n\nfrom speculos.resources_importer import get_resources_path\n\n\ncla"
  },
  {
    "path": "speculos/mcu/automation_server.py",
    "chars": 2059,
    "preview": "\"\"\"\nForward screen events (text, x, y) to TCP clients.\n\"\"\"\n\nimport json\nimport logging\nimport socketserver\nimport thread"
  },
  {
    "path": "speculos/mcu/bagl.py",
    "chars": 26116,
    "preview": "import binascii\nimport logging\nfrom collections import namedtuple\nfrom construct import Aligned, Struct, Int8ul, Int16ul"
  },
  {
    "path": "speculos/mcu/bagl_font.py",
    "chars": 317859,
    "preview": "from collections import namedtuple\nfrom typing import Optional\n\nBAGL_FONT_ID_MASK = 0x0fff\n\nBAGL_FONT_LUCIDA_CONSOLE_8PX"
  },
  {
    "path": "speculos/mcu/bagl_glyph.py",
    "chars": 2663,
    "preview": "from collections import namedtuple\n\n'''\n {BAGL_GLYPH_ICON_DOWN, 7, 4, 1, C_icon_down_colors, C_icon_down_bitmap},\nunsign"
  },
  {
    "path": "speculos/mcu/button_tcp.py",
    "chars": 2007,
    "preview": "'''\nTCP server to emulate buttons:\n\n- L/R: press left/right button\n- l/r: release left/right button\n\nUsage example:\n\n   "
  },
  {
    "path": "speculos/mcu/display.py",
    "chars": 11855,
    "preview": "from __future__ import annotations\n\nimport io\nfrom abc import ABC, abstractmethod\ntry:\n    from functools import cache\ne"
  },
  {
    "path": "speculos/mcu/finger_tcp.py",
    "chars": 2039,
    "preview": "'''\nTCP server to emulate finger actions on screen:\n\nargs are sent in csv format (x,y,pressed) and can be chained.\n\nUsag"
  },
  {
    "path": "speculos/mcu/headless.py",
    "chars": 2554,
    "preview": "import select\nfrom typing import List, Optional\n\nfrom speculos.observer import TextEvent\nfrom . import bagl\nfrom . impor"
  },
  {
    "path": "speculos/mcu/nbgl.py",
    "chars": 13392,
    "preview": "import gzip\nimport logging\nimport sys\nfrom construct import Struct, Int8ul, Int16ul, Int16sl\nfrom enum import IntEnum\nfr"
  },
  {
    "path": "speculos/mcu/nbgl_serialize.py",
    "chars": 20026,
    "preview": "# flake8: noqa\nimport struct\nfrom abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom enum import Enum"
  },
  {
    "path": "speculos/mcu/ocr.py",
    "chars": 9552,
    "preview": "import functools\nimport string\nfrom dataclasses import dataclass\nfrom typing import Dict, List, Mapping\nfrom speculos.ob"
  },
  {
    "path": "speculos/mcu/readerror.py",
    "chars": 311,
    "preview": "#!/usr/bin/env python3\n# coding: utf8\n\n\nclass ReadError(Exception):\n    \"\"\"\n    Raised when can_read method in SeProxyHa"
  },
  {
    "path": "speculos/mcu/resources/automation.schema",
    "chars": 2722,
    "preview": "{\n    \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n\n    \"definitions\": {\n        \"rules\": {\n            \"type\":"
  },
  {
    "path": "speculos/mcu/rle_custom.py",
    "chars": 42017,
    "preview": "#!/usr/bin/env python3\n# coding: utf-8\n# -----------------------------------------------------------------------------\n\""
  },
  {
    "path": "speculos/mcu/screen.py",
    "chars": 12674,
    "preview": "from __future__ import annotations\n\nfrom PyQt6.QtWidgets import QApplication, QWidget, QMainWindow\nfrom PyQt6.QtGui impo"
  },
  {
    "path": "speculos/mcu/screen_text.py",
    "chars": 5527,
    "preview": "import curses\nimport logging\nimport os\nimport select\nimport sys\nimport time\nfrom typing import Any, List\n\nfrom . import "
  },
  {
    "path": "speculos/mcu/seproxyhal.py",
    "chars": 22028,
    "preview": "import os\nimport logging\nimport sys\nimport threading\nimport time\nimport struct\nfrom pathlib import Path\nfrom collections"
  },
  {
    "path": "speculos/mcu/struct.py",
    "chars": 991,
    "preview": "from dataclasses import dataclass\nfrom typing import Any, Dict, NamedTuple, Optional, Tuple\n\nPixel = Tuple[int, int]\n\n\n@"
  },
  {
    "path": "speculos/mcu/transport/__init__.py",
    "chars": 451,
    "preview": "from typing import Callable\n\nfrom .interface import TransportLayer, TransportType\nfrom .nfc import NFC\nfrom .usb import "
  },
  {
    "path": "speculos/mcu/transport/interface.py",
    "chars": 857,
    "preview": "from abc import ABC, abstractmethod\nfrom enum import auto, IntEnum\nfrom typing import Callable, Optional\n\n\nclass Transpo"
  },
  {
    "path": "speculos/mcu/transport/nfc.py",
    "chars": 2318,
    "preview": "\"\"\"\nForward NFC packets between the MCU and the SE\n\"\"\"\n\nimport enum\nimport logging\nfrom typing import List, Optional\n\nfr"
  },
  {
    "path": "speculos/mcu/transport/usb.py",
    "chars": 8902,
    "preview": "\"\"\"\nForward USB packets between the MCU and the SE using the (custom) SE Proxy HAL\nprotocol.\n\"\"\"\n\nimport enum\nimport log"
  },
  {
    "path": "speculos/mcu/vnc.py",
    "chars": 3288,
    "preview": "'''\nForward framebuffer to a VNC server (vnc/vnc_server) and receive mouse events.\n\nThis VNC server can be tested with R"
  },
  {
    "path": "speculos/observer.py",
    "chars": 894,
    "preview": "from abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom logging import Logger\nfrom typing import List"
  },
  {
    "path": "speculos/resources_importer.py",
    "chars": 600,
    "preview": "import json\nfrom pathlib import Path\nfrom platform import python_version_tuple\nfrom typing import Dict\n\nmajor, minor, _ "
  },
  {
    "path": "speculos.py",
    "chars": 125,
    "preview": "#!/usr/bin/env python3\n\"\"\"Launch Speculos emulator\"\"\"\nfrom speculos.main import main\n\n\nif __name__ == \"__main__\":\n    ma"
  },
  {
    "path": "src/CMakeLists.txt",
    "chars": 3596,
    "preview": "add_compile_options(-Wextra -Wcast-qual -Wshadow -Werror\n        -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -W"
  },
  {
    "path": "src/bolos/bagl.c",
    "chars": 4779,
    "preview": "#include <err.h>\n#include <string.h>\n\n#include \"bagl.h\"\n#include \"emulate.h\"\n#include \"fonts.h\"\n\n#define SEPROXYHAL_TAG_"
  },
  {
    "path": "src/bolos/bagl.h",
    "chars": 544,
    "preview": "#pragma once\n\n#include <stddef.h>\n#include <stdint.h>\n\nunsigned long sys_bagl_hal_draw_rect(unsigned int color, int x, i"
  },
  {
    "path": "src/bolos/cx.c",
    "chars": 1110,
    "preview": "#include <err.h>\n#include <errno.h>\n#include <openssl/rand.h>\n#include <stdbool.h>\n#include <stdio.h>\n#include <stdlib.h"
  },
  {
    "path": "src/bolos/cx.h",
    "chars": 2161,
    "preview": "#pragma once\n\n/* ======================================================================= */\n/*                          "
  },
  {
    "path": "src/bolos/cx_aes.c",
    "chars": 5083,
    "preview": "#include <assert.h>\n#include <err.h>\n#include <string.h>\n\n#include <openssl/aes.h>\n#include <openssl/crypto.h>\n\n#include"
  },
  {
    "path": "src/bolos/cx_aes.h",
    "chars": 667,
    "preview": "#pragma once\n\n#include <stdint.h>\n\n#define CX_AES_BLOCK_SIZE 16\n\nstruct cx_aes_key_s {\n  unsigned int size;\n  unsigned c"
  },
  {
    "path": "src/bolos/cx_aes_sdk2.c",
    "chars": 3283,
    "preview": "#define _SDK_2_0_\n#include <openssl/aes.h>\n#include <stdbool.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string."
  },
  {
    "path": "src/bolos/cx_blake2.h",
    "chars": 6676,
    "preview": "/*\n   BLAKE2 reference source code package - reference C implementations\n\n   Copyright 2012, Samuel Neves <sneves@dei.uc"
  },
  {
    "path": "src/bolos/cx_blake2b.c",
    "chars": 15521,
    "preview": "#include <stdint.h>\n#include <string.h>\n#include <sys/types.h>\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n#include \"c"
  },
  {
    "path": "src/bolos/cx_bls.c",
    "chars": 7893,
    "preview": "#define _SDK_2_0_\n#include \"cx_bls.h\"\n#include \"cx_hkdf.h\"\n#include \"cx_utils.h\"\n#include \"cxlib.h\"\n#include <blst.h>\n\n#"
  },
  {
    "path": "src/bolos/cx_bls.h",
    "chars": 1598,
    "preview": "#ifndef CX_BLS_H\n#define CX_BLS_H\n\n#include <blst.h>\n#include <stdint.h>\n\n#define CX_BLS_BLS12381_PARAM_LEN (48)\n#define"
  },
  {
    "path": "src/bolos/cx_bls_fp2.c",
    "chars": 7411,
    "preview": "/**\n * @file cx_bls_fp2.c\n * @brief GF(p²) operations for BLS12-381.\n *        This file is  based on BLST API and imple"
  },
  {
    "path": "src/bolos/cx_bls_g2.c",
    "chars": 16946,
    "preview": "/**\n * @file cx_bls_g2.c\n * @brief BLS12-381 G2 operations.\n *        This file is based on BLST API and implements the "
  },
  {
    "path": "src/bolos/cx_bn.c",
    "chars": 10366,
    "preview": "#define _SDK_2_0_\n#include <err.h>\n#include <errno.h>\n#include <openssl/bn.h>\n#include <openssl/rand.h>\n#include <stdboo"
  },
  {
    "path": "src/bolos/cx_common.h",
    "chars": 6210,
    "preview": "\n#ifndef CX_COMMON_H\n#define CX_COMMON_H\n\n// clang-format off\n/**\n * @brief   Cryptography flags\n * @details Some functi"
  },
  {
    "path": "src/bolos/cx_crc.c",
    "chars": 6606,
    "preview": "#include <stdint.h>\n\n#include \"cx.h\"\n\n#define CX_CRC32_INIT 0xFFFFFFFF\n\n#define cx_crc16_update sys_cx_crc16_update\n\nsta"
  },
  {
    "path": "src/bolos/cx_crc.h",
    "chars": 384,
    "preview": "#pragma once\n\n#include <stddef.h>\n\ntypedef enum {\n  CRC_TYPE_CRC16_CCITT_FALSE = 0,\n  CRC_TYPE_CRC32 = 1,\n} crc_type_t;\n"
  },
  {
    "path": "src/bolos/cx_curve25519.c",
    "chars": 27774,
    "preview": "// Adapted from OpenSSL's curve25519 source code.\n// Original copyright below:\n\n/*\n * Copyright 2016 The OpenSSL Project"
  },
  {
    "path": "src/bolos/cx_curve25519.h",
    "chars": 191,
    "preview": "#pragma once\n\n#include <stdint.h>\n\n// Integers are in big-endian form\nint scalarmult_curve25519(uint8_t out[32], const u"
  },
  {
    "path": "src/bolos/cx_ec.c",
    "chars": 75609,
    "preview": "#include <err.h>\n#include <string.h>\n\n#include <openssl/bn.h>\n#include <openssl/ec.h>\n#include <openssl/err.h>\n#include "
  },
  {
    "path": "src/bolos/cx_ec.h",
    "chars": 17881,
    "preview": "#pragma once\n\n#ifndef _SDK_2_0_\n/** List of supported elliptic curves */\nenum cx_curve_e {\n  CX_CURVE_NONE,\n  /* -------"
  },
  {
    "path": "src/bolos/cx_ec_domain.c",
    "chars": 95416,
    "preview": "#define _SDK_2_0_\n#include <err.h>\n#include <errno.h>\n#include <openssl/bn.h>\n#include <openssl/objects.h>\n#include <ope"
  },
  {
    "path": "src/bolos/cx_ecpoint.c",
    "chars": 21062,
    "preview": "#define _SDK_2_0_\n#include <assert.h>\n#include <err.h>\n#include <errno.h>\n#include <openssl/objects.h>\n#include <openssl"
  },
  {
    "path": "src/bolos/cx_ed25519.c",
    "chars": 5273,
    "preview": "/* https://ed25519.cr.yp.to/python/ed25519.py */\n#include <err.h>\n#include <stdbool.h>\n#include <string.h>\n\n#include <op"
  },
  {
    "path": "src/bolos/cx_ed25519.h",
    "chars": 245,
    "preview": "#pragma once\n\n#include <openssl/bn.h>\n\ntypedef struct {\n  BIGNUM *x;\n  BIGNUM *y;\n} POINT;\n\nint scalarmult_ed25519(BIGNU"
  },
  {
    "path": "src/bolos/cx_hash.c",
    "chars": 7545,
    "preview": "#include <stdio.h>\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n#include \"emulate.h\"\n\nstatic const cx_hash_info_t cx_sh"
  },
  {
    "path": "src/bolos/cx_hash.h",
    "chars": 8031,
    "preview": "#pragma once\n\n#include <stdint.h>\n#include <string.h>\n\n#define CX_RIPEMD160_SIZE 20\n#define CX_SHA224_SIZE    28\n#define"
  },
  {
    "path": "src/bolos/cx_hkdf.c",
    "chars": 4068,
    "preview": "#define _SDK_2_0_\n#include \"cxlib.h\"\n#include <string.h>\n\n// HMAC-Based Key Kerivation Function defined at\n// https://to"
  },
  {
    "path": "src/bolos/cx_hkdf.h",
    "chars": 886,
    "preview": "#ifndef CX_HKDF_H\n#define CX_HKDF_H\n\n#include \"cx_hash.h\"\n\n#define CX_HKDF_MOD_R_CEIL (48)\n#define KEY_LENGTH         (3"
  },
  {
    "path": "src/bolos/cx_hmac.c",
    "chars": 6402,
    "preview": "#include <stdint.h>\n#include <string.h>\n#include <sys/types.h>\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n\n#define IP"
  },
  {
    "path": "src/bolos/cx_hmac.h",
    "chars": 1870,
    "preview": "#pragma once\n\ntypedef union {\n  cx_hash_t header;\n  cx_sha256_t sha256;\n  cx_sha512_t sha512;\n  cx_ripemd160_t ripemd160"
  },
  {
    "path": "src/bolos/cx_math.c",
    "chars": 6146,
    "preview": "#include <err.h>\n#include <stdbool.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n\n#include <openssl/bn."
  },
  {
    "path": "src/bolos/cx_math.h",
    "chars": 1622,
    "preview": "#pragma once\n\nint sys_cx_math_add(uint8_t *r, const uint8_t *a, const uint8_t *b,\n                    unsigned int len);"
  },
  {
    "path": "src/bolos/cx_montgomery.c",
    "chars": 9479,
    "preview": "#define _SDK_2_0_\n#include \"bolos/cxlib.h\"\n\n#define MAX_MONT_BYTE_LEN (56)\n\n//------------------------------------------"
  },
  {
    "path": "src/bolos/cx_mpi.c",
    "chars": 27968,
    "preview": "#define _SDK_2_0_\n#include <err.h>\n#include <errno.h>\n#include <openssl/bn.h>\n#include <openssl/rand.h>\n#include <stdboo"
  },
  {
    "path": "src/bolos/cx_ripemd160.c",
    "chars": 7990,
    "preview": "#include <stdint.h>\n#include <string.h>\n#include <sys/types.h>\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n#include \"c"
  },
  {
    "path": "src/bolos/cx_rng_rfc6979.c",
    "chars": 9151,
    "preview": "#include <stdbool.h>\n#include <string.h>\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n\n/* -----------------------------"
  },
  {
    "path": "src/bolos/cx_rng_rfc6979.h",
    "chars": 855,
    "preview": "#pragma once\n\n#include <stddef.h>\n#include <stdint.h>\n\n// In the supported elliptic curves, the order has at most 521 bi"
  },
  {
    "path": "src/bolos/cx_scc.c",
    "chars": 12208,
    "preview": "#include <stdbool.h>\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n\n/* ================================================="
  },
  {
    "path": "src/bolos/cx_sha256.c",
    "chars": 7307,
    "preview": "#include <stdint.h>\n#include <string.h>\n#include <sys/types.h>\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n#include \"c"
  },
  {
    "path": "src/bolos/cx_sha3.c",
    "chars": 11515,
    "preview": "/* @BANNER@ */\n\n#ifndef BOLOS_OS_UPGRADER\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n#include \"cx_utils.h\"\n#include <"
  },
  {
    "path": "src/bolos/cx_sha512.c",
    "chars": 12738,
    "preview": "#include <stdint.h>\n#include <string.h>\n#include <sys/types.h>\n\n#include \"bolos/exception.h\"\n#include \"cx.h\"\n#include \"c"
  },
  {
    "path": "src/bolos/cx_twisted_edwards.c",
    "chars": 9980,
    "preview": "#define _SDK_2_0_\n#include \"bolos/cxlib.h\"\n\n//--------------------------------------------------------------------------"
  },
  {
    "path": "src/bolos/cx_utils.c",
    "chars": 8124,
    "preview": "#include <err.h>\n\n#include <openssl/bn.h>\n#include <string.h>\n\n#include \"cx_utils.h\"\n/* ================================"
  },
  {
    "path": "src/bolos/cx_utils.h",
    "chars": 3916,
    "preview": "#pragma once\n\n#include <stdint.h>\n#include <unistd.h>\n\n#if UINTPTR_MAX == UINT64_MAX\n#define NATIVE_64BITS\n#endif\n\n#ifnd"
  },
  {
    "path": "src/bolos/cx_weierstrass.c",
    "chars": 1536,
    "preview": "#define _SDK_2_0_\n#include \"bolos/cxlib.h\"\n\n//--------------------------------------------------------------------------"
  },
  {
    "path": "src/bolos/cxlib.c",
    "chars": 469,
    "preview": "#define _SDK_2_0_\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"bolos/cxlib.h\"\n#include \"emulate.h\"\n\n//-------------"
  },
  {
    "path": "src/bolos/cxlib.h",
    "chars": 17142,
    "preview": "#pragma once\n#include <openssl/bn.h>\n#include <openssl/ec.h>\n#include <stdbool.h>\n\n#define _SDK_2_0_\n\n#include \"bolos/cx"
  },
  {
    "path": "src/bolos/default.c",
    "chars": 2419,
    "preview": "#include <err.h>\n#include <stddef.h>\n#include <stdio.h>\n#include <sys/mman.h>\n\n#include \"emulate.h\"\n#include \"launcher.h"
  },
  {
    "path": "src/bolos/endorsement.c",
    "chars": 8887,
    "preview": "/**\n * @file\n * @brief\n */\n\n/*********************\n *      INCLUDES\n *********************/\n\n#include \"endorsement.h\"\n#i"
  },
  {
    "path": "src/bolos/endorsement.h",
    "chars": 3691,
    "preview": "/**\n * @file endorsement.h\n * @brief Emulation of endorsement\n */\n\n#ifndef FILE_NAME_H_\n#define FILE_NAME_H_\n\n/*********"
  },
  {
    "path": "src/bolos/exception.c",
    "chars": 1229,
    "preview": "#include \"exception.h\"\n\n// custom impl of longjmp, that restores 10 registers from buf_addr (saved in\n// custom_setjmp) "
  },
  {
    "path": "src/bolos/exception.h",
    "chars": 838,
    "preview": "#pragma once\n\n#include \"errors.h\"\n#include <stdio.h>\n#include <unistd.h>\n\n// error type definition\ntypedef unsigned shor"
  },
  {
    "path": "src/bolos/fonts_info.c",
    "chars": 5875,
    "preview": "#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"fonts.h\"\n#include \"sdk.h\"\n\n#define MAX_BITMAP_CHAR"
  },
  {
    "path": "src/bolos/hdkey/include/hdkey.h",
    "chars": 2012,
    "preview": "/**\n * @file hdkey.h\n * @brief This is the public header file for hdkey.c.\n */\n\n#pragma once\n\n/*********************\n * "
  },
  {
    "path": "src/bolos/hdkey/include/hdkey_bip32.h",
    "chars": 3054,
    "preview": "/**\n * @file hdkey_bip32.h\n * @brief This is the public header file for hdkey_bip32.c.\n */\n\n#pragma once\n\n/*************"
  },
  {
    "path": "src/bolos/hdkey/include/hdkey_bls12377.h",
    "chars": 966,
    "preview": "/**\n * @file hdkey_bls12377.h\n * @brief This is the public header file for hdkey_bls12377.c.\n */\n\n#pragma once\n\n/*******"
  },
  {
    "path": "src/bolos/hdkey/include/hdkey_validate.h",
    "chars": 1107,
    "preview": "/**\n * @file hdkey_validate.h\n * @brief This is the public header file for hdkey_validate.c.\n */\n\n#pragma once\n\n/*******"
  },
  {
    "path": "src/bolos/hdkey/include/hdkey_zip32.h",
    "chars": 7687,
    "preview": "/**\n * @file hdkey_zip32.h\n * @brief This is the public header file for hdkey_zip32.c.\n */\n\n#pragma once\n\n/*************"
  },
  {
    "path": "src/bolos/hdkey/src/hdkey.c",
    "chars": 1498,
    "preview": "/**\n * @file hdkey.c\n * @brief This file contains the functions to perform deterministic key\n * derivation.\n */\n\n/******"
  },
  {
    "path": "src/bolos/hdkey/src/hdkey_bip32.c",
    "chars": 9719,
    "preview": "/**\n * @file hdkey_bip32.c\n * @brief Implementation of BIP32 derivation\n * https://github.com/bitcoin/bips/blob/master/b"
  },
  {
    "path": "src/bolos/hdkey/src/hdkey_bls12377.c",
    "chars": 3897,
    "preview": "/**\n * @file hdkey_bls12377.c\n * @brief Implementation of BLS12-377 key derivation\n * https://github.com/ProvableHQ/aleo"
  },
  {
    "path": "src/bolos/hdkey/src/hdkey_validate.c",
    "chars": 10906,
    "preview": "/**\n * @file hdkey_validate.c\n * @brief This file contains the functions to validate the context and\n * parameters to al"
  },
  {
    "path": "src/bolos/hdkey/src/hdkey_zip32.c",
    "chars": 29250,
    "preview": "/**\n * @file hdkey_zip32.c\n * @brief Implementation of ZIP32 key derivation\n */\n\n#define _SDK_2_0_\n\n/*******************"
  },
  {
    "path": "src/bolos/io/io.c",
    "chars": 5927,
    "preview": "#include <assert.h>\n#include <err.h>\n#include <errno.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <unistd.h>\n\n#inc"
  },
  {
    "path": "src/bolos/io/io.h",
    "chars": 777,
    "preview": "#pragma once\n\n#include <stdbool.h>\n\n#include \"os_io.h\"\n\nint sys_os_io_init(os_io_init_t *init);\n\nint sys_os_io_start(voi"
  },
  {
    "path": "src/bolos/io/mock/include/checks.h",
    "chars": 13,
    "preview": "#pragma once\n"
  },
  {
    "path": "src/bolos/io/mock/include/cx_rng_internal.h",
    "chars": 70,
    "preview": "#pragma once\n\n#include \"os_utils.h\"\n#define cx_rng_internal sys_cx_rng"
  },
  {
    "path": "src/bolos/io/mock/include/decorators.h",
    "chars": 1237,
    "preview": "#pragma once\n\n#ifndef SYSCALL\n// #define SYSCALL syscall\n#define SYSCALL\n#endif\n\n#ifndef TASKSWITCH\n// #define TASKSWITC"
  },
  {
    "path": "src/bolos/io/mock/include/exceptions.h",
    "chars": 33,
    "preview": "#pragma once\n\n#include \"errors.h\""
  },
  {
    "path": "src/bolos/io/mock/include/lcx_hash.h",
    "chars": 12,
    "preview": "#pragma once"
  },
  {
    "path": "src/bolos/io/mock/include/lcx_sha512.h",
    "chars": 12,
    "preview": "#pragma once"
  },
  {
    "path": "src/bolos/io/mock/include/os.h",
    "chars": 889,
    "preview": "#pragma once\n\n#include <stdlib.h>\n#include <string.h>\n\n#include \"bolos/io/io.h\"\n#include \"os_helpers.h\"\n#include \"os_mat"
  },
  {
    "path": "src/bolos/io/mock/include/os_debug.h",
    "chars": 13,
    "preview": "#pragma once\n"
  },
  {
    "path": "src/bolos/io/mock/include/os_helpers.h",
    "chars": 67,
    "preview": "#pragma once\r\n\r\n#ifndef UNUSED\r\n#define UNUSED(x) (void)x\r\n#endif\r\n"
  },
  {
    "path": "src/bolos/io/mock/include/os_id.h",
    "chars": 13,
    "preview": "#pragma once\n"
  },
  {
    "path": "src/bolos/io/mock/include/os_math.h",
    "chars": 186,
    "preview": "#pragma once\n\n#ifndef MIN\n#define MIN(x, y) ((x) < (y) ? (x) : (y))\n#endif\n#ifndef MAX\n#define MAX(x, y) ((x) > (y) ? (x"
  },
  {
    "path": "src/bolos/io/mock/include/os_pic.h",
    "chars": 36,
    "preview": "#pragma once\r\n\r\n#define PIC(x) (x)\r\n"
  },
  {
    "path": "src/bolos/io/mock/include/os_pin.h",
    "chars": 199,
    "preview": "#pragma once\n\n#include \"os_types.h\"\n\nstatic inline bolos_bool_t os_global_pin_is_validated(void)\n{\n  return BOLOS_TRUE;\n"
  },
  {
    "path": "src/bolos/io/mock/include/os_pki.h",
    "chars": 13,
    "preview": "#pragma once\n"
  },
  {
    "path": "src/bolos/io/mock/include/os_registry.h",
    "chars": 13,
    "preview": "#pragma once\n"
  },
  {
    "path": "src/bolos/io/mock/include/os_seed.h",
    "chars": 13,
    "preview": "#pragma once\n"
  },
  {
    "path": "src/bolos/io/mock/include/os_utils.h",
    "chars": 743,
    "preview": "#pragma once\n\n#include <stdint.h>\n#include <string.h>\n\nstatic inline uint16_t U2BE(const uint8_t *buf, size_t off)\n{\n  r"
  },
  {
    "path": "src/bolos/io/mock/include/ux.h",
    "chars": 888,
    "preview": "#pragma once\n\n#include \"emulate.h\"\n#include \"os.h\"\n\ntypedef enum bolos_ux_public_e {\n  BOLOS_UX_INITIALIZE = 0,\n  BOLOS_"
  },
  {
    "path": "src/bolos/io/mock/src/mock.c",
    "chars": 64,
    "preview": "\n#include \"os.h\"\n#include \"ux.h\"\n\nbolos_ux_params_t G_ux_params;"
  },
  {
    "path": "src/bolos/io/sdk/include/appflags.h",
    "chars": 3389,
    "preview": "#pragma once\n\n#include <stdint.h>\n\n/**\n * Base flag added to loaded application, to allow them to call all syscalls by\n "
  },
  {
    "path": "src/bolos/io/sdk/include/errors.h",
    "chars": 6162,
    "preview": "\n/*******************************************************************************\n *   Ledger Nano S - Secure firmware\n "
  },
  {
    "path": "src/bolos/io/sdk/include/os_apdu.h",
    "chars": 441,
    "preview": "#pragma once\r\n\r\n/* ----------------------------------------------------------------------- */\r\n/* -                     "
  },
  {
    "path": "src/bolos/io/sdk/include/os_app.h",
    "chars": 2532,
    "preview": "#pragma once\n\n#include <stdint.h>\n\n// Arbitrary max size for application name and version.\n#define BOLOS_APPNAME_MAX_SIZ"
  },
  {
    "path": "src/bolos/io/sdk/include/os_errors.h",
    "chars": 7422,
    "preview": "#ifndef OS_ERRORS_H\n#define OS_ERRORS_H\n\n#include <stdint.h>\n\n/**\n * The OS error codes are encoded on two bytes (0xabcd"
  }
]

// ... and 226 more files (download for full content)

About this extraction

This page contains the full source code of the LedgerHQ/speculos GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 426 files (21.0 MB), approximately 5.5M tokens, and a symbol index with 3464 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!