@compass-labs/api-sdk 2.2.59-rc.0 → 2.2.60-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/codeSamples_typescript.yaml +21 -21
  2. package/dist/commonjs/lib/config.d.ts +2 -2
  3. package/dist/commonjs/lib/config.js +2 -2
  4. package/dist/esm/lib/config.d.ts +2 -2
  5. package/dist/esm/lib/config.js +2 -2
  6. package/docs/models/components/approvetransferrequest.md +2 -2
  7. package/docs/models/components/createaccountrequest.md +4 -4
  8. package/docs/models/components/depositforburnrequest.md +2 -2
  9. package/docs/models/components/earnmanagerequest.md +2 -2
  10. package/docs/models/components/earnswaprequest.md +2 -2
  11. package/docs/models/components/earntransferrequest.md +2 -2
  12. package/docs/models/components/globalmarketsperpsapprovebuilderfeerequest.md +2 -2
  13. package/docs/models/components/globalmarketsperpscancelorderrequest.md +2 -2
  14. package/docs/models/components/globalmarketsperpsdepositrequest.md +2 -2
  15. package/docs/models/components/globalmarketsperpsdepositsponsorpreparerequest.md +2 -2
  16. package/docs/models/components/globalmarketsperpslimitorderrequest.md +2 -2
  17. package/docs/models/components/globalmarketsperpsmarketorderrequest.md +2 -2
  18. package/docs/models/components/globalmarketsperpswithdrawrequest.md +2 -2
  19. package/docs/models/components/v2bundlerequest.md +2 -2
  20. package/docs/models/operations/v2creditbalancesrequest.md +2 -2
  21. package/docs/models/operations/v2creditpositionsrequest.md +2 -2
  22. package/docs/models/operations/v2earnbalancesrequest.md +2 -2
  23. package/docs/models/operations/v2earnpositionsallrequest.md +2 -2
  24. package/docs/models/operations/v2earnpositionsrequest.md +2 -2
  25. package/docs/models/operations/v2globalmarketsperpsactivityrequest.md +2 -2
  26. package/docs/models/operations/v2globalmarketsperpspositionsrequest.md +2 -2
  27. package/docs/sdks/bridge/README.md +2 -2
  28. package/docs/sdks/credit/README.md +4 -4
  29. package/docs/sdks/earn/README.md +18 -18
  30. package/docs/sdks/gassponsorship/README.md +2 -2
  31. package/docs/sdks/globalmarketsperps/README.md +18 -18
  32. package/examples/node_modules/tsx/dist/cli.cjs +1 -1
  33. package/examples/node_modules/tsx/dist/cli.mjs +1 -1
  34. package/examples/node_modules/tsx/dist/esm/api/index.cjs +1 -1
  35. package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -1
  36. package/examples/node_modules/tsx/dist/esm/index.cjs +1 -1
  37. package/examples/node_modules/tsx/dist/esm/index.mjs +1 -1
  38. package/examples/node_modules/tsx/dist/loader.cjs +1 -1
  39. package/examples/node_modules/tsx/dist/loader.mjs +1 -1
  40. package/examples/node_modules/tsx/dist/package-Bj47PlGH.mjs +1 -0
  41. package/examples/node_modules/tsx/dist/package-DMqO70yR.cjs +1 -0
  42. package/examples/node_modules/tsx/dist/register-CKju0f8h.cjs +2 -0
  43. package/examples/node_modules/tsx/dist/register-CqMfTiWi.mjs +2 -0
  44. package/examples/node_modules/tsx/dist/repl.cjs +1 -1
  45. package/examples/node_modules/tsx/dist/repl.mjs +1 -1
  46. package/examples/node_modules/tsx/package.json +1 -1
  47. package/examples/package-lock.json +3 -3
  48. package/openapi_prepped_for_speakeasy.json +37 -37
  49. package/package.json +1 -1
  50. package/src/lib/config.ts +2 -2
  51. package/examples/node_modules/tsx/dist/package-CGdS2_oX.cjs +0 -1
  52. package/examples/node_modules/tsx/dist/package-DyJMwVU5.mjs +0 -1
  53. package/examples/node_modules/tsx/dist/register-CHVGxKtC.cjs +0 -2
  54. package/examples/node_modules/tsx/dist/register-D_B8UL5H.mjs +0 -2
@@ -4885,7 +4885,7 @@
4885
4885
  "schema": {
4886
4886
  "type": "string",
4887
4887
  "title": "Owner",
4888
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
4888
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
4889
4889
  },
4890
4890
  "description": "The address of the owner of the earn account to get positions for."
4891
4891
  }
@@ -4931,7 +4931,7 @@
4931
4931
  "schema": {
4932
4932
  "type": "string",
4933
4933
  "title": "Owner",
4934
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
4934
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
4935
4935
  },
4936
4936
  "description": "The address of the owner of the earn account."
4937
4937
  }
@@ -5383,7 +5383,7 @@
5383
5383
  "schema": {
5384
5384
  "type": "string",
5385
5385
  "title": "Owner",
5386
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
5386
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
5387
5387
  },
5388
5388
  "description": "The address of the owner of the earn account."
5389
5389
  }
@@ -5781,7 +5781,7 @@
5781
5781
  "schema": {
5782
5782
  "type": "string",
5783
5783
  "title": "Owner",
5784
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
5784
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
5785
5785
  },
5786
5786
  "description": "The address of the owner of the credit account to get positions for."
5787
5787
  }
@@ -5843,7 +5843,7 @@
5843
5843
  "schema": {
5844
5844
  "type": "string",
5845
5845
  "title": "Owner",
5846
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
5846
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
5847
5847
  },
5848
5848
  "description": "The address of the owner of the credit account."
5849
5849
  }
@@ -6224,7 +6224,7 @@
6224
6224
  "schema": {
6225
6225
  "type": "string",
6226
6226
  "title": "Owner",
6227
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
6227
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
6228
6228
  },
6229
6229
  "description": "User's EOA address (looks up their global markets perps product account)"
6230
6230
  },
@@ -6405,7 +6405,7 @@
6405
6405
  "schema": {
6406
6406
  "type": "string",
6407
6407
  "title": "Owner",
6408
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
6408
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
6409
6409
  },
6410
6410
  "description": "End-user EOA whose activity should be fetched."
6411
6411
  },
@@ -10203,7 +10203,7 @@
10203
10203
  "type": "string",
10204
10204
  "title": "Owner",
10205
10205
  "description": "The wallet address that owns the Earn Account.",
10206
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
10206
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
10207
10207
  },
10208
10208
  "chain": {
10209
10209
  "$ref": "#/components/schemas/Chain",
@@ -10232,7 +10232,7 @@
10232
10232
  "title": "ApproveTransferRequest",
10233
10233
  "example": {
10234
10234
  "chain": "base",
10235
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
10235
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
10236
10236
  "token": "USDT"
10237
10237
  }
10238
10238
  },
@@ -10910,7 +10910,7 @@
10910
10910
  "type": "string",
10911
10911
  "title": "Sender",
10912
10912
  "description": "The address of the transaction sender.",
10913
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
10913
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
10914
10914
  },
10915
10915
  "estimate_gas": {
10916
10916
  "type": "boolean",
@@ -10922,7 +10922,7 @@
10922
10922
  "type": "string",
10923
10923
  "title": "Owner",
10924
10924
  "description": "The address that will own and control the compass account",
10925
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
10925
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
10926
10926
  }
10927
10927
  },
10928
10928
  "type": "object",
@@ -10935,8 +10935,8 @@
10935
10935
  "description": "Request to create a compass account.",
10936
10936
  "example": {
10937
10937
  "chain": "base",
10938
- "sender": "0x01E62835dd7F52173546A325294762143eE4a882",
10939
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882"
10938
+ "sender": "0x06A9aF046187895AcFc7258450B15397CAc67400",
10939
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400"
10940
10940
  }
10941
10941
  },
10942
10942
  "CreateAccountResponse": {
@@ -12359,7 +12359,7 @@
12359
12359
  "type": "string",
12360
12360
  "title": "Owner",
12361
12361
  "description": "The primary wallet address that owns and controls the Product Account.",
12362
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
12362
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
12363
12363
  },
12364
12364
  "chain": {
12365
12365
  "type": "string",
@@ -12424,7 +12424,7 @@
12424
12424
  ],
12425
12425
  "title": "DepositForBurnRequest",
12426
12426
  "example": {
12427
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
12427
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
12428
12428
  "chain": "arbitrum",
12429
12429
  "amount": "3",
12430
12430
  "destination_chain": "base",
@@ -12790,7 +12790,7 @@
12790
12790
  "type": "string",
12791
12791
  "title": "Owner",
12792
12792
  "description": "The primary wallet address that owns and controls the Earn Account.",
12793
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
12793
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
12794
12794
  },
12795
12795
  "chain": {
12796
12796
  "$ref": "#/components/schemas/Chain",
@@ -12815,7 +12815,7 @@
12815
12815
  "title": "EarnManageRequest",
12816
12816
  "description": "Request model for the unified manage endpoint.\n\nInherits from EarnManageParams and adds context fields (owner, chain, etc).",
12817
12817
  "example": {
12818
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
12818
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
12819
12819
  "chain": "base",
12820
12820
  "venue": {
12821
12821
  "type": "VAULT",
@@ -13041,7 +13041,7 @@
13041
13041
  "type": "string",
13042
13042
  "title": "Owner",
13043
13043
  "description": "The owner's wallet address.",
13044
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
13044
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
13045
13045
  },
13046
13046
  "chain": {
13047
13047
  "$ref": "#/components/schemas/Chain",
@@ -13066,7 +13066,7 @@
13066
13066
  "title": "EarnSwapRequest",
13067
13067
  "description": "Request model for swap endpoint.\n\nInherits swap params and adds context fields (owner, chain, gas_sponsorship).",
13068
13068
  "example": {
13069
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
13069
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
13070
13070
  "chain": "base",
13071
13071
  "token_in": "USDC",
13072
13072
  "token_out": "USDT",
@@ -13175,7 +13175,7 @@
13175
13175
  "type": "string",
13176
13176
  "title": "Owner",
13177
13177
  "description": "The owner's wallet address.",
13178
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
13178
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
13179
13179
  },
13180
13180
  "chain": {
13181
13181
  "$ref": "#/components/schemas/Chain",
@@ -13254,7 +13254,7 @@
13254
13254
  ],
13255
13255
  "title": "EarnTransferRequest",
13256
13256
  "example": {
13257
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
13257
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
13258
13258
  "chain": "base",
13259
13259
  "token": "USDC",
13260
13260
  "amount": "0.01",
@@ -14008,7 +14008,7 @@
14008
14008
  "type": "string",
14009
14009
  "title": "Owner",
14010
14010
  "description": "User's EOA address",
14011
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
14011
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
14012
14012
  },
14013
14013
  "builder": {
14014
14014
  "$ref": "#/components/schemas/Builder",
@@ -14027,7 +14027,7 @@
14027
14027
  "title": "GlobalMarketsPerpsApproveBuilderFeeRequest",
14028
14028
  "description": "Request to approve builder fees before trading on the global markets perps DEX.",
14029
14029
  "example": {
14030
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
14030
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
14031
14031
  "builder": {
14032
14032
  "address": "0x88806A71D74AD0a510B350545C9AE490912F0888",
14033
14033
  "max_fee_rate": "0.01%"
@@ -14067,7 +14067,7 @@
14067
14067
  "type": "string",
14068
14068
  "title": "Owner",
14069
14069
  "description": "Owner of the global markets perps product account",
14070
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
14070
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
14071
14071
  },
14072
14072
  "asset": {
14073
14073
  "type": "string",
@@ -14109,7 +14109,7 @@
14109
14109
  "title": "GlobalMarketsPerpsCancelOrderRequest",
14110
14110
  "description": "Request to cancel an open order on a global markets perps market.",
14111
14111
  "example": {
14112
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
14112
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
14113
14113
  "asset": "AAPL",
14114
14114
  "order_id": 12345
14115
14115
  }
@@ -14159,7 +14159,7 @@
14159
14159
  "type": "string",
14160
14160
  "title": "Owner",
14161
14161
  "description": "The user's EOA address on Arbitrum",
14162
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
14162
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
14163
14163
  },
14164
14164
  "amount": {
14165
14165
  "type": "string",
@@ -14176,7 +14176,7 @@
14176
14176
  "title": "GlobalMarketsPerpsDepositRequest",
14177
14177
  "description": "Request to deposit USDC from Arbitrum into the user's global markets perps account.",
14178
14178
  "example": {
14179
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
14179
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
14180
14180
  "amount": "100.0"
14181
14181
  }
14182
14182
  },
@@ -14212,7 +14212,7 @@
14212
14212
  "type": "string",
14213
14213
  "title": "Owner",
14214
14214
  "description": "The user's EOA address on Arbitrum (the permit signer).",
14215
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
14215
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
14216
14216
  },
14217
14217
  "amount_raw": {
14218
14218
  "type": "integer",
@@ -14252,7 +14252,7 @@
14252
14252
  "title": "GlobalMarketsPerpsDepositSponsorPrepareRequest",
14253
14253
  "description": "Take a user's signed EIP-2612 USDC permit and build an Arbitrum tx\nthat calls Bridge2.batchedDepositWithPermit.\n\nThe customer broadcasts the returned tx from their own sponsor wallet \u2014\nCompass does not hold gas keys (non-custodial).",
14254
14254
  "example": {
14255
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
14255
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
14256
14256
  "amount_raw": 100000000,
14257
14257
  "deadline": 1747097383,
14258
14258
  "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
@@ -14561,7 +14561,7 @@
14561
14561
  "type": "string",
14562
14562
  "title": "Owner",
14563
14563
  "description": "Owner of the global markets perps product account",
14564
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
14564
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
14565
14565
  },
14566
14566
  "asset": {
14567
14567
  "type": "string",
@@ -14634,7 +14634,7 @@
14634
14634
  "title": "GlobalMarketsPerpsLimitOrderRequest",
14635
14635
  "description": "Request to place a limit order on a global markets perps market.",
14636
14636
  "example": {
14637
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
14637
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
14638
14638
  "asset": "AAPL",
14639
14639
  "side": "buy",
14640
14640
  "size": "10.0",
@@ -14649,7 +14649,7 @@
14649
14649
  "type": "string",
14650
14650
  "title": "Owner",
14651
14651
  "description": "Owner of the global markets perps product account",
14652
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
14652
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
14653
14653
  },
14654
14654
  "asset": {
14655
14655
  "type": "string",
@@ -14705,7 +14705,7 @@
14705
14705
  "title": "GlobalMarketsPerpsMarketOrderRequest",
14706
14706
  "description": "Request to place a market order on a global markets perps market.",
14707
14707
  "example": {
14708
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
14708
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
14709
14709
  "asset": "AAPL",
14710
14710
  "side": "buy",
14711
14711
  "size": "10.0",
@@ -15022,7 +15022,7 @@
15022
15022
  "type": "string",
15023
15023
  "title": "Owner",
15024
15024
  "description": "The user's EOA address (owner of the global markets perps account)",
15025
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
15025
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
15026
15026
  },
15027
15027
  "amount": {
15028
15028
  "type": "string",
@@ -15051,7 +15051,7 @@
15051
15051
  "title": "GlobalMarketsPerpsWithdrawRequest",
15052
15052
  "description": "Request to withdraw USDC from HyperEVM global markets perps account to Arbitrum.",
15053
15053
  "example": {
15054
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
15054
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
15055
15055
  "amount": "100.0"
15056
15056
  }
15057
15057
  },
@@ -23113,7 +23113,7 @@
23113
23113
  "type": "string",
23114
23114
  "title": "Owner",
23115
23115
  "description": "The owner's wallet address that controls the Earn Account.",
23116
- "example": "0x01E62835dd7F52173546A325294762143eE4a882"
23116
+ "example": "0x06A9aF046187895AcFc7258450B15397CAc67400"
23117
23117
  },
23118
23118
  "chain": {
23119
23119
  "$ref": "#/components/schemas/Chain",
@@ -23177,7 +23177,7 @@
23177
23177
  "title": "V2BundleRequest",
23178
23178
  "description": "Request to execute multiple earn actions in a single atomic transaction.\n\n## Supported Action Types\n\n- **V2_TRANSFER_FROM_EOA**: Transfer tokens from the owner's EOA to the product account\n using Permit2. Requires a signed Permit2 message.\n- **V2_TRANSFER_TO_EOA**: Transfer tokens from the product account back to the owner's EOA.\n No signature required (product account owns the tokens).\n- **V2_TRANSFER_TO_ADDRESS**: Transfer ERC20 tokens from the product account to any\n specified recipient address. No signature required (product account owns the tokens).\n- **V2_SWAP**: Swap tokens within the product account using 1inch aggregator.\n- **V2_MANAGE**: Deposit or withdraw from DeFi venues (Aave, Morpho, Vaults, etc.)\n\n## Using V2_TRANSFER_FROM_EOA (Deposit to Product Account)\n\nTo include a transfer from EOA in your bundle, follow these steps:\n\n1. **One-time setup**: Approve Permit2 to spend the token by calling\n `POST /v2/gas_sponsorship/approve_transfer` and executing the returned transaction.\n\n2. **Get Permit2 signature**: Call `POST /v2/earn/transfer` with:\n - `action`: \"DEPOSIT\"\n - `gas_sponsorship`: true\n - `spender`: omit this field (defaults to product account address for bundle use)\n\n This returns EIP-712 typed data. Sign it with the owner's wallet.\n\n3. **Include in bundle**: Add a V2_TRANSFER_FROM_EOA action with the signature\n and nonce/deadline from the typed data.\n\nThe bundle will atomically: pull tokens from EOA \u2192 execute subsequent actions.\n\n## Using V2_TRANSFER_TO_EOA (Withdraw to EOA)\n\nTo transfer tokens from the product account back to the owner's EOA, simply add\na V2_TRANSFER_TO_EOA action to your bundle. No signature is required since\nthe product account already owns the tokens.\n\nSpecify the exact token amount to transfer.",
23179
23179
  "example": {
23180
- "owner": "0x01E62835dd7F52173546A325294762143eE4a882",
23180
+ "owner": "0x06A9aF046187895AcFc7258450B15397CAc67400",
23181
23181
  "chain": "ethereum",
23182
23182
  "actions": [
23183
23183
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "2.2.59-rc.0",
3
+ "version": "2.2.60-rc.0",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "tshy": {
package/src/lib/config.ts CHANGED
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
64
  sdkVersion: "2.0.0",
65
- genVersion: "2.889.1",
65
+ genVersion: "2.893.0",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 2.0.0 2.889.1 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 2.0.0 2.893.0 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
@@ -1 +0,0 @@
1
- "use strict";var r="4.22.3";exports.version=r;
@@ -1 +0,0 @@
1
- var r="4.22.3";export{r as v};
@@ -1,2 +0,0 @@
1
- "use strict";var fe=Object.defineProperty;var l=(e,r)=>fe(e,"name",{value:r,configurable:!0});var T=require("node:module"),pe=require("node:worker_threads"),y=require("./node-features-CQLdkVE6.cjs"),n=require("./register-BOkp8V6j.cjs"),g=require("node:url"),ge=require("node:fs"),he=require("node:fs/promises"),h=require("./index-D9F1FXzN.cjs"),z=require("./client-D3mGB526.cjs"),S=require("node:path"),L=typeof document<"u"?document.currentScript:null;const F={active:!0,parsedTsconfig:void 0},X=l(e=>{const r={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(r.parsedTsconfig=n.loadTsconfig(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),r},"createData"),ye=l(async e=>{if(!e)throw new Error(`tsx must be loaded with --import instead of --loader
2
- The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(F,X(e)),e.port&&e.port.on("message",r=>{r==="deactivate"&&(F.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Pe=l(()=>(F.parsedTsconfig=n.loadTsconfig(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),Re=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageType(e)},"getFormatFromFileUrl"),Ue=l(e=>{const{pathname:r}=new URL(e),t=S.extname(r);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||n.tsExtensions.includes(t))return n.getPackageTypeSync(e)},"getFormatFromFileUrlSync"),U="tsx-namespace=",$="tsx-commonjs-export-preparse",V=`${$}=1`,j="tsx-commonjs-virtual-query",I=new Map,B=l((e,r)=>e.slice(1).split("&").filter(t=>t&&r.every(s=>!t.startsWith(s))).join("&"),"getQueryWithoutParameters"),W=l((e,r)=>{const t=B(e,r);return t?`?${t}`:""},"getSearchWithoutParameters"),Se=l(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),Ee=l(e=>{const r=Se(e);if(/^\s*export\s*\*/.test(r))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(r))return"namespace";const t=r.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(s=>{const o=s.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),ve=l((e,r,t)=>{const s=I.get(e);if(!s)return!1;try{const[o]=h.parseEsm(s);return o.some(i=>{if(i.d!==-1||i.n!==r)return!1;const m=Ee(s.slice(i.ss,i.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),E=l(e=>{const r=e.indexOf(U);if(r===-1)return;const t=e[r-1];if(t!=="?"&&t!=="&")return;const s=r+U.length,o=e.indexOf("&",s);return o===-1?e.slice(s):e.slice(s,o)},"getNamespace"),K=y.isFeatureSupported(y.importAttributes)?"importAttributes":"importAssertions",Y=l(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),Z=l(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Te=y.isFeatureSupported(y.esmLoadReadFile),Le=[`${j}=`],J=[`${$}=`,`${j}=`],v=l((e,r)=>r.parsedTsconfig&&n.je(r.parsedTsconfig,e)?r.parsedTsconfig.config:void 0,"getTsconfigRaw"),we=l(e=>{if(!e.searchParams.has(j))return;const{pathname:r}=e,t=r.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const s=new URL(e);return s.pathname=r.slice(0,t),s.search="",g.fileURLToPath(s)},"getFilePathFromVirtualQuery"),x=l(e=>{const r=e.startsWith(n.fileUrlPrefix)?new URL(e):void 0,t=r?g.fileURLToPath(r):e,s=r&&we(r),o=s||t,i=r&&s?g.pathToFileURL(o).toString()+W(r.search,Le):e;return{fileUrl:r,filePath:o,loadUrl:i}},"getFileLoadContext"),k=l((e,r)=>{if(!r?.search)return e;const t=W(r.search,J);return t?g.pathToFileURL(e).toString()+t:e},"getTransformPath"),ee=l((e,r,t)=>{const s=[...r?B(r.search,[U,...J]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return s?`${e}?${s}`:e},"getFilePathWithQuery"),Fe=new TextDecoder,te=l(e=>typeof e=="string"?e:Fe.decode(e),"decodeSource"),je=l((e,r)=>{const t=new URL(r),s=r.startsWith(n.fileUrlPrefix)?x(r).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete($),t.searchParams.delete(j),s&&(t.pathname=new URL(g.pathToFileURL(s)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),re=l((e,r)=>{if(!e.active)return!1;const t=E(r);if(e.namespace&&e.namespace!==t)return!1;const s=je(e,r);return z.parent.send&&z.parent.send({type:"dependency",path:s}),!0},"prepareLoad"),se=l((e,r)=>{if(!n.isJsonPattern.test(e))return r;const t=r[K];return t?.type?r:{...r,[K]:{...t,type:"json"}}},"prepareJsonAttributes"),Q=l(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),Ie=l(e=>{const r=l(async(t,s,o)=>{if(!re(e,t))return o(t,s);const i=E(t),{fileUrl:m,filePath:c,loadUrl:a}=x(t),u=se(a,s),d=await o(a,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:a,loaded:d});const P=m?.searchParams.has($)===!0,R=d.format,w=m?new URL(g.pathToFileURL(c)):void 0;if(w&&m&&(w.search=W(m.search,J)),Y(R)&&m&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await he.readFile(g.pathToFileURL(c),"utf8"),b=h.isESM(f);if(R==="commonjs-typescript"||!c.endsWith(".js")||b){if(!Te){if(P&&b&&n.implicitTsExtensionsPattern.test(c)){const C=await h.transform(f,c,{define:{"import.meta.url":JSON.stringify(w.toString())},tsconfigRaw:v(c,e)});return I.set(t,C.code),{format:"module",source:n.inlineSourceMap(C)}}return d}if(!i&&!P&&!c.endsWith(".cts"))return d;const G=!!(i||P||W(m.search,J)),D=h.transformSync(f,k(c,m),{cjsBanner:G?`require = require("node:module").createRequire(${JSON.stringify(g.pathToFileURL(c).toString())});`:void 0,tsconfigRaw:v(c,e)});if(d.format="commonjs",d.source=n.inlineSourceMap(D),G){const C=ee(c,m,i);d.responseURL=`data:text/javascript,${encodeURIComponent(D.code)}?filePath=${encodeURIComponent(C)}`}return n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const p=te(d.source),_=R==="json"&&!Q(s);if(R==="commonjs-typescript"){const f=h.transformSync(p,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",source:n.inlineSourceMap(f)}}if(_||Z(R)||n.tsExtensionsPattern.test(t)){const f=await h.transform(p,c,{tsconfigRaw:v(c,e)});return I.set(t,f.code),{format:"module",source:n.inlineSourceMap(f)}}if(d.format==="module"){const f=h.transformDynamicImport(c,p);f?(d.source=n.inlineSourceMap(f),I.set(t,f.code)):I.set(t,p)}return d},"load2");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"load",{url:t,context:s});const i=await r(t,s,o);return n.logEsm(1,"loaded",{url:t,result:i}),i}:r},"createLoad"),_e=l(e=>{const r=l((t,s,o)=>{if(Q(s)&&n.isGlobalCjsLoaderActive()||!re(e,t))return o(t,s);const i=E(t),{fileUrl:m,filePath:c,loadUrl:a}=x(t),u=se(a,s),d=o(a,u);n.logEsm(3,"loaded by next loader",{url:t,loadUrl:a,loaded:d});const P=d.format;if(Y(P)&&y.isFeatureSupported(y.esmLoadReadFile)&&d.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=ge.readFileSync(g.pathToFileURL(c),"utf8");if(P==="commonjs-typescript"||!c.endsWith(".js")||h.isESM(p)){const _=h.transformSync(p,k(c,m),{tsconfigRaw:v(c,e)}),f=!i&&n.isGlobalCjsLoaderActive(),b=ee(c,m,i);return d.format="commonjs",d.shouldBeReloadedByCJSLoader=f,d.source=n.inlineSourceMap(_),f||(d.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent(b)}`),n.logEsm(3,"returning CJS export annotation",d),d}}if(!d.source)return d;const R=te(d.source),w=P==="json"&&!Q(s);if(P==="commonjs-typescript"){const p=h.transformSync(R,c,{tsconfigRaw:v(c,e)});return{...d,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:n.inlineSourceMap(p)}}if(w||Z(P)||n.tsExtensionsPattern.test(t)){const p=h.transformEsmSync(R,c,{tsconfigRaw:v(c,e)});return{format:"module",source:n.inlineSourceMap(p)}}if(d.format==="module"){const p=h.transformDynamicImport(c,R);p&&(d.source=n.inlineSourceMap(p))}return d},"load2");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"loadSync",{url:t,context:s});const i=r(t,s,o);return n.logEsm(1,"loadedSync",{url:t,result:i}),i}:r},"createLoadSync"),be=Ie(F),Ce=y.isFeatureSupported(y.esmLoadReadFile),$e=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,oe=l(e=>!n.isFilePath(e)&&!$e.test(e),"isTsconfigPathAliasSpecifier"),M=l(e=>{if(e.url)return e.url;const r=e.message.match(/^Cannot find module '([^']+)'/);if(r){const[,s]=r;return s}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,s]=t;if(!S.isAbsolute(s))return;const o=g.pathToFileURL(s);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const i=h.readJsonFile(o);if(i?.main)return new URL(i.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),O=l(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),N=l(async(e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensions",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let i;for(const m of o)try{return await t(m,r)}catch(c){const{code:a}=c;if(!O(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;i=c}if(s)throw i},"resolveExtensions"),q=l((e,r,t,s)=>{const o=n.mapTsExtensions(e);if(n.logEsm(3,"resolveExtensionsSync",{url:e,context:r,throwError:s,tryPaths:o}),!o)return;let i;for(const m of o)try{return t(m,r)}catch(c){const{code:a}=c;if(!O(a)&&a!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;i=c}if(s)throw i},"resolveExtensionsSync"),We=l(async(e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBase",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const i=await N(e,r,t);if(n.logEsm(3,"resolveBase resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return await t(e,r)}catch(i){if(n.logEsm(3,"resolveBase error",{specifier:e,context:r,error:i}),i instanceof Error){const m=i;if(O(m.code)){const c=M(m);if(c){const a=await N(c,r,t);if(a)return a}}}throw i}},"resolveBase"),Je=l((e,r,t,s)=>{const o=s.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(n.logEsm(3,"resolveBaseSync",{specifier:e,context:r,specifierStartsWithFileUrl:e.startsWith(n.fileUrlPrefix),isRelativePath:n.isRelativePath(e),tsExtensionsPattern:n.tsExtensionsPattern.test(r.parentURL),allowJs:o}),(e.startsWith(n.fileUrlPrefix)||n.isRelativePath(e))&&(n.tsExtensionsPattern.test(r.parentURL)||o)){const i=q(e,r,t);if(n.logEsm(3,"resolveBaseSync resolved",{specifier:e,context:r,resolved:i}),i)return i}try{return t(e,r)}catch(i){if(n.logEsm(3,"resolveBaseSync error",{specifier:e,context:r,error:i}),i instanceof Error){const m=i;if(O(m.code)){const c=M(m);if(c){const a=q(c,r,t);if(a)return a}}}throw i}},"resolveBaseSync"),ne=l(async(e,r,t,s)=>{if(n.logEsm(3,"resolveDirectory",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=new URL(e,r.parentURL);return o.pathname=S.join(o.pathname,"index"),await N(o.toString(),r,t,!0)}try{return await We(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectory error",{specifier:e,context:r,error:o});const i=o;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=M(i);if(m)try{return await N(`${m}/index`,r,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",S.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectory"),ae=l((e,r,t,s)=>{if(n.logEsm(3,"resolveDirectorySync",{specifier:e,context:r,isDirectory:n.isDirectoryPattern.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),n.isDirectoryPattern.test(e)){const o=new URL(e,r.parentURL);return o.pathname=S.join(o.pathname,"index"),q(o.toString(),r,t,!0)}try{return Je(e,r,t,s)}catch(o){if(o instanceof Error){n.logEsm(3,"resolveDirectorySync error",{specifier:e,context:r,error:o});const i=o;if(i.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=M(i);if(m)try{return q(`${m}/index`,r,t,!0)}catch(c){const a=c,{message:u}=a;throw a.message=a.message.replace(`${"/index".replace("/",S.sep)}'`,"'"),a.stack=a.stack.replace(u,a.message),a}}}throw o}},"resolveDirectorySync"),Me=l(async(e,r,t,s)=>{const o=oe(e);if(n.logEsm(3,"resolveTsPaths",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const i=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPaths",{possiblePaths:i});for(const m of i)try{return await ne(g.pathToFileURL(m).toString(),r,t,s)}catch{}}return ne(e,r,t,s)},"resolveTsPaths"),Oe=l((e,r,t,s)=>{const o=oe(e);if(n.logEsm(3,"resolveTsPathsSync",{specifier:e,context:r,tsconfigPathAliasSpecifier:o,tsconfig:s.parsedTsconfig,fromNodeModules:r.parentURL?.includes("/node_modules/")}),o&&s.parsedTsconfig&&!r.parentURL?.includes("/node_modules/")){const i=n.wt(s.parsedTsconfig,e);n.logEsm(3,"resolveTsPathsSync",{possiblePaths:i});for(const m of i)try{return ae(g.pathToFileURL(m).toString(),r,t,s)}catch{}}return ae(e,r,t,s)},"resolveTsPathsSync"),A="tsx://",Ne=l(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),H=l((e,r)=>`${e}${e.includes("?")?"&":"?"}${r}`,"addQuery"),ie=l((e,r,t)=>{if(r!=="commonjs"||!e.startsWith(n.fileUrlPrefix)||!n.implicitTsExtensionsPattern.test(e))return e;const s=new URL(e),o=[B(s.search,[U]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(s.pathname+=`%3F${o}`,s.searchParams.set(j,"1"),s.toString()):e},"preserveCommonJsQueryIdentity"),qe=l(e=>{const r=l(async(t,s,o)=>{if(!e.active||t.startsWith("node:"))return o(t,s);let i=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let d;if(t.startsWith(A)){try{d=JSON.parse(t.slice(A.length))}catch{}d?.namespace&&(i=d.namespace)}if(e.namespace!==i)return o(t,s);d&&(t=d.specifier,s.parentURL=d.parentURL)}const[m,c]=t.split("?"),a=await Me(m,s,o,e);if(n.logEsm(2,"nextResolve",{resolved:a}),a.format==="builtin")return a;(!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(n.fileUrlPrefix)&&(a.format=await Re(a.url),n.logEsm(2,"getFormatFromFileUrl",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`);const u=s.parentURL&&a.format==="commonjs"&&n.implicitTsExtensionsPattern.test(a.url)&&(s.parentURL.includes(V)||ve(s.parentURL,t,Ce));return i&&!a.url.includes(U)&&(a.url=H(a.url,`${U}${i}`)),u&&(a.url=H(a.url,V)),(i||u)&&(a.url=ie(a.url,a.format,i)),a},"resolve2");return n.debugEnabled?async(t,s,o)=>{n.logEsm(2,"resolve",{specifier:t,context:s});const i=await r(t,s,o);return n.logEsm(1,"resolved",{specifier:t,context:s,result:i}),i}:r},"createResolve"),Ae=l(e=>{const r=l((t,s,o)=>{if(!e.active||t.startsWith("node:")||Ne(s)&&n.isGlobalCjsLoaderActive())return o(t,s);let i=E(t)??(s.parentURL&&E(s.parentURL));if(e.namespace){let u;if(t.startsWith(A)){try{u=JSON.parse(t.slice(A.length))}catch{}u?.namespace&&(i=u.namespace)}if(e.namespace!==i)return o(t,s);u&&(t=u.specifier,s.parentURL=u.parentURL)}const[m,c]=t.split("?"),a=Oe(m,s,o,e);return n.logEsm(2,"nextResolve",{resolved:a}),a.format==="builtin"||((!a.format||a.format==="commonjs-typescript"||a.format==="module-typescript")&&a.url.startsWith(n.fileUrlPrefix)&&(a.format=Ue(a.url),n.logEsm(2,"getFormatFromFileUrlSync",{resolved:a,format:a.format})),c&&(a.url+=`?${c}`),i&&!a.url.includes(U)&&(a.url=H(a.url,`${U}${i}`)),a.url=ie(a.url,a.format,i)),a},"resolve2");return n.debugEnabled?(t,s,o)=>{n.logEsm(2,"resolveSync",{specifier:t,context:s});const i=r(t,s,o);return n.logEsm(1,"resolvedSync",{specifier:t,context:s,result:i}),i}:r},"createResolveSync"),Be=qe(F),ce=l(e=>(r,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const s=t.startsWith(n.fileUrlPrefix)?t:g.pathToFileURL(t).toString();return import(`tsx://${JSON.stringify({specifier:r,parentURL:s,namespace:e})}`)},"createScopedImport");let le=!1;const xe=l(e=>{const r=[];for(let t=0;t<e.length;t+=1){const s=e[t];if(s==="--import"){const o=e[t+1];o&&r.push(o),t+=1}else s.startsWith("--import=")&&r.push(s.slice(9))}return r},"collectImportSpecifiers"),Qe=l(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),me=[new URL("loader.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href).toString(),new URL("esm/index.mjs",typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href).toString()],He=new Set(["tsx","tsx/esm",...me,...me.map(e=>decodeURI(new URL(e).pathname))]),Ge=l(e=>He.has(e),"isTsxImport"),de=l(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),De=l(()=>{const e=xe(process.execArgv),r=e.findIndex(Ge);return r>0&&e.slice(0,r).some(de)},"hasCliTypeScriptPreload"),ze=Qe().some(de)||De(),ue=typeof T.registerHooks=="function"&&y.isFeatureSupported(y.moduleRegisterHooksCjsReload)&&!ze,Xe=l(e=>{if(!T.register&&!ue)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!le){const{_resolveFilename:c}=T;T._resolveFilename=(a,...u)=>c(n.interopCjsExports(a),...u),le=!0}const{sourceMapsEnabled:r}=process;if(process.setSourceMapsEnabled(!0),ue){const c=X({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),a=T.registerHooks({load:_e(c),resolve:Ae(c)}),u=l(async()=>{c.active=!1,a.deregister(),r===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=ce(e.namespace),u.unregister=u),u}const{port1:t,port2:s}=new pe.MessageChannel;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:typeof document>"u"?require("url").pathToFileURL(__filename).href:L&&L.src||new URL("register-CHVGxKtC.cjs",document.baseURI).href,data:{port:s,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[s]});const o=e?.onImport,i=o&&(c=>{c.type==="load"&&o(c.url)});i&&(t.on("message",i),t.unref());const m=l(()=>(r===!1&&process.setSourceMapsEnabled(!1),i&&t.off("message",i),t.postMessage("deactivate"),new Promise(c=>{const a=l(u=>{u.type==="deactivated"&&(c(),t.off("message",a))},"onDeactivated");t.on("message",a)})),"unregister");return e?.namespace&&(m.import=ce(e.namespace),m.unregister=m),m},"register");exports.globalPreload=Pe,exports.initialize=ye,exports.load=be,exports.register=Xe,exports.resolve=Be;
@@ -1,2 +0,0 @@
1
- var Fe=Object.defineProperty;var i=(e,s)=>Fe(e,"name",{value:s,configurable:!0});import T from"node:module";import{MessageChannel as Ce}from"node:worker_threads";import{i as j,b as _e,e as z,m as $e}from"./node-features-B9BBLzwu.mjs";import{l as te,t as se,g as We,a as Je,d as J,b as d,e as V,f as S,h as L,j as K,k as be,m as g,n as Oe,w as re,o as Ne,p as b,q as oe,s as O,u as Ae}from"./register-BnTWPeIB.mjs";import{pathToFileURL as h,fileURLToPath as ne}from"node:url";import{readFileSync as Me}from"node:fs";import{readFile as Be}from"node:fs/promises";import{p as qe,i as ae,t as ce,a as N,b as ie,c as Qe,r as He}from"./index-XurvG3JN.mjs";import{p as me}from"./client-D_mPDF5S.mjs";import U from"node:path";const I={active:!0,parsedTsconfig:void 0},le=i(e=>{const s={active:!0,namespace:e?.namespace,onImport:e?.onImport,parsedTsconfig:void 0,port:e?.port,tsconfig:e?.tsconfig};return e?.tsconfig!==!1&&(s.parsedTsconfig=te(e?.tsconfig??process.env.TSX_TSCONFIG_PATH)),s},"createData"),Ge=i(async e=>{if(!e)throw new Error(`tsx must be loaded with --import instead of --loader
2
- The --loader flag was deprecated in Node v20.6.0 and v18.19.0`);Object.assign(I,le(e)),e.port&&e.port.on("message",s=>{s==="deactivate"&&(I.active=!1,e.port.postMessage({type:"deactivated"}))})},"initialize"),Xe=i(()=>(I.parsedTsconfig=te(process.env.TSX_TSCONFIG_PATH),"process.setSourceMapsEnabled(true);"),"globalPreload"),ze=i(e=>{const{pathname:s}=new URL(e),t=U.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||se.includes(t))return We(e)},"getFormatFromFileUrl"),Ve=i(e=>{const{pathname:s}=new URL(e),t=U.extname(s);if(t===".mts"||t===".mjs")return"module";if(t===".cts"||t===".cjs")return"commonjs";if(t===".js"||se.includes(t))return Je(e)},"getFormatFromFileUrlSync"),R="tsx-namespace=",A="tsx-commonjs-export-preparse",de=`${A}=1`,F="tsx-commonjs-virtual-query",C=new Map,D=i((e,s)=>e.slice(1).split("&").filter(t=>t&&s.every(r=>!t.startsWith(r))).join("&"),"getQueryWithoutParameters"),M=i((e,s)=>{const t=D(e,s);return t?`?${t}`:""},"getSearchWithoutParameters"),Ke=i(e=>e.replaceAll(/\/\*[\s\S]*?\*\/|\/\/[^\n\r]*/g,""),"stripComments"),De=i(e=>{const s=Ke(e);if(/^\s*export\s*\*/.test(s))return"named";if(/^\s*import\s*\*\s*as\s+[\w$]+/.test(s))return"namespace";const t=s.match(/\{([^}]*)\}/)?.[1];if(t)return t.split(",").some(r=>{const o=r.trim().split(/\s+as\s+/)[0];return!!(o&&o!=="default")})?"named":void 0},"getCommonJsImportBinding"),Ye=i((e,s,t)=>{const r=C.get(e);if(!r)return!1;try{const[o]=qe(r);return o.some(a=>{if(a.d!==-1||a.n!==s)return!1;const m=De(r.slice(a.ss,a.s));return m==="named"||t&&m==="namespace"})}catch{return!1}},"parentImportsCommonJsExports"),v=i(e=>{const s=e.indexOf(R);if(s===-1)return;const t=e[s-1];if(t!=="?"&&t!=="&")return;const r=s+R.length,o=e.indexOf("&",r);return o===-1?e.slice(r):e.slice(r,o)},"getNamespace"),ue=j(_e)?"importAttributes":"importAssertions",fe=i(e=>e==="commonjs"||e==="commonjs-typescript","isCommonJsFormat"),pe=i(e=>e==="module-typescript"||e==="typescript","isModuleTypeScriptFormat"),Ze=j(z),xe=[`${F}=`],B=[`${A}=`,`${F}=`],w=i((e,s)=>s.parsedTsconfig&&be(s.parsedTsconfig,e)?s.parsedTsconfig.config:void 0,"getTsconfigRaw"),ke=i(e=>{if(!e.searchParams.has(F))return;const{pathname:s}=e,t=s.toLowerCase().lastIndexOf("%3f");if(t===-1)return;const r=new URL(e);return r.pathname=s.slice(0,t),r.search="",ne(r)},"getFilePathFromVirtualQuery"),Y=i(e=>{const s=e.startsWith(g)?new URL(e):void 0,t=s?ne(s):e,r=s&&ke(s),o=r||t,a=s&&r?h(o).toString()+M(s.search,xe):e;return{fileUrl:s,filePath:o,loadUrl:a}},"getFileLoadContext"),he=i((e,s)=>{if(!s?.search)return e;const t=M(s.search,B);return t?h(e).toString()+t:e},"getTransformPath"),ge=i((e,s,t)=>{const r=[...s?D(s.search,[R,...B]).split("&").filter(Boolean):[],...t?[`namespace=${encodeURIComponent(t)}`]:[]].join("&");return r?`${e}?${r}`:e},"getFilePathWithQuery"),et=new TextDecoder,ye=i(e=>typeof e=="string"?e:et.decode(e),"decodeSource"),tt=i((e,s)=>{const t=new URL(s),r=s.startsWith(g)?Y(s).filePath:void 0;t.searchParams.delete("tsx-namespace"),t.searchParams.delete(A),t.searchParams.delete(F),r&&(t.pathname=new URL(h(r)).pathname);const o=t.toString();return e.port&&e.port.postMessage({type:"load",url:o}),e.onImport?.(o),o},"notifyLoad"),Pe=i((e,s)=>{if(!e.active)return!1;const t=v(s);if(e.namespace&&e.namespace!==t)return!1;const r=tt(e,s);return me.send&&me.send({type:"dependency",path:r}),!0},"prepareLoad"),Se=i((e,s)=>{if(!Oe.test(e))return s;const t=s[ue];return t?.type?s:{...s,[ue]:{...t,type:"json"}}},"prepareJsonAttributes"),Z=i(({conditions:e})=>e?.includes("require")===!0&&!e.includes("import"),"isCommonJsRequireContext$1"),st=i(e=>{const s=i(async(t,r,o)=>{if(!Pe(e,t))return o(t,r);const a=v(t),{fileUrl:m,filePath:c,loadUrl:n}=Y(t),u=Se(n,r),l=await o(n,u);d(3,"loaded by next loader",{url:t,loadUrl:n,loaded:l});const y=m?.searchParams.has(A)===!0,P=l.format,E=m?new URL(h(c)):void 0;if(E&&m&&(E.search=M(m.search,B)),fe(P)&&m&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const f=await Be(h(c),"utf8"),$=ae(f);if(P==="commonjs-typescript"||!c.endsWith(".js")||$){if(!Ze){if(y&&$&&V.test(c)){const W=await ce(f,c,{define:{"import.meta.url":JSON.stringify(E.toString())},tsconfigRaw:w(c,e)});return C.set(t,W.code),{format:"module",source:S(W)}}return l}if(!a&&!y&&!c.endsWith(".cts"))return l;const k=!!(a||y||M(m.search,B)),ee=N(f,he(c,m),{cjsBanner:k?`require = require("node:module").createRequire(${JSON.stringify(h(c).toString())});`:void 0,tsconfigRaw:w(c,e)});if(l.format="commonjs",l.source=S(ee),k){const W=ge(c,m,a);l.responseURL=`data:text/javascript,${encodeURIComponent(ee.code)}?filePath=${encodeURIComponent(W)}`}return d(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const p=ye(l.source),_=P==="json"&&!Z(r);if(P==="commonjs-typescript"){const f=N(p,c,{tsconfigRaw:w(c,e)});return{...l,format:"commonjs",source:S(f)}}if(_||pe(P)||L.test(t)){const f=await ce(p,c,{tsconfigRaw:w(c,e)});return C.set(t,f.code),{format:"module",source:S(f)}}if(l.format==="module"){const f=ie(c,p);f?(l.source=S(f),C.set(t,f.code)):C.set(t,p)}return l},"load2");return J?async(t,r,o)=>{d(2,"load",{url:t,context:r});const a=await s(t,r,o);return d(1,"loaded",{url:t,result:a}),a}:s},"createLoad"),rt=i(e=>{const s=i((t,r,o)=>{if(Z(r)&&K()||!Pe(e,t))return o(t,r);const a=v(t),{fileUrl:m,filePath:c,loadUrl:n}=Y(t),u=Se(n,r),l=o(n,u);d(3,"loaded by next loader",{url:t,loadUrl:n,loaded:l});const y=l.format;if(fe(y)&&j(z)&&l.responseURL?.startsWith("file:")&&!c.endsWith(".cjs")){const p=Me(h(c),"utf8");if(y==="commonjs-typescript"||!c.endsWith(".js")||ae(p)){const _=N(p,he(c,m),{tsconfigRaw:w(c,e)}),f=!a&&K(),$=ge(c,m,a);return l.format="commonjs",l.shouldBeReloadedByCJSLoader=f,l.source=S(_),f||(l.responseURL=`data:text/javascript,${encodeURIComponent(_.code)}?filePath=${encodeURIComponent($)}`),d(3,"returning CJS export annotation",l),l}}if(!l.source)return l;const P=ye(l.source),E=y==="json"&&!Z(r);if(y==="commonjs-typescript"){const p=N(P,c,{tsconfigRaw:w(c,e)});return{...l,format:"commonjs",shouldBeReloadedByCJSLoader:!1,source:S(p)}}if(E||pe(y)||L.test(t)){const p=Qe(P,c,{tsconfigRaw:w(c,e)});return{format:"module",source:S(p)}}if(l.format==="module"){const p=ie(c,P);p&&(l.source=S(p))}return l},"load2");return J?(t,r,o)=>{d(2,"loadSync",{url:t,context:r});const a=s(t,r,o);return d(1,"loadedSync",{url:t,result:a}),a}:s},"createLoadSync"),ot=st(I),nt=j(z),at=/^(?:[a-z][\d+.a-z-]*:\/\/|data:|file:|node:)/i,Re=i(e=>!Ne(e)&&!at.test(e),"isTsconfigPathAliasSpecifier"),q=i(e=>{if(e.url)return e.url;const s=e.message.match(/^Cannot find module '([^']+)'/);if(s){const[,r]=s;return r}const t=e.message.match(/^Cannot find package '([^']+)'/);if(t){const[,r]=t;if(!U.isAbsolute(r))return;const o=h(r);if(o.pathname.endsWith("/")&&(o.pathname+="package.json"),o.pathname.endsWith("/package.json")){const a=He(o);if(a?.main)return new URL(a.main,o).toString()}else return o.toString()}},"getMissingPathFromNotFound"),Q=i(e=>e==="ERR_MODULE_NOT_FOUND"||e==="MODULE_NOT_FOUND","isModuleNotFound"),H=i(async(e,s,t,r)=>{const o=oe(e);if(d(3,"resolveExtensions",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let a;for(const m of o)try{return await t(m,s)}catch(c){const{code:n}=c;if(!Q(n)&&n!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(r)throw a},"resolveExtensions"),G=i((e,s,t,r)=>{const o=oe(e);if(d(3,"resolveExtensionsSync",{url:e,context:s,throwError:r,tryPaths:o}),!o)return;let a;for(const m of o)try{return t(m,s)}catch(c){const{code:n}=c;if(!Q(n)&&n!=="ERR_PACKAGE_PATH_NOT_EXPORTED")throw c;a=c}if(r)throw a},"resolveExtensionsSync"),ct=i(async(e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBase",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(g),isRelativePath:O(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(g)||O(e))&&(L.test(s.parentURL)||o)){const a=await H(e,s,t);if(d(3,"resolveBase resolved",{specifier:e,context:s,resolved:a}),a)return a}try{return await t(e,s)}catch(a){if(d(3,"resolveBase error",{specifier:e,context:s,error:a}),a instanceof Error){const m=a;if(Q(m.code)){const c=q(m);if(c){const n=await H(c,s,t);if(n)return n}}}throw a}},"resolveBase"),it=i((e,s,t,r)=>{const o=r.parsedTsconfig?.config.compilerOptions?.allowJs??!1;if(d(3,"resolveBaseSync",{specifier:e,context:s,specifierStartsWithFileUrl:e.startsWith(g),isRelativePath:O(e),tsExtensionsPattern:L.test(s.parentURL),allowJs:o}),(e.startsWith(g)||O(e))&&(L.test(s.parentURL)||o)){const a=G(e,s,t);if(d(3,"resolveBaseSync resolved",{specifier:e,context:s,resolved:a}),a)return a}try{return t(e,s)}catch(a){if(d(3,"resolveBaseSync error",{specifier:e,context:s,error:a}),a instanceof Error){const m=a;if(Q(m.code)){const c=q(m);if(c){const n=G(c,s,t);if(n)return n}}}throw a}},"resolveBaseSync"),Ue=i(async(e,s,t,r)=>{if(d(3,"resolveDirectory",{specifier:e,context:s,isDirectory:b.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),b.test(e)){const o=new URL(e,s.parentURL);return o.pathname=U.join(o.pathname,"index"),await H(o.toString(),s,t,!0)}try{return await ct(e,s,t,r)}catch(o){if(o instanceof Error){d(3,"resolveDirectory error",{specifier:e,context:s,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=q(a);if(m)try{return await H(`${m}/index`,s,t,!0)}catch(c){const n=c,{message:u}=n;throw n.message=n.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),n.stack=n.stack.replace(u,n.message),n}}}throw o}},"resolveDirectory"),ve=i((e,s,t,r)=>{if(d(3,"resolveDirectorySync",{specifier:e,context:s,isDirectory:b.test(e)}),(e==="."||e===".."||e.endsWith("/.."))&&(e+="/"),b.test(e)){const o=new URL(e,s.parentURL);return o.pathname=U.join(o.pathname,"index"),G(o.toString(),s,t,!0)}try{return it(e,s,t,r)}catch(o){if(o instanceof Error){d(3,"resolveDirectorySync error",{specifier:e,context:s,error:o});const a=o;if(a.code==="ERR_UNSUPPORTED_DIR_IMPORT"){const m=q(a);if(m)try{return G(`${m}/index`,s,t,!0)}catch(c){const n=c,{message:u}=n;throw n.message=n.message.replace(`${"/index".replace("/",U.sep)}'`,"'"),n.stack=n.stack.replace(u,n.message),n}}}throw o}},"resolveDirectorySync"),mt=i(async(e,s,t,r)=>{const o=Re(e);if(d(3,"resolveTsPaths",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const a=re(r.parsedTsconfig,e);d(3,"resolveTsPaths",{possiblePaths:a});for(const m of a)try{return await Ue(h(m).toString(),s,t,r)}catch{}}return Ue(e,s,t,r)},"resolveTsPaths"),lt=i((e,s,t,r)=>{const o=Re(e);if(d(3,"resolveTsPathsSync",{specifier:e,context:s,tsconfigPathAliasSpecifier:o,tsconfig:r.parsedTsconfig,fromNodeModules:s.parentURL?.includes("/node_modules/")}),o&&r.parsedTsconfig&&!s.parentURL?.includes("/node_modules/")){const a=re(r.parsedTsconfig,e);d(3,"resolveTsPathsSync",{possiblePaths:a});for(const m of a)try{return ve(h(m).toString(),s,t,r)}catch{}}return ve(e,s,t,r)},"resolveTsPathsSync"),X="tsx://",dt=i(e=>e.conditions.includes("require")&&!e.conditions.includes("import"),"isCommonJsRequireContext"),x=i((e,s)=>`${e}${e.includes("?")?"&":"?"}${s}`,"addQuery"),we=i((e,s,t)=>{if(s!=="commonjs"||!e.startsWith(g)||!V.test(e))return e;const r=new URL(e),o=[D(r.search,[R]),...t?[`namespace=${encodeURIComponent(t)}`]:[]].filter(Boolean).join("&");return o?(r.pathname+=`%3F${o}`,r.searchParams.set(F,"1"),r.toString()):e},"preserveCommonJsQueryIdentity"),ut=i(e=>{const s=i(async(t,r,o)=>{if(!e.active||t.startsWith("node:"))return o(t,r);let a=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let l;if(t.startsWith(X)){try{l=JSON.parse(t.slice(X.length))}catch{}l?.namespace&&(a=l.namespace)}if(e.namespace!==a)return o(t,r);l&&(t=l.specifier,r.parentURL=l.parentURL)}const[m,c]=t.split("?"),n=await mt(m,r,o,e);if(d(2,"nextResolve",{resolved:n}),n.format==="builtin")return n;(!n.format||n.format==="commonjs-typescript"||n.format==="module-typescript")&&n.url.startsWith(g)&&(n.format=await ze(n.url),d(2,"getFormatFromFileUrl",{resolved:n,format:n.format})),c&&(n.url+=`?${c}`);const u=r.parentURL&&n.format==="commonjs"&&V.test(n.url)&&(r.parentURL.includes(de)||Ye(r.parentURL,t,nt));return a&&!n.url.includes(R)&&(n.url=x(n.url,`${R}${a}`)),u&&(n.url=x(n.url,de)),(a||u)&&(n.url=we(n.url,n.format,a)),n},"resolve2");return J?async(t,r,o)=>{d(2,"resolve",{specifier:t,context:r});const a=await s(t,r,o);return d(1,"resolved",{specifier:t,context:r,result:a}),a}:s},"createResolve"),ft=i(e=>{const s=i((t,r,o)=>{if(!e.active||t.startsWith("node:")||dt(r)&&K())return o(t,r);let a=v(t)??(r.parentURL&&v(r.parentURL));if(e.namespace){let u;if(t.startsWith(X)){try{u=JSON.parse(t.slice(X.length))}catch{}u?.namespace&&(a=u.namespace)}if(e.namespace!==a)return o(t,r);u&&(t=u.specifier,r.parentURL=u.parentURL)}const[m,c]=t.split("?"),n=lt(m,r,o,e);return d(2,"nextResolve",{resolved:n}),n.format==="builtin"||((!n.format||n.format==="commonjs-typescript"||n.format==="module-typescript")&&n.url.startsWith(g)&&(n.format=Ve(n.url),d(2,"getFormatFromFileUrlSync",{resolved:n,format:n.format})),c&&(n.url+=`?${c}`),a&&!n.url.includes(R)&&(n.url=x(n.url,`${R}${a}`)),n.url=we(n.url,n.format,a)),n},"resolve2");return J?(t,r,o)=>{d(2,"resolveSync",{specifier:t,context:r});const a=s(t,r,o);return d(1,"resolvedSync",{specifier:t,context:r,result:a}),a}:s},"createResolveSync"),pt=ut(I),Te=i(e=>(s,t)=>{if(!t)throw new Error("The current file path (import.meta.url) must be provided in the second argument of tsImport()");const r=t.startsWith(g)?t:h(t).toString();return import(`tsx://${JSON.stringify({specifier:s,parentURL:r,namespace:e})}`)},"createScopedImport");let Le=!1;const ht=i(e=>{const s=[];for(let t=0;t<e.length;t+=1){const r=e[t];if(r==="--import"){const o=e[t+1];o&&s.push(o),t+=1}else r.startsWith("--import=")&&s.push(r.slice(9))}return s},"collectImportSpecifiers"),gt=i(()=>[...(process.env.NODE_OPTIONS??"").matchAll(/(?:^|\s)--import(?:=|\s+)(\S+)/g)].map(([,e])=>e),"collectNodeOptionsImportSpecifiers"),Ee=[new URL("loader.mjs",import.meta.url).toString(),new URL("esm/index.mjs",import.meta.url).toString()],yt=new Set(["tsx","tsx/esm",...Ee,...Ee.map(e=>decodeURI(new URL(e).pathname))]),Pt=i(e=>yt.has(e),"isTsxImport"),je=i(e=>/\.(?:[cm]?ts|tsx)(?:[?#].*)?$/.test(e),"isTypeScriptImport"),St=i(()=>{const e=ht(process.execArgv),s=e.findIndex(Pt);return s>0&&e.slice(0,s).some(je)},"hasCliTypeScriptPreload"),Rt=gt().some(je)||St(),Ie=typeof T.registerHooks=="function"&&j($e)&&!Rt,Ut=i(e=>{if(!T.register&&!Ie)throw new Error(`This version of Node.js (${process.version}) does not support module.register(). Please upgrade to Node v18.19 or v20.6 and above.`);if(!Le){const{_resolveFilename:c}=T;T._resolveFilename=(n,...u)=>c(Ae(n),...u),Le=!0}const{sourceMapsEnabled:s}=process;if(process.setSourceMapsEnabled(!0),Ie){const c=le({namespace:e?.namespace,onImport:e?.onImport,tsconfig:e?.tsconfig}),n=T.registerHooks({load:rt(c),resolve:ft(c)}),u=i(async()=>{c.active=!1,n.deregister(),s===!1&&process.setSourceMapsEnabled(!1)},"unregister2");return e?.namespace&&(u.import=Te(e.namespace),u.unregister=u),u}const{port1:t,port2:r}=new Ce;T.register(`./esm/index.mjs?${Date.now()}`,{parentURL:import.meta.url,data:{port:r,namespace:e?.namespace,tsconfig:e?.tsconfig},transferList:[r]});const o=e?.onImport,a=o&&(c=>{c.type==="load"&&o(c.url)});a&&(t.on("message",a),t.unref());const m=i(()=>(s===!1&&process.setSourceMapsEnabled(!1),a&&t.off("message",a),t.postMessage("deactivate"),new Promise(c=>{const n=i(u=>{u.type==="deactivated"&&(c(),t.off("message",n))},"onDeactivated");t.on("message",n)})),"unregister");return e?.namespace&&(m.import=Te(e.namespace),m.unregister=m),m},"register");export{Ut as a,Xe as g,Ge as i,ot as l,pt as r};