@daimo/sdk 1.4.2 → 1.5.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.
- package/dist/client/createDaimoClient.d.ts +24 -6
- package/dist/client/createDaimoClient.d.ts.map +1 -1
- package/dist/client/createDaimoClient.js +47 -0
- package/dist/client/createDaimoClient.js.map +1 -1
- package/dist/common/account.d.ts +160 -21
- package/dist/common/account.d.ts.map +1 -1
- package/dist/common/account.js +12 -1
- package/dist/common/account.js.map +1 -1
- package/dist/common/api.d.ts +25 -12
- package/dist/common/api.d.ts.map +1 -1
- package/dist/common/api.js +11 -1
- package/dist/common/api.js.map +1 -1
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +1 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/session.d.ts +27 -3
- package/dist/common/session.d.ts.map +1 -1
- package/dist/common/session.js.map +1 -1
- package/dist/common/theme.d.ts +47 -0
- package/dist/common/theme.d.ts.map +1 -0
- package/dist/common/theme.js +230 -0
- package/dist/common/theme.js.map +1 -0
- package/dist/common/token.d.ts +6 -0
- package/dist/common/token.d.ts.map +1 -1
- package/dist/common/token.js +47 -1
- package/dist/common/token.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/web/accountWallet.d.ts +15 -0
- package/dist/web/accountWallet.d.ts.map +1 -0
- package/dist/web/accountWallet.js +44 -0
- package/dist/web/accountWallet.js.map +1 -0
- package/dist/web/api/index.d.ts +17 -11
- package/dist/web/api/index.d.ts.map +1 -1
- package/dist/web/api/navTree.d.ts +27 -5
- package/dist/web/api/navTree.d.ts.map +1 -1
- package/dist/web/components/ApplePayLogo.d.ts +9 -0
- package/dist/web/components/ApplePayLogo.d.ts.map +1 -0
- package/dist/web/components/ApplePayLogo.js +15 -0
- package/dist/web/components/ApplePayLogo.js.map +1 -0
- package/dist/web/components/ChooseChainPage.d.ts.map +1 -1
- package/dist/web/components/ChooseChainPage.js +3 -3
- package/dist/web/components/ChooseChainPage.js.map +1 -1
- package/dist/web/components/ChooseOptionPage.d.ts.map +1 -1
- package/dist/web/components/ChooseOptionPage.js +20 -7
- package/dist/web/components/ChooseOptionPage.js.map +1 -1
- package/dist/web/components/ChooseWalletPage.js +12 -3
- package/dist/web/components/ChooseWalletPage.js.map +1 -1
- package/dist/web/components/ConfirmationPage.d.ts.map +1 -1
- package/dist/web/components/ConfirmationPage.js +2 -1
- package/dist/web/components/ConfirmationPage.js.map +1 -1
- package/dist/web/components/ConfirmationSpinner.d.ts +3 -1
- package/dist/web/components/ConfirmationSpinner.d.ts.map +1 -1
- package/dist/web/components/ConfirmationSpinner.js +7 -2
- package/dist/web/components/ConfirmationSpinner.js.map +1 -1
- package/dist/web/components/DaimoFrame.d.ts +51 -0
- package/dist/web/components/DaimoFrame.d.ts.map +1 -0
- package/dist/web/components/DaimoFrame.js +173 -0
- package/dist/web/components/DaimoFrame.js.map +1 -0
- package/dist/web/components/DaimoModal.d.ts.map +1 -1
- package/dist/web/components/DaimoModal.js +127 -52
- package/dist/web/components/DaimoModal.js.map +1 -1
- package/dist/web/components/DaimoModalPreview.d.ts +11 -0
- package/dist/web/components/DaimoModalPreview.d.ts.map +1 -0
- package/dist/web/components/DaimoModalPreview.js +98 -0
- package/dist/web/components/DaimoModalPreview.js.map +1 -0
- package/dist/web/components/DeeplinkPage.d.ts.map +1 -1
- package/dist/web/components/DeeplinkPage.js +4 -3
- package/dist/web/components/DeeplinkPage.js.map +1 -1
- package/dist/web/components/ErrorPage.d.ts.map +1 -1
- package/dist/web/components/ErrorPage.js +4 -1
- package/dist/web/components/ErrorPage.js.map +1 -1
- package/dist/web/components/ExchangePage.d.ts.map +1 -1
- package/dist/web/components/ExchangePage.js +8 -23
- package/dist/web/components/ExchangePage.js.map +1 -1
- package/dist/web/components/ExternalPaymentPage.d.ts +22 -0
- package/dist/web/components/ExternalPaymentPage.d.ts.map +1 -0
- package/dist/web/components/ExternalPaymentPage.js +24 -0
- package/dist/web/components/ExternalPaymentPage.js.map +1 -0
- package/dist/web/components/ModalChrome.d.ts +28 -0
- package/dist/web/components/ModalChrome.d.ts.map +1 -0
- package/dist/web/components/ModalChrome.js +64 -0
- package/dist/web/components/ModalChrome.js.map +1 -0
- package/dist/web/components/ModalSkeleton.d.ts.map +1 -1
- package/dist/web/components/ModalSkeleton.js +2 -4
- package/dist/web/components/ModalSkeleton.js.map +1 -1
- package/dist/web/components/SelectAmountPage.d.ts.map +1 -1
- package/dist/web/components/SelectAmountPage.js +2 -2
- package/dist/web/components/SelectAmountPage.js.map +1 -1
- package/dist/web/components/SelectTokenPage.d.ts.map +1 -1
- package/dist/web/components/SelectTokenPage.js +8 -7
- package/dist/web/components/SelectTokenPage.js.map +1 -1
- package/dist/web/components/Skeleton.d.ts +19 -0
- package/dist/web/components/Skeleton.d.ts.map +1 -0
- package/dist/web/components/Skeleton.js +21 -0
- package/dist/web/components/Skeleton.js.map +1 -0
- package/dist/web/components/StripeOnrampPage.d.ts +3 -27
- package/dist/web/components/StripeOnrampPage.d.ts.map +1 -1
- package/dist/web/components/StripeOnrampPage.js +7 -116
- package/dist/web/components/StripeOnrampPage.js.map +1 -1
- package/dist/web/components/TokenAmountEntry.d.ts +9 -3
- package/dist/web/components/TokenAmountEntry.d.ts.map +1 -1
- package/dist/web/components/TokenAmountEntry.js +49 -27
- package/dist/web/components/TokenAmountEntry.js.map +1 -1
- package/dist/web/components/WaitingDepositAddressPage.d.ts +39 -0
- package/dist/web/components/WaitingDepositAddressPage.d.ts.map +1 -1
- package/dist/web/components/WaitingDepositAddressPage.js +61 -32
- package/dist/web/components/WaitingDepositAddressPage.js.map +1 -1
- package/dist/web/components/WalletAmountPage.d.ts.map +1 -1
- package/dist/web/components/WalletAmountPage.js +7 -4
- package/dist/web/components/WalletAmountPage.js.map +1 -1
- package/dist/web/components/account/AccountApplePayPage.d.ts +1 -1
- package/dist/web/components/account/AccountApplePayPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountApplePayPage.js +26 -14
- package/dist/web/components/account/AccountApplePayPage.js.map +1 -1
- package/dist/web/components/account/AccountBankDetailsPage.d.ts +2 -1
- package/dist/web/components/account/AccountBankDetailsPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountBankDetailsPage.js +166 -54
- package/dist/web/components/account/AccountBankDetailsPage.js.map +1 -1
- package/dist/web/components/account/AccountBankPickerPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountBankPickerPage.js +15 -13
- package/dist/web/components/account/AccountBankPickerPage.js.map +1 -1
- package/dist/web/components/account/AccountBankTransferSubmittedPage.d.ts +3 -1
- package/dist/web/components/account/AccountBankTransferSubmittedPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountBankTransferSubmittedPage.js +9 -3
- package/dist/web/components/account/AccountBankTransferSubmittedPage.js.map +1 -1
- package/dist/web/components/account/AccountCreatingWalletPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountCreatingWalletPage.js +6 -4
- package/dist/web/components/account/AccountCreatingWalletPage.js.map +1 -1
- package/dist/web/components/account/AccountEmailPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountEmailPage.js +20 -14
- package/dist/web/components/account/AccountEmailPage.js.map +1 -1
- package/dist/web/components/account/AccountEnrollmentPage.d.ts +7 -3
- package/dist/web/components/account/AccountEnrollmentPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountEnrollmentPage.js +142 -107
- package/dist/web/components/account/AccountEnrollmentPage.js.map +1 -1
- package/dist/web/components/account/AccountEnrollmentUpdatePage.d.ts +10 -0
- package/dist/web/components/account/AccountEnrollmentUpdatePage.d.ts.map +1 -0
- package/dist/web/components/account/AccountEnrollmentUpdatePage.js +214 -0
- package/dist/web/components/account/AccountEnrollmentUpdatePage.js.map +1 -0
- package/dist/web/components/account/AccountFlowProvider.d.ts +1 -1
- package/dist/web/components/account/AccountFlowProvider.d.ts.map +1 -1
- package/dist/web/components/account/AccountFlowProvider.js +26 -20
- package/dist/web/components/account/AccountFlowProvider.js.map +1 -1
- package/dist/web/components/account/AccountKycInfoPage.d.ts +13 -0
- package/dist/web/components/account/AccountKycInfoPage.d.ts.map +1 -0
- package/dist/web/components/account/AccountKycInfoPage.js +37 -0
- package/dist/web/components/account/AccountKycInfoPage.js.map +1 -0
- package/dist/web/components/account/AccountOtpCodeEntry.d.ts +4 -1
- package/dist/web/components/account/AccountOtpCodeEntry.d.ts.map +1 -1
- package/dist/web/components/account/AccountOtpCodeEntry.js +46 -43
- package/dist/web/components/account/AccountOtpCodeEntry.js.map +1 -1
- package/dist/web/components/account/AccountPaymentPage.d.ts +3 -2
- package/dist/web/components/account/AccountPaymentPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountPaymentPage.js +30 -18
- package/dist/web/components/account/AccountPaymentPage.js.map +1 -1
- package/dist/web/components/account/AccountPhoneOtpPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountPhoneOtpPage.js +22 -9
- package/dist/web/components/account/AccountPhoneOtpPage.js.map +1 -1
- package/dist/web/components/account/AccountPhonePage.d.ts.map +1 -1
- package/dist/web/components/account/AccountPhonePage.js +30 -12
- package/dist/web/components/account/AccountPhonePage.js.map +1 -1
- package/dist/web/components/account/AccountRipioOtpPage.d.ts +7 -0
- package/dist/web/components/account/AccountRipioOtpPage.d.ts.map +1 -0
- package/dist/web/components/account/AccountRipioOtpPage.js +53 -0
- package/dist/web/components/account/AccountRipioOtpPage.js.map +1 -0
- package/dist/web/components/account/AccountStatusPage.d.ts +1 -3
- package/dist/web/components/account/AccountStatusPage.d.ts.map +1 -1
- package/dist/web/components/account/AccountStatusPage.js +29 -39
- package/dist/web/components/account/AccountStatusPage.js.map +1 -1
- package/dist/web/components/account/accountNav.d.ts +1 -1
- package/dist/web/components/account/accountNav.d.ts.map +1 -1
- package/dist/web/components/account/accountNav.js +5 -1
- package/dist/web/components/account/accountNav.js.map +1 -1
- package/dist/web/components/account/formSchemas.d.ts +81 -0
- package/dist/web/components/account/formSchemas.d.ts.map +1 -0
- package/dist/web/components/account/formSchemas.js +80 -0
- package/dist/web/components/account/formSchemas.js.map +1 -0
- package/dist/web/components/account/formSchemas.test.d.ts +2 -0
- package/dist/web/components/account/formSchemas.test.d.ts.map +1 -0
- package/dist/web/components/account/formSchemas.test.js +57 -0
- package/dist/web/components/account/formSchemas.test.js.map +1 -0
- package/dist/web/components/account/kycRequirement.d.ts +14 -0
- package/dist/web/components/account/kycRequirement.d.ts.map +1 -0
- package/dist/web/components/account/kycRequirement.js +48 -0
- package/dist/web/components/account/kycRequirement.js.map +1 -0
- package/dist/web/components/account/phone.d.ts +2 -1
- package/dist/web/components/account/phone.d.ts.map +1 -1
- package/dist/web/components/account/phone.js +11 -2
- package/dist/web/components/account/phone.js.map +1 -1
- package/dist/web/components/buttons.d.ts +3 -2
- package/dist/web/components/buttons.d.ts.map +1 -1
- package/dist/web/components/buttons.js +4 -4
- package/dist/web/components/buttons.js.map +1 -1
- package/dist/web/components/containers.d.ts +7 -2
- package/dist/web/components/containers.d.ts.map +1 -1
- package/dist/web/components/containers.js +73 -30
- package/dist/web/components/containers.js.map +1 -1
- package/dist/web/components/formFields.d.ts +39 -0
- package/dist/web/components/formFields.d.ts.map +1 -0
- package/dist/web/components/formFields.js +70 -0
- package/dist/web/components/formFields.js.map +1 -0
- package/dist/web/components/icons.d.ts +17 -1
- package/dist/web/components/icons.d.ts.map +1 -1
- package/dist/web/components/icons.js +30 -2
- package/dist/web/components/icons.js.map +1 -1
- package/dist/web/components/shared.d.ts +1 -1
- package/dist/web/components/shared.d.ts.map +1 -1
- package/dist/web/components/shared.js +22 -22
- package/dist/web/components/shared.js.map +1 -1
- package/dist/web/formatAmount.d.ts +5 -0
- package/dist/web/formatAmount.d.ts.map +1 -0
- package/dist/web/formatAmount.js +53 -0
- package/dist/web/formatAmount.js.map +1 -0
- package/dist/web/formatAmount.test.d.ts +2 -0
- package/dist/web/formatAmount.test.d.ts.map +1 -0
- package/dist/web/formatAmount.test.js +43 -0
- package/dist/web/formatAmount.test.js.map +1 -0
- package/dist/web/hooks/accountAuthNav.d.ts +3 -0
- package/dist/web/hooks/accountAuthNav.d.ts.map +1 -0
- package/dist/web/hooks/accountAuthNav.js +24 -0
- package/dist/web/hooks/accountAuthNav.js.map +1 -0
- package/dist/web/hooks/accountAuthNav.test.d.ts +2 -0
- package/dist/web/hooks/accountAuthNav.test.d.ts.map +1 -0
- package/dist/web/hooks/accountAuthNav.test.js +32 -0
- package/dist/web/hooks/accountAuthNav.test.js.map +1 -0
- package/dist/web/hooks/formatUserError.d.ts.map +1 -1
- package/dist/web/hooks/formatUserError.js +13 -2
- package/dist/web/hooks/formatUserError.js.map +1 -1
- package/dist/web/hooks/locale.d.ts +2 -0
- package/dist/web/hooks/locale.d.ts.map +1 -1
- package/dist/web/hooks/locale.js +41 -4
- package/dist/web/hooks/locale.js.map +1 -1
- package/dist/web/hooks/locale.test.d.ts +2 -0
- package/dist/web/hooks/locale.test.d.ts.map +1 -0
- package/dist/web/hooks/locale.test.js +41 -0
- package/dist/web/hooks/locale.test.js.map +1 -0
- package/dist/web/hooks/locales/en.d.ts +26 -2
- package/dist/web/hooks/locales/en.d.ts.map +1 -1
- package/dist/web/hooks/locales/en.js +36 -12
- package/dist/web/hooks/locales/en.js.map +1 -1
- package/dist/web/hooks/locales/es.d.ts.map +1 -1
- package/dist/web/hooks/locales/es.js +35 -11
- package/dist/web/hooks/locales/es.js.map +1 -1
- package/dist/web/hooks/locales/ja.d.ts.map +1 -1
- package/dist/web/hooks/locales/ja.js +36 -12
- package/dist/web/hooks/locales/ja.js.map +1 -1
- package/dist/web/hooks/locales/ko.d.ts.map +1 -1
- package/dist/web/hooks/locales/ko.js +36 -12
- package/dist/web/hooks/locales/ko.js.map +1 -1
- package/dist/web/hooks/locales/pt.d.ts +4 -0
- package/dist/web/hooks/locales/pt.d.ts.map +1 -0
- package/dist/web/hooks/locales/pt.js +164 -0
- package/dist/web/hooks/locales/pt.js.map +1 -0
- package/dist/web/hooks/locales/zh.d.ts.map +1 -1
- package/dist/web/hooks/locales/zh.js +36 -12
- package/dist/web/hooks/locales/zh.js.map +1 -1
- package/dist/web/hooks/navEvent.js +2 -2
- package/dist/web/hooks/navEvent.js.map +1 -1
- package/dist/web/hooks/types.d.ts +15 -3
- package/dist/web/hooks/types.d.ts.map +1 -1
- package/dist/web/hooks/types.js.map +1 -1
- package/dist/web/hooks/useAccountFlow.d.ts +17 -11
- package/dist/web/hooks/useAccountFlow.d.ts.map +1 -1
- package/dist/web/hooks/useAccountFlow.js +71 -28
- package/dist/web/hooks/useAccountFlow.js.map +1 -1
- package/dist/web/hooks/useCreateDeposit.d.ts +1 -1
- package/dist/web/hooks/useCreateDeposit.d.ts.map +1 -1
- package/dist/web/hooks/useCreateDeposit.js +15 -103
- package/dist/web/hooks/useCreateDeposit.js.map +1 -1
- package/dist/web/hooks/useDraftDeposit.d.ts +2 -1
- package/dist/web/hooks/useDraftDeposit.d.ts.map +1 -1
- package/dist/web/hooks/useDraftDeposit.js +18 -1
- package/dist/web/hooks/useDraftDeposit.js.map +1 -1
- package/dist/web/hooks/useSessionNav.d.ts +6 -3
- package/dist/web/hooks/useSessionNav.d.ts.map +1 -1
- package/dist/web/hooks/useSessionNav.js +131 -39
- package/dist/web/hooks/useSessionNav.js.map +1 -1
- package/dist/web/hooks/useWalletFlow.d.ts.map +1 -1
- package/dist/web/hooks/useWalletFlow.js +74 -26
- package/dist/web/hooks/useWalletFlow.js.map +1 -1
- package/dist/web/hooks/walletError.d.ts +9 -0
- package/dist/web/hooks/walletError.d.ts.map +1 -0
- package/dist/web/hooks/walletError.js +16 -0
- package/dist/web/hooks/walletError.js.map +1 -0
- package/dist/web/index.d.ts +7 -1
- package/dist/web/index.d.ts.map +1 -1
- package/dist/web/index.js +3 -0
- package/dist/web/index.js.map +1 -1
- package/dist/web/styles.css +1 -1
- package/dist/web/theme.css +1 -1
- package/dist/web/theme.d.ts +7 -0
- package/dist/web/theme.d.ts.map +1 -0
- package/dist/web/theme.js +23 -0
- package/dist/web/theme.js.map +1 -0
- package/package.json +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationPage.js","sourceRoot":"","sources":["../../../src/web/components/ConfirmationPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAoCrB;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,GACe;IACtB,MAAM,MAAM,GAAG,qBAAqB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAElE,sEAAsE;IACtE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC9E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC5B,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;YAChD,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;IACH,CAAC,EAAE,CAAC,MAAM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mB,aAEhC,YAAG,SAAS,EAAC,sFAAsF,YAChG,eAAe,IAAI,IAAI;oCACtB,CAAC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"ConfirmationPage.js","sourceRoot":"","sources":["../../../src/web/components/ConfirmationPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAoCrB;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,MAAM,EACN,OAAO,GACe;IACtB,MAAM,MAAM,GAAG,qBAAqB,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAElE,sEAAsE;IACtE,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC9E,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;gBAC5B,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC;YAChD,CAAC,EAAE,IAAI,CAAC,CAAC;YACT,OAAO,GAAG,EAAE,C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ACvD,IAAI,YAAY,KAAK,WAAW;QAAE,OAAO,MAAM,CAAC;IAChD,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IAClD,IAAI,aAAa;QAAE,OAAO,SAAS,CAAC;IACpC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,mCAAmC;AACnC,SAAS,eAAe,CACtB,MAA0B,EAC1B,iBAAyB;IAEzB,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,YAAY;YACf,OAAO,CAAC,CAAC,kBAAkB,CAAC;QAC9B,KAAK,SAAS;YACZ,OAAO,CAAC,CAAC,qBAAqB,CAAC;QACjC,KAAK,YAAY;YACf,OAAO,iBAAiB,CAAC;QAC3B,KAAK,MAAM;YACT,OAAO,CAAC,CAAC,gBAAgB,CAAC;QAC5B,KAAK,UAAU;YACb,OAAO,CAAC,CAAC,eAAe,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
type ConfirmationSpinnerProps = {
|
|
2
2
|
done: boolean;
|
|
3
3
|
bounced?: boolean;
|
|
4
|
+
size?: number;
|
|
5
|
+
className?: string;
|
|
4
6
|
};
|
|
5
7
|
/** Spinner → checkmark/exclamation transition for payment confirmation. */
|
|
6
|
-
export declare function ConfirmationSpinner({ done, bounced }: ConfirmationSpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function ConfirmationSpinner({ done, bounced, size, className, }: ConfirmationSpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
8
10
|
//# sourceMappingURL=ConfirmationSpinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationSpinner.d.ts","sourceRoot":"","sources":["../../../src/web/components/ConfirmationSpinner.tsx"],"names":[],"mappings":"AAAA,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfirmationSpinner.d.ts","sourceRoot":"","sources":["../../../src/web/components/ConfirmationSpinner.tsx"],"names":[],"mappings":"AAAA,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,IAAU,EACV,SAAc,GACf,EAAE,wBAAwB,2CA0C1B"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/** Spinner → checkmark/exclamation transition for payment confirmation. */
|
|
3
|
-
export function ConfirmationSpinner({ done, bounced }) {
|
|
3
|
+
export function ConfirmationSpinner({ done, bounced, size = 100, className = "", }) {
|
|
4
4
|
const settled = done || bounced;
|
|
5
|
-
|
|
5
|
+
const inset = Math.max(2, Math.round(size * 0.06));
|
|
6
|
+
return (_jsx("div", { className: `daimo-relative daimo-shrink-0 ${className}`, style: { width: size, height: size }, children: _jsxs("div", { className: "daimo-absolute daimo-rounded-full daimo-flex daimo-items-center daimo-justify-center daimo-overflow-hidden", style: { backgroundColor: "var(--daimo-bg)", inset }, children: [_jsx(LoadingCircle, { className: `daimo-absolute daimo-w-full daimo-h-full daimo-transition-opacity daimo-duration-200 ${settled ? "daimo-opacity-0" : "daimo-opacity-100"}`, spinning: !settled }), _jsx(TickIcon, { className: `daimo-absolute daimo-w-full daimo-h-full daimo-transition-[opacity,transform] daimo-duration-200 ${done && !bounced
|
|
7
|
+
? "daimo-opacity-100 daimo-scale-100"
|
|
8
|
+
: "daimo-opacity-0 daimo-scale-50"}`, style: { color: "var(--daimo-checkmark)" } }), _jsx(ExclamationIcon, { className: `daimo-absolute daimo-w-full daimo-h-full daimo-transition-[opacity,transform] daimo-duration-200 ${bounced
|
|
9
|
+
? "daimo-opacity-100 daimo-scale-100"
|
|
10
|
+
: "daimo-opacity-0 daimo-scale-50"}`, style: { color: "var(--daimo-warning)" } })] }) }));
|
|
6
11
|
}
|
|
7
12
|
function LoadingCircle({ className, spinning, }) {
|
|
8
13
|
return (_jsxs("svg", { className: className, style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmationSpinner.js","sourceRoot":"","sources":["../../../src/web/components/ConfirmationSpinner.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ConfirmationSpinner.js","sourceRoot":"","sources":["../../../src/web/components/ConfirmationSpinner.tsx"],"names":[],"mappings":";AAOA,2EAA2E;AAC3E,MAAM,UAAU,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,IAAI,GAAG,GAAG,EACV,SAAS,GAAG,EAAE,GACW;IACzB,MAAM,OAAO,GAAG,IAAI,IAAI,OAAO,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;IACnD,OAAO,CACL,cACE,SAAS,EAAE,iCAAiC,SAAS,EAAE,EACvD,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAEpC,eACE,SAAS,EAAC,4GAA4G,EACtH,KAAK,EAAE,EAAE,eAAe,EAAE,iBAAiB,EAAE,KAAK,EAAE,aAGpD,KAAC,aAAa,IACZ,SAAS,EAAE,wFACT,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,mBAChC,EAAE,EACF,QAAQ,EAAE,CAAC,OAAO,GAClB,EAGF,KAAC,QAAQ,IACP,SAAS,EAAE,oGACT,IAAI,IAAI,CAAC,OAAO;wBACd,CAAC,CAAC,mCAAmC;wBACrC,CAAC,CAAC,gCACN,EAAE,EACF,KAAK,EAA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AAC,SAAS,EAClB,CAAC,EAAC,sXAAsX,EACxX,IAAI,EAAC,cAAc,GACnB,GACE,CACP,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,EAChB,SAAS,EACT,KAAK,GAIN;IACC,OAAO,CACL,cACE,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,iBACtB,MAAM,YAElB,eACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,4dAA4d,EAC9d,IAAI,EAAC,cAAc,GACnB,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The only supported layout. `modal` renders the hosted checkout in a
|
|
3
|
+
* full-screen dimmed overlay with a rounded, content-sized sheet.
|
|
4
|
+
*/
|
|
5
|
+
export type DaimoFrameLayout = "modal";
|
|
6
|
+
export interface DaimoFrameProps {
|
|
7
|
+
/** Session ID, created server-side via `POST /v1/sessions`. */
|
|
8
|
+
sessionId: string;
|
|
9
|
+
/** Client secret returned alongside the session. */
|
|
10
|
+
clientSecret: string;
|
|
11
|
+
/**
|
|
12
|
+
* Presentation layout. Currently only `"modal"` is supported: a full-screen
|
|
13
|
+
* dimmed overlay with a rounded sheet sized to the checkout content.
|
|
14
|
+
*/
|
|
15
|
+
layout?: DaimoFrameLayout;
|
|
16
|
+
/** Called when the user dismisses the checkout (taps the scrim or closes). */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Base URL of the hosted checkout. Defaults to `https://daimo.com`.
|
|
20
|
+
* Override only for staging / self-hosted environments.
|
|
21
|
+
*/
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Hosted Daimo checkout, embedded as an iframe in a full-screen modal overlay.
|
|
26
|
+
*
|
|
27
|
+
* `DaimoFrame` loads `/webview` in content-only (`embed`) mode inside a fixed,
|
|
28
|
+
* dimmed scrim and sizes the iframe to the height the content reports over
|
|
29
|
+
* `postMessage`. No wallet libraries or app providers required. The sheet stays
|
|
30
|
+
* hidden until the checkout's first content arrives; if nothing loads within
|
|
31
|
+
* {@link LOAD_TIMEOUT_MS}, a dismissable error card is shown instead.
|
|
32
|
+
*
|
|
33
|
+
* The dimming scrim is `position: fixed` on purpose: iOS 26 derives the
|
|
34
|
+
* safe-area strip colors (notch / home indicator) from the `background-color`
|
|
35
|
+
* of fixed/sticky elements near the viewport edges (falling back to `body`). An
|
|
36
|
+
* `absolute` scrim is never sampled, so the strips would stay light — the fixed
|
|
37
|
+
* scrim's semi-transparent background instead tints them to match the dimmed
|
|
38
|
+
* page. See https://nasedk.in/blog/ios26-safari-toolbar-colors/.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <DaimoFrame
|
|
43
|
+
* layout="modal"
|
|
44
|
+
* sessionId={sessionId}
|
|
45
|
+
* clientSecret={clientSecret}
|
|
46
|
+
* onClose={() => setOpen(false)}
|
|
47
|
+
* />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function DaimoFrame({ sessionId, clientSecret, layout, onClose, baseUrl, }: DaimoFrameProps): import("react").ReactPortal | null;
|
|
51
|
+
//# sourceMappingURL=DaimoFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DaimoFrame.d.ts","sourceRoot":"","sources":["../../../src/web/components/DaimoFrame.tsx"],"names":[],"mappings":"AA2FA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,YAAY,EACZ,MAAgB,EAChB,OAAO,EACP,OAA0B,GAC3B,EAAE,eAAe,sCAsFjB"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { CloseIcon } from "./icons.js";
|
|
6
|
+
import { ContactSupportButton, ErrorMessage } from "./shared.js";
|
|
7
|
+
const DAIMO_MESSAGE_SOURCE = "daimo-pay";
|
|
8
|
+
const DEFAULT_BASE_URL = "https://daimo.com";
|
|
9
|
+
const INITIAL_HEIGHT = 420;
|
|
10
|
+
/** Show the error fallback if the iframe hasn't rendered content within this. */
|
|
11
|
+
const LOAD_TIMEOUT_MS = 15000;
|
|
12
|
+
// Hoisted out of the style objects below so the SDK style linter (which scans
|
|
13
|
+
// string literals under a `position:` property for stale Tailwind tokens)
|
|
14
|
+
// doesn't flag these CSS keywords. They are real inline CSS values, not classes.
|
|
15
|
+
const CSS_FIXED = "fixed";
|
|
16
|
+
const CSS_RELATIVE = "relative";
|
|
17
|
+
const CSS_ABSOLUTE = "absolute";
|
|
18
|
+
// Fixed scrim: dims the viewport, and on iOS 26 its background is what Safari
|
|
19
|
+
// samples to tint the safe-area strips dark (an `absolute` scrim is not
|
|
20
|
+
// sampled). Also positions the sheet at the bottom, clear of the home bar.
|
|
21
|
+
const scrimStyle = {
|
|
22
|
+
position: CSS_FIXED,
|
|
23
|
+
inset: 0,
|
|
24
|
+
zIndex: 999,
|
|
25
|
+
background: "rgba(0, 0, 0, 0.5)",
|
|
26
|
+
display: "flex",
|
|
27
|
+
justifyContent: "center",
|
|
28
|
+
alignItems: "flex-end",
|
|
29
|
+
padding: 12,
|
|
30
|
+
paddingBottom: "calc(12px + env(safe-area-inset-bottom))",
|
|
31
|
+
};
|
|
32
|
+
// Rounded surface that clips the content-sized iframe to four corners. Hidden
|
|
33
|
+
// (opacity 0) until the checkout reports its first height, so the user never
|
|
34
|
+
// sees an empty shadowed bubble while the iframe loads.
|
|
35
|
+
const bubbleStyle = {
|
|
36
|
+
width: "100%",
|
|
37
|
+
maxWidth: 440,
|
|
38
|
+
maxHeight: "calc(100dvh - 24px - env(safe-area-inset-bottom))",
|
|
39
|
+
borderRadius: 24,
|
|
40
|
+
overflow: "hidden",
|
|
41
|
+
// Small shadow that stays within the ~12px gap below the sheet (so it never
|
|
42
|
+
// bleeds into the safe area): offset + blur reaches ~8px.
|
|
43
|
+
boxShadow: "0 2px 6px rgba(0, 0, 0, 0.2)",
|
|
44
|
+
// `transition` is set inline: opacity always animates, height only after the
|
|
45
|
+
// first appearance (see `animateHeight`).
|
|
46
|
+
};
|
|
47
|
+
const iframeStyle = {
|
|
48
|
+
display: "block",
|
|
49
|
+
width: "100%",
|
|
50
|
+
height: "100%",
|
|
51
|
+
border: 0,
|
|
52
|
+
};
|
|
53
|
+
// Error fallback card. Reuses the SDK surface token + components, so it needs
|
|
54
|
+
// the SDK theme CSS loaded on the host page.
|
|
55
|
+
const errorCardStyle = {
|
|
56
|
+
position: CSS_RELATIVE,
|
|
57
|
+
width: "100%",
|
|
58
|
+
maxWidth: 440,
|
|
59
|
+
background: "var(--daimo-surface)",
|
|
60
|
+
borderRadius: 24,
|
|
61
|
+
boxShadow: "0 2px 6px rgba(0, 0, 0, 0.2)",
|
|
62
|
+
padding: "44px 24px 28px",
|
|
63
|
+
display: "flex",
|
|
64
|
+
flexDirection: "column",
|
|
65
|
+
alignItems: "center",
|
|
66
|
+
gap: 20,
|
|
67
|
+
};
|
|
68
|
+
const closeButtonStyle = {
|
|
69
|
+
position: CSS_ABSOLUTE,
|
|
70
|
+
top: 12,
|
|
71
|
+
right: 12,
|
|
72
|
+
display: "flex",
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
justifyContent: "center",
|
|
75
|
+
width: 32,
|
|
76
|
+
height: 32,
|
|
77
|
+
border: 0,
|
|
78
|
+
borderRadius: 9999,
|
|
79
|
+
background: "transparent",
|
|
80
|
+
color: "var(--daimo-text-secondary)",
|
|
81
|
+
cursor: "pointer",
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Hosted Daimo checkout, embedded as an iframe in a full-screen modal overlay.
|
|
85
|
+
*
|
|
86
|
+
* `DaimoFrame` loads `/webview` in content-only (`embed`) mode inside a fixed,
|
|
87
|
+
* dimmed scrim and sizes the iframe to the height the content reports over
|
|
88
|
+
* `postMessage`. No wallet libraries or app providers required. The sheet stays
|
|
89
|
+
* hidden until the checkout's first content arrives; if nothing loads within
|
|
90
|
+
* {@link LOAD_TIMEOUT_MS}, a dismissable error card is shown instead.
|
|
91
|
+
*
|
|
92
|
+
* The dimming scrim is `position: fixed` on purpose: iOS 26 derives the
|
|
93
|
+
* safe-area strip colors (notch / home indicator) from the `background-color`
|
|
94
|
+
* of fixed/sticky elements near the viewport edges (falling back to `body`). An
|
|
95
|
+
* `absolute` scrim is never sampled, so the strips would stay light — the fixed
|
|
96
|
+
* scrim's semi-transparent background instead tints them to match the dimmed
|
|
97
|
+
* page. See https://nasedk.in/blog/ios26-safari-toolbar-colors/.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* <DaimoFrame
|
|
102
|
+
* layout="modal"
|
|
103
|
+
* sessionId={sessionId}
|
|
104
|
+
* clientSecret={clientSecret}
|
|
105
|
+
* onClose={() => setOpen(false)}
|
|
106
|
+
* />
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export function DaimoFrame({ sessionId, clientSecret, layout = "modal", onClose, baseUrl = DEFAULT_BASE_URL, }) {
|
|
110
|
+
const [src] = useState(() => `${baseUrl.replace(/\/$/, "")}/webview?session=${encodeURIComponent(sessionId)}&cs=${encodeURIComponent(clientSecret)}&layout=embed`);
|
|
111
|
+
const [height, setHeight] = useState(INITIAL_HEIGHT);
|
|
112
|
+
const [mounted, setMounted] = useState(false);
|
|
113
|
+
const [status, setStatus] = useState("loading");
|
|
114
|
+
// Height animates only after the bubble's first appearance, so revealing it
|
|
115
|
+
// doesn't animate from INITIAL_HEIGHT down to the first measured (skeleton)
|
|
116
|
+
// height. Only later growth (skeleton -> content) animates.
|
|
117
|
+
const [animateHeight, setAnimateHeight] = useState(false);
|
|
118
|
+
// Portals require a DOM target, so only render after mount (client-only).
|
|
119
|
+
useEffect(() => setMounted(true), []);
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
// Only trust messages from the iframe's own origin.
|
|
122
|
+
const frameOrigin = new URL(src, window.location.href).origin;
|
|
123
|
+
const handleMessage = (event) => {
|
|
124
|
+
if (event.origin !== frameOrigin)
|
|
125
|
+
return;
|
|
126
|
+
if (event.data?.source !== DAIMO_MESSAGE_SOURCE)
|
|
127
|
+
return;
|
|
128
|
+
if (event.data.type === "modalClosed")
|
|
129
|
+
onClose?.();
|
|
130
|
+
if (event.data.type === "contentHeightChanged") {
|
|
131
|
+
const reported = Number(event.data.payload?.height);
|
|
132
|
+
if (reported > 0) {
|
|
133
|
+
setHeight(reported);
|
|
134
|
+
setStatus("loaded");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
window.addEventListener("message", handleMessage);
|
|
139
|
+
return () => window.removeEventListener("message", handleMessage);
|
|
140
|
+
}, [onClose, src]);
|
|
141
|
+
// Fall back to the error card if the checkout never reports content.
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
if (status !== "loading")
|
|
144
|
+
return;
|
|
145
|
+
const id = setTimeout(() => setStatus("error"), LOAD_TIMEOUT_MS);
|
|
146
|
+
return () => clearTimeout(id);
|
|
147
|
+
}, [status]);
|
|
148
|
+
// Enable the height transition one frame after the bubble first appears, so
|
|
149
|
+
// its reveal snaps to the first height instead of animating down to it.
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (status !== "loaded" || animateHeight)
|
|
152
|
+
return;
|
|
153
|
+
const id = requestAnimationFrame(() => setAnimateHeight(true));
|
|
154
|
+
return () => cancelAnimationFrame(id);
|
|
155
|
+
}, [status, animateHeight]);
|
|
156
|
+
// `layout` is reserved for future modes; only "modal" is supported today.
|
|
157
|
+
void layout;
|
|
158
|
+
if (!mounted)
|
|
159
|
+
return null;
|
|
160
|
+
return createPortal(_jsx("div", { onClick: () => onClose?.(), style: scrimStyle, children: status === "error" ? (_jsx(DaimoFrameError, { sessionId: sessionId, onClose: onClose })) : (_jsx("div", { onClick: (e) => e.stopPropagation(), style: {
|
|
161
|
+
...bubbleStyle,
|
|
162
|
+
height,
|
|
163
|
+
opacity: status === "loaded" ? 1 : 0,
|
|
164
|
+
transition: animateHeight
|
|
165
|
+
? "height 0.2s ease-in-out, opacity 0.2s ease-in-out"
|
|
166
|
+
: "opacity 0.2s ease-in-out",
|
|
167
|
+
}, children: _jsx("iframe", { title: "Daimo", src: src, allow: "payment; clipboard-write", style: iframeStyle }) })) }), document.body);
|
|
168
|
+
}
|
|
169
|
+
/** Dismissable "couldn't load" card with a contact-support mailto link. */
|
|
170
|
+
function DaimoFrameError({ sessionId, onClose, }) {
|
|
171
|
+
return (_jsxs("div", { onClick: (e) => e.stopPropagation(), style: errorCardStyle, children: [_jsx("button", { type: "button", "aria-label": "Close", onClick: () => onClose?.(), style: closeButtonStyle, children: _jsx(CloseIcon, {}) }), _jsx(ErrorMessage, { message: "Couldn't load. Offline?" }), _jsx(ContactSupportButton, { subject: "Couldn't load Daimo checkout", info: { sessionId } })] }));
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=DaimoFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DaimoFrame.js","sourceRoot":"","sources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M,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACpC,UAAU,EAAE,aAAa;oBACvB,CAAC,CAAC,mDAAmD;oBACrD,CAAC,CAAC,0BAA0B;aAC/B,YAED,iBACE,KAAK,EAAC,OAAO,EACb,GAAG,EAAE,GAAG,EACR,KAAK,EAAC,0BAA0B,EAChC,KAAK,EAAE,WAAW,GAClB,GACE,CACP,GACG,EACN,QAAQ,CAAC,IAAI,CACd,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,SAAS,eAAe,CAAC,EACvB,SAAS,EACT,OAAO,GAIR;IACC,OAAO,CACL,eAAK,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,cAAc,aAC7D,iBACE,IAAI,EAAC,QAAQ,gBACF,OAAO,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,EAC1B,KAAK,EAAE,gBAAgB,YAEvB,KAAC,SAAS,KAAG,GACN,EACT,KAAC,YAAY,IAAC,OAAO,EAAC,yBAAyB,GAAG,EAClD,KAAC,oBAAoB,IACnB,OAAO,EAAC,8BAA8B,EACtC,IAAI,EAAE,EAAE,SAAS,EAAE,GACnB,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DaimoModal.d.ts","sourceRoot":"","sources":["../../../src/web/components/DaimoModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DaimoModal.d.ts","sourceRoot":"","sources":["../../../src/web/components/DaimoModal.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAsBpC,OAAO,EAIL,KAAK,uBAAuB,EAE7B,MAAM,mBAAmB,CAAC;AAY3B,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAiD/E,MAAM,MAAM,eAAe,GAAG,uBAAuB,GAAG;IACtD,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oEAAoE;IACpE,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AA0CF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,kDAkIhD"}
|