diff --git a/.env.example b/.env.example index 0f1d070ab46..c717d47a7bc 100644 --- a/.env.example +++ b/.env.example @@ -15,8 +15,24 @@ EXT_INJECT_MODE= # for hardware-js-sdk iframe src HARDWARE_SDK_CONNECT_SRC= +# for webpack analyzer +ENABLE_ANALYZER= +ENABLE_ANALYZER_HTML_REPORT= + # Jpush JPUSH_KEY= JPUSH_CHANNEL= + +# Privy +PRIVY_APP_ID= +PRIVY_MOBILE_CLIENT_ID= + +# Revenuecat +REVENUECAT_API_KEY_STRIPE= +REVENUECAT_API_KEY_APPLE= +REVENUECAT_API_KEY_GOOGLE= +REVENUECAT_API_KEY_WEB= +REVENUECAT_API_KEY_WEB_SANDBOX= + # Will auto add and inject variable at CI job.Must give an empty line at end of this file. diff --git a/.env.version b/.env.version index 44eede243a6..b061347384c 100644 --- a/.env.version +++ b/.env.version @@ -1,5 +1,5 @@ # VERSION: https://semver.org/ -VERSION=5.6.0 +VERSION=5.6.789 # Will auto add BUILD_NUMBER variable at native CI job.Must give an empty line at end of this file. diff --git a/.eslintrc.js b/.eslintrc.js index 0371f35d8ad..f2572929222 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,3 +1,5 @@ +require('./development/lint/eslint-rule-force-async-bg-api'); + const isDev = process.env.NODE_ENV !== 'production'; const jsRules = { // eslint-disable-next-line global-require @@ -6,6 +8,7 @@ const jsRules = { 'no-use-before-define': 'off', 'no-shadow': 'off', 'import/no-extraneous-dependencies': 'off', + // 'force-async-bg-api': 'error', // TODO not working 'no-restricted-exports': 'off', 'func-names': 'off', 'import/no-named-as-default-member': 'off', @@ -168,6 +171,7 @@ const tsRules = { const resolveExtensions = (platform) => ['.ts', '.tsx', '.js', '.jsx'].map((ext) => `${platform}${ext}`); + module.exports = { plugins: [ 'spellcheck', diff --git a/.github/actions/shared-env/action.yml b/.github/actions/shared-env/action.yml new file mode 100644 index 00000000000..b1da3377f84 --- /dev/null +++ b/.github/actions/shared-env/action.yml @@ -0,0 +1,174 @@ +name: Shared Environment Variables Setup +description: Setup environment variables for the project + +inputs: + additional_env: + required: false + type: string + description: "Additional environment variables to inject" + env_file_name: + required: false + type: string + default: ".env" + description: "Target environment file name" + sentry_project: + required: false + type: string + default: '' + description: "Sentry project name" + covalent_key: + required: true + type: string + description: "Covalent API Key" + sentry_token: + required: true + type: string + description: "Sentry Auth Token" + privy_app_id: + required: true + type: string + description: "Privy App ID" + privy_mobile_client_id: + required: true + type: string + description: "Privy Mobile Client ID" + revenuecat_api_key_web: + required: true + type: string + description: "RevenueCat Web API Key" + revenuecat_api_key_web_sandbox: + required: true + type: string + description: "RevenueCat Web Sandbox API Key" + revenuecat_api_key_apple: + required: true + type: string + description: "RevenueCat Apple API Key" + revenuecat_api_key_google: + required: true + type: string + description: "RevenueCat Google API Key" + +runs: + using: "composite" + steps: + - name: Checkout Source Code + uses: actions/checkout@v3 + with: + lfs: true + + - name: Dotenv Action + id: dotenv + uses: OneKeyHQ/actions/dotenv-action@main + with: + path: .env.version + + - name: Setup ENV + shell: bash + run: | + # Generate app version ------- start + app_version=${{ steps.dotenv.outputs.version }} + echo '$app_version='$app_version + echo "BUILD_APP_VERSION=$app_version" >> $GITHUB_ENV + # Generate app version ------- end + + # Generate github tag ------- start + github_ref="${github_ref////-}" + github_ref="${github_ref/refs-heads-/}" + github_ref="${github_ref/refs-tags-/}" + echo '$github_ref='$github_ref + echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV + # echo "::set-env name=GITHUB_TAG::$github_ref" + # Generate github tag ------- end + env: + github_ref: ${{ github.ref }} + workflow_run_number: ${{ github.event.workflow_run.run_number}} + + - name: Setup ENV BUILD_NUMBER to 1 + if: ${{ !github.event.workflow_run }} + shell: bash + run: | + # Generate build number ------- start + echo "BUILD_NUMBER=1" >> $GITHUB_ENV + # Generate build number ------- end + env: + github_ref: ${{ github.ref }} + workflow_run_number: ${{ github.event.workflow_run.run_number}} + + + - name: Setup ENV BUILD_NUMBER by workflow_run + if: ${{ github.event.workflow_run }} + shell: bash + run: | + echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" + + # Generate build number ------- start + DATE=`date "+%Y%m%d"` + run_number=$(($workflow_run_number % 100)) + run_number=$(printf "%02d" $run_number) + build_number="${DATE}${run_number}" + echo '$build_number='$build_number + echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV + # Generate build number ------- end + env: + github_ref: ${{ github.ref }} + workflow_run_number: ${{ github.event.workflow_run.run_number}} + + - name: Inject Environment Variables + shell: bash + env: + GITHUB_SHA: ${{ github.sha }} + COVALENT_KEY: ${{ inputs.covalent_key }} + SENTRY_TOKEN: ${{ inputs.sentry_token }} + SENTRY_PROJECT: ${{ inputs.sentry_project || '' }} + TARGET_ENV_FILE: ${{ inputs.env_file_name || '.env' }} + PRIVY_APP_ID: ${{ inputs.privy_app_id }} + PRIVY_MOBILE_CLIENT_ID: ${{ inputs.privy_mobile_client_id }} + REVENUECAT_API_KEY_WEB: ${{ inputs.revenuecat_api_key_web }} + REVENUECAT_API_KEY_WEB_SANDBOX: ${{ inputs.revenuecat_api_key_web_sandbox }} + REVENUECAT_API_KEY_APPLE: ${{ inputs.revenuecat_api_key_apple }} + REVENUECAT_API_KEY_GOOGLE: ${{ inputs.revenuecat_api_key_google }} + run: | + echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> ${TARGET_ENV_FILE} + echo "GITHUB_TAG=${{ env.GITHUB_TAG }}" >> ${TARGET_ENV_FILE} + echo "CI_BUILD_APP_VERSION=${{ env.BUILD_APP_VERSION }}" >> ${TARGET_ENV_FILE} + echo "CI_BUILD_NUMBER=${{ env.BUILD_NUMBER }}" >> ${TARGET_ENV_FILE} + echo "ENABLE_ANALYZER=1" >> ${TARGET_ENV_FILE} + echo "ENABLE_ANALYZER_HTML_REPORT=1" >> ${TARGET_ENV_FILE} + echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> ${TARGET_ENV_FILE} + echo "SPLIT_BUNDLE=${{ inputs.is-split-bundle }}" >> ${TARGET_ENV_FILE} + echo "SENTRY_AUTH_TOKEN=${{ env.SENTRY_TOKEN }}" >> ${TARGET_ENV_FILE} + echo "SENTRY_TOKEN=${{ env.SENTRY_TOKEN }}" >> ${TARGET_ENV_FILE} + echo "SENTRY_PROJECT=${{ env.SENTRY_PROJECT }}" >> ${TARGET_ENV_FILE} + echo "PRIVY_APP_ID=${{ env.PRIVY_APP_ID }}" >> ${TARGET_ENV_FILE} + echo "PRIVY_MOBILE_CLIENT_ID=${{ env.PRIVY_MOBILE_CLIENT_ID }}" >> ${TARGET_ENV_FILE} + echo "REVENUECAT_API_KEY_WEB=${{ env.REVENUECAT_API_KEY_WEB }}" >> ${TARGET_ENV_FILE} + echo "REVENUECAT_API_KEY_WEB_SANDBOX=${{ env.REVENUECAT_API_KEY_WEB_SANDBOX }}" >> ${TARGET_ENV_FILE} + echo "REVENUECAT_API_KEY_APPLE=${{ env.REVENUECAT_API_KEY_APPLE }}" >> ${TARGET_ENV_FILE} + echo "REVENUECAT_API_KEY_GOOGLE=${{ env.REVENUECAT_API_KEY_GOOGLE }}" >> ${TARGET_ENV_FILE} + if [[ ! -z "${{ inputs.additional_env }}" ]]; then + echo "${{ inputs.additional_env }}" >> ${TARGET_ENV_FILE} + fi + + - name: Print ENV file content + shell: bash + run: | + echo "=== .env ===" + if [ -f .env ]; then + cat .env + fi + echo "--------------------------------" + + echo "=== .env.expo ===" + if [ -f .env.expo ]; then + cat .env.expo + fi + echo "--------------------------------" + + echo "=== .env.version ===" + if [ -f .env.version ]; then + cat .env.version + fi + echo "--------------------------------" + + diff --git a/.github/workflows/release-android-debug.yml b/.github/workflows/release-android-debug.yml index 6068b364de4..400d5b6333e 100644 --- a/.github/workflows/release-android-debug.yml +++ b/.github/workflows/release-android-debug.yml @@ -7,6 +7,7 @@ on: description: "Should it run as split-bundle? (keep it null if you don't need it)" required: false default: '' + jobs: release-android-debug: runs-on: ubuntu-latest @@ -15,39 +16,28 @@ jobs: node-version: [20.x] steps: + # https://github.com/orgs/community/discussions/25678 + - name: Delete huge unnecessary tools folder + run: rm -rf /opt/hostedtoolcache + - name: Checkout Source Code uses: actions/checkout@v3 with: lfs: true - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env with: - path: .env.version - - - name: 'Setup ENV' - run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - github_ref="${github_ref////-}" - github_ref="${github_ref/refs-heads-/}" - github_ref="${github_ref/refs-tags-/}" - echo '$github_ref='$github_ref - echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV - # echo "::set-env name=GITHUB_TAG::$github_ref" - env: - github_ref: ${{ github.ref }} - workflow_run_number: ${{ github.event.workflow_run.run_number}} + env_file_name: ".env.expo" + sentry_project: '' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} - name: Setup Java uses: actions/setup-java@v4 @@ -83,12 +73,6 @@ jobs: run: | yarn - - name: Inject Environment Variables - env: - GITHUB_SHA: ${{ github.sha }} - run: | - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env - - name: Build APK env: NODE_OPTIONS: '--max_old_space_size=8192' @@ -97,6 +81,10 @@ jobs: yarn app:web-embed:build cd apps/mobile/android ./gradlew assembleDebug + + # https://github.com/orgs/community/discussions/25678 + - name: Delete huge unnecessary tools folder + run: rm -rf /opt/hostedtoolcache - name: Upload Main Debug APK uses: actions/upload-artifact@v3 @@ -115,7 +103,17 @@ jobs: - name: Upload Huawei Debug APK uses: actions/upload-artifact@v3 with: - name: release-huawei-debug - path: | - ./apps/mobile/android/app/build/outputs/apk/huawei/debug + name: release-huawei-debug + path: | + ./apps/mobile/android/app/build/outputs/apk/huawei/debug + - name: Free Disk Space + uses: jlumbroso/free-disk-space@main + with: + tool-cache: false + android: true + dotnet: false + haskell: false + large-packages: false + docker-images: false + swap-storage: false diff --git a/.github/workflows/release-android.yml b/.github/workflows/release-android.yml index 0616d14ef4b..89993bd1277 100644 --- a/.github/workflows/release-android.yml +++ b/.github/workflows/release-android.yml @@ -12,15 +12,33 @@ on: description: "Should it run as split-bundle? (keep it null if you don't need it)" required: false default: '' -jobs: + +jobs: release-android: runs-on: ubuntu-latest - if: ${{ !github.event.workflow_run || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }} steps: - - uses: actions/checkout@v3 + - name: Checkout Source Code + uses: actions/checkout@v3 with: lfs: true + + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env + with: + additional_env: | + NO_FLIPPER=1 + SENTRY_DISABLE_AUTO_UPLOAD=false + env_file_name: ".env.expo" + sentry_project: '' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} - name: Setup Node.js uses: actions/setup-node@v3 @@ -42,41 +60,11 @@ jobs: eas-version: latest token: ${{ secrets.EXPO_TOKEN }} - - name: Setup ENV BUILD_NUMBER to 1 - if: ${{ !github.event.workflow_run }} - run: | - # Generate build number ------- start - echo "BUILD_NUMBER=1" >> $GITHUB_ENV - # Generate build number ------- end - - - name: Setup ENV BUILD_NUMBER by workflow_run - if: ${{ github.event.workflow_run }} - run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - env: - workflow_run_number: ${{ github.event.workflow_run.run_number}} - - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main - with: - path: .env.version - - name: Modify build.gradle uses: OneKeyHQ/actions/build-gradle-edit@main with: versionCode: ${{ env.BUILD_NUMBER }} - versionName: ${{ steps.dotenv.outputs.version }} + versionName: ${{ env.BUILD_APP_VERSION }} packageName: 'so.onekey.app.wallet' android_dir: ./apps/mobile @@ -84,19 +72,6 @@ jobs: run: | # pass BUILD_NUMBER as env variable to expo server echo "BUILD_NUMBER=${{ env.BUILD_NUMBER }}" >> .env.version - - - name: Inject Environment Variables - env: - COVALENT_KEY: ${{ secrets.COVALENT_KEY }} - GITHUB_SHA: ${{ github.sha }} - SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} - run: | - echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env.expo - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env.expo - echo "SPLIT_BUNDLE=${{ inputs.is-split-bundle }}" >> .env.expo - echo "NO_FLIPPER=1" >> .env.expo - echo "SENTRY_DISABLE_AUTO_UPLOAD=false" >> .env.expo - echo "SENTRY_AUTH_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env.expo - name: Write .sentry.properties run: | @@ -109,6 +84,15 @@ jobs: run: | yarn + + - name: Build WebEmbed + env: + NODE_OPTIONS: '--max_old_space_size=8192' + SENTRY_DISABLE_AUTO_UPLOAD: 'true' + run: | + yarn app:web-embed:build + + - name: Build on EAS And Submit if: ${{ github.event.workflow_run }} run: | @@ -122,3 +106,12 @@ jobs: run: | cd apps/mobile eas build --profile=production --platform android --non-interactive --no-wait --resource-class large + + - name: Upload WebEmbed Artifacts + uses: actions/upload-artifact@v3 + with: + name: upload-web-embed-artifacts + path: | + ./apps/web-embed/web-build + if-no-files-found: error + diff --git a/.github/workflows/release-desktop-mas.yml b/.github/workflows/release-desktop-mas.yml index 5b72c50e319..6c3df38985d 100644 --- a/.github/workflows/release-desktop-mas.yml +++ b/.github/workflows/release-desktop-mas.yml @@ -22,36 +22,25 @@ jobs: with: lfs: true - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env with: - path: .env.version + env_file_name: ".env" + sentry_project: 'desktop-mas' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} - name: 'Setup ENV' run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - github_ref="${github_ref////-}" - github_ref="${github_ref/refs-heads-/}" - github_ref="${github_ref/refs-tags-/}" - echo '$github_ref='$github_ref - echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV - # echo "::set-env name=GITHUB_TAG::$github_ref" - eval "$(node -e 'const v=require("./apps/desktop/package.json").version; console.log("pkg_version="+v)')" echo '$pkg_version='$pkg_version echo "PKG_VERSION=$pkg_version" >> $GITHUB_ENV - artifacts_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" echo "ARTIFACTS_URL=$artifacts_url" >> $GITHUB_ENV @@ -92,18 +81,6 @@ jobs: run: | cd ./apps/desktop && yarn add electron-builder@23.6.0 - - name: Inject Environment Variables - env: - COVALENT_KEY: ${{ secrets.COVALENT_KEY }} - GITHUB_SHA: ${{ github.sha }} - SENTRY_PROJECT: 'desktop-mas' - SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} - run: | - echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env - echo "SENTRY_PROJECT=${{ env.SENTRY_PROJECT }}" >> .env - echo "SENTRY_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env - # - name: Setup Code Signing file # run: | # echo ${{ secrets.DESKTOP_KEYS_SECRET }} | base64 -d > apps/desktop/sign.p12 diff --git a/.github/workflows/release-desktop-snap.yml b/.github/workflows/release-desktop-snap.yml index 9668b15f390..7918ed6c64c 100644 --- a/.github/workflows/release-desktop-snap.yml +++ b/.github/workflows/release-desktop-snap.yml @@ -9,6 +9,7 @@ on: workflow_dispatch: jobs: + release-desktop: runs-on: ubuntu-latest strategy: @@ -21,36 +22,27 @@ jobs: uses: actions/checkout@v3 with: lfs: true + + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env + with: + env_file_name: ".env" + sentry_project: 'desktop-snap' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} + - name: Install Snapcraft uses: samuelmeuli/action-snapcraft@v2 - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main - with: - path: .env.version - - name: 'Setup ENV' run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - github_ref="${github_ref////-}" - github_ref="${github_ref/refs-heads-/}" - github_ref="${github_ref/refs-tags-/}" - echo '$github_ref='$github_ref - echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV - # echo "::set-env name=GITHUB_TAG::$github_ref" - eval "$(node -e 'const v=require("./apps/desktop/package.json").version; console.log("pkg_version="+v)')" echo '$pkg_version='$pkg_version echo "PKG_VERSION=$pkg_version" >> $GITHUB_ENV @@ -89,18 +81,6 @@ jobs: run: | yarn - - name: Inject Environment Variables - env: - COVALENT_KEY: ${{ secrets.COVALENT_KEY }} - GITHUB_SHA: ${{ github.sha }} - SENTRY_PROJECT: 'desktop-snap' - SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} - run: | - echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env - echo "SENTRY_PROJECT=${{ env.SENTRY_PROJECT }}" >> .env - echo "SENTRY_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env - - name: Build and Sign Snap Linux env: NODE_OPTIONS: '--max_old_space_size=8192' diff --git a/.github/workflows/release-desktop-winms.yml b/.github/workflows/release-desktop-winms.yml index 5f0fae5e2f4..672c59a27ab 100644 --- a/.github/workflows/release-desktop-winms.yml +++ b/.github/workflows/release-desktop-winms.yml @@ -22,32 +22,24 @@ jobs: with: lfs: true - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env with: - path: .env.version + env_file_name: ".env" + sentry_project: 'desktop-winms' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} + + - name: 'Setup ENV' run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - github_ref="${github_ref////-}" - github_ref="${github_ref/refs-heads-/}" - github_ref="${github_ref/refs-tags-/}" - echo '$github_ref='$github_ref - echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV - # echo "::set-env name=GITHUB_TAG::$github_ref" - eval "$(node -e 'const v=require("./apps/desktop/package.json").version; console.log("pkg_version="+v)')" echo '$pkg_version='$pkg_version echo "PKG_VERSION=$pkg_version" >> $GITHUB_ENV @@ -86,18 +78,6 @@ jobs: run: | yarn - - name: Inject Environment Variables - env: - COVALENT_KEY: ${{ secrets.COVALENT_KEY }} - GITHUB_SHA: ${{ github.sha }} - SENTRY_PROJECT: 'desktop-winms' - SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} - run: | - echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env - echo "SENTRY_PROJECT=${{ env.SENTRY_PROJECT }}" >> .env - echo "SENTRY_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env - - name: Setup Code Signing file run: | echo ${{ secrets.DESKTOP_KEYS_SECRET }} | base64 -d > apps/desktop/sign.p12 diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml index 9ad91018c7a..414037f6da9 100644 --- a/.github/workflows/release-desktop.yml +++ b/.github/workflows/release-desktop.yml @@ -22,32 +22,23 @@ jobs: with: lfs: true - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env with: - path: .env.version + env_file_name: ".env" + sentry_project: 'desktop' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} + - name: 'Setup ENV' run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - github_ref="${github_ref////-}" - github_ref="${github_ref/refs-heads-/}" - github_ref="${github_ref/refs-tags-/}" - echo '$github_ref='$github_ref - echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV - # echo "::set-env name=GITHUB_TAG::$github_ref" - eval "$(node -e 'const v=require("./apps/desktop/package.json").version; console.log("pkg_version="+v)')" echo '$pkg_version='$pkg_version echo "PKG_VERSION=$pkg_version" >> $GITHUB_ENV @@ -86,18 +77,6 @@ jobs: run: | yarn - - name: Inject Environment Variables - env: - COVALENT_KEY: ${{ secrets.COVALENT_KEY }} - GITHUB_SHA: ${{ github.sha }} - SENTRY_PROJECT: 'desktop' - SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} - run: | - echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env - echo "SENTRY_PROJECT=${{ env.SENTRY_PROJECT }}" >> .env - echo "SENTRY_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env - - name: Setup Code Signing file run: | echo ${{ secrets.DESKTOP_KEYS_SECRET }} | base64 -d > apps/desktop/sign.p12 diff --git a/.github/workflows/release-ext.yml b/.github/workflows/release-ext.yml index 0acc7c710bc..554898950fe 100644 --- a/.github/workflows/release-ext.yml +++ b/.github/workflows/release-ext.yml @@ -21,33 +21,23 @@ jobs: uses: actions/checkout@v3 with: lfs: true - - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main + + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env with: - path: .env.version + env_file_name: ".env" + sentry_project: 'chrome-extension' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} - name: 'Setup ENV' run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - github_ref="${github_ref////-}" - github_ref="${github_ref/refs-heads-/}" - github_ref="${github_ref/refs-tags-/}" - echo '$github_ref='$github_ref - echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV - # echo "::set-env name=GITHUB_TAG::$github_ref" - eval "$(node -e 'const v=require("./apps/ext/package.json").version; console.log("pkg_version="+v)')" echo '$pkg_version='$pkg_version echo "PKG_VERSION=$pkg_version" >> $GITHUB_ENV @@ -86,18 +76,6 @@ jobs: run: | yarn - - name: Inject Environment Variables - env: - COVALENT_KEY: ${{ secrets.COVALENT_KEY }} - GITHUB_SHA: ${{ github.sha }} - SENTRY_PROJECT: 'chrome-extension' - SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} - run: | - echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env - echo "SENTRY_PROJECT=${{ env.SENTRY_PROJECT }}" >> .env - echo "SENTRY_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env - - name: Build Ext env: NODE_OPTIONS: '--max_old_space_size=8192' diff --git a/.github/workflows/release-ios-debug.yml b/.github/workflows/release-ios-debug.yml index d39e9560b41..0869d9ff390 100644 --- a/.github/workflows/release-ios-debug.yml +++ b/.github/workflows/release-ios-debug.yml @@ -7,6 +7,7 @@ on: description: "Should it run as split-bundle? (keep it null if you don't need it)" required: false default: '' + jobs: release-ios-debug: runs-on: macos-14 @@ -22,34 +23,21 @@ jobs: with: lfs: true - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env with: - path: .env.version + env_file_name: ".env.expo" + sentry_project: '' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} + - - name: 'Setup ENV' - run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - github_ref="${github_ref////-}" - github_ref="${github_ref/refs-heads-/}" - github_ref="${github_ref/refs-tags-/}" - echo '$github_ref='$github_ref - echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV - # echo "::set-env name=GITHUB_TAG::$github_ref" - env: - github_ref: ${{ github.ref }} - workflow_run_number: ${{ github.event.workflow_run.run_number}} - name: Setup Node uses: actions/setup-node@v3 @@ -91,12 +79,6 @@ jobs: gem install cocoapods -v 1.15.2 pod install - - name: Inject Environment Variables - env: - GITHUB_SHA: ${{ github.sha }} - run: | - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env - - name: Build App File env: NODE_OPTIONS: '--max_old_space_size=8192' diff --git a/.github/workflows/release-ios.yml b/.github/workflows/release-ios.yml index d0abd53f03d..771adb388ea 100644 --- a/.github/workflows/release-ios.yml +++ b/.github/workflows/release-ios.yml @@ -12,16 +12,35 @@ on: description: "Should it run as split-bundle? (keep it null if you don't need it)" required: false default: '' + jobs: release-ios: runs-on: ubuntu-latest - if: ${{ !github.event.workflow_run || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }} steps: - - uses: actions/checkout@v3 + - name: Checkout Source Code + uses: actions/checkout@v3 with: lfs: true + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env + with: + additional_env: | + NO_FLIPPER=1 + SENTRY_DISABLE_AUTO_UPLOAD=false + env_file_name: ".env.expo" + sentry_project: '' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} + + - name: Setup Node.js uses: actions/setup-node@v3 with: @@ -49,41 +68,11 @@ jobs: echo ${{ secrets.ADHOC_PROFILE }} | base64 -d > apps/mobile/ios/certs/profile.mobileprovision echo ${{ secrets.ADHOC_SERVICE_EXTENSION_PROFILE }} | base64 -d > apps/mobile/ios/certs/serviceextension-profile.mobileprovision - - name: Setup ENV BUILD_NUMBER to 1 - if: ${{ !github.event.workflow_run }} - run: | - # Generate build number ------- start - echo "BUILD_NUMBER=1" >> $GITHUB_ENV - # Generate build number ------- end - - - name: Setup ENV BUILD_NUMBER by workflow_run - if: ${{ github.event.workflow_run }} - run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - env: - workflow_run_number: ${{ github.event.workflow_run.run_number}} - - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main - with: - path: .env.version - - name: Modify OneKeyWallet info.plist uses: OneKeyHQ/actions/build-plist-edit@main with: buildNumber: ${{ env.BUILD_NUMBER }} - versionName: ${{ steps.dotenv.outputs.version }} + versionName: ${{ env.BUILD_APP_VERSION }} projectName: OneKeyWallet dir: ./apps/mobile @@ -91,7 +80,7 @@ jobs: uses: OneKeyHQ/actions/build-plist-edit@main with: buildNumber: ${{ env.BUILD_NUMBER }} - versionName: ${{ steps.dotenv.outputs.version }} + versionName: ${{ env.BUILD_APP_VERSION }} projectName: ServiceExtension dir: ./apps/mobile @@ -100,23 +89,10 @@ jobs: # pass BUILD_NUMBER as env variable to expo server echo "BUILD_NUMBER=${{ env.BUILD_NUMBER }}" >> .env.version - - name: Inject Environment Variables - env: - COVALENT_KEY: ${{ secrets.COVALENT_KEY }} - GITHUB_SHA: ${{ github.sha }} - SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} - run: | - echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env.expo - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env.expo - echo "SPLIT_BUNDLE=${{ inputs.is-split-bundle }}" >> .env.expo - echo "NO_FLIPPER=1" >> .env.expo - echo "SENTRY_DISABLE_AUTO_UPLOAD=false" >> .env.expo - echo "SENTRY_AUTH_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env.expo - - name: Write .sentry.properties run: | echo "auth.token=${{ secrets.SENTRY_TOKEN }}" >> apps/mobile/ios/sentry.properties - + - name: Install Dep env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-web.yml b/.github/workflows/release-web.yml index 050a7a97922..7cc424d846c 100644 --- a/.github/workflows/release-web.yml +++ b/.github/workflows/release-web.yml @@ -17,7 +17,26 @@ jobs: TEST_ENDPOINT: app.onekeytest.com if: ${{ !github.event.workflow_run || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }} steps: - - uses: actions/checkout@v3 + - name: Checkout Source Code + uses: actions/checkout@v3 + with: + lfs: true + + - name: Run Shared Env Setup + uses: ./.github/actions/shared-env + with: + env_file_name: ".env" + sentry_project: 'web' + covalent_key: ${{ secrets.COVALENT_KEY }} + sentry_token: ${{ secrets.SENTRY_TOKEN }} + privy_app_id: ${{ secrets.PRIVY_APP_ID }} + privy_mobile_client_id: ${{ secrets.PRIVY_MOBILE_CLIENT_ID }} + revenuecat_api_key_web: ${{ secrets.REVENUECAT_API_KEY_WEB }} + revenuecat_api_key_web_sandbox: ${{ secrets.REVENUECAT_API_KEY_WEB_SANDBOX }} + revenuecat_api_key_apple: ${{ secrets.REVENUECAT_API_KEY_APPLE }} + revenuecat_api_key_google: ${{ secrets.REVENUECAT_API_KEY_GOOGLE }} + + - name: Setup Environment uses: actions/setup-node@v3 with: @@ -26,31 +45,8 @@ jobs: scope: '@onekeyhq' node-version: '20.x' - - name: Dotenv Action - id: dotenv - uses: OneKeyHQ/actions/dotenv-action@main - with: - path: .env.version - - name: Setup ENV run: | - echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}" - - # Generate build number ------- start - DATE=`date "+%Y%m%d"` - run_number=$(($workflow_run_number % 100)) - run_number=$(printf "%02d" $run_number) - build_number="${DATE}${run_number}" - echo '$build_number='$build_number - echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV - # Generate build number ------- end - - github_ref="${github_ref////-}" - github_ref="${github_ref/refs-heads-/}" - github_ref="${github_ref/refs-tags-/}" - echo '$github_ref='$github_ref - echo "GITHUB_TAG=$github_ref" >> $GITHUB_ENV - # echo "::set-env name=GITHUB_TAG::$github_ref" eval "$(node -e 'const v=require("./apps/web/package.json").version; console.log("pkg_version="+v)')" echo '$pkg_version='$pkg_version @@ -70,18 +66,6 @@ jobs: run: | yarn - - name: Inject Environment Variables - env: - COVALENT_KEY: ${{ secrets.COVALENT_KEY }} - GITHUB_SHA: ${{ github.sha }} - SENTRY_PROJECT: 'web' - SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} - run: | - echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env - echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env - echo "SENTRY_PROJECT=${{ env.SENTRY_PROJECT }}" >> .env - echo "SENTRY_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env - - name: Build Target env: PUBLIC_URL: ${{ env.PUBLIC_URL }} diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 30f5f81a62c..db43cf5620f 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -63,3 +63,11 @@ jobs: NODE_OPTIONS: '--max_old_space_size=4096' run: | yarn test + + - name: Upload Test Report + uses: actions/upload-artifact@v3 + if: always() + with: + name: test-report + path: test-report.html + diff --git a/@types/globals.d.ts b/@types/globals.d.ts index 4e6225507db..66bfdc8b6d6 100644 --- a/@types/globals.d.ts +++ b/@types/globals.d.ts @@ -4,7 +4,7 @@ import type { ETranslations, ETranslationsMock, } from '@onekeyhq/shared/src/locale'; - +import type { IWebEmbedOnekeyAppSettings } from '@onekeyhq/web-embed/utils/webEmbedAppSettings'; import type { ProviderPrivate } from '@onekeyfe/onekey-private-provider'; type IWindowOneKeyHub = { @@ -70,6 +70,8 @@ declare global { var extJsBridgeOffscreenToBg: JsBridgeBase; var ONEKEY_DESKTOP_DEEP_LINKS: any[]; + var WEB_EMBED_ONEKEY_APP_SETTINGS: IWebEmbedOnekeyAppSettings | undefined; + // eslint-disable-next-line @typescript-eslint/naming-convention interface Error extends Error { $$autoPrintErrorIgnore?: boolean; diff --git a/apps/desktop/App.tsx b/apps/desktop/App.tsx index 4a03038a5b8..583aa26fb07 100644 --- a/apps/desktop/App.tsx +++ b/apps/desktop/App.tsx @@ -8,8 +8,9 @@ import { initSentry, withSentryHOC, } from '@onekeyhq/shared/src/modules3rdParty/sentry'; +import { SentryErrorBoundaryFallback } from '@onekeyhq/kit/src/components/ErrorBoundary'; initSentry(); -export default withSentryHOC(KitProvider); +export default withSentryHOC(KitProvider, SentryErrorBoundaryFallback); // export default KitProvider; diff --git a/apps/desktop/webpack.config.js b/apps/desktop/webpack.config.js index bc2fd554aab..7b2ec4fcebc 100644 --- a/apps/desktop/webpack.config.js +++ b/apps/desktop/webpack.config.js @@ -1,3 +1,5 @@ +require('../../development/env'); + const webConfig = require('../../development/webpack/webpack.desktop.config'); module.exports = webConfig({ basePath: __dirname }); diff --git a/apps/ext/package.json b/apps/ext/package.json index 9a87a90c7f8..237cbd0cc23 100644 --- a/apps/ext/package.json +++ b/apps/ext/package.json @@ -11,7 +11,7 @@ "build:all": "yarn clean && yarn build && node ../../development/webpack/ext/zip.js", "start:v3": "EXT_MANIFEST_V3=1 WEB_PORT=3180 NODE_OPTIONS=\"--max-old-space-size=8192\" webpack serve", "start:v3:proxy": "ONEKEY_PROXY=true yarn start:v3", - "build:v3": "cross-env NODE_ENV=production EXT_MANIFEST_V3=1 webpack build", + "build:v3": "cross-env NODE_ENV=production EXT_MANIFEST_V3=1 NODE_OPTIONS=\"--max-old-space-size=8192\" webpack build", "build:all:v3": "yarn clean && yarn build:v3 && node ../../development/webpack/ext/zip.js", "android": "expo start --android", "ios": "expo start --ios", diff --git a/apps/ext/src/ui/renderApp.tsx b/apps/ext/src/ui/renderApp.tsx index ddd331c94ed..c4157eb7480 100644 --- a/apps/ext/src/ui/renderApp.tsx +++ b/apps/ext/src/ui/renderApp.tsx @@ -5,6 +5,7 @@ import 'setimmediate'; // eslint-disable-next-line import/order import { createRoot } from 'react-dom/client'; +import { SentryErrorBoundaryFallback } from '@onekeyhq/kit/src/components/ErrorBoundary'; import { initSentry, withSentryHOC, @@ -14,7 +15,7 @@ import App from '../App'; initSentry(); -const WithSentryHOC = withSentryHOC(App); +const WithSentryHOC = withSentryHOC(App, SentryErrorBoundaryFallback); function renderApp() { const root = globalThis.document.querySelector('#root'); diff --git a/apps/ext/webpack.config.js b/apps/ext/webpack.config.js index 84a066bab79..17dde8df7b5 100644 --- a/apps/ext/webpack.config.js +++ b/apps/ext/webpack.config.js @@ -1,3 +1,5 @@ +require('../../development/env'); + const webConfig = require('../../development/webpack/webpack.ext.config'); module.exports = webConfig({ basePath: __dirname }); diff --git a/apps/mobile/App.tsx b/apps/mobile/App.tsx index c3d78329138..7207a659a59 100644 --- a/apps/mobile/App.tsx +++ b/apps/mobile/App.tsx @@ -3,5 +3,6 @@ import '@onekeyhq/shared/src/polyfills'; import { KitProvider } from '@onekeyhq/kit'; import { withSentryHOC } from '@onekeyhq/shared/src/modules3rdParty/sentry'; +import { SentryErrorBoundaryFallback } from '@onekeyhq/kit/src/components/ErrorBoundary'; -export default withSentryHOC(KitProvider); +export default withSentryHOC(KitProvider, SentryErrorBoundaryFallback); diff --git a/apps/mobile/android/app/build.gradle b/apps/mobile/android/app/build.gradle index e2c101a1674..75a09964871 100644 --- a/apps/mobile/android/app/build.gradle +++ b/apps/mobile/android/app/build.gradle @@ -139,7 +139,7 @@ android { namespace 'so.onekey.app.wallet' defaultConfig { - applicationId 'so.onekey.app.wallet.dev' + applicationId 'so.onekey.app.wallet' minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 diff --git a/apps/mobile/android/app/google-services.json b/apps/mobile/android/app/google-services.json index 023f5b87850..cf24d4e70de 100644 --- a/apps/mobile/android/app/google-services.json +++ b/apps/mobile/android/app/google-services.json @@ -9,7 +9,7 @@ "client_info": { "mobilesdk_app_id": "1:117481276073:android:bdffdba4b36cd239b5dfb8", "android_client_info": { - "package_name": "so.onekey.app.wallet.dev" + "package_name": "so.onekey.app.wallet" } }, "oauth_client": [ @@ -17,7 +17,7 @@ "client_id": "117481276073-f3s78ljijap43crv50qvk21h5m7k5mbq.apps.googleusercontent.com", "client_type": 1, "android_info": { - "package_name": "so.onekey.app.wallet.dev", + "package_name": "so.onekey.app.wallet", "certificate_hash": "5e8f16062ea3cd2c4a0d547876baa6f38cabf625" } }, diff --git a/apps/mobile/android/app/src/main/AndroidManifest.xml b/apps/mobile/android/app/src/main/AndroidManifest.xml index e90c1e45a2f..79baabb1aa8 100644 --- a/apps/mobile/android/app/src/main/AndroidManifest.xml +++ b/apps/mobile/android/app/src/main/AndroidManifest.xml @@ -35,7 +35,9 @@ - + diff --git a/apps/mobile/android/build.gradle b/apps/mobile/android/build.gradle index 8160d2ee1f9..dd4dbd4e39d 100644 --- a/apps/mobile/android/build.gradle +++ b/apps/mobile/android/build.gradle @@ -18,7 +18,7 @@ buildscript { mavenCentral() } dependencies { - classpath('com.android.tools.build:gradle') + classpath('com.android.tools.build:gradle:8.5.0') classpath('com.facebook.react:react-native-gradle-plugin') classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath 'com.google.gms:google-services:4.3.15' @@ -56,9 +56,11 @@ allprojects { repositories { maven { url(expoCameraMavenPath) } } } // Execution failed for task ':bufgix-react-native-secure-window:compileDebugKotlin'. // 'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 11) jvm target compatibility should be set to the same Java version. allprojects { - tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { - kotlinOptions { - jvmTarget = "17" + project(':bufgix-react-native-secure-window') { + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions { + jvmTarget = "17" + } } } } diff --git a/apps/mobile/android/gradle.properties b/apps/mobile/android/gradle.properties index 76d44be6c86..f1e30080644 100644 --- a/apps/mobile/android/gradle.properties +++ b/apps/mobile/android/gradle.properties @@ -10,7 +10,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m -org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m +org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit @@ -56,7 +56,7 @@ EX_DEV_CLIENT_NETWORK_INSPECTOR=true # https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/gradle.properties FRESCO_VERSION=2.5.0 OKHTTP_VERSION=4.9.2 -ANDROIDX_APPCOMPAT_VERSION=1.4.1 +ANDROIDX_APPCOMPAT_VERSION=1.6.8 # see https://react-native-async-storage.github.io/async-storage/docs/advanced/db_size/ # see https://www.sqlite.org/limits.html diff --git a/apps/mobile/android/gradle/wrapper/gradle-wrapper.properties b/apps/mobile/android/gradle/wrapper/gradle-wrapper.properties index 03bc515044f..bb6c1919470 100644 --- a/apps/mobile/android/gradle/wrapper/gradle-wrapper.properties +++ b/apps/mobile/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/apps/mobile/app.json b/apps/mobile/app.json index 565f59be65a..257ac70f47e 100644 --- a/apps/mobile/app.json +++ b/apps/mobile/app.json @@ -41,7 +41,9 @@ "project": "react-native", "organization": "onekey-bb" } - ] + ], + "expo-font", + "expo-secure-store" ] } } diff --git a/apps/mobile/ios/OneKeyWallet.xcodeproj/project.pbxproj b/apps/mobile/ios/OneKeyWallet.xcodeproj/project.pbxproj index de985da7c6f..ee416223935 100644 --- a/apps/mobile/ios/OneKeyWallet.xcodeproj/project.pbxproj +++ b/apps/mobile/ios/OneKeyWallet.xcodeproj/project.pbxproj @@ -23,6 +23,7 @@ EA73E1F22C3EAEAD000E9398 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = EA73E1F12C3EAEAD000E9398 /* GoogleService-Info.plist */; }; EA9B87EC2BD94E3B00B8E64A /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = EA9B87EB2BD94E3B00B8E64A /* PrivacyInfo.xcprivacy */; }; EA9FF4ED2BDFFDBB00AC618A /* web-embed in Resources */ = {isa = PBXBuildFile; fileRef = EA9FF4EC2BDFFDBB00AC618A /* web-embed */; }; + F42739F92D24DABD0072EBA9 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F42739F82D24DABD0072EBA9 /* StoreKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -97,6 +98,7 @@ EA9B87EB2BD94E3B00B8E64A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; EA9FF4EC2BDFFDBB00AC618A /* web-embed */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "web-embed"; path = "OneKeyWallet/web-embed"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + F42739F82D24DABD0072EBA9 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -105,6 +107,7 @@ buildActionMask = 2147483647; files = ( 66629869BAECC5C48E46292A /* Pods_OneKeyWallet.framework in Frameworks */, + F42739F92D24DABD0072EBA9 /* StoreKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -155,6 +158,7 @@ 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { isa = PBXGroup; children = ( + F42739F82D24DABD0072EBA9 /* StoreKit.framework */, ED297162215061F000B7C4FE /* JavaScriptCore.framework */, D7AF803390CE7CF8ECC3DBAB /* Pods_OneKeyWallet.framework */, ); @@ -417,22 +421,30 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-OneKeyWallet/Pods-OneKeyWallet-resources.sh", "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/JXCategoryView/JXCategoryView.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/JXPagingView/JXPagerView.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/PurchasesHybridCommon/PurchasesHybridCommon.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/RNImageCropPickerPrivacyInfo.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/RevenueCat/RevenueCat.bundle", + "${PODS_CONFIGURATION_BUILD_DIR}/RevenueCatUI/RevenueCat_RevenueCatUI.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/Sentry/Sentry.bundle", "${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle", ); name = "[CP] Copy Pods Resources"; outputPaths = ( "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/JXCategoryView.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/JXPagerView.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/PurchasesHybridCommon.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNImageCropPickerPrivacyInfo.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RevenueCat.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RevenueCat_RevenueCatUI.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Sentry.bundle", "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle", ); diff --git a/apps/mobile/ios/Podfile.lock b/apps/mobile/ios/Podfile.lock index dab834dab43..b41638d4d50 100644 --- a/apps/mobile/ios/Podfile.lock +++ b/apps/mobile/ios/Podfile.lock @@ -16,7 +16,7 @@ PODS: - ExpoModulesCore - ZXingObjC/OneD - ZXingObjC/PDF417 - - EXConstants (15.4.5): + - EXConstants (15.4.6): - ExpoModulesCore - EXFont (11.10.3): - ExpoModulesCore @@ -27,10 +27,14 @@ PODS: - ExpoModulesCore - Expo (50.0.20): - ExpoModulesCore + - ExpoAppleAuthentication (6.3.0): + - ExpoModulesCore - ExpoBlur (12.9.1): - ExpoModulesCore - ExpoClipboard (5.0.1): - ExpoModulesCore + - ExpoCrypto (12.8.1): + - ExpoModulesCore - ExpoDevice (5.9.3): - ExpoModulesCore - ExpoFileSystem (16.0.5): @@ -57,10 +61,14 @@ PODS: - React-NativeModulesApple - React-RCTAppDelegate - ReactCommon/turbomodule/core + - ExpoNativeExtensions (0.0.3): + - ExpoModulesCore - ExpoSecureStore (12.5.0): - ExpoModulesCore - ExpoSharing (11.10.0): - ExpoModulesCore + - ExpoWebBrowser (12.8.2): + - ExpoModulesCore - EXScreenCapture (5.8.0): - ExpoModulesCore - EXSplashScreen (0.26.4): @@ -111,6 +119,11 @@ PODS: - MMKVCore (~> 1.3.1) - MMKVCore (1.3.1) - MultiplatformBleAdapter (0.1.9) + - PurchasesHybridCommon (13.14.0): + - RevenueCat (= 5.14.0) + - PurchasesHybridCommonUI (13.14.0): + - PurchasesHybridCommon (= 13.14.0) + - RevenueCatUI (= 5.14.0) - RCT-Folly (2022.05.16.00): - boost - DoubleConversion @@ -1218,6 +1231,9 @@ PODS: - ScreenshotPreventing - RealmJS (12.3.0): - React + - RevenueCat (5.14.0) + - RevenueCatUI (5.14.0): + - RevenueCat (= 5.14.0) - RNCAsyncStorage (1.22.0): - React-Core - RNDeviceInfo (10.11.0): @@ -1251,8 +1267,14 @@ PODS: - RNNotifee/NotifeeCore (= 9.0.0) - RNNotifee/NotifeeCore (9.0.0): - React-Core + - RNPaywalls (8.5.0): + - PurchasesHybridCommonUI (= 13.14.0) + - React-Core - RNPermissions (4.1.5): - React-Core + - RNPurchases (8.5.0): + - PurchasesHybridCommon (= 13.14.0) + - React-Core - RNReanimated (3.6.1): - glog - RCT-Folly (= 2022.05.16.00) @@ -1313,8 +1335,10 @@ DEPENDENCIES: - EXImageLoader (from `../../../node_modules/expo-image-loader/ios`) - EXNotifications (from `../../../node_modules/expo-notifications/ios`) - Expo (from `../../../node_modules/expo`) + - ExpoAppleAuthentication (from `../../../node_modules/expo-apple-authentication/ios`) - ExpoBlur (from `../../../node_modules/expo-blur/ios`) - ExpoClipboard (from `../../../node_modules/expo-clipboard/ios`) + - ExpoCrypto (from `../../../node_modules/expo-crypto/ios`) - ExpoDevice (from `../../../node_modules/expo-device/ios`) - ExpoFileSystem (from `../../../node_modules/expo-file-system/ios`) - ExpoHaptics (from `../../../node_modules/expo-haptics/ios`) @@ -1325,8 +1349,10 @@ DEPENDENCIES: - ExpoLocalAuthentication (from `../../../node_modules/expo-local-authentication/ios`) - ExpoLocalization (from `../../../node_modules/expo-localization/ios`) - ExpoModulesCore (from `../../../node_modules/expo-modules-core`) + - "ExpoNativeExtensions (from `../../../node_modules/@privy-io/expo-native-extensions/ios`)" - ExpoSecureStore (from `../../../node_modules/expo-secure-store/ios`) - ExpoSharing (from `../../../node_modules/expo-sharing/ios`) + - ExpoWebBrowser (from `../../../node_modules/expo-web-browser/ios`) - EXScreenCapture (from `../../../node_modules/expo-screen-capture/ios`) - EXSplashScreen (from `../../../node_modules/expo-splash-screen/ios`) - FBLazyVector (from `../../../node_modules/react-native/Libraries/FBLazyVector`) @@ -1413,7 +1439,9 @@ DEPENDENCIES: - RNGestureHandler (from `../../../node_modules/react-native-gesture-handler`) - RNImageCropPicker (from `../../../node_modules/react-native-image-crop-picker`) - "RNNotifee (from `../../../node_modules/@notifee/react-native`)" + - RNPaywalls (from `../../../node_modules/react-native-purchases-ui`) - RNPermissions (from `../../../node_modules/react-native-permissions`) + - RNPurchases (from `../../../node_modules/react-native-purchases`) - RNReanimated (from `../../../node_modules/react-native-reanimated`) - RNScreens (from `../../../node_modules/react-native-screens`) - "RNSentry (from `../../../node_modules/@sentry/react-native`)" @@ -1437,6 +1465,10 @@ SPEC REPOS: - MMKV - MMKVCore - MultiplatformBleAdapter + - PurchasesHybridCommon + - PurchasesHybridCommonUI + - RevenueCat + - RevenueCatUI - ScreenshotPreventing - SDWebImage - SDWebImageWebPCoder @@ -1469,10 +1501,14 @@ EXTERNAL SOURCES: :path: "../../../node_modules/expo-notifications/ios" Expo: :path: "../../../node_modules/expo" + ExpoAppleAuthentication: + :path: "../../../node_modules/expo-apple-authentication/ios" ExpoBlur: :path: "../../../node_modules/expo-blur/ios" ExpoClipboard: :path: "../../../node_modules/expo-clipboard/ios" + ExpoCrypto: + :path: "../../../node_modules/expo-crypto/ios" ExpoDevice: :path: "../../../node_modules/expo-device/ios" ExpoFileSystem: @@ -1493,10 +1529,14 @@ EXTERNAL SOURCES: :path: "../../../node_modules/expo-localization/ios" ExpoModulesCore: :path: "../../../node_modules/expo-modules-core" + ExpoNativeExtensions: + :path: "../../../node_modules/@privy-io/expo-native-extensions/ios" ExpoSecureStore: :path: "../../../node_modules/expo-secure-store/ios" ExpoSharing: :path: "../../../node_modules/expo-sharing/ios" + ExpoWebBrowser: + :path: "../../../node_modules/expo-web-browser/ios" EXScreenCapture: :path: "../../../node_modules/expo-screen-capture/ios" EXSplashScreen: @@ -1664,8 +1704,12 @@ EXTERNAL SOURCES: :path: "../../../node_modules/react-native-image-crop-picker" RNNotifee: :path: "../../../node_modules/@notifee/react-native" + RNPaywalls: + :path: "../../../node_modules/react-native-purchases-ui" RNPermissions: :path: "../../../node_modules/react-native-permissions" + RNPurchases: + :path: "../../../node_modules/react-native-purchases" RNReanimated: :path: "../../../node_modules/react-native-reanimated" RNScreens: @@ -1689,13 +1733,15 @@ SPEC CHECKSUMS: DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 EXApplication: 137189a3f149b4e8e546884629392c3efc94cbd3 EXBarCodeScanner: d59fd943cebee3f913ebf4ffde0d05d344da8b78 - EXConstants: 988aa430ca0f76b43cd46b66e7fae3287f9cc2fc + EXConstants: a5f6276e565d98f9eb4280f81241fc342d641590 EXFont: f20669cb266ef48b004f1eb1f2b20db96cd1df9f EXImageLoader: 03063370bc06ea1825713d3f55fe0455f7c88d04 EXNotifications: e11f0e9a5b657c064a481a5d522f3bc5a07bf7cd Expo: d86f597bbab83615207499c5b3bfd80992e2bbd3 + ExpoAppleAuthentication: 4fc9972356977f009911f2f3a5f56319c2a5b11b ExpoBlur: 2eb7f7ac50c0818ee7d596996e4c0112b3d225f6 ExpoClipboard: b597982124f067ff9f5b89093eb3d97898d5d877 + ExpoCrypto: b6428f48599c007676dc81a9b5f72c07e62fdccc ExpoDevice: d204395e17fffdcefa7470bdef33b07719ac41b1 ExpoFileSystem: 04795dd4d47e76eaf12e38c92091f77d794f9e7f ExpoHaptics: 28a771b630353cd6e8dcf1b1e3e693e38ad7c3c3 @@ -1706,8 +1752,10 @@ SPEC CHECKSUMS: ExpoLocalAuthentication: 2fed4b25cf8e54d36d5d1ebc9917e8325b3b5911 ExpoLocalization: 2d5f47577d67ce991ebdd951edf14fe1db85fa06 ExpoModulesCore: 370096473359f5f6aade0871400d063333747719 + ExpoNativeExtensions: 6c442ddce49ea2d1780e56224b222e5b103193f1 ExpoSecureStore: 5372610a4bbcf5e50fafbe6f38f8d9c22edf8253 ExpoSharing: 752ad6ae2b693de9cd4e7fddb78297bdc658b815 + ExpoWebBrowser: e31c97230ea93b51a2a74c6c2381b0d4fca5698c EXScreenCapture: d23d01882ce614ba2a341f9fe4bf4a9559830d92 EXSplashScreen: 6bd596128cd52fac91997ebc64f3d394c843a8f9 FBLazyVector: 9f533d5a4c75ca77c8ed774aced1a91a0701781e @@ -1728,6 +1776,8 @@ SPEC CHECKSUMS: MMKV: 5a07930c70c70b86cd87761a42c8f3836fb681d7 MMKVCore: e50135dbd33235b6ab390635991bab437ab873c0 MultiplatformBleAdapter: 5a6a897b006764392f9cef785e4360f54fb9477d + PurchasesHybridCommon: ea662e5a551e6fc79c1eb17feb0478c01c59f3e6 + PurchasesHybridCommonUI: 7f6a7707655327740f4b7e2842985bcb38745030 RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0 RCTRequired: 77f73950d15b8c1a2b48ba5b79020c3003d1c9b5 RCTTypeSafety: ede1e2576424d89471ef553b2aed09fbbcc038e3 @@ -1792,6 +1842,8 @@ SPEC CHECKSUMS: ReactNativeKeyboardManager: 60292dbac467c49841a7d69588208ec4a4f7b2a2 ReactNativeSecureWindow: b9dcbfe769995b0e0f499c4558819b440987afb9 RealmJS: 4c52a15602e70b64cd9230b0a17a9c12741371f4 + RevenueCat: 34f4147c8d26d2f3c691be4e3c9f033698e557f2 + RevenueCatUI: d07cd11f991f9fe72fbc64aa14257438ff1b3189 RNCAsyncStorage: c43e6d71e13bb4748503797784839e0fbbf89d56 RNDeviceInfo: bf8a32acbcb875f568217285d1793b0e8588c974 RNFastImage: 5c9c9fed9c076e521b3f509fe79e790418a544e8 @@ -1801,7 +1853,9 @@ SPEC CHECKSUMS: RNGestureHandler: 12833709769dde5fdb36ec9d4cdf4d3a1a024122 RNImageCropPicker: 771e2ca319d2cf92e04ebf334ece892ee9a6728f RNNotifee: e940770a09b9a3e7fe6c4155b7849fb00271b154 + RNPaywalls: 87b0a5aaa0ae343f7e4416c9541287ecd57adcde RNPermissions: ac5ac3a8f5f63166a4ea5473c73d7e28447e8178 + RNPurchases: a99a9d9139c977811e5db73178ea21d8c12f11ac RNReanimated: f5cb331578e0c4263050d77ba8bbec209f6b82d7 RNScreens: 99476adb9f898a77872e67836bbb9d47988788cc RNSentry: 780f6c64063f176a9f8296ef32390c3025c97e80 diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 2e5872ec13d..5ee0883a943 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -10,10 +10,13 @@ "android:google": "SENTRY_DISABLE_AUTO_UPLOAD=true ANDROID_CHANNEL=google expo run:android --variant=GoogleDebug", "ios": "SENTRY_DISABLE_AUTO_UPLOAD=true expo run:ios", "ios:device": "SENTRY_DISABLE_AUTO_UPLOAD=true expo run:ios --device", + "ios:pod-install": "cd ios && pod install && cd ..", "native-bundle": "react-native start --experimental-debugger", "clean": "yarn clean:build", - "clean:build": "rimraf ./dist && rimraf ./expo && rimraf .tamagui && rimraf ./node_modules/.cache", + "clean:build": "rimraf ./dist && rimraf ./expo && rimraf .tamagui && rimraf ./node_modules/.cache && yarn android:clean", "split-bundle": "SPLIT_BUNDLE=1 react-native start", + "android:clean": "./android/gradlew clean -p ./android", + "android:dependencies": "./android/gradlew dependencies -p ./android", "native-bundle:analyze": "react-native-bundle-visualizer", "eas-build-post-install": "echo $KEY_SECRET | base64 -d > ../../node_modules/@onekeyfe/react-native-lite-card/keys/keys.secret", "_folderslint": "yarn folderslint" @@ -27,6 +30,7 @@ "dependencies": { "@backpackapp-io/react-native-toast": "0.10.0", "@bufgix/react-native-secure-window": "0.1.1", + "@expo-google-fonts/inter": "^0.2.3", "@formatjs/intl-getcanonicallocales": "^1.9.2", "@formatjs/intl-locale": "^2.4.47", "@formatjs/intl-pluralrules": "^4.3.3", @@ -39,6 +43,8 @@ "@onekeyhq/components": "*", "@onekeyhq/kit": "*", "@onekeyhq/shared": "*", + "@privy-io/expo": "^0.35.1", + "@privy-io/expo-native-extensions": "^0.0.3", "@react-native-async-storage/async-storage": "1.22.0", "@react-native-community/netinfo": "^11.4.1", "@react-native-community/slider": "4.4.3", @@ -50,18 +56,22 @@ "@walletconnect/react-native-compat": "2.11.2", "burnt": "0.12.2", "expo": "50.0.20", + "expo-apple-authentication": "6.3.0", "expo-application": "5.8.3", "expo-barcode-scanner": "12.9.3", "expo-blur": "12.9.1", "expo-clipboard": "5.0.1", + "expo-constants": "15.4.6", + "expo-crypto": "12.8.1", "expo-device": "5.9.3", + "expo-font": "11.10.3", "expo-haptics": "12.8.1", "expo-image-manipulator": "11.5.0", "expo-image-picker": "14.5.0", "expo-intent-launcher": "^10.5.2", "expo-keep-awake": "12.8.2", "expo-linear-gradient": "12.7.1", - "expo-linking": "^5.0.2", + "expo-linking": "^6.2.2", "expo-local-authentication": "13.6.0", "expo-localization": "14.5.0", "expo-notifications": "0.27.6", @@ -69,7 +79,8 @@ "expo-secure-store": "12.5.0", "expo-sharing": "11.10.0", "expo-splash-screen": "0.26.4", - "expo-status-bar": "~1.6.0", + "expo-status-bar": "1.6.0", + "expo-web-browser": "12.8.2", "https-browserify": "^1.0.0", "jcore-react-native": "https://github.com/OneKeyHQ/jcore-react-native.git#2cadf288224242cec715a2e260f872235c58874c", "jpush-react-native": "https://github.com/OneKeyHQ/jpush-react-native.git#f10dfb5fe18fc042e6d4a82ec12f6b1d431adac7", @@ -98,7 +109,11 @@ "react-native-modal": "^13.0.1", "react-native-nested-scroll-view": "https://github.com/OneKeyHQ/react-native-nested-scroll-view.git#feat/support-rn73", "react-native-network-logger": "^1.16.1", + "react-native-passkeys": "^0.3.0", "react-native-permissions": "^4.1.5", + "react-native-purchases": "^8.5.0", + "react-native-purchases-ui": "^8.5.0", + "react-native-qrcode-styled": "^0.3.3", "react-native-randombytes": "^3.6.1", "react-native-reanimated": "3.6.1", "react-native-restart": "0.0.27", @@ -131,7 +146,8 @@ "autolinking": { "android": { "exclude": [ - "expo-camera" + "expo-camera", + "@privy-io/expo-native-extensions" ] }, "ios": { diff --git a/apps/mobile/react-native.config.js b/apps/mobile/react-native.config.js index b691d227462..0d206751090 100644 --- a/apps/mobile/react-native.config.js +++ b/apps/mobile/react-native.config.js @@ -5,6 +5,11 @@ module.exports = { platforms: { ios: null, }, - } + }, + '@privy-io/expo-native-extensions': { + platforms: { + android: null, + }, + }, }, }; diff --git a/apps/web-embed/index.js b/apps/web-embed/index.js index 9b2ba7f7a19..e39ea980ca1 100644 --- a/apps/web-embed/index.js +++ b/apps/web-embed/index.js @@ -1 +1,34 @@ -import './App'; +import '@onekeyhq/shared/src/polyfills'; +import React, { lazy, Suspense } from 'react'; +import { createRoot } from 'react-dom/client'; +import { HashRouter, Route, Routes } from 'react-router-dom'; +import { EWebEmbedRoutePath } from '@onekeyhq/shared/src/consts/webEmbedConsts'; + +const PageIndex = lazy(() => import('./pages/PageIndex')); +const PageWebEmbedApi = lazy(() => import('./pages/PageWebEmbedApi')); +const PageWebEmbedPrimePurchase = lazy(() => + import('./pages/PageWebEmbedPrimePurchase'), +); + +const container = document.getElementById('root'); +const root = createRoot(container); + +root.render( + + }> + + + } /> + } + /> + } + /> + + + + , +); diff --git a/apps/web-embed/pages/PageIndex.tsx b/apps/web-embed/pages/PageIndex.tsx new file mode 100644 index 00000000000..a1117fc59fc --- /dev/null +++ b/apps/web-embed/pages/PageIndex.tsx @@ -0,0 +1,19 @@ +import { Link } from 'react-router-dom'; + +import { EWebEmbedRoutePath } from '@onekeyhq/shared/src/consts/webEmbedConsts'; + +export default function PageIndex() { + return ( +
+

PageIndex

+
    +
  • + WebEmbedApi +
  • +
  • + PrimePurchase +
  • +
+
+ ); +} diff --git a/apps/web-embed/App.ts b/apps/web-embed/pages/PageWebEmbedApi.ts similarity index 66% rename from apps/web-embed/App.ts rename to apps/web-embed/pages/PageWebEmbedApi.ts index 30e91d80215..daf46b0c406 100644 --- a/apps/web-embed/App.ts +++ b/apps/web-embed/pages/PageWebEmbedApi.ts @@ -1,9 +1,19 @@ +import { memo, useEffect } from 'react'; + import { setBgSensitiveTextEncodeKey } from '@onekeyhq/core/src/secret'; import type { IBackgroundApiWebembedCallMessage } from '@onekeyhq/kit-bg/src/apis/IBackgroundApi'; import webembedApi from '@onekeyhq/kit-bg/src/webembeds/instance/webembedApi'; import type { IJsBridgeMessagePayload } from '@onekeyfe/cross-inpage-provider-types'; +// create button which can refresh, append to body +const refreshButton = document.createElement('button'); +refreshButton.textContent = 'Refresh'; +refreshButton.addEventListener('click', () => { + globalThis.location.reload(); +}); +document.body.appendChild(refreshButton); + function printMessageToBody(message: string) { const p = document.createElement('p'); p.textContent = `${new Date().toTimeString().slice(0, 8)} ${message}`; @@ -40,7 +50,19 @@ const init = (times = 0) => { }); }; -init(); +let isInitExecuted = false; +const PageWebEmbedApi = memo(() => { + useEffect(() => { + if (isInitExecuted) { + return; + } + isInitExecuted = true; + init(); + printMessageToBody('web-embed init...'); + printMessageToBody(`${globalThis.location.href}`); + }, []); + return null; +}); +PageWebEmbedApi.displayName = 'PageWebEmbedApi'; -printMessageToBody('web-embed init...'); -printMessageToBody(`${globalThis.location.href}`); +export default PageWebEmbedApi; diff --git a/apps/web-embed/pages/PageWebEmbedPrimePurchase.tsx b/apps/web-embed/pages/PageWebEmbedPrimePurchase.tsx new file mode 100644 index 00000000000..698b185f909 --- /dev/null +++ b/apps/web-embed/pages/PageWebEmbedPrimePurchase.tsx @@ -0,0 +1,184 @@ +/* eslint-disable unicorn/prefer-global-this */ +import { useEffect, useState } from 'react'; + +import { useSearchParams } from 'react-router-dom'; + +import purchasesSdk from '@onekeyhq/kit/src/views/Prime/purchasesSdk/purchasesSdk'; + +import webEmbedAppSettings from '../utils/webEmbedAppSettings'; + +import type { Package } from '@revenuecat/purchases-js'; + +function PrimeSubscriptionPlansWeb({ + packages, + onPackageSelected, +}: { + packages: Package[]; + onPackageSelected: (packageId: string) => void; +}) { + const [selectedPackageId, setSelectedPackageId] = useState< + string | undefined + >(packages?.[0]?.identifier); + + useEffect(() => { + if (selectedPackageId) { + onPackageSelected(selectedPackageId); + } + }, [onPackageSelected, selectedPackageId]); + + const containerStyle = { + display: 'flex', + flexDirection: 'column' as any, + gap: '10px', + }; + + const itemStyle = (selected: boolean) => ({ + display: 'flex', + alignItems: 'baseline', + padding: '20px', + backgroundColor: '#ffffff', + border: `2px solid ${selected ? '#0066ff' : '#e5e7eb'}`, + borderRadius: '12px', + cursor: 'pointer', + position: 'relative' as any, + userSelect: 'none' as const, + }); + + const titleStyle = { + fontSize: '24px', + marginRight: '8px', + }; + + const priceStyle = { + fontSize: '24px', + flex: 1, + }; + + const pricePerMonthStyle = { + fontSize: '14px', + color: '#6b7280', + marginLeft: '8px', + }; + + const badgeStyle = { + position: 'absolute' as any, + top: '-11px', + right: '16px', + backgroundColor: '#000000', + color: '#ffffff', + padding: '2px 8px', + borderRadius: '4px', + fontSize: '12px', + }; + + return ( +
+ {packages?.map((p) => { + const selected = selectedPackageId === p.identifier; + const price = p.rcBillingProduct.currentPrice.amountMicros / 1_000_000; + const periodDuration = p.rcBillingProduct?.normalPeriodDuration; + const pricePerMonth = periodDuration === 'P1Y' ? price / 12 : price; + const showSaveBadge = periodDuration === 'P1Y'; + + return ( +
setSelectedPackageId(p.identifier)} + onKeyDown={(e) => { + if (e.key === 'Enter' || e.key === ' ') { + setSelectedPackageId(p.identifier); + } + }} + role="button" + tabIndex={0} + aria-pressed={selected} + > + {showSaveBadge ?
Save 33%
: null} +
+ {p.rcBillingProduct.title} ({periodDuration}) +
+
${price.toFixed(2)}
+
+ ${pricePerMonth.toFixed(2)}/month +
+
+ ); + })} +
+ ); +} + +export default function PageWebEmbedPrimePurchase() { + const [packages, setPackages] = useState([]); + const [selectedPackageId, setSelectedPackageId] = useState( + null, + ); + + const [searchParams] = useSearchParams(); + const primeUserId = searchParams.get('primeUserId') || ''; + const primeUserEmail = searchParams.get('primeUserEmail') || ''; + + const settings = webEmbedAppSettings.getSettings(); + return ( +
+ + + + + +
+ {JSON.stringify({ + settings, + primeUserId, + primeUserEmail, + revenuecatApiKeySandbox: process.env.REVENUECAT_API_KEY_WEB_SANDBOX, + revenuecatApiKey: process.env.REVENUECAT_API_KEY_WEB, + })} +
+
{window.location.href}
+
+ ); +} diff --git a/apps/web-embed/pages/WebEmbedAppProvider.tsx b/apps/web-embed/pages/WebEmbedAppProvider.tsx new file mode 100644 index 00000000000..4895b329e56 --- /dev/null +++ b/apps/web-embed/pages/WebEmbedAppProvider.tsx @@ -0,0 +1,21 @@ +import { ConfigProvider } from '@onekeyhq/components'; + +import webEmbedAppSettings from '../utils/webEmbedAppSettings'; + +export default function WebEmbedAppProvider({ + children, +}: { + children: React.ReactNode; +}) { + const settings = webEmbedAppSettings.getSettings(); + + // TODO Toast support + return ( + + {children} + + ); +} diff --git a/apps/web-embed/utils/webEmbedAppSettings.ts b/apps/web-embed/utils/webEmbedAppSettings.ts new file mode 100644 index 00000000000..7ebbb9743a5 --- /dev/null +++ b/apps/web-embed/utils/webEmbedAppSettings.ts @@ -0,0 +1,14 @@ +export type IWebEmbedOnekeyAppSettings = { + themeVariant: string; + localeVariant: string; + revenuecatApiKey: string; +}; + +function getSettings(): IWebEmbedOnekeyAppSettings | undefined { + const settings = globalThis.WEB_EMBED_ONEKEY_APP_SETTINGS; + return settings; +} + +export default { + getSettings, +}; diff --git a/apps/web-embed/webpack.config.js b/apps/web-embed/webpack.config.js index 6b95f569ebf..1315160b996 100644 --- a/apps/web-embed/webpack.config.js +++ b/apps/web-embed/webpack.config.js @@ -1,3 +1,10 @@ +require('../../development/env'); + const webConfig = require('../../development/webpack/webpack.web-embed.config'); +console.log( + 'process.env.REVENUECAT_API_KEY_WEB_SANDBOX', + process.env.REVENUECAT_API_KEY_WEB_SANDBOX, +); + module.exports = webConfig({ basePath: __dirname }); diff --git a/apps/web/index.js b/apps/web/index.js index b25a1c442cf..8ce5e1165ae 100644 --- a/apps/web/index.js +++ b/apps/web/index.js @@ -15,10 +15,11 @@ import { initSentry, withSentryHOC, } from '@onekeyhq/shared/src/modules3rdParty/sentry'; +import { SentryErrorBoundaryFallback } from '@onekeyhq/kit/src/components/ErrorBoundary'; initSentry(); // registerRootComponent calls AppRegistry.registerComponent('main', () => App); // It also ensures that whether you load the app in Expo Go or in a native build, // the environment is set up appropriately -registerRootComponent(withSentryHOC(App)); +registerRootComponent(withSentryHOC(App, SentryErrorBoundaryFallback)); diff --git a/apps/web/webpack.config.js b/apps/web/webpack.config.js index 044576e6e8a..37b0d943910 100644 --- a/apps/web/webpack.config.js +++ b/apps/web/webpack.config.js @@ -1,3 +1,5 @@ +require('../../development/env'); + const webConfig = require('../../development/webpack/webpack.web.config'); module.exports = webConfig({ basePath: __dirname }); diff --git a/development/env.js b/development/env.js index e632157053a..7d7c5a1616d 100644 --- a/development/env.js +++ b/development/env.js @@ -4,17 +4,18 @@ const dateFns = require('date-fns'); const results = [ dotenv.config({ - path: path.resolve(__dirname, '../.env'), - }), - dotenv.config({ - path: path.resolve(__dirname, '../.env.version'), - }), - dotenv.config({ - path: path.resolve(__dirname, '../.env.expo'), + path: [ + // priority: high -> low + path.resolve(__dirname, '../.env.version'), + path.resolve(__dirname, '../.env.expo'), + path.resolve(__dirname, '../.env'), + ], }), ]; if (process.env.NODE_ENV !== 'production') { + // console.log('process.env', process.env); + process.env.BUILD_NUMBER = process.env.BUILD_NUMBER || `${dateFns.format(Date.now(), 'MMddHHmm')}-dev`; } diff --git a/development/envExposedToClient.js b/development/envExposedToClient.js index 89344eea3bc..b1fd6f2f91f 100644 --- a/development/envExposedToClient.js +++ b/development/envExposedToClient.js @@ -21,7 +21,14 @@ function buildEnvExposedToClientDangerously({ platform }) { 'GITHUB_SHA', 'STORYBOOK_ENABLED', 'WALLETCONNECT_PROJECT_ID', + 'PRIVY_APP_ID', + 'PRIVY_MOBILE_CLIENT_ID', + 'REVENUECAT_API_KEY_WEB', + 'REVENUECAT_API_KEY_WEB_SANDBOX', + 'REVENUECAT_API_KEY_APPLE', + 'REVENUECAT_API_KEY_GOOGLE', ]; + // *** also update Inject Environment Variables at release-ios.yml, release-android *** if (platform === developmentConsts.platforms.app) { transformInlineEnvironmentVariables.push('JPUSH_KEY'); diff --git a/development/lint/eslint-rule-force-async-bg-api.js b/development/lint/eslint-rule-force-async-bg-api.js new file mode 100644 index 00000000000..56e643dcd99 --- /dev/null +++ b/development/lint/eslint-rule-force-async-bg-api.js @@ -0,0 +1,64 @@ +module.exports = { + rules: { + 'force-async-bg-api': { + meta: { + type: 'problem', // 规则类型:problem, suggestion, layout + docs: { + description: + 'Ensure that methods annotated with @backgroundMethod() are async', + category: 'Best Practices', + recommended: false, + }, + schema: [], // 规则的配置选项 + messages: { + asyncRequired: + 'Methods annotated with @backgroundMethod() must be declared as async.', + }, + }, + create(context) { + return { + // 监听函数声明 + FunctionDeclaration(node) { + // 检查函数是否使用了 @backgroundMethod() 装饰器 + const hasBackgroundMethod = + node.decorators && + node.decorators.some( + (decorator) => + decorator.expression.type === 'CallExpression' && + decorator.expression.callee.name === 'backgroundMethod', + ); + + // 如果使用了 @backgroundMethod() 装饰器,但函数不是 async 的,则报告错误 + if (hasBackgroundMethod && node.async !== true) { + context.report({ + node, + messageId: 'asyncRequired', + }); + } + }, + + // 监听箭头函数表达式 + ArrowFunctionExpression(node) { + // 检查箭头函数是否使用了 @backgroundMethod() 装饰器 + const hasBackgroundMethod = + node.parent.type === 'MethodDefinition' && + node.parent.decorators && + node.parent.decorators.some( + (decorator) => + decorator.expression.type === 'CallExpression' && + decorator.expression.callee.name === 'backgroundMethod', + ); + + // 如果使用了 @backgroundMethod() 装饰器,但函数不是 async 的,则报告错误 + if (hasBackgroundMethod && node.async !== true) { + context.report({ + node: node.parent, + messageId: 'asyncRequired', + }); + } + }, + }; + }, + }, + }, +}; diff --git a/development/scripts/web-embed.js b/development/scripts/web-embed.js index 8e72d7c099b..63889d80361 100644 --- a/development/scripts/web-embed.js +++ b/development/scripts/web-embed.js @@ -4,6 +4,8 @@ const path = require('path'); const fs = require('fs'); const { exit } = require('process'); +require('../env'); + const BASEDIR = path.dirname(__filename); const webBuildPath = path.resolve(BASEDIR, '../../apps/web-embed/web-build'); @@ -25,6 +27,10 @@ if (process.env.GITHUB_SHA) { // Local development if (!fs.existsSync(webBuildPath)) { console.log('build web-embed on local development'); + console.log( + 'process.env.REVENUECAT_API_KEY_WEB_SANDBOX', + process.env.REVENUECAT_API_KEY_WEB_SANDBOX, + ); require('child_process').execSync('yarn app:web-embed:build', { stdio: 'inherit', }); diff --git a/development/spellCheckerSkipWords.js b/development/spellCheckerSkipWords.js index bd771615f9c..f5c81318ddd 100644 --- a/development/spellCheckerSkipWords.js +++ b/development/spellCheckerSkipWords.js @@ -18,14 +18,24 @@ module.exports = [ 'Boardloader', 'fs', 'hdk', + 'Captcha', + 'Resending', + 'yml', + 'captcha', 'dkey', 'impls', + 'Revenuecat', 'ttl', + 'facebook', + 'privy', + 'google', 'Sollet', 'Solflare', 'encryptors', 'txids', '_j_msgid', + 'Reachability', + 'Mastercard', 'ord', 'exe', 'Merkle', diff --git a/development/webpack/utils.js b/development/webpack/utils.js index 9f9983f23a0..4b8f0954c9d 100644 --- a/development/webpack/utils.js +++ b/development/webpack/utils.js @@ -3,6 +3,7 @@ const { developmentConsts } = require('../babelTools'); const { EXT_CHANNEL, TARGET_BROWSER } = require('./constant'); exports.createResolveExtensions = function ({ platform, configName }) { + console.log('createResolveExtensions>>>>>>', platform, configName); return uniq([ // .chrome-ext.ts, .firefox-ext.ts ...(EXT_CHANNEL && TARGET_BROWSER diff --git a/development/webpack/webpack.analyzer.config.js b/development/webpack/webpack.analyzer.config.js index 6cf1b732fd4..49dabb01396 100644 --- a/development/webpack/webpack.analyzer.config.js +++ b/development/webpack/webpack.analyzer.config.js @@ -1,7 +1,12 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); -const { ENABLE_ANALYZER_HTML_REPORT, ANALYSE_MODULE } = require('./constant'); +const { + ENABLE_ANALYZER_HTML_REPORT, + ENABLE_ANALYZER, + ANALYSE_MODULE, +} = require('./constant'); console.log('ENABLE_ANALYZER_HTML_REPORT >>>>>> ', ENABLE_ANALYZER_HTML_REPORT); +console.log('ENABLE_ANALYZER >>>>>> ', ENABLE_ANALYZER); module.exports = ({ configName }) => ({ plugins: [ new BundleAnalyzerPlugin( diff --git a/development/webpack/webpack.base.config.js b/development/webpack/webpack.base.config.js index 281b41b46d6..187c8814605 100644 --- a/development/webpack/webpack.base.config.js +++ b/development/webpack/webpack.base.config.js @@ -102,273 +102,256 @@ const basePerformance = { maxEntrypointSize: 600_000, }; -module.exports = ({ platform, basePath, configName }) => ({ - entry: path.join(basePath, 'index.js'), - context: path.resolve(basePath), - bail: false, - target: ['web'], - watchOptions: { - aggregateTimeout: 5, - ignored: [ - '**/.git/**', - '**/node_modules/**', - '**/.expo/**', - '**/.expo-shared/**', - '**/web-build/**', - '**/.#*', - ], - }, - stats: 'errors-warnings', - infrastructureLogging: { 'debug': false, 'level': 'none' }, - output: { - publicPath: PUBLIC_URL || '/', - path: path.join(basePath, 'web-build'), - assetModuleFilename: isDev - ? 'static/media/[name].[ext]' - : 'static/media/[name].[hash][ext]', - uniqueName: 'web', - filename: isDev ? '[name].bundle.js' : '[name].[chunkhash:10].bundle.js', - chunkFilename: isDev - ? 'static/js/[name].chunk.js' - : 'static/js/[name].[chunkhash:10].chunk.js', - }, - plugins: [ - new HtmlWebpackPlugin({ - title: platform, - minify: !isDev, - inject: true, - filename: path.join(basePath, 'web-build/index.html'), - template: `!!ejs-loader?esModule=false!${path.join( - __dirname, - '../../packages/shared/src/web/index.html', - )}`, - favicon: path.join( - basePath, - 'public/static/images/icons/favicon/favicon.png', - ), - templateParameters: { - filename: '', - browser: '', - platform, - isDev, - htmlHeadPreloadCode: fs.readFileSync( - path.resolve(basePath, '../ext/src/assets/preload-html-head.js'), - { - encoding: 'utf-8', - }, +module.exports = ({ platform, basePath, configName }) => { + const babelLoaderOption = { + babelrc: false, + configFile: true, + sourceType: 'unambiguous', + root: basePath, + compact: !isDev, + sourceMaps: isDev, + inputSourceMap: isDev, + cacheCompression: false, + cacheDirectory: path.resolve(basePath, 'node_modules/.cache/babel-loader'), + }; + const useBabelLoader = { + loader: 'babel-loader', + options: babelLoaderOption, + }; + return { + entry: path.join(basePath, 'index.js'), + context: path.resolve(basePath), + bail: false, + target: ['web'], + watchOptions: { + aggregateTimeout: 5, + ignored: [ + '**/.git/**', + '**/node_modules/**', + '**/.expo/**', + '**/.expo-shared/**', + '**/web-build/**', + '**/.#*', + ], + }, + stats: 'errors-warnings', + infrastructureLogging: { 'debug': false, 'level': 'none' }, + output: { + publicPath: PUBLIC_URL || '/', + path: path.join(basePath, 'web-build'), + assetModuleFilename: isDev + ? 'static/media/[name].[ext]' + : 'static/media/[name].[hash][ext]', + uniqueName: 'web', + filename: isDev ? '[name].bundle.js' : '[name].[chunkhash:10].bundle.js', + chunkFilename: isDev + ? 'static/js/[name].chunk.js' + : 'static/js/[name].[chunkhash:10].chunk.js', + }, + plugins: [ + new HtmlWebpackPlugin({ + title: platform, + minify: !isDev, + inject: true, + filename: path.join(basePath, 'web-build/index.html'), + template: `!!ejs-loader?esModule=false!${path.join( + __dirname, + '../../packages/shared/src/web/index.html', + )}`, + favicon: path.join( + basePath, + 'public/static/images/icons/favicon/favicon.png', ), - WEB_PUBLIC_URL: PUBLIC_URL || '/', - WEB_TITLE: platform, - LANG_ISO_CODE: 'en', - NO_SCRIPT: - '

Oh no! It looks like JavaScript is not enabled in your browser.

', - ROOT_ID: 'root', - }, - }), - // Generate an asset manifest file with the following content: - // - "files" key: Mapping of all asset filenames to their corresponding - // output file so that tools can pick it up without having to parse - // `index.html` - // - "entrypoints" key: Array of files which are included in `index.html`, - // can be used to reconstruct the HTML if necessary - new webpackManifestPlugin.WebpackManifestPlugin({ - fileName: 'asset-manifest.json', - publicPath: './', - filter: ({ path }) => { - if ( - path.match( - /(apple-touch-startup-image|apple-touch-icon|chrome-icon|precache-manifest)/, - ) - ) { - return false; - } - // Remove compressed versions and service workers - return !(path.endsWith('.gz') || path.endsWith('worker.js')); - }, - generate: (seed, files, entrypoints) => { - const manifestFiles = files.reduce((manifest, file) => { - if (file.name) { - manifest[file.name] = file.path; + templateParameters: { + filename: '', + browser: '', + platform, + isDev, + htmlHeadPreloadCode: fs.readFileSync( + path.resolve(basePath, '../ext/src/assets/preload-html-head.js'), + { + encoding: 'utf-8', + }, + ), + WEB_PUBLIC_URL: PUBLIC_URL || '/', + WEB_TITLE: platform, + LANG_ISO_CODE: 'en', + NO_SCRIPT: + '

Oh no! It looks like JavaScript is not enabled in your browser.

', + ROOT_ID: 'root', + }, + }), + // Generate an asset manifest file with the following content: + // - "files" key: Mapping of all asset filenames to their corresponding + // output file so that tools can pick it up without having to parse + // `index.html` + // - "entrypoints" key: Array of files which are included in `index.html`, + // can be used to reconstruct the HTML if necessary + new webpackManifestPlugin.WebpackManifestPlugin({ + fileName: 'asset-manifest.json', + publicPath: './', + filter: ({ path }) => { + if ( + path.match( + /(apple-touch-startup-image|apple-touch-icon|chrome-icon|precache-manifest)/, + ) + ) { + return false; } - return manifest; - }, seed); - const entrypointFiles = entrypoints.main.filter( - (fileName) => !fileName.endsWith('.map'), - ); - return { - files: manifestFiles, - entrypoints: entrypointFiles, - }; - }, - }), - ...basePlugins, - ], - module: { - strictExportPresence: false, - rules: [ - { - exclude: [/@babel(?:\/|\\{1,2})runtime/], - test: /\.(js|mjs|jsx|ts|tsx|css)$/, - resolve: { - fullySpecified: false, + // Remove compressed versions and service workers + return !(path.endsWith('.gz') || path.endsWith('worker.js')); }, - }, - { - 'oneOf': [ - { - test: /\.wasm$/, - type: 'webassembly/async', + generate: (seed, files, entrypoints) => { + const manifestFiles = files.reduce((manifest, file) => { + if (file.name) { + manifest[file.name] = file.path; + } + return manifest; + }, seed); + const entrypointFiles = entrypoints.main.filter( + (fileName) => !fileName.endsWith('.map'), + ); + return { + files: manifestFiles, + entrypoints: entrypointFiles, + }; + }, + }), + ...basePlugins, + ], + module: { + strictExportPresence: false, + rules: [ + { + exclude: [/@babel(?:\/|\\{1,2})runtime/], + test: /\.(js|mjs|jsx|ts|tsx|css)$/, + resolve: { + fullySpecified: false, }, - { - test: [/\.avif$/], - type: 'asset', - mimetype: 'image/avif', - parser: { - dataUrlCondition: { - maxSize: 1000, - }, + }, + { + 'oneOf': [ + { + test: /\.wasm$/, + type: 'webassembly/async', }, - }, - { - test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.svg$/], - type: 'asset', - parser: { dataUrlCondition: { maxSize: 1000 } }, - }, - - { - test: /\.(js|mjs|jsx|ts|tsx)$/, - exclude: [/node_modules/], - use: [ - { - loader: 'babel-loader', - options: { - babelrc: false, - configFile: true, - sourceType: 'unambiguous', - root: basePath, - compact: !isDev, - sourceMaps: isDev, - inputSourceMap: isDev, - cacheCompression: false, - cacheDirectory: path.resolve( - basePath, - 'node_modules/.cache/babel-loader', - ), + { + test: [/\.avif$/], + type: 'asset', + mimetype: 'image/avif', + parser: { + dataUrlCondition: { + maxSize: 1000, }, }, - { - loader: 'tamagui-loader', - options: { - config: path.join( - basePath, - '../../packages/components/tamagui.config.ts', - ), - components: ['tamagui'], - importsWhitelist: [], - logTimings: false, - disableExtraction: isDev, + }, + { + test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.svg$/], + type: 'asset', + parser: { dataUrlCondition: { maxSize: 1000 } }, + }, + + { + test: /\.(js|mjs|jsx|ts|tsx)$/, + exclude: [/node_modules/], + use: [ + useBabelLoader, + { + loader: 'tamagui-loader', + options: { + config: path.join( + basePath, + '../../packages/components/tamagui.config.ts', + ), + components: ['tamagui'], + importsWhitelist: [], + logTimings: false, + disableExtraction: isDev, + }, }, - }, - ], - resolve: { fullySpecified: false }, - }, - { - test: /(@?react-(navigation|native)).*\.(ts|js)x?$/, - exclude: [/react-native-logs/, /react-native-modalize/], - use: { - loader: 'babel-loader', - options: { - babelrc: false, - configFile: true, - sourceType: 'unambiguous', - root: basePath, - compact: !isDev, - sourceMaps: isDev, - inputSourceMap: isDev, - cacheCompression: false, - cacheDirectory: path.resolve( - basePath, - 'node_modules/.cache/babel-loader', - ), - }, + ], + resolve: { fullySpecified: false }, }, - resolve: { fullySpecified: false }, - }, - { - test: /(@?expo-*).*\.(ts|js)x?$/, - exclude: [/react-native-logs/, /react-native-modalize/], - use: { - loader: 'babel-loader', - options: { - babelrc: false, - configFile: true, - sourceType: 'unambiguous', - root: basePath, - compact: !isDev, - sourceMaps: isDev, - inputSourceMap: isDev, - cacheCompression: false, - cacheDirectory: path.resolve( - basePath, - 'node_modules/.cache/babel-loader', - ), - }, + { + test: /(@?react-(navigation|native)).*\.(ts|js)x?$/, + exclude: [/react-native-logs/, /react-native-modalize/], + use: useBabelLoader, + resolve: { fullySpecified: false }, }, - resolve: { fullySpecified: false }, - }, - { - test: /\.(css)$/, - use: [ - 'style-loader', - { - loader: 'css-loader', - options: { - importLoaders: 1, - sourceMap: true, - modules: { mode: 'global' }, + { + test: [ + // expo + /(@?expo-*).*\.(c|m)?(ts|js)x?$/, + // set-interval-async (webembed android webview required) + /(@?set-interval-async).*\.(c|m)?(ts|js)x?$/, + // // tamagui (webembed android webview required) + // /(@?tamagui*).*\.(c|m)?(ts|js)x?$/, + // // keystonehq + // /(@?keystonehq).*\.(c|m)?(ts|js)x?$/, + ], + exclude: [/react-native-logs/, /react-native-modalize/], + use: useBabelLoader, + resolve: { fullySpecified: false }, + }, + { + test: /lru-cache.*\.(ts|js)x?$/, + use: useBabelLoader, + resolve: { fullySpecified: false }, + }, + { + test: /\.(css)$/, + use: [ + 'style-loader', + { + loader: 'css-loader', + options: { + importLoaders: 1, + sourceMap: true, + modules: { mode: 'global' }, + }, }, - }, - ].filter(Boolean), - 'sideEffects': true, - }, - { - exclude: [/^$/, /\.(js|mjs|cjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/], - type: 'asset/resource', - }, - ], - }, - { - test: /@polkadot/, - // test: /[\s\S]*node_modules[/\\]@polkadot[\s\S]*.c?js$/, - loader: require.resolve('@open-wc/webpack-import-meta-loader'), - }, - { - test: /\.mjs$/, - include: /node_modules/, - type: 'javascript/auto', - }, - { - test: /\.ejs$/i, - use: ['html-loader', 'template-ejs-loader'], - }, - { - test: /\.worker\.(js|ts)$/, - use: { - loader: 'worker-loader', - options: { - inline: 'fallback', + ].filter(Boolean), + 'sideEffects': true, + }, + { + exclude: [ + /^$/, + /\.(js|mjs|cjs|jsx|ts|tsx)$/, + /\.html$/, + /\.json$/, + ], + type: 'asset/resource', + }, + ], + }, + { + test: /@polkadot/, + loader: require.resolve('@open-wc/webpack-import-meta-loader'), + }, + { + test: /\.mjs$/, + include: /node_modules/, + type: 'javascript/auto', + }, + { + test: /\.ejs$/i, + use: ['html-loader', 'template-ejs-loader'], + }, + { + test: /\.worker\.(js|ts)$/, + use: { + loader: 'worker-loader', + options: { + inline: 'fallback', + }, }, }, - }, - ], - }, - resolve: baseResolve({ platform, configName }), - experiments: baseExperiments, - performance: basePerformance, -}); + ], + }, + resolve: baseResolve({ platform, configName }), + experiments: baseExperiments, + performance: basePerformance, + }; +}; module.exports.basePlugins = basePlugins; -module.exports.baseResolve = baseResolve; -module.exports.basePlugins = basePlugins; -module.exports.baseExperiments = baseExperiments; -module.exports.basePerformance = basePerformance; diff --git a/development/webpack/webpack.desktop.config.js b/development/webpack/webpack.desktop.config.js index 97c47be22eb..e940c8c11a9 100644 --- a/development/webpack/webpack.desktop.config.js +++ b/development/webpack/webpack.desktop.config.js @@ -2,20 +2,25 @@ const { merge, mergeWithRules, CustomizeRule } = require('webpack-merge'); const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity'); const baseConfig = require('./webpack.base.config'); +const analyzerConfig = require('./webpack.analyzer.config'); const developmentConfig = require('./webpack.development.config'); const productionConfig = require('./webpack.prod.config'); -const { NODE_ENV } = require('./constant'); +const { NODE_ENV, ENABLE_ANALYZER } = require('./constant'); const babelTools = require('../babelTools'); module.exports = ({ basePath, platform = babelTools.developmentConsts.platforms.desktop, }) => { + const configs = ENABLE_ANALYZER + ? [analyzerConfig({ configName: platform })] + : []; switch (NODE_ENV) { case 'production': { return merge( baseConfig({ platform, basePath }), productionConfig({ platform, basePath }), + ...configs, { output: { crossOriginLoading: 'anonymous', @@ -29,6 +34,7 @@ module.exports = ({ return merge( baseConfig({ platform, basePath }), developmentConfig({ platform, basePath }), + ...configs, { devServer: { open: false, diff --git a/development/webpack/webpack.ext.config.js b/development/webpack/webpack.ext.config.js index b2f280c86af..0e60cc024ee 100644 --- a/development/webpack/webpack.ext.config.js +++ b/development/webpack/webpack.ext.config.js @@ -63,7 +63,10 @@ module.exports = ({ }); const extConfigs = ({ name }) => ENABLE_ANALYZER - ? [extConfig({ name }), analyzerConfig({ configName: platform })] + ? [ + extConfig({ name }), + analyzerConfig({ configName: [platform, name].join('-') }), + ] : [extConfig({ name })]; const multipleEntryConfigs = [ diff --git a/development/webpack/webpack.web-embed.config.js b/development/webpack/webpack.web-embed.config.js index 1296fc368cd..2057e76b011 100644 --- a/development/webpack/webpack.web-embed.config.js +++ b/development/webpack/webpack.web-embed.config.js @@ -5,177 +5,8 @@ const path = require('path'); const developmentConfig = require('./webpack.development.config'); const productionConfig = require('./webpack.prod.config'); const babelTools = require('../babelTools'); -const { isDev, PUBLIC_URL, NODE_ENV } = require('./constant'); -const BaseConfig = require('./webpack.base.config'); - -const baseConfig = ({ platform, basePath, configName }) => { - const baseLoaderOption = { - babelrc: false, - configFile: true, - sourceType: 'unambiguous', - root: basePath, - compact: !isDev, - sourceMaps: isDev, - inputSourceMap: isDev, - cacheCompression: false, - cacheDirectory: path.resolve(basePath, 'node_modules/.cache/babel-loader'), - }; - return { - entry: path.join(basePath, 'index.js'), - context: path.resolve(basePath), - bail: false, - target: ['web'], - watchOptions: { - aggregateTimeout: 5, - ignored: [ - '**/.git/**', - '**/node_modules/**', - '**/.expo/**', - '**/.expo-shared/**', - '**/web-build/**', - '**/.#*', - ], - }, - stats: 'errors-warnings', - infrastructureLogging: { 'debug': false, 'level': 'none' }, - output: { - publicPath: PUBLIC_URL || '/', - path: path.join(basePath, 'web-build'), - assetModuleFilename: isDev - ? 'static/media/[name].[ext]' - : 'static/media/[name].[hash][ext]', - uniqueName: 'web', - filename: isDev ? '[name].bundle.js' : '[name].[chunkhash:10].bundle.js', - chunkFilename: isDev - ? 'static/js/[name].chunk.js' - : 'static/js/[name].[chunkhash:10].chunk.js', - }, - plugins: [ - new HtmlWebpackPlugin({ - title: platform, - minify: !isDev, - inject: true, - filename: path.join(basePath, 'web-build/index.html'), - template: `!!ejs-loader?esModule=false!${path.join( - __dirname, - '../../packages/shared/src/web/index.html', - )}`, - favicon: path.join( - basePath, - 'public/static/images/icons/favicon/favicon.png', - ), - templateParameters: { - filename: '', - browser: '', - platform, - isDev, - htmlHeadPreloadCode: '', - WEB_PUBLIC_URL: PUBLIC_URL || '/', - WEB_TITLE: platform, - LANG_ISO_CODE: 'en', - NO_SCRIPT: '', - ROOT_ID: 'root', - }, - }), - ...BaseConfig.basePlugins, - ], - module: { - strictExportPresence: false, - rules: [ - { - exclude: [/@babel(?:\/|\\{1,2})runtime/], - test: /\.(js|mjs|jsx|ts|tsx|css)$/, - resolve: { - fullySpecified: false, - }, - }, - { - 'oneOf': [ - { - test: /\.wasm$/, - type: 'webassembly/async', - }, - { - test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.svg$/], - type: 'asset', - parser: { dataUrlCondition: { maxSize: 1000 } }, - }, - { - test: /\.(js|mjs|ts)$/, - exclude: [/node_modules/], - use: [ - { - loader: 'babel-loader', - options: baseLoaderOption, - }, - ], - resolve: { fullySpecified: false }, - }, - { - test: /lru-cache.*\.(ts|js)x?$/, - use: { - loader: 'babel-loader', - options: baseLoaderOption, - }, - resolve: { fullySpecified: false }, - }, - { - test: /(@?react-(navigation|native)).*\.(ts|js)x?$/, - use: { - loader: 'babel-loader', - options: baseLoaderOption, - }, - resolve: { fullySpecified: false }, - }, - { - test: /(@?expo).*\.(ts|js)x?$/, - use: { - loader: 'babel-loader', - options: baseLoaderOption, - }, - resolve: { fullySpecified: false }, - }, - { - exclude: [ - /^$/, - /\.(js|mjs|cjs|jsx|ts|tsx)$/, - /\.html$/, - /\.json$/, - ], - type: 'asset/resource', - }, - ], - }, - { - test: /@polkadot/, - // test: /[\s\S]*node_modules[/\\]@polkadot[\s\S]*.c?js$/, - loader: require.resolve('@open-wc/webpack-import-meta-loader'), - }, - { - test: /\.mjs$/, - include: /node_modules/, - type: 'javascript/auto', - }, - { - test: /\.ejs$/i, - use: ['html-loader', 'template-ejs-loader'], - }, - { - test: /\.worker\.(js|ts)$/, - use: { - loader: 'worker-loader', - options: { - inline: 'fallback', - }, - }, - }, - ], - }, - resolve: BaseConfig.baseResolve({ platform, configName }), - experiments: BaseConfig.baseExperiments, - performance: BaseConfig.basePerformance, - }; -}; +const { WEB_PORT, PUBLIC_URL, NODE_ENV } = require('./constant'); +const baseConfig = require('./webpack.base.config'); module.exports = ({ basePath, @@ -191,7 +22,7 @@ module.exports = ({ splitChunks: false, }, output: { - publicPath: './', + publicPath: PUBLIC_URL || './', path: path.join(basePath, 'web-build'), assetModuleFilename: 'static/media/web-embed.[name].[contenthash][ext]', diff --git a/package.json b/package.json index 35571dc449e..c734c8acd20 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "app:desktop": "yarn workspace @onekeyhq/desktop start", "app:desktop:web": "yarn workspace @onekeyhq/desktop dev:renderer", "app:desktop:electron": "yarn workspace @onekeyhq/desktop build:main:dev && yarn workspace @onekeyhq/desktop dev:main", + "app:desktop:build": "yarn workspace @onekeyhq/desktop build", "app:ext": "yarn workspace @onekeyhq/ext start:v3", "app:ext:proxy": "yarn workspace @onekeyhq/ext start:v3:proxy", "app:ext:build": "yarn workspace @onekeyhq/ext build:v3", @@ -73,6 +74,8 @@ "@polkadot/extension-inject": "0.46.6", "@polkadot/types": "11.3.1", "@polkadot/util-crypto": "12.6.2", + "@privy-io/react-auth": "1.98.4", + "@revenuecat/purchases-js": "^0.15.1", "@sentry/browser": "8.42.0", "@sentry/core": "8.42.0", "@sentry/react": "8.42.0", @@ -126,6 +129,7 @@ "react-native-reanimated": "3.6.1", "react-native-web": "0.18.12", "react-render-tracker": "^0.7.6", + "react-router-dom": "^7.1.1", "rlp": "^3.0.0", "set-interval-async": "^3.0.3", "socket.io-client": "^4.7.5", @@ -136,6 +140,7 @@ "timeout-signal": "^2.0.0", "tonweb": "^0.0.66", "use-suspender": "^2.0.0-beta.0", + "validator": "^13.12.0", "viem": "^2.9.2" }, "devDependencies": { @@ -166,6 +171,7 @@ "@types/react": "^18.2.29", "@types/react-beautiful-dnd": "13.1.8", "@types/react-dom": "~18.3.0", + "@types/validator": "^13", "@types/web": "0.0.151", "@typescript-eslint/eslint-plugin": "^5.46.1", "@typescript-eslint/parser": "^5.46.1", @@ -243,6 +249,8 @@ "@babel/highlight": "7.23.4", "@babel/types": "7.23.5", "@babel/parser": "7.23.5", + "protobufjs": "6.11.2", + "@metamask/eth-sig-util": "5.1.0", "@polkadot/util": "12.6.2", "@polkadot/util-crypto": "12.6.2", "electron": "27.3.1", diff --git a/packages/components/src/composite/Dialog/index.tsx b/packages/components/src/composite/Dialog/index.tsx index a5ba3e76445..a7ea4a05b84 100644 --- a/packages/components/src/composite/Dialog/index.tsx +++ b/packages/components/src/composite/Dialog/index.tsx @@ -13,18 +13,27 @@ import { useState, } from 'react'; +import { setStringAsync } from 'expo-clipboard'; import { isNil } from 'lodash'; import { useIntl } from 'react-intl'; -import { AnimatePresence, Sheet, Dialog as TMDialog, useMedia } from 'tamagui'; +import { + AnimatePresence, + Sheet, + SizableText, + Dialog as TMDialog, + useMedia, +} from 'tamagui'; import { dismissKeyboard } from '@onekeyhq/shared/src/keyboard'; import { ETranslations } from '@onekeyhq/shared/src/locale'; import platformEnv from '@onekeyhq/shared/src/platformEnv'; +import { Toast } from '../../actions/Toast'; import { SheetGrabber } from '../../content'; import { Form } from '../../forms/Form'; import { Portal } from '../../hocs'; import { useBackHandler, useOverlayZIndex } from '../../hooks'; +import { ScrollView } from '../../layouts/ScrollView'; import { Spinner, Stack } from '../../primitives'; import { Content } from './Content'; @@ -506,6 +515,34 @@ const dialogCancel = (props: IDialogCancelProps) => showCancelButton: true, }); +const dialogDebugMessage = ( + props: IDialogShowProps & { debugMessage: any }, +) => { + const dataContent = JSON.stringify(props.debugMessage, null, 2); + console.log('dialogDebugMessage:', dataContent); + return dialogShow({ + title: 'DebugMessage', + showFooter: false, + showConfirmButton: false, + showCancelButton: false, + renderContent: ( + + { + await setStringAsync(dataContent); + Toast.success({ + title: 'Copied', + }); + }} + > + {dataContent} + + + ), + ...props, + }); +}; + export function DialogLoadingView({ children, bg, @@ -526,13 +563,17 @@ export function DialogLoadingView({ ); } -function dialogLoading(props: { title: string }) { +export type IDialogLoadingProps = { + title: string; + showExitButton?: boolean; +}; +function dialogLoading(props: IDialogLoadingProps) { return dialogShow({ ...props, dismissOnOverlayPress: false, // disableSwipeGesture: true, disableDrag: true, - showExitButton: false, + showExitButton: props.showExitButton ?? false, showFooter: false, showConfirmButton: false, showCancelButton: false, @@ -554,4 +595,5 @@ export const Dialog = { confirm: dialogConfirm, cancel: dialogCancel, loading: dialogLoading, + debugMessage: dialogDebugMessage, }; diff --git a/packages/components/src/content/Theme/index.tsx b/packages/components/src/content/Theme/index.tsx new file mode 100644 index 00000000000..77b15dd5891 --- /dev/null +++ b/packages/components/src/content/Theme/index.tsx @@ -0,0 +1,7 @@ +import { Theme as TamaguiTheme } from 'tamagui'; + +import type { ThemeProps } from 'tamagui'; + +export function Theme(props: ThemeProps) { + return ; +} diff --git a/packages/components/src/content/index.ts b/packages/components/src/content/index.ts index b0b593328c9..84699bf0bfd 100644 --- a/packages/components/src/content/index.ts +++ b/packages/components/src/content/index.ts @@ -18,3 +18,4 @@ export * from './SecureView'; export * from './SheetGrabber'; export * from './ConfirmHighlighter'; export * from './DescriptionList'; +export * from './Theme'; diff --git a/packages/components/src/forms/Form/index.tsx b/packages/components/src/forms/Form/index.tsx index a6e8b19de37..d64796966d6 100644 --- a/packages/components/src/forms/Form/index.tsx +++ b/packages/components/src/forms/Form/index.tsx @@ -112,7 +112,7 @@ export type IFieldProps = Omit, 'render'> & description?: string | ReactNode; horizontal?: boolean; optional?: boolean; - labelAddon?: string | ReactElement; + labelAddon?: string | ReactElement | ReactNode; errorMessageAlign?: 'left' | 'center' | 'right'; renderErrorMessage?: (props: IFieldErrorProps) => ReactElement; }>; diff --git a/packages/components/src/forms/Input/VerificationCodeInput.tsx b/packages/components/src/forms/Input/VerificationCodeInput.tsx new file mode 100644 index 00000000000..2608c2766b1 --- /dev/null +++ b/packages/components/src/forms/Input/VerificationCodeInput.tsx @@ -0,0 +1,109 @@ +import type { ComponentProps } from 'react'; +import { useCallback, useRef, useState } from 'react'; + +import { Input } from '.'; + +import { XStack } from '../../primitives'; + +import type { IInputRef } from '.'; +import type { Stack } from '../../primitives'; +import type { + NativeSyntheticEvent, + TextInputKeyPressEventData, +} from 'react-native'; + +type IVerificationCodeInputProps = { + length?: number; + onChange?: (code: string) => void; + onComplete?: (code: string) => void; +} & ComponentProps; + +export function VerificationCodeInput({ + length = 6, + onChange, + onComplete, + ...props +}: IVerificationCodeInputProps) { + const [code, setCode] = useState(Array(length).fill('')); + const inputRefs = useRef<(IInputRef | null)[]>([]); + + const focusNextInput = useCallback((index: number) => { + inputRefs.current[index + 1]?.focus(); + }, []); + + const focusPrevInput = useCallback((index: number) => { + inputRefs.current[index - 1]?.focus(); + }, []); + + const handleChange = useCallback( + (index: number, value: string) => { + const newCode = [...code]; + newCode[index] = value.slice(-1); + setCode(newCode); + + if (value && index < length - 1) { + focusNextInput(index); + } + // if (!value && index > 0) { + // focusPrevInput(index); + // } + + onChange?.(newCode.join('')); + if (newCode.filter(Boolean).length >= length) { + inputRefs?.current?.forEach((input) => { + // TODO blur not working if rendered in Dialog + input?.blur(); + }); + const completeCode = newCode.join(''); + onComplete?.(completeCode); + } + }, + [code, focusNextInput, length, onChange, onComplete], + ); + + const handleKeyDown = useCallback( + (index: number, e: NativeSyntheticEvent) => { + const keyboardKey = e.nativeEvent.key; + if (keyboardKey === 'Backspace') { + if (code[index]) { + handleChange(index, ''); + } else if (index > 0) { + focusPrevInput(index); + handleChange(index - 1, ''); + } + } + + if (!Number.isNaN(Number(keyboardKey))) { + handleChange(index, keyboardKey); + } + }, + [code, focusPrevInput, handleChange], + ); + + const inputSize = '$11'; + return ( + + {Array(length) + .fill(null) + .map((_, index) => ( + (inputRefs.current[index] = el)} + value={code[index]} + onKeyPress={(e) => handleKeyDown(index, e)} + maxLength={1} + textAlign="center" + w={inputSize} + h={inputSize} + minWidth={inputSize} // iOS + /> + ))} + + ); +} diff --git a/packages/components/src/forms/Input/index.tsx b/packages/components/src/forms/Input/index.tsx index 1a8a17caf6d..b472f9723f3 100644 --- a/packages/components/src/forms/Input/index.tsx +++ b/packages/components/src/forms/Input/index.tsx @@ -53,9 +53,9 @@ type ITMInputProps = GetProps; export { EPasteEventPayloadItemType } from '@onekeyfe/react-native-text-input/src/enum'; export type { - IPasteEventPayloadItem, - IPasteEventPayload, IPasteEventParams, + IPasteEventPayload, + IPasteEventPayloadItem, } from '@onekeyfe/react-native-text-input'; export type IInputProps = { @@ -71,6 +71,7 @@ export type IInputProps = { addOns?: IInputAddOnProps[]; allowClear?: boolean; // add clear button when controlled value is not empty autoFocusDelayMs?: number; + allowSecureTextEye?: boolean; containerProps?: IGroupProps; onPaste?: (event: IPasteEventParams) => void; onChangeText?: ((text: string) => string | void) | undefined; @@ -83,6 +84,7 @@ export type IInputProps = { export type IInputRef = { focus: () => void; + blur: () => void; }; const SIZE_MAPPINGS = { @@ -169,6 +171,8 @@ function BaseInput( keyboardType, InputComponentStyle, autoFocusDelayMs, + secureTextEntry, + allowSecureTextEye, ...props } = useProps(inputProps); const { paddingLeftWithIcon, height, iconLeftPosition } = SIZE_MAPPINGS[size]; @@ -184,21 +188,43 @@ function BaseInput( const reloadAutoFocus = useAutoFocus(inputRef, autoFocus, autoFocusDelayMs); const readOnlyStyle = useReadOnlyStyle(readonly); + const [secureEntryState, setSecureEntryState] = useState(true); + + const usedSecureTextEntry = useMemo(() => { + if (allowSecureTextEye) { + return secureEntryState; + } + return secureTextEntry; + }, [allowSecureTextEye, secureEntryState, secureTextEntry]); + const addOns = useMemo(() => { + const allAddOns = [...(addOnsInProps ?? [])]; if (allowClear && inputProps?.value) { - return [ - ...(addOnsInProps ?? []), - { - iconName: 'XCircleOutline', - onPress: () => { - inputRef?.current?.clear(); - onChangeText?.(''); - }, + allAddOns.push({ + iconName: 'XCircleOutline', + onPress: () => { + inputRef?.current?.clear(); + onChangeText?.(''); + }, + }); + } + if (allowSecureTextEye) { + allAddOns.push({ + iconName: secureEntryState ? 'EyeOutline' : 'EyeOffOutline', + onPress: () => { + setSecureEntryState(!secureEntryState); }, - ]; + }); } - return addOnsInProps; - }, [allowClear, inputProps?.value, addOnsInProps, onChangeText]); + return allAddOns; + }, [ + addOnsInProps, + allowClear, + inputProps?.value, + allowSecureTextEye, + onChangeText, + secureEntryState, + ]); useEffect(() => { if (!platformEnv.isNative && inputRef.current && onPaste) { @@ -250,6 +276,9 @@ function BaseInput( focus: () => { inputRef.current?.focus(); }, + blur: () => { + inputRef.current?.blur(); + }, measureLayout: ( relativeToNativeComponentRef: | React.ElementRef> @@ -357,6 +386,7 @@ function BaseInput( onFocus={handleFocus} selectTextOnFocus={selectTextOnFocus} editable={editable} + secureTextEntry={usedSecureTextEntry} {...readOnlyStyle} {...InputComponentStyle} {...props} @@ -470,6 +500,7 @@ function BaseInputUnControlled( () => inputRef.current || { focus: () => {}, + blur: () => {}, }, ); return ( diff --git a/packages/components/src/forms/index.ts b/packages/components/src/forms/index.ts index 4a7686ba37d..5d8f77c0173 100644 --- a/packages/components/src/forms/index.ts +++ b/packages/components/src/forms/index.ts @@ -1,6 +1,7 @@ export * from './Checkbox'; export * from './Form'; export * from './Input'; +export * from './Input/VerificationCodeInput'; export * from './Radio'; export * from './Select'; export * from './Slider'; diff --git a/packages/components/src/primitives/Icon/Icons.tsx b/packages/components/src/primitives/Icon/Icons.tsx index daeac913a03..e84348186a8 100644 --- a/packages/components/src/primitives/Icon/Icons.tsx +++ b/packages/components/src/primitives/Icon/Icons.tsx @@ -30,6 +30,8 @@ const icons = { WhatsappBrand: () => import("./react/brand/Whatsapp"), Xbrand: () => import("./react/brand/X"), YoutubeBrand: () => import("./react/brand/Youtube"), + OnekeyPrimeDarkColored: () => import("./react/colored/OnekeyPrimeDark"), + OnekeyPrimeLightColored: () => import("./react/colored/OnekeyPrimeLight"), AccountErrorCustom: () => import("./react/custom/AccountError"), CheckboxCheckedCustom: () => import("./react/custom/CheckboxChecked"), CheckboxIndeterminateCustom: () => @@ -870,6 +872,7 @@ const icons = { PostcardOutline: () => import("./react/outline/Postcard"), PoundOutline: () => import("./react/outline/Pound"), PowerOutline: () => import("./react/outline/Power"), + PrimeOutline: () => import("./react/outline/Prime"), PrinterOutline: () => import("./react/outline/Printer"), ProcessorOutline: () => import("./react/outline/Processor"), PullRequestOutline: () => import("./react/outline/PullRequest"), @@ -1777,6 +1780,7 @@ const icons = { PostcardSolid: () => import("./react/solid/Postcard"), PoundSolid: () => import("./react/solid/Pound"), PowerSolid: () => import("./react/solid/Power"), + PrimeSolid: () => import("./react/solid/Prime"), PrinterSolid: () => import("./react/solid/Printer"), ProcessorSolid: () => import("./react/solid/Processor"), PullRequestSolid: () => import("./react/solid/PullRequest"), diff --git a/packages/components/src/primitives/Icon/react/colored/OnekeyPrimeDark.tsx b/packages/components/src/primitives/Icon/react/colored/OnekeyPrimeDark.tsx new file mode 100644 index 00000000000..3b1941608d1 --- /dev/null +++ b/packages/components/src/primitives/Icon/react/colored/OnekeyPrimeDark.tsx @@ -0,0 +1,32 @@ +import Svg, { + SvgProps, + Path, + Defs, + LinearGradient, + Stop, +} from 'react-native-svg'; +const SvgOnekeyPrimeDark = (props: SvgProps) => ( + + + + + + + + + + +); +export default SvgOnekeyPrimeDark; diff --git a/packages/components/src/primitives/Icon/react/colored/OnekeyPrimeLight.tsx b/packages/components/src/primitives/Icon/react/colored/OnekeyPrimeLight.tsx new file mode 100644 index 00000000000..194c4c01deb --- /dev/null +++ b/packages/components/src/primitives/Icon/react/colored/OnekeyPrimeLight.tsx @@ -0,0 +1,32 @@ +import Svg, { + SvgProps, + Path, + Defs, + LinearGradient, + Stop, +} from 'react-native-svg'; +const SvgOnekeyPrimeLight = (props: SvgProps) => ( + + + + + + + + + + +); +export default SvgOnekeyPrimeLight; diff --git a/packages/components/src/primitives/Icon/react/colored/index.ts b/packages/components/src/primitives/Icon/react/colored/index.ts new file mode 100644 index 00000000000..fe5b7768a75 --- /dev/null +++ b/packages/components/src/primitives/Icon/react/colored/index.ts @@ -0,0 +1,2 @@ +export { default as OnekeyPrimeDark } from './OnekeyPrimeDark'; +export { default as OnekeyPrimeLight } from './OnekeyPrimeLight'; diff --git a/packages/components/src/primitives/Icon/react/outline/Prime.tsx b/packages/components/src/primitives/Icon/react/outline/Prime.tsx new file mode 100644 index 00000000000..6dae95e9bc9 --- /dev/null +++ b/packages/components/src/primitives/Icon/react/outline/Prime.tsx @@ -0,0 +1,16 @@ +import Svg, { SvgProps, Path } from 'react-native-svg'; +const SvgPrime = (props: SvgProps) => ( + + + +); +export default SvgPrime; diff --git a/packages/components/src/primitives/Icon/react/outline/index.ts b/packages/components/src/primitives/Icon/react/outline/index.ts index 2ed8f6044a5..2aa16773795 100644 --- a/packages/components/src/primitives/Icon/react/outline/index.ts +++ b/packages/components/src/primitives/Icon/react/outline/index.ts @@ -620,6 +620,7 @@ export { default as PlusSquare } from './PlusSquare'; export { default as Postcard } from './Postcard'; export { default as Pound } from './Pound'; export { default as Power } from './Power'; +export { default as Prime } from './Prime'; export { default as Printer } from './Printer'; export { default as Processor } from './Processor'; export { default as PullRequest } from './PullRequest'; diff --git a/packages/components/src/primitives/Icon/react/solid/Prime.tsx b/packages/components/src/primitives/Icon/react/solid/Prime.tsx new file mode 100644 index 00000000000..6607523f93f --- /dev/null +++ b/packages/components/src/primitives/Icon/react/solid/Prime.tsx @@ -0,0 +1,13 @@ +import Svg, { SvgProps, Path } from 'react-native-svg'; +const SvgPrime = (props: SvgProps) => ( + + + + +); +export default SvgPrime; diff --git a/packages/components/src/primitives/Icon/react/solid/index.ts b/packages/components/src/primitives/Icon/react/solid/index.ts index 36cbba98c7d..6f8243426a6 100644 --- a/packages/components/src/primitives/Icon/react/solid/index.ts +++ b/packages/components/src/primitives/Icon/react/solid/index.ts @@ -618,6 +618,7 @@ export { default as PlusSquare } from './PlusSquare'; export { default as Postcard } from './Postcard'; export { default as Pound } from './Pound'; export { default as Power } from './Power'; +export { default as Prime } from './Prime'; export { default as Printer } from './Printer'; export { default as Processor } from './Processor'; export { default as PullRequest } from './PullRequest'; diff --git a/packages/components/svg/colored/onekey-prime-dark.svg b/packages/components/svg/colored/onekey-prime-dark.svg new file mode 100644 index 00000000000..09f2d83b24d --- /dev/null +++ b/packages/components/svg/colored/onekey-prime-dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/packages/components/svg/colored/onekey-prime-light.svg b/packages/components/svg/colored/onekey-prime-light.svg new file mode 100644 index 00000000000..5db9f3ac496 --- /dev/null +++ b/packages/components/svg/colored/onekey-prime-light.svg @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/packages/components/svg/outline/prime.svg b/packages/components/svg/outline/prime.svg new file mode 100644 index 00000000000..2dd1866d506 --- /dev/null +++ b/packages/components/svg/outline/prime.svg @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/packages/components/svg/solid/prime.svg b/packages/components/svg/solid/prime.svg new file mode 100644 index 00000000000..4466d314b1c --- /dev/null +++ b/packages/components/svg/solid/prime.svg @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/packages/kit-bg/src/apis/BackgroundApi.ts b/packages/kit-bg/src/apis/BackgroundApi.ts index 45f3ab566d3..a0a8638a4ca 100644 --- a/packages/kit-bg/src/apis/BackgroundApi.ts +++ b/packages/kit-bg/src/apis/BackgroundApi.ts @@ -324,6 +324,16 @@ class BackgroundApi extends BackgroundApiBase implements IBackgroundApi { return value; } + get servicePrime() { + const Service = + require('../services/ServicePrime') as typeof import('../services/ServicePrime'); + const value = new Service.default({ + backgroundApi: this, + }); + Object.defineProperty(this, 'servicePrime', { value }); + return value; + } + get serviceQrWallet() { const Service = require('../services/ServiceQrWallet') as typeof import('../services/ServiceQrWallet'); diff --git a/packages/kit-bg/src/apis/BackgroundApiProxy.ts b/packages/kit-bg/src/apis/BackgroundApiProxy.ts index 32133d8283a..2e0d83634f3 100644 --- a/packages/kit-bg/src/apis/BackgroundApiProxy.ts +++ b/packages/kit-bg/src/apis/BackgroundApiProxy.ts @@ -45,6 +45,7 @@ import type ServiceNostr from '../services/ServiceNostr'; import type ServiceNotification from '../services/ServiceNotification'; import type ServiceOnboarding from '../services/ServiceOnboarding'; import type ServicePassword from '../services/ServicePassword'; +import type ServicePrime from '../services/ServicePrime'; // import type ServiceCronJob from './services/ServiceCronJob'; import type ServicePromise from '../services/ServicePromise'; import type ServiceQrWallet from '../services/ServiceQrWallet'; @@ -156,6 +157,8 @@ class BackgroundApiProxy 'serviceNotification', ) as ServiceNotification; + servicePrime = this._createProxyService('servicePrime') as ServicePrime; + serviceQrWallet = this._createProxyService( 'serviceQrWallet', ) as ServiceQrWallet; diff --git a/packages/kit-bg/src/apis/IBackgroundApi.ts b/packages/kit-bg/src/apis/IBackgroundApi.ts index 75f841a70c2..1dea4f1a007 100644 --- a/packages/kit-bg/src/apis/IBackgroundApi.ts +++ b/packages/kit-bg/src/apis/IBackgroundApi.ts @@ -49,6 +49,7 @@ import type ServiceNostr from '../services/ServiceNostr'; import type ServiceNotification from '../services/ServiceNotification'; import type ServiceOnboarding from '../services/ServiceOnboarding'; import type ServicePassword from '../services/ServicePassword'; +import type ServicePrime from '../services/ServicePrime'; import type ServicePromise from '../services/ServicePromise'; import type ServiceQrWallet from '../services/ServiceQrWallet'; import type ServiceScanQRCode from '../services/ServiceScanQRCode'; @@ -152,6 +153,7 @@ export interface IBackgroundApi extends IBackgroundApiBridge { serviceDappSide: ServiceDappSide; serviceWalletConnect: ServiceWalletConnect; serviceNotification: ServiceNotification; + servicePrime: ServicePrime; serviceQrWallet: ServiceQrWallet; serviceAccountProfile: ServiceAccountProfile; serviceHardware: ServiceHardware; diff --git a/packages/kit-bg/src/apis/backgroundApiPermissions.ts b/packages/kit-bg/src/apis/backgroundApiPermissions.ts index dc0bca2c1b2..334cf4912c2 100644 --- a/packages/kit-bg/src/apis/backgroundApiPermissions.ts +++ b/packages/kit-bg/src/apis/backgroundApiPermissions.ts @@ -21,6 +21,8 @@ export const WEB_EMBED_API_WHITE_LIST_ORIGIN = [ 'http://localhost:8081', // real iOS Device web-embed origin allowed in DEV (LAN ip) + 'http://192.168.6.37:3008', + 'http://192.168.6.37', 'http://192.168.31.215:3008', 'http://192.168.31.204:3008', 'http://192.168.31.205:3008', diff --git a/packages/kit-bg/src/dbs/local/consts.ts b/packages/kit-bg/src/dbs/local/consts.ts index c876b4716c5..752c6773ef3 100644 --- a/packages/kit-bg/src/dbs/local/consts.ts +++ b/packages/kit-bg/src/dbs/local/consts.ts @@ -1,7 +1,7 @@ import { ELocalDBStoreNames } from './localDBStoreNames'; const LOCAL_DB_NAME = 'OneKeyV5'; -const LOCAL_DB_VERSION = 4; +const LOCAL_DB_VERSION = 6; // ---------------------------------------------- diff --git a/packages/kit-bg/src/dbs/simple/base/SimpleDb.ts b/packages/kit-bg/src/dbs/simple/base/SimpleDb.ts index 258326a4260..08092097ae5 100644 --- a/packages/kit-bg/src/dbs/simple/base/SimpleDb.ts +++ b/packages/kit-bg/src/dbs/simple/base/SimpleDb.ts @@ -27,6 +27,7 @@ import { SimpleDbEntityLocalTokens } from '../entity/SimpleDbEntityLocalTokens'; import { SimpleDbEntityMarketWatchList } from '../entity/SimpleDbEntityMarketWatchList'; import { SimpleDbEntityNetworkSelector } from '../entity/SimpleDbEntityNetworkSelector'; import { SimpleDbEntityNotificationSettings } from '../entity/SimpleDbEntityNotificationSettings'; +import { SimpleDbEntityPrime } from '../entity/SimpleDbEntityPrime'; import { SimpleDbEntityRiskyTokens } from '../entity/SimpleDbEntityRiskyTokens'; import { SimpleDbEntityServerNetwork } from '../entity/SimpleDbEntityServerNetwork'; import { SimpleDbEntitySwapConfigs } from '../entity/SimpleDbEntitySwapConfigs'; @@ -36,6 +37,8 @@ import { SimpleDbEntityUniversalSearch } from '../entity/SimpleDbEntityUniversal import { SimpleDbEntityV4MigrationResult } from '../entity/SimpleDbEntityV4MigrationResult'; export class SimpleDb { + prime = new SimpleDbEntityPrime(); + browserTabs = new SimpleDbEntityBrowserTabs(); browserBookmarks = new SimpleDbEntityBrowserBookmarks(); diff --git a/packages/kit-bg/src/dbs/simple/base/SimpleDbProxy.ts b/packages/kit-bg/src/dbs/simple/base/SimpleDbProxy.ts index bd2a50552d1..410c49c5656 100644 --- a/packages/kit-bg/src/dbs/simple/base/SimpleDbProxy.ts +++ b/packages/kit-bg/src/dbs/simple/base/SimpleDbProxy.ts @@ -31,6 +31,7 @@ import type { SimpleDbEntityLocalTokens } from '../entity/SimpleDbEntityLocalTok import type { SimpleDbEntityMarketWatchList } from '../entity/SimpleDbEntityMarketWatchList'; import type { SimpleDbEntityNetworkSelector } from '../entity/SimpleDbEntityNetworkSelector'; import type { SimpleDbEntityNotificationSettings } from '../entity/SimpleDbEntityNotificationSettings'; +import type { SimpleDbEntityPrime } from '../entity/SimpleDbEntityPrime'; import type { SimpleDbEntityRiskyTokens } from '../entity/SimpleDbEntityRiskyTokens'; import type { SimpleDbEntityServerNetwork } from '../entity/SimpleDbEntityServerNetwork'; import type { SimpleDbEntitySwapConfigs } from '../entity/SimpleDbEntitySwapConfigs'; @@ -57,6 +58,8 @@ export class SimpleDbProxy return this.backgroundApiProxy.callBackground(method, ...params); } + prime = this._createProxyService('prime') as SimpleDbEntityPrime; + browserTabs = this._createProxyService( 'browserTabs', ) as SimpleDbEntityBrowserTabs; diff --git a/packages/kit-bg/src/dbs/simple/entity/SimpleDbEntityPrime.ts b/packages/kit-bg/src/dbs/simple/entity/SimpleDbEntityPrime.ts new file mode 100644 index 00000000000..323e6fac5e4 --- /dev/null +++ b/packages/kit-bg/src/dbs/simple/entity/SimpleDbEntityPrime.ts @@ -0,0 +1,26 @@ +import { backgroundMethod } from '@onekeyhq/shared/src/background/backgroundDecorators'; + +import { SimpleDbEntityBase } from '../base/SimpleDbEntityBase'; + +export interface ISimpleDBPrime { + authToken: string; +} + +export class SimpleDbEntityPrime extends SimpleDbEntityBase { + entityName = 'prime'; + + override enableCache = true; + + async getAuthToken(): Promise { + const rawData = await this.getRawData(); + return rawData?.authToken || ''; + } + + @backgroundMethod() + async saveAuthToken(authToken: string) { + await this.setRawData((v) => ({ + ...v, + authToken, + })); + } +} diff --git a/packages/kit-bg/src/providers/ProviderApiPrivate.ts b/packages/kit-bg/src/providers/ProviderApiPrivate.ts index fde2f06de7e..70b81cf3c2e 100644 --- a/packages/kit-bg/src/providers/ProviderApiPrivate.ts +++ b/packages/kit-bg/src/providers/ProviderApiPrivate.ts @@ -487,9 +487,12 @@ class ProviderApiPrivate extends ProviderApiBase { await waitForDataLoaded({ data: () => this.isWebEmbedApiReady && Boolean(bg?.webEmbedBridge), - logName: `ProviderApiPrivate.callWebEmbedApiProxy: ${ - data?.module || '' - } - ${data?.method || ''}`, + logName: `ProviderApiPrivate.callWebEmbedApiProxy: ${JSON.stringify({ + module: data?.module, + method: data?.method, + isWebEmbedApiReady: Boolean(this.isWebEmbedApiReady), + webEmbedBridge: Boolean(bg?.webEmbedBridge), + })}`, wait: 1000, timeout: timerUtils.getTimeDurationMs({ minute: 3 }), }); diff --git a/packages/kit-bg/src/services/ServiceBase.ts b/packages/kit-bg/src/services/ServiceBase.ts index 8e133fdf5f5..48a2d2a62b6 100644 --- a/packages/kit-bg/src/services/ServiceBase.ts +++ b/packages/kit-bg/src/services/ServiceBase.ts @@ -3,6 +3,11 @@ import { backgroundClass, backgroundMethod, } from '@onekeyhq/shared/src/background/backgroundDecorators'; +import type { IAppEventBusPayload } from '@onekeyhq/shared/src/eventBus/appEventBus'; +import { + EAppEventBusNames, + appEventBus, +} from '@onekeyhq/shared/src/eventBus/appEventBus'; import type { EServiceEndpointEnum } from '@onekeyhq/shared/types/endpoint'; import { getEndpointInfo } from '../endpoints'; @@ -54,4 +59,26 @@ export default class ServiceBase { this._currentNetworkId = networkId; this._currentAccountId = accountId; } + + showDialogLoading( + payload: IAppEventBusPayload[EAppEventBusNames.ShowDialogLoading], + ) { + appEventBus.emit(EAppEventBusNames.ShowDialogLoading, payload); + } + + hideDialogLoading() { + appEventBus.emit(EAppEventBusNames.HideDialogLoading, undefined); + } + + async withDialogLoading( + payload: IAppEventBusPayload[EAppEventBusNames.ShowDialogLoading], + fn: () => Promise, + ) { + try { + this.showDialogLoading(payload); + return await fn(); + } finally { + this.hideDialogLoading(); + } + } } diff --git a/packages/kit-bg/src/services/ServiceCustomRpc.ts b/packages/kit-bg/src/services/ServiceCustomRpc.ts index bbf79ac30f1..0004ed65ab5 100644 --- a/packages/kit-bg/src/services/ServiceCustomRpc.ts +++ b/packages/kit-bg/src/services/ServiceCustomRpc.ts @@ -239,7 +239,7 @@ class ServiceCustomRpc extends ServiceBase { !lastFetchTime || now - lastFetchTime >= timerUtils.getTimeDurationMs({ hour: 1 }) ) { - this.fetchNetworkFromServer().catch((error) => { + void this.fetchNetworkFromServer().catch((error) => { defaultLogger.account.wallet.getServerNetworksError(error); }); } @@ -254,6 +254,7 @@ class ServiceCustomRpc extends ServiceBase { @backgroundMethod() public async fetchNetworkFromServer(): Promise { + // await timerUtils.wait(3000 * 10); defaultLogger.account.wallet.fetchNetworkFromServer(); // Request /wallet/v1/network/list to get all evm networks const client = await this.getClient(EServiceEndpointEnum.Wallet); diff --git a/packages/kit-bg/src/services/ServicePrime/ServicePrime.tsx b/packages/kit-bg/src/services/ServicePrime/ServicePrime.tsx new file mode 100644 index 00000000000..0dd6014a1b6 --- /dev/null +++ b/packages/kit-bg/src/services/ServicePrime/ServicePrime.tsx @@ -0,0 +1,484 @@ +import { isString } from 'lodash'; + +import { ensureSensitiveTextEncoded } from '@onekeyhq/core/src/secret'; +import { appApiClient } from '@onekeyhq/shared/src/appApiClient/appApiClient'; +import { + backgroundMethod, + toastIfError, +} from '@onekeyhq/shared/src/background/backgroundDecorators'; +import { PrimeLoginDialogCancelError } from '@onekeyhq/shared/src/errors'; +import stringUtils from '@onekeyhq/shared/src/utils/stringUtils'; +import timerUtils from '@onekeyhq/shared/src/utils/timerUtils'; +import type { IApiClientResponse } from '@onekeyhq/shared/types/endpoint'; +import { EServiceEndpointEnum } from '@onekeyhq/shared/types/endpoint'; +import type { + IPrimeServerUserInfo, + IPrimeSubscriptionInfo, + IPrimeUserInfo, +} from '@onekeyhq/shared/types/prime/primeTypes'; + +import { getEndpointInfo } from '../../endpoints'; +import { + primeLoginDialogAtom, + primePersistAtom, +} from '../../states/jotai/atoms/prime'; +import ServiceBase from '../ServiceBase'; + +import type { IPrimeLoginDialogKeys } from '../../states/jotai/atoms/prime'; +import type { AxiosInstance } from 'axios'; + +class ServicePrime extends ServiceBase { + constructor({ backgroundApi }: { backgroundApi: any }) { + super({ backgroundApi }); + } + + _primeAuthClient: AxiosInstance | undefined; + + async getPrimeClient() { + if (this._primeAuthClient) { + return this._primeAuthClient; + } + const endpointInfo = await getEndpointInfo({ + name: EServiceEndpointEnum.Prime, + }); + const client = await appApiClient.getBasicClient(endpointInfo); + client.interceptors.request.use(async (config) => { + const authToken = await this.backgroundApi.simpleDb.prime.getAuthToken(); + if (authToken) { + // TODO use cookie instead of simpleDb + config.headers['X-Onekey-Request-Token'] = `${authToken}`; + } + return config; + }); + client.interceptors.response.use( + (response) => response, + (error) => { + // TODO check invalid token and logout + // this.setPrimePersistAtomNotLoggedIn() + throw error; + }, + ); + this._primeAuthClient = client; + return this._primeAuthClient; + } + + @backgroundMethod() + async apiFetchPrimeUserInfo(): Promise<{ + userInfo: IPrimeUserInfo; + serverUserInfo: IPrimeServerUserInfo | undefined; + }> { + const authToken = await this.backgroundApi.simpleDb.prime.getAuthToken(); + if (!authToken) { + await this.setPrimePersistAtomNotLoggedIn(); + return { + userInfo: await primePersistAtom.get(), + serverUserInfo: undefined, + }; + } + const client = await this.getPrimeClient(); + const result = await client.get>( + '/prime/v1/user/info', + ); + const serverUserInfo = result?.data?.data; + console.log( + 'serverPrimeUserInfo >>>>> ', + JSON.stringify(serverUserInfo, null, 2), + ); + let primeSubscription: IPrimeSubscriptionInfo | undefined; + if (serverUserInfo.isPrime) { + primeSubscription = { + isActive: true, + expiresAt: serverUserInfo.primeExpiredAt, + }; + } else { + primeSubscription = undefined; + } + await primePersistAtom.set((v) => ({ + ...v, + isLoggedIn: true, + primeSubscription, + })); + return { + userInfo: await primePersistAtom.get(), + serverUserInfo, + }; + } + + async setPrimePersistAtomNotLoggedIn() { + await primePersistAtom.set(() => ({ + isLoggedIn: false, + privyUserId: undefined, + email: undefined, + primeSubscription: undefined, + subscriptionManageUrl: undefined, + })); + } + + @backgroundMethod() + async apiPreparePrimeLogin({ email }: { email: string }): Promise<{ + isRegistered: boolean; + verifyUUID: string; + captchaRequired: boolean; + emailCodeRequired: boolean; + }> { + await timerUtils.wait(600); + try { + const client = await this.getClient(EServiceEndpointEnum.Prime); + const result = await client.get< + IApiClientResponse<{ + isRegistered: boolean; + verifyUUID: string; + captchaRequired: boolean; + emailCodeRequired: boolean; + }> + >('/api/prime/check-email-registered', { + params: { + email, + }, + }); + return result?.data?.data; + } catch (error) { + console.error(error); + } + + if (email.startsWith('1')) { + return { + isRegistered: true, + verifyUUID: stringUtils.generateUUID(), + captchaRequired: false, + emailCodeRequired: false, + }; + } + + return { + isRegistered: false, + verifyUUID: stringUtils.generateUUID(), + captchaRequired: true, + emailCodeRequired: true, + }; + } + + @backgroundMethod() + async apiSendEmailVerificationCode({ + email, + verifyUUID, + }: { + email: string; + verifyUUID: string; + }): Promise<{ success: boolean }> { + await timerUtils.wait(600); + try { + const client = await this.getClient(EServiceEndpointEnum.Prime); + const result = await client.get>( + '/api/prime/send-email-verification-code', + { + params: { + email, + verifyUUID, + }, + }, + ); + return result?.data?.data; + } catch (error) { + console.error(error); + } + + return { success: true }; + } + + @backgroundMethod() + async apiPrimeLogin({ + email, + password, + emailCode, + verifyUUID, + isRegister, + }: { + email: string; + password: string; + emailCode: string; + verifyUUID: string; + isRegister: boolean; + }) { + await timerUtils.wait(600); + try { + const client = await this.getClient(EServiceEndpointEnum.Prime); + const result = await client.post< + IApiClientResponse<{ success: boolean }> + >('/api/prime/login', { + data: { email, password, emailCode, verifyUUID, isRegister }, + }); + return result?.data?.data; + } catch (error) { + console.error(error); + } + return { success: false }; + } + + @backgroundMethod() + @toastIfError() + async ensurePrimeLoginValidEmail(email: string) { + if (!stringUtils.isValidEmail(email)) { + // TODO i18n error + throw new Error('Invalid email'); + } + } + + @backgroundMethod() + @toastIfError() + async ensurePrimeLoginValidPassword(password: string) { + ensureSensitiveTextEncoded(password); + const rawPassword = + await this.backgroundApi.servicePassword.decodeSensitiveText({ + encodedText: password, + }); + if (!rawPassword) { + throw new Error('Invalid password'); + } + } + + @backgroundMethod() + @toastIfError() + async startPrimeLogin() { + const { email } = await this.promptPrimeLoginEmailDialog(); + + // TODO move to UI + const { isRegistered, verifyUUID, captchaRequired, emailCodeRequired } = + // TODO close loading dialog and reject promise + await this.withDialogLoading( + { + title: 'Checking email', + }, + async () => + this.apiPreparePrimeLogin({ + email, + }), + ); + const isRegister = !isRegistered; + + const { password } = await this.promptPrimeLoginPasswordDialog({ + email, + isRegister, + }); + ensureSensitiveTextEncoded(password); + + if (captchaRequired) { + // TODO captcha verify (register, or login retry 5 times) + } + + let code = ''; + if (emailCodeRequired) { + ({ code } = await this.promptPrimeLoginEmailCodeDialog({ + email, + verifyUUID, + })); + } + + // TODO move to UI + const { success } = await this.withDialogLoading( + { title: 'Logging in' }, + async () => + this.apiPrimeLogin({ + email, + password, + emailCode: code, + verifyUUID, + isRegister, + }), + ); + + return { + success, + email, + password, + isRegister, + code, + captcha: 'mock-captcha', + verifyUUID, + }; + } + + @backgroundMethod() + async startForgetPassword({ + email, + passwordDialogPromiseId, + }: { + email: string; + passwordDialogPromiseId: number; + }) { + console.log('startForgetPassword', passwordDialogPromiseId); + if (passwordDialogPromiseId) { + await this.cancelPrimeLogin({ + promiseId: passwordDialogPromiseId, + dialogType: 'promptPrimeLoginPasswordDialog', + }); + } + + // TODO show forget password dialog + + return { success: true }; + } + + @backgroundMethod() + async startChangePassword() { + // TODO show change password dialog + } + + @backgroundMethod() + async promptPrimeLoginEmailDialog() { + // eslint-disable-next-line no-async-promise-executor + const email = await new Promise(async (resolve, reject) => { + const promiseId = this.backgroundApi.servicePromise.createCallback({ + resolve, + reject, + }); + await primeLoginDialogAtom.set((v) => ({ + ...v, + promptPrimeLoginEmailDialog: promiseId, + })); + }); + await this.ensurePrimeLoginValidEmail(email); + return { email }; + } + + @backgroundMethod() + @toastIfError() + async resolvePrimeLoginEmailDialog({ + promiseId, + email, + }: { + promiseId: number; + email: string; + }) { + if (isString(email)) { + // eslint-disable-next-line no-param-reassign + email = email.trim(); + } + await this.ensurePrimeLoginValidEmail(email); + await primeLoginDialogAtom.set((v) => ({ + ...v, + promptPrimeLoginEmailDialog: undefined, + })); + await this.backgroundApi.servicePromise.resolveCallback({ + id: promiseId, + data: email, + }); + } + + @backgroundMethod() + async promptPrimeLoginPasswordDialog({ + email, + isRegister, + }: { + email: string; + isRegister?: boolean; + }) { + // eslint-disable-next-line no-async-promise-executor + const password = await new Promise(async (resolve, reject) => { + const promiseId = this.backgroundApi.servicePromise.createCallback({ + resolve, + reject, + }); + await primeLoginDialogAtom.set((v) => ({ + ...v, + promptPrimeLoginPasswordDialog: { + email, + isRegister, + promiseId, + }, + })); + }); + ensureSensitiveTextEncoded(password); + return { password }; + } + + @backgroundMethod() + @toastIfError() + async resolvePrimeLoginPasswordDialog({ + promiseId, + password, + }: { + promiseId: number; + password: string; + }) { + ensureSensitiveTextEncoded(password); + await timerUtils.wait(300); + await primeLoginDialogAtom.set((v) => ({ + ...v, + promptPrimeLoginPasswordDialog: undefined, + })); + await this.backgroundApi.servicePromise.resolveCallback({ + id: promiseId, + data: password, + }); + } + + @backgroundMethod() + async promptPrimeLoginEmailCodeDialog({ + email, + verifyUUID, + }: { + email: string; + verifyUUID: string; + }) { + // eslint-disable-next-line no-async-promise-executor + const code = await new Promise(async (resolve, reject) => { + const promiseId = this.backgroundApi.servicePromise.createCallback({ + resolve, + reject, + }); + await primeLoginDialogAtom.set((v) => ({ + ...v, + promptPrimeLoginEmailCodeDialog: { + email, + verifyUUID, + promiseId, + }, + })); + }); + return { code }; + } + + @backgroundMethod() + @toastIfError() + async resolvePrimeLoginEmailCodeDialog({ + promiseId, + code, + }: { + promiseId: number; + code: string; + }) { + if (!code || code.length !== 6) { + throw new Error('Invalid code'); + } + await primeLoginDialogAtom.set((v) => ({ + ...v, + promptPrimeLoginEmailCodeDialog: undefined, + })); + await this.backgroundApi.servicePromise.resolveCallback({ + id: promiseId, + data: code, + }); + } + + @backgroundMethod() + async cancelPrimeLogin({ + promiseId, + dialogType, + }: { + promiseId: number; + dialogType: IPrimeLoginDialogKeys; + }) { + const error = new PrimeLoginDialogCancelError(); + await primeLoginDialogAtom.set((v) => ({ + ...v, + [dialogType]: undefined, + })); + return this.backgroundApi.servicePromise.rejectCallback({ + id: promiseId, + error, + }); + } +} + +export default ServicePrime; diff --git a/packages/kit-bg/src/services/ServicePrime/index.tsx b/packages/kit-bg/src/services/ServicePrime/index.tsx new file mode 100644 index 00000000000..e4dcb5417df --- /dev/null +++ b/packages/kit-bg/src/services/ServicePrime/index.tsx @@ -0,0 +1,3 @@ +import ServicePrime from './ServicePrime'; + +export default ServicePrime; diff --git a/packages/kit-bg/src/services/ServicePromise.ts b/packages/kit-bg/src/services/ServicePromise.ts index 1b7b7401597..8788bf601fa 100644 --- a/packages/kit-bg/src/services/ServicePromise.ts +++ b/packages/kit-bg/src/services/ServicePromise.ts @@ -54,7 +54,7 @@ class ServicePromise extends ServiceBase { resolve, reject, data, - }: IPromiseContainerCallbackCreate) { + }: IPromiseContainerCallbackCreate): number { latestId += 1; if (latestId <= 0) { throw new Error( diff --git a/packages/kit-bg/src/states/jotai/atomNames.ts b/packages/kit-bg/src/states/jotai/atomNames.ts index e5a057e34ba..8f822a8aa78 100644 --- a/packages/kit-bg/src/states/jotai/atomNames.ts +++ b/packages/kit-bg/src/states/jotai/atomNames.ts @@ -37,6 +37,9 @@ export enum EAtomNames { // notificationsAtom, notificationsPersistAtom is reserved for notificationsPersistAtom notificationsAtom = 'notificationsAtom', // persist notificationsReadedAtom = 'notificationsReadedAtom', + primePersistAtom = 'primePersistAtom', + primeInitAtom = 'primeInitAtom', + primeLoginDialogAtom = 'primeLoginDialogAtom', accountSelectorAccountsListIsLoadingAtom = 'accountSelectorAccountsListIsLoadingAtom', } export type IAtomNameKeys = keyof typeof EAtomNames; diff --git a/packages/kit-bg/src/states/jotai/atoms/devSettings.ts b/packages/kit-bg/src/states/jotai/atoms/devSettings.ts index e5798a03bd4..79ed354d419 100644 --- a/packages/kit-bg/src/states/jotai/atoms/devSettings.ts +++ b/packages/kit-bg/src/states/jotai/atoms/devSettings.ts @@ -22,6 +22,10 @@ export interface IDevSettings { disableNumberShortcuts?: boolean; disableSearchAndAccountSelectorShortcuts?: boolean; webviewDebuggingEnabled?: boolean; + // show trading view + showTradingView?: boolean; + showPrimeTest?: boolean; + usePrimeSandboxPayment?: boolean; } export type IDevSettingsKeys = keyof IDevSettings; diff --git a/packages/kit-bg/src/states/jotai/atoms/index.ts b/packages/kit-bg/src/states/jotai/atoms/index.ts index b30a13f95ad..15772bddb54 100644 --- a/packages/kit-bg/src/states/jotai/atoms/index.ts +++ b/packages/kit-bg/src/states/jotai/atoms/index.ts @@ -16,3 +16,4 @@ export * from './spotlight'; export * from './v4migration'; export * from './gallery'; export * from './activeAccountValue'; +export * from './prime'; diff --git a/packages/kit-bg/src/states/jotai/atoms/prime.ts b/packages/kit-bg/src/states/jotai/atoms/prime.ts new file mode 100644 index 00000000000..604d94b8229 --- /dev/null +++ b/packages/kit-bg/src/states/jotai/atoms/prime.ts @@ -0,0 +1,61 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import type { IPrimeUserInfo } from '@onekeyhq/shared/types/prime/primeTypes'; + +import { EAtomNames } from '../atomNames'; +import { globalAtom } from '../utils'; + +export type IPrimePersistAtomData = IPrimeUserInfo; +export const { + target: primePersistAtom, // persist + use: usePrimePersistAtom, +} = globalAtom({ + name: EAtomNames.primePersistAtom, + persist: true, + initialValue: { + isLoggedIn: false, + email: undefined, + privyUserId: undefined, + primeSubscription: undefined, + subscriptionManageUrl: undefined, + }, +}); + +export type IPrimeInitAtomData = { + isReady: boolean; +}; +export const { target: primeInitAtom, use: usePrimeInitAtom } = + globalAtom({ + name: EAtomNames.primeInitAtom, + initialValue: { + isReady: false, + }, + }); + +export type IPrimeLoginDialogAtomPasswordData = { + isRegister?: boolean; + email: string; + promiseId: number; +}; + +export type IPrimeLoginDialogAtomEmailCodeData = { + email: string; + verifyUUID: string; + promiseId: number; +}; +export type IPrimeLoginDialogAtomData = { + promptPrimeLoginEmailDialog: number | undefined; + promptPrimeLoginPasswordDialog: IPrimeLoginDialogAtomPasswordData | undefined; + promptPrimeLoginEmailCodeDialog: + | IPrimeLoginDialogAtomEmailCodeData + | undefined; +}; +export type IPrimeLoginDialogKeys = keyof IPrimeLoginDialogAtomData; +export const { target: primeLoginDialogAtom, use: usePrimeLoginDialogAtom } = + globalAtom({ + name: EAtomNames.primeLoginDialogAtom, + initialValue: { + promptPrimeLoginEmailDialog: undefined, + promptPrimeLoginPasswordDialog: undefined, + promptPrimeLoginEmailCodeDialog: undefined, + }, + }); diff --git a/packages/kit/assets/animations/prime-banner-bg-dark.json b/packages/kit/assets/animations/prime-banner-bg-dark.json new file mode 100644 index 00000000000..8234560298c --- /dev/null +++ b/packages/kit/assets/animations/prime-banner-bg-dark.json @@ -0,0 +1 @@ +{"v":"4.8.0","ip":0,"op":720,"fr":60,"w":300,"h":300,"nm":"B","assets":[{"id":"comp_0","layers":[{"ind":1,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":403,"s":[0]},{"t":404,"s":[21]}]},"r":{"a":0,"k":118},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[56,56,100]}},"ip":394,"op":574,"st":394,"refId":"comp_1","h":29,"w":700},{"ind":2,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":163,"s":[0]},{"t":164,"s":[95]}]},"r":{"a":0,"k":161},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[37,37,100]}},"ip":158,"op":338,"st":158,"refId":"comp_1","h":29,"w":700},{"ind":3,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":549,"s":[0]},{"t":550,"s":[95]}]},"r":{"a":0,"k":239},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":542,"op":722,"st":542,"refId":"comp_1","h":29,"w":700},{"ind":4,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":518,"s":[0]},{"t":519,"s":[47]}]},"r":{"a":0,"k":307},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[48,48,100]}},"ip":513,"op":693,"st":513,"refId":"comp_1","h":29,"w":700},{"ind":5,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":376,"s":[0]},{"t":377,"s":[95]}]},"r":{"a":0,"k":-48},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":368,"op":548,"st":368,"refId":"comp_1","h":29,"w":700},{"ind":6,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":297,"s":[0]},{"t":298,"s":[93]}]},"r":{"a":0,"k":-5},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[22,22,100]}},"ip":293,"op":473,"st":293,"refId":"comp_1","h":29,"w":700},{"ind":7,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":367,"s":[0]},{"t":368,"s":[45]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":361,"op":541,"st":361,"refId":"comp_1","h":29,"w":700},{"ind":8,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":443,"s":[0]},{"t":444,"s":[95]}]},"r":{"a":0,"k":141},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[60,60,100]}},"ip":439,"op":619,"st":439,"refId":"comp_1","h":29,"w":700},{"ind":9,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":265,"s":[0]},{"t":266,"s":[35]}]},"r":{"a":0,"k":35},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[81,81,100]}},"ip":256,"op":436,"st":256,"refId":"comp_1","h":29,"w":700},{"ind":10,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":78},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[62,62,100]}},"ip":306,"op":486,"st":306,"refId":"comp_1","h":29,"w":700},{"ind":11,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":487,"s":[0]},{"t":488,"s":[51]}]},"r":{"a":0,"k":156},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":480,"op":660,"st":480,"refId":"comp_1","h":29,"w":700},{"ind":12,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":155,"s":[0]},{"t":156,"s":[95]}]},"r":{"a":0,"k":224},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[73,73,100]}},"ip":150,"op":330,"st":150,"refId":"comp_1","h":29,"w":700},{"ind":13,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":476,"s":[0]},{"t":477,"s":[95]}]},"r":{"a":0,"k":-131},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":468,"op":648,"st":468,"refId":"comp_1","h":29,"w":700},{"ind":14,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":176,"s":[0]},{"t":177,"s":[95]}]},"r":{"a":0,"k":-88},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[47,47,100]}},"ip":172,"op":352,"st":172,"refId":"comp_1","h":29,"w":700},{"ind":15,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":396,"s":[0]},{"t":397,"s":[95]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":390,"op":570,"st":390,"refId":"comp_1","h":29,"w":700},{"ind":16,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":58},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[85,85,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":17,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[26]}]},"r":{"a":0,"k":118},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[91,91,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":18,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":393,"s":[0]},{"t":394,"s":[100]}]},"r":{"a":0,"k":161},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":388,"op":568,"st":388,"refId":"comp_1","h":29,"w":700},{"ind":19,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":206,"s":[0]},{"t":207,"s":[100]}]},"r":{"a":0,"k":239},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":199,"op":379,"st":199,"refId":"comp_1","h":29,"w":700},{"ind":20,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":407,"s":[0]},{"t":408,"s":[52]}]},"r":{"a":0,"k":307},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[83,83,100]}},"ip":402,"op":582,"st":402,"refId":"comp_1","h":29,"w":700},{"ind":21,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":385,"s":[0]},{"t":386,"s":[100]}]},"r":{"a":0,"k":-48},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":377,"op":557,"st":377,"refId":"comp_1","h":29,"w":700},{"ind":22,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":223,"s":[0]},{"t":224,"s":[98]}]},"r":{"a":0,"k":-5},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[57,57,100]}},"ip":219,"op":399,"st":219,"refId":"comp_1","h":29,"w":700},{"ind":23,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[50]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":305,"op":485,"st":305,"refId":"comp_1","h":29,"w":700},{"ind":24,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":474,"s":[0]},{"t":475,"s":[100]}]},"r":{"a":0,"k":141},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[95,95,100]}},"ip":470,"op":650,"st":470,"refId":"comp_1","h":29,"w":700},{"ind":25,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[40]}]},"r":{"a":0,"k":35},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[116,116,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":26,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":290,"s":[0]},{"t":291,"s":[100]}]},"r":{"a":0,"k":92},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":285,"op":465,"st":285,"refId":"comp_1","h":29,"w":700},{"ind":27,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":377,"s":[0]},{"t":378,"s":[56]}]},"r":{"a":0,"k":156},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":370,"op":550,"st":370,"refId":"comp_1","h":29,"w":700},{"ind":28,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":384,"s":[0]},{"t":385,"s":[100]}]},"r":{"a":0,"k":224},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[108,108,100]}},"ip":379,"op":559,"st":379,"refId":"comp_1","h":29,"w":700},{"ind":29,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[100]}]},"r":{"a":0,"k":-131},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":303,"op":483,"st":303,"refId":"comp_1","h":29,"w":700},{"ind":30,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":572,"s":[0]},{"t":573,"s":[100]}]},"r":{"a":0,"k":-88},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[82,82,100]}},"ip":568,"op":748,"st":568,"refId":"comp_1","h":29,"w":700},{"ind":31,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[100]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":305,"op":485,"st":305,"refId":"comp_1","h":29,"w":700},{"ind":32,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":510,"s":[0]},{"t":511,"s":[100]}]},"r":{"a":0,"k":58},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[120,120,100]}},"ip":506,"op":686,"st":506,"refId":"comp_1","h":29,"w":700},{"ind":33,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":384,"s":[0]},{"t":385,"s":[100]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":380,"op":560,"st":380,"refId":"comp_1","h":29,"w":700},{"ind":34,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[21]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[36,36,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":35,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":486,"s":[0]},{"t":487,"s":[95]}]},"r":{"a":0,"k":116},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[17,17,100]}},"ip":481,"op":661,"st":481,"refId":"comp_1","h":29,"w":700},{"ind":36,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":235,"s":[0]},{"t":236,"s":[95]}]},"r":{"a":0,"k":194},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":228,"op":408,"st":228,"refId":"comp_1","h":29,"w":700},{"ind":37,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":466,"s":[0]},{"t":467,"s":[47]}]},"r":{"a":0,"k":262},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[28,28,100]}},"ip":461,"op":641,"st":461,"refId":"comp_1","h":29,"w":700},{"ind":38,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":-93},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":39,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":458,"s":[0]},{"t":459,"s":[93]}]},"r":{"a":0,"k":-50},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[2,2,100]}},"ip":454,"op":634,"st":454,"refId":"comp_1","h":29,"w":700},{"ind":40,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":398,"s":[0]},{"t":399,"s":[45]}]},"r":{"a":0,"k":28},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":392,"op":572,"st":392,"refId":"comp_1","h":29,"w":700},{"ind":41,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":284,"s":[0]},{"t":285,"s":[95]}]},"r":{"a":0,"k":96},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[40,40,100]}},"ip":280,"op":460,"st":280,"refId":"comp_1","h":29,"w":700},{"ind":42,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":411,"s":[0]},{"t":412,"s":[35]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[61,61,100]}},"ip":402,"op":582,"st":402,"refId":"comp_1","h":29,"w":700},{"ind":43,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":396,"s":[0]},{"t":397,"s":[95]}]},"r":{"a":0,"k":33},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[42,42,100]}},"ip":391,"op":571,"st":391,"refId":"comp_1","h":29,"w":700},{"ind":44,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[51]}]},"r":{"a":0,"k":111},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":304,"op":484,"st":304,"refId":"comp_1","h":29,"w":700},{"ind":45,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":495,"s":[0]},{"t":496,"s":[95]}]},"r":{"a":0,"k":179},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[53,53,100]}},"ip":490,"op":670,"st":490,"refId":"comp_1","h":29,"w":700},{"ind":46,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":419,"s":[0]},{"t":420,"s":[95]}]},"r":{"a":0,"k":-176},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":411,"op":591,"st":411,"refId":"comp_1","h":29,"w":700},{"ind":47,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":469,"s":[0]},{"t":470,"s":[95]}]},"r":{"a":0,"k":-133},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[27,27,100]}},"ip":465,"op":645,"st":465,"refId":"comp_1","h":29,"w":700},{"ind":48,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":-55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":305,"op":485,"st":305,"refId":"comp_1","h":29,"w":700},{"ind":49,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":335,"s":[0]},{"t":336,"s":[95]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":331,"op":511,"st":331,"refId":"comp_1","h":29,"w":700},{"ind":50,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":382,"s":[0]},{"t":383,"s":[26]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[71,71,100]}},"ip":373,"op":553,"st":373,"refId":"comp_1","h":29,"w":700},{"ind":51,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":357,"s":[0]},{"t":358,"s":[100]}]},"r":{"a":0,"k":116},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":352,"op":532,"st":352,"refId":"comp_1","h":29,"w":700},{"ind":52,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":469,"s":[0]},{"t":470,"s":[100]}]},"r":{"a":0,"k":194},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":462,"op":642,"st":462,"refId":"comp_1","h":29,"w":700},{"ind":53,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":350,"s":[0]},{"t":351,"s":[52]}]},"r":{"a":0,"k":262},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[63,63,100]}},"ip":345,"op":525,"st":345,"refId":"comp_1","h":29,"w":700},{"ind":54,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":182,"s":[0]},{"t":183,"s":[100]}]},"r":{"a":0,"k":-84},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":174,"op":354,"st":174,"refId":"comp_1","h":29,"w":700},{"ind":55,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":350,"s":[0]},{"t":351,"s":[98]}]},"r":{"a":0,"k":-50},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[37,37,100]}},"ip":346,"op":526,"st":346,"refId":"comp_1","h":29,"w":700},{"ind":56,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":536,"s":[0]},{"t":537,"s":[50]}]},"r":{"a":0,"k":28},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":530,"op":710,"st":530,"refId":"comp_1","h":29,"w":700},{"ind":57,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":378,"s":[0]},{"t":379,"s":[100]}]},"r":{"a":0,"k":96},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[75,75,100]}},"ip":374,"op":554,"st":374,"refId":"comp_1","h":29,"w":700},{"ind":58,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":581,"s":[0]},{"t":582,"s":[40]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[96,96,100]}},"ip":572,"op":752,"st":572,"refId":"comp_1","h":29,"w":700},{"ind":59,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":404,"s":[0]},{"t":405,"s":[100]}]},"r":{"a":0,"k":33},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":399,"op":579,"st":399,"refId":"comp_1","h":29,"w":700},{"ind":60,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[56]}]},"r":{"a":0,"k":111},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":304,"op":484,"st":304,"refId":"comp_1","h":29,"w":700},{"ind":61,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":405,"s":[0]},{"t":406,"s":[100]}]},"r":{"a":0,"k":179},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[88,88,100]}},"ip":400,"op":580,"st":400,"refId":"comp_1","h":29,"w":700},{"ind":62,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":417,"s":[0]},{"t":418,"s":[100]}]},"r":{"a":0,"k":-176},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":409,"op":589,"st":409,"refId":"comp_1","h":29,"w":700},{"ind":63,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[100]}]},"r":{"a":0,"k":-133},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[62,62,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":64,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":520,"s":[0]},{"t":521,"s":[100]}]},"r":{"a":0,"k":-55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":514,"op":694,"st":514,"refId":"comp_1","h":29,"w":700},{"ind":65,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":433,"s":[0]},{"t":434,"s":[100]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[100,100,100]}},"ip":429,"op":609,"st":429,"refId":"comp_1","h":29,"w":700},{"ind":66,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[21]}]},"r":{"a":0,"k":118},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[56,56,100]}},"ip":127,"op":307,"st":127,"refId":"comp_1","h":29,"w":700},{"ind":67,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":283,"s":[0]},{"t":284,"s":[95]}]},"r":{"a":0,"k":161},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[37,37,100]}},"ip":278,"op":458,"st":278,"refId":"comp_1","h":29,"w":700},{"ind":68,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":212,"s":[0]},{"t":213,"s":[95]}]},"r":{"a":0,"k":239},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":205,"op":385,"st":205,"refId":"comp_1","h":29,"w":700},{"ind":69,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":317,"s":[0]},{"t":318,"s":[47]}]},"r":{"a":0,"k":307},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[48,48,100]}},"ip":312,"op":492,"st":312,"refId":"comp_1","h":29,"w":700},{"ind":70,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":301,"s":[0]},{"t":302,"s":[95]}]},"r":{"a":0,"k":-48},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":293,"op":473,"st":293,"refId":"comp_1","h":29,"w":700},{"ind":71,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":226,"s":[0]},{"t":227,"s":[93]}]},"r":{"a":0,"k":-5},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[22,22,100]}},"ip":222,"op":402,"st":222,"refId":"comp_1","h":29,"w":700},{"ind":72,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":409,"s":[0]},{"t":410,"s":[45]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":403,"op":583,"st":403,"refId":"comp_1","h":29,"w":700},{"ind":73,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[95]}]},"r":{"a":0,"k":141},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[60,60,100]}},"ip":132,"op":312,"st":132,"refId":"comp_1","h":29,"w":700},{"ind":74,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":191,"s":[0]},{"t":192,"s":[35]}]},"r":{"a":0,"k":35},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[81,81,100]}},"ip":182,"op":362,"st":182,"refId":"comp_1","h":29,"w":700},{"ind":75,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":222,"s":[0]},{"t":223,"s":[95]}]},"r":{"a":0,"k":78},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[62,62,100]}},"ip":217,"op":397,"st":217,"refId":"comp_1","h":29,"w":700},{"ind":76,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":251,"s":[0]},{"t":252,"s":[51]}]},"r":{"a":0,"k":156},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":244,"op":424,"st":244,"refId":"comp_1","h":29,"w":700},{"ind":77,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":360,"s":[0]},{"t":361,"s":[95]}]},"r":{"a":0,"k":224},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[73,73,100]}},"ip":355,"op":535,"st":355,"refId":"comp_1","h":29,"w":700},{"ind":78,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":245,"s":[0]},{"t":246,"s":[95]}]},"r":{"a":0,"k":-131},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":237,"op":417,"st":237,"refId":"comp_1","h":29,"w":700},{"ind":79,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":363,"s":[0]},{"t":364,"s":[95]}]},"r":{"a":0,"k":-88},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[47,47,100]}},"ip":359,"op":539,"st":359,"refId":"comp_1","h":29,"w":700},{"ind":80,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":221,"s":[0]},{"t":222,"s":[95]}]},"r":{"a":0,"k":1},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":215,"op":395,"st":215,"refId":"comp_1","h":29,"w":700},{"ind":81,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[95]}]},"r":{"a":0,"k":58},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[85,85,100]}},"ip":132,"op":312,"st":132,"refId":"comp_1","h":29,"w":700},{"ind":82,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":483,"s":[0]},{"t":484,"s":[26]}]},"r":{"a":0,"k":118},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[91,91,100]}},"ip":474,"op":654,"st":474,"refId":"comp_1","h":29,"w":700},{"ind":83,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":218,"s":[0]},{"t":219,"s":[100]}]},"r":{"a":0,"k":161},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":213,"op":393,"st":213,"refId":"comp_1","h":29,"w":700},{"ind":84,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":441,"s":[0]},{"t":442,"s":[100]}]},"r":{"a":0,"k":239},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":434,"op":614,"st":434,"refId":"comp_1","h":29,"w":700},{"ind":85,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[52]}]},"r":{"a":0,"k":216},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[83,83,100]}},"ip":131,"op":311,"st":131,"refId":"comp_1","h":29,"w":700},{"ind":86,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":210,"s":[0]},{"t":211,"s":[100]}]},"r":{"a":0,"k":-48},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":202,"op":382,"st":202,"refId":"comp_1","h":29,"w":700},{"ind":87,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":5,"s":[0]},{"t":6,"s":[98]}]},"r":{"a":0,"k":-5},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[57,57,100]}},"ip":1,"op":181,"st":1,"refId":"comp_1","h":29,"w":700},{"ind":88,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":46,"s":[0]},{"t":47,"s":[50]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":40,"op":220,"st":40,"refId":"comp_1","h":29,"w":700},{"ind":89,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":226,"s":[0]},{"t":227,"s":[100]}]},"r":{"a":0,"k":141},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[95,95,100]}},"ip":222,"op":402,"st":222,"refId":"comp_1","h":29,"w":700},{"ind":90,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":68,"s":[0]},{"t":69,"s":[40]}]},"r":{"a":0,"k":35},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[116,116,100]}},"ip":59,"op":239,"st":59,"refId":"comp_1","h":29,"w":700},{"ind":91,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":282,"s":[0]},{"t":283,"s":[100]}]},"r":{"a":0,"k":-32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":277,"op":457,"st":277,"refId":"comp_1","h":29,"w":700},{"ind":92,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":450,"s":[0]},{"t":451,"s":[56]}]},"r":{"a":0,"k":156},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":443,"op":623,"st":443,"refId":"comp_1","h":29,"w":700},{"ind":93,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":327,"s":[0]},{"t":328,"s":[100]}]},"r":{"a":0,"k":224},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[108,108,100]}},"ip":322,"op":502,"st":322,"refId":"comp_1","h":29,"w":700},{"ind":94,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":59,"s":[0]},{"t":60,"s":[100]}]},"r":{"a":0,"k":-131},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":51,"op":231,"st":51,"refId":"comp_1","h":29,"w":700},{"ind":95,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":324,"s":[0]},{"t":325,"s":[100]}]},"r":{"a":0,"k":-88},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[82,82,100]}},"ip":320,"op":500,"st":320,"refId":"comp_1","h":29,"w":700},{"ind":96,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":96,"s":[0]},{"t":97,"s":[100]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":90,"op":270,"st":90,"refId":"comp_1","h":29,"w":700},{"ind":97,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":288,"s":[0]},{"t":289,"s":[100]}]},"r":{"a":0,"k":58},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[120,120,100]}},"ip":284,"op":464,"st":284,"refId":"comp_1","h":29,"w":700},{"ind":98,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":209,"s":[0]},{"t":210,"s":[100]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":205,"op":385,"st":205,"refId":"comp_1","h":29,"w":700},{"ind":99,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":348,"s":[0]},{"t":349,"s":[21]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[36,36,100]}},"ip":339,"op":519,"st":339,"refId":"comp_1","h":29,"w":700},{"ind":100,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":116},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[17,17,100]}},"ip":306,"op":486,"st":306,"refId":"comp_1","h":29,"w":700},{"ind":101,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":366,"s":[0]},{"t":367,"s":[95]}]},"r":{"a":0,"k":194},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":359,"op":539,"st":359,"refId":"comp_1","h":29,"w":700},{"ind":102,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":128,"s":[0]},{"t":129,"s":[47]}]},"r":{"a":0,"k":262},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[28,28,100]}},"ip":123,"op":303,"st":123,"refId":"comp_1","h":29,"w":700},{"ind":103,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":309,"s":[0]},{"t":310,"s":[95]}]},"r":{"a":0,"k":-93},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":305,"op":485,"st":305,"refId":"comp_1","h":29,"w":700},{"ind":104,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":276,"s":[0]},{"t":277,"s":[93]}]},"r":{"a":0,"k":-50},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[2,2,100]}},"ip":272,"op":452,"st":272,"refId":"comp_1","h":29,"w":700},{"ind":105,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":365,"s":[0]},{"t":366,"s":[45]}]},"r":{"a":0,"k":28},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":359,"op":539,"st":359,"refId":"comp_1","h":29,"w":700},{"ind":106,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":343,"s":[0]},{"t":344,"s":[95]}]},"r":{"a":0,"k":96},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[40,40,100]}},"ip":339,"op":519,"st":339,"refId":"comp_1","h":29,"w":700},{"ind":107,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":176,"s":[0]},{"t":177,"s":[35]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[61,61,100]}},"ip":167,"op":347,"st":167,"refId":"comp_1","h":29,"w":700},{"ind":108,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":221,"s":[0]},{"t":222,"s":[95]}]},"r":{"a":0,"k":33},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[42,42,100]}},"ip":216,"op":396,"st":216,"refId":"comp_1","h":29,"w":700},{"ind":109,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":488,"s":[0]},{"t":489,"s":[51]}]},"r":{"a":0,"k":111},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":481,"op":661,"st":481,"refId":"comp_1","h":29,"w":700},{"ind":110,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":320,"s":[0]},{"t":321,"s":[95]}]},"r":{"a":0,"k":179},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[53,53,100]}},"ip":315,"op":495,"st":315,"refId":"comp_1","h":29,"w":700},{"ind":111,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":244,"s":[0]},{"t":245,"s":[95]}]},"r":{"a":0,"k":-176},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":236,"op":416,"st":236,"refId":"comp_1","h":29,"w":700},{"ind":112,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":294,"s":[0]},{"t":295,"s":[95]}]},"r":{"a":0,"k":-133},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[27,27,100]}},"ip":290,"op":470,"st":290,"refId":"comp_1","h":29,"w":700},{"ind":113,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[95]}]},"r":{"a":0,"k":-55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":130,"op":310,"st":130,"refId":"comp_1","h":29,"w":700},{"ind":114,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":359,"s":[0]},{"t":360,"s":[95]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":355,"op":535,"st":355,"refId":"comp_1","h":29,"w":700},{"ind":115,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":207,"s":[0]},{"t":208,"s":[26]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[71,71,100]}},"ip":198,"op":378,"st":198,"refId":"comp_1","h":29,"w":700},{"ind":116,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":182,"s":[0]},{"t":183,"s":[100]}]},"r":{"a":0,"k":116},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":177,"op":357,"st":177,"refId":"comp_1","h":29,"w":700},{"ind":117,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":294,"s":[0]},{"t":295,"s":[100]}]},"r":{"a":0,"k":194},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":287,"op":467,"st":287,"refId":"comp_1","h":29,"w":700},{"ind":118,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":175,"s":[0]},{"t":176,"s":[52]}]},"r":{"a":0,"k":262},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[63,63,100]}},"ip":170,"op":350,"st":170,"refId":"comp_1","h":29,"w":700},{"ind":119,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":106,"s":[0]},{"t":107,"s":[100]}]},"r":{"a":0,"k":-93},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":98,"op":278,"st":98,"refId":"comp_1","h":29,"w":700},{"ind":120,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":352,"s":[0]},{"t":353,"s":[98]}]},"r":{"a":0,"k":-50},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[37,37,100]}},"ip":348,"op":528,"st":348,"refId":"comp_1","h":29,"w":700},{"ind":121,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":361,"s":[0]},{"t":362,"s":[50]}]},"r":{"a":0,"k":28},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":355,"op":535,"st":355,"refId":"comp_1","h":29,"w":700},{"ind":122,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":203,"s":[0]},{"t":204,"s":[100]}]},"r":{"a":0,"k":96},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[75,75,100]}},"ip":199,"op":379,"st":199,"refId":"comp_1","h":29,"w":700},{"ind":123,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":247,"s":[0]},{"t":248,"s":[40]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[96,96,100]}},"ip":238,"op":418,"st":238,"refId":"comp_1","h":29,"w":700},{"ind":124,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":417,"s":[0]},{"t":418,"s":[100]}]},"r":{"a":0,"k":33},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":412,"op":592,"st":412,"refId":"comp_1","h":29,"w":700},{"ind":125,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[56]}]},"r":{"a":0,"k":111},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":129,"op":309,"st":129,"refId":"comp_1","h":29,"w":700},{"ind":126,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":351,"s":[0]},{"t":352,"s":[100]}]},"r":{"a":0,"k":179},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[88,88,100]}},"ip":346,"op":526,"st":346,"refId":"comp_1","h":29,"w":700},{"ind":127,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":107,"s":[0]},{"t":108,"s":[100]}]},"r":{"a":0,"k":-176},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":99,"op":279,"st":99,"refId":"comp_1","h":29,"w":700},{"ind":128,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[100]}]},"r":{"a":0,"k":-133},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[62,62,100]}},"ip":132,"op":312,"st":132,"refId":"comp_1","h":29,"w":700},{"ind":129,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":345,"s":[0]},{"t":346,"s":[100]}]},"r":{"a":0,"k":-55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":339,"op":519,"st":339,"refId":"comp_1","h":29,"w":700},{"ind":130,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":258,"s":[0]},{"t":259,"s":[100]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[100,100,100]}},"ip":254,"op":434,"st":254,"refId":"comp_1","h":29,"w":700},{"ind":131,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":403,"s":[0]},{"t":404,"s":[21]}]},"r":{"a":0,"k":160},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[14,14,100]}},"ip":394,"op":574,"st":394,"refId":"comp_1","h":29,"w":700},{"ind":132,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":163,"s":[0]},{"t":164,"s":[95]}]},"r":{"a":0,"k":203},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-5,-5,100]}},"ip":158,"op":338,"st":158,"refId":"comp_1","h":29,"w":700},{"ind":133,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":549,"s":[0]},{"t":550,"s":[95]}]},"r":{"a":0,"k":281},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":542,"op":722,"st":542,"refId":"comp_1","h":29,"w":700},{"ind":134,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":518,"s":[0]},{"t":519,"s":[47]}]},"r":{"a":0,"k":349},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[6,6,100]}},"ip":513,"op":693,"st":513,"refId":"comp_1","h":29,"w":700},{"ind":135,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":376,"s":[0]},{"t":377,"s":[95]}]},"r":{"a":0,"k":-6},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":368,"op":548,"st":368,"refId":"comp_1","h":29,"w":700},{"ind":136,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":297,"s":[0]},{"t":298,"s":[93]}]},"r":{"a":0,"k":37},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-20,-20,100]}},"ip":293,"op":473,"st":293,"refId":"comp_1","h":29,"w":700},{"ind":137,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":367,"s":[0]},{"t":368,"s":[45]}]},"r":{"a":0,"k":115},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":361,"op":541,"st":361,"refId":"comp_1","h":29,"w":700},{"ind":138,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":443,"s":[0]},{"t":444,"s":[95]}]},"r":{"a":0,"k":183},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[18,18,100]}},"ip":439,"op":619,"st":439,"refId":"comp_1","h":29,"w":700},{"ind":139,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":265,"s":[0]},{"t":266,"s":[35]}]},"r":{"a":0,"k":77},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[39,39,100]}},"ip":256,"op":436,"st":256,"refId":"comp_1","h":29,"w":700},{"ind":140,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":120},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[20,20,100]}},"ip":306,"op":486,"st":306,"refId":"comp_1","h":29,"w":700},{"ind":141,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":487,"s":[0]},{"t":488,"s":[51]}]},"r":{"a":0,"k":198},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[55,55,100]}},"ip":480,"op":660,"st":480,"refId":"comp_1","h":29,"w":700},{"ind":142,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":155,"s":[0]},{"t":156,"s":[95]}]},"r":{"a":0,"k":266},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[31,31,100]}},"ip":150,"op":330,"st":150,"refId":"comp_1","h":29,"w":700},{"ind":143,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":476,"s":[0]},{"t":477,"s":[95]}]},"r":{"a":0,"k":-89},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[55,55,100]}},"ip":468,"op":648,"st":468,"refId":"comp_1","h":29,"w":700},{"ind":144,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":176,"s":[0]},{"t":177,"s":[95]}]},"r":{"a":0,"k":-46},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[23,23,100]}},"ip":172,"op":352,"st":172,"refId":"comp_1","h":29,"w":700},{"ind":145,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":396,"s":[0]},{"t":397,"s":[95]}]},"r":{"a":0,"k":32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[55,55,100]}},"ip":390,"op":570,"st":390,"refId":"comp_1","h":29,"w":700},{"ind":146,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":100},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[43,43,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":147,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":90,"s":[0]},{"t":91,"s":[26]}]},"r":{"a":0,"k":160},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[49,49,100]}},"ip":81,"op":261,"st":81,"refId":"comp_1","h":29,"w":700},{"ind":148,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":393,"s":[0]},{"t":394,"s":[100]}]},"r":{"a":0,"k":203},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":388,"op":568,"st":388,"refId":"comp_1","h":29,"w":700},{"ind":149,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":206,"s":[0]},{"t":207,"s":[100]}]},"r":{"a":0,"k":281},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":199,"op":379,"st":199,"refId":"comp_1","h":29,"w":700},{"ind":150,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":407,"s":[0]},{"t":408,"s":[52]}]},"r":{"a":0,"k":349},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[41,41,100]}},"ip":402,"op":582,"st":402,"refId":"comp_1","h":29,"w":700},{"ind":151,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":385,"s":[0]},{"t":386,"s":[100]}]},"r":{"a":0,"k":-6},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":377,"op":557,"st":377,"refId":"comp_1","h":29,"w":700},{"ind":152,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":223,"s":[0]},{"t":224,"s":[98]}]},"r":{"a":0,"k":37},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[15,15,100]}},"ip":219,"op":399,"st":219,"refId":"comp_1","h":29,"w":700},{"ind":153,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":174,"s":[0]},{"t":175,"s":[50]}]},"r":{"a":0,"k":115},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":168,"op":348,"st":168,"refId":"comp_1","h":29,"w":700},{"ind":154,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":474,"s":[0]},{"t":475,"s":[100]}]},"r":{"a":0,"k":183},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[53,53,100]}},"ip":470,"op":650,"st":470,"refId":"comp_1","h":29,"w":700},{"ind":155,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[40]}]},"r":{"a":0,"k":77},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[74,74,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":156,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":132,"s":[0]},{"t":133,"s":[100]}]},"r":{"a":0,"k":120},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[55,55,100]}},"ip":127,"op":307,"st":127,"refId":"comp_1","h":29,"w":700},{"ind":157,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":377,"s":[0]},{"t":378,"s":[56]}]},"r":{"a":0,"k":198},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[90,90,100]}},"ip":370,"op":550,"st":370,"refId":"comp_1","h":29,"w":700},{"ind":158,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":36,"s":[0]},{"t":37,"s":[100]}]},"r":{"a":0,"k":266},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[66,66,100]}},"ip":31,"op":211,"st":31,"refId":"comp_1","h":29,"w":700},{"ind":159,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":157,"s":[0]},{"t":158,"s":[100]}]},"r":{"a":0,"k":-89},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[90,90,100]}},"ip":149,"op":329,"st":149,"refId":"comp_1","h":29,"w":700},{"ind":160,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":572,"s":[0]},{"t":573,"s":[100]}]},"r":{"a":0,"k":-46},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[40,40,100]}},"ip":568,"op":748,"st":568,"refId":"comp_1","h":29,"w":700},{"ind":161,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":282,"s":[0]},{"t":283,"s":[100]}]},"r":{"a":0,"k":32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[90,90,100]}},"ip":276,"op":456,"st":276,"refId":"comp_1","h":29,"w":700},{"ind":162,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":510,"s":[0]},{"t":511,"s":[100]}]},"r":{"a":0,"k":100},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[78,78,100]}},"ip":506,"op":686,"st":506,"refId":"comp_1","h":29,"w":700},{"ind":163,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":384,"s":[0]},{"t":385,"s":[100]}]},"r":{"a":0,"k":55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[70,70,100]}},"ip":380,"op":560,"st":380,"refId":"comp_1","h":29,"w":700},{"ind":164,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[21]}]},"r":{"a":0,"k":115},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-6,-6,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":165,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":486,"s":[0]},{"t":487,"s":[95]}]},"r":{"a":0,"k":158},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-25,-25,100]}},"ip":481,"op":661,"st":481,"refId":"comp_1","h":29,"w":700},{"ind":166,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":235,"s":[0]},{"t":236,"s":[95]}]},"r":{"a":0,"k":236},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[10,10,100]}},"ip":228,"op":408,"st":228,"refId":"comp_1","h":29,"w":700},{"ind":167,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":466,"s":[0]},{"t":467,"s":[47]}]},"r":{"a":0,"k":304},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-14,-14,100]}},"ip":461,"op":641,"st":461,"refId":"comp_1","h":29,"w":700},{"ind":168,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":-51},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[10,10,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":169,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":458,"s":[0]},{"t":459,"s":[93]}]},"r":{"a":0,"k":-8},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-40,-40,100]}},"ip":454,"op":634,"st":454,"refId":"comp_1","h":29,"w":700},{"ind":170,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":398,"s":[0]},{"t":399,"s":[45]}]},"r":{"a":0,"k":70},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[10,10,100]}},"ip":392,"op":572,"st":392,"refId":"comp_1","h":29,"w":700},{"ind":171,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":284,"s":[0]},{"t":285,"s":[95]}]},"r":{"a":0,"k":138},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-2,-2,100]}},"ip":280,"op":460,"st":280,"refId":"comp_1","h":29,"w":700},{"ind":172,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":411,"s":[0]},{"t":412,"s":[35]}]},"r":{"a":0,"k":32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[19,19,100]}},"ip":402,"op":582,"st":402,"refId":"comp_1","h":29,"w":700},{"ind":173,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":396,"s":[0]},{"t":397,"s":[95]}]},"r":{"a":0,"k":75},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[0,0,100]}},"ip":391,"op":571,"st":391,"refId":"comp_1","h":29,"w":700},{"ind":174,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[51]}]},"r":{"a":0,"k":153},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[35,35,100]}},"ip":304,"op":484,"st":304,"refId":"comp_1","h":29,"w":700},{"ind":175,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":495,"s":[0]},{"t":496,"s":[95]}]},"r":{"a":0,"k":221},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[11,11,100]}},"ip":490,"op":670,"st":490,"refId":"comp_1","h":29,"w":700},{"ind":176,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":419,"s":[0]},{"t":420,"s":[95]}]},"r":{"a":0,"k":-134},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[35,35,100]}},"ip":411,"op":591,"st":411,"refId":"comp_1","h":29,"w":700},{"ind":177,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":469,"s":[0]},{"t":470,"s":[95]}]},"r":{"a":0,"k":-91},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-15,-15,100]}},"ip":465,"op":645,"st":465,"refId":"comp_1","h":29,"w":700},{"ind":178,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":128,"s":[0]},{"t":129,"s":[95]}]},"r":{"a":0,"k":-13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[35,35,100]}},"ip":122,"op":302,"st":122,"refId":"comp_1","h":29,"w":700},{"ind":179,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":335,"s":[0]},{"t":336,"s":[95]}]},"r":{"a":0,"k":55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[23,23,100]}},"ip":331,"op":511,"st":331,"refId":"comp_1","h":29,"w":700},{"ind":180,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":382,"s":[0]},{"t":383,"s":[26]}]},"r":{"a":0,"k":115},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[29,29,100]}},"ip":373,"op":553,"st":373,"refId":"comp_1","h":29,"w":700},{"ind":181,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":176,"s":[0]},{"t":177,"s":[100]}]},"r":{"a":0,"k":158},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[10,10,100]}},"ip":171,"op":351,"st":171,"refId":"comp_1","h":29,"w":700},{"ind":182,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":469,"s":[0]},{"t":470,"s":[100]}]},"r":{"a":0,"k":236},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[45,45,100]}},"ip":462,"op":642,"st":462,"refId":"comp_1","h":29,"w":700},{"ind":183,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":235,"s":[0]},{"t":236,"s":[52]}]},"r":{"a":0,"k":304},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[21,21,100]}},"ip":230,"op":410,"st":230,"refId":"comp_1","h":29,"w":700},{"ind":184,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":182,"s":[0]},{"t":183,"s":[100]}]},"r":{"a":0,"k":-51},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[45,45,100]}},"ip":174,"op":354,"st":174,"refId":"comp_1","h":29,"w":700},{"ind":185,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":350,"s":[0]},{"t":351,"s":[98]}]},"r":{"a":0,"k":-8},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-5,-5,100]}},"ip":346,"op":526,"st":346,"refId":"comp_1","h":29,"w":700},{"ind":186,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":536,"s":[0]},{"t":537,"s":[50]}]},"r":{"a":0,"k":70},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[45,45,100]}},"ip":530,"op":710,"st":530,"refId":"comp_1","h":29,"w":700},{"ind":187,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":378,"s":[0]},{"t":379,"s":[100]}]},"r":{"a":0,"k":138},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[33,33,100]}},"ip":374,"op":554,"st":374,"refId":"comp_1","h":29,"w":700},{"ind":188,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":581,"s":[0]},{"t":582,"s":[40]}]},"r":{"a":0,"k":32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[54,54,100]}},"ip":572,"op":752,"st":572,"refId":"comp_1","h":29,"w":700},{"ind":189,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":404,"s":[0]},{"t":405,"s":[100]}]},"r":{"a":0,"k":75},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[35,35,100]}},"ip":399,"op":579,"st":399,"refId":"comp_1","h":29,"w":700},{"ind":190,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[56]}]},"r":{"a":0,"k":153},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[70,70,100]}},"ip":304,"op":484,"st":304,"refId":"comp_1","h":29,"w":700},{"ind":191,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":180,"s":[0]},{"t":181,"s":[100]}]},"r":{"a":0,"k":221},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[46,46,100]}},"ip":175,"op":355,"st":175,"refId":"comp_1","h":29,"w":700},{"ind":192,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":453,"s":[0]},{"t":454,"s":[100]}]},"r":{"a":0,"k":-134},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[70,70,100]}},"ip":445,"op":625,"st":445,"refId":"comp_1","h":29,"w":700},{"ind":193,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[100]}]},"r":{"a":0,"k":-91},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[20,20,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":194,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":520,"s":[0]},{"t":521,"s":[100]}]},"r":{"a":0,"k":-13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[70,70,100]}},"ip":514,"op":694,"st":514,"refId":"comp_1","h":29,"w":700},{"ind":195,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":433,"s":[0]},{"t":434,"s":[100]}]},"r":{"a":0,"k":55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[58,58,100]}},"ip":429,"op":609,"st":429,"refId":"comp_1","h":29,"w":700},{"ind":196,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[21]}]},"r":{"a":0,"k":160},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[14,14,100]}},"ip":127,"op":307,"st":127,"refId":"comp_1","h":29,"w":700},{"ind":197,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":283,"s":[0]},{"t":284,"s":[95]}]},"r":{"a":0,"k":203},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-5,-5,100]}},"ip":278,"op":458,"st":278,"refId":"comp_1","h":29,"w":700},{"ind":198,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":212,"s":[0]},{"t":213,"s":[95]}]},"r":{"a":0,"k":281},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":205,"op":385,"st":205,"refId":"comp_1","h":29,"w":700},{"ind":199,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":317,"s":[0]},{"t":318,"s":[47]}]},"r":{"a":0,"k":349},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[6,6,100]}},"ip":312,"op":492,"st":312,"refId":"comp_1","h":29,"w":700},{"ind":200,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":301,"s":[0]},{"t":302,"s":[95]}]},"r":{"a":0,"k":-6},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":293,"op":473,"st":293,"refId":"comp_1","h":29,"w":700}]},{"id":"comp_1","layers":[{"ind":1,"ty":4,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":50,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":65,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":140,"s":[100]},{"t":179,"s":[0]}]},"r":{"a":0,"k":0},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[350]},{"t":179,"s":[606]}]},"y":{"a":0,"k":14.5}},"a":{"a":0,"k":[0,0,0]},"s":{"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[37,37,100]},{"t":15,"s":[48.061,48.061,100]}],"a":1}},"shapes":[{"ty":"gr","nm":"E","bm":0,"it":[{"ty":"el","nm":"E","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[9,9]}},{"ty":"gf","s":{"a":0,"k":[0,0]},"e":{"a":0,"k":[4,-1]},"t":2,"h":{"a":0,"k":0},"a":{"a":0,"k":0},"g":{"k":{"a":0,"k":[0,0.549,1,0.6,0.15,0.549,1,0.6,0.3,0.549,1,0.6,0.65,0.576,1,0.571,1,0.602,1,0.542,0,1,0.15,1,0.3,1,0.65,0.5,1,0]},"p":5},"nm":"G","bm":0,"o":{"a":0,"k":100},"r":1},{"ty":"tr","o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"nm":"T","sk":{"a":0,"k":0},"sa":{"a":0,"k":0}}]}],"ip":0,"op":181,"st":0}]}],"layers":[{"ind":1,"ty":0,"nm":"B","sr":1,"ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[150,150,0]},"s":{"a":0,"k":[100,100,100]}},"ip":-360,"op":360,"st":-360,"refId":"comp_0","h":300,"w":300},{"ind":2,"ty":0,"nm":"B","sr":1,"ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[150,150,0]},"s":{"a":0,"k":[100,100,100]}},"ip":360,"op":1080,"st":360,"refId":"comp_0","h":300,"w":300},{"ind":3,"ty":0,"nm":"B","sr":1,"ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[150,150,0]},"s":{"a":0,"k":[100,100,100]}},"ip":0,"op":720,"st":0,"refId":"comp_0","h":300,"w":300}],"markers":[]} \ No newline at end of file diff --git a/packages/kit/assets/animations/prime-banner-bg-light.json b/packages/kit/assets/animations/prime-banner-bg-light.json new file mode 100644 index 00000000000..8346552463e --- /dev/null +++ b/packages/kit/assets/animations/prime-banner-bg-light.json @@ -0,0 +1 @@ +{"v":"4.8.0","ip":0,"op":720,"fr":60,"w":300,"h":300,"nm":"B","assets":[{"id":"comp_0","layers":[{"ind":1,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":403,"s":[0]},{"t":404,"s":[21]}]},"r":{"a":0,"k":118},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[56,56,100]}},"ip":394,"op":574,"st":394,"refId":"comp_1","h":29,"w":700},{"ind":2,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":163,"s":[0]},{"t":164,"s":[95]}]},"r":{"a":0,"k":161},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[37,37,100]}},"ip":158,"op":338,"st":158,"refId":"comp_1","h":29,"w":700},{"ind":3,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":549,"s":[0]},{"t":550,"s":[95]}]},"r":{"a":0,"k":239},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":542,"op":722,"st":542,"refId":"comp_1","h":29,"w":700},{"ind":4,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":518,"s":[0]},{"t":519,"s":[47]}]},"r":{"a":0,"k":307},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[48,48,100]}},"ip":513,"op":693,"st":513,"refId":"comp_1","h":29,"w":700},{"ind":5,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":376,"s":[0]},{"t":377,"s":[95]}]},"r":{"a":0,"k":-48},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":368,"op":548,"st":368,"refId":"comp_1","h":29,"w":700},{"ind":6,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":297,"s":[0]},{"t":298,"s":[93]}]},"r":{"a":0,"k":-5},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[22,22,100]}},"ip":293,"op":473,"st":293,"refId":"comp_1","h":29,"w":700},{"ind":7,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":367,"s":[0]},{"t":368,"s":[45]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":361,"op":541,"st":361,"refId":"comp_1","h":29,"w":700},{"ind":8,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":443,"s":[0]},{"t":444,"s":[95]}]},"r":{"a":0,"k":141},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[60,60,100]}},"ip":439,"op":619,"st":439,"refId":"comp_1","h":29,"w":700},{"ind":9,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":265,"s":[0]},{"t":266,"s":[35]}]},"r":{"a":0,"k":35},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[81,81,100]}},"ip":256,"op":436,"st":256,"refId":"comp_1","h":29,"w":700},{"ind":10,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":78},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[62,62,100]}},"ip":306,"op":486,"st":306,"refId":"comp_1","h":29,"w":700},{"ind":11,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":487,"s":[0]},{"t":488,"s":[51]}]},"r":{"a":0,"k":156},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":480,"op":660,"st":480,"refId":"comp_1","h":29,"w":700},{"ind":12,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":155,"s":[0]},{"t":156,"s":[95]}]},"r":{"a":0,"k":224},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[73,73,100]}},"ip":150,"op":330,"st":150,"refId":"comp_1","h":29,"w":700},{"ind":13,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":476,"s":[0]},{"t":477,"s":[95]}]},"r":{"a":0,"k":-131},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":468,"op":648,"st":468,"refId":"comp_1","h":29,"w":700},{"ind":14,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":176,"s":[0]},{"t":177,"s":[95]}]},"r":{"a":0,"k":-88},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[47,47,100]}},"ip":172,"op":352,"st":172,"refId":"comp_1","h":29,"w":700},{"ind":15,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":396,"s":[0]},{"t":397,"s":[95]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":390,"op":570,"st":390,"refId":"comp_1","h":29,"w":700},{"ind":16,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":58},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[85,85,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":17,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[26]}]},"r":{"a":0,"k":118},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[91,91,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":18,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":393,"s":[0]},{"t":394,"s":[100]}]},"r":{"a":0,"k":161},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":388,"op":568,"st":388,"refId":"comp_1","h":29,"w":700},{"ind":19,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":206,"s":[0]},{"t":207,"s":[100]}]},"r":{"a":0,"k":239},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":199,"op":379,"st":199,"refId":"comp_1","h":29,"w":700},{"ind":20,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":407,"s":[0]},{"t":408,"s":[52]}]},"r":{"a":0,"k":307},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[83,83,100]}},"ip":402,"op":582,"st":402,"refId":"comp_1","h":29,"w":700},{"ind":21,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":385,"s":[0]},{"t":386,"s":[100]}]},"r":{"a":0,"k":-48},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":377,"op":557,"st":377,"refId":"comp_1","h":29,"w":700},{"ind":22,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":223,"s":[0]},{"t":224,"s":[98]}]},"r":{"a":0,"k":-5},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[57,57,100]}},"ip":219,"op":399,"st":219,"refId":"comp_1","h":29,"w":700},{"ind":23,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[50]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":305,"op":485,"st":305,"refId":"comp_1","h":29,"w":700},{"ind":24,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":474,"s":[0]},{"t":475,"s":[100]}]},"r":{"a":0,"k":141},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[95,95,100]}},"ip":470,"op":650,"st":470,"refId":"comp_1","h":29,"w":700},{"ind":25,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[40]}]},"r":{"a":0,"k":35},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[116,116,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":26,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":290,"s":[0]},{"t":291,"s":[100]}]},"r":{"a":0,"k":92},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":285,"op":465,"st":285,"refId":"comp_1","h":29,"w":700},{"ind":27,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":377,"s":[0]},{"t":378,"s":[56]}]},"r":{"a":0,"k":156},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":370,"op":550,"st":370,"refId":"comp_1","h":29,"w":700},{"ind":28,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":384,"s":[0]},{"t":385,"s":[100]}]},"r":{"a":0,"k":224},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[108,108,100]}},"ip":379,"op":559,"st":379,"refId":"comp_1","h":29,"w":700},{"ind":29,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[100]}]},"r":{"a":0,"k":-131},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":303,"op":483,"st":303,"refId":"comp_1","h":29,"w":700},{"ind":30,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":572,"s":[0]},{"t":573,"s":[100]}]},"r":{"a":0,"k":-88},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[82,82,100]}},"ip":568,"op":748,"st":568,"refId":"comp_1","h":29,"w":700},{"ind":31,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[100]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":305,"op":485,"st":305,"refId":"comp_1","h":29,"w":700},{"ind":32,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":510,"s":[0]},{"t":511,"s":[100]}]},"r":{"a":0,"k":58},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[120,120,100]}},"ip":506,"op":686,"st":506,"refId":"comp_1","h":29,"w":700},{"ind":33,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":384,"s":[0]},{"t":385,"s":[100]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":380,"op":560,"st":380,"refId":"comp_1","h":29,"w":700},{"ind":34,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[21]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[36,36,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":35,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":486,"s":[0]},{"t":487,"s":[95]}]},"r":{"a":0,"k":116},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[17,17,100]}},"ip":481,"op":661,"st":481,"refId":"comp_1","h":29,"w":700},{"ind":36,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":235,"s":[0]},{"t":236,"s":[95]}]},"r":{"a":0,"k":194},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":228,"op":408,"st":228,"refId":"comp_1","h":29,"w":700},{"ind":37,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":466,"s":[0]},{"t":467,"s":[47]}]},"r":{"a":0,"k":262},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[28,28,100]}},"ip":461,"op":641,"st":461,"refId":"comp_1","h":29,"w":700},{"ind":38,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":-93},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":39,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":458,"s":[0]},{"t":459,"s":[93]}]},"r":{"a":0,"k":-50},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[2,2,100]}},"ip":454,"op":634,"st":454,"refId":"comp_1","h":29,"w":700},{"ind":40,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":398,"s":[0]},{"t":399,"s":[45]}]},"r":{"a":0,"k":28},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":392,"op":572,"st":392,"refId":"comp_1","h":29,"w":700},{"ind":41,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":284,"s":[0]},{"t":285,"s":[95]}]},"r":{"a":0,"k":96},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[40,40,100]}},"ip":280,"op":460,"st":280,"refId":"comp_1","h":29,"w":700},{"ind":42,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":411,"s":[0]},{"t":412,"s":[35]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[61,61,100]}},"ip":402,"op":582,"st":402,"refId":"comp_1","h":29,"w":700},{"ind":43,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":396,"s":[0]},{"t":397,"s":[95]}]},"r":{"a":0,"k":33},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[42,42,100]}},"ip":391,"op":571,"st":391,"refId":"comp_1","h":29,"w":700},{"ind":44,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[51]}]},"r":{"a":0,"k":111},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":304,"op":484,"st":304,"refId":"comp_1","h":29,"w":700},{"ind":45,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":495,"s":[0]},{"t":496,"s":[95]}]},"r":{"a":0,"k":179},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[53,53,100]}},"ip":490,"op":670,"st":490,"refId":"comp_1","h":29,"w":700},{"ind":46,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":419,"s":[0]},{"t":420,"s":[95]}]},"r":{"a":0,"k":-176},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":411,"op":591,"st":411,"refId":"comp_1","h":29,"w":700},{"ind":47,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":469,"s":[0]},{"t":470,"s":[95]}]},"r":{"a":0,"k":-133},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[27,27,100]}},"ip":465,"op":645,"st":465,"refId":"comp_1","h":29,"w":700},{"ind":48,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":-55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":305,"op":485,"st":305,"refId":"comp_1","h":29,"w":700},{"ind":49,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":335,"s":[0]},{"t":336,"s":[95]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":331,"op":511,"st":331,"refId":"comp_1","h":29,"w":700},{"ind":50,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":382,"s":[0]},{"t":383,"s":[26]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[71,71,100]}},"ip":373,"op":553,"st":373,"refId":"comp_1","h":29,"w":700},{"ind":51,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":357,"s":[0]},{"t":358,"s":[100]}]},"r":{"a":0,"k":116},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":352,"op":532,"st":352,"refId":"comp_1","h":29,"w":700},{"ind":52,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":469,"s":[0]},{"t":470,"s":[100]}]},"r":{"a":0,"k":194},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":462,"op":642,"st":462,"refId":"comp_1","h":29,"w":700},{"ind":53,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":350,"s":[0]},{"t":351,"s":[52]}]},"r":{"a":0,"k":262},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[63,63,100]}},"ip":345,"op":525,"st":345,"refId":"comp_1","h":29,"w":700},{"ind":54,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":182,"s":[0]},{"t":183,"s":[100]}]},"r":{"a":0,"k":-84},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":174,"op":354,"st":174,"refId":"comp_1","h":29,"w":700},{"ind":55,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":350,"s":[0]},{"t":351,"s":[98]}]},"r":{"a":0,"k":-50},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[37,37,100]}},"ip":346,"op":526,"st":346,"refId":"comp_1","h":29,"w":700},{"ind":56,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":536,"s":[0]},{"t":537,"s":[50]}]},"r":{"a":0,"k":28},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":530,"op":710,"st":530,"refId":"comp_1","h":29,"w":700},{"ind":57,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":378,"s":[0]},{"t":379,"s":[100]}]},"r":{"a":0,"k":96},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[75,75,100]}},"ip":374,"op":554,"st":374,"refId":"comp_1","h":29,"w":700},{"ind":58,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":581,"s":[0]},{"t":582,"s":[40]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[96,96,100]}},"ip":572,"op":752,"st":572,"refId":"comp_1","h":29,"w":700},{"ind":59,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":404,"s":[0]},{"t":405,"s":[100]}]},"r":{"a":0,"k":33},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":399,"op":579,"st":399,"refId":"comp_1","h":29,"w":700},{"ind":60,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[56]}]},"r":{"a":0,"k":111},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":304,"op":484,"st":304,"refId":"comp_1","h":29,"w":700},{"ind":61,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":405,"s":[0]},{"t":406,"s":[100]}]},"r":{"a":0,"k":179},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[88,88,100]}},"ip":400,"op":580,"st":400,"refId":"comp_1","h":29,"w":700},{"ind":62,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":417,"s":[0]},{"t":418,"s":[100]}]},"r":{"a":0,"k":-176},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":409,"op":589,"st":409,"refId":"comp_1","h":29,"w":700},{"ind":63,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[100]}]},"r":{"a":0,"k":-133},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[62,62,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":64,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":520,"s":[0]},{"t":521,"s":[100]}]},"r":{"a":0,"k":-55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":514,"op":694,"st":514,"refId":"comp_1","h":29,"w":700},{"ind":65,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":433,"s":[0]},{"t":434,"s":[100]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[100,100,100]}},"ip":429,"op":609,"st":429,"refId":"comp_1","h":29,"w":700},{"ind":66,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[21]}]},"r":{"a":0,"k":118},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[56,56,100]}},"ip":127,"op":307,"st":127,"refId":"comp_1","h":29,"w":700},{"ind":67,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":283,"s":[0]},{"t":284,"s":[95]}]},"r":{"a":0,"k":161},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[37,37,100]}},"ip":278,"op":458,"st":278,"refId":"comp_1","h":29,"w":700},{"ind":68,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":212,"s":[0]},{"t":213,"s":[95]}]},"r":{"a":0,"k":239},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":205,"op":385,"st":205,"refId":"comp_1","h":29,"w":700},{"ind":69,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":317,"s":[0]},{"t":318,"s":[47]}]},"r":{"a":0,"k":307},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[48,48,100]}},"ip":312,"op":492,"st":312,"refId":"comp_1","h":29,"w":700},{"ind":70,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":301,"s":[0]},{"t":302,"s":[95]}]},"r":{"a":0,"k":-48},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":293,"op":473,"st":293,"refId":"comp_1","h":29,"w":700},{"ind":71,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":226,"s":[0]},{"t":227,"s":[93]}]},"r":{"a":0,"k":-5},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[22,22,100]}},"ip":222,"op":402,"st":222,"refId":"comp_1","h":29,"w":700},{"ind":72,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":409,"s":[0]},{"t":410,"s":[45]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":403,"op":583,"st":403,"refId":"comp_1","h":29,"w":700},{"ind":73,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[95]}]},"r":{"a":0,"k":141},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[60,60,100]}},"ip":132,"op":312,"st":132,"refId":"comp_1","h":29,"w":700},{"ind":74,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":191,"s":[0]},{"t":192,"s":[35]}]},"r":{"a":0,"k":35},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[81,81,100]}},"ip":182,"op":362,"st":182,"refId":"comp_1","h":29,"w":700},{"ind":75,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":222,"s":[0]},{"t":223,"s":[95]}]},"r":{"a":0,"k":78},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[62,62,100]}},"ip":217,"op":397,"st":217,"refId":"comp_1","h":29,"w":700},{"ind":76,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":251,"s":[0]},{"t":252,"s":[51]}]},"r":{"a":0,"k":156},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":244,"op":424,"st":244,"refId":"comp_1","h":29,"w":700},{"ind":77,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":360,"s":[0]},{"t":361,"s":[95]}]},"r":{"a":0,"k":224},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[73,73,100]}},"ip":355,"op":535,"st":355,"refId":"comp_1","h":29,"w":700},{"ind":78,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":245,"s":[0]},{"t":246,"s":[95]}]},"r":{"a":0,"k":-131},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":237,"op":417,"st":237,"refId":"comp_1","h":29,"w":700},{"ind":79,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":363,"s":[0]},{"t":364,"s":[95]}]},"r":{"a":0,"k":-88},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[47,47,100]}},"ip":359,"op":539,"st":359,"refId":"comp_1","h":29,"w":700},{"ind":80,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":221,"s":[0]},{"t":222,"s":[95]}]},"r":{"a":0,"k":1},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":215,"op":395,"st":215,"refId":"comp_1","h":29,"w":700},{"ind":81,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[95]}]},"r":{"a":0,"k":58},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[85,85,100]}},"ip":132,"op":312,"st":132,"refId":"comp_1","h":29,"w":700},{"ind":82,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":483,"s":[0]},{"t":484,"s":[26]}]},"r":{"a":0,"k":118},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[91,91,100]}},"ip":474,"op":654,"st":474,"refId":"comp_1","h":29,"w":700},{"ind":83,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":218,"s":[0]},{"t":219,"s":[100]}]},"r":{"a":0,"k":161},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[72,72,100]}},"ip":213,"op":393,"st":213,"refId":"comp_1","h":29,"w":700},{"ind":84,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":441,"s":[0]},{"t":442,"s":[100]}]},"r":{"a":0,"k":239},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":434,"op":614,"st":434,"refId":"comp_1","h":29,"w":700},{"ind":85,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[52]}]},"r":{"a":0,"k":216},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[83,83,100]}},"ip":131,"op":311,"st":131,"refId":"comp_1","h":29,"w":700},{"ind":86,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":210,"s":[0]},{"t":211,"s":[100]}]},"r":{"a":0,"k":-48},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":202,"op":382,"st":202,"refId":"comp_1","h":29,"w":700},{"ind":87,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":5,"s":[0]},{"t":6,"s":[98]}]},"r":{"a":0,"k":-5},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[57,57,100]}},"ip":1,"op":181,"st":1,"refId":"comp_1","h":29,"w":700},{"ind":88,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":46,"s":[0]},{"t":47,"s":[50]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[107,107,100]}},"ip":40,"op":220,"st":40,"refId":"comp_1","h":29,"w":700},{"ind":89,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":226,"s":[0]},{"t":227,"s":[100]}]},"r":{"a":0,"k":141},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[95,95,100]}},"ip":222,"op":402,"st":222,"refId":"comp_1","h":29,"w":700},{"ind":90,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":68,"s":[0]},{"t":69,"s":[40]}]},"r":{"a":0,"k":35},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[116,116,100]}},"ip":59,"op":239,"st":59,"refId":"comp_1","h":29,"w":700},{"ind":91,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":282,"s":[0]},{"t":283,"s":[100]}]},"r":{"a":0,"k":-32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[97,97,100]}},"ip":277,"op":457,"st":277,"refId":"comp_1","h":29,"w":700},{"ind":92,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":450,"s":[0]},{"t":451,"s":[56]}]},"r":{"a":0,"k":156},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":443,"op":623,"st":443,"refId":"comp_1","h":29,"w":700},{"ind":93,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":327,"s":[0]},{"t":328,"s":[100]}]},"r":{"a":0,"k":224},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[108,108,100]}},"ip":322,"op":502,"st":322,"refId":"comp_1","h":29,"w":700},{"ind":94,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":59,"s":[0]},{"t":60,"s":[100]}]},"r":{"a":0,"k":-131},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":51,"op":231,"st":51,"refId":"comp_1","h":29,"w":700},{"ind":95,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":324,"s":[0]},{"t":325,"s":[100]}]},"r":{"a":0,"k":-88},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[82,82,100]}},"ip":320,"op":500,"st":320,"refId":"comp_1","h":29,"w":700},{"ind":96,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":96,"s":[0]},{"t":97,"s":[100]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[132,132,100]}},"ip":90,"op":270,"st":90,"refId":"comp_1","h":29,"w":700},{"ind":97,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":288,"s":[0]},{"t":289,"s":[100]}]},"r":{"a":0,"k":58},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[120,120,100]}},"ip":284,"op":464,"st":284,"refId":"comp_1","h":29,"w":700},{"ind":98,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":209,"s":[0]},{"t":210,"s":[100]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":205,"op":385,"st":205,"refId":"comp_1","h":29,"w":700},{"ind":99,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":348,"s":[0]},{"t":349,"s":[21]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[36,36,100]}},"ip":339,"op":519,"st":339,"refId":"comp_1","h":29,"w":700},{"ind":100,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":116},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[17,17,100]}},"ip":306,"op":486,"st":306,"refId":"comp_1","h":29,"w":700},{"ind":101,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":366,"s":[0]},{"t":367,"s":[95]}]},"r":{"a":0,"k":194},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":359,"op":539,"st":359,"refId":"comp_1","h":29,"w":700},{"ind":102,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":128,"s":[0]},{"t":129,"s":[47]}]},"r":{"a":0,"k":262},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[28,28,100]}},"ip":123,"op":303,"st":123,"refId":"comp_1","h":29,"w":700},{"ind":103,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":309,"s":[0]},{"t":310,"s":[95]}]},"r":{"a":0,"k":-93},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":305,"op":485,"st":305,"refId":"comp_1","h":29,"w":700},{"ind":104,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":276,"s":[0]},{"t":277,"s":[93]}]},"r":{"a":0,"k":-50},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[2,2,100]}},"ip":272,"op":452,"st":272,"refId":"comp_1","h":29,"w":700},{"ind":105,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":365,"s":[0]},{"t":366,"s":[45]}]},"r":{"a":0,"k":28},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":359,"op":539,"st":359,"refId":"comp_1","h":29,"w":700},{"ind":106,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":343,"s":[0]},{"t":344,"s":[95]}]},"r":{"a":0,"k":96},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[40,40,100]}},"ip":339,"op":519,"st":339,"refId":"comp_1","h":29,"w":700},{"ind":107,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":176,"s":[0]},{"t":177,"s":[35]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[61,61,100]}},"ip":167,"op":347,"st":167,"refId":"comp_1","h":29,"w":700},{"ind":108,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":221,"s":[0]},{"t":222,"s":[95]}]},"r":{"a":0,"k":33},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[42,42,100]}},"ip":216,"op":396,"st":216,"refId":"comp_1","h":29,"w":700},{"ind":109,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":488,"s":[0]},{"t":489,"s":[51]}]},"r":{"a":0,"k":111},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":481,"op":661,"st":481,"refId":"comp_1","h":29,"w":700},{"ind":110,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":320,"s":[0]},{"t":321,"s":[95]}]},"r":{"a":0,"k":179},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[53,53,100]}},"ip":315,"op":495,"st":315,"refId":"comp_1","h":29,"w":700},{"ind":111,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":244,"s":[0]},{"t":245,"s":[95]}]},"r":{"a":0,"k":-176},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":236,"op":416,"st":236,"refId":"comp_1","h":29,"w":700},{"ind":112,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":294,"s":[0]},{"t":295,"s":[95]}]},"r":{"a":0,"k":-133},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[27,27,100]}},"ip":290,"op":470,"st":290,"refId":"comp_1","h":29,"w":700},{"ind":113,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[95]}]},"r":{"a":0,"k":-55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":130,"op":310,"st":130,"refId":"comp_1","h":29,"w":700},{"ind":114,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":359,"s":[0]},{"t":360,"s":[95]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":355,"op":535,"st":355,"refId":"comp_1","h":29,"w":700},{"ind":115,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":207,"s":[0]},{"t":208,"s":[26]}]},"r":{"a":0,"k":73},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[71,71,100]}},"ip":198,"op":378,"st":198,"refId":"comp_1","h":29,"w":700},{"ind":116,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":182,"s":[0]},{"t":183,"s":[100]}]},"r":{"a":0,"k":116},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[52,52,100]}},"ip":177,"op":357,"st":177,"refId":"comp_1","h":29,"w":700},{"ind":117,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":294,"s":[0]},{"t":295,"s":[100]}]},"r":{"a":0,"k":194},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":287,"op":467,"st":287,"refId":"comp_1","h":29,"w":700},{"ind":118,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":175,"s":[0]},{"t":176,"s":[52]}]},"r":{"a":0,"k":262},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[63,63,100]}},"ip":170,"op":350,"st":170,"refId":"comp_1","h":29,"w":700},{"ind":119,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":106,"s":[0]},{"t":107,"s":[100]}]},"r":{"a":0,"k":-93},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":98,"op":278,"st":98,"refId":"comp_1","h":29,"w":700},{"ind":120,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":352,"s":[0]},{"t":353,"s":[98]}]},"r":{"a":0,"k":-50},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[37,37,100]}},"ip":348,"op":528,"st":348,"refId":"comp_1","h":29,"w":700},{"ind":121,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":361,"s":[0]},{"t":362,"s":[50]}]},"r":{"a":0,"k":28},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[87,87,100]}},"ip":355,"op":535,"st":355,"refId":"comp_1","h":29,"w":700},{"ind":122,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":203,"s":[0]},{"t":204,"s":[100]}]},"r":{"a":0,"k":96},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[75,75,100]}},"ip":199,"op":379,"st":199,"refId":"comp_1","h":29,"w":700},{"ind":123,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":247,"s":[0]},{"t":248,"s":[40]}]},"r":{"a":0,"k":-10},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[96,96,100]}},"ip":238,"op":418,"st":238,"refId":"comp_1","h":29,"w":700},{"ind":124,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":417,"s":[0]},{"t":418,"s":[100]}]},"r":{"a":0,"k":33},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[77,77,100]}},"ip":412,"op":592,"st":412,"refId":"comp_1","h":29,"w":700},{"ind":125,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[56]}]},"r":{"a":0,"k":111},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":129,"op":309,"st":129,"refId":"comp_1","h":29,"w":700},{"ind":126,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":351,"s":[0]},{"t":352,"s":[100]}]},"r":{"a":0,"k":179},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[88,88,100]}},"ip":346,"op":526,"st":346,"refId":"comp_1","h":29,"w":700},{"ind":127,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":107,"s":[0]},{"t":108,"s":[100]}]},"r":{"a":0,"k":-176},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":99,"op":279,"st":99,"refId":"comp_1","h":29,"w":700},{"ind":128,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[100]}]},"r":{"a":0,"k":-133},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[62,62,100]}},"ip":132,"op":312,"st":132,"refId":"comp_1","h":29,"w":700},{"ind":129,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":345,"s":[0]},{"t":346,"s":[100]}]},"r":{"a":0,"k":-55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[112,112,100]}},"ip":339,"op":519,"st":339,"refId":"comp_1","h":29,"w":700},{"ind":130,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":258,"s":[0]},{"t":259,"s":[100]}]},"r":{"a":0,"k":13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[100,100,100]}},"ip":254,"op":434,"st":254,"refId":"comp_1","h":29,"w":700},{"ind":131,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":403,"s":[0]},{"t":404,"s":[21]}]},"r":{"a":0,"k":160},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[14,14,100]}},"ip":394,"op":574,"st":394,"refId":"comp_1","h":29,"w":700},{"ind":132,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":163,"s":[0]},{"t":164,"s":[95]}]},"r":{"a":0,"k":203},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-5,-5,100]}},"ip":158,"op":338,"st":158,"refId":"comp_1","h":29,"w":700},{"ind":133,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":549,"s":[0]},{"t":550,"s":[95]}]},"r":{"a":0,"k":281},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":542,"op":722,"st":542,"refId":"comp_1","h":29,"w":700},{"ind":134,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":518,"s":[0]},{"t":519,"s":[47]}]},"r":{"a":0,"k":349},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[6,6,100]}},"ip":513,"op":693,"st":513,"refId":"comp_1","h":29,"w":700},{"ind":135,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":376,"s":[0]},{"t":377,"s":[95]}]},"r":{"a":0,"k":-6},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":368,"op":548,"st":368,"refId":"comp_1","h":29,"w":700},{"ind":136,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":297,"s":[0]},{"t":298,"s":[93]}]},"r":{"a":0,"k":37},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-20,-20,100]}},"ip":293,"op":473,"st":293,"refId":"comp_1","h":29,"w":700},{"ind":137,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":367,"s":[0]},{"t":368,"s":[45]}]},"r":{"a":0,"k":115},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":361,"op":541,"st":361,"refId":"comp_1","h":29,"w":700},{"ind":138,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":443,"s":[0]},{"t":444,"s":[95]}]},"r":{"a":0,"k":183},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[18,18,100]}},"ip":439,"op":619,"st":439,"refId":"comp_1","h":29,"w":700},{"ind":139,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":265,"s":[0]},{"t":266,"s":[35]}]},"r":{"a":0,"k":77},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[39,39,100]}},"ip":256,"op":436,"st":256,"refId":"comp_1","h":29,"w":700},{"ind":140,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":120},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[20,20,100]}},"ip":306,"op":486,"st":306,"refId":"comp_1","h":29,"w":700},{"ind":141,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":487,"s":[0]},{"t":488,"s":[51]}]},"r":{"a":0,"k":198},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[55,55,100]}},"ip":480,"op":660,"st":480,"refId":"comp_1","h":29,"w":700},{"ind":142,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":155,"s":[0]},{"t":156,"s":[95]}]},"r":{"a":0,"k":266},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[31,31,100]}},"ip":150,"op":330,"st":150,"refId":"comp_1","h":29,"w":700},{"ind":143,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":476,"s":[0]},{"t":477,"s":[95]}]},"r":{"a":0,"k":-89},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[55,55,100]}},"ip":468,"op":648,"st":468,"refId":"comp_1","h":29,"w":700},{"ind":144,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":176,"s":[0]},{"t":177,"s":[95]}]},"r":{"a":0,"k":-46},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[23,23,100]}},"ip":172,"op":352,"st":172,"refId":"comp_1","h":29,"w":700},{"ind":145,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":396,"s":[0]},{"t":397,"s":[95]}]},"r":{"a":0,"k":32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[55,55,100]}},"ip":390,"op":570,"st":390,"refId":"comp_1","h":29,"w":700},{"ind":146,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":100},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[43,43,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":147,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":90,"s":[0]},{"t":91,"s":[26]}]},"r":{"a":0,"k":160},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[49,49,100]}},"ip":81,"op":261,"st":81,"refId":"comp_1","h":29,"w":700},{"ind":148,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":393,"s":[0]},{"t":394,"s":[100]}]},"r":{"a":0,"k":203},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":388,"op":568,"st":388,"refId":"comp_1","h":29,"w":700},{"ind":149,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":206,"s":[0]},{"t":207,"s":[100]}]},"r":{"a":0,"k":281},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":199,"op":379,"st":199,"refId":"comp_1","h":29,"w":700},{"ind":150,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":407,"s":[0]},{"t":408,"s":[52]}]},"r":{"a":0,"k":349},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[41,41,100]}},"ip":402,"op":582,"st":402,"refId":"comp_1","h":29,"w":700},{"ind":151,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":385,"s":[0]},{"t":386,"s":[100]}]},"r":{"a":0,"k":-6},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":377,"op":557,"st":377,"refId":"comp_1","h":29,"w":700},{"ind":152,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":223,"s":[0]},{"t":224,"s":[98]}]},"r":{"a":0,"k":37},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[15,15,100]}},"ip":219,"op":399,"st":219,"refId":"comp_1","h":29,"w":700},{"ind":153,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":174,"s":[0]},{"t":175,"s":[50]}]},"r":{"a":0,"k":115},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[65,65,100]}},"ip":168,"op":348,"st":168,"refId":"comp_1","h":29,"w":700},{"ind":154,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":474,"s":[0]},{"t":475,"s":[100]}]},"r":{"a":0,"k":183},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[53,53,100]}},"ip":470,"op":650,"st":470,"refId":"comp_1","h":29,"w":700},{"ind":155,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[40]}]},"r":{"a":0,"k":77},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[74,74,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":156,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":132,"s":[0]},{"t":133,"s":[100]}]},"r":{"a":0,"k":120},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[55,55,100]}},"ip":127,"op":307,"st":127,"refId":"comp_1","h":29,"w":700},{"ind":157,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":377,"s":[0]},{"t":378,"s":[56]}]},"r":{"a":0,"k":198},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[90,90,100]}},"ip":370,"op":550,"st":370,"refId":"comp_1","h":29,"w":700},{"ind":158,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":36,"s":[0]},{"t":37,"s":[100]}]},"r":{"a":0,"k":266},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[66,66,100]}},"ip":31,"op":211,"st":31,"refId":"comp_1","h":29,"w":700},{"ind":159,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":157,"s":[0]},{"t":158,"s":[100]}]},"r":{"a":0,"k":-89},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[90,90,100]}},"ip":149,"op":329,"st":149,"refId":"comp_1","h":29,"w":700},{"ind":160,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":572,"s":[0]},{"t":573,"s":[100]}]},"r":{"a":0,"k":-46},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[40,40,100]}},"ip":568,"op":748,"st":568,"refId":"comp_1","h":29,"w":700},{"ind":161,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":282,"s":[0]},{"t":283,"s":[100]}]},"r":{"a":0,"k":32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[90,90,100]}},"ip":276,"op":456,"st":276,"refId":"comp_1","h":29,"w":700},{"ind":162,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":510,"s":[0]},{"t":511,"s":[100]}]},"r":{"a":0,"k":100},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[78,78,100]}},"ip":506,"op":686,"st":506,"refId":"comp_1","h":29,"w":700},{"ind":163,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":384,"s":[0]},{"t":385,"s":[100]}]},"r":{"a":0,"k":55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[70,70,100]}},"ip":380,"op":560,"st":380,"refId":"comp_1","h":29,"w":700},{"ind":164,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[21]}]},"r":{"a":0,"k":115},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-6,-6,100]}},"ip":302,"op":482,"st":302,"refId":"comp_1","h":29,"w":700},{"ind":165,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":486,"s":[0]},{"t":487,"s":[95]}]},"r":{"a":0,"k":158},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-25,-25,100]}},"ip":481,"op":661,"st":481,"refId":"comp_1","h":29,"w":700},{"ind":166,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":235,"s":[0]},{"t":236,"s":[95]}]},"r":{"a":0,"k":236},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[10,10,100]}},"ip":228,"op":408,"st":228,"refId":"comp_1","h":29,"w":700},{"ind":167,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":466,"s":[0]},{"t":467,"s":[47]}]},"r":{"a":0,"k":304},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-14,-14,100]}},"ip":461,"op":641,"st":461,"refId":"comp_1","h":29,"w":700},{"ind":168,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[95]}]},"r":{"a":0,"k":-51},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[10,10,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":169,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":458,"s":[0]},{"t":459,"s":[93]}]},"r":{"a":0,"k":-8},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-40,-40,100]}},"ip":454,"op":634,"st":454,"refId":"comp_1","h":29,"w":700},{"ind":170,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":398,"s":[0]},{"t":399,"s":[45]}]},"r":{"a":0,"k":70},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[10,10,100]}},"ip":392,"op":572,"st":392,"refId":"comp_1","h":29,"w":700},{"ind":171,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":284,"s":[0]},{"t":285,"s":[95]}]},"r":{"a":0,"k":138},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-2,-2,100]}},"ip":280,"op":460,"st":280,"refId":"comp_1","h":29,"w":700},{"ind":172,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":411,"s":[0]},{"t":412,"s":[35]}]},"r":{"a":0,"k":32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[19,19,100]}},"ip":402,"op":582,"st":402,"refId":"comp_1","h":29,"w":700},{"ind":173,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":396,"s":[0]},{"t":397,"s":[95]}]},"r":{"a":0,"k":75},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[0,0,100]}},"ip":391,"op":571,"st":391,"refId":"comp_1","h":29,"w":700},{"ind":174,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[51]}]},"r":{"a":0,"k":153},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[35,35,100]}},"ip":304,"op":484,"st":304,"refId":"comp_1","h":29,"w":700},{"ind":175,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":495,"s":[0]},{"t":496,"s":[95]}]},"r":{"a":0,"k":221},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[11,11,100]}},"ip":490,"op":670,"st":490,"refId":"comp_1","h":29,"w":700},{"ind":176,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":419,"s":[0]},{"t":420,"s":[95]}]},"r":{"a":0,"k":-134},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[35,35,100]}},"ip":411,"op":591,"st":411,"refId":"comp_1","h":29,"w":700},{"ind":177,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":469,"s":[0]},{"t":470,"s":[95]}]},"r":{"a":0,"k":-91},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-15,-15,100]}},"ip":465,"op":645,"st":465,"refId":"comp_1","h":29,"w":700},{"ind":178,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":128,"s":[0]},{"t":129,"s":[95]}]},"r":{"a":0,"k":-13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[35,35,100]}},"ip":122,"op":302,"st":122,"refId":"comp_1","h":29,"w":700},{"ind":179,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":335,"s":[0]},{"t":336,"s":[95]}]},"r":{"a":0,"k":55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[23,23,100]}},"ip":331,"op":511,"st":331,"refId":"comp_1","h":29,"w":700},{"ind":180,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":382,"s":[0]},{"t":383,"s":[26]}]},"r":{"a":0,"k":115},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[29,29,100]}},"ip":373,"op":553,"st":373,"refId":"comp_1","h":29,"w":700},{"ind":181,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":176,"s":[0]},{"t":177,"s":[100]}]},"r":{"a":0,"k":158},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[10,10,100]}},"ip":171,"op":351,"st":171,"refId":"comp_1","h":29,"w":700},{"ind":182,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":469,"s":[0]},{"t":470,"s":[100]}]},"r":{"a":0,"k":236},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[45,45,100]}},"ip":462,"op":642,"st":462,"refId":"comp_1","h":29,"w":700},{"ind":183,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":235,"s":[0]},{"t":236,"s":[52]}]},"r":{"a":0,"k":304},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[21,21,100]}},"ip":230,"op":410,"st":230,"refId":"comp_1","h":29,"w":700},{"ind":184,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":182,"s":[0]},{"t":183,"s":[100]}]},"r":{"a":0,"k":-51},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[45,45,100]}},"ip":174,"op":354,"st":174,"refId":"comp_1","h":29,"w":700},{"ind":185,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":350,"s":[0]},{"t":351,"s":[98]}]},"r":{"a":0,"k":-8},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-5,-5,100]}},"ip":346,"op":526,"st":346,"refId":"comp_1","h":29,"w":700},{"ind":186,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":536,"s":[0]},{"t":537,"s":[50]}]},"r":{"a":0,"k":70},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[45,45,100]}},"ip":530,"op":710,"st":530,"refId":"comp_1","h":29,"w":700},{"ind":187,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":378,"s":[0]},{"t":379,"s":[100]}]},"r":{"a":0,"k":138},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[33,33,100]}},"ip":374,"op":554,"st":374,"refId":"comp_1","h":29,"w":700},{"ind":188,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":581,"s":[0]},{"t":582,"s":[40]}]},"r":{"a":0,"k":32},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[54,54,100]}},"ip":572,"op":752,"st":572,"refId":"comp_1","h":29,"w":700},{"ind":189,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":404,"s":[0]},{"t":405,"s":[100]}]},"r":{"a":0,"k":75},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[35,35,100]}},"ip":399,"op":579,"st":399,"refId":"comp_1","h":29,"w":700},{"ind":190,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[56]}]},"r":{"a":0,"k":153},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[70,70,100]}},"ip":304,"op":484,"st":304,"refId":"comp_1","h":29,"w":700},{"ind":191,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":180,"s":[0]},{"t":181,"s":[100]}]},"r":{"a":0,"k":221},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[46,46,100]}},"ip":175,"op":355,"st":175,"refId":"comp_1","h":29,"w":700},{"ind":192,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":453,"s":[0]},{"t":454,"s":[100]}]},"r":{"a":0,"k":-134},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[70,70,100]}},"ip":445,"op":625,"st":445,"refId":"comp_1","h":29,"w":700},{"ind":193,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":311,"s":[0]},{"t":312,"s":[100]}]},"r":{"a":0,"k":-91},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[20,20,100]}},"ip":307,"op":487,"st":307,"refId":"comp_1","h":29,"w":700},{"ind":194,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":520,"s":[0]},{"t":521,"s":[100]}]},"r":{"a":0,"k":-13},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[70,70,100]}},"ip":514,"op":694,"st":514,"refId":"comp_1","h":29,"w":700},{"ind":195,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":433,"s":[0]},{"t":434,"s":[100]}]},"r":{"a":0,"k":55},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[58,58,100]}},"ip":429,"op":609,"st":429,"refId":"comp_1","h":29,"w":700},{"ind":196,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":136,"s":[0]},{"t":137,"s":[21]}]},"r":{"a":0,"k":160},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[14,14,100]}},"ip":127,"op":307,"st":127,"refId":"comp_1","h":29,"w":700},{"ind":197,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":283,"s":[0]},{"t":284,"s":[95]}]},"r":{"a":0,"k":203},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[-5,-5,100]}},"ip":278,"op":458,"st":278,"refId":"comp_1","h":29,"w":700},{"ind":198,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":212,"s":[0]},{"t":213,"s":[95]}]},"r":{"a":0,"k":281},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":205,"op":385,"st":205,"refId":"comp_1","h":29,"w":700},{"ind":199,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":317,"s":[0]},{"t":318,"s":[47]}]},"r":{"a":0,"k":349},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[6,6,100]}},"ip":312,"op":492,"st":312,"refId":"comp_1","h":29,"w":700},{"ind":200,"ty":0,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":301,"s":[0]},{"t":302,"s":[95]}]},"r":{"a":0,"k":-6},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[350,14.5,0]},"s":{"a":0,"k":[30,30,100]}},"ip":293,"op":473,"st":293,"refId":"comp_1","h":29,"w":700}]},{"id":"comp_1","layers":[{"ind":1,"ty":4,"nm":"P","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":50,"s":[0]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":65,"s":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":140,"s":[100]},{"t":179,"s":[0]}]},"r":{"a":0,"k":0},"p":{"s":true,"x":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[350]},{"t":179,"s":[606]}]},"y":{"a":0,"k":14.5}},"a":{"a":0,"k":[0,0,0]},"s":{"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":0,"s":[37,37,100]},{"t":15,"s":[48.061,48.061,100]}],"a":1}},"shapes":[{"ty":"gr","nm":"E","bm":0,"it":[{"ty":"el","nm":"E","d":1,"p":{"a":0,"k":[0,0]},"s":{"a":0,"k":[19,19]}},{"ty":"gf","s":{"a":0,"k":[0,0]},"e":{"a":0,"k":[5.617,-1.263]},"t":2,"h":{"a":0,"k":0},"a":{"a":0,"k":0},"g":{"k":{"a":0,"k":[0.377,1,1,1,0.567,0.5,0.892,0.544,0.758,0,0.783,0.089,0.879,0.051,0.781,0.044,1,0.102,0.779,0,0,1,0.115,1,0.23,1,0.615,0.5,1,0]},"p":5},"nm":"G","bm":0,"o":{"a":0,"k":100},"r":1},{"ty":"tr","o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[0,0]},"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"nm":"T","sk":{"a":0,"k":0},"sa":{"a":0,"k":0}}]}],"ip":0,"op":181,"st":0}]}],"layers":[{"ind":1,"ty":0,"nm":"B","sr":1,"ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[150,150,0]},"s":{"a":0,"k":[100,100,100]}},"ip":-360,"op":360,"st":-360,"refId":"comp_0","h":300,"w":300},{"ind":2,"ty":0,"nm":"B","sr":1,"ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[150,150,0]},"s":{"a":0,"k":[100,100,100]}},"ip":360,"op":1080,"st":360,"refId":"comp_0","h":300,"w":300},{"ind":3,"ty":0,"nm":"B","sr":1,"ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[150,150,0]},"a":{"a":0,"k":[150,150,0]},"s":{"a":0,"k":[100,100,100]}},"ip":0,"op":720,"st":0,"refId":"comp_0","h":300,"w":300}],"markers":[]} \ No newline at end of file diff --git a/packages/kit/package.json b/packages/kit/package.json index befa7a3adaa..9d06ac10130 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -21,7 +21,6 @@ "react-redux": "^8.0.5", "redux-logger": "^3.0.6", "redux-persist": "^6.0.0", - "socket.io-client": "^4.5.4", "swr": "^2.1.5", "url-parse": "^1.5.10", "use-debounce": "^9.0.4", diff --git a/packages/kit/src/components/Captcha/Captcha.tsx b/packages/kit/src/components/Captcha/Captcha.tsx new file mode 100644 index 00000000000..2c480008943 --- /dev/null +++ b/packages/kit/src/components/Captcha/Captcha.tsx @@ -0,0 +1,3 @@ +export function Captcha() { + return <>; +} diff --git a/packages/kit/src/components/Captcha/index.tsx b/packages/kit/src/components/Captcha/index.tsx new file mode 100644 index 00000000000..898b4a3b692 --- /dev/null +++ b/packages/kit/src/components/Captcha/index.tsx @@ -0,0 +1 @@ +export * from './Captcha'; diff --git a/packages/kit/src/components/ErrorBoundary/index.tsx b/packages/kit/src/components/ErrorBoundary/index.tsx index 69054354da5..8df25c0578e 100644 --- a/packages/kit/src/components/ErrorBoundary/index.tsx +++ b/packages/kit/src/components/ErrorBoundary/index.tsx @@ -2,6 +2,8 @@ // eslint-disable-next-line max-classes-per-file import { PureComponent } from 'react'; +import { SafeAreaView, Text } from 'react-native'; + type IErrorBoundaryProps = { children: React.ReactNode; onError?: (error: Error, componentStack: string | null) => void; @@ -32,4 +34,38 @@ class ErrorBoundaryBase extends PureComponent< } } -export { ErrorBoundaryBase }; +class ErrorBoundarySimple extends ErrorBoundaryBase { + override render() { + if (this.state.error) { + return ( + + {this.state.error.message} + + ); + } + return this.props.children; + } +} + +function SentryErrorBoundaryFallback({ + error, + componentStack, + eventId, + resetError, +}: { + error: unknown; + componentStack: string; + eventId: string; + resetError(): void; +}) { + return ( + + + {(error as Error | undefined)?.message || + 'unknown error by error boundary'} + + + ); +} + +export { ErrorBoundaryBase, ErrorBoundarySimple, SentryErrorBoundaryFallback }; diff --git a/packages/kit/src/components/TabPageHeader/HeaderRight.tsx b/packages/kit/src/components/TabPageHeader/HeaderRight.tsx index 16d98bd70b5..43edb712223 100644 --- a/packages/kit/src/components/TabPageHeader/HeaderRight.tsx +++ b/packages/kit/src/components/TabPageHeader/HeaderRight.tsx @@ -37,6 +37,7 @@ import { EAccountSelectorSceneName } from '@onekeyhq/shared/types'; import backgroundApiProxy from '../../background/instance/backgroundApiProxy'; import useAppNavigation from '../../hooks/useAppNavigation'; import { UrlAccountNavHeader } from '../../views/Home/pages/urlAccount/UrlAccountNavHeader'; +import { PrimeHeaderIconButton } from '../../views/Prime/components/PrimeHeaderIconButton'; import useScanQrCode from '../../views/ScanQrCode/hooks/useScanQrCode'; import { UniversalSearchInput } from './UniversalSearchInput'; @@ -170,6 +171,10 @@ export function HeaderRight({ onPress={onScanButtonPressed} /> ); + const primeButton = + devSettings?.enabled && devSettings?.settings?.showPrimeTest ? ( + + ) : null; let notificationsButton: ReactNode | null = ( ; }) { const webviewRef = useRef(null); const onWebViewRef = useCallback(($ref: IWebViewWrapperRef | null) => { @@ -27,27 +37,53 @@ export function WebViewWebEmbed({ const [top, setTop] = useState(initTop); const [minimized, setMinimized] = useState(false); const config = useMemo(() => webEmbedConfig.getWebEmbedConfig(), []); + const themeVariant = useThemeVariant(); + const localeVariant = useLocaleVariant(); + const [devSettingsPersistAtom] = useDevSettingsPersistAtom(); + + const [revenuecatApiKey, setRevenuecatApiKey] = useState(''); + useEffect(() => { - if (!platformEnv.isNative) { - return; + async function getApiKey() { + const devSettings = + await backgroundApiProxy.serviceDevSetting.getDevSetting(); + let apiKey = process.env.REVENUECAT_API_KEY_WEB; + if (devSettings?.settings?.usePrimeSandboxPayment) { + apiKey = process.env.REVENUECAT_API_KEY_WEB_SANDBOX; + } + if (!apiKey) { + throw new Error('No REVENUECAT api key found'); + } + setRevenuecatApiKey(apiKey); } - const jsBridge = webviewRef?.current?.jsBridge; - if (!jsBridge) { - return; + void getApiKey(); + }, []); + + const webEmbedAppSettings = useMemo< + IWebEmbedOnekeyAppSettings | undefined + >(() => { + if (!themeVariant || !localeVariant || !revenuecatApiKey) { + return undefined; } - jsBridge.globalOnMessageEnabled = true; - backgroundApiProxy.connectWebEmbedBridge( - jsBridge as unknown as JsBridgeBase, - ); - }, [webviewRef]); + return { + themeVariant, + localeVariant, + revenuecatApiKey, + }; + }, [themeVariant, localeVariant, revenuecatApiKey]); + const remoteUrl = useMemo(() => { - if (process.env.NODE_ENV !== 'production') { + if ( + process.env.NODE_ENV !== 'production' || + devSettingsPersistAtom.enabled + ) { if (config?.url) { return config?.url; } } return undefined; - }, [config?.url]); + }, [config?.url, devSettingsPersistAtom.enabled]); + const nativeWebviewSource = useMemo(() => { if (remoteUrl) { return undefined; @@ -67,8 +103,16 @@ export function WebViewWebEmbed({ return undefined; }, [remoteUrl]); - const webview = useMemo( - () => ( + const webview = useMemo(() => { + if (!webEmbedAppSettings) { + return null; + } + const fullHash = uriUtils.buildUrl({ + path: hashRoutePath, + query: hashRouteQueryParams, + }); + console.log('WebViewWebEmbed fullHash', hashRoutePath, fullHash); + return ( - ), - [customReceiveHandler, nativeWebviewSource, onWebViewRef, remoteUrl], - ); + ); + }, [ + customReceiveHandler, + hashRoutePath, + hashRouteQueryParams, + nativeWebviewSource, + onWebViewRef, + remoteUrl, + webEmbedAppSettings, + ]); + + useEffect(() => { + if (!platformEnv.isNative) { + return; + } + const jsBridge = webviewRef?.current?.jsBridge; + if (!jsBridge) { + return; + } + if (!webview) { + return; + } + if (!webEmbedAppSettings) { + return; + } + jsBridge.globalOnMessageEnabled = true; + backgroundApiProxy.connectWebEmbedBridge( + jsBridge as unknown as JsBridgeBase, + ); + }, [webviewRef, webview, webEmbedAppSettings]); const webviewUrlOrUri = useMemo(() => { if (remoteUrl) { @@ -88,6 +167,11 @@ export function WebViewWebEmbed({ return nativeWebviewSource?.uri || ''; }, [nativeWebviewSource?.uri, remoteUrl]); + if (config) { + // TODO remove + config.debug = true; + } + const debugViewSize = useMemo(() => { if (config?.debug) { if (minimized) { @@ -143,7 +227,12 @@ export function WebViewWebEmbed({ } function WebViewWebEmbedSingletonView() { - return ; + return ( + + ); } export const WebViewWebEmbedSingleton = memo(WebViewWebEmbedSingletonView); diff --git a/packages/kit/src/provider/Container/DialogLoadingContainer/DialogLoadingContainer.tsx b/packages/kit/src/provider/Container/DialogLoadingContainer/DialogLoadingContainer.tsx new file mode 100644 index 00000000000..8ce93e7c624 --- /dev/null +++ b/packages/kit/src/provider/Container/DialogLoadingContainer/DialogLoadingContainer.tsx @@ -0,0 +1,31 @@ +import { useEffect, useRef } from 'react'; + +import type { IDialogInstance } from '@onekeyhq/components'; +import { Dialog } from '@onekeyhq/components'; +import type { IAppEventBusPayload } from '@onekeyhq/shared/src/eventBus/appEventBus'; +import { + EAppEventBusNames, + appEventBus, +} from '@onekeyhq/shared/src/eventBus/appEventBus'; + +export function DialogLoadingContainer() { + const dialogRef = useRef(null); + useEffect(() => { + const hideFn = async () => { + await dialogRef.current?.close(); + }; + const showFn = async ( + payload: IAppEventBusPayload[EAppEventBusNames.ShowDialogLoading], + ) => { + await hideFn(); + dialogRef.current = Dialog.loading(payload); + }; + appEventBus.on(EAppEventBusNames.ShowDialogLoading, showFn); + appEventBus.on(EAppEventBusNames.HideDialogLoading, hideFn); + return () => { + appEventBus.off(EAppEventBusNames.ShowDialogLoading, showFn); + appEventBus.off(EAppEventBusNames.HideDialogLoading, hideFn); + }; + }, []); + return null; +} diff --git a/packages/kit/src/provider/Container/DialogLoadingContainer/index.tsx b/packages/kit/src/provider/Container/DialogLoadingContainer/index.tsx new file mode 100644 index 00000000000..55992ce2e38 --- /dev/null +++ b/packages/kit/src/provider/Container/DialogLoadingContainer/index.tsx @@ -0,0 +1 @@ +export * from './DialogLoadingContainer'; diff --git a/packages/kit/src/provider/Container/PrimeLoginContainer/PrimeLoginContainer.tsx b/packages/kit/src/provider/Container/PrimeLoginContainer/PrimeLoginContainer.tsx new file mode 100644 index 00000000000..f8781679e19 --- /dev/null +++ b/packages/kit/src/provider/Container/PrimeLoginContainer/PrimeLoginContainer.tsx @@ -0,0 +1,100 @@ +import { useEffect, useRef } from 'react'; + +import type { IDialogInstance } from '@onekeyhq/components'; +import { Dialog } from '@onekeyhq/components'; +import type { IPrimeLoginDialogAtomPasswordData } from '@onekeyhq/kit-bg/src/states/jotai/atoms'; +import { usePrimeLoginDialogAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms'; + +import backgroundApiProxy from '../../../background/instance/backgroundApiProxy'; +import { PrimeLoginEmailCodeDialog } from '../../../views/Prime/components/PrimeLoginEmailCodeDialog'; +import { PrimeLoginEmailDialog } from '../../../views/Prime/components/PrimeLoginEmailDialog'; +import { PrimeLoginPasswordDialog } from '../../../views/Prime/components/PrimeLoginPasswordDialog'; + +export function PrimeLoginContainer() { + const [ + { + promptPrimeLoginEmailDialog, + promptPrimeLoginPasswordDialog, + promptPrimeLoginEmailCodeDialog, + }, + ] = usePrimeLoginDialogAtom(); + + const passwordDataRef = useRef( + undefined, + ); + passwordDataRef.current = promptPrimeLoginPasswordDialog; + + const emailDialogRef = useRef(undefined); + const passwordDialogRef = useRef(undefined); + const emailCodeDialogRef = useRef(undefined); + + useEffect(() => { + void (async () => { + if (promptPrimeLoginEmailDialog) { + await emailDialogRef.current?.close(); + emailDialogRef.current = Dialog.show({ + renderContent: ( + + ), + onClose: async () => { + await backgroundApiProxy.servicePrime.cancelPrimeLogin({ + promiseId: promptPrimeLoginEmailDialog, + dialogType: 'promptPrimeLoginEmailDialog', + }); + }, + }); + } else { + await emailDialogRef.current?.close(); + } + })(); + }, [promptPrimeLoginEmailDialog]); + + useEffect(() => { + void (async () => { + if (promptPrimeLoginPasswordDialog?.promiseId) { + await passwordDialogRef.current?.close(); + passwordDialogRef.current = Dialog.show({ + renderContent: ( + + ), + onClose: async () => { + await backgroundApiProxy.servicePrime.cancelPrimeLogin({ + promiseId: promptPrimeLoginPasswordDialog?.promiseId, + dialogType: 'promptPrimeLoginPasswordDialog', + }); + }, + }); + } else { + await passwordDialogRef.current?.close(); + } + })(); + }, [promptPrimeLoginPasswordDialog?.promiseId]); + + useEffect(() => { + void (async () => { + if (promptPrimeLoginEmailCodeDialog?.promiseId) { + await emailCodeDialogRef.current?.close(); + emailCodeDialogRef.current = Dialog.show({ + renderContent: ( + + ), + onClose: async () => { + await backgroundApiProxy.servicePrime.cancelPrimeLogin({ + promiseId: promptPrimeLoginEmailCodeDialog?.promiseId, + dialogType: 'promptPrimeLoginEmailCodeDialog', + }); + }, + }); + } else { + await emailCodeDialogRef.current?.close(); + } + })(); + }, [promptPrimeLoginEmailCodeDialog?.promiseId]); + + return null; +} diff --git a/packages/kit/src/provider/Container/PrimeLoginContainer/index.tsx b/packages/kit/src/provider/Container/PrimeLoginContainer/index.tsx new file mode 100644 index 00000000000..a67c216ad03 --- /dev/null +++ b/packages/kit/src/provider/Container/PrimeLoginContainer/index.tsx @@ -0,0 +1 @@ +export * from './PrimeLoginContainer'; diff --git a/packages/kit/src/provider/Container/index.tsx b/packages/kit/src/provider/Container/index.tsx index 56b67c99189..1c9c45997c9 100644 --- a/packages/kit/src/provider/Container/index.tsx +++ b/packages/kit/src/provider/Container/index.tsx @@ -15,6 +15,7 @@ import { AirGapQrcodeDialogContainer } from './AirGapQrcodeDialogContainer'; import { AppStateLockContainer } from './AppStateLockContainer'; import { CloudBackupContainer } from './CloudBackupContainer'; import { CreateAddressContainer } from './CreateAddressContainer'; +import { DialogLoadingContainer } from './DialogLoadingContainer'; import { ErrorToastContainer } from './ErrorToastContainer'; import { FlipperPluginsContainer } from './FlipperPluginsContainer'; import { ForceFirmwareUpdateContainer } from './ForceFirmwareUpdateContainer'; @@ -24,6 +25,7 @@ import { HardwareUiStateContainer } from './HardwareUiStateContainer'; import { KeyboardContainer } from './KeyboardContainer'; import { NavigationContainer } from './NavigationContainer'; import { PortalBodyContainer } from './PortalBodyContainer'; +import { PrimeLoginContainer } from './PrimeLoginContainer'; const PageTrackerContainer = LazyLoad( () => import('./PageTrackerContainer'), @@ -97,6 +99,8 @@ export function Container() { + + diff --git a/packages/kit/src/provider/index.tsx b/packages/kit/src/provider/index.tsx index 1911bd51539..0f00c9a51b6 100644 --- a/packages/kit/src/provider/index.tsx +++ b/packages/kit/src/provider/index.tsx @@ -1,4 +1,12 @@ +/* eslint-disable camelcase */ +import { + Inter_400Regular, + Inter_500Medium, + Inter_600SemiBold, +} from '@expo-google-fonts/inter'; +import { useFonts } from 'expo-font'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; +import { SafeAreaProvider } from 'react-native-safe-area-context'; import { Toast } from '@onekeyhq/components'; import { SyncHomeAccountToDappAccountProvider } from '@onekeyhq/kit/src/views/Discovery/components/SyncDappAccountToHomeProvider'; @@ -10,6 +18,7 @@ import { useDebugComponentRemountLog } from '@onekeyhq/shared/src/utils/debug/de import { GlobalJotaiReady } from '../components/GlobalJotaiReady'; import PasswordVerifyPromptMount from '../components/Password/container/PasswordVerifyPromptMount'; import { SystemLocaleTracker } from '../components/SystemLocaleTracker'; +import { PrivyProvider } from '../views/Prime/components/PrivyProvider'; import { ColdStartByNotification, Container } from './Container'; import InAppNotification from './Container/InAppNotification'; @@ -42,23 +51,36 @@ export function KitProvider(props: any = {}) { ColdStartByNotification.launchNotification = launchNotification; useDebugComponentRemountLog({ name: 'KitProvider' }); - return ( - - - - - - - - - - - - - - - - - + + useFonts({ + Inter_400Regular, + Inter_500Medium, + Inter_600SemiBold, + }); + + const content = ( + + + + + + + + + + + + + + + + + + + + + ); + + return content; } diff --git a/packages/kit/src/routes/Modal/router.tsx b/packages/kit/src/routes/Modal/router.tsx index 9a63f62cb90..f06696022cd 100644 --- a/packages/kit/src/routes/Modal/router.tsx +++ b/packages/kit/src/routes/Modal/router.tsx @@ -19,6 +19,7 @@ import { KeyTagModalRouter } from '../../views/KeyTag/router'; import { LiteCardPages } from '../../views/LiteCard/router'; import { ModalNotificationsRouter } from '../../views/Notifications/router'; import { OnboardingRouter } from '../../views/Onboarding/router'; +import { PrimeRouter } from '../../views/Prime/router'; import { ModalReceiveStack } from '../../views/Receive/router'; import { ScanQrCodeModalRouter } from '../../views/ScanQrCode/router'; import { ModalSendStack } from '../../views/Send/router'; @@ -78,6 +79,10 @@ const router: IModalRootNavigatorConfig[] = [ }, }, onboardingRouterConfig, + { + name: EModalRoutes.PrimeModal, + children: PrimeRouter, + }, { name: EModalRoutes.FirmwareUpdateModal, children: ModalFirmwareUpdateStack, diff --git a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/ActionList.tsx b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/ActionList.tsx index 0cef8ecaa19..6029e4881ba 100644 --- a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/ActionList.tsx +++ b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/ActionList.tsx @@ -289,13 +289,13 @@ const ActionListGallery = () => ( ), }, { - title: 'Long Press', + title: 'Long Press (function call)', element: ( + ), }, diff --git a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Input.tsx b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Input.tsx index ca457cf3ec1..f7a270a6803 100644 --- a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Input.tsx +++ b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Input.tsx @@ -1,7 +1,35 @@ -import { Input, Stack } from '@onekeyhq/components'; +import { useState } from 'react'; + +import { + Input, + SizableText, + Stack, + Toast, + VerificationCodeInput, + YStack, +} from '@onekeyhq/components'; import { Layout } from './utils/Layout'; +function VerificationCodeInputDemo() { + const [code, setCode] = useState(''); + return ( + + { + Toast.success({ + title: 'Complete', + message: completeCode, + }); + }} + /> + {code} + + ); +} + const InputGallery = () => ( ( ), }, + { + title: 'VerificationCodeInput', + element: , + }, ]} /> ); diff --git a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Logger.tsx b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Logger.tsx index 06ebcd6de20..18114d21d9a 100644 --- a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Logger.tsx +++ b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/Logger.tsx @@ -106,6 +106,27 @@ const LoggerDemo = () => { Log Browser Tabs + + diff --git a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/WebEmbed.tsx b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/WebEmbed.tsx index 1bc4b4ec720..00f7565a158 100644 --- a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/WebEmbed.tsx +++ b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/WebEmbed.tsx @@ -15,7 +15,7 @@ import webEmbedConfig from '@onekeyhq/shared/src/storage/webEmbedConfig'; import { Layout } from './utils/Layout'; -function WebEmbedGallery() { +export function WebEmbedDevConfig() { const [url0, setUrl] = useState(''); const [debug0, setDebug] = useState(false); @@ -43,6 +43,39 @@ function WebEmbedGallery() { setDebug(config?.debug ?? false); }, []); + return ( + + + + Debug mode (show webview floating panel) + + + { + // check WEB_EMBED_API_WHITE_LIST_ORIGIN for $private white list origin + setUrl('http://localhost:3008'); + }} + > + Webview Url ( Real device, please use local LAN network ip address, + and update WEB_EMBED_API_WHITE_LIST_ORIGIN ) + + + + + {/* */} + + + ); +} + +function WebEmbedGallery() { return ( - - - - Debug mode (show webview floating panel) - - - - { - // check WEB_EMBED_API_WHITE_LIST_ORIGIN for $private white list origin - setUrl('http://localhost:3008'); - }} - > - Webview Url ( Real device, please use local LAN network ip - address, and update WEB_EMBED_API_WHITE_LIST_ORIGIN ) - - - - - {/* */} - - - ), + title: 'WebEmbedDevConfig', + element: , }, ]} /> diff --git a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/WebView.tsx b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/WebView.tsx index 3dc583c0271..66532d9552f 100644 --- a/packages/kit/src/views/Developer/pages/Gallery/Components/stories/WebView.tsx +++ b/packages/kit/src/views/Developer/pages/Gallery/Components/stories/WebView.tsx @@ -1,18 +1,37 @@ import { useCallback, useState } from 'react'; import { Button, Input, Page } from '@onekeyhq/components'; -import { openUrlInApp } from '@onekeyhq/shared/src/utils/openUrlUtils'; +import { EWebEmbedRoutePath } from '@onekeyhq/shared/src/consts/webEmbedConsts'; +import openUrlUtils from '@onekeyhq/shared/src/utils/openUrlUtils'; export default function WebviewGallery() { const [url, setUrl] = useState('https://www.baidu.com'); + const [hashRoutePath, setHashRoutePath] = useState( + EWebEmbedRoutePath.primePurchase, + ); const openWebView = useCallback(() => { - openUrlInApp(url); + openUrlUtils.openUrlInApp(url); }, [url]); + const openWebViewEmbed = useCallback(() => { + openUrlUtils.openUrlByWebviewPro({ + url: '', + title: 'WebView', + isWebEmbed: true, + hashRoutePath: hashRoutePath as any, + hashRouteQueryParams: { + primeUserId: 'hello-world-1234567890', + primeUserEmail: 'hello-world@1234567890.com', + }, + }); + }, [hashRoutePath]); return ( + + + ); diff --git a/packages/kit/src/views/Onboarding/pages/ConnectHardwareWallet/ConnectYourDevice.tsx b/packages/kit/src/views/Onboarding/pages/ConnectHardwareWallet/ConnectYourDevice.tsx index be22b8a269c..1996dc4d375 100644 --- a/packages/kit/src/views/Onboarding/pages/ConnectHardwareWallet/ConnectYourDevice.tsx +++ b/packages/kit/src/views/Onboarding/pages/ConnectHardwareWallet/ConnectYourDevice.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/no-unstable-nested-components */ import type { ReactNode } from 'react'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; diff --git a/packages/kit/src/views/Prime/TODO.md b/packages/kit/src/views/Prime/TODO.md new file mode 100644 index 00000000000..7a86dbfceb0 --- /dev/null +++ b/packages/kit/src/views/Prime/TODO.md @@ -0,0 +1,6 @@ +- [ ] privy server is down, ready=false, show Error on Dashboard UI +- [ ] refresh token if server says expired +- [ ] [refresh token](https://docs.privy.io/guide/react/authorization#managing-expired-access-tokens) before every api request (background can not call `getAccessToken()` ) +- [ ] get token and refresh token in ext background +- [ ] re-login if user token is logout (can `getAccessToken()` auto handle it?) +- [ ] https://docs.privy.io/guide/expo/misc/persistence expo custom token storage diff --git a/packages/kit/src/views/Prime/components/PrimeHeaderIconButton/PrimeHeaderIconButton.tsx b/packages/kit/src/views/Prime/components/PrimeHeaderIconButton/PrimeHeaderIconButton.tsx new file mode 100644 index 00000000000..68cab694dc0 --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrimeHeaderIconButton/PrimeHeaderIconButton.tsx @@ -0,0 +1,37 @@ +import { useCallback } from 'react'; + +import { useIntl } from 'react-intl'; + +import { HeaderIconButton } from '@onekeyhq/components'; +import useAppNavigation from '@onekeyhq/kit/src/hooks/useAppNavigation'; +import { EModalRoutes } from '@onekeyhq/shared/src/routes'; +import { EPrimePages } from '@onekeyhq/shared/src/routes/prime'; + +import { usePrimeAuth } from '../../hooks/usePrimeAuth'; + +export function PrimeHeaderIconButton() { + const { user, isReady } = usePrimeAuth(); + const intl = useIntl(); + const navigation = useAppNavigation(); + // TODO: add a state to check if the user has clicked the button + const isClicked = true; + + const onPrimeButtonPressed = useCallback(async () => { + navigation.pushFullModal(EModalRoutes.PrimeModal, { + screen: EPrimePages.PrimeDashboard, + }); + }, [navigation]); + + return ( + + ); +} diff --git a/packages/kit/src/views/Prime/components/PrimeHeaderIconButton/index.tsx b/packages/kit/src/views/Prime/components/PrimeHeaderIconButton/index.tsx new file mode 100644 index 00000000000..caf645bad4d --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrimeHeaderIconButton/index.tsx @@ -0,0 +1 @@ +export * from './PrimeHeaderIconButton'; diff --git a/packages/kit/src/views/Prime/components/PrimeLoginEmailCodeDialog/PrimeLoginEmailCodeDialog.tsx b/packages/kit/src/views/Prime/components/PrimeLoginEmailCodeDialog/PrimeLoginEmailCodeDialog.tsx new file mode 100644 index 00000000000..591d4bbbb67 --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrimeLoginEmailCodeDialog/PrimeLoginEmailCodeDialog.tsx @@ -0,0 +1,132 @@ +import { useCallback, useEffect, useMemo, useState } from 'react'; + +import { + Button, + Dialog, + RichSizeableText, + Stack, + Toast, + VerificationCodeInput, + XStack, + YStack, +} from '@onekeyhq/components'; +import backgroundApiProxy from '@onekeyhq/kit/src/background/instance/backgroundApiProxy'; +import { usePrimeLoginDialogAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms'; + +const COUNTDOWN_TIME = 60; + +export function PrimeLoginEmailCodeDialog({ + promiseId, +}: { + promiseId: number; +}) { + const [{ promptPrimeLoginEmailCodeDialog }] = usePrimeLoginDialogAtom(); + const [code, setCode] = useState(''); + const [countdown, setCountdown] = useState(COUNTDOWN_TIME); + const [isResending, setIsResending] = useState(false); + + const sendEmailVerificationCode = useCallback(async () => { + setIsResending(true); + try { + await backgroundApiProxy.servicePrime.apiSendEmailVerificationCode({ + email: promptPrimeLoginEmailCodeDialog?.email || '', + verifyUUID: promptPrimeLoginEmailCodeDialog?.verifyUUID || '', + }); + setCountdown(COUNTDOWN_TIME); + } finally { + setIsResending(false); + } + }, [ + promptPrimeLoginEmailCodeDialog?.email, + promptPrimeLoginEmailCodeDialog?.verifyUUID, + ]); + + useEffect(() => { + let timer: NodeJS.Timeout; + if (countdown > 0) { + timer = setInterval(() => { + setCountdown((prev) => prev - 1); + }, 1000); + } + return () => { + if (timer) { + clearInterval(timer); + } + }; + }, [countdown]); + + useEffect(() => { + void sendEmailVerificationCode(); + }, [sendEmailVerificationCode]); + + const buttonText = useMemo(() => { + if (isResending) return '发送中...'; + if (countdown > 0) return `重新发送 (${countdown}s)`; + return '重新发送'; + }, [isResending, countdown]); + + return ( + + + Enter verification code + + {`Sent to ${ + promptPrimeLoginEmailCodeDialog?.email || '' + }`} + + + + + + + { + setCode(value); + Toast.success({ + title: 'code', + message: value, + }); + }} + length={6} + /> + + + { + try { + await backgroundApiProxy.servicePrime.resolvePrimeLoginEmailCodeDialog( + { + promiseId, + code, + }, + ); + } catch (error) { + preventClose(); + throw error; + } + }} + /> + + ); +} diff --git a/packages/kit/src/views/Prime/components/PrimeLoginEmailCodeDialog/index.tsx b/packages/kit/src/views/Prime/components/PrimeLoginEmailCodeDialog/index.tsx new file mode 100644 index 00000000000..d0f0b5a5abc --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrimeLoginEmailCodeDialog/index.tsx @@ -0,0 +1 @@ +export * from './PrimeLoginEmailCodeDialog'; diff --git a/packages/kit/src/views/Prime/components/PrimeLoginEmailDialog/PrimeLoginEmailDialog.tsx b/packages/kit/src/views/Prime/components/PrimeLoginEmailDialog/PrimeLoginEmailDialog.tsx new file mode 100644 index 00000000000..9a232735fa4 --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrimeLoginEmailDialog/PrimeLoginEmailDialog.tsx @@ -0,0 +1,93 @@ +import { useCallback } from 'react'; + +import { useIntl } from 'react-intl'; + +import { Dialog, Form, Input, Stack, useForm } from '@onekeyhq/components'; +import backgroundApiProxy from '@onekeyhq/kit/src/background/instance/backgroundApiProxy'; +import stringUtils from '@onekeyhq/shared/src/utils/stringUtils'; + +export function PrimeLoginEmailDialog({ promiseId }: { promiseId: number }) { + const intl = useIntl(); + + const form = useForm<{ email: string }>({ + // mode: 'onSubmit', + // reValidateMode: 'onSubmit', + defaultValues: { email: '' }, + }); + + const submit = useCallback( + async (options: { preventClose?: () => void } = {}) => { + await form.trigger(); + if (!form.formState.isValid) { + options?.preventClose?.(); + return; + } + const data = form.getValues(); + try { + await backgroundApiProxy.servicePrime.resolvePrimeLoginEmailDialog({ + promiseId, + email: data.email, + }); + } catch (error) { + options?.preventClose?.(); + throw error; + } + }, + [form, promiseId], + ); + + return ( + + + Continue with OneKey ID + + OneKey ID is all you need to access all prime benefits. + + +
+ { + if (!value) { + return 'email is required'; + } + if (!stringUtils.isValidEmail(value)) { + return 'invalid email'; + } + return true; + }, + required: { + value: true, + message: 'email is required', + }, + onChange: () => { + form.clearErrors(); + }, + }} + > + text?.trim() ?? text} + onSubmitEditing={() => submit()} // submit on press enter + /> + +
+
+ { + await submit({ preventClose }); + }} + /> +
+ ); +} diff --git a/packages/kit/src/views/Prime/components/PrimeLoginEmailDialog/index.tsx b/packages/kit/src/views/Prime/components/PrimeLoginEmailDialog/index.tsx new file mode 100644 index 00000000000..9fcef66a755 --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrimeLoginEmailDialog/index.tsx @@ -0,0 +1 @@ +export * from './PrimeLoginEmailDialog'; diff --git a/packages/kit/src/views/Prime/components/PrimeLoginPasswordDialog/PrimeLoginPasswordDialog.tsx b/packages/kit/src/views/Prime/components/PrimeLoginPasswordDialog/PrimeLoginPasswordDialog.tsx new file mode 100644 index 00000000000..50d3fb20c1f --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrimeLoginPasswordDialog/PrimeLoginPasswordDialog.tsx @@ -0,0 +1,240 @@ +import { useCallback, useMemo, useState } from 'react'; + +import { + Button, + Checkbox, + Dialog, + Form, + Input, + RichSizeableText, + Stack, + XStack, + YStack, + useForm, +} from '@onekeyhq/components'; +import backgroundApiProxy from '@onekeyhq/kit/src/background/instance/backgroundApiProxy'; +import type { IPrimeLoginDialogAtomPasswordData } from '@onekeyhq/kit-bg/src/states/jotai/atoms'; + +export function PrimeLoginPasswordDialog({ + data, + promiseId, +}: { + data: IPrimeLoginDialogAtomPasswordData | undefined; + promiseId: number; +}) { + const [confirmPassword, setConfirmPassword] = useState(''); + + const isRegister = data?.isRegister; + const email = data?.email || ''; + + // console.log({ isRegister, email }); + + const form = useForm<{ password: string; confirmPassword: string }>({ + // mode: 'onSubmit', + reValidateMode: 'onChange', + defaultValues: { password: '', confirmPassword: '' }, + }); + + const [passwordVerifyState, setPasswordVerifyState] = useState<{ + minLength: boolean; + minNumberCharacter: boolean; + minLetterCharacter: boolean; + minSpecialCharacter: boolean; + }>({ + minLength: false, + minNumberCharacter: false, + minLetterCharacter: false, + minSpecialCharacter: false, + }); + + const isValidPassword = useCallback((password: string) => { + let minLength = true; + let minNumberCharacter = true; + let minLetterCharacter = true; + let minSpecialCharacter = true; + + if (password.length < 8) { + minLength = false; + } + if (!/\d/.test(password)) { + minNumberCharacter = false; + } + if (!/[a-zA-Z]/.test(password)) { + minLetterCharacter = false; + } + // eslint-disable-next-line no-useless-escape + if (!/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>/?`~]/.test(password)) { + minSpecialCharacter = false; + } + + setPasswordVerifyState({ + minLength, + minNumberCharacter, + minLetterCharacter, + minSpecialCharacter, + }); + + return ( + minLength && + minNumberCharacter && + minLetterCharacter && + minSpecialCharacter + ); + }, []); + + const submit = useCallback( + async (options: { preventClose?: () => void } = {}) => { + await form.trigger(); + if (!form.formState.isValid) { + options?.preventClose?.(); + return; + } + const formData = form.getValues(); + try { + const encodedPassword = + await backgroundApiProxy.servicePassword.encodeSensitiveText({ + text: formData.password, + }); + await backgroundApiProxy.servicePrime.ensurePrimeLoginValidPassword( + encodedPassword, + ); + await backgroundApiProxy.servicePrime.resolvePrimeLoginPasswordDialog({ + promiseId, + password: encodedPassword, + }); + } catch (error) { + options?.preventClose?.(); + throw error; + } + }, + [form, promiseId], + ); + + const states = useMemo(() => { + let title = 'Welcome back'; + let description = `Manage your OneKey ID ${email}`; + if (isRegister) { + title = 'Sign up OneKey ID'; + description = `${email} is not registered yet, we will create a new account for you.`; + } + return { + title, + description, + }; + }, [email, isRegister]); + + return ( + + {states.title} + + {states.description} + + + +
+ + + + ) : null + } + rules={{ + validate: isRegister + ? (value) => { + if (!isValidPassword(value)) { + return false; + } + return true; + } + : (value) => { + if (!value) { + return false; + } + return true; + }, + onChange: () => { + void form.trigger('password'); + }, + }} + > + { + void submit(); + }} + /> + + {/* {isRegister ? ( + + ) : null} */} + + {isRegister ? ( + + + + + + + ) : null} +
+
+
+ { + await submit({ preventClose }); + }} + /> +
+ ); +} diff --git a/packages/kit/src/views/Prime/components/PrimeLoginPasswordDialog/index.tsx b/packages/kit/src/views/Prime/components/PrimeLoginPasswordDialog/index.tsx new file mode 100644 index 00000000000..8eb74e4fd2a --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrimeLoginPasswordDialog/index.tsx @@ -0,0 +1 @@ +export * from './PrimeLoginPasswordDialog'; diff --git a/packages/kit/src/views/Prime/components/PrivyProvider.native.tsx b/packages/kit/src/views/Prime/components/PrivyProvider.native.tsx new file mode 100644 index 00000000000..4fea8e93c26 --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrivyProvider.native.tsx @@ -0,0 +1,31 @@ +import { + PrivyElements, + PrivyProvider as PrivyProviderBase, +} from '@privy-io/expo'; + +import { usePrivyAuthSyncToAtom } from '../hooks/usePrivyAuthSyncToAtom'; + +function PrivyAuthSyncToAtom() { + usePrivyAuthSyncToAtom(); + return null; +} + +export function PrivyProvider({ children }: { children: React.ReactNode }) { + const appId = process.env.PRIVY_APP_ID ?? ''; + const clientId = process.env.PRIVY_MOBILE_CLIENT_ID ?? ''; + if (!appId) { + throw new Error('PRIVY_APP_ID is not set'); + } + if (!clientId) { + throw new Error('PRIVY_MOBILE_CLIENT_ID is not set'); + } + // throw new Error('PRIVY_MOBILE_CLIENT_ID is not set'); + + return ( + + + + {children} + + ); +} diff --git a/packages/kit/src/views/Prime/components/PrivyProvider.tsx b/packages/kit/src/views/Prime/components/PrivyProvider.tsx new file mode 100644 index 00000000000..6c8792ae58f --- /dev/null +++ b/packages/kit/src/views/Prime/components/PrivyProvider.tsx @@ -0,0 +1,39 @@ +import { PrivyProvider as PrivyProviderBase } from '@privy-io/react-auth'; + +import { usePrivyAuthSyncToAtom } from '../hooks/usePrivyAuthSyncToAtom'; + +function PrivyAuthSyncToAtom() { + usePrivyAuthSyncToAtom(); + return null; +} + +export function PrivyProvider({ children }: { children: React.ReactNode }) { + const appId = process.env.PRIVY_APP_ID ?? ''; + if (!appId) { + throw new Error('PRIVY_APP_ID is not set'); + } + + // TODO: ext error + // Embedded wallet is only available over HTTPS + return ( + + + {children} + + ); +} + +export function PrivyProviderNoop({ children }: { children: React.ReactNode }) { + return children; +} diff --git a/packages/kit/src/views/Prime/hooks/useFetchPrimeUserInfo.ts b/packages/kit/src/views/Prime/hooks/useFetchPrimeUserInfo.ts new file mode 100644 index 00000000000..18f9935c960 --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/useFetchPrimeUserInfo.ts @@ -0,0 +1,19 @@ +import { useCallback } from 'react'; + +import backgroundApiProxy from '../../../background/instance/backgroundApiProxy'; + +import { usePrimeAuth } from './usePrimeAuth'; + +export function useFetchPrimeUserInfo() { + const { isReady, user } = usePrimeAuth(); + const fetchPrimeUserInfo = useCallback(async () => { + if (isReady && user?.privyUserId) { + const userInfo = + await backgroundApiProxy.servicePrime.apiFetchPrimeUserInfo(); + return userInfo; + } + return undefined; + }, [isReady, user?.privyUserId]); + + return { fetchPrimeUserInfo }; +} diff --git a/packages/kit/src/views/Prime/hooks/usePrimeAuth.ts b/packages/kit/src/views/Prime/hooks/usePrimeAuth.ts new file mode 100644 index 00000000000..3e53bab7535 --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/usePrimeAuth.ts @@ -0,0 +1,92 @@ +import { useCallback, useMemo } from 'react'; + +import { Toast } from '@onekeyhq/components'; +import { + usePrimeInitAtom, + usePrimePersistAtom, +} from '@onekeyhq/kit-bg/src/states/jotai/atoms'; +import { NotImplemented } from '@onekeyhq/shared/src/errors'; +import type { IOneKeyError } from '@onekeyhq/shared/src/errors/types/errorTypes'; +import platformEnv from '@onekeyhq/shared/src/platformEnv'; + +import backgroundApiProxy from '../../../background/instance/backgroundApiProxy'; + +import { usePrivyUniversal } from './usePrivyUniversal'; + +export function usePrimeAuth() { + const [primePersistAtom, setPrimePersistAtom] = usePrimePersistAtom(); + const [primeInitAtom, setPrimeInitAtom] = usePrimeInitAtom(); + + const privy = usePrivyUniversal(); + const { logout, isReady, getAccessToken } = privy; + + const login = useCallback(() => { + if (platformEnv.isNative) { + privy.native?.login?.({ + loginMethods: ['email'], + }); + } else { + privy.web?.login?.({ + loginMethods: ['email'], + }); + } + }, [privy]); + + const loginLegacy = useCallback(async () => { + try { + const email = await backgroundApiProxy.servicePrime.startPrimeLogin(); + console.log('prime email >>> ', email); + Toast.success({ + title: `Prime login success: ${email.email}`, + }); + } catch (error) { + console.error(error); + Toast.error({ + title: `login failed: ${(error as IOneKeyError)?.message || ''}`, + }); + } + }, []); + + const updateEmail = useCallback(() => { + if (platformEnv.isNative) { + throw new NotImplemented('updateEmail is not supported on native'); + } else { + privy.web?.updateEmail?.(); + } + }, [privy]); + + const updatePhone = useCallback(() => { + if (platformEnv.isNative) { + throw new NotImplemented('updatePhone is not supported on native'); + } else { + privy.web?.updatePhone?.(); + } + }, [privy]); + + return useMemo( + () => ({ + // you should check isReady before use other methods + // TODO when privy network is broken(isReady is false), we should show a Error Page on the Dashboard UI + isReady: primeInitAtom.isReady, + user: primePersistAtom, + privy, + login, + loginLegacy, + logout, + updateEmail, + updatePhone, + getAccessToken, + }), + [ + getAccessToken, + login, + loginLegacy, + logout, + primeInitAtom, + primePersistAtom, + privy, + updateEmail, + updatePhone, + ], + ); +} diff --git a/packages/kit/src/views/Prime/hooks/usePrimePayment.native.ts b/packages/kit/src/views/Prime/hooks/usePrimePayment.native.ts new file mode 100644 index 00000000000..aca1fd0d083 --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/usePrimePayment.native.ts @@ -0,0 +1,194 @@ +import { useCallback, useEffect, useState } from 'react'; + +import Purchases, { LOG_LEVEL } from 'react-native-purchases'; +import RevenueCatUI from 'react-native-purchases-ui'; + +import { usePrimePersistAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms'; +import errorToastUtils from '@onekeyhq/shared/src/errors/utils/errorToastUtils'; +import platformEnv from '@onekeyhq/shared/src/platformEnv'; +import perfUtils from '@onekeyhq/shared/src/utils/debug/perfUtils'; + +import { usePrimeAuth } from './usePrimeAuth'; + +import type { IUsePrimePayment } from './usePrimePaymentTypes'; +import type { + CustomerInfo, + PurchasesPackage, +} from '@revenuecat/purchases-typescript-internal'; +import type { PAYWALL_RESULT } from 'react-native-purchases-ui'; + +export function usePrimePayment(): IUsePrimePayment { + const [isPaymentReady, setIsPaymentReady] = useState(false); + const { isReady: isAuthReady, user } = usePrimeAuth(); + const [primePersistAtom, setPrimePersistAtom] = usePrimePersistAtom(); + + const isReady = isPaymentReady && isAuthReady; + + const getCustomerInfo = useCallback(async () => { + if (!isReady) { + throw new Error('PrimeAuth Not ready'); + } + if (!user?.privyUserId) { + throw new Error('User not logged in'); + } + // Do not logout which will create anonymous user + // try { + // await Purchases.logOut(); + // } catch (e) { + // console.error(e); + // } + if (user?.privyUserId) { + try { + await Purchases.logIn(user.privyUserId); + } catch (e) { + console.error(e); + } + try { + await Purchases.logIn(user.privyUserId); + } catch (e) { + console.error(e); + } + } + const appUserId = await Purchases.getAppUserID(); + if (appUserId !== user?.privyUserId) { + throw new Error('AppUserId not match'); + } + const customerInfo: CustomerInfo = await Purchases.getCustomerInfo(); + console.log( + 'customerInfo >>>>> ', + appUserId, + JSON.stringify(customerInfo, null, 2), + ); + setPrimePersistAtom((prev) => + perfUtils.buildNewValueIfChanged(prev, { + ...prev, + subscriptionManageUrl: customerInfo.managementURL || '', + }), + ); + + return customerInfo; + }, [isReady, setPrimePersistAtom, user?.privyUserId]); + + // TODO move to jotai context + useEffect(() => { + void (async () => { + if (process.env.NODE_ENV !== 'production') { + await Purchases.setLogLevel(LOG_LEVEL.VERBOSE); + // TODO VPN required + await Purchases.setProxyURL('https://api.rc-backup.com/'); + } + + let apiKey = ''; + if (platformEnv.isNativeIOS) { + apiKey = process.env.REVENUECAT_API_KEY_APPLE || ''; + } + if (platformEnv.isNativeAndroid) { + apiKey = process.env.REVENUECAT_API_KEY_GOOGLE || ''; + } + if (!apiKey) { + throw new Error('No REVENUECAT api key found'); + } + Purchases.configure({ + apiKey, + // useAmazon: true + }); + setIsPaymentReady(true); + })(); + }, []); + + useEffect(() => { + void (async () => { + if (isReady && user?.privyUserId) { + await getCustomerInfo(); + } + })(); + }, [getCustomerInfo, isReady, user?.privyUserId]); + + const getPaywallPackagesNative = useCallback(async () => { + if (!isReady) { + throw new Error('PrimeAuth native not ready, please try again later'); + } + const offerings = await Purchases.getOfferings(); + const packages: PurchasesPackage[] = []; + Object.values(offerings.all).forEach((offering) => { + packages.push(...offering.availablePackages); + }); + packages.sort((a) => { + // Yearly is the first + if (a.presentedOfferingContext.offeringIdentifier === 'Yearly') { + return -1; + } + return 1; + }); + return { + packages, + }; + }, [isReady]); + + // https://www.revenuecat.com/docs/tools/paywalls/displaying-paywalls#react-native + const presentPaywallNative = useCallback(async () => { + try { + console.log('presentPaywallNative >>>>> '); + if (!isReady) { + throw new Error('PrimeAuth native not ready!!!'); + } + + if (platformEnv.isNativeAndroid) { + // if (platformEnv.isNativeAndroidGooglePlay) { + // // TODO VPN required or device not support google play service + // if (!(await googlePlayService.isAvailable())) { + // throw new Error( + // 'Google Play Service is not available on this device', + // ); + // } + // } else { + // throw new Error('Android web purchase not supported yet'); + // } + } + + // const { packages } = await getPaywallPackagesNative(); + // console.log( + // 'getPaywallPackagesNative: packages >>>>> ', + // JSON.stringify(packages, null, 2), + // ); + + // const offerings = await Purchases.getOfferings(); + // console.log('offerings >>>>> ', JSON.stringify(offerings, null, 2)); + // const offeringYearly = offerings.all.Yearly; + // const offeringMonthly = offerings.all.Monthly; + + // const customerInfo = await Purchases.getCustomerInfo(); + // console.log('customerInfo >>>>> ', JSON.stringify(customerInfo, null, 2)); + + const paywallResult: PAYWALL_RESULT = await RevenueCatUI.presentPaywall({ + // offering: offeringYearly, + // offering: offering // Optional Offering object obtained through getOfferings + }); + + // const paywallResult: PAYWALL_RESULT = + // await RevenueCatUI.presentPaywallIfNeeded({ + // // offering: offering, // Optional Offering object obtained through getOfferings + // requiredEntitlementIdentifier: 'Prime', + // }); + + console.log( + 'paywallResult >>>>> ', + JSON.stringify(paywallResult, null, 2), + ); + + return paywallResult; + } catch (error) { + errorToastUtils.toastIfError(error); + throw error; + } + }, [isReady]); + + return { + isReady, + presentPaywallNative, + getPaywallPackagesNative, + getPaywallPackagesWeb: undefined, + purchasePaywallPackageWeb: undefined, + getCustomerInfo, + }; +} diff --git a/packages/kit/src/views/Prime/hooks/usePrimePayment.ts b/packages/kit/src/views/Prime/hooks/usePrimePayment.ts new file mode 100644 index 00000000000..ec73faebf19 --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/usePrimePayment.ts @@ -0,0 +1,209 @@ +// load stripe js before revenuecat, otherwise revenuecat will create script tag load https://js.stripe.com/v3 +// eslint-disable-next-line import/order +import '@onekeyhq/shared/src/modules3rdParty/stripe-v3'; + +import { useCallback, useEffect, useRef } from 'react'; + +import { LogLevel, Purchases } from '@revenuecat/purchases-js'; + +import { usePrimePersistAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms'; +import perfUtils from '@onekeyhq/shared/src/utils/debug/perfUtils'; +import { createPromiseTarget } from '@onekeyhq/shared/src/utils/promiseUtils'; +import type { IPrimeUserInfo } from '@onekeyhq/shared/types/prime/primeTypes'; + +import backgroundApiProxy from '../../../background/instance/backgroundApiProxy'; + +import { usePrimeAuth } from './usePrimeAuth'; + +import errorToastUtils from '@onekeyhq/shared/src/errors/utils/errorToastUtils'; + +import type { IUsePrimePayment } from './usePrimePaymentTypes'; +import type { + CustomerInfo, + Package, + PurchaseParams, +} from '@revenuecat/purchases-js'; + +export function usePrimePayment(): IUsePrimePayment { + const { isReady: isAuthReady, user } = usePrimeAuth(); + const [primePersistAtom, setPrimePersistAtom] = usePrimePersistAtom(); + + const isReady = isAuthReady; + const configureDonePromise = useRef(createPromiseTarget()); + + const getCustomerInfo = useCallback(async () => { + if (!isReady) { + throw new Error('PrimeAuth Not ready'); + } + if (!user?.privyUserId) { + throw new Error('User not logged in'); + } + if (process.env.NODE_ENV !== 'production') { + Purchases.setLogLevel(LogLevel.Verbose); + } + const devSettings = + await backgroundApiProxy.serviceDevSetting.getDevSetting(); + let apiKey = process.env.REVENUECAT_API_KEY_WEB; + if (devSettings?.settings?.usePrimeSandboxPayment) { + apiKey = process.env.REVENUECAT_API_KEY_WEB_SANDBOX; + } + if (!apiKey) { + throw new Error('No REVENUECAT api key found'); + } + + // TODO VPN required + // await Purchases.setProxyURL('https://api.rc-backup.com/'); + + // TODO how to configure another userId when user login with another account + // https://www.revenuecat.com/docs/customers/user-ids#logging-in-with-a-custom-app-user-id + + Purchases.configure(apiKey, user?.privyUserId || ''); + + const customerInfo: CustomerInfo = + await Purchases.getSharedInstance().getCustomerInfo(); + console.log('customerInfo >>>>>> ', user?.privyUserId, customerInfo); + + const appUserId = Purchases.getSharedInstance().getAppUserId(); + if (appUserId !== user?.privyUserId) { + throw new Error('AppUserId not match'); + } + + setPrimePersistAtom((prev) => { + const newData: IPrimeUserInfo = { + ...prev, + subscriptionManageUrl: customerInfo.managementURL || '', + }; + // update prime status by local sdk + if (process.env.NODE_ENV !== 'production') { + const isPrime = customerInfo?.entitlements?.active?.Prime?.isActive; + if (isPrime) { + const willRenew = + customerInfo?.entitlements?.active?.Prime?.willRenew; + newData.primeSubscription = { + isActive: true, + expiresAt: willRenew + ? 0 + : customerInfo.entitlements.active.Prime.expirationDate?.getTime() ?? + 0, + }; + } else { + newData.primeSubscription = undefined; + } + } + return perfUtils.buildNewValueIfChanged(prev, newData); + }); + + if ('gold_entitlement' in customerInfo.entitlements.active) { + // Grant user access to the entitlement "gold_entitlement" + // grantEntitlementAccess(); + } + + configureDonePromise.current.resolveTarget(true); + return customerInfo; + }, [isReady, setPrimePersistAtom, user?.privyUserId]); + + useEffect(() => { + void (async () => { + if (isReady && user?.privyUserId) { + await getCustomerInfo(); + } + })(); + }, [getCustomerInfo, isReady, user?.privyUserId]); + + const getOfferings = useCallback(async () => { + if (!isReady) { + throw new Error('PrimeAuth Not ready'); + } + if (!user?.isLoggedIn) { + return undefined; + } + const offerings = await Purchases.getSharedInstance().getOfferings({ + currency: 'USD', + }); + return offerings; + }, [isReady, user?.isLoggedIn]); + + const getPaywallPackagesWeb = useCallback(async () => { + await configureDonePromise.current.ready; + if (!isReady) { + throw new Error('PrimeAuth Not ready'); + } + const offerings = await getOfferings(); + const packages: Package[] = []; + + // Object.values(offerings.all).forEach((offering) => { + // packages.push(...offering.availablePackages); + // }); + packages.push(...(offerings?.current?.availablePackages || [])); + + packages.sort((a) => { + // Yearly is the first + if ( + a.rcBillingProduct.presentedOfferingContext.offeringIdentifier === + 'Yearly' + ) { + return -1; + } + return 1; + }); + return { + packages, + }; + }, [getOfferings, isReady]); + + const purchasePaywallPackageWeb = useCallback( + async ({ + packageId, + email, + locale, + }: { + packageId: string; + email: string; + locale?: string; // https://www.revenuecat.com/docs/tools/paywalls/creating-paywalls#supported-locales + }) => { + try { + if (!isReady) { + throw new Error('PrimeAuth Not ready'); + } + // const offerings = await this.getPaywallOfferings(); + // const paywallPackage = offerings?.all?.monthly?.packagesById?.[packageId]; + const packages = await getPaywallPackagesWeb(); + const paywallPackage = packages.packages.find( + (p) => p.identifier === packageId, + ); + if (!paywallPackage) { + throw new Error('purchasePaywallPackage ERROR: Invalid packageId'); + } + const purchaseParams: PurchaseParams = { + rcPackage: paywallPackage, + customerEmail: email, + selectedLocale: locale, + }; + // TODO check package user is Matched to privyUserId + // TODO check if user has already purchased + const purchase = await Purchases.getSharedInstance().purchase( + purchaseParams, + ); + // test credit card + // https://docs.stripe.com/testing#testing-interactively + // Mastercard: 5555555555554444 + // visa: 4242424242424242 + console.log('purchase >>>>>> ', purchase); + return purchase; + } catch (error) { + errorToastUtils.toastIfError(error); + throw error; + } + }, + [getPaywallPackagesWeb, isReady], + ); + + return { + isReady, + presentPaywallNative: undefined, + getPaywallPackagesNative: undefined, + getPaywallPackagesWeb, + purchasePaywallPackageWeb, + getCustomerInfo, + }; +} diff --git a/packages/kit/src/views/Prime/hooks/usePrimePaymentTypes.ts b/packages/kit/src/views/Prime/hooks/usePrimePaymentTypes.ts new file mode 100644 index 00000000000..c4227841fef --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/usePrimePaymentTypes.ts @@ -0,0 +1,37 @@ +import type { + CustomerInfo as CustomerInfoWeb, + Package, + PurchaseResult, +} from '@revenuecat/purchases-js'; +import type { + CustomerInfo as CustomerInfoNative, + PurchasesPackage, +} from '@revenuecat/purchases-typescript-internal'; +import type { PAYWALL_RESULT } from 'react-native-purchases-ui'; + +export type IUsePrimePayment = { + isReady: boolean; + getCustomerInfo: () => Promise; + getPaywallPackagesNative: + | (() => Promise<{ + packages: PurchasesPackage[]; + }>) + | undefined; + getPaywallPackagesWeb: + | (() => Promise<{ + packages: Package[]; + }>) + | undefined; + presentPaywallNative: (() => Promise) | undefined; + purchasePaywallPackageWeb: + | (({ + packageId, + email, + locale, + }: { + packageId: string; + email: string; + locale?: string; + }) => Promise) + | undefined; +}; diff --git a/packages/kit/src/views/Prime/hooks/usePrivyAuthSyncToAtom.ts b/packages/kit/src/views/Prime/hooks/usePrivyAuthSyncToAtom.ts new file mode 100644 index 00000000000..613841b7416 --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/usePrivyAuthSyncToAtom.ts @@ -0,0 +1,69 @@ +import { useEffect } from 'react'; + +import { + usePrimeInitAtom, + usePrimePersistAtom, +} from '@onekeyhq/kit-bg/src/states/jotai/atoms'; + +import backgroundApiProxy from '../../../background/instance/backgroundApiProxy'; + +import { usePrivyUniversal } from './usePrivyUniversal'; + +export function usePrivyAuthSyncToAtom() { + const [primePersistAtom, setPrimePersistAtom] = usePrimePersistAtom(); + const [primeInitAtom, setPrimeInitAtom] = usePrimeInitAtom(); + + // https://github.com/privy-io/create-next-app/blob/main/pages/index.tsx + const { + isReady, + authenticated, + userEmail, + privyUserId, + native, + web, + getAccessToken, + } = usePrivyUniversal(); + + useEffect(() => { + void (async () => { + if (!isReady) { + return; + } + let accessToken: string | null = ''; + if (authenticated) { + accessToken = await getAccessToken(); + } + + await backgroundApiProxy.simpleDb.prime.saveAuthToken(accessToken || ''); + + if (accessToken) { + setPrimePersistAtom((v) => ({ + ...v, + isLoggedIn: true, + email: userEmail, + privyUserId, + })); + } else { + setPrimePersistAtom((v) => ({ + ...v, + isLoggedIn: false, + email: undefined, + privyUserId: undefined, + })); + } + + setPrimeInitAtom((v) => ({ + ...v, + isReady: true, + })); + })(); + }, [ + setPrimePersistAtom, + setPrimeInitAtom, + authenticated, + getAccessToken, + isReady, + userEmail, + privyUserId, + ]); +} diff --git a/packages/kit/src/views/Prime/hooks/usePrivyUniversal.native.ts b/packages/kit/src/views/Prime/hooks/usePrivyUniversal.native.ts new file mode 100644 index 00000000000..5fbff74fdbd --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/usePrivyUniversal.native.ts @@ -0,0 +1,45 @@ +import { useMemo } from 'react'; + +import { usePrivy, useLogin as usePrivyLogin } from '@privy-io/expo'; + +import type { IUsePrivyUniversal } from './usePrivyUniversalTypes'; + +export function usePrivyUniversal(): IUsePrivyUniversal { + const privy = usePrivy(); + const { error, user, isReady, logout, getAccessToken } = privy; + const { login } = usePrivyLogin(); + + console.log('usePrivyUniversal: isReady >>>>> ', isReady); + + const userEmail = useMemo(() => { + if (user) { + const emailUser = user?.linked_accounts?.find( + (item) => item.type === 'email', + ); + if (emailUser) { + const address: string = (emailUser as { address: string }).address; + return address; + } + } + return undefined; + }, [user]); + + return useMemo( + () => ({ + // privy, + web: undefined, + native: { + login, + error, + user, + }, + authenticated: !!user, + userEmail, + privyUserId: user?.id, + isReady, + logout, + getAccessToken, + }), + [getAccessToken, login, logout, user, error, isReady, userEmail], + ); +} diff --git a/packages/kit/src/views/Prime/hooks/usePrivyUniversal.ts b/packages/kit/src/views/Prime/hooks/usePrivyUniversal.ts new file mode 100644 index 00000000000..35eb19128dc --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/usePrivyUniversal.ts @@ -0,0 +1,77 @@ +import { useMemo } from 'react'; + +import { usePrivy, useLogin as usePrivyLogin } from '@privy-io/react-auth'; + +import type { IUsePrivyUniversal } from './usePrivyUniversalTypes'; + +export function usePrivyUniversal(): IUsePrivyUniversal { + const privy = usePrivy(); + // https://github.com/privy-io/create-next-app/blob/main/pages/index.tsx + const { + ready, + authenticated, + user, + logout, + updateEmail: updateEmailWeb, + updatePhone: updatePhoneWeb, + linkEmail, + linkWallet, + unlinkEmail, + linkPhone, + unlinkPhone, + unlinkWallet, + linkGoogle, + unlinkGoogle, + linkTwitter, + unlinkTwitter, + linkDiscord, + unlinkDiscord, + getAccessToken, + } = privy; + const { login: loginWeb } = usePrivyLogin({ + onComplete( + user0, + isNewUser, + wasAlreadyAuthenticated, + loginMethod, + loginAccount, + ) { + console.log('privy login complete >>> ', { + user0, + isNewUser, + wasAlreadyAuthenticated, + loginMethod, + loginAccount, + }); + }, + }); + + return useMemo( + () => ({ + // privy, + native: undefined, + web: { + user: privy.user, + login: loginWeb, + updateEmail: updateEmailWeb, + updatePhone: updatePhoneWeb, + }, + authenticated: privy.authenticated, + userEmail: privy.user?.email?.address, + privyUserId: privy.user?.id, + isReady: privy.ready, + logout, + getAccessToken, + }), + [ + getAccessToken, + loginWeb, + logout, + privy.authenticated, + privy.ready, + privy.user, + updateEmailWeb, + updatePhoneWeb, + ], + ); +} diff --git a/packages/kit/src/views/Prime/hooks/usePrivyUniversalTypes.ts b/packages/kit/src/views/Prime/hooks/usePrivyUniversalTypes.ts new file mode 100644 index 00000000000..44a39d629db --- /dev/null +++ b/packages/kit/src/views/Prime/hooks/usePrivyUniversalTypes.ts @@ -0,0 +1,29 @@ +import type { LoginUIConfig } from '@privy-io/expo'; +import type { PrivyUser } from '@privy-io/public-api'; +import type { LoginModalOptions, User } from '@privy-io/react-auth'; + +export type IUsePrivyUniversal = { + native: + | { + error: Error | null | undefined; + user: PrivyUser | null | undefined; + login: ((config: LoginUIConfig) => void) | undefined; + } + | undefined; + web: + | { + user: User | null | undefined; + login: + | ((options?: LoginModalOptions | React.MouseEvent) => void) + | undefined; + updateEmail: (() => void) | undefined; // web only + updatePhone: (() => void) | undefined; // web only + } + | undefined; + userEmail: string | undefined; + privyUserId: string | undefined; + authenticated: boolean; + isReady: boolean; + logout: () => Promise; + getAccessToken: () => Promise; +}; diff --git a/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeDashboard.tsx b/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeDashboard.tsx new file mode 100644 index 00000000000..8cad6ff18cf --- /dev/null +++ b/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeDashboard.tsx @@ -0,0 +1,416 @@ +import { useCallback, useEffect, useMemo, useState } from 'react'; + +import { StyleSheet } from 'react-native'; + +import type { IKeyOfIcons } from '@onekeyhq/components'; +import { + ActionList, + Button, + Dialog, + Icon, + IconButton, + LottieView, + Page, + SizableText, + Stack, + Theme, + Toast, + XStack, + YStack, + useSafeAreaInsets, +} from '@onekeyhq/components'; +import PrimeBannerBgDark from '@onekeyhq/kit/assets/animations/prime-banner-bg-dark.json'; +import { ListItem } from '@onekeyhq/kit/src/components/ListItem'; +import useAppNavigation from '@onekeyhq/kit/src/hooks/useAppNavigation'; +import { usePromiseResult } from '@onekeyhq/kit/src/hooks/usePromiseResult'; +import { EWebEmbedRoutePath } from '@onekeyhq/shared/src/consts/webEmbedConsts'; +import platformEnv from '@onekeyhq/shared/src/platformEnv'; +import openUrlUtils from '@onekeyhq/shared/src/utils/openUrlUtils'; +import timerUtils from '@onekeyhq/shared/src/utils/timerUtils'; + +import { useFetchPrimeUserInfo } from '../../hooks/useFetchPrimeUserInfo'; +import { usePrimeAuth } from '../../hooks/usePrimeAuth'; +import { usePrimePayment } from '../../hooks/usePrimePayment'; + +import { PrimeSubscriptionPlans } from './PrimeSubscriptionPlans'; +import { PrimeUserInfo } from './PrimeUserInfo'; + +function showDebugMessageByDialog(obj: any) { + Dialog.debugMessage({ + debugMessage: obj, + }); +} + +function PrimeBanner() { + return ( + + + + OneKey Prime + + + Unlock advanced features to enhance your crypto asset management + experience. + + + ); +} + +function PrimeBenefitsItem({ + icon, + title, + subtitle, + onPress, +}: { + icon: IKeyOfIcons; + title: string; + subtitle: string; + onPress: () => void; +}) { + return ( + + + + + + + ); +} + +function PrimeBenefitsList() { + return ( + + { + Toast.success({ + title: 'Sync', + }); + }} + /> + { + Toast.success({ + title: 'Premium RPC', + }); + }} + /> + { + Toast.success({ + title: 'Account Activity', + }); + }} + /> + { + Toast.success({ + title: 'Analytics', + }); + }} + /> + { + Toast.success({ + title: 'Device management', + }); + }} + /> + + ); +} + +export default function PrimeDashboard() { + const { top } = useSafeAreaInsets(); + const { login, loginLegacy, logout, privy, getAccessToken, user } = + usePrimeAuth(); + const navigation = useAppNavigation(); + const { fetchPrimeUserInfo } = useFetchPrimeUserInfo(); + useEffect(() => { + void fetchPrimeUserInfo(); + }, [fetchPrimeUserInfo]); + const [isLoading, setIsLoading] = useState(false); + const [selectedPackageId, setSelectedPackageId] = useState< + string | undefined + >(); + const { + presentPaywallNative, + purchasePaywallPackageWeb, + getPaywallPackagesWeb, + getPaywallPackagesNative, + getCustomerInfo, + } = usePrimePayment(); + + const loginByPrivy = useCallback(async () => { + if (platformEnv.isNative) { + // TODO: privy login Modal is conflict with OneKey Modal + navigation.popStack(); + await timerUtils.wait(1000); + } + login(); + }, [login, navigation]); + + const purchaseByWebview = useCallback(async () => { + navigation.popStack(); + await timerUtils.wait(1000); + // purchase by webview + openUrlUtils.openUrlByWebviewPro({ + url: '', + title: 'WebView', + isWebEmbed: true, + hashRoutePath: EWebEmbedRoutePath.primePurchase, + hashRouteQueryParams: { + primeUserId: user?.privyUserId || '', + primeUserEmail: user?.email || '', + }, + }); + }, [navigation, user?.privyUserId, user?.email]); + + // TODO move to jotai context method + const doPurchase = useCallback(async () => { + try { + setIsLoading(true); + if (!user?.isLoggedIn) { + return await loginByPrivy(); + // loginLegacy(); + } + if (platformEnv.isNative) { + ActionList.show({ + title: 'Purchase', + onClose: () => {}, + sections: [ + { + items: [ + { + label: 'Purchase by AppStore/GooglePlay', + // description: 'Purchase by AppStore/GooglePlay', + onPress: () => { + void presentPaywallNative?.(); + }, + }, + { + label: 'Purchase by Webview', + // description: 'Purchase by Webview', + onPress: () => { + void purchaseByWebview(); + }, + }, + ], + }, + ], + }); + return; + } + if (selectedPackageId) { + await purchasePaywallPackageWeb?.({ + packageId: selectedPackageId, + email: user?.email || '', + // locale: 'zh-CN', + }); + // await backgroundApiProxy.servicePrime.initRevenuecatPurchases({ + // privyUserId: user.privyUserId || '', + // }); + // await backgroundApiProxy.servicePrime.purchasePaywallPackage({ + // packageId: selectedPackageId, + // email: user?.email || '', + // // locale: 'zh-CN', + // }); + } + } finally { + setIsLoading(false); + await fetchPrimeUserInfo(); + } + }, [ + user?.isLoggedIn, + user?.email, + selectedPackageId, + loginByPrivy, + purchaseByWebview, + presentPaywallNative, + purchasePaywallPackageWeb, + fetchPrimeUserInfo, + ]); + + const shouldShowConfirmButton = useMemo(() => { + if (!user?.isLoggedIn) { + return true; + } + if (user?.isLoggedIn && !user?.primeSubscription?.isActive) { + return true; + } + return false; + }, [user?.isLoggedIn, user?.primeSubscription]); + + const { result: paywallPackages } = usePromiseResult(async () => { + if (!platformEnv.isNative) { + return getPaywallPackagesWeb?.(); + } + }, [getPaywallPackagesWeb]); + + const subscriptionPlans = useMemo(() => { + if ( + user?.isLoggedIn && + // !user?.primeSubscription?.isActive && + paywallPackages?.packages?.length + ) { + return ( + + ); + } + return null; + }, [user?.isLoggedIn, paywallPackages]); + + return ( + <> + + + + + + + + + + + {platformEnv.isRuntimeBrowser ? ( + + + + ) : null} + + {user?.isLoggedIn ? ( + + ) : null} + {subscriptionPlans} + + + + + + + + + + + + + + + + + + ); +} diff --git a/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeSubscriptionPlans.tsx b/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeSubscriptionPlans.tsx new file mode 100644 index 00000000000..aa9b80d8201 --- /dev/null +++ b/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeSubscriptionPlans.tsx @@ -0,0 +1,137 @@ +import { useEffect, useState } from 'react'; + +import { BigNumber } from 'bignumber.js'; + +import type { IXStackProps } from '@onekeyhq/components'; +import { + Badge, + NumberSizeableText, + SizableText, + XStack, + YStack, +} from '@onekeyhq/components'; + +import type { Package } from '@revenuecat/purchases-js'; + +function PrimeSubscriptionPlanItem({ + selected, + title, + periodDuration, + price, + currency, + ...rest +}: { + selected?: boolean; + title: string; + periodDuration: 'P1Y' | 'P1M'; + price: number; + currency: string; +} & IXStackProps) { + let promoText = ''; + let pricePerMonth = price; + if (periodDuration === 'P1Y') { + const pricePerMonthBN = new BigNumber(price).div(12); + pricePerMonth = pricePerMonthBN.toNumber(); + // const savePercent = new BigNumber(1) + // .minus(pricePerMonthBN.div(price)) + // .multipliedBy(100) + // .toFixed(1); + // promoText = `Save ${savePercent}%`; + promoText = `Save 33%`; + } + return ( + + {promoText ? ( + + {promoText} + + ) : null} + + {title} ({periodDuration}) + + + {price} + + + {pricePerMonth} + + + ); +} + +export function PrimeSubscriptionPlans({ + packages, + onPackageSelected, +}: { + packages: Package[] | undefined; + onPackageSelected: (packageId: string) => void; +}) { + const [selectedPackageId, setSelectedPackageId] = useState< + string | undefined + >(packages?.[0]?.identifier); + + useEffect(() => { + if (selectedPackageId) { + onPackageSelected(selectedPackageId); + } + }, [onPackageSelected, selectedPackageId]); + + return ( + + {packages?.map((p) => { + const selected = selectedPackageId === p.identifier; + return ( + { + setSelectedPackageId(p.identifier); + }} + currency="$" + $gtMd={{ + flex: 1, + }} + /> + ); + })} + + ); +} diff --git a/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeUserInfo.tsx b/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeUserInfo.tsx new file mode 100644 index 00000000000..97964f26700 --- /dev/null +++ b/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeUserInfo.tsx @@ -0,0 +1,56 @@ +import { StyleSheet } from 'react-native'; + +import { Badge, Icon, SizableText, XStack } from '@onekeyhq/components'; + +import { usePrimeAuth } from '../../hooks/usePrimeAuth'; + +import { PrimeUserInfoMoreButton } from './PrimeUserInfoMoreButton'; + +export function PrimeUserInfo({ + doPurchase, +}: { + doPurchase?: () => Promise; +}) { + const { user, privy } = usePrimeAuth(); + const isPrime = user?.primeSubscription?.isActive; + + return ( + + + { + console.log(privy?.web?.user); + console.log(privy?.native?.user); + }} + flex={1} + size="$bodyMdMedium" + ellipsizeMode="middle" + ellipse + > + {user?.email} + + {isPrime ? ( + + Prime + + ) : ( + + Free + + )} + + + ); +} diff --git a/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeUserInfoMoreButton.tsx b/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeUserInfoMoreButton.tsx new file mode 100644 index 00000000000..9ec6264ef1d --- /dev/null +++ b/packages/kit/src/views/Prime/pages/PrimeDashboard/PrimeUserInfoMoreButton.tsx @@ -0,0 +1,165 @@ +import { useCallback } from 'react'; + +import { + ActionList, + Badge, + Dialog, + Divider, + IconButton, + SizableText, + Stack, + Toast, + XStack, +} from '@onekeyhq/components'; +import { formatDateFns } from '@onekeyhq/shared/src/utils/dateUtils'; +import openUrlUtils from '@onekeyhq/shared/src/utils/openUrlUtils'; + +import { useFetchPrimeUserInfo } from '../../hooks/useFetchPrimeUserInfo'; +import { usePrimeAuth } from '../../hooks/usePrimeAuth'; +import { usePrimePayment } from '../../hooks/usePrimePayment'; + +function PrimeUserInfoMoreButtonDropDownMenu({ + handleActionListClose, + doPurchase, +}: { + handleActionListClose: () => void; + doPurchase?: () => Promise; +}) { + const { user, logout, updateEmail } = usePrimeAuth(); + const isPrime = user?.primeSubscription?.isActive; + const primeExpiredAt = user?.primeSubscription?.expiresAt; + const { fetchPrimeUserInfo } = useFetchPrimeUserInfo(); + const { getCustomerInfo } = usePrimePayment(); + + const userInfo = ( + + + + {user?.email} + + {isPrime ? ( + + Prime + + ) : ( + + Free + + )} + + {primeExpiredAt && isPrime ? ( + + Ends on {formatDateFns(new Date(primeExpiredAt))} + + ) : null} + + ); + return ( + <> + {userInfo} + { + Toast.success({ + title: 'Change email not implemented', + }); + updateEmail(); + }} + /> + { + Toast.success({ + title: 'Change password not implemented', + }); + }} + /> + {isPrime ? ( + <> + { + if (user.subscriptionManageUrl) { + openUrlUtils.openUrlExternal(user.subscriptionManageUrl); + } else { + Toast.message({ + title: 'Please try again later', + }); + await Promise.all([fetchPrimeUserInfo(), getCustomerInfo()]); + } + }} + /> + { + void doPurchase?.(); + }} + /> + + ) : null} + + { + Dialog.show({ + icon: 'InfoCircleOutline', + title: 'Log out', + description: 'Are you sure you want to log out?', + onConfirmText: 'Log out', + onConfirm: () => logout(), + }); + }} + /> + + ); +} + +export function PrimeUserInfoMoreButton({ + doPurchase, +}: { + doPurchase?: () => Promise; +}) { + const renderItems = useCallback( + ({ + handleActionListClose, + }: { + handleActionListClose: () => void; + handleActionListOpen: () => void; + }) => ( + + ), + [doPurchase], + ); + return ( + { + console.log('1'); + }} + /> + } + /> + ); +} diff --git a/packages/kit/src/views/Prime/pages/PrimeDashboard/index.tsx b/packages/kit/src/views/Prime/pages/PrimeDashboard/index.tsx new file mode 100644 index 00000000000..42fea5ef79e --- /dev/null +++ b/packages/kit/src/views/Prime/pages/PrimeDashboard/index.tsx @@ -0,0 +1,3 @@ +import PrimeDashboard from './PrimeDashboard'; + +export default PrimeDashboard; diff --git a/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkBase.ts b/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkBase.ts new file mode 100644 index 00000000000..477b49ca9fc --- /dev/null +++ b/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkBase.ts @@ -0,0 +1,78 @@ +import { createPromiseTarget } from '@onekeyhq/shared/src/utils/promiseUtils'; + +import type { + CustomerInfo, + Package, + PurchaseResult, +} from '@revenuecat/purchases-js'; + +export type IPurchasePackageParams = { + packageId: string; + email: string; // auto filled payment email + locale?: string; + userId: string; +}; + +export abstract class PurchasesSdkBase { + configureDonePromise = createPromiseTarget(); + + abstract getApiKey(): Promise; + + abstract getAppUserId(): Promise; + + abstract configureWithLogin(params: { + apiKey: string; + userId: string; + }): Promise; + + abstract setDefaultLogLevel(): Promise; + + abstract getCustomerInfoBase(): Promise; + + abstract getPaywallPackagesBase(): Promise; + + abstract purchasePackageBase( + params: IPurchasePackageParams, + ): Promise; + + async login(params: { userId: string }): Promise { + const apiKey = await this.getApiKey(); + if (!apiKey) { + throw new Error('No REVENUECAT api key found'); + } + if (!params.userId) { + throw new Error('No userId found'); + } + await this.setDefaultLogLevel(); + await this.configureWithLogin({ apiKey, userId: params.userId }); + this.configureDonePromise.resolveTarget(true); + } + + async ensureUserIdMatched(userId: string) { + if (!userId) { + throw new Error('No userId found'); + } + const appUserId = await this.getAppUserId(); + if (appUserId !== userId) { + throw new Error('AppUserId not match'); + } + } + + async getCustomerInfo(params: { userId: string }): Promise { + await this.login({ userId: params.userId }); + await this.ensureUserIdMatched(params.userId); + const customerInfo = await this.getCustomerInfoBase(); + return customerInfo; + } + + async getPaywallPackages() { + await this.configureDonePromise.ready; + return this.getPaywallPackagesBase(); + } + + async purchasePackage(params: IPurchasePackageParams) { + await this.configureDonePromise.ready; + await this.ensureUserIdMatched(params.userId); + return this.purchasePackageBase(params); + } +} diff --git a/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWeb.ts b/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWeb.ts new file mode 100644 index 00000000000..e71e2e68a30 --- /dev/null +++ b/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWeb.ts @@ -0,0 +1,18 @@ +import backgroundApiProxy from '../../../background/instance/backgroundApiProxy'; + +import { PurchasesSdkWebBase } from './PurchasesSdkWebBase'; + +export default class PurchasesSdkWeb extends PurchasesSdkWebBase { + async getApiKey(): Promise { + const devSettings = + await backgroundApiProxy.serviceDevSetting.getDevSetting(); + let apiKey = process.env.REVENUECAT_API_KEY_WEB; + if (devSettings?.settings?.usePrimeSandboxPayment) { + apiKey = process.env.REVENUECAT_API_KEY_WEB_SANDBOX; + } + if (!apiKey) { + throw new Error('No REVENUECAT api key found'); + } + return apiKey; + } +} diff --git a/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWebBase.ts b/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWebBase.ts new file mode 100644 index 00000000000..ddfd57d108a --- /dev/null +++ b/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWebBase.ts @@ -0,0 +1,104 @@ +import { LogLevel, Purchases } from '@revenuecat/purchases-js'; + +import { PurchasesSdkBase } from './PurchasesSdkBase'; + +import type { IPurchasePackageParams } from './PurchasesSdkBase'; +import type { + CustomerInfo, + Package, + PurchaseParams, + PurchaseResult, +} from '@revenuecat/purchases-js'; + +export abstract class PurchasesSdkWebBase extends PurchasesSdkBase { + override async configureWithLogin(params: { + apiKey: string; + userId: string; + }): Promise { + // TODO VPN required + // await Purchases.setProxyURL('https://api.rc-backup.com/'); + + // TODO how to configure another userId when user login with another account + // https://www.revenuecat.com/docs/customers/user-ids#logging-in-with-a-custom-app-user-id + const { apiKey, userId } = params; + if (!userId) { + throw new Error('No userId found'); + } + Purchases.configure(apiKey, userId); + } + + override async setDefaultLogLevel(): Promise { + if (process.env.NODE_ENV !== 'production') { + Purchases.setLogLevel(LogLevel.Verbose); + } + } + + override async getCustomerInfoBase(): Promise { + const customerInfo: CustomerInfo = + await Purchases.getSharedInstance().getCustomerInfo(); + console.log('customerInfo >>>>>> ', customerInfo); + return customerInfo; + } + + override async getPaywallPackagesBase(): Promise { + const offerings = await Purchases.getSharedInstance().getOfferings({ + currency: 'USD', + }); + const packages: Package[] = []; + + // Object.values(offerings.all).forEach((offering) => { + // packages.push(...offering.availablePackages); + // }); + packages.push(...(offerings?.current?.availablePackages || [])); + packages.sort((a) => { + // Yearly is the first + if ( + a.rcBillingProduct.presentedOfferingContext.offeringIdentifier === + 'Yearly' + ) { + return -1; + } + return 1; + }); + return packages; + } + + override async purchasePackageBase( + params: IPurchasePackageParams, + ): Promise { + try { + await this.configureDonePromise.ready; + const { packageId, email, locale } = params; + // const offerings = await this.getPaywallOfferings(); + // const paywallPackage = offerings?.all?.monthly?.packagesById?.[packageId]; + const packages = await this.getPaywallPackages(); + const paywallPackage = packages.find((p) => p.identifier === packageId); + if (!paywallPackage) { + throw new Error('purchasePaywallPackage ERROR: Invalid packageId'); + } + const purchaseParams: PurchaseParams = { + rcPackage: paywallPackage, + customerEmail: email, + selectedLocale: locale, + }; + // TODO check package user is Matched to privyUserId + // TODO check if user has already purchased + const purchase = await Purchases.getSharedInstance().purchase( + purchaseParams, + ); + // test credit card + // https://docs.stripe.com/testing#testing-interactively + // Mastercard: 5555555555554444 + // visa: 4242424242424242 + console.log('purchase >>>>>> ', purchase); + return purchase; + } catch (error) { + console.error('purchasePackageBase ERROR >>>>>> ', error); + throw error; + } + } + + async getAppUserId(): Promise { + return Purchases.getSharedInstance().getAppUserId(); + } +} diff --git a/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWebEmbed.ts b/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWebEmbed.ts new file mode 100644 index 00000000000..57a3b38fc59 --- /dev/null +++ b/packages/kit/src/views/Prime/purchasesSdk/PurchasesSdkWebEmbed.ts @@ -0,0 +1,8 @@ +import { PurchasesSdkWebBase } from './PurchasesSdkWebBase'; + +export default class PurchasesSdkWeb extends PurchasesSdkWebBase { + async getApiKey(): Promise { + const settings = globalThis.WEB_EMBED_ONEKEY_APP_SETTINGS; + return settings?.revenuecatApiKey || ''; + } +} diff --git a/packages/kit/src/views/Prime/purchasesSdk/purchasesSdk.ts b/packages/kit/src/views/Prime/purchasesSdk/purchasesSdk.ts new file mode 100644 index 00000000000..2d07d272ccc --- /dev/null +++ b/packages/kit/src/views/Prime/purchasesSdk/purchasesSdk.ts @@ -0,0 +1,3 @@ +import PurchasesSdkWeb from './PurchasesSdkWeb'; + +export default new PurchasesSdkWeb(); diff --git a/packages/kit/src/views/Prime/purchasesSdk/purchasesSdk.webEmbed.ts b/packages/kit/src/views/Prime/purchasesSdk/purchasesSdk.webEmbed.ts new file mode 100644 index 00000000000..c1ed4fe138b --- /dev/null +++ b/packages/kit/src/views/Prime/purchasesSdk/purchasesSdk.webEmbed.ts @@ -0,0 +1,3 @@ +import PurchasesSdkWebEmbed from './PurchasesSdkWebEmbed'; + +export default new PurchasesSdkWebEmbed(); diff --git a/packages/kit/src/views/Prime/router/index.ts b/packages/kit/src/views/Prime/router/index.ts new file mode 100644 index 00000000000..3050e058b5e --- /dev/null +++ b/packages/kit/src/views/Prime/router/index.ts @@ -0,0 +1,17 @@ +import type { IModalFlowNavigatorConfig } from '@onekeyhq/components'; +import type { IPrimeParamList } from '@onekeyhq/shared/src/routes/prime'; +import { EPrimePages } from '@onekeyhq/shared/src/routes/prime'; + +import { LazyLoadPage } from '../../../components/LazyLoadPage'; + +const PrimeDashboard = LazyLoadPage(() => import('../pages/PrimeDashboard')); + +export const PrimeRouter: IModalFlowNavigatorConfig< + EPrimePages, + IPrimeParamList +>[] = [ + { + name: EPrimePages.PrimeDashboard, + component: PrimeDashboard, + }, +]; diff --git a/packages/kit/src/views/Setting/pages/List/DevSettingsSection/index.tsx b/packages/kit/src/views/Setting/pages/List/DevSettingsSection/index.tsx index 3ff0d3fb4d6..db3072d3104 100644 --- a/packages/kit/src/views/Setting/pages/List/DevSettingsSection/index.tsx +++ b/packages/kit/src/views/Setting/pages/List/DevSettingsSection/index.tsx @@ -17,6 +17,7 @@ import backgroundApiProxy from '@onekeyhq/kit/src/background/instance/background import { ListItem } from '@onekeyhq/kit/src/components/ListItem'; import { Section } from '@onekeyhq/kit/src/components/Section'; import useAppNavigation from '@onekeyhq/kit/src/hooks/useAppNavigation'; +import { WebEmbedDevConfig } from '@onekeyhq/kit/src/views/Developer/pages/Gallery/Components/stories/WebEmbed'; import { useSettingsPersistAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms'; import { useDevSettingsPersistAtom } from '@onekeyhq/kit-bg/src/states/jotai/atoms/devSettings'; import type { IBackgroundMethodWithDevOnlyPassword } from '@onekeyhq/shared/src/background/backgroundDecorators'; @@ -61,7 +62,7 @@ if (process.env.NODE_ENV !== 'production') { correctDevOnlyPwd = `${formatDateFns(new Date(), 'yyyyMMdd')}-onekey-debug`; } -function showDevOnlyPasswordDialog({ +export function showDevOnlyPasswordDialog({ title, description, onConfirm, @@ -311,6 +312,16 @@ export const DevSettingsSection = () => { > + + + + + + { + + { + const dialog = Dialog.cancel({ + title: 'WebEmbedDevConfig', + renderContent: , + }); + }} + /> ); }; diff --git a/packages/kit/src/views/Setting/utils/devMode.ts b/packages/kit/src/views/Setting/utils/devMode.ts index 22cf9da7701..cd9a551177d 100644 --- a/packages/kit/src/views/Setting/utils/devMode.ts +++ b/packages/kit/src/views/Setting/utils/devMode.ts @@ -1,6 +1,8 @@ import { Dialog } from '@onekeyhq/components'; import backgroundApiProxy from '@onekeyhq/kit/src/background/instance/backgroundApiProxy'; +import { showDevOnlyPasswordDialog } from '../pages/List/DevSettingsSection'; + // for open dev mode let clickCount = 0; let startTime: Date | undefined; @@ -48,17 +50,27 @@ export const handleOpenDevMode = async (callback: () => void) => { isPasswordVerifying = true; try { await showPromoteDialog(); - await backgroundApiProxy.servicePassword.promptPasswordVerify({ - dialogProps: { - confirmButtonProps: { - testID: 'confirm-button', + try { + await backgroundApiProxy.servicePassword.promptPasswordVerify({ + dialogProps: { + confirmButtonProps: { + testID: 'confirm-button', + }, + description: + 'Danger Zone: Are you sure you want to enable developer-related features?', + dismissOnOverlayPress: false, + }, + }); + await backgroundApiProxy.serviceDevSetting.switchDevMode(true); + } catch (error) { + showDevOnlyPasswordDialog({ + title: 'Danger Zone', + description: 'Fallback to devOnlyPassword verification', + onConfirm: async () => { + await backgroundApiProxy.serviceDevSetting.switchDevMode(true); }, - description: - 'Danger Zone: Are you sure you want to enable developer-related features?', - dismissOnOverlayPress: false, - }, - }); - await backgroundApiProxy.serviceDevSetting.switchDevMode(true); + }); + } } catch (error) { /* empty */ } finally { diff --git a/packages/kit/src/views/WebView/pages/WebViewModal/index.tsx b/packages/kit/src/views/WebView/pages/WebViewModal/index.tsx index 276fac6511b..e42836e7ca9 100644 --- a/packages/kit/src/views/WebView/pages/WebViewModal/index.tsx +++ b/packages/kit/src/views/WebView/pages/WebViewModal/index.tsx @@ -8,6 +8,7 @@ import { Share } from 'react-native'; import { ActionList, Page, useClipboard } from '@onekeyhq/components'; import { HeaderIconButton } from '@onekeyhq/components/src/layouts/Navigation/Header'; import WebView from '@onekeyhq/kit/src/components/WebView'; +import { WebViewWebEmbed } from '@onekeyhq/kit/src/components/WebViewWebEmbed'; import { ETranslations } from '@onekeyhq/shared/src/locale'; import platformEnv from '@onekeyhq/shared/src/platformEnv'; import type { @@ -22,7 +23,8 @@ export default function WebViewModal() { const { webviewRef, setWebViewRef } = useWebViewBridge(); const route = useRoute>(); - const { url, title } = route.params; + const { url, title, isWebEmbed, hashRoutePath, hashRouteQueryParams } = + route.params; const { copyText } = useClipboard(); const intl = useIntl(); const headerRight = useCallback( @@ -98,11 +100,18 @@ export default function WebViewModal() { - ref && setWebViewRef(ref)} - src={url} - onNavigationStateChange={onNavigationStateChange} - /> + {isWebEmbed ? ( + + ) : ( + ref && setWebViewRef(ref)} + src={url} + onNavigationStateChange={onNavigationStateChange} + /> + )} ); diff --git a/packages/shared/src/analytics/index.ts b/packages/shared/src/analytics/index.ts index 1187224d40c..24f11594852 100644 --- a/packages/shared/src/analytics/index.ts +++ b/packages/shared/src/analytics/index.ts @@ -2,7 +2,7 @@ import Axios from 'axios'; import appGlobals from '../appGlobals'; import platformEnv from '../platformEnv'; -import { headerPlatform } from '../request/Interceptor'; +import { headerPlatform } from '../request/InterceptorConsts'; import { getDeviceInfo } from './deviceInfo'; diff --git a/packages/shared/src/appApiClient/appApiClient.ts b/packages/shared/src/appApiClient/appApiClient.ts index 9fdc9d635ef..0f39d0b7011 100644 --- a/packages/shared/src/appApiClient/appApiClient.ts +++ b/packages/shared/src/appApiClient/appApiClient.ts @@ -18,6 +18,7 @@ const clients: Record = { [EServiceEndpointEnum.Earn]: null, [EServiceEndpointEnum.Notification]: null, [EServiceEndpointEnum.NotificationWebSocket]: null, + [EServiceEndpointEnum.Prime]: null, }; const rawDataClients: Record = { @@ -28,6 +29,7 @@ const rawDataClients: Record = { [EServiceEndpointEnum.Earn]: null, [EServiceEndpointEnum.Notification]: null, [EServiceEndpointEnum.NotificationWebSocket]: null, + [EServiceEndpointEnum.Prime]: null, }; const getBasicClient = async ({ @@ -100,6 +102,7 @@ const getRawDataClient = memoizee( ); const appApiClient = { + getBasicClient, getClient, getRawDataClient, }; diff --git a/packages/shared/src/cloudfs/index.android.ts b/packages/shared/src/cloudfs/index.android.ts index 14fc5cd18ee..934da766a47 100644 --- a/packages/shared/src/cloudfs/index.android.ts +++ b/packages/shared/src/cloudfs/index.android.ts @@ -3,6 +3,7 @@ import RNCloudFs from 'react-native-cloud-fs'; // import debugLogger from '@onekeyhq/shared/src/logger/debugLogger'; +import googlePlayService from '../googlePlayService/googlePlayService'; import platformEnv from '../platformEnv'; const GoogleSignInConfigure = { @@ -18,14 +19,7 @@ export function backupPlatform() { } export async function isAvailable(): Promise { - try { - const hasPlayServices = await GoogleSignin.hasPlayServices({ - showPlayServicesUpdateDialog: false, - }); - return hasPlayServices; - } catch (e) { - return false; - } + return googlePlayService.isAvailable(); } export async function loginIfNeeded( diff --git a/packages/shared/src/config/endpointsMap.ts b/packages/shared/src/config/endpointsMap.ts index 7a61159927a..6b6db4d784a 100644 --- a/packages/shared/src/config/endpointsMap.ts +++ b/packages/shared/src/config/endpointsMap.ts @@ -39,6 +39,10 @@ export const endpointsMap: Record = { env: 'test', isWebSocket: true, }), + prime: buildServiceEndpoint({ + serviceName: EServiceEndpointEnum.Prime, + env: 'test', + }), }, prod: { wallet: buildServiceEndpoint({ @@ -70,6 +74,10 @@ export const endpointsMap: Record = { env: 'prod', isWebSocket: true, }), + prime: buildServiceEndpoint({ + serviceName: EServiceEndpointEnum.Prime, + env: 'prod', + }), }, }; diff --git a/packages/shared/src/consts/webEmbedConsts.ts b/packages/shared/src/consts/webEmbedConsts.ts new file mode 100644 index 00000000000..4359c375702 --- /dev/null +++ b/packages/shared/src/consts/webEmbedConsts.ts @@ -0,0 +1,5 @@ +export enum EWebEmbedRoutePath { + index = '/', + primePurchase = '/prime/purchase', + webEmbedApi = '/webembed/api', +} diff --git a/packages/shared/src/errors/errors/appErrors.ts b/packages/shared/src/errors/errors/appErrors.ts index 5d11125e4f4..bc683a5f581 100644 --- a/packages/shared/src/errors/errors/appErrors.ts +++ b/packages/shared/src/errors/errors/appErrors.ts @@ -142,6 +142,19 @@ export class PasswordPromptDialogCancel extends OneKeyError { override className = EOneKeyErrorClassNames.PasswordPromptDialogCancel; } +export class PrimeLoginDialogCancelError extends OneKeyError { + constructor(props?: IOneKeyError | string) { + super( + normalizeErrorProps(props, { + defaultMessage: 'PrimeLoginDialogCancelError', + defaultKey: ETranslations.global_cancel, + }), + ); + } + + override className = EOneKeyErrorClassNames.PrimeLoginDialogCancelError; +} + export class FailedToTransfer extends OneKeyError { constructor(props?: IOneKeyError) { super( diff --git a/packages/shared/src/errors/errors/baseErrors.ts b/packages/shared/src/errors/errors/baseErrors.ts index 2483b0557a4..732d67c837a 100644 --- a/packages/shared/src/errors/errors/baseErrors.ts +++ b/packages/shared/src/errors/errors/baseErrors.ts @@ -9,6 +9,7 @@ import type { } from '@onekeyhq/shared/src/locale'; import { EOneKeyErrorClassNames } from '../types/errorTypes'; +import { normalizeErrorProps } from '../utils/errorUtils'; import type { IOneKeyAPIBaseResponse } from '../../../types/request'; import type { @@ -148,6 +149,15 @@ export class OneKeyServerApiError extends OneKeyError< any, IOneKeyAPIBaseResponse > { + constructor(props?: IOneKeyError | string) { + super( + normalizeErrorProps(props, { + defaultMessage: 'OneKeyServerApiError', + // defaultKey: ETranslations.auth_error_passcode_incorrect, + }), + ); + } + override className?: EOneKeyErrorClassNames | undefined = EOneKeyErrorClassNames.OneKeyServerApiError; } diff --git a/packages/shared/src/errors/types/errorTypes.ts b/packages/shared/src/errors/types/errorTypes.ts index c60b00993e3..fedb46b3e13 100644 --- a/packages/shared/src/errors/types/errorTypes.ts +++ b/packages/shared/src/errors/types/errorTypes.ts @@ -26,6 +26,7 @@ export enum EOneKeyErrorClassNames { OneKeyWalletConnectModalCloseError = 'OneKeyWalletConnectModalCloseError', OneKeyAlreadyExistWalletError = 'OneKeyAlreadyExistWalletError', PasswordPromptDialogCancel = 'PasswordPromptDialogCancel', + PrimeLoginDialogCancelError = 'PrimeLoginDialogCancelError', VaultKeyringNotDefinedError = 'VaultKeyringNotDefinedError', OneKeyErrorInsufficientNativeBalance = 'OneKeyErrorInsufficientNativeBalance', OneKeyErrorNotImplemented = 'OneKeyErrorNotImplemented', diff --git a/packages/shared/src/eventBus/appEventBus.ts b/packages/shared/src/eventBus/appEventBus.ts index afc6274ae9c..cb9687e355e 100644 --- a/packages/shared/src/eventBus/appEventBus.ts +++ b/packages/shared/src/eventBus/appEventBus.ts @@ -2,7 +2,10 @@ import { CrossEventEmitter } from '@onekeyfe/cross-inpage-provider-core'; import { cloneDeep } from 'lodash'; -import type { IQrcodeDrawType } from '@onekeyhq/components'; +import type { + IDialogLoadingProps, + IQrcodeDrawType, +} from '@onekeyhq/components'; import type { IDBAccount } from '@onekeyhq/kit-bg/src/dbs/local/types'; import type { IAccountSelectorSelectedAccount } from '@onekeyhq/kit-bg/src/dbs/simple/entity/SimpleDbEntityAccountSelector'; import type { IAccountDeriveTypes } from '@onekeyhq/kit-bg/src/vaults/types'; @@ -52,6 +55,8 @@ export enum EAppEventBusNames { WalletConnectOpenModal = 'WalletConnectOpenModal', WalletConnectCloseModal = 'WalletConnectCloseModal', WalletConnectModalState = 'WalletConnectModalState', + ShowDialogLoading = 'ShowDialogLoading', + HideDialogLoading = 'HideDialogLoading', ShowToast = 'ShowToast', ShowAirGapQrcode = 'ShowAirGapQrcode', HideAirGapQrcode = 'HideAirGapQrcode', @@ -100,6 +105,8 @@ export enum EAppEventBusNames { export interface IAppEventBusPayload { [EAppEventBusNames.ConfirmAccountSelected]: undefined; + [EAppEventBusNames.ShowDialogLoading]: IDialogLoadingProps; + [EAppEventBusNames.HideDialogLoading]: undefined; [EAppEventBusNames.WalletClear]: undefined; [EAppEventBusNames.WalletUpdate]: undefined; [EAppEventBusNames.WalletRemove]: { diff --git a/packages/shared/src/googlePlayService/googlePlayService.android.ts b/packages/shared/src/googlePlayService/googlePlayService.android.ts new file mode 100644 index 00000000000..ea4ff017afb --- /dev/null +++ b/packages/shared/src/googlePlayService/googlePlayService.android.ts @@ -0,0 +1,23 @@ +import { GoogleSignin } from '@react-native-google-signin/google-signin'; + +import type { IGooglePlayService } from './googlePlayServiceTypes'; + +const googlePlayService: IGooglePlayService = { + isAvailable: async () => { + try { + const hasPlayServices = await GoogleSignin.hasPlayServices({ + showPlayServicesUpdateDialog: false, + }); + console.log( + 'googlePlayService: isAvailable result >>>>> ', + hasPlayServices, + ); + return hasPlayServices; + } catch (e) { + console.error('googlePlayService: isAvailable error >>>>> ', e); + return false; + } + }, +}; + +export default googlePlayService; diff --git a/packages/shared/src/googlePlayService/googlePlayService.ts b/packages/shared/src/googlePlayService/googlePlayService.ts new file mode 100644 index 00000000000..b35dba39177 --- /dev/null +++ b/packages/shared/src/googlePlayService/googlePlayService.ts @@ -0,0 +1,7 @@ +import type { IGooglePlayService } from './googlePlayServiceTypes'; + +const googlePlayService: IGooglePlayService = { + isAvailable: () => Promise.resolve(false), +}; + +export default googlePlayService; diff --git a/packages/shared/src/googlePlayService/googlePlayServiceTypes.ts b/packages/shared/src/googlePlayService/googlePlayServiceTypes.ts new file mode 100644 index 00000000000..4a854981ab8 --- /dev/null +++ b/packages/shared/src/googlePlayService/googlePlayServiceTypes.ts @@ -0,0 +1,3 @@ +export type IGooglePlayService = { + isAvailable: () => Promise; +}; diff --git a/packages/shared/src/modules3rdParty/sentry/index.desktop.ts b/packages/shared/src/modules3rdParty/sentry/index.desktop.ts index ec7da3b7b78..a20b55c5878 100644 --- a/packages/shared/src/modules3rdParty/sentry/index.desktop.ts +++ b/packages/shared/src/modules3rdParty/sentry/index.desktop.ts @@ -5,6 +5,8 @@ import { withErrorBoundary, withProfiler } from '@sentry/react'; import { buildIntegrations } from './basicOptions'; +import type { FallbackRender } from '@sentry/react'; + export * from '@sentry/electron/renderer'; export * from './basicOptions'; @@ -24,9 +26,11 @@ export const nativeCrash = () => {}; export const withSentryHOC = ( Component: ComponentType, + errorBoundaryFallback?: FallbackRender, ): ComponentType => withErrorBoundary(withProfiler(Component), { onError: (error, info) => { console.error('error', error, info); }, + fallback: errorBoundaryFallback, }); diff --git a/packages/shared/src/modules3rdParty/sentry/index.ext.ts b/packages/shared/src/modules3rdParty/sentry/index.ext.ts index 44bea28990f..1d63aab3f31 100644 --- a/packages/shared/src/modules3rdParty/sentry/index.ext.ts +++ b/packages/shared/src/modules3rdParty/sentry/index.ext.ts @@ -4,6 +4,8 @@ import * as Sentry from '@sentry/react'; import { basicOptions, buildIntegrations, buildOptions } from './basicOptions'; +import type { FallbackRender } from '@sentry/react'; + export const initSentry = () => { if (process.env.NODE_ENV !== 'production') { return; @@ -24,9 +26,11 @@ export const nativeCrash = () => {}; export const withSentryHOC = ( Component: ComponentType, + errorBoundaryFallback?: FallbackRender, ): ComponentType => Sentry.withErrorBoundary(Sentry.withProfiler(Component), { onError: (error, info) => { console.error('error', error, info); }, + fallback: errorBoundaryFallback, }); diff --git a/packages/shared/src/modules3rdParty/sentry/index.native.ts b/packages/shared/src/modules3rdParty/sentry/index.native.ts index e8b724057b8..efdf8b17094 100644 --- a/packages/shared/src/modules3rdParty/sentry/index.native.ts +++ b/packages/shared/src/modules3rdParty/sentry/index.native.ts @@ -12,6 +12,8 @@ import { import { basicOptions, navigationIntegration } from './basicOptions'; +import type { FallbackRender } from '@sentry/react'; + export * from '@sentry/react-native'; export * from './basicOptions'; @@ -41,9 +43,11 @@ export const nativeCrash = sentryNativeCrash; export const withSentryHOC = ( Component: ComponentType, + errorBoundaryFallback?: FallbackRender, ): ComponentType => withErrorBoundary(withProfiler(wrap(Component)), { onError: (error, info) => { console.error('error', error, info); }, + fallback: errorBoundaryFallback, }); diff --git a/packages/shared/src/modules3rdParty/sentry/index.ts b/packages/shared/src/modules3rdParty/sentry/index.ts index 4bbd8fcf43a..fb39b9dc31f 100644 --- a/packages/shared/src/modules3rdParty/sentry/index.ts +++ b/packages/shared/src/modules3rdParty/sentry/index.ts @@ -4,6 +4,8 @@ import * as Sentry from '@sentry/react'; import { basicOptions, buildIntegrations, buildOptions } from './basicOptions'; +import type { FallbackRender } from '@sentry/react'; + export * from '@sentry/react'; export * from './basicOptions'; @@ -22,11 +24,16 @@ export const initSentry = () => { export const nativeCrash = () => {}; +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export const addBreadcrumb = (args: any) => {}; + export const withSentryHOC = ( Component: ComponentType, + errorBoundaryFallback?: FallbackRender, ): ComponentType => Sentry.withErrorBoundary(Sentry.withProfiler(Component), { onError: (error, info) => { console.error('error', error, info); }, + fallback: errorBoundaryFallback, }); diff --git a/packages/shared/src/modules3rdParty/sentry/index.webEmbed.ts b/packages/shared/src/modules3rdParty/sentry/index.webEmbed.ts deleted file mode 100644 index 0dfc099e379..00000000000 --- a/packages/shared/src/modules3rdParty/sentry/index.webEmbed.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const initSentry = () => {}; -export const nativeCrash = () => {}; diff --git a/packages/shared/src/modules3rdParty/stripe-v3/index.js b/packages/shared/src/modules3rdParty/stripe-v3/index.js new file mode 100644 index 00000000000..18c78c3b30b --- /dev/null +++ b/packages/shared/src/modules3rdParty/stripe-v3/index.js @@ -0,0 +1 @@ +!function(){function e(t){var n=o[t];if(void 0!==n)return n.exports;var i=o[t]={id:t,loaded:!1,exports:{}};return r[t](i,i.exports,e),i.loaded=!0,i.exports}var t,n,r={723:function(e,t,n){"use strict";function r(e){l.length||(a(),!0),l[l.length]=e}function o(){for(;d1024){for(var t=0,n=l.length-d;tq.length&&q.push(e)}function d(e,t,n,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a=!1;if(null===e)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case b:case w:a=!0}}if(a)return n(o,e,""===t?"."+m(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var c=0;c=2)throw new o.No("It seems that you have more than one of deferredPaymentRequest, recurringPaymentRequest, and automaticReloadPaymentRequest set in your Apple Pay config. Please only set one of the three.");if(a&&!!a.freeCancellationDate!=!!a.freeCancellationDateTimeZone)throw new o.No("It seems that you have only set one of deferredPaymentRequest.freeCancellationDate and deferredPaymentRequest.freeCancellationDateTimezone. Please set both or none of them.");if(null!=c&&null!==(t=c.regularBilling)&&void 0!==t&&t.recurringPaymentStartDate&&c.regularBilling.recurringPaymentEndDate&&c.regularBilling.recurringPaymentStartDate.getTime()>=c.regularBilling.recurringPaymentEndDate.getTime())throw new o.No("It seems that you have set recurringPaymentRequest.regularBilling.recurringPaymentStartDate to a date that is after or on recurringPaymentRequest.regularBilling.recurringPaymentEndDate. Please set recurringPaymentRequest.regularBilling.recurringPaymentStartDate to a date that is before recurringPaymentRequest.regularBilling.recurringPaymentEndDate.");if(null!=c&&null!==(n=c.trialBilling)&&void 0!==n&&n.recurringPaymentStartDate&&c.trialBilling.recurringPaymentEndDate&&c.trialBilling.recurringPaymentStartDate.getTime()>=c.trialBilling.recurringPaymentEndDate.getTime())throw new o.No("It seems that you have set recurringPaymentRequest.trialBilling.recurringPaymentStartDate to a date that is after or on recurringPaymentRequest.trialBilling.recurringPaymentEndDate. Please set recurringPaymentRequest.trialBilling.recurringPaymentStartDate to a date that is before recurringPaymentRequest.trialBilling.recurringPaymentEndDate.");if("checkout"!==i&&"payment_link"!==i&&u||"checkout"!==i&&"payment_link"!==i&&l)throw new o.No("Coupon codes are not supported.")},g=function(e){var t=e.applePay,n=(0,a.VC)(14),r=[];t.recurringPaymentRequest&&!n&&r.push("`applePay.recurringPaymentRequest` is only supported with Apple Pay in Safari 16.0+ and iOS 16.0+.");var o=(0,a.VC)(14);t.automaticReloadPaymentRequest&&!o&&r.push("`applePay.automaticReloadPaymentRequest` is only supported with Apple Pay in Safari 16.0+ and iOS 16.0+.");var i=(0,a.VC)(15);return t.deferredPaymentRequest&&!i&&r.push("`applePay.deferredPaymentRequest` is only supported with Apple Pay in Safari 16.5+ and iOS 16.5+."),r}},4716:function(e,t,n){"use strict";n.d(t,{_0:function(){return d},YA:function(){return s},_y:function(){return p},A2:function(){return u}});var r,o,i,a=n(4942),c=n(942),s=(r={},(0,a.Z)(r,c.Yj.card,{unique:!0,conflict:[c.Yj.cardNumber,c.Yj.cardExpiry,c.Yj.cardCvc,c.Yj.postalCode],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.cardNumber,{unique:!0,conflict:[c.Yj.card],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.cardExpiry,{unique:!0,conflict:[c.Yj.card],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.cardCvc,{unique:!0,conflict:[c.Yj.card],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.postalCode,{unique:!0,conflict:[c.Yj.card],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.paymentRequestButton,{unique:!0,conflict:[],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.iban,{unique:!0,conflict:[],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.idealBank,{unique:!0,conflict:[],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.p24Bank,{unique:!0,conflict:[],beta:!1,implementation:"legacy"}),(0,a.Z)(r,c.Yj.auBankAccount,{unique:!0,beta:!1,conflict:[],implementation:"legacy"}),(0,a.Z)(r,c.Yj.fpxBank,{unique:!0,beta:!1,conflict:[],implementation:"legacy"}),(0,a.Z)(r,c.Yj.netbankingBank,{unique:!0,beta:!0,conflict:[],implementation:"legacy"}),(0,a.Z)(r,c.Yj.issuingCardCopyButton,{unique:!1,beta:!0,conflict:[],implementation:"legacy"}),(0,a.Z)(r,c.Yj.issuingCardNumberDisplay,{unique:!1,beta:!0,conflict:[],implementation:"legacy"}),(0,a.Z)(r,c.Yj.issuingCardCvcDisplay,{unique:!1,beta:!0,conflict:[],implementation:"legacy"}),(0,a.Z)(r,c.Yj.issuingCardExpiryDisplay,{unique:!1,beta:!0,conflict:[],implementation:"legacy"}),(0,a.Z)(r,c.Yj.issuingCardPinDisplay,{unique:!1,beta:!0,conflict:[],implementation:"legacy"}),(0,a.Z)(r,c.Yj.epsBank,{unique:!0,conflict:[],beta:!0,implementation:"legacy"}),(0,a.Z)(r,c.Yj.affirmMessage,{unique:!1,conflict:[],beta:!1,implementation:"affirm_message"}),(0,a.Z)(r,c.Yj.afterpayClearpayMessage,{unique:!1,conflict:[],beta:!1,implementation:"afterpay_message"}),(0,a.Z)(r,c.Yj.unifiedMessage,{unique:!1,conflict:[],beta:!0,implementation:"payment_method_messaging"}),(0,a.Z)(r,c.Yj.paymentMethodMessaging,{unique:!1,conflict:[],beta:!1,implementation:"payment_method_messaging"}),(0,a.Z)(r,c.Yj.linkAuthentication,{unique:!0,conflict:[],beta:!1,implementation:"frame"}),(0,a.Z)(r,c.Yj.payment,{unique:!0,conflict:[],beta:!1,implementation:"frame"}),(0,a.Z)(r,c.Yj.shippingAddress,{unique:!0,conflict:[c.Yj.address],beta:!0,implementation:"frame"}),(0,a.Z)(r,c.Yj.address,{unique:!1,conflict:[c.Yj.shippingAddress],beta:!1,implementation:"frame"}),(0,a.Z)(r,c.Yj.expressCheckout,{unique:!0,conflict:[c.Yj.payButton],beta:!1,implementation:"express_checkout"}),(0,a.Z)(r,c.Yj.payButton,{unique:!0,conflict:[c.Yj.expressCheckout],beta:!0,implementation:"express_checkout"}),(0,a.Z)(r,c.Yj.currencySelector,{unique:!0,conflict:[],beta:!0,implementation:"frame"}),r),u="__PrivateStripeElement",l=["brand"],d=(o={},(0,a.Z)(o,c.Yj.card,l),(0,a.Z)(o,c.Yj.cardNumber,l),(0,a.Z)(o,c.Yj.iban,["country","bankName"]),(0,a.Z)(o,c.Yj.auBankAccount,["bankName","branchName"]),o),p=(i={},(0,a.Z)(i,c.Yj.idealBank,{secondary:c.Yj.idealBankSecondary}),(0,a.Z)(i,c.Yj.p24Bank,{secondary:c.Yj.p24BankSecondary}),(0,a.Z)(i,c.Yj.fpxBank,{secondary:c.Yj.fpxBankSecondary}),(0,a.Z)(i,c.Yj.netbankingBank,{secondary:c.Yj.netbankingBankSecondary}),(0,a.Z)(i,c.Yj.epsBank,{secondary:c.Yj.epsBankSecondary}),i)},2543:function(e,t,n){"use strict";n.d(t,{Am:function(){return s},Dx:function(){return u},GN:function(){return i},UQ:function(){return c},d6:function(){return d},sg:function(){return a},uY:function(){return l}});var r=n(1413),o=n(4417),i={billingAddressRequired:!0,shippingAddressRequired:!1},a=["always","auto","never"],c=["auto","never"],s=(0,r.Z)((0,r.Z)({},(0,o.ff)((function(){return"never"}))),{},{googlePay:"never",applePay:"never",paypal:"never",link:"never"}),u={applePay:["add-money","book","buy","check-out","contribute","donate","order","plain","reload","rent","subscribe","support","tip","top-up"],googlePay:["book","buy","checkout","donate","order","pay","plain","subscribe"],paypal:["paypal","checkout","buynow","pay"],klarna:["continue","pay"],link:["link"]},l={applePay:["black","white","white-outline"],googlePay:["black","white"],paypal:["gold","blue","silver","white","black"],klarna:["dark","light","outlined"],link:["default"]},d=["fail","invalid_shipping_address"]},4417:function(e,t,n){"use strict";n.d(t,{bj:function(){return f},ff:function(){return d},pd:function(){return l},r2:function(){return p}});var r=n(4942),o=n(1413),i=n(3324),a=n(1647),c=n(3550),s=n(2024),u=function(e){return Object.keys(a.H).reduce((function(t,n){var c=n,s=e(c,a.H[c]),u=(0,i.Z)(s,2),l=u[0],d=u[1];return(0,o.Z)((0,o.Z)({},t),{},(0,r.Z)({},l,d))}),{})},l=function(e){return u((function(t,n){return[t,e(t,n)]}))},d=function(e){return u((function(t,n){return[m(t),e(t,n)]}))},p=function(e){return f().indexOf(e)>=0},m=function(e){return(0,c.i3)(e)},f=(0,c.qe)((function(){return(0,s.qh)(a.H).map((function(e){return(0,i.Z)(e,1)[0]}))}))},1647:function(e,t,n){"use strict";n.d(t,{H:function(){return l}});var r,o=n(4942),i=["pay","checkout"],a=["light","dark"],c=n(3333),s={thirdPartyFrameType:"AmazonPayButton",isSupported:(0,c.gG)()&&!c.aS,rolloutConfig:{type:"ga",circuitBreaker:"elements_disable_express_checkout_button_amazon_pay"},recurringFlowsRolloutConfig:{type:"ga",circuitBreaker:"elements_disable_recurring_express_checkout_button_amazon_pay"},confirmationTokenRolloutConfig:{type:"ga"},supportedButtonThemes:a,defaultButtonTheme:"light",defaultBackgroundDarkButtonTheme:"light",defaultBackgroundLightButtonTheme:"dark",supportedButtonTypes:i,defaultButtonTypeOption:"pay",plainButtonType:"pay",isNextActionSupported:!0},u={thirdPartyFrameType:"DemoPayButton",isSupported:!0,rolloutConfig:{type:"beta",betaGate:"elements_enable_express_checkout_button_demo_pay"},recurringFlowsRolloutConfig:{type:"ga"},confirmationTokenRolloutConfig:{type:"ga"},supportedButtonThemes:a,defaultButtonTheme:"light",defaultBackgroundDarkButtonTheme:"light",defaultBackgroundLightButtonTheme:"dark",supportedButtonTypes:i,defaultButtonTypeOption:"pay",plainButtonType:"pay",isNextActionSupported:!0},l=(r={},(0,o.Z)(r,"demo_pay",u),(0,o.Z)(r,"amazon_pay",s),r)},3514:function(e,t,n){"use strict";n.d(t,{r4:function(){return H},lK:function(){return se},PY:function(){return ce},lH:function(){return ue},oN:function(){return te},a1:function(){return ne},uU:function(){return re}});var r=n(5987),o=n(1413),i=n(9062),a=n(1873),c=n(8812),s=n(7955),u=n(1765),l=n(1743),d=n(2967),p=n(2543),m=n(4417),f=n(1647),_=((0,m.bj)(),(0,m.ff)((function(e,t){return t})),(0,m.pd)((function(e,t){return t.thirdPartyFrameType})),(0,m.pd)((function(e,t){return t.isSupported})),(0,m.ff)((function(e,t){return t.supportedButtonThemes})),(0,m.ff)((function(e,t){return t.defaultBackgroundLightButtonTheme})),(0,m.ff)((function(e,t){return t.defaultBackgroundDarkButtonTheme})),(0,m.ff)((function(e,t){return t.defaultButtonTypeOption})),(0,m.ff)((function(e,t){return t.supportedButtonTypes})),(0,m.ff)((function(e,t){return t.plainButtonType})),(0,m.pd)((function(e,t){return t.isNextActionSupported})),(0,m.ff)((function(){return(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.UQ)))}))),h=((0,m.ff)((function(e,t){return t.rolloutConfig})),f.H,n(9620)),y=n(8229),v=function(e){return"apple_pay_inner"===e||"apple_pay_outer"===e||"applePayOuter"===e||"applePayInner"===e},g=["lineItems"],b=(0,a.mC)({isEligible:a.Xg,type:a.kw.apply(void 0,(0,i.Z)(y.mY))}),w=(0,a.mC)({isEligible:a.HM,type:a.kw.apply(void 0,(0,i.Z)(y.mY))}),k=Object.freeze((0,o.Z)({applePay:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.sg))),googlePay:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.sg))),paypal:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.UQ))),link:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.UQ))),klarna:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.UQ)))},_)),S=Object.freeze({applePay:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.uY.applePay))),googlePay:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.uY.googlePay))),paypal:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.uY.paypal))),klarna:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.uY.klarna)))}),C=Object.freeze({applePay:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.Dx.applePay))),googlePay:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.Dx.googlePay))),paypal:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.Dx.paypal))),klarna:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.Dx.klarna)))}),E=(0,a.kw)("auto","horizontal","vertical"),A=Object.keys(l.yv),P=(0,a.jt)(a.kw.apply(void 0,A)),M=Object.freeze((0,o.Z)((0,o.Z)({},d.V8),{},{paymentRequestPassthrough:(0,a.jt)(a.Ry),applePayLaterAvailability:P,supportsCouponCode:(0,a.jt)(a.Xg),couponCode:(0,a.jt)(a.Z_),minApplePayVersion:(0,a.jt)(a.Rx)})),R=Object.freeze((0,o.Z)((0,o.Z)({},M),{},{cardFunding:(0,a.jt)((0,a.kw)("supportsCredit","supportsDebit"))})),I=Object.freeze(d.um),N=Object.freeze({name:a.Z_,amount:a.Bi}),T=Object.freeze({name:a.Z_,amount:a.Cz}),O=Object.freeze({unit:(0,a.kw)("hour","day","business_day","week","month"),value:(0,a.M4)(0)}),x=Object.freeze({id:a.Z_,amount:a.MZ,displayName:a.Z_,deliveryEstimate:(0,a.jt)((0,a.or)(a.Z_,(0,a.mC)({maximum:(0,a.jt)((0,a.mC)(O)),minimum:(0,a.jt)((0,a.mC)(O))})))}),j=(0,a.jt)((0,a.uw)("id")((0,a.Fy)((0,a.mC)(x),10))),Z=Object.freeze((0,o.Z)((0,o.Z)({},x),{},{amount:a.Cz})),L=(0,a.jt)((0,a.uw)("id")((0,a.Fy)((0,a.mC)(Z),10))),D=Object.freeze({__linkPurchaseProtectionsData:(0,a.jt)(w),__linkProtectionsEligibleAndRolledOut:(0,a.jt)(a.HM),__linkUnrecognizedProtectionsHoldback:(0,a.jt)(a.HM),minGooglePayVersion:(0,a.jt)((0,a.mC)({major:(0,a.gy)(0),minor:(0,a.gy)(0)}))}),B=Object.freeze({locale:(0,a.yv)("elements()"),buttonHeight:(0,a.jt)((0,a.rS)(40,55)),layout:(0,a.jt)((0,a.or)((0,a.or)(E,(0,a.mC)({type:E,visibleButtonCount:(0,a.jt)((0,a.ig)(0))})),(0,a.mC)({maxColumns:(0,a.Wc)((0,a.gy)(0),(function(){return 0})),maxRows:(0,a.Wc)((0,a.gy)(0),(function(){return 0})),overflow:(0,a.jt)((0,a.kw)("auto","never"))}))),paymentMethodOrder:(0,a.jt)((0,a.CT)(a.Z_))}),q=Object.freeze((0,o.Z)((0,o.Z)({},B),{},{allowedShippingCountries:(0,a.jt)((0,a.CT)(a.hN)),billingAddressRequired:(0,a.jt)(a.HM),emailRequired:(0,a.jt)(a.HM),phoneNumberRequired:(0,a.jt)(a.HM),shippingAddressRequired:(0,a.jt)(a.HM)})),F=((0,o.Z)((0,o.Z)({},q),{},{buttonTheme:(0,a.jt)((0,a.mC)(S)),buttonType:(0,a.jt)((0,a.mC)(C)),paymentMethods:(0,a.jt)((0,a.mC)(k)),wallets:(0,a.jt)((0,a.mC)(k)),__autoClose:(0,a.jt)(a.HM),__checkout:(0,a.jt)((0,a.$N)(D)),business:(0,a.jt)((0,a.mC)({name:a.Z_})),applePay:(0,a.jt)((0,a.mC)(d.As)),lineItems:(0,a.jt)((0,a.CT)((0,a.mC)(T))),shippingRates:L}),(0,o.Z)((0,o.Z)({},B),{},{buttonTheme:(0,a.jt)((0,a.mC)(S)),buttonType:(0,a.jt)((0,a.mC)(C)),paymentMethods:(0,a.jt)((0,a.mC)(k)),wallets:(0,a.jt)((0,a.mC)(k)),__autoClose:(0,a.jt)(a.HM),__checkout:(0,a.jt)((0,a.$N)(D))}),Object.freeze({allowedShippingCountries:(0,a.jt)((0,a.CT)(a.hN)),billingAddressRequired:(0,a.jt)(a.Xg),emailRequired:(0,a.jt)(a.Xg),phoneNumberRequired:(0,a.jt)(a.Xg),shippingAddressRequired:(0,a.jt)(a.Xg)})),U=Object.freeze((0,o.Z)({business:(0,a.jt)((0,a.mC)({name:a.Z_}))},F)),G=Object.freeze({applePay:(0,a.jt)((0,a.mC)(M)),lineItems:(0,a.jt)((0,a.CT)((0,a.mC)(N))),shippingRates:j}),z=Object.freeze({locale:(0,a.yv)("elements()"),buttonHeight:(0,a.jt)((0,a.O)(40,55)),layout:(0,a.jt)((0,a.or)((0,a.or)(E,(0,a.mC)({type:E,visibleButtonCount:(0,a.jt)((0,a.M4)(0))})),(0,a.mC)({maxColumns:(0,a.Wc)((0,a.M2)(0),(function(){return 0})),maxRows:(0,a.Wc)((0,a.M2)(0),(function(){return 0})),overflow:(0,a.jt)((0,a.kw)("auto","never"))}))),paymentMethodOrder:(0,a.jt)((0,a.CT)(a.Z_))}),V=Object.freeze((0,o.Z)((0,o.Z)({},z),F)),K=Object.freeze({__linkPurchaseProtectionsData:(0,a.jt)(b),__linkProtectionsEligibleAndRolledOut:(0,a.jt)(a.Xg),__linkUnrecognizedProtectionsHoldback:(0,a.jt)(a.Xg),embeddedCheckoutMessengerSend:(0,a.jt)(a.uz),minApplePayVersion:(0,a.jt)(a.Rx),minGooglePayVersion:(0,a.jt)((0,a.mC)({major:a.Rx,minor:a.Rx})),applePayIdentifierAccount:(0,a.jt)(a.Z_)}),H=Object.freeze((0,o.Z)((0,o.Z)({},z),{},{buttonTheme:(0,a.jt)((0,a.mC)(S)),buttonType:(0,a.jt)((0,a.mC)(C)),paymentMethods:(0,a.jt)((0,a.mC)(k)),wallets:(0,a.jt)((0,a.mC)(k)),__checkout:(0,a.jt)((0,a.$N)(K)),__autoClose:(0,a.jt)(a.Xg)})),Y=Object.freeze((0,o.Z)((0,o.Z)((0,o.Z)({},H),U),G)),W=Object.freeze({allowedShippingCountries:(0,a.jt)((0,a.CT)(a.Z_)),business:(0,a.jt)((0,a.mC)({name:a.Z_})),billingAddressRequired:(0,a.jt)(a.Xg),emailRequired:(0,a.jt)(a.Xg),lineItems:(0,a.jt)((0,a.CT)((0,a.mC)(N))),phoneNumberRequired:(0,a.jt)(a.Xg),shippingAddressRequired:(0,a.jt)(a.Xg),shippingRates:j,applePay:(0,a.jt)((0,a.mC)(M))}),X=Object.freeze({allowedShippingCountries:(0,a.jt)((0,a.CT)(a.Z_)),business:(0,a.jt)((0,a.mC)({name:a.Z_})),billingAddressRequired:(0,a.jt)(a.Xg),emailRequired:(0,a.jt)(a.Xg),lineItems:(0,a.jt)((0,a.CT)((0,a.mC)(N))),phoneNumberRequired:(0,a.jt)(a.Xg),shippingAddressRequired:(0,a.jt)(a.Xg),shippingRates:j,applePay:(0,a.jt)((0,a.mC)(R))}),Q=Object.freeze({lineItems:(0,a.jt)((0,a.CT)((0,a.mC)(N))),shippingRates:j,applePay:(0,a.jt)((0,a.mC)(I))}),J=Object.freeze({reason:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.d6)))}),$=function(e){return e.layout&&("string"==typeof e.layout||"type"in e.layout)?"It looks like you're using a legacy layout implementation. It is advised to switch to the newer implementation. For more information, see https://stripe.com/docs/js/elements_object/create_express_checkout_element#express_checkout_element_create-options-layout.":null},ee=function(e,t){if(!e)return{value:null,warnings:[]};if("custom_checkout"===t||"checkout"===t||"payment_link"===t)return{value:e,warnings:[]};var n=(0,a.Gu)((0,a.mC)({applePay:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.sg))),googlePay:(0,a.jt)(a.kw.apply(void 0,(0,i.Z)(p.sg)))}),e,"options.wallets"),r=n.value,o=n.warnings;return o.push("It looks like you're using the legacy 'wallets' option. It is advised to switch to the newer option, 'paymentMethods'. For more information, see https://docs.stripe.com/js/elements_object/create_express_checkout_element."),{value:r,warnings:o}},te=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=(0,a.Gu)((0,a.mC)(r?Y:H),e,"elements.create('expressCheckout', options)"),u=s.value,l=s.warnings,d=$(u);d&&l.push(d);var p=ee(null==u?void 0:u.wallets,t),m=p.value,f=p.warnings;if(null!==(n=u.__checkout)&&void 0!==n&&n.minGooglePayVersion&&"checkout"!==t&&"payment_link"!==t)throw new c.No("Google Pay version is not customizable unless on Checkout.");return{value:(0,o.Z)((0,o.Z)({},u),m?{paymentMethods:m}:{}),warnings:[].concat((0,i.Z)(l),(0,i.Z)(f))}},ne=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,a.Gu)((0,a.mC)(t?V:z),e,"expressCheckoutElement.update()"),r=n.value,o=n.warnings,i=$(r);return i&&o.push(i),{value:r,warnings:o}},re=function(e,t,n,r,o,i){if(t&&e){var a=t.reduce((function(e,t){return e+t.amount}),0);if(e0)throw new c.No("Instead of passing ".concat(E.join(", ")," on click, provide the param(s) on create or update instead."))}var A={};if(S){var P=(0,s.Jo)(null==S?void 0:S.allowedShippingCountries);A=(0,o.Z)((0,o.Z)({},S),{},{allowedShippingCountries:P.allowedCountries||void 0}),P.warnings.forEach((function(e){return C.push(e)}))}if(r){var M=oe(A,_);A=M.value,M.warnings.forEach((function(e){return C.push(e)}))}if(!y&&null!==(t=A.applePay)&&void 0!==t&&t.paymentRequestPassthrough)throw new c.No("To use the paymentRequestPassthrough parameter you must have the beta ece_apple_pay_payment_request_passthrough_1");(g&&A.applePay&&(0,d.AB)({applePay:A.applePay,elementsInitSource:_}),A.applePay)&&(0,d.EH)({applePay:A.applePay}).forEach((function(e){return C.push(e)}));if(S&&ie(b,_)){var R=S.shippingAddressRequired,I=S.shippingRates;if(R&&(!I||!I.length))throw new c.No("When `shippingAddressRequired` is true, you must specify `shippingRates`.")}return{value:A,warnings:C}},se=function(e,t,n,r,o){var i=(0,a.Gu)((0,a.jt)((0,a.mC)(Q)),e,"".concat(t," event resolve callback")),s=i.value,u=i.warnings,l=v(n),p="google_pay"===n,m=null!=s?s:{};if(r){var f=oe(m,o);m=f.value,f.warnings.forEach((function(e){return u.push(e)}))}if(l&&m.applePay&&(0,d.AB)({applePay:m.applePay}),s&&ie(p,o)){var _=s.shippingRates;if(_&&!_.length)throw new c.No("You must specify `shippingRates`.")}return{value:m,warnings:u}},ue=function(e){var t=(0,a.Gu)((0,a.jt)((0,a.mC)(J)),e,"confirm event paymentFailed callback"),n=t.value;return{value:null!=n?n:{},warnings:t.warnings}}},2334:function(e,t,n){"use strict";n.d(t,{L$:function(){return ee},Y4:function(){return Q},ru:function(){return he},hk:function(){return _e},jX:function(){return ke},mT:function(){return we},I2:function(){return pe},iU:function(){return X},mZ:function(){return ye},a0:function(){return Se},xl:function(){return Ae},zf:function(){return Ee},Ee:function(){return Pe},$K:function(){return me},FC:function(){return ve},n4:function(){return be},Uz:function(){return ge}});var r,o,i=n(1413),a=n(4942),c=n(9062),s=n(942),u=["external_aplazame","external_atone","external_au_easy_payment","external_au_pay","external_azupay","external_bank_pay","external_benefit","external_bitcash","external_bizum","external_catch","external_dapp","external_dbarai","external_divido","external_famipay","external_fawry","external_fonix","external_gcash","external_grabpay_later","external_interac","external_iwocapay","external_kbc","external_knet","external_laybuy","external_line_pay","external_merpay","external_momo","external_net_cash","external_nexi_pay","external_octopus","external_oney","external_paidy","external_pay_easy","external_payconiq","external_paypal","external_paypay","external_paypo","external_paysafecard","external_picpay","external_planpay","external_postepay","external_postfinance","external_rakuten_pay","external_samsung_pay","external_scalapay","external_sezzle","external_shopback_pay","external_sofinco","external_softbank_carrier_payment","external_tabby","external_tng_ewallet","external_toss_pay","external_truelayer","external_twint","external_venmo","external_walley","external_webmoney","external_younited_pay"].concat(["external_hip_ach_credit_transfer","external_hip_paper_check","external_hip_sepa_credit_transfer"]),l=n(1873),d=n(1765),p=n(4775),m=n(6617),f=document.referrer,_=(0,m.Ds)(f),h=(_&&_.origin,_&&_.host,new RegExp("^(".concat("‎","?\\d{2}\\D{3})").concat("‎","?(\\d{1,4})?")),n(9581)),y=n(5937),v=n.n(y),g=n(1520),b=n.n(g),w=n(3089),k=n.n(w),S=n(8256),C=n.n(S),E=n(4223),A=n.n(E),P=n(6863),M=n.n(P),R=n(6628),I=n.n(R),N=n(9824),T=n.n(N),O=n(3260),x=n.n(O),j=n(4975),Z=n.n(j),L=n(4481),D=n.n(L),B=n(3381),q=n.n(B),F=n(3181),U=n.n(F),G=n(2142),z=n.n(G),V=function(e){switch(e){case"abn_amro":return v();case"asn_bank":return b();case"bunq":return k();case"ing":return C();case"knab":return A();case"n26":return M();case"nn":return I();case"rabobank":return T();case"regiobank":return x();case"revolut":return Z();case"sns_bank":return D();case"triodos_bank":return q();case"van_lanschot":return U();case"yoursafe":return z();default:return(0,h.Rz)(e)}},K={abn_amro:{icon:V("abn_amro"),text:"ABN Amro"},asn_bank:{icon:V("asn_bank"),text:"ASN Bank"},bunq:{icon:V("bunq"),text:"bunq B.V.".concat("‎")},ing:{icon:V("ing"),text:"ING Bank"},knab:{icon:V("knab"),text:"Knab"},n26:{icon:V("n26"),text:"N26"},nn:{icon:V("nn"),text:"Nationale-Nederlanden"},rabobank:{icon:V("rabobank"),text:"Rabobank"},regiobank:{icon:V("regiobank"),text:"RegioBank"},revolut:{icon:V("revolut"),text:"Revolut"},sns_bank:{icon:V("sns_bank"),text:"SNS Bank"},triodos_bank:{icon:V("triodos_bank"),text:"Triodos Bank"},van_lanschot:{icon:V("van_lanschot"),text:"Van Lanschot Kempen"},yoursafe:{icon:V("yoursafe"),text:"Yoursafe"}},H=(Object.keys(K).map((function(e){return{value:e,icon:K[e].icon,text:K[e].text}})),n(1743)),Y=n(2967),W=n(4897),X=(0,l.CT)(l.z$.apply(void 0,(0,c.Z)(u))),Q=["apple_pay","google_pay"],J=([].concat((0,c.Z)(W.y.typesSupportingPaymentElement),["affirm","afterpay_clearpay","alipay","alma","acss_debit","amazon_pay","au_becs_debit","bancontact","blik","boleto","card","cashapp","crypto","customer_balance","eps","fpx","giropay","grabpay","id_bank_transfer","ideal","klarna","konbini","naver_pay","kakao_pay","payco","kr_card","samsung_pay","kr_market","link","link_card_brand","mb_way","mobilepay","multibanco","ng_bank","ng_bank_transfer","ng_card","ng_market","ng_ussd","oxxo","p24","pay_by_bank","paynow","paypal","payto","pix","promptpay","demo_pay","rechnung","revolut_pay","sunbit","satispay","sepa_debit","sofort","swish","twint","us_bank_account","upi","wechat_pay","zip","south_korea_market","nz_bank_account","bacs_debit","gopay","qris","shopeepay","apple_pay","google_pay"],(0,c.Z)(u)),s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.DISCOVER,s.rM.DINERS,s.rM.JCB,s.rM.UNIONPAY,s.rM.ELO,(0,a.Z)({},s.rM.AMEX,["BR","MY","AE","TH"]),r={},(0,a.Z)(r,s.rM.ELO,["CA","US","GB"]),(0,a.Z)(r,s.rM.DISCOVER,["CA","JP","US","GB"]),(0,a.Z)(r,s.rM.DINERS,["CA","JP","US","GB"]),(0,a.Z)(r,s.rM.JCB,["AU","CA","DE","GB","IE","JP","NZ","PL","SG","US"]),(0,a.Z)(r,s.rM.UNIONPAY,["AU","CA","HK","MY","NZ","SG","GB","US","CH","AT","BE","BG","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","NO"]),s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.JCB,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.UNIONPAY,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.DINERS,s.rM.DISCOVER,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.DINERS,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.JCB,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.DINERS,s.rM.DISCOVER,s.rM.JCB,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.JCB,s.rM.MASTERCARD,s.rM.AMEX,s.rM.DINERS,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.UNIONPAY,s.rM.JCB,s.rM.DISCOVER,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.DINERS,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.JCB,s.rM.UNIONPAY,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.DINERS,s.rM.AMEX,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.JCB,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.DINERS,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.MASTERCARD,s.rM.VISA,s.rM.DINERS,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.JCB,s.rM.UNIONPAY,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.UNIONPAY,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.DISCOVER,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.JCB,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.DISCOVER,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.UNIONPAY,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.JCB,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,s.rM.MASTERCARD,s.rM.VISA,s.rM.VISA,s.rM.MASTERCARD,s.rM.AMEX,s.rM.VISA,s.rM.MASTERCARD,s.rM.VISA,s.rM.MASTERCARD,{UNIONPAY:"unionpay",JCB:"jcb",ELO:"elo",DISCOVER:"discover",DINERS:"diners_club"}),$={VISA:"visa",MASTERCARD:"mastercard",AMEX:"amex",AMERICAN_EXPRESS:"american_express",DISCOVER_GLOBAL_NETWORK:"discover_global_network"},ee=(o={},(0,a.Z)(o,$.VISA,[s.rM.VISA]),(0,a.Z)(o,$.MASTERCARD,[s.rM.MASTERCARD]),(0,a.Z)(o,$.AMEX,[s.rM.AMEX]),(0,a.Z)(o,$.AMERICAN_EXPRESS,[s.rM.AMEX]),(0,a.Z)(o,$.DISCOVER_GLOBAL_NETWORK,[s.rM.DISCOVER,s.rM.DINERS,s.rM.JCB,s.rM.UNIONPAY,s.rM.ELO]),(0,a.Z)(o,J.UNIONPAY,[s.rM.UNIONPAY]),(0,a.Z)(o,J.JCB,[s.rM.JCB]),(0,a.Z)(o,J.ELO,[s.rM.ELO]),(0,a.Z)(o,J.DISCOVER,[s.rM.DISCOVER]),(0,a.Z)(o,J.DINERS,[s.rM.DINERS]),o),te=Object.keys(J).map((function(e){return J[e]})),ne=function(e){var t=Object.keys($).map((function(e){return $[e]}));return e===d.M4.blocked_card_brands_beta_1?t.filter((function(e){return e!==$.AMERICAN_EXPRESS})):t.filter((function(e){return e!==$.AMEX}))},re=l.kw.apply(void 0,(0,c.Z)(ne(d.M4.blocked_card_brands_beta_1))),oe=l.z$.apply(void 0,(0,c.Z)(ne()).concat((0,c.Z)(te))),ie=(0,l.mC)({email:(0,l.jt)((0,l.AG)(l.Z_)),name:(0,l.jt)((0,l.AG)(l.Z_)),phone:(0,l.jt)((0,l.AG)(l.Z_)),address:(0,l.jt)((0,l.mC)({city:(0,l.jt)((0,l.AG)(l.Z_)),country:(0,l.jt)((0,l.AG)(l.Z_)),line1:(0,l.jt)((0,l.AG)(l.Z_)),line2:(0,l.jt)((0,l.AG)(l.Z_)),postal_code:(0,l.jt)((0,l.AG)(l.Z_)),state:(0,l.jt)((0,l.AG)(l.Z_))}))}),ae=l.z$.apply(void 0,(0,c.Z)(p.uR)),ce=(0,l.mC)({network:(0,l.jt)((0,l.CT)(ae))}),se=l.kw.apply(void 0,(0,c.Z)(Object.keys(K))),ue=(0,l.mC)({bank:(0,l.jt)(se)}),le=(0,l.mC)({ideal:(0,l.jt)(ue)}),de=(0,l.mC)({saveForFuturePurchases:(0,l.jt)((0,l.or)(l.Xg,l.HM)),setAsDefault:(0,l.jt)((0,l.or)(l.Xg,l.HM))}),pe=(0,l.mC)({billingDetails:(0,l.jt)(ie),card:(0,l.jt)(ce),paymentMethods:(0,l.jt)(le),savePaymentMethod:(0,l.jt)(de)}),me=(0,l.mC)({enableSave:(0,l.jt)((0,l.kw)("never","auto")),enableSetAsDefault:(0,l.jt)((0,l.kw)("never","auto")),messages:(0,l.jt)((0,l.mC)({saveLabel:(0,l.jt)(l.Z_),setAsDefaultLabel:(0,l.jt)(l.Z_),removeSavedDialogBody:(0,l.jt)(l.Z_)})),maxVisiblePaymentMethods:(0,l.jt)((0,l.or)((0,l.M4)(0),(0,l.ig)(0)))}),fe=Object.keys(H.yv),_e=(0,l.mC)(Y.um),he=(0,l.mC)((0,i.Z)((0,i.Z)({},Y.V8),{},{applePayLaterAvailability:(0,l.jt)(l.kw.apply(void 0,fe))})),ye=(0,l.mC)({billingDetails:(0,l.jt)((0,l.or)((0,l.kw)("never","auto"),(0,l.mC)({name:(0,l.jt)((0,l.kw)("never","auto")),phone:(0,l.jt)((0,l.kw)("never","auto")),email:(0,l.jt)((0,l.kw)("never","auto")),address:(0,l.jt)((0,l.or)((0,l.kw)("never","auto","if_required"),(0,l.mC)({country:(0,l.jt)((0,l.kw)("never","auto")),postalCode:(0,l.jt)((0,l.kw)("never","auto")),state:(0,l.jt)((0,l.kw)("never","auto")),city:(0,l.jt)((0,l.kw)("never","auto")),line1:(0,l.jt)((0,l.kw)("never","auto")),line2:(0,l.jt)((0,l.kw)("never","auto"))})))})))}),ve=(0,l.mC)({amazon_pay:(0,l.jt)((0,l.kw)("auto","always","never")),applePay:(0,l.jt)((0,l.kw)("auto","always","never")),auBecsDebit:(0,l.jt)((0,l.kw)("auto","always","never")),bancontact:(0,l.jt)((0,l.kw)("auto","always","never")),card:(0,l.jt)((0,l.kw)("auto","always","never")),cashapp:(0,l.jt)((0,l.kw)("auto","always","never")),demo_pay:(0,l.jt)((0,l.kw)("auto","always","never")),googlePay:(0,l.jt)((0,l.kw)("auto","always","never")),ideal:(0,l.jt)((0,l.kw)("auto","always","never")),kr_market:(0,l.jt)((0,l.kw)("auto","always","never")),ng_card:(0,l.jt)((0,l.kw)("auto","always","never")),ng_market:(0,l.jt)((0,l.kw)("auto","always","never")),paypal:(0,l.jt)((0,l.kw)("auto","always","never")),revolut_pay:(0,l.jt)((0,l.kw)("auto","always","never")),sepaDebit:(0,l.jt)((0,l.kw)("auto","always","never")),sofort:(0,l.jt)((0,l.kw)("auto","always","never")),usBankAccount:(0,l.jt)((0,l.kw)("auto","always","never"))}),ge=((0,l.or)((0,l.kw)("auto","never"),(0,l.mC)({applePay:(0,l.jt)((0,l.kw)("auto","never")),googlePay:(0,l.jt)((0,l.kw)("auto","never"))})),(0,l.or)((0,l.kw)("auto","never"),l.Ry)),be=(0,l.mC)({applePay:(0,l.jt)((0,l.kw)("auto","never")),googlePay:(0,l.jt)((0,l.kw)("auto","never"))}),we=(0,l.CT)(re),ke=(0,l.CT)(oe),Se=(0,l.mC)({onEvent:(0,l.jt)(l.uz)}),Ce=(0,l.kw)("accordion","tabs","auto"),Ee=(0,l.or)(Ce,l.Ry),Ae=(0,l.mC)({type:Ce,radios:(0,l.jt)(l.Xg),spacedAccordionItems:(0,l.jt)(l.Xg),defaultCollapsed:(0,l.jt)(l.Xg),visibleAccordionItemsCount:(0,l.jt)((0,l.M2)(0))}),Pe=(0,l.mC)({type:Ce,radios:(0,l.jt)(l.Xg),spacedAccordionItems:(0,l.jt)(l.Xg),visibleAccordionItemsCount:(0,l.jt)((0,l.M2)(0))});(0,l.or)(Ce,(0,l.or)((0,l.mC)({type:(0,l.kw)("tabs","auto")}),(0,l.mC)({type:(0,l.kw)("accordion"),radios:(0,l.jt)(l.Xg),spacedAccordionItems:(0,l.jt)(l.Xg),visibleAccordionItemsCount:(0,l.jt)((0,l.M2)(0))}))),(0,l.or)(Ce,(0,l.or)((0,l.mC)({type:(0,l.kw)("tabs","auto"),defaultCollapsed:(0,l.jt)(l.HM)}),(0,l.mC)({type:(0,l.kw)("accordion"),defaultCollapsed:(0,l.jt)(l.HM),radios:(0,l.jt)(l.HM),spacedAccordionItems:(0,l.jt)(l.HM),visibleAccordionItemsCount:(0,l.jt)((0,l.gy)(0))})))},7955:function(e,t,n){"use strict";n.d(t,{C1:function(){return w},Jo:function(){return S},S6:function(){return b},YR:function(){return k},Z0:function(){return m},_0:function(){return g},_F:function(){return f},_m:function(){return _},lA:function(){return v},oU:function(){return h}});var r=n(1413),o=n(9062),i=n(2334),a=n(6977),c=n(1873),s=n(8812),u=n(2024),l=n(2375),d=n(2984),p=n(1765),m=function(e,t){if((0,p.uN)(e,p.M4.elements_customers_beta_1)&&t)throw new s.No("The ".concat(p.M4.elements_customers_beta_1," beta is not compatible when passing a 'customerSessionClientSecret'. Please only use one."))},f=function(e,t,n){if("string"!=typeof e)return(0,c.$3)("a client_secret string",e,t,n);var r=(0,a.RY)(e);if(null===r){var o="a client secret of the form ${id}_secret_${secret}";return 0===e.indexOf("cuss_secret_")&&(o+=". Did you mean to pass this to customerSessionClientSecret?"),(0,c.$3)(o,e,t,n)}return(0,c.x4)(r,[])},_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=e.layout;if(!r||"string"==typeof r)return[];var a=(0,c.mC)({layout:t?i.Ee:i.xl}),s=(0,c.Gu)(a,{layout:r},n),u=s.warnings,l=r,d=l.type;return"accordion"!==d&&(r.hasOwnProperty("spacedAccordionItems")&&(u=[].concat((0,o.Z)(u),["options.layout.spacedAccordionItems is only supported with the 'accordion' layout type."])),r.hasOwnProperty("radios")&&(u=[].concat((0,o.Z)(u),["options.layout.radios is only supported with the 'accordion' layout type."])),r.hasOwnProperty("visibleAccordionItemsCount")&&(u=[].concat((0,o.Z)(u),["options.layout.visibleAccordionItemsCount is only supported with the 'accordion' layout type."]))),u},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=e.wallets;if(!n||"string"==typeof n)return[];var r=(0,c.mC)({wallets:i.n4}),o=(0,c.Gu)(r,{wallets:n},t),a=o.warnings;return a},y=function(e,t){return e.length<=t?e:"".concat(e.slice(0,t).trim(),"...")},v=function(){var e,t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=o.savePaymentMethod;if(!i)return{savePaymentMethodTruncated:null,warnings:[]};if(null==i||!i.messages)return{savePaymentMethodTruncated:i,warnings:[]};var a=[],c=null==i||null===(e=i.messages)||void 0===e?void 0:e.saveLabel;c&&c.length>100&&(a.push("savePaymentMethod.messages.saveLabel is over 100 characters and will be truncated."),c=y(c,100));var s=null==i||null===(t=i.messages)||void 0===t?void 0:t.setAsDefaultLabel;s&&s.length>100&&(a.push("savePaymentMethod.messages.setAsDefaultLabel is over 100 characters and will be truncated."),s=y(s,100));var u=null==i||null===(n=i.messages)||void 0===n?void 0:n.removeSavedDialogBody;return u&&u.length>500&&(a.push("savePaymentMethod.messages.removeSavedDialogBody is over 500 characters and will be truncated"),u=y(u,500)),null==c&&null==s&&null==u?{savePaymentMethodTruncated:i,warnings:[]}:{savePaymentMethodTruncated:(0,r.Z)((0,r.Z)({},i),{},{messages:(0,r.Z)((0,r.Z)((0,r.Z)({},null!=c?{saveLabel:c}:{}),null!=s?{setAsDefaultLabel:s}:{}),null!=u?{removeSavedDialogBody:u}:{})}),warnings:a}},g=function(e){var t=e.fields,n=e.validation;if(n)for(var r in n)if(!t||!t[r]||"always"!==t[r])throw new s.No("You cannot specify validation.".concat(r," without setting fields.").concat(r," to always."))},b=function(e){var t,n;if(null!==(t=e.defaultValues)&&void 0!==t&&t.phone&&"always"!==(null===(n=e.fields)||void 0===n?void 0:n.phone))throw new s.No("You cannot specify defaultValues.phone without setting fields.phone to always.")},w=function(e){var t,n,r,o,i;if((null!==(t=e.defaultValues)&&void 0!==t&&t.firstName||null!==(n=e.defaultValues)&&void 0!==n&&n.lastName)&&(null===(r=e.display)||void 0===r?void 0:r.name)!==l.ZV)throw new s.No("You cannot specify defaultValues.firstName or defaultValues.lastName without setting display.name to split.");if((null===(o=e.display)||void 0===o?void 0:o.name)===l.ZV&&null!==(i=e.defaultValues)&&void 0!==i&&i.name)throw new s.No("You cannot specify defaultValues.name when you have display.name set to split.")},k=function(e){var t=e.contacts,n=e.fields,r=e.validation;if(t){var o,i=(0,u.cx)(t,(function(e){return e.hasOwnProperty("phone")}));if(-1!==i)if("always"!==(null==n?void 0:n.phone)||"always"!==(null==r||null===(o=r.phone)||void 0===o?void 0:o.required))throw new s.No("You cannot specify contacts[".concat(i,"].phone without\n setting fields.phone to 'always' and validation.phone.required to 'always'.\n Phone options should only be 'always' when absolutely necessary."))}},S=function(e){if(!e)return{allowedCountries:null,warnings:[]};var t=[],n=[];return e.forEach((function(e){if("string"==typeof e){var r=(0,d.Fc)(e);null!==r?t.push(r):n.push('invalid country code "'.concat(e,'"; "').concat(e,'" is not a valid 2-letter country code'))}else n.push('invalid value provided for country code "'.concat(e,'"; expected "string" but received "').concat(typeof e,'"'))})),{allowedCountries:t,warnings:n}}},6668:function(e,t,n){"use strict";n.d(t,{dz:function(){return k},ky:function(){return w},Ul:function(){return g},Cn:function(){return h},O$:function(){return b}});var r,o=n(7462),i=n(1413),a=n(5671),c=n(3144),s=n(136),u=n(9388),l=function(e){function t(){return(0,a.Z)(this,t),n.call(this,{channel:"hcaptcha-invisible",fingerprintedPath:"hcaptcha-invisible-94fe9df8ddd56d56a7bac8787569488d.html",frameQueryParams:{debugMode:window.location.href.indexOf("__iframe-debug-mode__")>=0}})}(0,s.Z)(t,e);var n=(0,u.Z)(t);return(0,c.Z)(t,[{key:"execute",value:function(e){var t=e.siteKey,n=e.extraData,r=e.rqdata;return this.sendMessageToChild("execute",{siteKey:t,extraData:n,rqdata:r}).then((function(e){return e}))}},{key:"init",value:function(e){return this.sendMessageToChild("init",e)}}]),t}(n(125).K),d=n(3423),p=n(9792),m=function(e){function t(){var e;(0,a.Z)(this,t);for(var r=arguments.length,o=new Array(r),i=0;i0){var n=this.execute(5-e+1);this.nextPromise=n,n.then((function(){t.nextPromise===n&&(t.resolvedPromise=n,setTimeout((function(){t.resolvedPromise===n&&(t.resolvedPromise=void 0)}),t.tokenExpirationLength),t.retryTimeout=setTimeout((function(){t.preload(e-1)}),t.tokenExpirationLength-1e4))}))}}},{key:"resetNext",value:function(){this.nextPromise=void 0,this.retryTimeout&&(clearTimeout(this.retryTimeout),this.retryTimeout=void 0)}},{key:"execute",value:function(e){var t=this;if(!r)throw new m("captcha not mounted");var n=new p.E,o=r.execute({siteKey:this.siteKey,extraData:y,rqdata:this.rqdata});return o.then((function(r){var o=r.duration;t.log("captcha.passive.execute",(0,i.Z)({elapsed_time:n.getElapsedTime(),duration:o},e?{attempt:e}:null))})),o}},{key:"log",value:function(e,t){this.logger.log(e,(0,i.Z)((0,i.Z)({},t),{},{site_key:this.siteKey}))}},{key:"start",value:function(){r?this.preload(5):this.log("captcha.passive.error",{reason:"preload_not_mounted"})}},{key:"consumeToken",value:function(){var e=this.resolvedPromise||this.nextPromise;return e?(this.resetNext(),this.resolvedPromise=void 0,e):this.execute()}},{key:"stop",value:function(){this.resetNext()}}]),e}(),g=function(e){var t=e.siteKey,n=e.rqdata,r=e.logger,o=e.tokenExpirationLength;(e.skipPreloadersCache||!_[t])&&(_[t]=new v({siteKey:t,rqdata:n,logger:r,tokenExpirationLength:o}))},b=function(e,t){var n;e&&t&&(null===(n=_[e])||void 0===n||n.start())},w=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=new p.E;return new f((function(a,c){if(!n||!e)return t.log("captcha.passive.disabled",{site_key:e,reason:n?"site_key_not_set":"not_enabled"}),void a(null);var s,u=o.timeout||6e3,l=setTimeout((function(){c(new m("timeout"))}),u),d=function(){if(i.getElapsedTime()>=u)clearInterval(s);else{var d=e?_[e]:null;r&&d?(clearInterval(s),d.consumeToken().then((function(e){clearTimeout(l),a(e)})).catch((function(e){clearTimeout(l),c(e)})).finally((function(){o.preloadNextToken&&b(e,n)}))):t.log("captcha.passive.not_initialized",{site_key:e})}};s=setInterval(d,1e3),d()})).then((function(r){var o=i.getElapsedTime();return r?t.log("captcha.passive.success",{duration:o,site_key:e}):n&&e&&t.log("captcha.passive.unknown",{duration:o,site_key:e}),r})).catch((function(n){var r=i.getElapsedTime();if(t.log("captcha.passive.error",{duration:r,reason:n.message,site_key:e}),o.rejectOnError)throw n;return null}))},k=function(e){(0,o.Z)(y,e)}},3379:function(e,t,n){"use strict";n.d(t,{H:function(){return a}});var r=n(5671),o=n(3144),i=n(9038),a=function(){function e(t){(0,r.Z)(this,e),this._inContextData=t,this._inContextOuter=new i.B({inContextData:t,paymentMethodBehavior:{lightboxFrameOptions:this._lightboxFrameOptions.bind(this),addModalListeners:this._addModalListeners.bind(this),inContextOuterConfig:{showLightboxBackdrop:!1}}})}return(0,o.Z)(e,[{key:"collectPayment",value:function(){return this._inContextOuter.collectPayment()}},{key:"_lightboxFrameOptions",value:function(){var e=this._inContextData,t=e.paymentMethod,n=e.paymentIntent,r=e.controller,o=e.paymentSurface;return{paymentMethodType:t,redirectUrl:e.redirectUrl,controllerId:r._id,paymentSurface:o,intentId:n.id}}},{key:"_addModalListeners",value:function(e){var t=this;e._once("checkout_loaded",(function(){t._inContextOuter.clearModalLoadTimeout()}))}}]),e}()},9038:function(e,t,n){"use strict";n.d(t,{B:function(){return f}});var r=n(5671),o=n(3144),i=n(1413),a=function(){function e(t,n,o,i){(0,r.Z)(this,e),this._controller=t,this._paymentIntent=o,this._paymentSurface=i,this._paymentMethod=n}return(0,o.Z)(e,[{key:"start",value:function(){this._controller.report("in_context.start",{payment_method:this._paymentMethod,message:"starting in-context payment flow for klarna",intent_id:this._paymentIntent.id,payment_surface:this._paymentSurface})}},{key:"error",value:function(e){"affirm"===this._paymentMethod&&this._controller.report("in_context.error.affirm",{payment_method:this._paymentMethod,intent_id:this._paymentIntent.id,error:{message:e.message,name:e.name}}),this._controller.report("in_context.error",{payment_method:this._paymentMethod,intent_id:this._paymentIntent.id,error:{message:e.message,name:e.name}})}},{key:"unexpected",value:function(e){this._controller.report("in_context.unexpected",{payment_method:this._paymentMethod,message:e})}},{key:"timeout",value:function(e){"affirm"===this._paymentMethod&&this._controller.report("in_context.timeout.affirm",{payment_method:this._paymentMethod,payment_surface:this._paymentSurface,intent_id:this._paymentIntent.id,error:{message:e.message,name:e.name}}),this._controller.report("in_context.timeout",{payment_method:this._paymentMethod,payment_surface:this._paymentSurface,intent_id:this._paymentIntent.id,error:{message:e.message,name:e.name}})}},{key:"log",value:function(e){this._controller.report("in_context.log",(0,i.Z)({payment_method:this._paymentMethod,intent_id:this._paymentIntent.id,payment_surface:this._paymentSurface},e))}}]),e}(),c="IN_CONTEXT_INNER",s=n(6977),u=n(1849),l=function(e,t,n,r,o){return"affirm"===o?e.report("in_context.log.affirm",{intent_id:t.id,state:"".concat(o,"_in_context_fallback_to_redirect"),payment_surface:r}):e.report("in_context.log",{payment_method:o,intent_id:t.id,state:"".concat(o,"_in_context_fallback_to_redirect"),payment_surface:r}),(0,u.U)(n).then((function(n){return(0,u.d)(e,"next_action redirect",n),(0,s.PA)(n,t)}))},d=n(9581),p=n(6274).Promise,m=function(e){return e.COMPLETED="COMPLETED",e.CANCELED="CANCELED",e.ERROR="ERROR",e.DUPLICATE_MODAL="DUPLICATE_MODAL",e}({}),f=function(){function e(t){var n=this,o=t.inContextData,i=t.paymentMethodBehavior;(0,r.Z)(this,e),this._addModalListenersAndWaitForCompletion=function(e){return n._paymentMethodBehavior.addModalListeners(e),e._on("load",(function(){e.show(),n._paymentMethodBehavior.inContextOuterConfig.showLightboxBackdrop&&e.fadeInBackdrop()})),e._once("checkout_complete",(function(){n._resolveCheckoutPromise(m.COMPLETED),e.destroy()})),e._once("checkout_canceled",(function(){n._resolveCheckoutPromise(m.CANCELED),e.destroy()})),e._once("error",(function(){n.clearModalLoadTimeout(),n._resolveCheckoutPromise(m.ERROR),e.destroy()})),e._once("duplicate_modal",(function(){n.clearModalLoadTimeout(),n._resolveCheckoutPromise(m.DUPLICATE_MODAL),e.destroy()})),n._checkoutPromise},this._returnIntentResponseOrFallback=function(e,t){var r=t.paymentIntent,o=t.redirectUrl,i=t.controller,a=t.paymentSurface;switch(e){case m.COMPLETED:case m.CANCELED:var c=n._paymentMethodBehavior.inContextOuterConfig.showLightboxBackdrop;return function(e,t,n,r){return e.action.retrievePaymentIntent({intentSecret:(0,s.O3)(t),hosted:!1}).then((function(o){var i=(0,s.PA)(o,t);if(i.hasOwnProperty("error"))return i;var a=i.paymentIntent;return"succeeded"===a.status||"requires_capture"===a.status?i:a.last_payment_error?e.action.localizeError(a.last_payment_error).then((function(e){return{error:e.error}})):r&&(0,s.mD)(a.status)?e.action.localizeError({code:"payment_intent_payment_attempt_failed"}).then((function(e){return{error:e.error}})):(e.report("in_context.unexpected",{payment_method:n,message:"Payment Intent is in an unexpected state when attempting to return response to user",current_intent_state:a.status,intent_id:t.id}),"canceled"===a.status||"requires_confirmation"===a.status||(0,s.mD)(a.status)||"requires_payment_method"===a.status?e.action.localizeError({message:"Payment was abandoned. Please try again."}).then((function(e){return{error:e.error}})):("affirm"===n&&e.report("in_context.error.affirm",{intent_id:t.id,error:{message:"PaymentIntent unexpectedly not successful and doesn't have last_payment_error field",current_intent_state:a.status}}),e.report("in_context.error",{payment_method:n,intent_id:t.id,error:{message:"PaymentIntent unexpectedly not successful and doesn't have last_payment_error field",current_intent_state:a.status}}),e.action.localizeError({message:"unexpected error"}).then((function(e){return{error:e.error}}))))}))}(i,r,n._paymentMethod,c);case m.ERROR:return n._fallbackToRedirectOnErrors?l(i,r,o,a,n._paymentMethod):i.action.localizeError({code:"errors.code.unexpected"}).then((function(e){return{error:e.error}}));case m.DUPLICATE_MODAL:return i.action.localizeError({message:"Payment was interrupted by another payment attempt."}).then((function(e){return{error:e.error}}));default:try{(0,d.Rz)(e,"unknown InContextCheckoutResult")}catch(t){n._logger.error(new Error("Unexpected InContextCheckoutResult: ".concat(e)))}return l(i,r,o,a,n._paymentMethod)}},this._inContextData=o,this._paymentMethodBehavior=i,this._paymentIntent=o.paymentIntent,this._controller=o.controller,this._paymentMethod=o.paymentMethod,this._paymentSurface=o.paymentSurface,this._fallbackToRedirectOnErrors=o.fallbackToRedirectOnErrors,this._logger=new a(this._controller,this._paymentMethod,this._paymentIntent,this._paymentSurface),this._clearModalLoadTimeout=function(){var e=new Error("clearModalLoadTimeout function has not been defined");throw n._logger.error(e),e},this._closeModal=function(){var e=new Error("closeModal function has not been defined");throw n._logger.error(e),e},this._resolveCheckoutPromise=function(){var e=new Error("resolveCheckoutPromise function has not been defined");throw n._logger.error(e),e},this._checkoutPromise=new p((function(e){n._resolveCheckoutPromise=e}))}return(0,o.Z)(e,[{key:"collectPayment",value:function(){var e=this;return this._logger.start(),this._maybeRemoveExistingInContextModal().then((function(){return e._createInContextModal()})).then((function(t){return e._addModalListenersAndWaitForCompletion(t)})).then((function(t){return e._returnIntentResponseOrFallback(t,e._inContextData)})).catch((function(t){throw e._logger.error(t),t}))}},{key:"_maybeRemoveExistingInContextModal",value:function(){var e=this._controller.getLightboxFrame(c);return e?(this._logger.unexpected("Unexpectedly found existing modal frame when launching ".concat(this._paymentMethod," In-Context modal")),e._emit("duplicate_modal"),e.destroy()):p.resolve()}},{key:"_createInContextModal",value:function(){var e=this,t=setTimeout((function(){e._logger.timeout(new Error("".concat(e._paymentMethod," In-Context STP frame did not load after 20 seconds"))),e._resolveCheckoutPromise(m.ERROR)}),2e4);this._clearModalLoadTimeout=function(){return clearTimeout(t)},this._logger.log({state:"launching_in_context_inner"});var n=this._controller.createLightboxFrame({type:c,options:this._paymentMethodBehavior.lightboxFrameOptions()});return this._closeModal=function(){e._resolveCheckoutPromise(m.CANCELED),n.destroy()},n}},{key:"clearModalLoadTimeout",value:function(){return this._clearModalLoadTimeout()}},{key:"closeModal",value:function(){return this._closeModal()}}]),e}()},8731:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(3144),o=n(5671),i=n(1413),a=n(4200),c=n(6274).Promise,s={display:"block",position:"fixed","z-index":"2147483647",background:"rgba(40,40,40,0)",transition:"background 400ms ease","will-change":"background",top:"0",left:"0",right:"0",bottom:"0",margin:"0",padding:"0"},u=(0,i.Z)((0,i.Z)({},s),{},{background:"rgba(40,40,40,0.75)"}),l=(0,r.Z)((function e(t){var n=this,r=t.lockScrolling,l=t.lockScrollingIOSSpecialFix,d=void 0!==l&&l,p=t.lockFocus,m=t.lockFocusOn,f=t.appendElement,_=void 0!==f&&f,h=t.backgroundTransition,y=void 0===h?"400ms ease":h,v=t.listenerRegistry;(0,o.Z)(this,e),this.domElement=document.createElement("div"),this._runOnHide=[],this.mount=function(){var e=(0,a.Xq)();n.domElement.style.display="none",e.contains(n.domElement)||(n._appendElement?e.appendChild(n.domElement):e.insertBefore(n.domElement,e.firstChild))},this.show=function(){var e=(0,i.Z)((0,i.Z)({},s),{},{transition:n._backgroundTransition});if((0,a.yq)(n.domElement,e),n._lockScrolling){var t=(0,a.MV)(n._lockScrollingIOSSpecialFix);n._runOnHide.push(t)}if(n._lockFocus){var r=(0,a.W3)(n._lockFocusOn).restoreFocus;n._runOnHide.push(r)}},this.fadeIn=function(){setTimeout((function(){var e=(0,i.Z)((0,i.Z)({},u),{},{transition:n._backgroundTransition});(0,a.yq)(n.domElement,e)}))},this.fadeOut=function(){return new c((function(e){var t=(0,i.Z)((0,i.Z)({},s),{},{transition:n._backgroundTransition});(0,a.yq)(n.domElement,t),setTimeout(e,500),n._listenerRegistry.addEventListener(n.domElement,"transitionend",e)})).then((function(){n.domElement.style.display="none",n.runOnHide()}))},this.runOnHide=function(){for(;n._runOnHide.length;){var e;null===(e=n._runOnHide.pop())||void 0===e||e()}},this.unmount=function(){var e=(0,a.Xq)();e.contains(n.domElement)&&e.removeChild(n.domElement)},this._lockScrolling=!!r,this._lockScrollingIOSSpecialFix=!!d,this._lockFocus=!!p,this._appendElement=_,this._lockFocusOn=m||null,this._backgroundTransition="background ".concat(y),this._listenerRegistry=v}))},8547:function(e,t,n){"use strict";var r=n(9062),o=n(3144),i=n(5671),a=n(8812),c=n(4505),s=(0,o.Z)((function e(){var t=this;(0,i.Z)(this,e),this._emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o0},this._off=function(e,n){if(n){for(var r,o=t._callbacks[e]||[],i=0;i"))})),t.substring(0,1e3)}(e.stack):null,l=!!s&&-1!==s.indexOf("https://js.stripe.com/v3/"),d=function(e){return function(e){return"Script error."===e.message||"string"==typeof e.fileName&&(0===e.fileName.indexOf("chrome://")||0===e.fileName.indexOf("chrome-extension://"))}(e)?"uncaught_third_party_error":"IntegrationError"===e.name?"integration_error":"fatal.uncaught_error"}(e);return{eventName:d,eventData:{name:"string"==typeof e.name?e.name:null,message:"string"==typeof e.message?e.message:null,fileName:s,lineNumber:"number"==typeof e.lineNumber?e.lineNumber:null,columnNumber:"number"==typeof e.columnNumber?e.columnNumber:null,stack:u,iframe:e.iframe,inPromise:null!==(t=e.inPromise)&&void 0!==t?t:null,element:null!==(n=e.element)&&void 0!==n?n:null,elementHasLoaded:null!==(r=e.elementHasLoaded)&&void 0!==r?r:null,apiMethodName:null!==(c=e.apiMethodName)&&void 0!==c?c:null,isStripeOrigin:l}}},s=function(e,t,n,o){var i=(0,r.Kn)(e)?e:new Error("Error thrown with unexpected type: ".concat(String(e))),a=c({_isUserError:i._isUserError,name:i.name,message:i.message,description:i.description,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,stack:i.stack,iframe:!1,element:"outer",apiMethodName:o,inPromise:n});throw t&&a&&(t.report(a.eventName,a.eventData),"integration_error"!==a.eventName&&t.reportError(i)),e},u=function(e,t,n){return function(){try{return e.call(this)}catch(e){return s(e,t||this&&this._controller,!1,n)}}},l=function(e,t,n){return function(r){try{return e.call(this,r)}catch(e){return s(e,t||this&&this._controller,!1,n)}}},d=function(e,t,n){return function(r,o){try{return e.call(this,r,o)}catch(e){return s(e,t||this&&this._controller,!1,n)}}},p=function(e,t,n){return function(r,o,i){try{return e.call(this,r,o,i)}catch(e){return s(e,t||this&&this._controller,!1,n)}}},m=function(e,t,n){return function(){try{for(var r=arguments.length,o=new Array(r),i=0;i=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw a}}}}n.d(t,{NG:function(){return l},lT:function(){return d},sr:function(){return f}});var o=n(181),i=n(9062),a=n(1413),c=n(8948),s=n(942),u=["SCRIPT","STYLE"],l=function(){var e=null;return _().then((function(t){e=t})).catch((function(){e=null})),function(){var t=y();return e?(0,a.Z)({name:C(t),email:g(t),experimentalEmail:v()},E(e,t)):{name:C(t),email:g(t),phoneNumber:null,phoneCountry:null,experimentalEmail:v()}}},d=function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,n=Date.now(),r=[],o=document.documentElement.getElementsByTagName("*").length;m(document.documentElement,(function(e,n){f(e,t).forEach((function(e,t){r.push({selector:n,value:e,nthMatch:t})}))}));var i=Date.now()-n;return{selectors:{name:[],email:r,phoneNumber:[],phoneCountry:[]},runtimeInMillis:i,nodeCount:o,runCount:1,source:e}}},p=function(e){var t;if(e.id&&"string"==typeof e.id&&window.CSS&&CSS.escape&&!(0,c.Ur)(e.id))return"#".concat(CSS.escape(e.id));var n=e.tagName.toLowerCase(),r=Array.from((null===(t=e.parentElement)||void 0===t?void 0:t.children)||[]);if(1===r.filter((function(e){return e.tagName.toLowerCase()===n})).length||!e.parentElement)return n;var o=r.indexOf(e);return"".concat(n,":nth-child(").concat(1+o,")")},m=function(e,t){for(var n=[{element:e,selector:p(e)}],r=function(){var e=n.shift();if(e){if(t(e.element,e.selector))return"break";var r=Array.from(e.element.children).map((function(t){return{element:t,selector:"".concat(e.selector," > ").concat(p(t))}}));n.push.apply(n,(0,i.Z)(r))}};n.length;){if("break"===r())break}},f=function(e,t){if("INPUT"===e.tagName||"SELECT"===e.tagName){if(document.activeElement===e)return[];var n=w(e),r=b(n);return r?[r]:[]}return u.includes(e.tagName)?[]:Array.from(e.childNodes).reduce((function(e,n){if(n.nodeType===Node.TEXT_NODE){var r,o=null===(r=n.textContent)||void 0===r?void 0:r.trim();if(!o)return e;var a=(o.length0;){var i=n.messageQueue.shift();i&&i()}n.initialized=!0,n.frame&&(n.frame.dataset.initialized="true")}else{var a=n.resolver.getResolverAndDelete(t);a&&a(t.body)}}},this.channel=t.channel,this.fingerprintedPath=t.fingerprintedPath,this.frame=null,this.frameOrigin=null,this.frameQueryParams=t.frameQueryParams,this.frameAttributes=t.frameAttributes,this.initialized=!1,this.messageQueue=[],this.resolver=new u,this.on="on"in t?t.on:{},this.createListener()}return(0,i.Z)(e,[{key:"isLoaded",value:function(){return this.initialized}},{key:"mount",value:function(e,t){if(!this.frame){if(!this.fingerprintedPath)throw new Error("Passed in an invalid path for frame client with channel: ".concat(this.channel));var n=function(e){var t=e.fingerprintedPath,n=e.name,r=e.onLoad,o=e.queryStringOptions,i=e.referrerPolicy||"no-referrer",s=document.createElement("iframe");r&&s.addEventListener("load",(function(){r(s)})),s.setAttribute("frameborder","0"),s.setAttribute("allowTransparency","true"),s.setAttribute("scrolling","no"),s.setAttribute("name",n),s.setAttribute("referrerpolicy",i),e.visible||(s.setAttribute("aria-hidden","true"),s.setAttribute("tabIndex","-1"));var u=e.frameAttributes;u&&Object.keys(u).forEach((function(e){s.setAttribute(e,u[e])}));var l,d,p=(l=e.DANGEROUS_BREAKS_ORIGIN_CHECKING_baseUrl,d=t,"".concat(l||"https://js.stripe.com/v3/").concat(d||""));if(o){var m=(0,a.q)(o);s.src="".concat(p,"#").concat(m)}else s.src=p;return e.visible||(0,c.SV)(s),s}({fingerprintedPath:this.fingerprintedPath,name:this.channel,queryStringOptions:(0,r.Z)((0,r.Z)({},this.frameQueryParams),{},{parentOrigin:window.location.origin}),referrerPolicy:"no-referrer",frameAttributes:this.frameAttributes,visible:!(null==t||!t.visible),DANGEROUS_BREAKS_ORIGIN_CHECKING_baseUrl:null==t?void 0:t.DANGEROUS_BREAKS_ORIGIN_CHECKING_baseUrl});null!=t&&t.inlineCss&&(0,c.yq)(n,t.inlineCss),e.appendChild(n),this.frame=n}}},{key:"isMounted",value:function(){return document.contains(this.frame)}},{key:"sendMessageToChild",value:function(e,t){var n=this;return this.initialized?this.postMessageToChild(e,t):new l((function(r){n.messageQueue.push((function(){return r({type:e,body:t})}))})).then((function(){return n.postMessageToChild(e,t)}))}},{key:"postMessageToChild",value:function(e,t){var n=this,r=this.frame,o=this.frameOrigin;if(!r)throw new Error("Cannot communicate with frame before calling mount().");var i=r.contentWindow;if(!i||!o)throw new Error("frame window is not ready");var a=this.resolver.getNextRequestId(),c={channel:this.channel,type:e,id:a,body:t};return new l((function(t){n.resolver.setResolver(e,a,t),i.postMessage(JSON.stringify(c),o)}))}},{key:"getClientHandler",value:function(e){var t=this.on[e.type];return t?function(e,n){var r,o=t(e);r=o,Boolean(r&&"function"==typeof r.then)?o.then((function(e){n(e)})):void 0!==o&&n(o)}:null}}]),e}();n(6274).Promise,window.location.hash.indexOf("debugMode=true"),n(6274).Promise},4775:function(e,t,n){"use strict";n.d(t,{uR:function(){return r}});var r=Object.keys({accel:!0,amex:!0,carnet:!0,cartes_bancaires:!0,diners:!0,discover:!0,eftpos_au:!0,elo:!0,girocard:!0,interac:!0,jcb:!0,mastercard:!0,nyce:!0,pulse:!0,rupay:!0,star:!0,unionpay:!0,visa:!0})},4897:function(e,t,n){"use strict";n.d(t,{y:function(){return _}});var r=n(1413),o=n(3324),i=n(5671),a=n(3144),c={PI:"paymentIntent",SI:"setupIntent",PI_SFU:"paymentIntent w/ SFU"},s=n(2024),u={billie:{paymentMethodSpec:{type:"billie",polling:!1,redirect:!0,async:!0,paymentScreens:[{type:"billie",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!1,allowedCountries:["DE","FR","NL"],defaultCountry:"DE",defaultCurrency:"eur",taxCountry:null,supportsOffSession:!1,fieldLabels:null,hasLuxeServerSpec:!0},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.billie",headline:"payment.headline.billie",noTrialOrSetupModeHeader:"payment.headline.billie"},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-billie-ce797ab9d9419d7f283c2edbabc4a0b9.svg",darkThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-billie_dark-96f0fe8684ec4bb7175c217a8447cad9.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["de","fr","nl"],prioritizedLanguages:["de-de","fr-fr","nl-nl"]},iconSize:"md",testConfig:{unitAmount:1e3}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.billie"},combinedDemos:[{id:"paymentElementBillie",name:"Payment Element + Billie",amount:100,supportedModes:["PI"],initialMode:"PI",type:"redirect",v2Key:{id:"billie-test-key",name:"Billie test key",description:"Account for Billie in DE",accountId:"acct_1QGcFYBSJ8Ajkxjy",scenariosLink:"https://admin.corp.stripe.com/scenarios?runId=scnrun*AZLr41UA2wAAACw5"}}],testConfig:{amount:2500}},jsApiConfig:{betaFlags:["billie_pm_beta_1"],supportsConfirmXPayment:!0}},capchase_pay:{paymentMethodSpec:{type:"capchase_pay",polling:!1,redirect:!0,async:!0,nextActionQrCode:!1,paymentScreens:[{type:"capchase_pay",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!1,allowedCountries:["US","GB","ES","SE","BE","NL","CA","FI","DK"],defaultCountry:"US",defaultCurrency:"usd",taxCountry:null,supportsOffSession:!1,fieldLabels:null,hasLuxeServerSpec:!0},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.capchase_pay",headline:"payment.headline.capchase_pay",noTrialOrSetupModeHeader:"payment.headline.capchase_pay"},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-capchase_pay-da19ef6ea868e9f9504a258d756a2bf1.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["us","gb","nl","ca"],prioritizedLanguages:["en-us","en-gb","es-es","sv-se","nl-nl","fr-ca","fi-fi","da-dk"]},iconSize:"md",testConfig:{unitAmount:1e6}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.capchase_pay"},combinedDemos:[{id:"paymentElementCapchasePay",name:"Payment Element + Capchase Pay",amount:3e5,supportedModes:["PI"],initialMode:"PI",type:"redirect",v2Key:{id:"capchase-test-key",name:"Capchase test key",description:"US account for testing Capchase Pay",accountId:"acct_1QGcFYBSJ8Ajkxjy",scenariosLink:"https://admin.corp.stripe.com/scenarios?runId=scnrun*AZLr5KMA2wAAACxU"}}],testConfig:{amount:1e6}},jsApiConfig:{betaFlags:["capchase_pay_pm_beta_1"],supportsConfirmXPayment:!0}},kriya:{paymentMethodSpec:{type:"kriya",polling:!1,redirect:!0,async:!0,paymentScreens:[{type:"kriya",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!1,allowedCountries:["GB","IE","BE","NL","ES","CY","DK","FI","PL","SE","CH"],defaultCountry:"GB",defaultCurrency:"gbp",taxCountry:null,supportsOffSession:!1,fieldLabels:null,hasLuxeServerSpec:!0},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.kriya",headline:"payment.headline.kriya",noTrialOrSetupModeHeader:"payment.headline.kriya"},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-kriya-2fc48d982927bee3db081ff546890ab1.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["gb","ie","be","nl","es","cy","dk","fi","pl","se","ch"],prioritizedLanguages:["en-gb","en-ie","nl-be","fr-be","nl-nl","es-es","el-cy","da-dk","fi-fi","pl-pl","sv-se","de-ch","fr-ch","it-ch"]},iconSize:"md",testConfig:{unitAmount:1e3}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.kriya"},combinedDemos:[{id:"paymentElementKriya",name:"Payment Element + Kriya",amount:2500,supportedModes:["PI"],initialMode:"PI",type:"redirect",v2Key:{id:"kriya-test-key",name:"Kriya test key",description:"Account for Kriya in GB",accountId:"acct_1QGcIvDaDBoFDcmO",scenariosLink:"https://admin.corp.stripe.com/scenarios?id=scntmp*AZLr5oZIwgAAAEaF"}}],testConfig:{amount:1e4}},jsApiConfig:{betaFlags:["kriya_pm_beta_1"],supportsConfirmXPayment:!0}},mondu:{paymentMethodSpec:{type:"mondu",polling:!1,redirect:!0,async:!0,paymentScreens:[{type:"mondu",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!1,allowedCountries:["NL","DE","GB","FR","CH","BE"],defaultCountry:"DE",defaultCurrency:"eur",taxCountry:null,supportsOffSession:!1,fieldLabels:null,hasLuxeServerSpec:!0},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.mondu",headline:"payment.headline.mondu",noTrialOrSetupModeHeader:"payment.headline.mondu"},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-mondu-0410ce9097dff459c456de81de61811c.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["de","fr","nl","gb","ch","be"],prioritizedLanguages:["de-de","fr-fr","nl-nl","en-gb","de-ch","fr-ch","it-ch","nl-be","fr-be"]},iconSize:"md",testConfig:{unitAmount:1e3}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.mondu"},combinedDemos:[{id:"paymentElementMondu",name:"Payment Element + Mondu",amount:2500,supportedModes:["PI"],initialMode:"PI",type:"redirect",v2Key:{id:"mondu-test-key",name:"Mondu test key",description:"DE account for testing Mondu",accountId:"acct_1QGcKOEF6Kk0GtMh",scenariosLink:"https://admin.corp.stripe.com/scenarios?id=scntmp*AZLr5-pVFgAAALJn"}}],testConfig:{amount:1e3}},jsApiConfig:{betaFlags:["mondu_pm_beta_1"],supportsConfirmXPayment:!0}},ng_wallet:{paymentMethodSpec:{type:"ng_wallet",polling:!1,redirect:!0,paymentScreens:[{type:"ng_wallet",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!1,allowedCountries:["US"],async:!1,defaultCountry:"US",defaultCurrency:"ngn",taxCountry:null,supportsOffSession:!1,fieldLabels:null,hasLuxeServerSpec:!0,redirectMessage:"upe.redirectMessage.ng_wallet",redirectMessageLinks:{terms_link:{url:"https://d37ugbyn3rpeym.cloudfront.net/docs/GSSL%20-%20Buyer%20T&Cs%20(Final).pdf",text:"upe.redirectMessage.ng_wallet.terms_link",linkType:"terms"}}},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.ng_wallet",headline:"payment.headline.ng_wallet",noTrialOrSetupModeHeader:"payment.headline.ng_wallet",redirectMessage:"payment.ng_wallet.hosted_instructions_notice.text",redirectMessageLinks:{terms_link:{url:"https://d37ugbyn3rpeym.cloudfront.net/docs/GSSL%20-%20Buyer%20T&Cs%20(Final).pdf",text:"payment.ng_wallet.hosted_instructions_notice.terms_link"}}},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-ng_wallet-ca32fc2af1e7ae7ab43c2eb2f90d4e11.svg",darkThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-ng_wallet_dark-640d71cce159e5fe7b5bbc3f1a942304.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["us"],prioritizedLanguages:["en-ng"]},iconSize:"md",testConfig:{unitAmount:1e7}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.ng_wallet"},combinedDemos:[{id:"paymentElementNairaWallet",name:"Payment Element + Naira Wallet",amount:1e7,currency:"NGN",supportedModes:["PI"],initialMode:"PI",type:"redirect",v2Key:{id:"ng_wallet-test-key",name:"Naira Wallet test key",description:"Account for Naira Wallet in US",accountId:"acct_1QSODeDVpqbmmLCl",scenariosLink:"https://admin.corp.stripe.com/scenarios?runId=scnrun*AZOTI4shAAAAAOeG"}}],testConfig:{amount:1e7}},jsApiConfig:{supportsConfirmXPayment:!0,betaFlags:["ng_wallet_pm_beta_1"]}},samsung_pay:{paymentMethodSpec:{type:"samsung_pay",polling:!1,redirect:!0,async:!1,paymentScreens:[{type:"samsung_pay",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!1,allowedCountries:null,defaultCountry:"US",defaultCurrency:"krw",taxCountry:null,supportsOffSession:!1,fieldLabels:null,hidePaymentMethodDescription:!0,hasLuxeServerSpec:!0,redirectMessage:"upe.redirectMessage.samsung_pay",redirectMessageLinks:{terms_link:{url:"https://support.stripe.com/questions/nicepayments-customer-terms",text:"upe.redirectMessage.samsung_pay.link_text",linkType:"terms"}}},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.samsung_pay",headline:"payment.headline.samsung_pay",noTrialOrSetupModeHeader:"payment.headline.samsung_pay",redirectMessage:"payment.samsung_pay.hosted_instructions_notice.text",redirectMessageLinks:{terms_link:{url:"https://support.stripe.com/questions/nicepayments-customer-terms",text:"payment.samsung_pay.hosted_instructions_notice.link_text"}}},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-samsungpay-ea57f885d8b777960d41a4eefc4972f8.svg",darkThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-samsungpay_dark-535de9ca969b1968a4a9af7503e39047.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["us"],prioritizedLanguages:["ko-kr"]},iconSize:"md",testConfig:{unitAmount:2500}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.samsung_pay"},testConfig:{amount:2500}}},sequra:{paymentMethodSpec:{type:"sequra",polling:!1,redirect:!0,async:!1,paymentScreens:[{type:"sequra",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!1,allowedCountries:["ES"],defaultCountry:"ES",defaultCurrency:"eur",taxCountry:null,supportsOffSession:!1,fieldLabels:null,hasLuxeServerSpec:!0},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.sequra",headline:"payment.headline.sequra",noTrialOrSetupModeHeader:"payment.headline.sequra"},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-sequra-783a26313c95faf606c21836956bde93.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["es"],prioritizedLanguages:["es-es"]},iconSize:"md",testConfig:{unitAmount:1e4}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.sequra"},combinedDemos:[{id:"paymentElementSequra",name:"Payment Element + Sequra",amount:6e4,supportedModes:["PI"],initialMode:"PI",type:"redirect",v2Key:{id:"sequra-test-key",name:"Sequra test key",description:"Account for Sequra in ES",accountId:"acct_1QGcLsGrC0D6iH8B",scenariosLink:"https://admin.corp.stripe.com/scenarios?id=scntmp*AZLr6UxVFgAAALFo"}}],testConfig:{amount:6e4}},jsApiConfig:{betaFlags:["sequra_pm_beta_1"],supportsConfirmXPayment:!0}},scalapay:{paymentMethodSpec:{type:"scalapay",polling:!1,redirect:!0,paymentScreens:[{type:"scalapay",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!1,allowedCountries:["IT","FR","ES","DE","NL","IE","BE","FI"],async:!1,defaultCountry:"IT",defaultCurrency:"eur",taxCountry:null,supportsOffSession:!1,fieldLabels:null,hasLuxeServerSpec:!0},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.scalapay",headline:"payment.headline.scalapay",noTrialOrSetupModeHeader:"payment.headline.scalapay"},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-scalapay-c37d9e7619a3128911bc39e94339cce8.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["it","fr","es","de","nl","ie","be","fi"],prioritizedLanguages:["it-ch","fr-fr","es-es","de-ch","nl-nl"]},iconSize:"md",testConfig:{unitAmount:1e4}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.scalapay"},combinedDemos:[{id:"paymentElementScala",name:"Payment Element + Scalapay",amount:1e4,currency:"eur",supportedModes:["PI"],initialMode:"PI",type:"redirect",v2Key:{id:"scalapay-test-key",name:"Scalapay test key",description:"Account for Scalapay in IT",accountId:"acct_1QIdogL4GkGKC6FU",scenariosLink:"https://admin.corp.stripe.com/scenarios?runId=scnrun*AZMIqHLbTwAAANsu"}}],testConfig:{amount:1e4}},jsApiConfig:{supportsConfirmXPayment:!0,betaFlags:["scalapay_pm_beta_1"]}},vipps:{paymentMethodSpec:{type:"vipps",polling:!1,redirect:!0,async:!1,paymentScreens:[{type:"vipps",step:"initial"}],alwaysCollectFullBillingAddress:!1,alwaysCollectCountry:!1,alwaysCollectTaxInformation:!0,allowedCountries:["NO"],defaultCountry:"NO",defaultCurrency:"nok",taxCountry:"NO",supportsOffSession:!1,fieldLabels:null,hasLuxeServerSpec:!0},hostedPaymentUiConfiguration:{messageKeys:{name:"payment.selector.label.vipps",headline:"payment.headline.vipps",noTrialOrSetupModeHeader:"payment.headline.vipps"},iconSvgs:{lightThemeSvg:"https://js.stripe.com/v3/fingerprinted/img/payment-methods/icon-pm-vipps-444ad3fb81e0b63575aa1a23cec15c2a.svg"},features:{excludeFromOverflowIconRotation:!1,isSubmittable:!0,hasSpecificNotice:!1,hasCustomReducers:!1,supportsSetupMode:!1,supportsSubscription:!1},dataDrivenConfig:{paymentMethodCategory:"simple_redirect"},sortOrder:{prioritizedCountries:["no"],prioritizedLanguages:["nb-no","nn-no","se-no","en-no"]},iconSize:"md",testConfig:{unitAmount:1e4}},paymentElementUiConfiguration:{messageKeys:{name:"upe.methods.vipps"},combinedDemos:[{id:"paymentElementVipps",name:"Payment Element + Vipps",amount:6e4,supportedModes:["PI"],initialMode:"PI",type:"redirect",v2Key:{id:"vipps-test-key",name:"Vipps test key",description:"Account for Vipps in NO",accountId:"acct_1QKGpABHDs7gLZf5",scenariosLink:"https://admin.corp.stripe.com/scenarios?runId=scnrun*AZMfzQMeLgAAAEWd"}}],testConfig:{amount:6e4}},jsApiConfig:{betaFlags:["vipps_pm_beta_1"],apiVersion:"2024-10-28.acacia;vipps_preview=v1",supportsConfirmXPayment:!0}}},l=function(){return u},d=n(3550),p=function(){function e(){(0,i.Z)(this,e),this.ofType=(0,d.HP)((function(e){return new m(e)})),this.dataDrivenOfType=(0,d.HP)((function(e){return new f(e)}))}return(0,a.Z)(e,[{key:"supportsType",value:function(e){return l().hasOwnProperty(e)}},{key:"supportsDataDrivenType",value:function(e){return this.allDataDriven.hasOwnProperty(e)}},{key:"clientSpecsByType",get:function(){return(0,s.Rb)(l(),"paymentMethodSpec")}},{key:"supportedByCheckout",get:function(){return(0,s.iO)(l(),(function(){return!0}))}},{key:"typesSupportingPaymentElement",get:function(){var e=(0,s.Rb)(l(),"paymentElementUiConfiguration"),t=(0,s.Nn)(e,void 0);return(0,s.Ke)(t)}},{key:"paymentElementPaymentMethodLabel",get:function(){var e=(0,s.Rb)(l(),"paymentElementUiConfiguration.messageKeys.name");return(0,s.Nn)(e,void 0)}},{key:"typesWithLuxeServerSpec",get:function(){var e=(0,s.Rb)(l(),"paymentMethodSpec.hasLuxeServerSpec"),t=(0,s.ve)(e,!0);return(0,s.Ke)(t)}},{key:"submittableToHostedUi",get:function(){var e=(0,s.Rb)(l(),"hostedPaymentUiConfiguration.features.isSubmittable");return(0,s.ve)(e,!0)}},{key:"withIconSvgs",get:function(){var e=(0,s.Rb)(l(),"hostedPaymentUiConfiguration.iconSvgs");return(0,s.iO)((0,s.Nn)(e,void 0),(function(){return!0}))}},{key:"noTrialOrSetupModeHeaderMessages",get:function(){return(0,s.Rb)(l(),"hostedPaymentUiConfiguration.messageKeys.noTrialOrSetupModeHeader")}},{key:"withDefaultReducer",get:function(){var e=(0,s.Rb)(l(),"hostedPaymentUiConfiguration.features.hasCustomReducers"),t=(0,s.Nn)(e,!0);return(0,s.iO)(t,(function(e,t){return l()[t].paymentMethodSpec}))}},{key:"hasDefaultReducerPaymentMethod",value:function(e){return this.withDefaultReducer.hasOwnProperty(e)}},{key:"allDataDriven",get:function(){var e=(0,s.Rb)(l(),"hostedPaymentUiConfiguration.dataDrivenConfig"),t=(0,s.Nn)(e,void 0);return(0,s.iO)(t,(function(){return!0}))}},{key:"_existingDemosByType",get:function(){var e=(0,s.Rb)(l(),"paymentElementUiConfiguration.combinedDemos");return(0,s.Nn)(e,void 0)}},{key:"allCombinedDemoSettings",value:function(e){var t={};return(0,s.qh)(this._existingDemosByType).forEach((function(n){var r,i,a=(0,o.Z)(n,2),s=a[0],u=a[1],d=null===(r=e[s])||void 0===r?void 0:r.keys;if(!d)throw new Error("Keys for merchants are not yet defined for ".concat(s));var p=null===(i=l()[s].jsApiConfig)||void 0===i?void 0:i.betaFlags;u.forEach((function(e){t[e.id]={id:e.id,name:e.name,keys:{publicKey:d.publishable,secretKey:d.secret,beta:p||null,apiVersion:null,header:null},initialMode:c[e.initialMode]}}))})),t}},{key:"allDemoProps",get:function(){return(0,s.VS)((0,s.qh)(this._existingDemosByType),(function(e){var t=(0,o.Z)(e,2),n=t[0];return t[1].map((function(e){var t;return(0,r.Z)((0,r.Z)({},e),{},{currency:"currency"in e?e.currency:l()[n].paymentMethodSpec.defaultCurrency,paymentMethodType:l()[n].paymentMethodSpec.type,paymentMethodRegistryKey:n,betaFlags:(null===(t=l()[n].jsApiConfig)||void 0===t?void 0:t.betaFlags)||[]})}))}))}},{key:"allCombinedDemoV2ApiKeyConfigs",value:function(e){var t=[];return(0,s.qh)(this._existingDemosByType).forEach((function(n){var i,a=(0,o.Z)(n,2),c=a[0],s=a[1],u=null===(i=e[c])||void 0===i?void 0:i.keys;if(!u)throw new Error("Keys for merchants are not yet defined for ".concat(c));s.forEach((function(e){t.push((0,r.Z)((0,r.Z)({},e.v2Key),{},{publicKey:u.publishable,secretKey:u.secret}))}))})),t}},{key:"typesSupportingFinalizedInvoice",get:function(){return(0,s.Ke)(l())}},{key:"bySortPrioritizedLanguage",get:function(){var e=(0,s.Rb)(l(),"hostedPaymentUiConfiguration.sortOrder.prioritizedLanguages"),t={};return(0,s.qh)(e).forEach((function(e){var n=(0,o.Z)(e,2),r=n[0];n[1].forEach((function(e){t[e]=(t[e]||[]).concat([r])}))})),t}},{key:"bySortPrioritizedCountry",get:function(){var e=(0,s.Rb)(l(),"hostedPaymentUiConfiguration.sortOrder.prioritizedCountries"),t={};return(0,s.qh)(e).forEach((function(e){var n=(0,o.Z)(e,2),r=n[0];n[1].forEach((function(e){t[e]=(t[e]||[]).concat([r])}))})),t}},{key:"typesByType",get:function(){return(0,s.Rb)(l(),"paymentMethodSpec.type")}},{key:"allBetaFlags",get:function(){var e=(0,s.Rb)(l(),"jsApiConfig.betaFlags"),t=(0,s.Nn)(e,void 0),n={};return(0,s.VO)(t).forEach((function(e){e.forEach((function(e){n[e]=e}))})),n}},{key:"allQRPMs",get:function(){var e=(0,s.Rb)(l(),"paymentMethodSpec.nextActionQrCode"),t=(0,s.ve)(e,!0);return(0,s.Ke)(t)}},{key:"allQRPMScanText",get:function(){var e={};return this.allQRPMs.forEach((function(t){e[t]="upe.qr_code_scan_text.".concat(t)})),e}}]),e}(),m=function(){function e(t){(0,i.Z)(this,e),this._paymentMethodType=t}return(0,a.Z)(e,[{key:"spec",get:function(){return this._config.paymentMethodSpec}},{key:"iconConfig",get:function(){var e="iconSize"in this._hostedPaymentUiConfiguration?{iconSize:this._hostedPaymentUiConfiguration.iconSize}:null;return(0,r.Z)({iconName:this.spec.type},e)}},{key:"iconSvgLight",get:function(){return this._hostedPaymentUiConfiguration.iconSvgs.lightThemeSvg}},{key:"iconSvgDark",get:function(){return"darkThemeSvg"in this._hostedPaymentUiConfiguration.iconSvgs?this._hostedPaymentUiConfiguration.iconSvgs.darkThemeSvg:null}},{key:"headlineMessageKey",get:function(){return this._hostedPaymentUiConfiguration.messageKeys.headline}},{key:"paymentMethodNameLabelKey",get:function(){return this._hostedPaymentUiConfiguration.messageKeys.name}},{key:"messageKeys",get:function(){return this._hostedPaymentUiConfiguration.messageKeys}},{key:"redirectMessage",get:function(){return"redirectMessage"in this.messageKeys?this.messageKeys.redirectMessage:null}},{key:"redirectMessageLinks",get:function(){return"redirectMessageLinks"in this.messageKeys?this.messageKeys.redirectMessageLinks:null}},{key:"excludeFromOverflowIconRotation",get:function(){return this._hostedPaymentUiConfiguration.features.excludeFromOverflowIconRotation}},{key:"_config",get:function(){return l()[this._paymentMethodType]}},{key:"_hostedPaymentUiConfiguration",get:function(){return this._config.hostedPaymentUiConfiguration}}]),e}(),f=function(){function e(t){(0,i.Z)(this,e),this._paymentMethodType=t}return(0,a.Z)(e,[{key:"paymentMethodCategory",get:function(){return this._config.hostedPaymentUiConfiguration.dataDrivenConfig.paymentMethodCategory}},{key:"submitPaymentOptions",value:function(e){var t=this._config.paymentMethodSpec;return{submitMode:"payment_method_data",paymentType:t.type,data:{type:t.type,paymentMethodData:{billing_details:e}}}}},{key:"_config",get:function(){return l()[this._paymentMethodType]}}]),e}(),_=new p},6977:function(e,t,n){"use strict";n.d(t,{G2:function(){return f},Lj:function(){return a},O3:function(){return d},PA:function(){return s},QS:function(){return i},RY:function(){return l},e3:function(){return u},gW:function(){return m},mD:function(){return p},vF:function(){return c}});var r=n(1413),o=n(9581),i=(n(942),"spc"),a=function(e){return void 0!==e.paymentIntent},c=function(e){return void 0!==e.setupIntent},s=function(e,t){switch(e.type){case"object":return{paymentIntent:e.object};case"error":var n=t?{payment_intent:t}:{};return{error:(0,r.Z)((0,r.Z)({},n),e.error)};default:return(0,o.Rz)(e)}},u=function(e,t){switch(e.type){case"error":return{error:(0,r.Z)((0,r.Z)({},t?{setup_intent:t}:{}),e.error)};case"object":return{setupIntent:e.object};default:return(0,o.Rz)(e)}},l=function(e){var t=e.trim().match(/^((seti|pi)_[A-Za-z0-9]+)_secret_[^-]+$/);return t?"pi"===t[2]?{id:t[1],clientSecret:t[0],type:"PAYMENT_INTENT"}:{id:t[1],clientSecret:t[0],type:"SETUP_INTENT"}:null},d=function(e){return"payment_intent"===e.object?{id:e.id,clientSecret:e.client_secret,type:"PAYMENT_INTENT"}:{id:e.id,clientSecret:e.client_secret,type:"SETUP_INTENT"}},p=function(e){return"requires_source_action"===e||"requires_action"===e},m=function(e){return"requires_payment_method"===e||"requires_confirmation"===e||"requires_source"===e},f=function(e){return"requires_source_action"===e.status||"requires_action"===e.status?e.next_action:null}},1743:function(e,t,n){"use strict";n.d(t,{Tw:function(){return o},Uz:function(){return s},WN:function(){return l},aH:function(){return a},kB:function(){return i},qp:function(){return u},yv:function(){return d}});var r=n(1413),o="40px",i={invalid_coupon_code:"invalid_coupon_code",expired_coupon_code:"expired_coupon_code",invalid_payer_zip:"invalid_payer_zip"},a=(0,r.Z)({success:"success",fail:"fail",invalid_shipping_address:"invalid_shipping_address"},i),c=(0,r.Z)({fail:"fail",invalid_payer_name:"invalid_payer_name",invalid_payer_email:"invalid_payer_email",invalid_payer_phone:"invalid_payer_phone",invalid_shipping_address:"invalid_shipping_address"},i),s={shipping:"shipping",delivery:"delivery",pickup:"pickup"},u=(0,r.Z)({success:"success"},c),l={merchantCapabilities:["supports3DS"],displayItems:[]},d={auto:"auto",available:"available",unavailableItemIneligible:"unavailableItemIneligible",unavailableRecurringTransaction:"unavailableRecurringTransaction"}},7934:function(e,t,n){"use strict";n.d(t,{RO:function(){return d}});var r,o,i=n(4942),a=n(942),c=(r={},(0,i.Z)(r,a.rM.VISA,"visa"),(0,i.Z)(r,a.rM.MASTERCARD,"masterCard"),(0,i.Z)(r,a.rM.AMEX,"amex"),(0,i.Z)(r,a.rM.DISCOVER,"discover"),(0,i.Z)(r,a.rM.JCB,"jcb"),(0,i.Z)(r,a.rM.UNIONPAY,"chinaUnionPay"),(0,i.Z)(r,a.rM.DINERS,null),(0,i.Z)(r,a.ZJ.MAESTRO,"maestro"),(0,i.Z)(r,a.ZJ.CARTES_BANCAIRES,"cartesBancaires"),(0,i.Z)(r,a.ZJ.INTERAC,"interac"),r),s=(o={},(0,i.Z)(o,a.rM.VISA,"VISA"),(0,i.Z)(o,a.rM.MASTERCARD,"MASTERCARD"),(0,i.Z)(o,a.rM.AMEX,"AMEX"),(0,i.Z)(o,a.rM.DISCOVER,"DISCOVER"),(0,i.Z)(o,a.rM.JCB,"JCB"),(0,i.Z)(o,a.rM.DINERS,null),(0,i.Z)(o,a.ZJ.CARTES_BANCAIRES,null),(0,i.Z)(o,a.ZJ.INTERAC,null),["AT","AU","BE","CA","CH","DE","DK","EE","ES","FI","FR","GB","GR","HK","IE","IT","JP","LT","LU","LV","MX","NL","NO","NZ","PL","PT","SE","SG","US"]),u=["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GI","GR","HR","HU","IE","IT","LI","LT","LU","LV","MT","NL","NO","PL","PT","RO","SE","SI","SK","GB","HK","SG","CH","US"],l=function(e,t,n,r,o,i){var c=[];return r&&-1!==r.indexOf(a.ZJ.CARTES_BANCAIRES)&&"eur"===o&&i&&c.push(a.ZJ.CARTES_BANCAIRES),-1!==s.indexOf(e)&&c.push(a.rM.AMEX),(-1!==["GB","CA","JP","US"].indexOf(e)||t)&&c.push.apply(c,[a.rM.DISCOVER,a.rM.DINERS]),(-1!==u.indexOf(e)||t)&&c.push(a.rM.JCB),c.push.apply(c,[a.rM.MASTERCARD,a.rM.VISA]),c.filter((function(e){return-1===n.indexOf(e)}))},d=function(e,t,n,r,o,i){return l(e,t,n,r,o,i).reduce((function(e,t){var n=c[t];return n&&e.push(n),e}),[])}},9581:function(e,t,n){"use strict";n.d(t,{Rz:function(){return s}});var r=n(3144),o=n(5671),i=n(136),a=n(9388),c=n(7112),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"absurd";throw new Error("".concat(t,': expected nothing but got "').concat(e,'"'))};Error},2141:function(e,t,n){"use strict";n.d(t,{J$:function(){return r.J}});var r=n(4832)},4832:function(e,t,n){"use strict";n.d(t,{J:function(){return o}});var r={AE:"AE",AT:"AT",AU:"AU",BE:"BE",BG:"BG",BR:"BR",CA:"CA",CH:"CH",CI:"CI",CR:"CR",CY:"CY",CZ:"CZ",DE:"DE",DK:"DK",DO:"DO",EE:"EE",ES:"ES",FI:"FI",FR:"FR",GB:"GB",GI:"GI",GR:"GR",GT:"GT",HK:"HK",HR:"HR",HU:"HU",ID:"ID",IE:"IE",IN:"IN",IT:"IT",JP:"JP",LI:"LI",LT:"LT",LU:"LU",LV:"LV",MT:"MT",MX:"MX",MY:"MY",NL:"NL",NO:"NO",NZ:"NZ",PE:"PE",PH:"PH",PL:"PL",PT:"PT",RO:"RO",SE:"SE",SG:"SG",SI:"SI",SK:"SK",SN:"SN",TH:"TH",TT:"TT",US:"US",UY:"UY"},o=Object.keys(r)},1765:function(e,t,n){"use strict";n.d(t,{M4:function(){return u},MJ:function(){return l},P3:function(){return v},ub:function(){return h},Lv:function(){return d},uN:function(){return m},dZ:function(){return y},jk:function(){return g}});var r,o=n(9062),i=n(6617),a=n(1873),c=n(1413),s=n(4897),u=(0,c.Z)((0,c.Z)({},s.y.allBetaFlags),{},{checkout_beta_2:"checkout_beta_2",checkout_beta_3:"checkout_beta_3",checkout_beta_4:"checkout_beta_4",checkout_beta_testcards:"checkout_beta_testcards",payment_intent_beta_1:"payment_intent_beta_1",payment_intent_beta_2:"payment_intent_beta_2",payment_intent_beta_3:"payment_intent_beta_3",google_pay_beta_1:"google_pay_beta_1",acss_debit_beta_1:"acss_debit_beta_1",acss_debit_beta_2:"acss_debit_beta_2",afterpay_clearpay_setup_intents_beta:"afterpay_clearpay_setup_intents_beta",bacs_debit_beta:"bacs_debit_beta",fpx_bank_beta_1:"fpx_bank_beta_1",ideal_pm_beta_1:"ideal_pm_beta_1",line_items_beta_1:"line_items_beta_1",oxxo_pm_beta_1:"oxxo_pm_beta_1",gopay_pm_beta_1:"gopay_pm_beta_1",shopeepay_pm_beta_1:"shopeepay_pm_beta_1",qris_pm_beta_1:"qris_pm_beta_1",kr_market_pm_beta_1:"kr_market_pm_beta_1",ng_market_pm_beta_1:"ng_market_pm_beta_1",sepa_pm_beta_1:"sepa_pm_beta_1",deferred_intent_blik_beta_1:"deferred_intent_blik_beta_1",klarna_pm_beta_1:"klarna_pm_beta_1",tax_product_beta_1:"tax_product_beta_1",wechat_pay_pm_beta_1:"wechat_pay_pm_beta_1",wechat_pay_pm_beta_2:"wechat_pay_pm_beta_2",checkout_beta_locales:"checkout_beta_locales",stripe_js_beta_locales:"stripe_js_beta_locales",upi_beta_1:"upi_beta_1",upi_beta_2:"upi_beta_2",issuing_elements_1:"issuing_elements_1",issuing_elements_2:"issuing_elements_2",return_intents_beta_1:"return_intents_beta_1",netbanking_beta_1:"netbanking_beta_1",netbanking_bank_beta_1:"netbanking_bank_beta_1",instant_debits_beta_1:"instant_debits_beta_1",link_beta_1:"link_beta_1",link_beta_2:"link_beta_2",link_beta_3:"link_beta_3",link_default_integration_beta_1:"link_default_integration_beta_1",link_default_integration_beta_2:"link_default_integration_beta_2",payment_element_beta_1:"payment_element_beta_1",elements_customers_beta_1:"elements_customers_beta_1",elements_spm_sfu_off_session_override_beta_1:"elements_spm_sfu_off_session_override_beta_1",card_country_event_beta_1:"card_country_event_beta_1",id_bank_transfer_beta_1:"id_bank_transfer_beta_1",id_bank_transfer_beta_2:"id_bank_transfer_beta_2",us_bank_account_beta_2:"us_bank_account_beta_2",cup_apple_pay_beta_1:"cup_apple_pay_beta_1",nz_bank_account_beta_1:"nz_bank_account_beta_1",nz_bank_account_beta_2:"nz_bank_account_beta_2",payment_element_apple_pay_beta_1:"payment_element_apple_pay_beta_1",link_autofill_modal_beta_1:"link_autofill_modal_beta_1",shipping_address_element_beta_1:"shipping_address_element_beta_1",process_order_beta_1:"process_order_beta_1",server_side_confirmation_beta_1:"server_side_confirmation_beta_1",pay_by_bank_beta_1:"pay_by_bank_beta_1",blocked_card_brands_beta_1:"blocked_card_brands_beta_1",blocked_card_brands_beta_2:"blocked_card_brands_beta_2",payment_element_disable_card_country_zip_validations_beta_1:"payment_element_disable_card_country_zip_validations_beta_1",affirm_in_context_beta_1:"affirm_in_context_beta_1",ume_beta_1:"ume_beta_1",ume_beta_2:"ume_beta_2",ume_beta_3:"ume_beta_3",payment_method_messaging_autopm_beta_1:"payment_method_messaging_autopm_beta_1",networks_change_1:"networks_change_1",express_checkout_element_beta_1:"express_checkout_element_beta_1",pay_button_element_beta_1:"pay_button_element_beta_1",link_in_card_element_beta_1:"link_in_card_element_beta_1",sunbit_pm_beta_1:"sunbit_pm_beta_1",satispay_pm_beta_1:"satispay_pm_beta_1",ng_bank_pm_beta_1:"ng_bank_pm_beta_1",ng_bank_transfer_pm_beta_1:"ng_bank_transfer_pm_beta_1",ng_card_pm_beta_1:"ng_card_pm_beta_1",ng_ussd_pm_beta_1:"ng_ussd_pm_beta_1",financial_connections_on_event_beta_1:"financial_connections_on_event_beta_1",elements_enable_deferred_intent_beta_1:"elements_enable_deferred_intent_beta_1",elements_enable_deferred_intent_beta_2:"elements_enable_deferred_intent_beta_2",enable_stripe_update_api_key_beta_0:"enable_stripe_update_api_key_beta_0",cartes_bancaires_apple_pay_beta_1:"cartes_bancaires_apple_pay_beta_1",interac_apple_pay_beta_1:"interac_apple_pay_beta_1",payment_request_button_two_button_beta_1:"payment_request_button_two_button_beta_1",custom_checkout_beta_1:"custom_checkout_beta_1",custom_checkout_beta_2:"custom_checkout_beta_2",custom_checkout_beta_3:"custom_checkout_beta_3",custom_checkout_beta_4:"custom_checkout_beta_4",custom_checkout_beta_5:"custom_checkout_beta_5",custom_checkout_beta_6:"custom_checkout_beta_6",custom_checkout_internal_dev_beta:"custom_checkout_internal_dev_beta",custom_checkout_adaptive_pricing_1:"custom_checkout_adaptive_pricing_1",elements_adaptive_pricing_beta_1:"elements_adaptive_pricing_beta_1",custom_checkout_server_updates_1:"custom_checkout_server_updates_1",custom_domain_checkout:"custom_domain_checkout",deferred_intent_pe_optional_amount_beta_0:"deferred_intent_pe_optional_amount_beta_0",south_korea_market_beta_1:"south_korea_market_beta_1",ece_apple_pay_deferred_payment_card_funding_beta_1:"ece_apple_pay_deferred_payment_card_funding_beta_1",ece_apple_pay_payment_request_passthrough_1:"ece_apple_pay_payment_request_passthrough_1",ece_temp_prevent_default_beta_1:"ece_temp_prevent_default_beta_1",ece_temp_click_shape_changes_beta_1:"ece_temp_click_shape_changes_beta_1",disable_link_passthrough_beta_1:"disable_link_passthrough_beta_1",payto_pm_beta_1:"payto_pm_beta_1",elements_enable_sessions_edge:"elements_enable_sessions_edge",multibanco_pm_beta_1:"multibanco_pm_beta_1",disable_deferred_intent_client_validation_beta_1:"disable_deferred_intent_client_validation_beta_1",rechnung_pm_beta_1:"rechnung_pm_beta_1",embedded_checkout_byol_beta_1:"embedded_checkout_byol_beta_1",change_event_improvements_beta_1:"change_event_improvements_beta_1",mb_way_pm_beta_1:"mb_way_pm_beta_1",payment_element_byof_beta_1:"payment_element_byof_beta_1"}),l=Object.freeze({netbankingBank:"netbanking_bank_beta_1",shippingAddress:["shipping_address_element_beta_1","link_beta_1","link_beta_2","link_beta_3"],unifiedMessage:["ume_beta_1","ume_beta_2"],currencySelector:["custom_checkout_adaptive_pricing_1","elements_adaptive_pricing_beta_1"]}),d=Object.keys(u),p={},m=function e(t,n){if(Array.isArray(n))return n.some((function(n){return e(t,n)}));var r=p[n];return(null==t?void 0:t.indexOf(n))>-1||!!r&&(null==t?void 0:t.indexOf(r))>-1},f=window.location.hash.substring(1).split("?")[0],_=(0,a.ld)((0,a.mC)({betas:(0,a.Wc)((0,a.CT)(a.kw.apply(void 0,(0,o.Z)(d))),(function(){return[]}))}),(0,i.vB)(f),"internal"),h="valid"===_.type?_.value.betas:[],y=function(e){var t=[],n=[];if(e){if(-1!==e.indexOf(u.blocked_card_brands_beta_1)&&-1!==e.indexOf(u.blocked_card_brands_beta_2))return{validBetas:t,betaError:"The following betas are incompatible for Stripe() parameter:\n\n- ".concat(u.blocked_card_brands_beta_1,"\n- ").concat(u.blocked_card_brands_beta_2,"\n\n Please remove ").concat(u.blocked_card_brands_beta_1,".")};e.forEach((function(e){d.indexOf(e)>-1?t.push(u[e]):n.push(e)}))}if(n.length>0){var r="The following betas are unrecognized for Stripe() parameter:\n\n- ".concat(n.join("\n- "),"\n\n They are either invalid or expired betas, please remove these beta flags to prevent future integration issues.");return{validBetas:t,betaWarning:r}}return{validBetas:t}},v=[],g=(r=v,function(e,t){return m(t,u.stripe_js_beta_locales)||-1===r.indexOf(e)?e:"auto"})},3333:function(e,t,n){"use strict";n.d(t,{sV:function(){return N},DI:function(){return T},j3:function(){return F},fL:function(){return Q},G9:function(){return B},Bh:function(){return P},P0:function(){return A},PB:function(){return G},D$:function(){return z},D1:function(){return L},aS:function(){return U},JW:function(){return M},QH:function(){return W},JC:function(){return H},NK:function(){return Y},yv:function(){return O},ZR:function(){return K},q$:function(){return I},Ah:function(){return R},q:function(){return ee},cE:function(){return V},s$:function(){return x},Gx:function(){return X},OV:function(){return j},ub:function(){return Z},xz:function(){return D},Wt:function(){return q},x5:function(){return $},gG:function(){return re},gq:function(){return ne},d4:function(){return te},lE:function(){return ie},UT:function(){return oe}});var r,o=n(6274).Promise,i=function(e){var t,n;return function(){for(var r=arguments.length,o=new Array(r),i=0;i0||"ontouchstart"in window))&&!l(e)},f=i((function(e){return c(a(e),"macintosh")||c(a(e),"iphone")||c(a(e),"ipad")})),_=function(e,t){return f(e)&&c(e,"like")&&(/(iPhone|iPod|iPad).*AppleWebKit((?!.*Safari)|(.*\([^)]*like[^)]*Safari[^)]*\)))/i.test(e)||/(Macintosh).*AppleWebKit((?!.*Safari)|(.*\([^)]*like[^)]*Safari[^)]*\)))/i.test(e)&&m(e,t))},h=i((function(e){return b(e)&&/wv|Version\/\d+\.\d+/.test(e)&&!y(e)})),y=function(e){return c(a(e),"opera mini")},v=i((function(e){return f(e)&&!w(e)&&/^((?!chrome|android).)*safari/i.test(e)&&!d(e)})),g=function(e){return c(a(e),"firefox")},b=function(e){return c(a(e),"android")&&!l(e)},w=i((function(e){return c(a(e),"chrome/")})),k=i((function(e){return w(e)&&/Chrome\/(7[4-9]|[8-9]\d+|[1-9]\d{2,})/i.test(e)})),S="undefined"!=typeof window,C=S?window.navigator.maxTouchPoints:0,E=S?window.navigator.userAgent:"",A=(S&&window.navigator.platform,s(E)),P=u(E),M=(s(r=E)&&/Edge\/((1[0-6]\.)|0\.)/i.test(r),l(E)),R=(function(e){c(a(e),"msie")&&/MSIE ([0-9]{1,}[.0-9]{0,})/i.test(e)}(E),p(E,C)),I=(m(E,C),function(e,t){return p(e,t)||b(e)}(E,C)),N=b(E),T=h(E),O=(function(e){c(a(e),"android 4.")&&!c(a(e),"chrome")&&b(e)}(E),_(E,C)),x=v(E),j=function(e,t){var n=p(e,t)&&/OS (1[7-9]|[2-9]\d+|[1-9]\d{2,})/i.test(e);return v(e)&&/Version\/(1[7-9]|[2-9]\d+|[1-9]\d{2,})/i.test(e)||n}(E,C),Z=function(e){return v(e)&&/Version\/(1[8-9]|[2-9]\d+|[1-9]\d{2,})/i.test(e)}(E),L=(function(e,t){v(e)&&p(e,t)}(E,C),g(E)),D=(function(e){g(e)&&/Firefox\/(50|51|[0-4]?\d)([^\d]|$)/i.test(e)}(E),d(E)),B=w(E),q=(function(e){w(e)&&(k(e)||/Chrome\/(6[6-9]|[7-9]\d+|[1-9]\d{2,})/i.test(e))}(E),k(E),function(e){return c(a(e),"applewebkit/")&&!c(a(e),"chrome")&&!s(e)&&!l(e)}(E)),F=function(e){return c(a(e),"chrome")&&!s(e)}(E),U=(function(e){c(a(e),"crios")}(E),function(e){return c(a(e),"fxios")}(E)),G=function(e){return c(a(e),"edgios")}(E),z=function(e){return c(a(e),"electron")}(E),V=y(E),K=function(e){return f(e)&&!w(e)&&/Macintosh.*AppleWebKit(?!.*Safari)/i.test(e)}(E),H=function(e){return c(a(e),"safari line")}(E),Y=function(e){return c(a(e),"pinterest/ios")}(E),W=(function(e){/OS 16_((\d+_?){1,2})/i.test(e)}(E),function(e){return/OS 18_0/i.test(e)}(E)),X=i((function(){return x&&"download"in document.createElement("a")})),Q=S&&!!window.navigator.brave&&"function"==typeof window.navigator.brave.isBrave,J=function(){return S&&window.navigator&&"standalone"in window.navigator&&window.navigator.standalone},$=i((function(){return _(E,C)||h(E)||function(e){return c(e,"FBAN")||c(e,"FBAV")}(E)||J()})),ee=(i((function(){return J()||!!window.matchMedia&&window.matchMedia("(display-mode: standalone)").matches})),i((function(){return function(e,t){return new o((function(n){if(S&&v(e)&&void 0!==t){var r="__stripe_private_mode_test";try{var o=window.indexedDB&&window.indexedDB.open&&window.indexedDB.open(r,1);o.onupgradeneeded=function(){var e=o.result;try{e.createObjectStore("test",{autoIncrement:!0}).put(new Blob),n(!1)}catch(e){var t=e instanceof Error?e.message:e;if("string"==typeof t){var i=/BlobURLs are not yet supported/.test(t);n(i)}else n(!1)}finally{e.close(),window.indexedDB&&window.indexedDB.deleteDatabase&&window.indexedDB.deleteDatabase(r)}}}catch(e){n(!1)}}else n(!1)}))}(E,C)}))),te=i((function(e){var t=a(e);return c(t,"windows")?"Windows":c(t,"android")?"Android":c(t,"iphone")||c(t,"ipad")?"iOS":c(t,"mac os")?"MacOS":c(t,"cros")?"ChromeOS":c(t,"linux")?"Linux":"Other"})),ne=i((function(e){var t=a(e);return d(e)?"SamsungBrowser":c(t,"instagram")?"Instagram":c(t,"firefox")?"Firefox":s(e)||u(e)?"IE Edge":l(e)?"IE":c(t,"fb_iab")||c(t,"fban")||c(t,"fbav")?"Facebook":c(t,"chrome")?"Chrome":c(t,"safari")?"Safari":"Other"})),re=(B&&te(E),function(){return!($()||z||K||Q||Y||H||G||V||window.crossOriginIsolated)}),oe=function(){return(window.navigator.languages||[])[0]||window.navigator.userLanguage||window.navigator.language||""},ie=function(){try{var e,t,n=null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.connection;return{effectiveType:n.effectiveType,rtt:n.rtt,downlink:n.downlink}}catch(e){return{}}}},2024:function(e,t,n){"use strict";n.d(t,{CE:function(){return A},G:function(){return a},Ke:function(){return d},Nn:function(){return E},PM:function(){return N},Q8:function(){return h},Rb:function(){return v},TS:function(){return I},VO:function(){return p},VS:function(){return w},Xy:function(){return l},cx:function(){return s},dq:function(){return f},ei:function(){return k},iO:function(){return y},l2:function(){return g},qh:function(){return m},qk:function(){return _},sE:function(){return c},sq:function(){return b},ve:function(){return C}});var r=n(7462),o=n(3324),i=n(6274).Promise,a=function(e,t){for(var n=-1,r=null==e?0:e.length;++n@]+@[^\s<>@.]+(\.[a-zA-Z0-9-]+)+$/,C=/[^\s<>@]+@[^\s<>@.]+(\.[a-zA-Z0-9-]+\w)+(\.[a-zA-Z0-9-]+\w)?/g},4020:function(e,t,n){"use strict";n.d(t,{Fe:function(){return a}});var r={bif:1,clp:1,djf:1,gnf:1,jpy:1,kmf:1,krw:1,mga:1,pyg:1,rwf:1,vnd:1,vuv:1,xaf:1,xof:1,xpf:1,bhd:1e3,jod:1e3,kwd:1e3,omr:1e3,tnd:1e3},o=["cop","idr","lbp","pkr"],i=function(e,t){var n=function(e){var t=r[e.toLowerCase()]||100;return{unitSize:1/t,fractionDigits:Math.ceil(Math.log(t)/Math.log(10))}}(t);return{result:e*n.unitSize,fractionDigits:n.fractionDigits}},a=function(e,t,n){var r=i(e,t),a=r.result,c=r.fractionDigits;return"apple"===n&&-1!==o.indexOf(t)?Math.ceil(a).toString():"google"===n?a.toFixed(c>2?2:c):a.toFixed(c)}},6241:function(e,t,n){"use strict";n.d(t,{Fe:function(){return r.Fe},QT:function(){return o.Q}});var r=n(4020),o=n(462)},462:function(e,t,n){"use strict";n.d(t,{Q:function(){return o}});var r={aed:"aed",afn:"afn",all:"all",amd:"amd",ang:"ang",aoa:"aoa",ars:"ars",aud:"aud",awg:"awg",azn:"azn",bam:"bam",bbd:"bbd",bdt:"bdt",bgn:"bgn",bhd:"bhd",bif:"bif",bmd:"bmd",bnd:"bnd",bob:"bob",brl:"brl",bsd:"bsd",btn:"btn",bwp:"bwp",byn:"byn",byr:"byr",bzd:"bzd",cad:"cad",cdf:"cdf",chf:"chf",clf:"clf",clp:"clp",cny:"cny",cop:"cop",crc:"crc",cuc:"cuc",cup:"cup",cve:"cve",czk:"czk",djf:"djf",dkk:"dkk",dop:"dop",dzd:"dzd",egp:"egp",ern:"ern",etb:"etb",eur:"eur",fjd:"fjd",fkp:"fkp",gbp:"gbp",gel:"gel",ghs:"ghs",gip:"gip",gmd:"gmd",gnf:"gnf",gtq:"gtq",gyd:"gyd",hkd:"hkd",hnl:"hnl",htg:"htg",huf:"huf",idr:"idr",ils:"ils",inr:"inr",iqd:"iqd",irr:"irr",isk:"isk",jmd:"jmd",jod:"jod",jpy:"jpy",kes:"kes",kgs:"kgs",khr:"khr",kmf:"kmf",kpw:"kpw",krw:"krw",kwd:"kwd",kyd:"kyd",kzt:"kzt",lak:"lak",lbp:"lbp",lkr:"lkr",lrd:"lrd",lsl:"lsl",ltl:"ltl",lvl:"lvl",lyd:"lyd",mad:"mad",mdl:"mdl",mga:"mga",mkd:"mkd",mmk:"mmk",mnt:"mnt",mop:"mop",mro:"mro",mur:"mur",mvr:"mvr",mwk:"mwk",mxn:"mxn",myr:"myr",mzn:"mzn",nad:"nad",ngn:"ngn",nio:"nio",nok:"nok",npr:"npr",nzd:"nzd",omr:"omr",pab:"pab",pen:"pen",pgk:"pgk",php:"php",pkr:"pkr",pln:"pln",pyg:"pyg",qar:"qar",ron:"ron",rsd:"rsd",rub:"rub",rwf:"rwf",sar:"sar",sbd:"sbd",scr:"scr",sdg:"sdg",sek:"sek",sgd:"sgd",shp:"shp",skk:"skk",sll:"sll",sos:"sos",srd:"srd",ssp:"ssp",std:"std",svc:"svc",syp:"syp",szl:"szl",thb:"thb",tjs:"tjs",tmt:"tmt",tnd:"tnd",top:"top",try:"try",ttd:"ttd",twd:"twd",tzs:"tzs",uah:"uah",ugx:"ugx",usd:"usd",uyu:"uyu",uzs:"uzs",vef:"vef",vnd:"vnd",vuv:"vuv",wst:"wst",xaf:"xaf",xag:"xag",xau:"xau",xcd:"xcd",xdr:"xdr",xof:"xof",xpf:"xpf",yer:"yer",zar:"zar",zmk:"zmk",zmw:"zmw",btc:"btc",jep:"jep",eek:"eek",ghc:"ghc",mtl:"mtl",tmm:"tmm",yen:"yen",zwd:"zwd",zwl:"zwl",zwn:"zwn",zwr:"zwr"},o=Object.keys(r)},6835:function(e,t,n){"use strict";n.d(t,{B:function(){return a}});var r=n(5671),o=n(3144),i=n(6274).Promise,a=function(){function e(){var t=this;(0,r.Z)(this,e),this._state="pending",this._state="pending",this.promise=new i((function(e,n){t._resolve=e,t._reject=n})),this.promise.then((function(){t._state="resolved"}),(function(){t._state="rejected"}))}return(0,o.Z)(e,[{key:"resolve",value:function(e){this._resolve(e)}},{key:"reject",value:function(e){this._reject(e)}},{key:"isResolved",value:function(){return"resolved"===this._state}},{key:"isRejected",value:function(){return"rejected"===this._state}},{key:"isPending",value:function(){return"pending"===this._state}}]),e}()},3534:function(e,t,n){"use strict";n.d(t,{Hb:function(){return l},Ql:function(){return p},SV:function(){return u},Xq:function(){return d},Yi:function(){return h},d3:function(){return v},mb:function(){return a},qW:function(){return y},yq:function(){return c}});var r=n(3324),o=n(8812),i=n(3550),a=function(e,t){var n={},o={};e.className.split(/\s+/).forEach((function(e){e&&(n[e]=!0)})),t.forEach((function(e){var t=(0,r.Z)(e,2),i=t[0],a=t[1];i.split(/\s+/).forEach((function(e){e&&(o[e]=o[e]||a,n[e]=o[e])}))})),e.className=Object.keys(n).filter((function(e){return n[e]})).join(" ")},c=function(e,t){e.style.cssText=Object.keys(t).map((function(e){return"".concat(e,": ").concat(t[e]," !important;")})).join(" ")},s={border:"none",margin:"0",padding:"0",width:"1px","min-width":"100%",overflow:"hidden",display:"block",visibility:"hidden",position:"fixed",height:"1px","pointer-events":"none","user-select":"none"},u=function(e){c(e,s)},l=function(e){try{return window.parent.frames[e]}catch(e){return null}},d=function(){if(!document.body)throw new o.No("Stripe.js requires that your page has a element.");return document.body},p=function(e){return setTimeout(e,16)},m=function(e,t){return t.ownerDocument===e&&!(t.ownerDocument.compareDocumentPosition(t)&t.DOCUMENT_POSITION_DISCONNECTED)},f=function(e,t){return t.isConnected&&t.ownerDocument===e},_=function(e,t){return!!e.documentElement&&e.documentElement.contains(t)},h=function(e,t,n){var r=_(e,t),o="isConnected"in window.Node.prototype,i=(o?f:_)(e,t);return n&&n("shadow_dom_mount.data",{isConnectedViaShadowDom_isConnectedLegacy:r,isConnectedViaShadowDom_shouldRunIsConnectedModern:o,isConnectedViaShadowDom_isConnected:i,isConnectedViaShadowDom_isConnectedNew:m(e,t)}),!r&&i},y=function(e){if(!window.ShadowRoot)return!1;for(var t=e.parentNode;null!==t;){if(t instanceof ShadowRoot)return!0;t=t.parentNode}return!1},v=function(e,t){if(!window.IntersectionObserver)return function(){};if(0!==e.clientHeight)return t(),function(){};var n=(0,i.$M)(t);if(window.ResizeObserver){var r=new ResizeObserver((function(t){t.forEach((function(t){0!==t.contentRect.height&&(r.unobserve(e),n())}))}));return r.observe(e),function(){return r.disconnect()}}var o=new IntersectionObserver((function(t){t.forEach((function(t){t.intersectionRatio>0&&(o.unobserve(e),n())}))}),{root:document.documentElement});return o.observe(e),function(){return o.disconnect()}}},4200:function(e,t,n){"use strict";n.d(t,{Tf:function(){return a},W3:function(){return _},Xq:function(){return h.Xq},L$:function(){return p},dh:function(){return m},Dx:function(){return u},xz:function(){return E},qW:function(){return h.qW},Yi:function(){return h.Yi},a0:function(){return v},d3:function(){return h.d3},MV:function(){return C},gl:function(){return f},SV:function(){return h.SV},yq:function(){return h.yq},Hb:function(){return h.Hb},mb:function(){return h.mb},xc:function(){return M},BO:function(){return P},Ql:function(){return h.Ql},w3:function(){return I}});var r="1.2em",o="14px",i=function(e){var t=e.split(" ").map((function(e){return parseInt(e.trim(),10)}));return 1===t.length||2===t.length?2*t[0]:3===t.length||4===t.length?t[0]+t[2]:0},a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0",a=i(n);if("string"==typeof e&&/^[0-9.]+px$/.test(e)){var c=parseFloat(e.toString().replace(/[^0-9.]/g,""));return"".concat(c+a,"px")}var s,u=parseFloat(e.toString().replace(/[^0-9.]/g,"")),l=parseFloat(o.replace(/[^0-9.]/g,"")),d=parseFloat(t.toString().replace(/[^0-9.]/g,""));if("string"==typeof t&&/^(\d+|\d*\.\d+)px$/.test(t))s=d;else if("string"==typeof t&&/^(\d+|\d*\.\d+)em$/.test(t))s=d*l;else if("string"==typeof t&&/^(\d+|\d*\.\d+)%$/.test(t))s=d/100*l;else{if("string"!=typeof t||!/^[\d.]+$/.test(t)&&!/^\d*\.(px|em|%)$/.test(t))return"100%";s=l}var p=u*s+a,m="".concat(p,"px");return/^[0-9.]+px$/.test(m)?m:"100%"},c=n(3550),s=n(2024),u=function(e,t){return e?window.getComputedStyle(e,t):null},l="a[href], area[href], input:not([disabled]),\n select:not([disabled]), textarea:not([disabled]), button:not([disabled]),\n object, embed, *[tabindex], *[contenteditable]",d="".concat(l,', iframe[name^="__privateStripeFrame"]'),p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.includeStripeIframes,n=e.parentElement;return Array.prototype.slice.call((n||document).querySelectorAll(t?d:l)).filter((function(e){if("IFRAME"===e.tagName&&e===document.activeElement)return!1;var t=e.getAttribute("tabindex"),n=!t||parseInt(t,10)>=0,r=e.getBoundingClientRect(),o=u(e),i=r.width>0&&r.height>0&&o&&"hidden"!==o.getPropertyValue("visibility");return n&&i}))},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeStripeIframes,o=p({includeStripeIframes:r}),i=(0,s.cx)(o,(function(t){return t===e||e.contains(t)})),a="previous"===t?-1:1;return o[i+a]},f=function(e,t){return e.then((function(){return(0,s.qk)(t,(function(e){var t=e.element,n=e.tabIndex;""===n?t.removeAttribute("tabindex"):t.setAttribute("tabindex",n)}))}))},_=function(e){var t=[],n=(0,s.qk)(document.querySelectorAll("*"),(function(n){var r=n.getAttribute("tabindex")||"";e!==n&&(n.tabIndex=-1),t.push({element:n,tabIndex:r})})),r=(0,c.$M)((function(){f(n,t)}));return{lockedPromise:n,lockedElements:t,restoreFocus:r}},h=(n(6617),n(3534)),y=["button","checkbox","file","hidden","image","submit","radio","reset"],v=function(e){var t=e.tagName;if(e.isContentEditable||"TEXTAREA"===t)return!0;if("INPUT"!==t)return!1;var n=e.getAttribute("type");return-1===y.indexOf(n)},g=n(4942),b=n(7462),w=n(3333),k=function(e,t){if(!e)return function(){};var n;return n=e.style.cssText,(0,b.Z)(e.style,t),function(){e.style.cssText=n}},S=function(e){if(w.Ah){var t,n,r=window,o=document.documentElement,i=window,a=i.scrollX,c=i.scrollY,s=i.visualViewport,u=null!==(t=null==s?void 0:s.offsetLeft)&&void 0!==t?t:0,l=null!==(n=null==s?void 0:s.offsetTop)&&void 0!==n?n:0,d=o.style.getPropertyValue("--scrollbar-width"),p=function(e){var t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(o),m=d?Number.parseInt(d,10):r.innerWidth-o.clientWidth,f=k(e,(0,g.Z)({position:"fixed",top:"".concat(-(c-Math.floor(l)),"px"),left:"".concat(-(a-Math.floor(u)),"px"),right:"0"},p,"".concat(m,"px")));return function(){f(),r.scrollTo({left:a,top:c,behavior:"instant"})}}return function(){}},C=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(0,h.Xq)(),n=k(t,{overflow:"hidden"}),r=e?S(t):function(){},o={passive:!1},i=function(e){return e.preventDefault()},a=function(){};return window.addEventListener("touchmove",a,o),t.addEventListener("touchstart",a,o),t.addEventListener("touchmove",i,o),(0,c.$M)((function(){r(),n(),window.removeEventListener("touchmove",a,o),t.removeEventListener("touchstart",a,o),t.removeEventListener("touchmove",i,o)}))},E=function(){var e=document.querySelectorAll("meta[name=viewport][content]"),t=e[e.length-1];return t&&t instanceof HTMLMetaElement?t.content:""},A=function(e){return E().match(e)},P=function(e){A("width=device-width")||e('Elements requires "width=device-width" be set in your page\'s viewport meta tag.\n For more information: https://stripe.com/docs/js/appendix/viewport_meta_requirements')},M=function(e){A("minimum-scale=1")||e('The Financial Connections authentication flow requires "minimum-scale=1" to be set in your page\'s viewport meta tag.')},R=n(6274).Promise,I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requiredStableFrames,r=void 0===n?3:n,o=t.timeout,i=void 0===o?5e3:o,a=t.isStable,c=void 0===a?N:a;return new R((function(t){var n=setTimeout(t,i),o=0,a=e.getBoundingClientRect();!function i(){requestAnimationFrame((function(){var s=e.getBoundingClientRect();c(a,s)?o++:o=0,o===r?(clearTimeout(n),t(e)):(a=s,i())}))}()}))},N=function(e,t){return e.height===t.height&&e.width===t.width}},8139:function(e,t,n){"use strict";n.d(t,{QO:function(){return i}});var r,o=n(4942),i={DEFAULT:"DEFAULT",ELEMENTS:"ELEMENTS",CONTROLLER:"CONTROLLER",SDK:"SDK",WEBAUTHN:"WEBAUTHN",CONNECTIONS:"CONNECTIONS",CUSTOM_CHECKOUT:"CUSTOM_CHECKOUT"};r={},(0,o.Z)(r,i.DEFAULT,"https://e473f68ec35a484cb7f83899ae4f576d@errors.stripe.com/976"),(0,o.Z)(r,i.ELEMENTS,"https://198453e0cdc24c5ca470767075dba88d@errors.stripe.com/977"),(0,o.Z)(r,i.CONTROLLER,"https://76b49ff5e43c4910b429f557acde2bfd@errors.stripe.com/978"),(0,o.Z)(r,i.SDK,"https://c736ae64298f402f97218af93e3e0989@errors.stripe.com/914"),(0,o.Z)(r,i.WEBAUTHN,"https://20f53591733d415ea088036b8e8ad0e3@errors.stripe.com/980"),(0,o.Z)(r,i.CONNECTIONS,"https://0413044039f446ed806d8c6805dbbd83@errors.stripe.com/1206"),(0,o.Z)(r,i.CUSTOM_CHECKOUT,"https://41eb33ecb50649bfab8462af40c2df93@errors.stripe.com/1406"),n(6274).Promise},4086:function(e,t,n){"use strict";n.d(t,{k:function(){return c}});var r=n(3144),o=n(5671),i=n(136),a=n(9388),c=function(e){function t(e,r){var i;return(0,o.Z)(this,t),(i=n.call(this)).name="FetchError",i.type="fetch_error",i.message="Error fetching ".concat(r),i.requestUrl=r,"string"==typeof e?i.message+=": ".concat(e):(i.originalError=e,i.message+=": ".concat(e.message)),i}(0,i.Z)(t,e);var n=(0,a.Z)(t);return(0,r.Z)(t)}((0,n(7112).Z)(Error))},3973:function(e,t,n){"use strict";n.d(t,{N:function(){return s}});var r=n(3144),o=n(5671),i=n(7326),a=n(136),c=n(9388),s=function(e){function t(e){var r;return(0,o.Z)(this,t),r=n.call(this,e),window.__stripeElementsController&&window.__stripeElementsController.reportIntegrationError(e),r.name="IntegrationError",Object.defineProperty((0,i.Z)(r),"message",{value:r.message,enumerable:!0}),r}(0,a.Z)(t,e);var n=(0,c.Z)(t);return(0,r.Z)(t)}((0,n(7112).Z)(Error))},8102:function(e,t,n){"use strict";var r=n(3144),o=n(5671),i=n(136),a=n(9388);Error},51:function(e,t,n){"use strict";n.d(t,{F:function(){return c}});var r=n(3144),o=n(5671),i=n(136),a=n(9388),c=function(e){function t(e){var r;return(0,o.Z)(this,t),(r=n.call(this,e)).name="NetworkError",r.type="network_error",r.requestUrl=e,r}(0,i.Z)(t,e);var n=(0,a.Z)(t);return(0,r.Z)(t)}((0,n(7112).Z)(Error))},8812:function(e,t,n){"use strict";n.d(t,{F7:function(){return i.F},No:function(){return o.N},kp:function(){return r.k}});var r=n(4086),o=n(3973),i=(n(8102),n(51))},4044:function(e,t,n){"use strict";n.d(t,{D:function(){return i}});var r=n(9581),o=n(97),i=function(e){switch(e){case"CARD_ELEMENT_COMBINED":case"CARD_ELEMENT_SPLIT":return(0,o.x)("elements-inner-card-617af561506022e137707621ed52d185.html");case"CONTROLLER":return(0,o.x)("controller-2e9e9a14cff70f5468bda45c9fd61f30.html");case"CONTROLLER_WITH_PRECONNECT":return(0,o.x)("controller-with-preconnect-dbb4500af186f85aefed00e840b3844f.html");case"METRICS_CONTROLLER":return(0,o.x)("m-outer-3437aaddcdf6922d623e172c2d6f9278.html");case"OUTER_LOGGER_CONTROLLER":return(0,o.x)("outer-logger-64dbd498a825b9ee686903c7670c81b8.html");case"PAYMENT_REQUEST_ELEMENT":return(0,o.x)("elements-inner-payment-request-d1399f8df46bf7d09752428e5d25066e.html");case"PAYMENT_REQUEST_BROWSER":return(0,o.x)("payment-request-inner-browser-040c0ca97601355daa7ba1fed68813a3.html");case"PAYMENT_REQUEST_GOOGLE_PAY":return(0,o.x)("payment-request-inner-google-pay-cdb3909118fb1129bfcd3ee8c88e6d56.html");case"IBAN_ELEMENT":return(0,o.x)("elements-inner-iban-0ea6782214d289e3daa05c942e2541ec.html");case"IDEAL_BANK_ELEMENT":return(0,o.x)("elements-inner-ideal-bank-3ac2d0ee728d0df35ef3cb4f5f3f0b86.html");case"P24_BANK_ELEMENT":return(0,o.x)("elements-inner-p24-bank-a91b94032de7b2cfcfec67e72d89fa1b.html");case"AUTHORIZE_WITH_URL":return(0,o.x)("authorize-with-url-inner-c8b4ed4bdee2539ead2fd4847d7ac481.html");case"STRIPE_3DS2_CHALLENGE":return(0,o.x)("three-ds-2-challenge-22394602feee7339a2ddef2e7c9e9cea.html");case"STRIPE_3DS2_FINGERPRINT":return(0,o.x)("three-ds-2-fingerprint-4865837a9c3ccaea177beb459c94d1c1.html");case"AU_BANK_ACCOUNT_ELEMENT":return(0,o.x)("elements-inner-au-bank-account-a708d83a511ff81da560b4760fb1b402.html");case"FPX_BANK_ELEMENT":return(0,o.x)("elements-inner-fpx-bank-7ab164fcfb5ae9d126bc8e5fc7067d74.html");case"LIGHTBOX_APP":return(0,o.x)("lightbox-inner-a0041bdc661146fd2dda42f1ab224cf7.html");case"ISSUING_CARD_NUMBER_DISPLAY_ELEMENT":return(0,o.x)("elements-inner-issuing-card-number-display-b492dd7373a8a02a80b4b854216b598d.html");case"ISSUING_CARD_COPY_BUTTON_ELEMENT":return(0,o.x)("elements-inner-issuing-card-copy-button-5f0ebb6e6e6a5e1d6e95058e7918b81e.html");case"ISSUING_CARD_CVC_DISPLAY_ELEMENT":return(0,o.x)("elements-inner-issuing-card-cvc-display-067d37f5d0b9b37436d6f9e365ee9238.html");case"ISSUING_CARD_EXPIRY_DISPLAY_ELEMENT":return(0,o.x)("elements-inner-issuing-card-expiry-display-a0b2af01fc735e161964f2ca3da9bbe5.html");case"ISSUING_CARD_PIN_DISPLAY_ELEMENT":return(0,o.x)("elements-inner-issuing-card-pin-display-495c210d9acd587a02fb480c8e6aa5ab.html");case"EPS_BANK_ELEMENT":return(0,o.x)("elements-inner-eps-bank-c0b5a611e8696516a9115435e00e3dc2.html");case"HCAPTCHA_APP":return(0,o.x)("hcaptcha-inner-be9769c4f1e74e04628d6cdbc6231f2a.html");case"CARD_DETAILS_RECOLLECTION_MODAL":return(0,o.x)("card-details-recollection-modal-4d9d86411532610cd6e32938d4be1595.html");case"NETBANKING_BANK_ELEMENT":return(0,o.x)("elements-inner-netbanking-bank-90d96b70179fccf80651fefae8b081e0.html");case"AFFIRM_MESSAGE_ELEMENT":return(0,o.x)("elements-inner-affirm-message-e2691d03ac8b781fa33eb6246ebf5b87.html");case"AFFIRM_MESSAGE_MODAL_ELEMENT":return(0,o.x)("elements-inner-affirm-message-modal-52a03a273bb90b631dc4d1058cd243b2.html");case"AFTERPAY_MESSAGE_MODAL_ELEMENT":return(0,o.x)("elements-inner-afterpay-message-modal-9d9d0e7bfa9df4419429181dd198a045.html");case"PAYMENT_METHOD_MESSAGING_MODAL_ELEMENT":return(0,o.x)("elements-inner-payment-method-messaging-modal-adc786cd5a75080e31433ff506a331fb.html");case"LINK_AUTHENTICATION_ELEMENT":return(0,o.x)("elements-inner-authentication-17ae75a5eee9b6553cb9eff5c5b1539c.html");case"PAYMENT_ELEMENT":return(0,o.x)("elements-inner-payment-0eb8f51ef43e813487d91f6e011d427f.html");case"PAYMENT_API_INNER":return(0,o.x)("elements-inner-payment-api-b5cb9c4822690b539343b973e6b368b1.html");case"LINKED_ACCOUNTS_INNER":return(0,o.x)("linked-accounts-inner-7f0c9b9c34720150a39f390fa3f18e93.html");case"WECHAT_PAY_INNER":case"PAYNOW_INNER":case"PIX_INNER":case"PROMPTPAY_INNER":case"BACS_CONFIRMATION_INNER":case"SEPA_DEBIT_CONFIRMATION_INNER":return(0,o.x)("");case"BLIK_INNER":return(0,o.x)("blik-inner-92646060ca44d4b3b5d02fb1838b87fd.html");case"ADDRESS_ELEMENT_BILLING":case"ADDRESS_ELEMENT_SHIPPING":case"ADDRESS_ELEMENT":return(0,o.x)("elements-inner-address-6e680759675dd7a7553d392d889f7240.html");case"LINK_AUTOFILL_MODAL":return(0,o.x)("link-autofill-modal-inner-1e0d974d8cbbce04f87652856b2f6c5a.html");case"LINK_MODAL":return(0,o.x)("link-modal-inner-b9bd866d03a0d39022d1ffcc4bfe884f.html");case"GOOGLE_MAPS_APP":return(0,o.x)("google-maps-inner-86b228ee2b0ddc7783b64923b86ee580.html");case"AUTOCOMPLETE_SUGGESTIONS_ELEMENT":return(0,o.x)("elements-inner-autocomplete-suggestions-b7aa3035601f482d080043547769ed18.html");case"ACH_BANK_SEARCH_RESULTS_ELEMENT":return(0,o.x)("elements-inner-ach-bank-search-results-2fa481cff04a7adff53d0ac99f2c2d18.html");case"LINK_INFO_MODAL":return(0,o.x)("elements-inner-link-info-modal-000eb5722fb6c4655fc1d3c934b0ddc5.html");case"LINK_PURCHASE_PROTECTION_MODAL":return(0,o.x)("elements-inner-link-purchase-protection-modal-9166a6ea3a6093c715179838010b948a.html");case"LOADER_UI_APP":return(0,o.x)("elements-inner-loader-ui-cea647f7f95b5fc71cdea347ee2b3f90.html");case"BACS_MANDATE_CONFIRMATION_APP":return(0,o.x)("bacs-mandate-confirmation-inner-69a0211e73ffafb55df82a6905e7f4bf.html");case"SEPA_DEBIT_MICRODEPOSITS_CONFIRMATION_APP":return(0,o.x)("sepa-debit-microdeposits-confirmation-inner-b217da8adfa1f02e0437ad5f3bfa9623.html");case"EXPRESS_CHECKOUT_ELEMENT":return(0,o.x)("elements-inner-express-checkout-6184fab3aa2fb2cd947db3adfdd0433c.html");case"LINK_BUTTON_FOR_CARD_ELEMENT":return(0,o.x)("elements-inner-link-button-for-card-500f1c829c945f876ba15c8570765414.html");case"PAYMENT_METHOD_MESSAGING_ELEMENT":return(0,o.x)("elements-inner-payment-method-messaging-0169b82733cbf7276f04e89f25b70593.html");case"IN_CONTEXT_INNER":return(0,o.x)("in-context-inner-52fbeee8f20b6b40b8405d276fb1c1f4.html");case"SMTC_COLLECTION_INNER":return(0,o.x)("smtc-collection-inner-a7e647e8dc84ea82a01ae7f95ca5225d.html");case"CURRENCY_SELECTOR_ELEMENT":return(0,o.x)("elements-inner-currency-selector-3b075a5f638d2fb0cb884e1723ea1108.html");case"PRB_WARNING_MODAL":return(0,o.x)("elements-inner-prb-warning-modal-bfef376682f3557c0d131d4860a4b638.html");default:return(0,r.Rz)(e)}}},97:function(e,t,n){"use strict";n.d(t,{x:function(){return r}});var r=function(e){return"".concat("https://js.stripe.com/v3/").concat(e||"")}},6183:function(e,t,n){"use strict";n.d(t,{NC:function(){return o},i7:function(){return a},xS:function(){return i.x},$G:function(){return c.$G},oi:function(){return c.oi},jr:function(){return s}});var r=n(3333),o={CARD_ELEMENT_COMBINED:"CARD_ELEMENT_COMBINED",CARD_ELEMENT_SPLIT:"CARD_ELEMENT_SPLIT",CONTROLLER:"CONTROLLER",CONTROLLER_WITH_PRECONNECT:"CONTROLLER_WITH_PRECONNECT",METRICS_CONTROLLER:"METRICS_CONTROLLER",OUTER_LOGGER_CONTROLLER:"OUTER_LOGGER_CONTROLLER",PAYMENT_REQUEST_ELEMENT:"PAYMENT_REQUEST_ELEMENT",PAYMENT_REQUEST_BROWSER:"PAYMENT_REQUEST_BROWSER",PAYMENT_REQUEST_GOOGLE_PAY:"PAYMENT_REQUEST_GOOGLE_PAY",IBAN_ELEMENT:"IBAN_ELEMENT",IDEAL_BANK_ELEMENT:"IDEAL_BANK_ELEMENT",P24_BANK_ELEMENT:"P24_BANK_ELEMENT",AUTHORIZE_WITH_URL:"AUTHORIZE_WITH_URL",STRIPE_3DS2_CHALLENGE:"STRIPE_3DS2_CHALLENGE",STRIPE_3DS2_FINGERPRINT:"STRIPE_3DS2_FINGERPRINT",AU_BANK_ACCOUNT_ELEMENT:"AU_BANK_ACCOUNT_ELEMENT",FPX_BANK_ELEMENT:"FPX_BANK_ELEMENT",LIGHTBOX_APP:"LIGHTBOX_APP",ISSUING_CARD_NUMBER_DISPLAY_ELEMENT:"ISSUING_CARD_NUMBER_DISPLAY_ELEMENT",ISSUING_CARD_COPY_BUTTON_ELEMENT:"ISSUING_CARD_COPY_BUTTON_ELEMENT",ISSUING_CARD_CVC_DISPLAY_ELEMENT:"ISSUING_CARD_CVC_DISPLAY_ELEMENT",ISSUING_CARD_EXPIRY_DISPLAY_ELEMENT:"ISSUING_CARD_EXPIRY_DISPLAY_ELEMENT",ISSUING_CARD_PIN_DISPLAY_ELEMENT:"ISSUING_CARD_PIN_DISPLAY_ELEMENT",EPS_BANK_ELEMENT:"EPS_BANK_ELEMENT",HCAPTCHA_APP:"HCAPTCHA_APP",CARD_DETAILS_RECOLLECTION_MODAL:"CARD_DETAILS_RECOLLECTION_MODAL",NETBANKING_BANK_ELEMENT:"NETBANKING_BANK_ELEMENT",AFFIRM_MESSAGE_ELEMENT:"AFFIRM_MESSAGE_ELEMENT",AFFIRM_MESSAGE_MODAL_ELEMENT:"AFFIRM_MESSAGE_MODAL_ELEMENT",AFTERPAY_MESSAGE_MODAL_ELEMENT:"AFTERPAY_MESSAGE_MODAL_ELEMENT",PAYMENT_METHOD_MESSAGING_MODAL_ELEMENT:"PAYMENT_METHOD_MESSAGING_MODAL_ELEMENT",AUTOCOMPLETE_SUGGESTIONS_ELEMENT:"AUTOCOMPLETE_SUGGESTIONS_ELEMENT",ACH_BANK_SEARCH_RESULTS_ELEMENT:"ACH_BANK_SEARCH_RESULTS_ELEMENT",LINK_AUTHENTICATION_ELEMENT:"LINK_AUTHENTICATION_ELEMENT",PAYMENT_ELEMENT:"PAYMENT_ELEMENT",PAYMENT_API_INNER:"PAYMENT_API_INNER",LINKED_ACCOUNTS_INNER:"LINKED_ACCOUNTS_INNER",WECHAT_PAY_INNER:"WECHAT_PAY_INNER",PAYNOW_INNER:"PAYNOW_INNER",BLIK_INNER:"BLIK_INNER",PIX_INNER:"PIX_INNER",PROMPTPAY_INNER:"PROMPTPAY_INNER",ADDRESS_ELEMENT:"ADDRESS_ELEMENT",ADDRESS_ELEMENT_SHIPPING:"ADDRESS_ELEMENT_SHIPPING",ADDRESS_ELEMENT_BILLING:"ADDRESS_ELEMENT_BILLING",LINK_AUTOFILL_MODAL:"LINK_AUTOFILL_MODAL",LINK_INFO_MODAL:"LINK_INFO_MODAL",LINK_MODAL:"LINK_MODAL",GOOGLE_MAPS_APP:"GOOGLE_MAPS_APP",LOADER_UI_APP:"LOADER_UI_APP",BACS_MANDATE_CONFIRMATION_APP:"BACS_MANDATE_CONFIRMATION_APP",BACS_CONFIRMATION_INNER:"BACS_CONFIRMATION_INNER",SEPA_DEBIT_MICRODEPOSITS_CONFIRMATION_APP:"SEPA_DEBIT_MICRODEPOSITS_CONFIRMATION_APP",SEPA_DEBIT_CONFIRMATION_INNER:"SEPA_DEBIT_CONFIRMATION_INNER",EXPRESS_CHECKOUT_ELEMENT:"EXPRESS_CHECKOUT_ELEMENT",LINK_BUTTON_FOR_CARD_ELEMENT:"LINK_BUTTON_FOR_CARD_ELEMENT",PAYMENT_METHOD_MESSAGING_ELEMENT:"PAYMENT_METHOD_MESSAGING_ELEMENT",LINK_PURCHASE_PROTECTION_MODAL:"LINK_PURCHASE_PROTECTION_MODAL",IN_CONTEXT_INNER:"IN_CONTEXT_INNER",SMTC_COLLECTION_INNER:"SMTC_COLLECTION_INNER",CURRENCY_SELECTOR_ELEMENT:"CURRENCY_SELECTOR_ELEMENT",PRB_WARNING_MODAL:"PRB_WARNING_MODAL"},i=n(97),a=function(e){var t={frameborder:"0",allowTransparency:"true",scrolling:"no",role:"presentation"},n=!r.D1&&!r.DI;if(n&&(t.allow="payment *"),e===o.STRIPE_3DS2_CHALLENGE){var a="publickey-credentials-get ".concat((0,i.x)());t.allow=n?"payment *; ".concat(a):a}if(e===o.LINK_AUTHENTICATION_ELEMENT||e===o.PAYMENT_ELEMENT||e===o.LINK_MODAL){var c="publickey-credentials-get *";t.allow=n?"payment *; ".concat(c):c}if(e===o.PAYMENT_REQUEST_GOOGLE_PAY){t.sandbox=["allow-scripts","allow-forms","allow-popups","allow-popups-to-escape-sandbox","allow-same-origin"].join(" "),t.referrerpolicy="origin"}return e===o.LINKED_ACCOUNTS_INNER&&(t.allow=n?"payment *; clipboard-write":"clipboard-write"),t},c=n(5311),s=(n(942),function(e){return e})},5311:function(e,t,n){"use strict";n.d(t,{$G:function(){return d},EK:function(){return u},oi:function(){return l}});var r,o=n(1413),i=n(9581),a=n(942),c=n(4200),s=(n(9543),!1),u=function(e){r=e},l=function(e){var t,n=e.targetOrigin,u=e.type,l=n;switch(u){case"sibling":t=(0,c.Hb)(e.targetFrameId);break;case"child":if(!(t=window.frames[e.targetFrameId])){var d=document.querySelector('iframe[name="'.concat(e.targetFrameId,'"]'));d&&(t=d.contentWindow,r&&!s&&(s=!0,r("post_message.iframe_fallback_lookup.success")))}break;case"parent":l=l||"*",t=window.parent;break;default:(0,i.Rz)(u)}if(l=l||a.jQ,t&&"function"==typeof t.postMessage){var p=e.message.delegate?{targetOrigin:l,delegate:e.message.delegate}:l;t.postMessage(JSON.stringify((0,o.Z)((0,o.Z)({},e),{},{__stripeJsV3:!0})),p)}},d=function(e){try{var t="string"==typeof e?JSON.parse(e):e;return t.__stripeJsV3?t:null}catch(e){return null}}},3550:function(e,t,n){"use strict";n.d(t,{AO:function(){return a},Ds:function(){return o},Kn:function(){return m},HP:function(){return i},qe:function(){return s},tN:function(){return l},$M:function(){return c},_v:function(){return p},i3:function(){return f}});var r=n(8812),o=(n(6274).Promise,function(e,t,n){var r,o,i=function(){for(var i=this,a=arguments.length,c=new Array(a),s=0;s0&&void 0!==arguments[0]?arguments[0]:0;return new d((function(t){return setTimeout(t,e)}))},m=function(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)},f=function(e){return e.replace(/_./g,(function(e){return e[1].toUpperCase()}))};n(3333)},5558:function(e,t,n){"use strict";n.d(t,{To:function(){return i},Vj:function(){return a}});var r="00".concat(Math.floor(1e3*Math.random())).slice(-3),o=0,i=function(e){return"".concat(e).concat(r).concat(o++)},a=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"00000000-0000-4000-8000-000000000000".replace(/[08]/g,e)}},9620:function(e,t,n){"use strict";n.d(t,{Kl:function(){return r.Kl},Tj:function(){return o.T},lO:function(){return r.lO},pF:function(){return r.pF}});var r=n(1834),o=n(7049)},1834:function(e,t,n){"use strict";n.d(t,{Kl:function(){return o},lO:function(){return i},pF:function(){return a}});var r=n(8812),o={live:"live",test:"test",unknown:"unknown"},i=function(e){return e?/^pk_test_/.test(e)?o.test:/^pk_live_/.test(e)?o.live:o.unknown:o.unknown},a=function(e){if(e===o.unknown)throw new r.No("It looks like you're using an older Stripe key. In order to use this API, you'll need to use a modern API key, which is prefixed with 'pk_live_' or 'pk_test_'.\n You can roll your publishable key here: https://dashboard.stripe.com/account/apikeys")}},7049:function(e,t,n){"use strict";n.d(t,{T:function(){return l}});var r=n(8812),o="publishable",i="secret",a="ephemeral",c="restricted",s="unknown",u=function(e){switch(e.split("_",1)[0]){case"pk":return o;case"sk":return i;case"ek":return a;case"rk":return c;default:return s}},l=function(e){if(""===e)throw new r.No("Please call Stripe() with your publishable key. You used an empty string.");switch(u(e)){case i:throw new r.No("You should not use your secret key with Stripe.js.\n Please pass a publishable key instead.");case a:throw new r.No("You should not use an ephemeral key with Stripe.js.\n Please pass a publishable key instead.");case c:throw new r.No("You should not use a restricted key with Stripe.js.\n Please pass a publishable key instead.")}}},6232:function(e,t,n){"use strict";n.d(t,{Q:function(){return a},x:function(){return o}});var r=n(8948),o=function(e){var t={};return function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Object.keys(n).forEach((function(o){var i="".concat(r,"-").concat(o).replace(/^-/,""),a=n[o];if(null!=a)switch(typeof a){case"object":Array.isArray(a)?t[i]=a.join(" "):e(a,i);break;case"number":case"boolean":case"string":t[i]=a;break;default:t[i]=String(a)}else t[i]=a}))}(e),t},i={account_holder_id:!0,amount:!0,arb_id:!0,controller:!0,controller_init_delay:!0,controller_load_time:!0,cumulative_layout_shift:!0,dom_complete:!0,dom_interactive:!0,dom_loading:!0,duration:!0,eid:!0,elapsed_time:!0,elements_assignment_id:!0,elements_session_id:!0,end:!0,event_count:!0,event_id:!0,event:!0,features:!0,first_contentful_paint:!0,frame_width:!0,funnel_event_elapsed_time:!0,key:!0,largest_contentful_paint:!0,latency:!0,load_timestamp:!0,logger_id:!0,metric_value:!0,navigation_fetch_start:!0,payment_page_id:!0,paymentUserAgent:!0,request_start:!0,resource_timings:!0,response_end:!0,search_session:!0,searchSession:!0,session_id:!0,shownDuration:!0,since_create:!0,since_fetch:!0,since_group_create:!0,since_mount:!0,since_sjs_load:!0,since_stripe_create:!0,since_wrapper_create:!0,since_store:!0,since_link_consumer_session_ready:!0,since_link_default_integration_ready:!0,since_parent_visible:!0,source_id:!0,start_time:!0,start:!0,stripe_create_duration:!0,stripe_js_id:!0,stripe_js_init_duration:!0,stripe_js_load_duration:!0,time_from_confirm_to_poll_start:!0,time_from_pm_to_confirm:!0,time_polling_hook:!0,time_polling_success:!0,time_to_create_pm:!0,time_to_first_byte:!0,time_waiting_on_captcha:!0,timeline:!0,timestamp:!0,timestamps:!0,token_id:!0,until_first_create:!0,until_first_load:!0,until_first_mount:!0,version:!0},a=function(e,t){if("string"==typeof e&&e.length>8e3&&"timeline"!==t)return"";if("string"==typeof e&&e.length>61440&&"timeline"===t)return"";if(0===t.indexOf("resourceTiming["))return e;if(i[t.split("-")[0]])return e;var n=(0,r.vG)(e),o=(0,r.Xd)(n);return(0,r.Og)(o)}},9543:function(e,t,n){"use strict";n(6232)},1939:function(e,t,n){"use strict";n.d(t,{O:function(){return c}});var r=n(4942),o=n(1413),i=n(5671),a=n(3144),c=function(){function e(t){var n=this,a=t.getTarget,c=t.targetOrigin,s=t.messageTag;(0,i.Z)(this,e),this.callbacks=[],this.listen=function(e){0===n.callbacks.length&&window.addEventListener("message",n.handleMessage),n.callbacks.push(e)},this.stopAllListeners=function(){window.removeEventListener("message",n.handleMessage),n.callbacks.length=0},this.postMessage=function(e){if(n.target){var t=(0,o.Z)((0,o.Z)({},e),{},(0,r.Z)({},n.MESSAGE_TAG,!0));n.target.postMessage(t,n.targetOrigin)}},this.handleMessage=function(e){n.isValidPopupMessageEvent(e)&&n.callbacks.forEach((function(t){return t(e.data,e.origin)}))},this.getTarget=a,this.targetOrigin=c,this.MESSAGE_TAG=s}return(0,a.Z)(e,[{key:"target",get:function(){return this.getTarget()}},{key:"isValidPopupMessageEvent",value:function(e){return("*"===this.targetOrigin||e.origin===this.targetOrigin)&&e.source===this.target&&e.data&&"object"==typeof e.data&&this.MESSAGE_TAG in e.data}}]),e}()},8070:function(e,t,n){"use strict";n.d(t,{J:function(){return i},c:function(){return o}});var r=function(e){for(var t="",n=0;n")},p=function(e){return i(e).replace(new RegExp(c,"gi"),"$1")},m=function(e){return i(e).replace(new RegExp(s,"gi"),"$1_")},f=function(e){if(!e||"object"!=typeof e||!e.type&&!e.code)return e;var t=function(t){return e[t]&&"string"==typeof e[t]?(0,o.Z)({},"".concat(t,"_id"),e[t]):e[t]&&"object"==typeof e[t]&&"string"==typeof e[t].id?(0,o.Z)({},"".concat(t,"_id"),e[t].id):null};return(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({type:e.type,code:e.code,param:e.param},t("payment_intent")),t("setup_intent")),t("payment_method")),t("source"))}},2984:function(e,t,n){"use strict";n.d(t,{Fc:function(){return a},J$:function(){return o}});var r={AC:"AC",AD:"AD",AE:"AE",AF:"AF",AG:"AG",AI:"AI",AL:"AL",AM:"AM",AO:"AO",AQ:"AQ",AR:"AR",AT:"AT",AU:"AU",AW:"AW",AX:"AX",AZ:"AZ",BA:"BA",BB:"BB",BD:"BD",BE:"BE",BF:"BF",BG:"BG",BH:"BH",BI:"BI",BJ:"BJ",BL:"BL",BM:"BM",BN:"BN",BO:"BO",BQ:"BQ",BR:"BR",BS:"BS",BT:"BT",BV:"BV",BW:"BW",BY:"BY",BZ:"BZ",CA:"CA",CD:"CD",CF:"CF",CG:"CG",CH:"CH",CI:"CI",CK:"CK",CL:"CL",CM:"CM",CN:"CN",CO:"CO",CR:"CR",CV:"CV",CW:"CW",CY:"CY",CZ:"CZ",DE:"DE",DJ:"DJ",DK:"DK",DM:"DM",DO:"DO",DZ:"DZ",EC:"EC",EE:"EE",EG:"EG",EH:"EH",ER:"ER",ES:"ES",ET:"ET",FI:"FI",FJ:"FJ",FK:"FK",FO:"FO",FR:"FR",GA:"GA",GB:"GB",GD:"GD",GE:"GE",GF:"GF",GG:"GG",GH:"GH",GI:"GI",GL:"GL",GM:"GM",GN:"GN",GP:"GP",GQ:"GQ",GR:"GR",GS:"GS",GT:"GT",GU:"GU",GW:"GW",GY:"GY",HK:"HK",HN:"HN",HR:"HR",HT:"HT",HU:"HU",ID:"ID",IE:"IE",IL:"IL",IM:"IM",IN:"IN",IO:"IO",IQ:"IQ",IS:"IS",IT:"IT",JE:"JE",JM:"JM",JO:"JO",JP:"JP",KE:"KE",KG:"KG",KH:"KH",KI:"KI",KM:"KM",KN:"KN",KR:"KR",KW:"KW",KY:"KY",KZ:"KZ",LA:"LA",LB:"LB",LC:"LC",LI:"LI",LK:"LK",LR:"LR",LS:"LS",LT:"LT",LU:"LU",LV:"LV",LY:"LY",MA:"MA",MC:"MC",MD:"MD",ME:"ME",MF:"MF",MG:"MG",MK:"MK",ML:"ML",MM:"MM",MN:"MN",MO:"MO",MQ:"MQ",MR:"MR",MS:"MS",MT:"MT",MU:"MU",MV:"MV",MW:"MW",MX:"MX",MY:"MY",MZ:"MZ",NA:"NA",NC:"NC",NE:"NE",NG:"NG",NI:"NI",NL:"NL",NO:"NO",NP:"NP",NR:"NR",NU:"NU",NZ:"NZ",OM:"OM",PA:"PA",PE:"PE",PF:"PF",PG:"PG",PH:"PH",PK:"PK",PL:"PL",PM:"PM",PN:"PN",PR:"PR",PS:"PS",PT:"PT",PY:"PY",QA:"QA",RE:"RE",RO:"RO",RS:"RS",RU:"RU",RW:"RW",SA:"SA",SB:"SB",SC:"SC",SD:"SD",SE:"SE",SG:"SG",SH:"SH",SI:"SI",SJ:"SJ",SK:"SK",SL:"SL",SM:"SM",SN:"SN",SO:"SO",SR:"SR",SS:"SS",ST:"ST",SV:"SV",SX:"SX",SZ:"SZ",TA:"TA",TC:"TC",TD:"TD",TF:"TF",TG:"TG",TH:"TH",TJ:"TJ",TK:"TK",TL:"TL",TM:"TM",TN:"TN",TO:"TO",TR:"TR",TT:"TT",TV:"TV",TW:"TW",TZ:"TZ",UA:"UA",UG:"UG",US:"US",UY:"UY",UZ:"UZ",VA:"VA",VC:"VC",VE:"VE",VG:"VG",VN:"VN",VU:"VU",WF:"WF",WS:"WS",XK:"XK",YE:"YE",YT:"YT",ZA:"ZA",ZM:"ZM",ZW:"ZW",ZZ:"ZZ"},o=Object.keys(r),i=r,a=function(e){return e&&i[e.toUpperCase()]||null}},9792:function(e,t,n){"use strict";n.d(t,{E:function(){return s}});var r=n(5671),o=n(3144),i=Date.now?function(){return Date.now()}:function(){return(new Date).getTime()},a=i(),c=window.performance&&window.performance.now?function(){return window.performance.now()}:function(){return i()-a},s=function(){function e(t){(0,r.Z)(this,e),this.timestampValue=null!=t?t:c()}return(0,o.Z)(e,[{key:"getAsPosixTime",value:function(){return i()-this.getElapsedTime()}},{key:"getElapsedTime",value:function(e){return Math.round((e?e.timestampValue:c())-this.timestampValue)}},{key:"valueOf",value:function(){return Math.round(this.timestampValue)}}],[{key:"fromPosixTime",value:function(t){return new e(t-i()+c())}}]),e}()},1216:function(e,t,n){"use strict";var r=(0,n(6617).Ds)("https://payments.stripe.com");r&&r.origin,new Set(["https://checkout.stripe.com","https://checkout.link.com","https://buy.stripe.com","https://book.stripe.com","https://donate.stripe.com","https://js.stripe.com"])},7600:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o=function(e){var t={};return e.replace(/\+/g," ").split("&").forEach((function(e){var n,o=e.split("="),i=decodeURIComponent(o[0]),a=t,c=0,s=i.split("]["),u=s.length-1;if(/\[/.test(s[0])&&/\]$/.test(s[u])?(s[u]=s[u].replace(/\]$/,""),u=(s=s.shift().split("[").concat(s)).length-1):u=0,!(s.indexOf("__proto__")>=0))if(2===o.length)if(n=decodeURIComponent(o[1]),u)for(;c<=u;c++){if(i=""===s[c]?a.length:s[c],!r(a,i)&&a[i])return;a[i]=c0?window.location.ancestorOrigins[window.location.ancestorOrigins.length-1]:document.referrer?new URL(document.referrer).origin:null},s=function(){try{if(window.top!==window.self)return c()||void 0}catch(e){}},u=function(){try{return window.self!==window.top}catch(e){return!1}}},4469:function(e,t,n){"use strict";n.d(t,{q:function(){return o}});var r=n(9062),o=function e(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(o>20)return"";var i=[];return Object.keys(t).forEach((function(a){var c=t[a],s=n?"".concat(n,"[").concat(a,"]"):a;if(c&&"object"==typeof c){var u=e(c,s,o+1);""!==u&&(i=[].concat((0,r.Z)(i),[u]))}else null!=c&&(i=[].concat((0,r.Z)(i),["".concat(s,"=").concat(encodeURIComponent(String(c)))]))})),i.join("&").replace(/%20/g,"+")}},3745:function(e,t,n){"use strict";n.d(t,{Ds:function(){return i},P$:function(){return a},kg:function(){return c},sD:function(){return o},v_:function(){return s},w0:function(){return u}});var r=/^(http(s)?):\/\//,o=function(e){return r.test(e)},i=function(e){if(!o(e))return null;var t;try{t=new URL(e)}catch(n){(t=document.createElement("a")).href=e}var n=t.protocol,r=t.host,i=t.pathname,a=t.hash,c=/:80$/,s=/:443$/;return"http:"===n&&c.test(r)?r=r.replace(c,""):"https:"===n&&s.test(r)&&(r=r.replace(s,"")),{host:r,protocol:n,origin:"".concat(n,"//").concat(r),pathname:i,hash:a}},a=function(e){var t=i(e);return t?t.origin:null},c=function(e){var t=a(e);if(!t)throw new Error('Invalid URL: "'.concat(e,'"'));return t},s=function(e,t){if("/"===t[0]){var n=i(e);return n?"".concat(n.origin).concat(t):t}var r=e.replace(/\/[^/]*$/,"/");return"".concat(r).concat(t)},u=function(e){return e.split("?")[0].split("#")[0]}},4693:function(e,t,n){"use strict";n.d(t,{Sl:function(){return o}});var r=new RegExp("^(?:4[0-9]{15,}|(?:5[0-6,8]|2[2-7]|6[037])[0-9]{14,}|3[47][0-9]{13}|6[45][0-9]{14}|3[089][0-9]{14}|36[0-9]{12}|35[0-9]{14}|(?:62|81)[0-9]{11,})$"),o=function(e){if("string"!=typeof e)return!1;var t=e.replace(/[\s-]+/g,"").match(/\d{13,}/g);return!!t&&t.some((function(e){return r.test(e)&&function(e){for(var t="0".charCodeAt(0),n=e.length%2,r=0,o=e.length-1;o>=0;--o){var i=o%2===n,a=e.charCodeAt(o)-t;i&&(a*=2),a>9&&(a-=9),r+=a}return r%10==0}(e)}))}},9605:function(e,t,n){"use strict";n.d(t,{MO:function(){return c},oQ:function(){return a},rX:function(){return i}});var r=n(7974),o=(0,r.p5)("an Element",{_componentName:r.Z_,_groupId:r.Z_,_implementation:(0,r.mC)({_frame:(0,r.mC)({id:r.Z_})})}),i=function(e){var t=(0,r.ld)(o,e,"");return"error"===t.type?null:t.value},a=(0,r.p5)("an Elements group",{_elements:(0,r.CT)(o),_id:r.Z_,_isSubmitting:r.Xg,_commonOptions:(0,r.$N)({paymentMethodCreation:(0,r.jt)((0,r.kw)("manual")),payment_method_types:(0,r.jt)((0,r.AG)((0,r.CT)(r.Z_))),paymentMethodTypes:(0,r.jt)((0,r.AG)((0,r.CT)(r.Z_))),clientSecret:(0,r.jt)((0,r.AG)((0,r.$N)({id:r.Z_,clientSecret:r.Z_,type:r.Z_}))),mode:(0,r.jt)((0,r.AG)(r.Z_))}),_controller:(0,r.$N)({_id:r.Z_})}),c=function(e){var t=(0,r.ld)(a,e,"");return"error"===t.type?null:t.value}},1873:function(e,t,n){"use strict";n.d(t,{$3:function(){return i.$3},$N:function(){return i.$N},AG:function(){return i.AG},Ao:function(){return i.Ao},Bi:function(){return i.Bi},CT:function(){return i.CT},Cz:function(){return i.Cz},Ec:function(){return i.Ec},Fy:function(){return i.Fy},Gu:function(){return i.Gu},HM:function(){return i.HM},Kr:function(){return i.Kr},M2:function(){return i.M2},M4:function(){return i.M4},MO:function(){return r.MO},MZ:function(){return i.MZ},NM:function(){return i.NM},NQ:function(){return i.NQ},O:function(){return i.O},RH:function(){return i.RH},Rx:function(){return i.Rx},Ry:function(){return i.Ry},Sl:function(){return c.Sl},TX:function(){return i.TX},UF:function(){return i.UF},Wc:function(){return i.Wc},Xg:function(){return i.Xg},Z_:function(){return i.Z_},cV:function(){return i.cV},ci:function(){return i.ci},gy:function(){return i.gy},hN:function(){return i.hN},ig:function(){return i.ig},jt:function(){return i.jt},kG:function(){return o.k},kw:function(){return i.kw},ld:function(){return i.ld},mC:function(){return i.mC},n2:function(){return i.n2},oH:function(){return a.o},oQ:function(){return r.oQ},or:function(){return i.or},p3:function(){return i.p3},rS:function(){return i.rS},rX:function(){return r.rX},ui:function(){return i.ui},uw:function(){return i.uw},uz:function(){return i.uz},x4:function(){return i.x4},xe:function(){return i.xe},yv:function(){return i.yv},z$:function(){return i.z$},zS:function(){return i.zS}});var r=n(9605),o=n(9096),i=n(7974),a=n(7386),c=n(4693)},9096:function(e,t,n){"use strict";function r(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o0&&i>0&&a()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})$/.test(t.toLowerCase());return{valid:!s&&!c,isIncomplete:c,isInvalid:s}}},7974:function(e,t,n){"use strict";n.d(t,{$3:function(){return y},$N:function(){return ae},AG:function(){return b},Ao:function(){return m},Bi:function(){return K},CT:function(){return Q},Cz:function(){return L},Ec:function(){return I},Fy:function(){return J},Gu:function(){return ue},HM:function(){return O},Kr:function(){return Y},M2:function(){return G},M4:function(){return U},MZ:function(){return H},NM:function(){return te},NQ:function(){return v},O:function(){return F},RH:function(){return h},Rx:function(){return Z},Ry:function(){return W},TX:function(){return ce},UF:function(){return T},Wc:function(){return x},Xg:function(){return j},Z_:function(){return N},cV:function(){return R},ci:function(){return oe},gy:function(){return q},hN:function(){return M},ig:function(){return B},jt:function(){return g},kw:function(){return A},ld:function(){return se},mC:function(){return re},n2:function(){return k},or:function(){return w},p3:function(){return z},p5:function(){return ie},rS:function(){return D},ui:function(){return E},uw:function(){return $},uz:function(){return X},x4:function(){return f},xe:function(){return C},yv:function(){return ee},z$:function(){return P},zS:function(){return _}});var r=n(1413),o=n(9062),i=n(8812),a=n(2024),c=n(6241),s=n(2141),u=n(9620),l=(n(6617),n(9581)),d=["card number","name"],p=["address","billingDetails","name","postal_code","postalCode","phone"],m=function(e,t,n,r){var o=r.reduce((function(e,t,n){return 0===n?t:0===t.indexOf(".")?"".concat(e,'["').concat(t,'"]'):"".concat(e,".").concat(t)}),"");return"undefined"===t?"Missing value for ".concat(n.label,": ").concat(o||"value"," should be ").concat(e,"."):"Invalid value for ".concat(n.label,": ").concat(o||"value"," should be ").concat(e,". You specified: ").concat(t,".")},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{type:"valid",value:e,warnings:t}},_=function(e){return{error:e,errorType:"full",type:"error"}},h=function(e,t,n,r){var o=new i.No(m(e,t,n,r));return _(o)},y=function(e,t,n,r){return{expected:e,actual:function(e,t){var n=typeof e;switch(n){case"undefined":case"boolean":return"".concat(e);case"object":if(!e)return"".concat(e);var r=Object.keys(e);if(0===r.length)return JSON.stringify(e);if(t)return"object with keys: [".concat(r,"]");try{return JSON.stringify(e)}catch(e){return"object with keys: [".concat(r,"]")}default:var o="".concat(e);return t&&(o="".concat(n,": ").concat(function(e){if(e.length<=3)return"[redacted]";var t=e[0],n=e[e.length-1];return t+"*".repeat(e.length-2)+n}(o))),o}}(t,!p.every((function(e){return-1===r.indexOf(e)}))||!d.every((function(e){return-1===n.label.indexOf(e)}))),options:n,errorType:"mismatch",type:"error",path:r}},v=function(e,t){return[].concat((0,o.Z)(e),[t])},g=function(e){return function(t,n,r){return void 0===t?f(t):e(t,n,r)}},b=function(e){return function(t,n,r){return null===t?f(t):e(t,n,r)}},w=function(e,t){return function(n,r,o){var a=function(e){var t=e.path.join(".")||"value";return{error:"".concat(t," should be ").concat(e.expected),actual:"".concat(t," as ").concat(e.actual)}},c=function(e,t,n){return _(new i.No("Invalid value for ".concat(e,": ").concat(t,". You specified ").concat(n,".")))},s=e(n,r,o),u=t(n,r,o);if("error"===s.type&&"error"===u.type){if("mismatch"===s.errorType&&"mismatch"===u.errorType){var l=a(s),d=l.error,p=l.actual,m=a(u),f=m.error,h=m.actual;return c(r.label,d===f?d:"".concat(d," or ").concat(f),p===h?p:"".concat(p," and ").concat(h))}if("mismatch"===s.errorType){var y=a(s),v=y.error,g=y.actual;return c(r.label,v,g)}if("mismatch"===u.errorType){var b=a(u),w=b.error,k=b.actual;return c(r.label,w,k)}return _(s.error)}return"valid"===s.type?s:u}},k=function(e,t){return function(n,r,o){return n instanceof e?f(n):y("a ".concat(t," instance"),n,r,o)}},S=function(e,t){return function(n,r,o){var i=(0,a.sE)(e,(function(e){return e===n}));if(void 0===i){var c=t?"a recognized string":"one of the following strings: ".concat(e.join(", "));return y(c,n,r,o)}return f(i)}},C=function(e){return function(t,n,r){return"string"==typeof t&&0===t.indexOf(e)?f(t):y("a string starting with ".concat(e),t,n,r)}},E=function(e,t){return function(n,r,o){return"string"==typeof n&&n.length>=e&&n.length<=t?f(n):y(e===t?"a string of ".concat(e," characters"):"a string with ".concat(e," to ").concat(t," characters"),n,r,o)}},A=function(){for(var e=arguments.length,t=new Array(e),n=0;ne?y("a string with max ".concat(e," characters"),t,n,r):f(t):y("a string",t,n,r)}},O=function(e,t,n){return"true"===e?f(!0):"false"===e?f(!1):y("a boolean",""===e?'""':e,t,n)},x=function(e,t){return function(n,r,o){return void 0===n?f(t()):e(n,r,o)}},j=function(e,t,n){return"boolean"==typeof e?f(e):y("a boolean",e,t,n)},Z=function(e,t,n){return"number"==typeof e?f(e):y("a number",e,t,n)},L=function(e,t,n){var r=N(e,t,n);if("error"===r.type)return r;var o=Number(r.value);return isNaN(o)?y("a numeric string",e,t,n):f(o)},D=function(e,t){return function(n,r,o){var i=N(n,r,o);if("error"===i.type)return i;var a=Number(i.value);return"string"==typeof n&&a>=e&&a<=t?f(a):y("a number from ".concat(e," to ").concat(t),n,r,o)}},B=function(e){return function(t,n,r){var o=N(t,n,r);if("error"===o.type)return o;var i=Number(o.value);return"string"==typeof t&&i>e?f(i):y("a number greater than ".concat(e),t,n,r)}},q=function(e){return function(t,n,r){var o=N(t,n,r);if("error"===o.type)return o;var i=Number(o.value);return"string"==typeof t&&i>=e?f(i):y("a number greater than or equal to ".concat(e),t,n,r)}},F=function(e,t){return function(n,r,o){return"number"==typeof n&&n>=e&&n<=t?f(n):y("a number from ".concat(e," to ").concat(t),n,r,o)}},U=function(e){return function(t,n,r){return"number"==typeof t&&t>e?f(t):y("a number greater than ".concat(e),t,n,r)}},G=function(e){return function(t,n,r){return"number"==typeof t&&t>=e?f(t):y("a number greater than or equal to ".concat(e),t,n,r)}},z=function(e,t){return function(n,r,o){return n===e?f(e):y(t||String(e),n,r,o)}},V=function(e){return function(t,n,r){return"number"==typeof t&&t===parseInt(t,10)&&(!e||t>=0)?f(t):y(e?"a positive amount in the currency's subunit":"an amount in the currency's subunit",t,n,r)}},K=function(e,t,n){return V(!1)(e,t,n)},H=function(e,t,n){return V(!0)(e,t,n)},Y=function e(t,n,r){if(t){if("string"==typeof t)try{var o=new Date(t);if("object"==typeof o&&o.toISOString()===t)return e(o,n,r)}catch(e){}if("object"==typeof t){var i=t;if("function"==typeof i.getTime&&i.getTime()>=Date.now()-1e3)return f(i)}}return y("a future Date",t,n,r)},W=function(e,t,n){return e&&"object"==typeof e?f(e):y("an object",e,t,n)},X=function(e,t,n){return"function"==typeof e?f(e):y("function",e,t,n)},Q=function(e){return function(t,n,r){return Array.isArray(t)?t.map((function(t,o){return e(t,n,v(r,String(o)))})).reduce((function(e,t){return"error"===e.type?e:"error"===t.type?t:f([].concat((0,o.Z)(e.value),[t.value]),[].concat((0,o.Z)(e.warnings),(0,o.Z)(t.warnings)))}),f([])):y("array",t,n,r)}},J=function(e,t){return function(n,r,o){var i=Q(e)(n,r,o);return"error"===i.type?i:i.value.length1&&void 0!==arguments[1]?arguments[1]:{},n=t.unrecognizedKeyBehavior,c=t.name;return function(t,s,u){var l=null!=n?n:"warn";if(t&&"object"==typeof t&&!Array.isArray(t)){var d=t,p=(0,a.sE)(Object.keys(d),(function(t){return!e[t]}));if(p&&"error"===l)return _(new i.No("Invalid ".concat(s.label," parameter: ").concat([].concat((0,o.Z)(u),[p]).join(".")," is not an accepted parameter.")));var m=Object.keys(d),h=f("passthrough"===l?(0,r.Z)({},t):{});return p&&"warn"===l&&(h=m.reduce((function(t,n){return e[n]?t:f(t.value,[].concat((0,o.Z)(t.warnings),["Unrecognized ".concat(s.label," parameter: ").concat([].concat((0,o.Z)(u),[n]).join(".")," is not a recognized parameter. This may cause issues with your integration in the future.")]))}),h)),Object.keys(e).reduce((function(n,r){if("error"===n.type)return n;var o=(0,e[r])(d[r],s,v(u,r));return"valid"===o.type&&void 0!==o.value?(n.value[r]=o.value,o.warnings.forEach((function(e){n.warnings.push(e)})),n):"valid"===o.type?(o.warnings.forEach((function(e){n.warnings.push(e)})),n):c?y(c,t,s,u):o}),h)}return y(null!=c?c:"an object",t,s,u)}},re=function(e){return ne(e,{unrecognizedKeyBehavior:"warn"})},oe=function(e){return ne(e,{unrecognizedKeyBehavior:"error"})},ie=function(e,t){return ne(t,{unrecognizedKeyBehavior:"ignore",name:e})},ae=function(e){return ne(e,{unrecognizedKeyBehavior:"ignore"})},ce=function(e){return ne(e,{unrecognizedKeyBehavior:"passthrough"})},se=function(e,t,n,r){var o=r||{},a=o.path||[],c=e(t,{authenticatedOrigin:o.authenticatedOrigin||"",element:o.element||"",label:n},a);return"valid"===c.type||"full"===c.errorType?c:{type:"error",errorType:"full",error:new i.No(m(c.expected,c.actual,c.options,c.path))}},ue=function(e,t,n,r){var o=se(e,t,n,r);switch(o.type){case"valid":return{value:o.value,warnings:o.warnings};case"error":throw o.error;default:return(0,l.Rz)(o)}}},925:function(e,t,n){"use strict";n.d(t,{CF:function(){return c},Jt:function(){return f},KC:function(){return a},NX:function(){return m},Nb:function(){return o},PS:function(){return s},Pp:function(){return l},SZ:function(){return p},Xd:function(){return u},et:function(){return i},kE:function(){return d},zc:function(){return _}});var r=n(1413),o=["ready","focus","blur","escape"],i="StripeElement",a={margin:"0",padding:"0",border:"none",display:"block",background:"transparent",position:"relative",opacity:"1"},c={height:"2px",margin:"-4px",width:"calc(100% + 8px)"},s={position:"fixed",top:"0",right:"0",bottom:"0",left:"0","z-index":"9999999"},u=300,l={position:"absolute",top:"0",right:"0",bottom:"0",left:"0","z-index":"1",background:"rgba(0,0,0,.75)",opacity:"0","will-change":"transform",transition:"opacity ".concat(u,"ms ease")},d=(0,r.Z)((0,r.Z)({},l),{},{opacity:"1"}),p={"align-items":"center",display:"flex","flex-direction":"column",position:"relative",top:"50%",left:"50%",transform:"translate(-50%, -50%)","-webkit-transform":"translate(-50%, -50%)"},m={color:"#fff","margin-top":"24px","padding-right":"28px","padding-left":"28px","text-align":"center"},f={"max-width":"430px"},_={addressLine:[],country:"",postalCode:"",recipient:"",region:"",city:"",phone:"",sortingCode:"",dependentLocality:"",organization:""}},5490:function(e,t,n){"use strict";n.d(t,{C:function(){return p}});var r=n(1413),o=n(4200),i=n(3550),a=n(925),c=n(4417),s="http://www.w3.org/2000/svg",u=[{path:"M36.12 3.67683C36.12 2.54882 37.0704 1.63202 38.1888 1.63202C39.3072 1.63202 40.2576 2.55362 40.2576 3.67683C40.2576 4.80003 39.3408 5.74563 38.1888 5.74563C37.0368 5.74563 36.12 4.82883 36.12 3.67683Z",fill:"#fff"},{path:"M29.9808 1.92001H33.5808V22.08H29.9808V1.92001Z",fill:"#fff"},{path:"M40.008 7.68001H36.3792V22.08H40.008V7.68001Z",fill:"#fff"},{path:"M66.0961 14.3904C68.8273 12.7104 70.6848 10.2096 71.4192 7.67524H67.7904C66.8448 10.0944 64.6752 11.9136 62.2896 12.6864V1.91523H58.6608V22.0752H62.2896V16.08C65.0592 16.7712 67.248 19.1664 67.9968 22.0752H71.6496C71.0928 19.0224 69.0049 16.1664 66.0961 14.3904Z",fill:"#fff"},{path:"M46.44 9.29283C47.3904 8.03043 49.2432 7.29602 50.7456 7.29602C53.5488 7.29602 55.8672 9.34563 55.872 12.4416V22.0752H52.2432V13.2432C52.2432 11.9712 51.6768 10.5024 49.8384 10.5024C47.6784 10.5024 46.4352 12.4176 46.4352 14.6592V22.0848H42.8064V7.68962H46.44V9.29283Z",fill:"#fff"},{path:"M12 24C18.6274 24 24 18.6274 24 12C24 5.37257 18.6274 0 12 0C5.37259 0 0 5.37257 0 12C0 18.6274 5.37259 24 12 24Z",fill:"#fff"},{path:"M11.4479 4.80005H7.74707C8.46707 7.80965 10.5695 10.3824 13.1999 12C10.5647 13.6176 8.46707 16.1904 7.74707 19.2H11.4479C12.3647 16.416 14.9039 13.9968 18.0239 13.5024V10.4929C14.8991 10.0033 12.3599 7.58405 11.4479 4.80005Z",fill:"#2b2b2b"}],l=n(6274).Promise,d=function(e,t){setTimeout(t,e+16)},p=function(e,t,n){var c={unmounted:!1,restoreScroll:function(){},restoreFocus:function(){return l.resolve()}},s=(0,o.Xq)(),u=document.createElement("div");u.setAttribute("data-testid","overlay"),(0,o.yq)(u,a.PS);var p=document.createElement("div");(0,o.yq)(p,a.Pp);var f=document.createElement("div"),_=document.createTextNode(t);f.appendChild(_),(0,o.yq)(f,(0,r.Z)((0,r.Z)((0,r.Z)({},a.NX),s.clientWidth>400?a.Jt:{}),n));var h=document.createElement("div");h.appendChild(m(e)),h.appendChild(f),(0,o.yq)(h,a.SZ),p.appendChild(h),u.appendChild(p);return{mount:(0,i.$M)((function(){c.restoreScroll=(0,o.MV)();var e=(0,o.W3)(null),t=e.lockedPromise,n=e.lockedElements;c.restoreFocus=function(){return(0,o.gl)(t,n)},s.appendChild(u),(0,o.Ql)((function(){new l((function(e){(0,o.yq)(p,a.kE),d(a.Xd,e)}))}))})),unmount:function(){return c.unmounted?l.resolve():(c.unmounted=!0,c.restoreScroll(),new l((function(e){(0,o.yq)(p,a.Pp),d(a.Xd,e)})).then((function(){s.removeChild(u)})),c.restoreFocus())}}},m=function(e){if((0,c.r2)(e))return document.createElementNS("http://www.w3.org/2000/svg","svg");switch(e){case"paypal":return function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.style.verticalAlign="middle",e.setAttributeNS(null,"width","149"),e.setAttributeNS(null,"height","37"),e.setAttributeNS(null,"viewBox","0 0 ".concat("149"," 37")),e.setAttributeNS(null,"role","presentation"),e.setAttributeNS(null,"fill","none");var t=document.createElementNS("http://www.w3.org/2000/svg","g");t.setAttributeNS(null,"clip-path","url(#a)");var n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"fill","#fff"),n.setAttributeNS(null,"d","M55.673 7.515h-7.809c-.534 0-.988.43-1.072 1.013l-3.158 22.155c-.063.438.243.832.644.832h3.728c.534 0 .989-.43 1.072-1.015l.852-5.976c.082-.584.538-1.014 1.07-1.014h2.472c5.144 0 8.113-2.754 8.888-8.212.35-2.388.015-4.264-.996-5.578-1.11-1.442-3.078-2.205-5.691-2.205Zm.9 8.091c-.426 3.1-2.567 3.1-4.637 3.1h-1.178l.826-5.79c.05-.35.323-.607.643-.607h.54c1.41 0 2.74 0 3.427.89.41.53.536 1.318.38 2.408ZM80.633 14.77h-4.198a.733.733 0 0 0-.722.62l-.185 1.183-.294-.429c-.909-1.328-2.935-1.772-4.958-1.772-4.638 0-8.6 3.538-9.372 8.5-.401 2.475.17 4.842 1.564 6.493 1.279 1.518 3.11 2.15 5.287 2.15 3.738 0 5.81-2.42 5.81-2.42l-.187 1.175c-.07.449.273.851.72.851h3.782a1.22 1.22 0 0 0 1.203-1.036l2.269-14.466a.731.731 0 0 0-.72-.85Zm-5.851 8.226c-.406 2.415-2.309 4.035-4.737 4.035-1.219 0-2.193-.393-2.818-1.14-.62-.74-.856-1.794-.659-2.969.378-2.394 2.314-4.068 4.704-4.068 1.192 0 2.161.4 2.8 1.152.64.76.893 1.82.71 2.99ZM101.264 16.086h-3.923c-.374 0-.726.188-.938.502l-5.41 8.042-2.294-7.728a1.137 1.137 0 0 0-1.087-.816h-3.855a.685.685 0 0 0-.644.907l4.32 12.796-4.062 5.786a.686.686 0 0 0 .555 1.083h3.918c.371 0 .72-.183.93-.49l13.048-19.005c.312-.455-.009-1.077-.558-1.077ZM113.992 7.515h-7.81c-.533 0-.988.43-1.071 1.013l-3.158 22.155c-.063.438.243.832.641.832h4.008c.372 0 .691-.301.749-.71l.896-6.28c.082-.585.538-1.015 1.071-1.015h2.471c5.145 0 8.112-2.754 8.889-8.212.35-2.388.014-4.264-.997-5.578-1.109-1.442-3.076-2.205-5.689-2.205Zm.9 8.091c-.425 3.1-2.566 3.1-4.638 3.1h-1.177l.828-5.79c.049-.35.321-.607.642-.607h.54c1.409 0 2.74 0 3.427.89.41.53.535 1.318.378 2.408ZM138.947 14.77h-4.196a.728.728 0 0 0-.72.62l-.186 1.183-.295-.429c-.909-1.328-2.934-1.772-4.957-1.772-4.639 0-8.599 3.538-9.371 8.5-.4 2.475.168 4.842 1.562 6.493 1.282 1.518 3.11 2.15 5.288 2.15 3.738 0 5.81-2.42 5.81-2.42l-.187 1.175c-.07.449.273.851.723.851h3.78a1.22 1.22 0 0 0 1.203-1.036l2.27-14.466a.735.735 0 0 0-.724-.85Zm-5.852 8.226c-.402 2.415-2.308 4.035-4.736 4.035-1.217 0-2.193-.393-2.819-1.14-.62-.74-.854-1.794-.659-2.969.381-2.394 2.314-4.068 4.704-4.068 1.193 0 2.162.4 2.8 1.152.642.76.896 1.82.71 2.99ZM143.076 8.124l-3.388 22.56c-.066.436.257.83.679.83h3.406c.566 0 1.046-.429 1.133-1.014l3.341-22.153c.067-.437-.257-.832-.678-.832h-3.814a.7.7 0 0 0-.679.609ZM8.447 34.943l.65-4.048-1.447-.033H.744L5.544.984a.393.393 0 0 1 .39-.326h11.643c3.866 0 6.533.79 7.926 2.348.653.732 1.069 1.496 1.27 2.337.211.882.215 1.937.009 3.222l-.015.094v.824l.653.363c.55.287.987.615 1.322.99.559.625.92 1.42 1.072 2.362.158.97.106 2.122-.152 3.428-.298 1.501-.78 2.809-1.43 3.88a8.035 8.035 0 0 1-2.266 2.437c-.864.602-1.89 1.059-3.051 1.351-1.125.288-2.407.433-3.813.433h-.907c-.648 0-1.277.23-1.771.64a2.68 2.68 0 0 0-.924 1.619l-.068.364-1.147 7.136-.052.262c-.014.083-.037.125-.072.153a.194.194 0 0 1-.12.042H8.448Z"),t.appendChild(n);var r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"fill","#BFBFBF"),r.setAttributeNS(null,"d","M26.996 9.229c-.032.218-.07.441-.11.67-1.423 7.739-6.29 10.412-12.507 10.412h-3.165c-.76 0-1.4.585-1.52 1.38l-1.62 10.888-.459 3.087c-.077.521.303.992.8.992h5.613c.665 0 1.23-.512 1.335-1.207l.055-.302 1.057-7.106.068-.39c.103-.697.669-1.209 1.334-1.209h.84c5.438 0 9.696-2.34 10.94-9.11.52-2.828.251-5.19-1.125-6.85a5.42 5.42 0 0 0-1.536-1.255Z"),t.appendChild(r);var o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttributeNS(null,"fill","#fff"),o.setAttributeNS(null,"d","M26.565 8.059a12.448 12.448 0 0 0-1.509-.327c-.93-.147-1.95-.217-3.043-.217h-9.22c-.228 0-.444.05-.637.14a1.44 1.44 0 0 0-.818 1.076L9.377 20.875l-.057.354c.13-.8.828-1.388 1.657-1.388h3.452c6.78 0 12.087-2.69 13.639-10.475.046-.23.085-.455.12-.674a8.376 8.376 0 0 0-1.275-.526c-.113-.037-.23-.073-.348-.107Z"),t.appendChild(o);var i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"fill","#fff"),i.setAttributeNS(null,"d","M12.125 9.512a1.35 1.35 0 0 1 .771-1.007 1.42 1.42 0 0 1 .6-.132H22.2c1.03 0 1.993.065 2.871.203a11.81 11.81 0 0 1 1.753.406c.433.14.834.304 1.204.494.436-2.7-.003-4.538-1.505-6.202-1.656-1.832-4.645-2.616-8.47-2.616H6.949c-.78 0-1.447.552-1.568 1.303L.756 30.443c-.091.563.356 1.072.941 1.072h6.855l1.721-10.61 1.852-11.393Z"),t.appendChild(i);var a=document.createElementNS("http://www.w3.org/2000/svg","defs"),c=document.createElementNS("http://www.w3.org/2000/svg","clipPath");c.setAttributeNS(null,"id","a");var s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttributeNS(null,"fill","#fff"),s.setAttributeNS(null,"d","M.744.658h147.512v36H.744z"),c.appendChild(s),a.appendChild(c),e.appendChild(t),e.appendChild(a),e}();case"google_pay":return function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.style.verticalAlign="middle",e.setAttributeNS(null,"width","95"),e.setAttributeNS(null,"height","51"),e.setAttributeNS(null,"viewBox","0 0 ".concat("95"," 51")),e.setAttributeNS(null,"role","presentation"),e.setAttributeNS(null,"fill","none");var t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttributeNS(null,"fill","#fff"),t.setAttributeNS(null,"d","M69.734.562H25.266C11.37.562 0 11.855 0 25.658 0 39.46 11.37 50.754 25.266 50.754h44.468C83.63 50.754 95 39.46 95 25.658 95 11.855 83.63.562 69.734.562Z"),e.appendChild(t);var n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttributeNS(null,"fill","#3C4043"),n.setAttributeNS(null,"d","M69.734 2.594c3.12 0 6.152.615 9.007 1.82a23.432 23.432 0 0 1 7.39 4.956 23.118 23.118 0 0 1 4.99 7.34 22.636 22.636 0 0 1 1.833 8.948c0 3.099-.62 6.11-1.832 8.946a23.258 23.258 0 0 1-4.99 7.34 23.291 23.291 0 0 1-7.39 4.957 23.055 23.055 0 0 1-9.008 1.82H25.266c-3.12 0-6.152-.615-9.007-1.82a23.432 23.432 0 0 1-7.39-4.956 23.116 23.116 0 0 1-4.99-7.34 22.634 22.634 0 0 1-1.832-8.947c0-3.1.619-6.111 1.831-8.947a23.257 23.257 0 0 1 4.99-7.34 23.29 23.29 0 0 1 7.39-4.957 23.055 23.055 0 0 1 9.008-1.82h44.468Zm0-2.032H25.266C11.37.562 0 11.855 0 25.658 0 39.46 11.37 50.754 25.266 50.754h44.468C83.63 50.754 95 39.46 95 25.658 95 11.855 83.63.562 69.734.562Z"),e.appendChild(n);var r=document.createElementNS("http://www.w3.org/2000/svg","path");r.setAttributeNS(null,"fill","#3C4043"),r.setAttributeNS(null,"d","M45.403 27.44v7.59h-2.425V16.285h6.43c1.63 0 3.019.54 4.156 1.619 1.162 1.079 1.743 2.397 1.743 3.953 0 1.593-.58 2.91-1.743 3.977-1.124 1.067-2.514 1.594-4.156 1.594h-4.005v.012Zm0-8.847v6.538h4.055c.96 0 1.769-.327 2.4-.967.645-.64.973-1.418.973-2.296 0-.866-.328-1.631-.973-2.271-.631-.665-1.427-.991-2.4-.991h-4.055v-.013ZM61.649 21.78c1.794 0 3.209.477 4.245 1.43 1.036.954 1.553 2.26 1.553 3.916v7.905h-2.311v-1.782h-.101c-.998 1.468-2.337 2.196-4.005 2.196-1.428 0-2.615-.414-3.575-1.255-.96-.84-1.44-1.882-1.44-3.137 0-1.33.505-2.384 1.516-3.162 1.01-.79 2.362-1.18 4.042-1.18 1.44 0 2.628.264 3.55.791v-.552c0-.84-.328-1.543-.998-2.133a3.437 3.437 0 0 0-2.35-.878c-1.351 0-2.425.564-3.209 1.706l-2.135-1.33c1.175-1.694 2.919-2.535 5.218-2.535Zm-3.133 9.31c0 .628.265 1.155.809 1.57.53.414 1.162.627 1.882.627 1.023 0 1.933-.377 2.728-1.13.796-.752 1.2-1.63 1.2-2.647-.757-.59-1.806-.891-3.158-.891-.985 0-1.806.238-2.463.703-.67.489-.998 1.079-.998 1.769ZM80.636 22.194l-8.085 18.471h-2.5l3.006-6.462-5.331-12.009h2.64l3.84 9.21h.05l3.74-9.21h2.64Z"),e.appendChild(r);var o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttributeNS(null,"fill","#4285F4"),o.setAttributeNS(null,"d","M35.756 25.908c0-.785-.07-1.537-.202-2.26H25.387v4.141l5.855.002a4.98 4.98 0 0 1-2.173 3.335v2.686h3.486c2.035-1.87 3.2-4.636 3.2-7.904Z"),e.appendChild(o);var i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"fill","#34A853"),i.setAttributeNS(null,"d","M29.07 31.126c-.97.65-2.22 1.03-3.681 1.03-2.824 0-5.22-1.89-6.077-4.437h-3.595v2.77a10.83 10.83 0 0 0 9.672 5.921c2.923 0 5.379-.955 7.166-2.599l-3.485-2.685Z"),e.appendChild(i);var a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttributeNS(null,"fill","#FABB05"),a.setAttributeNS(null,"d","M18.974 25.664c0-.716.12-1.407.339-2.057v-2.77h-3.596a10.635 10.635 0 0 0-1.15 4.827c0 1.736.415 3.375 1.15 4.827l3.596-2.77a6.444 6.444 0 0 1-.339-2.057Z"),e.appendChild(a);var c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttributeNS(null,"fill","#E94235"),c.setAttributeNS(null,"d","M25.389 19.17c1.595 0 3.024.546 4.152 1.613l3.089-3.066c-1.876-1.735-4.322-2.8-7.241-2.8-4.229 0-7.891 2.409-9.672 5.92l3.595 2.77c.858-2.547 3.253-4.437 6.077-4.437Z"),e.appendChild(c),e}();case"klarna":return function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.style.verticalAlign="middle",e.setAttributeNS(null,"width","49"),e.setAttributeNS(null,"height","49"),e.setAttributeNS(null,"viewBox","135 110 340 389"),e.setAttributeNS(null,"fill","none");var t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttributeNS(null,"d","M439.675 110H355.227C355.227 179.464 312.727 241.704 248.149 286.161L222.76 303.944V110H135V499H222.76V306.167L367.922 499H475L335.357 314.503C398.831 268.379 440.227 196.691 439.675 110Z"),t.setAttributeNS(null,"fill","#F9F8F5"),e.appendChild(t),e}();case"link":return(t=document.createElementNS(s,"svg")).style.verticalAlign="middle",t.setAttributeNS(null,"width","72"),t.setAttributeNS(null,"height","24"),t.setAttribute("viewBox","0 0 72 24"),u.forEach((function(e){var n=document.createElementNS(s,"path");n.setAttribute("d",e.path),n.setAttribute("fill",e.fill),t.appendChild(n)})),t;default:return document.createElementNS("http://www.w3.org/2000/svg","svg")}var t}},7030:function(e,t,n){"use strict";n.d(t,{Kb:function(){return l},Nb:function(){return m},P0:function(){return f},et:function(){return p},tk:function(){return d}});var r,o,i=n(4942),a=n(4716),c=n(942),s=n(6183),u=n(2375),l="".concat(a.A2,"-input"),d=("".concat(a.A2,"-inputAfter"),"".concat(a.A2,"-safariInput")),p="StripeElement",m=["focus","blur","escape","change","loaderstart","carddetailschange","savedpaymentmethodupdate","savedpaymentmethodremove"],f=(o={},(0,i.Z)(o,c.Yj.linkAuthentication,s.NC.LINK_AUTHENTICATION_ELEMENT),(0,i.Z)(o,c.Yj.payment,s.NC.PAYMENT_ELEMENT),(0,i.Z)(o,c.Yj.shippingAddress,s.NC.ADDRESS_ELEMENT),(0,i.Z)(o,c.Yj.address,(r={},(0,i.Z)(r,u.gC,s.NC.ADDRESS_ELEMENT_SHIPPING),(0,i.Z)(r,u.mm,s.NC.ADDRESS_ELEMENT_BILLING),r)),(0,i.Z)(o,c.Yj.autocompleteSuggestions,s.NC.AUTOCOMPLETE_SUGGESTIONS_ELEMENT),(0,i.Z)(o,c.Yj.achBankSearchResults,s.NC.ACH_BANK_SEARCH_RESULTS_ELEMENT),(0,i.Z)(o,c.Yj.paymentMethodMessaging,s.NC.PAYMENT_METHOD_MESSAGING_ELEMENT),(0,i.Z)(o,c.Yj.currencySelector,s.NC.CURRENCY_SELECTOR_ELEMENT),o)},9144:function(e,t,n){"use strict";n.d(t,{KC:function(){return r},ZS:function(){return o}});var r={margin:"0",padding:"0",border:"none",display:"block",background:"transparent",position:"relative",opacity:"1",clear:"both"},o={border:"none",display:"block",position:"absolute",height:"1px",top:"-1px",left:"0",padding:"0",margin:"0",width:"100%",opacity:"0",background:"transparent","pointer-events":"none","font-size":"16px"}},8246:function(e,t,n){"use strict";function r(e){try{if(e.currentScript)return e.currentScript.src;var t=e.querySelectorAll('script[src^="'.concat(xe,'"]')),n=(0,A.sE)(t,(function(e){var t=(e.getAttribute("src")||"").split("?")[0];return new RegExp("^".concat(xe,"/?$")).test(t)}));return n&&n.getAttribute("src")||""}catch(e){return""}}function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.maxDepth,o=void 0===r?Number.POSITIVE_INFINITY:r,i=n.useToJSON,a=void 0===i||i;return"object"==typeof e&&null!==e?bl({from:e,seen:[],forceEnumerable:!0,maxDepth:o,depth:0,useToJSON:a,serialize:!0}):"function"==typeof e?"[Function: ".concat(null!==(t=e.name)&&void 0!==t?t:"anonymous","]"):e}function i(e){return Boolean(e)&&"object"==typeof e&&"name"in e&&"message"in e&&"stack"in e}var a,c,s=n(1413),u=n(9062),l=n(5671),d=n(3144),p=n(4942),m=n(5987),f=n(7462),_=n(2963),h=n(7326),y=n(136),v=n(9388),g=n(1873),b=n(5558),w=n(4200),k=n(3333),S=n(6617),C=n(248),E=n(1765),A=n(2024),P=n(8812),M=n(3324),R=n(6274).Promise,I=function(e){var t=e.data,n=e.contentType,r=void 0===n?"application/x-www-form-urlencoded":n,o=e.method,i=e.url,a="";return t&&"application/x-www-form-urlencoded"===r?a=(0,S.qC)(t):t&&"application/json"===r&&(a=JSON.stringify(t)),{requestUrl:"GET"===o&&a?"".concat(i,"?").concat(a):i,requestData:"GET"===o?"":a,contentType:r}},N=function e(t){return new R((function(n,r){var o=t.method,i=t.headers,a=void 0===i?{}:i,c=t.keepalive,u=t.withCredentials,l=t.priority,d=void 0===l?"auto":l,p=I(t),m=p.requestUrl,f=p.requestData,_={Accept:"application/json","Content-Type":p.contentType};a&&Object.keys(a).forEach((function(e){var t=a[e];"string"==typeof t&&(_[e]=t)})),window.fetch(m,{method:o,keepalive:c,headers:_,body:f||void 0,mode:"cors",credentials:u?"include":"omit",priority:d}).then((function(o){if(0===o.status){if(!u)return e((0,s.Z)((0,s.Z)({},t),{},{withCredentials:!0})).then(n,r);r(new P.F7(m))}return o.text().then((function(e){n({responseURL:o.url,status:o.status,json:function(){return R.resolve(JSON.parse(e))},getResponseHeader:function(e){return o.headers.get(e)||""},responseText:e})}))})).catch((function(e){r(new P.kp(e,m))}))}))},T=function(e){return"function"==typeof window.fetch?N(e):function(e){return new R((function(t,n){var r=e.method,o=e.headers,i=e.withCredentials,a=I(e),c=a.requestUrl,u=a.requestData,l=a.contentType,d=new XMLHttpRequest;i&&(d.withCredentials=i),d.open(r,c,!0),d.setRequestHeader("Accept","application/json"),d.setRequestHeader("Content-Type",l),d.json=function(){return new R((function(e,t){try{e(JSON.parse(d.responseText))}catch(e){t(new P.kp(e,c))}}))},o&&Object.keys(o).forEach((function(e){var t=o[e];"string"==typeof t&&d.setRequestHeader(e,t)})),d.onreadystatechange=function(){4===d.readyState&&(d.onreadystatechange=function(){},0===d.status?i?n(new P.F7(c)):T((0,s.Z)((0,s.Z)({},e),{},{withCredentials:!0})).then(t,n):t(d))};try{d.send(u)}catch(e){n(new P.kp(e,c))}}))}(e)},O=n(6232),x=["client_id"],j="https://r.stripe.com/0",Z="https://r.stripe.com/b",L=k.D1&&"function"==typeof navigator.sendBeacon,D=new Set(["stripe-js","stripe-js-one-click-authn","stripe-js-linked-accounts","crypto-onramp"]),B=function(e){return new Blob([(0,S.qC)(e)]).size},q=function(){function e(t){var n=this,r=t.clientId,o=t.maxBatchSize;(0,l.Z)(this,e),this.bufferedLogs=[],this.batchTimer=null,this.fetchQueue=[],this.inFlightBytes=0,this.clientId=r,this.maxBatchSize=o,document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&n.flushImmediately("visibilitystate")})),window.addEventListener("beforeunload",(function(){n.flushImmediately("beforeunload")}))}return(0,d.Z)(e,[{key:"queue",value:function(e,t){var n=this;try{this.willOverflowBufferSize(e)&&this.flush()}catch(e){}this.bufferedLogs.push(e),"high"===t||this.bufferedLogs.length>=this.maxBatchSize?this.flush(t):this.batchTimer||(this.batchTimer=setTimeout((function(){n.flush()}),1e3))}},{key:"getBatchPayload",value:function(){return{client_id:this.clientId,num_requests:this.bufferedLogs.length,events:(0,u.Z)(this.bufferedLogs)}}},{key:"resetBuffer",value:function(){this.bufferedLogs=[],this.batchTimer&&(clearTimeout(this.batchTimer),this.batchTimer=null)}},{key:"flushImmediately",value:function(e){var t=this.getBatchPayload();t.events=t.events.map((function(t){return(0,s.Z)((0,s.Z)({},t),{},{event_flush_reason:e})}));var n=this.prepareBatchPayloadForRequest(t);if(0!==t.num_requests)if(this.resetBuffer(),this.isSendBeaconSupported()&&this.requestWithBeacon(n))for(;this.fetchQueue.length>0;){var r=this.fetchQueue.shift();r&&this.requestWithBeacon(r.payload)}else for(this.requestWithFetch({size:B(n),payload:n});this.fetchQueue.length>0;){var o=this.fetchQueue.shift();o&&this.requestWithFetch(o)}}},{key:"flush",value:function(e){var t=this.prepareBatchPayloadForRequest(this.getBatchPayload());0!==t.num_requests&&(this.resetBuffer(),this.send(t,e))}},{key:"send",value:function(e,t){k.D1&&this.isSendBeaconSupported()&&this.requestWithBeacon(e)||this.queueFetch(e,t)}},{key:"prepareBatchPayloadForRequest",value:function(e){try{var t=JSON.stringify(e.events);return(0,s.Z)((0,s.Z)({},e),{},{events:t})}catch(e){throw this.resetBuffer(),e}}},{key:"isSendBeaconSupported",value:function(){return navigator&&"function"==typeof navigator.sendBeacon}},{key:"willOverflowBufferSize",value:function(e){if(0===this.bufferedLogs.length)return!1;var t=[].concat((0,u.Z)(this.bufferedLogs),[e]),n={client_id:this.clientId,num_requests:t.length,events:t};return B(this.prepareBatchPayloadForRequest(n))>=32e3}},{key:"requestWithBeacon",value:function(e){try{if(window.navigator.sendBeacon&&window.navigator.sendBeacon.bind){var t=navigator.sendBeacon.bind(navigator),n=new Blob([(0,S.qC)(e)],{type:"application/x-www-form-urlencoded"});return t(Z,n)}}catch(e){return!1}return!1}},{key:"queueFetch",value:function(e,t){var n=B(e);this.fetchQueue.push({size:n,payload:e}),this.emptyFetchQueue(t)}},{key:"emptyFetchQueue",value:function(e){for(;this.fetchQueue.length>0&&(0===this.inFlightBytes||this.inFlightBytes+this.fetchQueue[0].size<5e4);){var t=this.fetchQueue.shift();t&&this.requestWithFetch(t,e)}}},{key:"requestWithFetch",value:function(e,t){var n=this,r=e.size,o=e.payload;this.inFlightBytes+=r,T({url:Z,method:"POST",data:o,keepalive:!k.D1||void 0,withCredentials:!1,priority:"high"===t?"auto":"low"}).finally((function(){n.inFlightBytes-=r,n.emptyFetchQueue()}))}}]),e}(),F=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.useBatching,r=t.useBatchingForTestMode,o=t.maxBatchSize;(0,l.Z)(this,e),this.clientQueues={},this.request=function(e,t){if(L){var n=new Blob([(0,S.qC)(e)],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(j,n)}else T({url:j,method:"POST",data:e,keepalive:!0,withCredentials:!1,priority:"high"===t?"auto":"low"})},this.useBatching=null!=n&&n,this.useBatchingForTestMode=null!=r&&r,this.maxBatchSize=null!=o?o:5}return(0,d.Z)(e,[{key:"send",value:function(e){var t=e.name,n=e.params,r=e.priority;if(void 0===n.client_id||"string"==typeof n.client_id){var o=n.client_id||"stripe-js",i=this.shouldBatchEvent(o,n),a={event_name:t,client_id:o,created:n.timestamp,batching_enabled:i};Object.keys(n).forEach((function(e){if("timestamp"!==e&&"client_id"!==e){var t=n[e];null!=t&&(a[e]=(0,O.Q)(t,e))}})),i?this.queueEvent(a,r):this.request(a)}}},{key:"getClientQueuedEvents",value:function(){var e={};return(0,A.qh)(this.clientQueues).forEach((function(t){var n=(0,M.Z)(t,2),r=n[0],o=n[1];e[r]=o.getBatchPayload().events})),e}},{key:"shouldBatchEvent",value:function(e,t){return!!D.has(e)&&(!("test"!==t.key_mode||!this.useBatchingForTestMode)||this.useBatching)}},{key:"getOrCreateClientQueue",value:function(e){return this.clientQueues[e]||(this.clientQueues[e]=new q({clientId:e,maxBatchSize:this.maxBatchSize})),this.clientQueues[e]}},{key:"queueEvent",value:function(e,t){var n=e.client_id,r=(0,m.Z)(e,x);this.getOrCreateClientQueue(n).queue(r,t)}}]),e}(),U=(n(9543),n(942)),G=n(3423),z=(0,d.Z)((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;(0,l.Z)(this,e),this.name=t,this.params=(0,O.x)(n),this.priority=r})),V=function(e,t){e.canaryPercentage;var n,r,o=e.canaryRevision,i=e.deployedRevisions;return 0===(null==o?void 0:o.indexOf(t))?"canary":0===(null==i||null===(n=i[0])||void 0===n?void 0:n.indexOf(t))?"main":0===(null==i||null===(r=i[1])||void 0===r?void 0:r.indexOf(t))?"previous":"other"},K=n(6274).Promise,H=function(e){return-1!==String(e).indexOf("[native code]")},Y=function(e){if(!(e in window))return!1;var t=window[e];return H(t)},W=function(){return Y("Promise")||Y("__nativePromise")?Y("fetch")?"modern":"lts":"legacy"},X=function(){return Y("fetch")?Y("URLSearchParams")?function(){if(Y("Promise"))return!(!K.prototype||!H(K.prototype.finally));if(window.__nativePromise&&Y("__nativePromise")){var e=window.__nativePromise;return e.prototype&&H(e.prototype.finally)}return!1}()?function(){if(window.Animation&&Y("Animation")){var e=window.Animation;return e.prototype&&H(e.prototype.persist)}return!1}()?window.CSS&&window.CSS.supports&&CSS.supports("selector(:has(a))")?window.CSS&&window.CSS.supports&&CSS.supports("color: light-dark(#000, #fff)")?"2024":"2022":"2020":"2017":"2016":"2015":"2014"},Q=function(){return T({url:"".concat(U.Xk,".deploy_status_henson.json"),method:"GET"}).then((function(e){if(200!==e.status&&304!==e.status)throw new Error("could not fetch .deploy_status_henson.json; status=".concat(e.status));return e.json().then((function(t){return t?(0,s.Z)((0,s.Z)({},t||{}),function(e){var t,n,r=e.getResponseHeader("Server");if(!r){if(304!==e.status||!e.getResponseHeader("X-Served-By"))return;r="Fastly"}switch(r){case"Cloudfront":return{cdnName:r,cdnPopDc:null===(t=e.getResponseHeader("X-Amz-Cf-Pop"))||void 0===t?void 0:t.substring(0,3)};case"Fastly":return{cdnName:r,cdnPopDc:null===(n=e.getResponseHeader("X-Served-By"))||void 0===n?void 0:n.split(", ").map((function(e){var t=e.split("-");return t[t.length-1]})).join(", ")};default:return}}(e)):t}))}))},J=function(){try{var e=(0,k.lE)();return{connection_rtt:e.rtt,connection_downlink:e.downlink,connection_effective_type:e.effectiveType}}catch(e){return{}}},$=function(){function e(t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:G.X;(0,l.Z)(this,e),this.transports=[],this.prefix="",this.deployStatusFetch={state:"initial"},this.queue=[],this.setTransports(t),this.eventCount=0,this.releaseVersion=r,this.baseParams=(0,s.Z)({deploy_status:"unknown",browserClassification:W(),browser_classification_v2:X()},J()),n&&this.updateParams({running_tests:!0}),this.fetchDeployStatus=Q}return(0,d.Z)(e,[{key:"updateParams",value:function(e){(0,f.Z)(this.baseParams,e)}},{key:"getParams",value:function(){return(0,s.Z)({},this.baseParams)}},{key:"setDefaultPrefix",value:function(e){this.prefix=e}},{key:"setTransports",value:function(e){this.transports=e}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!k.fL)if("initial"===this.deployStatusFetch.state&&this.fetchAndSetDeployStatus(),"loading"!==this.deployStatusFetch.state){var o=null!==(t=null==r?void 0:r.prefix)&&void 0!==t?t:this.prefix,i=(0,s.Z)((0,s.Z)({event_count:++this.eventCount,timestamp:Date.now(),os:(0,k.d4)(navigator.userAgent),browserFamily:(0,k.gq)(navigator.userAgent),version:this.releaseVersion,event_id:(0,b.Vj)()},this.baseParams),n),a=new z("".concat(o).concat(e),i,null==r?void 0:r.priority);this.transports.forEach((function(e){e.send(a)}))}else this.queue.push([e,(0,s.Z)({timestamp:Date.now()},n),r])}},{key:"flushQueue",value:function(){for(var e=this.queue.shift();e;)this.log.apply(this,(0,u.Z)(e)),e=this.queue.shift()}},{key:"fetchAndSetDeployStatus",value:function(){var e=this;if(this.fetchDeployStatus){this.deployStatusFetch={state:"loading"},setTimeout((function(){if("loading"===e.deployStatusFetch.state){var t="unable to fetch the deploy status within ".concat(2600," ms");e.deployStatusFetch={state:"failed",errorMessage:t},e.updateParams({deploy_status_fetch_failed:!0,deploy_status_fetch_failed_message:t}),e.flushQueue()}}),2600);var t=Date.now(),n=null;this.fetchDeployStatus().then((function(r){n=Date.now()-t,function(e){var t=e;if("number"!=typeof(null==t?void 0:t.canaryPercentage))throw new Error('"'.concat(e,'" is not a deploy status'))}(r),e.deployStatusFetch={state:"ready",deployStatus:r},e.updateParams({deploy_status:V(r,e.releaseVersion),deploy_status_time_to_fetch_ms:n,deploy_status_fetch_failed:!1,deploy_status_fetch_failed_message:null,cdn_name:r.cdnName,cdn_pop_dc:r.cdnPopDc}),e.flushQueue()})).catch((function(t){e.deployStatusFetch={state:"failed",errorMessage:String(t)},e.updateParams({deploy_status_fetch_failed:!0,deploy_status_fetch_failed_message:String(t)}),e.flushQueue()}))}}}]),e}(),ee=null,te=function(e,t,n){(0,S.Qg)(window.location.origin)&&(ee||(ee=function(){var e=[];e.push(new F({useBatching:!0,maxBatchSize:5}));var t=Boolean(!1);return new $(e,t)}()).setDefaultPrefix("v3_redact."),ee.log(e,t,{prefix:n}))},ne=[/"ascs_[a-zA-Z0-9]+"/g,/"uscs_[a-zA-Z0-9]+"/g,/"pscs_[a-zA-Z0-9]+"/g],re={network:[function(e){return/\/wallet-config/.test(e.url)},function(e){return/\/consumers\/sessions\/lookup/.test(e.url)},function(e){return/\/consumers\/sessions\/extend/.test(e.url)},function(e){return/\/set-cookie/.test(e.url)},function(e){return/\/networked_accounts/.test(e.url)},function(e){return/\/share_networked_account/.test(e.url)},function(e){return/\/onramp_session\/update/.test(e.url)}],postMessage:[function(e){return"outer"!==e.postMessageType}],logger:[]},oe=function(e,t,n){try{if(!function(e){for(var t=re[e.boundaryType],n=0;n element.");this.autoload&&(this.loaded=!0)}}},{key:"_createIFrame",value:function(t,n,r){var o=e.prototype._createIFrame.call(this,t,n,r);return o.setAttribute("aria-hidden","true"),o.setAttribute("tabIndex","-1"),(0,w.SV)(o),o}}]),t}(He),We=Ye,Xe=function(e){function t(){return(0,l.Z)(this,t),n.apply(this,arguments)}(0,y.Z)(t,e);var n=(0,v.Z)(t);return(0,d.Z)(t,[{key:"_generateId",value:function(){return this._controllerId}}]),t}(We),Qe=Xe,Je=n(6274).Promise,$e="__privateStripeMetricsController",et="merchant",tt="session",nt="NA",rt=function(e){return 42===e.length},ot=function(e,t,n){return n?!e||!rt(e)&&rt(t)?t:e:(0,b.Vj)()},it=function(){function e(){var t,n,r=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,l.Z)(this,e),this._controllerFrame=null,this._latencies=[],this._handleMessage=function(e){return function(t){var n=t.data,o=t.origin;if((0,S.Qg)(o)&&"string"==typeof n)try{var i=JSON.parse(n),a=i.originatingScript,c=i.payload;if("m2"===a){var s,u=c.guid,l=c.muid,d=c.sid;r._guid=u,r._muid=r._getID(et,l),r._sid=r._getID(tt,d),null===(s=r._onIdsUpdate)||void 0===s||s.call(r,r.ids()),e()}}catch(e){}}};var i=null===(t=o.checkoutIds)||void 0===t?void 0:t.muid,a=null===(n=o.checkoutIds)||void 0===n?void 0:n.sid;this._guid=nt,i&&"NA"!==i?(this._muid=i,this._doNotPersistMuid=!0):(this._muid=this._getID(et),this._doNotPersistMuid=!1),a&&"NA"!==a?(this._sid=a,this._doNotPersistSid=!0):(this._sid=this._getID(tt),this._doNotPersistSid=!1),this._listenerRegistry=(0,Ue.E)(),this._idsPromise=new Je((function(e){r._establishMessageChannel(e)})),this._id=(0,b.To)($e),Be&&(setTimeout((function(){r._controllerFrame=new Qe({type:ge.NC.METRICS_CONTROLLER,controllerId:r._id,listenerRegistry:r._listenerRegistry,autoload:!0,appParams:r._buildFrameQueryString()})}),5e3),this._startIntervalCheck(),setTimeout(this._testLatency.bind(this),2e3+500*Math.random()))}return(0,d.Z)(e,[{key:"ids",value:function(){return{guid:this._guid,muid:this._muid,sid:this._sid}}},{key:"idsPromise",value:function(){var e=this;return this._idsPromise.then((function(){return e.ids()}))}},{key:"setOnIdsUpdate",value:function(e){var t=this._onIdsUpdate;this._onIdsUpdate=function(n){e(n),null==t||t(n)}}},{key:"_getOnIdsUpdate",value:function(){return this._onIdsUpdate}},{key:"_establishMessageChannel",value:function(e){if(!Be)return this._guid=(0,b.Vj)(),void e();this._listenerRegistry.addEventListener(window,"message",this._handleMessage(e))}},{key:"_startIntervalCheck",value:function(){var e=this,t=window.location.href;setInterval((function(){var n=window.location.href;n!==t&&(e.send((function(e){return{action:"ping",payload:{sid:e.sid,muid:e.muid,title:document.title,referrer:document.referrer,url:document.location.href,version:6}}})),t=n)}),5e3)}},{key:"report",value:function(e,t){this.send((function(n){return{action:"track",payload:{sid:n.sid,muid:n.muid,url:document.location.href,source:e,data:t,version:6}}}))}},{key:"send",value:function(e){var t=this;this._idsPromise.then((function(){try{t._controllerFrame&&t._controllerFrame.send(e(t.ids()))}catch(e){}}))}},{key:"_testLatency",value:function(){var e=this,t=new Date;this._listenerRegistry.addEventListener(document,"mousemove",(function n(){try{var r=new Date;e._latencies.push(r-t),e._latencies.length>=10&&(e.report("mouse-timings-10",e._latencies),e._listenerRegistry.removeEventListener(document,"mousemove",n)),t=r}catch(e){}}))}},{key:"_extractMetaReferrerPolicy",value:function(){var e=document.querySelector("meta[name=referrer]");return null!=e&&e instanceof HTMLMetaElement?e.content.toLowerCase():null}},{key:"_extractUrl",value:function(e){var t=document.location.href;switch(e){case"origin":case"strict-origin":case"origin-when-cross-origin":case"strict-origin-when-cross-origin":return document.location.origin;case"unsafe-url":return t.split("#")[0];default:return t}}},{key:"_buildFrameQueryString",value:function(){var e=this._extractMetaReferrerPolicy(),t=this._extractUrl(e),n={url:t,title:document.title,referrer:document.referrer,muid:this._muid,sid:this._sid,version:6,preview:(0,S.Qg)(t)};return null!=e&&(n.metaReferrerPolicy=e),Object.keys(n).map((function(e){return null!=n[e]?"".concat(e,"=").concat(encodeURIComponent(n[e].toString())):null})).join("&")}},{key:"_getID",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nt;switch(e){case et:if(this._doNotPersistMuid)return ot(this._muid,t,Be);try{var n="__stripe_mid",r=ot(Ne(n),t,Be);return rt(r)&&Ie({name:n,value:r,domain:".".concat(document.location.hostname),protocol:document.location.protocol,sameSite:"Strict"}),r}catch(e){return nt}case tt:if(this._doNotPersistSid)return ot(this._sid,t,Be);try{var o="__stripe_sid",i=ot(Ne(o),t,Be);return rt(i)&&Ie({name:o,value:i,domain:".".concat(document.location.hostname),protocol:document.location.protocol,sameSite:"Strict",expiresIn:18e5}),i}catch(e){return nt}default:throw new Error("Invalid ID type specified: ".concat(e))}}}]),e}(),at=null,ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return at=new it(e)},st=!1,ut=function(){var e=at;e&&(st||(st=!0,e.send((function(e){return{action:"ping",payload:{v2:2,sid:e.sid,muid:e.muid,title:document.title,referrer:document.referrer,url:document.location.href,version:6}}})),e.send((function(t){return{action:"track",payload:{sid:t.sid,muid:t.muid,url:document.location.href,source:"mouse-timings-10-v2",data:e._latencies,version:6}}}))))},lt=["test_id"],dt=function(e){switch(e.type){case"object":return lt.push(e.object.id),{issuingCard:e.object};case"error":return{error:e.error};default:return(0,de.Rz)(e)}},pt=function(e){switch(e.type){case"object":return{nonce:e.object.public_nonce};case"error":return{error:e.error};default:return(0,de.Rz)(e)}},mt=n(9792),ft=n(4436),_t=n(6274).Promise,ht=function(e){return parseFloat(e.replace("px",""))||0},yt=function(e,t){if(!e)return{source:"frame",outerHeight:Math.max(28,t.clientHeight),innerHeight:t.clientHeight,outerBorderRadius:0,outerPadding:null,hasInputBoxStyles:!1};var n,r,o,i,a,c,s,u,l,d,p,m=(r=t,o=(n=e).getBoundingClientRect(),i=r.getBoundingClientRect(),a=getComputedStyle(n),c=a.borderTopWidth,s=a.borderBottomWidth,u=a.borderLeftWidth,l=a.borderRightWidth,{top:i.top-o.top-ht(c),bottom:o.bottom-i.bottom-ht(s),left:i.left-o.left-ht(u),right:o.right-i.right-ht(l)}),f=t.clientHeight,_=2*Math.min(m.top,m.bottom)+f;return{source:"wrapper",outerHeight:Math.round(10*Math.min(_,e.clientHeight))/10,innerHeight:t.clientHeight,outerBorderRadius:(d=e,p=getComputedStyle(d),-1!==p.borderRadius.indexOf(" ")?0:ht(p.borderRadius)),outerPadding:m,hasInputBoxStyles:Ae(e)}},vt=function(e,t){return new _t((function(n){(0,w.d3)(e,(function(){(0,w.w3)(e).then((function(){var r;try{r=function(e,t){for(var n={card:Ae,paymentRequestButton:Pe}[t],r=e.parentElement,o=0,i=null,a=e.clientHeight,c=e.clientWidth,s="card"===t?3*a:a,u="card"===t?1.5*c:c;o<4&&null!==r;){var l=r,d=l.clientHeight,p=l.clientWidth;if(d>s||p>u)return 0===o?r:i;if(n(r))return r;d>a&&(i=r,s=d),p>c&&(i=r,u=p),o+=1,r=r.parentElement}return i}(e,t)}catch(e){r=null}n(r)}))}))}))},gt=n(3367),bt=n(5584),wt=n.n(bt),kt=n(161),St=n.n(kt),Ct=n(8778),Et=n.n(Ct),At=n(9757),Pt=n.n(At),Mt=n(6119),Rt=n.n(Mt),It=n(2531),Nt=n.n(It),Tt=n(9098),Ot=n.n(Tt),xt=n(4769),jt=n.n(xt),Zt={margin:"0","user-select":"none",transform:"translate(0)","color-scheme":"only light",display:"block",position:"absolute",top:"0",right:"0",height:"0",width:"var(--stripeElementWidth)",padding:"0",border:"0",overflow:"hidden",opacity:"1"},Lt={display:"block",position:"absolute",top:"50%",right:"0",width:"0",margin:"0",padding:"0",border:"0",background:"none",opacity:"1",overflow:"hidden","pointer-events":"auto",transition:"none"},Dt=(wt(),St(),Nt(),Rt(),Pt(),Et(),Ot(),jt(),{selectors:{email:[],phoneCountry:[],phoneNumber:[],name:[]},runCount:0,runtimeInMillis:0,nodeCount:0,source:""}),Bt=function(e){var t=(0,gt.lT)()(e);qt(t)},qt=function(e){if(e.selectors.email){var t=Dt.selectors.email,n=e.selectors.email,r={};t.concat(n).forEach((function(e){r[e.value]=e}));var o=[];for(var i in r)r.hasOwnProperty(i)&&o.push(r[i]);Dt.selectors.email=o}Dt.runtimeInMillis+=e.runtimeInMillis,Dt.nodeCount+=e.nodeCount,Dt.runCount++,Dt.source=e.source},Ft=function(e,t,n){var r=[];try{if(!n.selectors||!n.selectors.length)return;var o=Date.now(),i=n.selectors.slice(0,10).map((function(e){var t=document.querySelector(e),o=[];return t instanceof HTMLElement&&(o=(0,gt.sr)(t,5e3)),r.push.apply(r,(0,u.Z)(o.map((function(t,n){return{value:t,selector:e,nthMatch:n}})))),{selector:e,result:o.length?"found":"not_found",atTime:"".concat(n.source,"-").concat(n.atTime)}}));n.logRecallFromInner||t.report("link.no_code_default_values.recall",{results:JSON.stringify(i),executionTime:Date.now()-o}),e.send({action:"stripe-link-no-code-default-values",payload:{foundSelectors:r,logRecallFromInner:n.logRecallFromInner,reportableSelectorResults:i}})}catch(e){t.report("link.no_code_default_values.recall_error",{message:null==e?void 0:e.message,stack:null==e?void 0:e.stack,name:null==e?void 0:e.name})}},Ut=function(e){var t,n,r=e.isOverride,o=e.component,i=e.frameId,a=e.parent,c=e.frame,u=e.locale,l=void 0===u?"auto":u,d=e.controller,p=e.controllerId,m=e.style,f=e.disabled,_=e.onSubmit,h=e.onLoad,y=e.onError,v=e.onOuterAction,g=(0,gt.NG)(),k=(0,gt.lT)(),C=window.SIMULATE_SECURE_CLICK,E=!1,A="",P=null,M=(0,s.Z)({},Lt),R=(0,Ge.D)("LINK_BUTTON_FOR_CARD_ELEMENT"),I=document.createElement("iframe"),N="".concat(o,"Button");I.setAttribute("name",(0,b.To)(N)),I.setAttribute("frameborder","0"),I.setAttribute("allowTransparency","true"),I.setAttribute("scrolling","no");var T={locale:(0,ft.Nj)(l),style:m,disabled:f,frameId:i,publishableKey:d._apiKey,stripeAccount:null!==(t=d._stripeAccount)&&void 0!==t?t:null,stripeJsId:d._stripeJsId,controllerId:p,mids:d.mids(),component:o};C&&(T.isSimulatedClick=C),(0,w.yq)(I,Zt),I.src="".concat(R,"#").concat((0,S.qC)(T));var O,x=document.createElement("div");x.appendChild(I),(0,w.yq)(x,Lt),r&&!document.getElementById("test-mode-banner")&&((O=document.createElement("marquee")).id="test-mode-banner",O.innerText="Link in Card Test Mode",(0,w.yq)(O,{position:"fixed",left:"0",right:"0",top:"0",color:"#fff","background-color":"#33ddb3","z-index":"9999999"}),document.body.appendChild(O));var j=function(e){var t,n,r=e.data,i=e.origin;if(e.source===I.contentWindow&&i===U.jQ&&-1!==(null===(t=r.action)||void 0===t?void 0:t.indexOf("card-element-link")))switch(r.action){case"card-element-link-load":E=!0,D(),h(),["card","cardNumber"].indexOf(o)>-1&&(null==x?void 0:x.offsetTop)+(null==x?void 0:x.offsetHeight)/2<(null===(n=c._iframe)||void 0===n?void 0:n.offsetTop)&&d.report("debug.link_button_above_iframe");break;case"card-element-link-request-prefill-data":var a={name:null,email:null,phoneCountry:null,phoneNumber:null};if("link-pay"===r.payload.state||"link-save"===r.payload.state)try{a=g()}catch(e){d.report("prefill_data_collection_error",{message:null==e?void 0:e.message,stack:null==e?void 0:e.stack,name:null==e?void 0:e.name})}if(["link-pay","link-save","link-use"].indexOf(r.payload.state)>-1&&P)try{var u=k("card-element");c.send({action:"stripe-link-prefill-selectors",payload:u})}catch(e){d.report("prefill_data_selectors_error",{message:null==e?void 0:e.message,stack:null==e?void 0:e.stack,name:null==e?void 0:e.name})}c.send({action:"stripe-link-prefill-values",payload:a});break;case"card-element-link-update-styles":var l=r.payload,p=l.wrapperStyles,m=l.frameStyles;z(p),(0,w.yq)(I,(0,s.Z)((0,s.Z)({},Zt),m));break;case"card-element-link-error":y(r.payload.reason||"");break;case"card-element-link-report":d.report(r.payload.event,(0,s.Z)({},r.payload.data));break;case"card-element-link-submit":_();break;case"card-element-link-message-outer":"link-state-change"===r.payload.outerAction&&(A=r.payload.outerPayload.state),v(r.payload)}},Z=function(e){var t;null==I||null===(t=I.contentWindow)||void 0===t||t.postMessage(e,U.jQ)},L=(0,ze.Ds)((function(){(0,w.w3)(a,{requiredStableFrames:3,timeout:300,isStable:function(e,t){return e.width===t.width}}).then((function(e){if(e){var t=a.getBoundingClientRect().width;a.style.setProperty("--stripeElementWidth","".concat(t,"px")),Z({action:"card-element-link-new-width",payload:{width:t}})}}))}),100),D=(0,ze.$M)((function(){vt(a,"card").then((function(e){var t=yt(e,a);"frame"===t.source&&d.report("link_in_card.outer_wrapper_not_found");var r=function(){a.style.setProperty("--stripeElementWidth","".concat(a.getBoundingClientRect().width,"px")),L()};r(),window.ResizeObserver&&(n=new ResizeObserver(r)).observe(a),Z({action:"card-element-link-outer-measurements",payload:(0,s.Z)((0,s.Z)({},t),{},{width:c._iframe.offsetWidth})})}))})),B=function(){Z({action:"card-element-link-focus-button"})},q=function(e){Z({action:"card-element-link-options-update",payload:e})},F=function(e){Ft(c,d,e)},G=function(e){var t=e.prefillDataCollection;P=t},z=function(e){var t=(0,s.Z)((0,s.Z)((0,s.Z)({},Lt),M),e);M=t,(0,w.yq)(x,M)};return c._on("outer-update-link-prefill-data-collection",G),c._on("outer-update-link-user-options",q),c._on("link-no-code-default-values-recall-selectors",F),I.addEventListener("focus",B,!1),window.addEventListener("message",j,!1),null==a||a.appendChild(x),d.report("link_in_card.mount_link_frame"),{unmount:function(){var e;Z({action:"card-element-link-unmount",payload:{}}),c._off("outer-update-link-prefill-data-collection",G),c._off("outer-update-link-user-options",q),c._off("link-no-code-default-values-recall-selectors",F),I.removeEventListener("focus",B,!1),window.removeEventListener("message",j,!1),null===(e=n)||void 0===e||e.disconnect(),null==a||a.removeChild(x),d.report("link_in_card.unmount_link_frame")},hasLoaded:function(){return E},getActiveButton:function(){return A},setFocusable:function(e){I.setAttribute("tabIndex",e?"0":"-1")},updateIframePosition:function(e){return Z({action:"card-element-link-outer-nudge",payload:{right:e}})},disallowPointerEvents:function(){z({"pointer-events":"none",opacity:"0",transition:" opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1)"})},allowPointerEvents:function(){z({"pointer-events":"auto",opacity:"1",transition:" opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1)"})}}},Gt=n(6274).Promise,zt={position:"fixed",top:"0",left:"100%",opacity:"0",visibility:"hidden",pointerEvents:"none",height:"auto",width:"auto",maxHeight:"none",maxWidth:"none"},Vt=function(e,t){var n=function(e,t){var n=(0,w.Dx)(e);if(!n)return null;var r=n.backgroundPosition,o=n.backgroundPositionX,i=parseInt(n.width,10)-t;if(r.match(/right/)){var a,c,s=null===(a=r.match(/right\s+(-?\d+)px/))||void 0===a?void 0:a[1],u=null===(c=r.match(/right\s+(\d+)%/))||void 0===c?void 0:c[1];if(s)return parseInt(s,10);if(u)return parseInt(u,10)/100*i}else{var l,d=null===(l=o.match(/(\d+)%/))||void 0===l?void 0:l[1];if(d)return(1-parseInt(d,10)/100)*i}return null}(e,t);if(null===n)return null;var r=e.getBoundingClientRect();return{width:t,height:r.height,x:r.right-t-n,y:r.y,top:r.top,bottom:r.bottom,left:r.right-t-n,right:r.right-n}},Kt=function(e){var t,n,r,o,i=e.detectedWrapper,a=e.mountedToElement,c=e.rootStripeElement,s=e.onOverlap,u=e.onWarning,l=[],d=0,p=0,m=function(){var e,t;p++;var n=c.getBoundingClientRect(),r=_();if(p>50&&(u("disconnecting, greater than ".concat(50," overlap checks done")),b()),!(n.width<150)){if(l=l.filter((function(n){var o,i,a="backgroundImage"===n.source?n.approximateDimensions:n.element.getBoundingClientRect(),c=(i=r,!((o=a).y+o.heighti.y+i.height||o.x+o.widthi.x+i.width));return c&&(!e||a.left30&&(u("disconnecting, greater than ".concat(30," elements being watched")),b()))},_=function(){var e=c.getBoundingClientRect(),t=e.height,n=e.y,r=e.right,o=e.width-150;return{width:o,height:32,x:r-o,y:n+t/2-16}},h=function(e){if(f({source:"resizeObserver-element",element:e}),e.children)for(var t=Math.min(e.children.length,5);t--;){var n=e.children[t];Ht(n)&&f({source:"resizeObserver-siblingChild",element:n})}},y=(0,ze.Ds)((function(){var e,t=_(),n=document.elementFromPoint(t.x+t.width,t.y),r=a.previousElementSibling,o=a.nextElementSibling,s=null==a||null===(e=a.parentElement)||void 0===e?void 0:e.nextElementSibling;if(r&&h(r),o)for(var u=o,l=0;l<3&&u;l++)h(u),u=u.nextElementSibling;s&&h(s),n&&function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;if(!(n>75||r>75||[document.body,document.documentElement,i,a].indexOf(e)>-1||a.contains(e)))for(var o=5,c=e;o--;){if(Ht(c)){f({source:"resizeObserver-fromPoint",element:e});break}if(!c.parentElement)break;c=c.parentElement}}(n),[c.previousElementSibling,c.nextElementSibling].forEach((function(e){e&&Ht(e)&&f({source:"resizeObserver-elementPrivate",element:e})})),m()}),250),v=function(e){e.forEach((function(e){e.isIntersecting&&f({element:e.target,source:"intersectionObserver"})})),e.length&&m()},g=function(e){var t=(0,w.Dx)(e);if(t){(function(e){return new Gt((function(t){var n,r=null===(n=e.backgroundSize.match(/(\d+)px/))||void 0===n?void 0:n[1];if(r){var o=parseInt(r,10);t({width:o})}else if(-1!==["auto","contain"].indexOf(e.backgroundSize)){var i=document.createElement("img");i.src=e.backgroundImage.replace(/url\("(.+)"\)/,"$1"),(0,w.yq)(i,zt),document.body.appendChild(i);var a=(0,ze.$M)((function(e){try{e(),document.body.removeChild(i)}catch(e){}}));setTimeout((function(){a((function(){t({error:"Background image took too long to load"})}))}),2e3),i.onload=function(){a((function(){if(0!==i.width&&0!==i.height)if("contain"===e.backgroundSize){var n=parseInt(e.width,10),r=parseInt(e.height,10)*(i.width/i.height);t({width:Math.min(r,n)})}else t({width:i.width});else t({error:"Background image has no dimensions"})}))},i.onerror=function(){a((function(){t({error:"Failed to load background image"})}))}}else t({error:"Unsupported background-size"})}))})(t).then((function(t){var n=t.error,r=t.width;n?u(n):r&&function(t){var n=Vt(e,t);n&&(f({source:"backgroundImage",element:e,approximateDimensions:n}),m())}(r)}))}},b=function(){var e,o,i;l=[],null===(e=t)||void 0===e||e.disconnect(),null===(o=n)||void 0===o||o.disconnect(),null===(i=r)||void 0===i||i.disconnect()};try{window.ResizeObserver&&((o=new ResizeObserver((function(){return y()}))).observe(a),t=o),i?(window.IntersectionObserver&&(n=function(e){for(var t=0,n=new window.IntersectionObserver(v,{root:e}),r=(null==i?void 0:i.children)||[],o=0;o15){u("disconnecting, greater than 10 intersection observer nodes detected"),b();break}}return n}(i)),window.MutationObserver&&(r=function(e){var t=0,r=new MutationObserver((function(e){e.forEach((function(e){var r=e.type,o=e.addedNodes;if("childList"===r){for(var i=0;i15)){u("disconnecting, greater than 10 added mutation observer nodes detected"),b();break}}m()}}))}));return r.observe(e,{childList:!0}),r}(i)),[a,null==a?void 0:a.parentElement].forEach((function(e){e&&function(e){var t=(0,w.Dx)(e);if(!t)return!1;var n=t.backgroundImage;if(!/url\(.+\)/.test(n))return!1;var r=t.backgroundPosition;if(/right/.test(r)){var o,i,a=null===(o=r.match(/right\s+(-?\d+)px/))||void 0===o?void 0:o[1],c=null===(i=r.match(/right\s+(\d+)%/))||void 0===i?void 0:i[1];if(a&&parseInt(a,10)>75)return!1;if(c&&parseInt(c,10)>5)return!1}else{var s,u=null===(s=t.backgroundPositionX.match(/(\d+)%/))||void 0===s?void 0:s[1];if(!u||parseInt(u,10)<95)return!1}var l=t.backgroundRepeat;if("no-repeat"===l)return!0;if("repeat"===l){var d,p=t.backgroundSize;if(-1!==p.indexOf(","))return!1;var m=null===(d=p.match(/(\d+)px/))||void 0===d?void 0:d[1];return!!m&&parseInt(m,10)<75}return!1}(e)&&g(e)}))):u("no wrapper detected, not setting intersection or mutation observer")}catch(e){u("string"==typeof(null==e?void 0:e.message)?null==e?void 0:e.message:"error caught in detection")}return{disconnect:b,check:y}},Ht=function(e){if(e instanceof HTMLElement){var t=(0,w.Dx)(e);return"absolute"===(null==t?void 0:t.position)||"right"===(null==t?void 0:t.float)}return!1},Yt={networks:null},Wt=function(e,t,n){if(!n)return 0;var r=n.indexOf(e)>-1,o=n.indexOf(t)>-1;return r&&!o?-1:!r&&o?1:r&&o?n.indexOf(e)-n.indexOf(t):0},Xt=function(e){var t=e.cardNetworks,n=e.merchantPreferredNetworks,r=e.stripePreferredNetworks;return t.length<=1||0===r.length&&(!n||0===n.length)?t:(0,u.Z)(t).sort((function(e,t){var o=Wt(e,t,n);return 0!==o?o:Wt(e,t,r)}))},Qt=n(6274).Promise,Jt=["classes"],$t={base:"StripeElement",focus:"StripeElement--focus",invalid:"StripeElement--invalid",complete:"StripeElement--complete",empty:"StripeElement--empty",webkitAutofill:"StripeElement--webkit-autofill"},en="#faffbd",tn=function(e){return parseFloat(e.toFixed(1))},nn=function(e){return/^\d+(\.\d*)?px$/.test(e)},rn=function(e){for(var t=5;t--;){var n,r=e.children[t];if(r&&null!==(n=r.textContent)&&void 0!==n&&n.trim())return r}return null},on=function(){function e(t){var n,r,o=this;(0,l.Z)(this,e),this._lastEmittedNetworksChange=null,this.focus=function(e){var t;if("link-manage"!==(null===(t=o._linkButtonFrame)||void 0===t?void 0:t.getActiveButton())){if(o._isIssuingDisplayElement())throw new P.No("Cannot call focus() on an ".concat(o._componentName," Element."));document.activeElement&&document.activeElement.blur&&document.activeElement.blur(),o._fakeInput.focus()}else null==e||e.preventDefault()},this._formSubmit=function(){for(var e=o._component.parentElement;e&&"FORM"!==e.nodeName;)e=e.parentElement;if(e){var t=document.createEvent("Event");t.initEvent("submit",!0,!0),e.dispatchEvent(t)}},this._unmountLinkButtonFrame=function(){o._linkButtonFrame&&((0,w.yq)(o._fakeInput,we.ZS),o._restrictFocusToCardOnly(),o._linkButtonFrame.unmount(),o._linkButtonFrame=void 0),o._hasFloatingLabels=void 0,o._blurOnNextLinkState=void 0},this._isActiveLinkButton=function(e){var t;return(null===(t=o._linkButtonFrame)||void 0===t?void 0:t.getActiveButton())===e},this._restrictFocusToLinkFrameOnly=function(){var e;o._fakeInput.setAttribute("tabIndex","-1"),null===(e=o._linkButtonFrame)||void 0===e||e.setFocusable(!0)},this._restrictFocusToCardOnly=function(){var e;o._fakeInput.removeAttribute("tabIndex"),null===(e=o._linkButtonFrame)||void 0===e||e.setFocusable(!1)},this._allowFrameAndCardFocus=function(){var e;o._fakeInput.removeAttribute("tabIndex"),null===(e=o._linkButtonFrame)||void 0===e||e.setFocusable(!0)},this._handleLinkStateChangeFocusBehavior=function(e){switch(o._frame._iframe.removeAttribute("tabIndex"),e?(0,w.yq)(o._fakeInput,(0,s.Z)((0,s.Z)({},we.ZS),{},{"z-index":"-1"})):(0,w.yq)(o._fakeInput,we.ZS),e){case"link-manage":o._frame._iframe.setAttribute("tabIndex","-1"),o._restrictFocusToLinkFrameOnly();break;case"link-pay":o._focused?o._restrictFocusToLinkFrameOnly():o._restrictFocusToCardOnly();break;case"link-save":case"link-use":o._focused?o._restrictFocusToLinkFrameOnly():o._allowFrameAndCardFocus();break;default:o._restrictFocusToCardOnly()}},this._remove1PasswordButton=function(){if(o._focused)try{var e=document.querySelector("com-1password-button");null==e||e.remove()}catch(e){}},this._handleFloatingPlaceholdersWithLink=function(){var e;(o._hasFloatingLabels=!0,o._frame.send({action:"stripe-has-floating-labels",payload:null}),o._focused)||(null===(e=o._linkButtonFrame)||void 0===e||e.disallowPointerEvents())},this._hasZeroOpacityAncestor=function(){for(var e=o._component,t=!1,n=20;n--;){var r=(0,w.Dx)(e);if(r){var i=r.opacity,a=r.height,c=r.width;if("0"===i&&0!==parseInt(a,10)&&0!==parseInt(c,10)){t=!0;break}}if(!e.parentElement||e.parentElement.getElementsByClassName(se.A2).length>1)break;e=e.parentElement}return t},this._hasOverlappingSibling=function(e){var t,n=e;if(!n)return!1;if(null===(t=n.textContent)||void 0===t||!t.trim())return!1;for(var r=5;r--;){var i=rn(n);if(!i)break;n=i}var a=o._component.getBoundingClientRect(),c=n.getBoundingClientRect(),s=Math.abs(a.x-c.x)<20,u=a.y+a.height/2,l=c.yu,d=!!n.textContent;return s&&l&&d},this._hasFloatingPlaceholder=function(){var e=o._getParent(),t="";return o._hasZeroOpacityAncestor()?t="zero_opacity_ancestor":o._hasOverlappingSibling(null==e?void 0:e.previousElementSibling)?t="previous_overlapping_sibling":o._hasOverlappingSibling(null==e?void 0:e.nextElementSibling)&&(t="next_overlapping_sibling"),!!t&&(o._controller.report("link_in_card.split_card.has_floating_placeholders",{type:t}),!0)},this._logPrbDeprecationWarning=function(){var e=["You're using a legacy wallets integration.","We released an improved way to boost conversion and integrate with wallets including Apple Pay, Google Pay, Link, and more. https://docs.stripe.com/elements/express-checkout-element/comparison","Learn how to upgrade your integration: https://docs.stripe.com/elements/express-checkout-element/migration"].join("\n\n");o._controller.warn(e)};var i=t.options,a=t.component,c=t.listenerRegistry,u=t.elementTimings,d=t.emitEvent,p=t.getParent,m=t.hasRegisteredListener,f=t.selfDestruct,_=(0,A.CE)(i,["loader","appearance","clientSecret"]),h=_.controller,y=_.componentName,v=_.publicOptions,b=_.betas;this._betas=b,this._componentName=y,this._component=a,this._controller=h,this._listenerRegistry=c,this._emitEvent=d,this._getParent=p,this._hasRegisteredListener=m,this._selfDestruct=f;var k=(0,g.Gu)(ye,v||{},"create()"),S=k.value;k.warnings.forEach((function(e){return o._controller.warn(e)}));var C=S.paymentRequest,E=S.classes,M=S.issuingCard,R=null===(n=S.style)||void 0===n||null===(r=n.paymentRequestButton)||void 0===r?void 0:r.height;this._cachedOptions={style:{paymentRequestButton:{height:"string"==typeof R?R:void 0}}};var I,N="paymentRequestButton"===this._componentName;if(N){if(null!=C&&C._initialOptions.__isCheckout||this._logPrbDeprecationWarning(),!C)throw new P.No("You must pass in a stripe.paymentRequest object in order to use this Element.");this._paymentRequest=C;var T=_.locale;this._paymentRequest._registerElement(),this._paymentRequest._updateLocale(T)}if(this._isIssuingDisplayElement()){var O=0===(b||[]).length;if(!M)throw new Error("You must pass in an ID to the issuingCard option in order to use this Element.");if(O){if(!("nonce"in S)||!("ephemeralKeySecret"in S))throw new Error("You must set the nonce and ephemeralKeySecret options to use this Element.")}else if(I=M,-1===lt.indexOf(I))throw new Error("Issuing card ".concat(M," has not been retrieved."))}this._createElement(_,S,u),this._classes=$t,this._computeCustomClasses(E||{}),this._groupId=_.groupId,this._lastBackgroundColor="",this._focused=!1,this._empty=!N,this._invalid=!1,this._complete=!1,this._autofilled=!1,this._hasUnmounted=!1,this._lastSubmittedAt=null,this._hasBlurred=!1}return(0,d.Z)(e,[{key:"update",value:function(e){var t=this,n=(0,g.Gu)(ve,e||{},"element.update()"),r=n.value;if(n.warnings.forEach((function(e){return t._controller.warn(e)})),r){var o,i,a=null===(o=r.style)||void 0===o||null===(i=o.paymentRequestButton)||void 0===i?void 0:i.height,c={style:{paymentRequestButton:{height:"string"==typeof a?a:void 0}}};this._cachedOptions=(0,A.PM)(this._cachedOptions,c);var s=r.classes,u=(0,m.Z)(r,Jt);s&&(this._removeClasses(),this._computeCustomClasses(s),this._updateClasses()),this._updateFrameHeight(r),Object.keys(u).length&&(this._frame.update(u),this._secondaryFrame&&this._secondaryFrame.update(u))}}},{key:"blur",value:function(){if(this._isIssuingDisplayElement())throw new P.No("Cannot call blur() on an ".concat(this._componentName," Element."));this._frame.blur(),this._fakeInput.blur()}},{key:"clear",value:function(){this._frame.clear()}},{key:"unmount",value:function(){var e;this._hasUnmounted=!0;var t=this._getParent(),n=this._label;this._controller.action.elementUnmounted({elementName:this._componentName,groupId:this._groupId,frameId:this._frame.id}),t&&(this._listenerRegistry.removeEventListener(t,"click",this.focus),this._removeClasses()),n&&(this._listenerRegistry.removeEventListener(n,"click",this.focus),this._label=null),this._secondaryFrame&&(this._secondaryFrame.unmount(),this._listenerRegistry.removeEventListener(window,"click",this._handleOutsideClick)),this._controller._prbWarningModal&&this._controller.outerAction.unmountPrbWarningModal(),this._unmountLinkButtonFrame(),null===(e=this._linkOverlapObserver)||void 0===e||e.disconnect(),this._fakeInput.disabled=!0,this._frame.unmount()}},{key:"mount",value:function(){var e=this,t=(0,w.qW)(this._component),n=!!window.frames[this._frame.id],r=(0,w.Yi)(document,this._component,t?function(t,n){e._controller.report("debug.".concat(t),n)}:void 0);if(t&&this._controller.report("debug.user_error.shadow_dom_mount.new_implementation",{element:this._componentName,isAccessibleViaWindowFrames:n}),t!==r&&this._controller.report("debug.shadow_dom_mount.old_implementation_mismatch",{element:this._componentName,isConnectedViaShadowDomResult:t,isConnectedViaShadowDom__deprecatedResult:r}),r){this._controller.report("user_error.shadow_dom_mount",{element:this._componentName});var o=function(){throw new P.No("Elements cannot be mounted in a ShadowRoot. Please mount in the Light DOM.")};"test"===this._controller.keyMode()?o():setTimeout(o,0)}if(this._paymentRequest){if(!this._paymentRequest._canMakePaymentResolved)throw new P.No("For the paymentRequestButton Element, you must first check availability using paymentRequest.canMakePayment() before mounting the Element.");if(!this._paymentRequest._activeBackingLibraryName)throw new P.No("The paymentRequestButton Element is not available in the current environment.")}this._mountTimestamp=new mt.E,this._findPossibleLabel(),this._updateClasses(),this._hasUnmounted&&"paymentRequestButton"===this._componentName&&this._frame.send({action:"stripe-cached-options-remount",payload:this._cachedOptions}),this._controller.action.elementMounted({elementName:this._componentName,groupId:this._groupId,frameId:this._frame.id})}},{key:"_isIssuingDisplayElement",value:function(){return"issuingCardNumberDisplay"===this._componentName||"issuingCardCvcDisplay"===this._componentName||"issuingCardExpiryDisplay"===this._componentName||"issuingCardPinDisplay"===this._componentName}},{key:"_updateClasses",value:function(){var e=this._getParent();e&&(0,w.mb)(e,[[this._classes.base,!0],[this._classes.empty,this._empty],[this._classes.focus,this._focused],[this._classes.invalid,this._invalid],[this._classes.complete,this._complete],[this._classes.webkitAutofill,this._autofilled]])}},{key:"_removeClasses",value:function(){var e=this._getParent();e&&(0,w.mb)(e,[[this._classes.base,!1],[this._classes.empty,!1],[this._classes.focus,!1],[this._classes.invalid,!1],[this._classes.complete,!1],[this._classes.webkitAutofill,!1]])}},{key:"_findPossibleLabel",value:function(){var e=this._getParent();if(e){var t,n=e.getAttribute("id");if(n&&(t=document.querySelector("label[for='".concat(n,"']"))),t)this._listenerRegistry.addEventListener(e,"click",this.focus);else for(t=t||e.parentElement;t&&"LABEL"!==t.nodeName;)t=t.parentElement;t?(this._label=t,this._listenerRegistry.addEventListener(t,"click",this.focus)):this._listenerRegistry.addEventListener(e,"click",this.focus)}}},{key:"_computeCustomClasses",value:function(e){var t={};return Object.keys(e).forEach((function(n){if(!$t[n])throw new P.No("".concat(n," is not a customizable class name.\nYou can customize: ").concat(Object.keys($t).join(", ")));var r=e[n]||$t[n];t[n]=r.replace(/\./g," ")})),this._classes=(0,s.Z)((0,s.Z)({},this._classes),t),this}},{key:"_setupEvents",value:function(e){var t,n=this,r=e.stripeJsLoadTimestamp,o=e.groupCreateTimestamp,i=e.createTimestamp,a={stripeJsLoad:r.getAsPosixTime(),stripeCreate:i.getAsPosixTime(),groupCreate:o.getAsPosixTime(),create:i.getAsPosixTime()};this._controller.deferredCanMakePaymentResponse.promise.then((function(e){n._frame.send({action:"stripe-can-make-payment-response",payload:e})})),this._paymentRequest&&this._paymentRequest._on("walletconfigpropsupdate",(function(e){n._frame.send({action:"stripe-wallet-config-props-update",payload:e})})),this._frame._on("outer-link-card-mount",(function(e){var r=e.isOverride,o=e.frameId,i=e.locale,a=e.style,c=e.disabled,s=e.controllerId;n._linkButtonFrame=Ut({component:n._componentName,frame:n._frame,parent:n._component,controller:n._controller,controllerId:s,isOverride:r,frameId:o,locale:i,style:a,disabled:c,onSubmit:function(){return n._frame._emit("submit")},onLoad:function(){var e;t&&(null===(e=n._linkButtonFrame)||void 0===e||e.updateIframePosition(t),t=void 0)},onOuterAction:function(e){var t=e.outerAction,r=e.outerPayload;if("link-state-change"===t&&"link-manage"===r.state){n._frame._iframe.style.display="none";n._frame._iframe.offsetHeight;n._frame._iframe.style.display="block"}"link-state-change"===t&&(n._handleLinkStateChangeFocusBehavior(r.state),"cardNumber"===n._componentName&&n._remove1PasswordButton(),"cardNumber"===n._componentName&&void 0===n._hasFloatingLabels&&["link-pay","link-use"].indexOf(r.state)>-1&&n._hasFloatingPlaceholder()&&n._handleFloatingPlaceholdersWithLink(),["cardNumber","cardCvc","cardExpiry","postalCode"].indexOf(n._componentName)>-1&&void 0===n._blurOnNextLinkState&&"link-manage"===r.state&&n._hasFloatingPlaceholder()?(n._blurOnNextLinkState=!0,n._controller.report("link_in_card.split_card.requires_focus_and_blur_with_data"),(0,w.Ql)((function(){n._emitEvent("focus"),n._focused=!0,n._updateClasses(),n._emitEvent("blur"),n._focused=!1,n._updateClasses()}))):n._blurOnNextLinkState&&(n._blurOnNextLinkState=void 0,(0,w.Ql)((function(){n._emitEvent("blur")}))))},onError:function(e){n._frame.send({action:"stripe-link-in-card-eject",payload:{reason:e}}),n._unmountLinkButtonFrame()}})})),this._frame._on("outer-link-card-unmount",(function(){return n._unmountLinkButtonFrame()})),this._frame._on("prb-warning-modal-mount",(function(e){var t=e.locale;n._controller.report("prb_warning.mount"),n._controller.outerAction.mountPrbWarningModal({locale:t})}));var c=(0,ze.$M)((function(e){var t=e.matchFrame;n._frame.send({action:"stripe-timings",payload:{timestamps:a,matchFrame:t}})}));if(this._frame._on("load",(function(e){var t,r,o=e.source,i=n._getParent(),s=ke(i),u=n._paymentRequest?n._paymentRequest._buttonTypeName:null,l=n._paymentRequest?n._paymentRequest._secondaryButtonTypeName:null,d=null===(t=n._paymentRequest)||void 0===t?void 0:t._initialOptions.onBehalfOf,p=null===(r=n._paymentRequest)||void 0===r?void 0:r._initialOptions.__isCheckout;n._mountTimestamp&&(a.mount=n._mountTimestamp.getAsPosixTime());var m=function(e,t,r){var i,a,m;n._frame.send({action:"stripe-user-mount",payload:{rtl:s,paymentRequestButtonType:u,secondaryPaymentRequestButtonType:l,linkExperimentAssignments:e,arb_id:t,outerBorderRadius:r,amount:null===(i=n._paymentRequest)||void 0===i||null===(a=i._reportOnlyTotal)||void 0===a?void 0:a.amount,currency:null===(m=n._paymentRequest)||void 0===m?void 0:m._reportOnlyCurrency,paymentRequestOnBehalfOf:d,mountPrbInCheckout:p,windowInnerWidth:window.innerWidth}}),c({matchFrame:o===n._frame._iframe.contentWindow})};if(-1!==[u,l].indexOf("LINK")){var f,_,h,y=n._controller.action.retrieveWalletConfig({onBehalfOf:null===(f=n._paymentRequest)||void 0===f?void 0:f._initialOptions.onBehalfOf,amount:null===(_=n._paymentRequest)||void 0===_?void 0:_._initialOptions.total.amount,currency:null===(h=n._paymentRequest)||void 0===h?void 0:h._initialOptions.currency}),v=i?vt(i,"paymentRequestButton"):Qt.resolve(null);Qt.all([y,v]).then((function(e){var t,n,r,o,a=(0,M.Z)(e,2),c=a[0],s=a[1],u=i?yt(s,i):null;"object"===c.type&&(t=null===(r=c.object.experiments)||void 0===r?void 0:r.experiment_assignments,n=null===(o=c.object.experiments)||void 0===o?void 0:o.arb_id);m(t,n,null==u?void 0:u.outerBorderRadius)}))}else m()})),this._secondaryFrame){var s=this._secondaryFrame;s._on("load",(function(e){var t=e.source;n._mountTimestamp&&(a.mount=n._mountTimestamp.getAsPosixTime()),s.send({action:"stripe-user-mount",payload:{rtl:!1,paymentRequestButtonType:null}}),s.send({action:"stripe-timings",payload:{timestamps:a,matchFrame:t===s._iframe.contentWindow}})}))}this._frame._on("redirectfocus",(function(e){var t=e.focusDirection,r=(0,w.dh)(n._component,t,{includeStripeIframes:!0});r&&r.focus()})),this._frame._on("focus",(function(){var e;n._hasFloatingLabels&&(null===(e=n._linkButtonFrame)||void 0===e||e.allowPointerEvents());(n._isActiveLinkButton("link-pay")||n._isActiveLinkButton("link-save")||n._isActiveLinkButton("link-use"))&&n._restrictFocusToLinkFrameOnly(),n._focused=!0,n._updateClasses()})),this._frame._on("blur",(function(){var e;(n._isActiveLinkButton("link-pay")?n._restrictFocusToCardOnly():(n._isActiveLinkButton("link-save")||n._isActiveLinkButton("link-use"))&&n._allowFrameAndCardFocus(),n._hasFloatingLabels&&n._empty)&&(null===(e=n._linkButtonFrame)||void 0===e||e.disallowPointerEvents());n._focused=!1,n._updateClasses(),n._lastSubmittedAt&&"paymentRequestButton"===n._componentName&&(n._controller.report("payment_request_button.sheet_visible",{latency:n._lastSubmittedAt.getElapsedTime()}),n._lastSubmittedAt=null),!n._linkButtonFrame||n._hasBlurred||"cardNumber"!==n._componentName||n._hasFloatingLabels||setTimeout((function(){n._hasFloatingPlaceholder()&&n._handleFloatingPlaceholdersWithLink()}),500),n._hasBlurred=!0})),this._frame._on("submit",(function(e){if("paymentRequestButton"===n._componentName){n._lastSubmittedAt=new mt.E;var t=!1,r=!1;ut(),n._emitEvent("click",{preventDefault:function(){n._controller.report("payment_request_button.default_prevented"),t&&n._controller.warn("event.preventDefault() was called after the payment sheet was shown. Make sure to call it synchronously when handling the `click` event."),r=!0}}),!r&&n._paymentRequest&&(n._paymentRequest._updateLastClickedButtonPosition(null==e?void 0:e.buttonPosition),n._paymentRequest._elementShow(),t=!0)}else n._emitEvent("submit"),n._formSubmit()})),["ready","focus","blur","escape","click"].forEach((function(e){n._frame._on(e,(function(){n._emitEvent(e)}))})),this._frame._on("self-destruct",(function(){n._selfDestruct()})),this._frame._on("load-error",(function(e){n._emitEvent("loaderror",{error:e}),n._selfDestruct()})),this._frame._on("change",(function(e){var t;ut();var r={},o=se._0[n._componentName]||[];["error","value","empty","complete"].concat((0,u.Z)(o)).forEach((function(t){return r[t]=e[t]})),n._emitEvent("change",r),null===(t=n._linkOverlapObserver)||void 0===t||t.check(),n._empty=r.empty,n._invalid=!!r.error,n._complete=r.complete,n._updateClasses()})),this._frame._on("__privateIntegrationError",(function(e){var t=e.message;n._emitEvent("__privateIntegrationError",{message:t})})),this._frame._on("card-element-card-brand-choice-eligibility-change",(function(e){var t=e.isEligibleForCardElementCBC,r=e.merchantPreferredNetworks,o=e.stripePreferredNetworks;n._controller.action.isCardMetadataRequired({frameId:n._frame.id,resetEmitted:!0}).then((function(){return n._controller.action.retrieveCardNetworks({frameId:n._frame.id})})).then((function(e){if(e){var i=e;if(t){var a=Xt({cardNetworks:e,merchantPreferredNetworks:r,stripePreferredNetworks:o});n._frame.send({action:"stripe-card-networks-retrieved",payload:a}),i=a.slice(0,1)}n._emitNetworksChangeEventIfDifferentFromLast(i,!1)}}))})),this._frame._on("networkschange-emit",(function(e){var t=e.cardNetworks,r=e.merchantPreferredNetworks,o=e.stripePreferredNetworks,i=e.isCartesBancairesEnabled,a=e.isEligibleForCBC,c=e.isLinkBankAccount;if(-1!==["card","cardNumber"].indexOf(n._componentName)){if(c)return n._emitNetworksChangeEventIfDifferentFromLast([],!0),void n._emitNetworksChangeEventIfDifferentFromLast(["link"],!1);var s=n._formatNetworks({cardNetworks:t,stripePreferredNetworks:o,merchantPreferredNetworks:r,isCartesBancairesEnabled:i,isEligibleForCBC:a}).networksToEmit;n._emitNetworksChangeEventIfDifferentFromLast(s,!1)}})),this._frame._on("networkschange-start",(function(e){var t=e.isCartesBancairesEnabled,r=e.isEligibleForCardElementCBC,o=e.merchantPreferredNetworks,i=e.stripePreferredNetworks;(t||n._hasRegisteredListener("networkschange"))&&n._controller.action.isCardMetadataRequired({frameId:n._frame.id}).then((function(e){return e&&n._emitNetworksChangeEvent(null,!0),n._controller.action.retrieveCardNetworks({frameId:n._frame.id})})).then((function(e){if(e){var a=n._formatNetworks({cardNetworks:e,stripePreferredNetworks:i,merchantPreferredNetworks:o,isCartesBancairesEnabled:t,isEligibleForCBC:r}),c=a.orderedCardNetworks,s=a.networksToEmit;n._emitNetworksChangeEvent(s,!1),t&&n._frame.send({action:"stripe-card-networks-retrieved",payload:c})}}))})),this._frame._on("dimensions",(function(e){if("paymentRequestButton"!==n._componentName){var r=n._getParent();if(r){var o=(0,w.Dx)(r,null);if(o){var i=parseFloat(o.getPropertyValue("height")),a=e.height;if("border-box"===o.getPropertyValue("box-sizing")){var c=parseFloat(o.getPropertyValue("padding-top")),s=parseFloat(o.getPropertyValue("padding-bottom"));i=i-parseFloat(o.getPropertyValue("border-top"))-parseFloat(o.getPropertyValue("border-bottom"))-c-s}var u=tn(i),l=tn(a);0!==i&&u1&&void 0!==arguments[1]&&arguments[1],n=e.style;if("paymentRequestButton"===this._componentName){var r=n&&n.paymentRequestButton||{},o=r.height,i="string"==typeof o?o:void 0;(t||i)&&(this._frame.updateStyle({height:i||this._lastHeight||Re.Tw,minHeight:"auto"}),this._lastHeight=i||this._lastHeight)}else{var a=n&&n.base||{},c=a.lineHeight,s=a.fontSize,u=a.padding,l="string"!=typeof c||isNaN(parseFloat(c))?void 0:c,d="string"==typeof s?s:void 0,p="string"==typeof u?u:void 0;if(d&&!nn(d)&&this._controller.warn("The fontSize style you specified (".concat(d,") is not in px. We do not recommend using relative css units, as they will be calculated relative to our iframe's styles rather than your site's.")),t||l||d){var m=-1===U.T2.indexOf(this._componentName)?void 0:p||this._lastPadding,f=(0,w.Tf)(l||this._lastHeight,d||this._lastFontSize,m);this._frame.updateStyle({height:f}),this._lastFontSize=d||this._lastFontSize,this._lastHeight=l||this._lastHeight,this._lastPadding=m}}}},{key:"_createElement",value:function(e,t,n){var r=this,o=(0,A.ei)(e,["locale","fonts","betas","appearance","loader","clientSecret","deferredIntent","wait","mids","controllingElement","controllingMode","mountedInternal","externalPaymentMethodTypes","allowedCardBrands","disallowedCardBrands","customerSessionClientSecret","paymentMethodCreation"]),i=(0,A.ei)(t,["hidePostalCode","hideIcon","disableLink","preferredNetwork","showIcon","disableMultipleButtons","style","iconStyle","value","error","locale","fonts","placeholder","disabled","placeholderCountry","supportedCountries","accountHolderType","issuingCard","ephemeralKeySecret","nonce","toCopy","__privateCvcOptional","__privateValue","__privateEmitIbanValue"]),a=this._component,c=Ee(Ce.Kb);(0,w.yq)(a,Me);var u=ke(document.body),l=e.componentName,d=e.groupId,p=be[l],m=(0,s.Z)((0,s.Z)((0,s.Z)({},o),i),{},{rtl:u}),f=this._controller.createElementFrame(p,l,d,m);if(f._on("load",(function(){c.disabled=!1})),this._listenerRegistry.addEventListener(c,"focus",(function(){f.focus()})),f.appendTo(a),se._y[l]){var _=se._y[l].secondary,h=this._controller.createSecondaryElementFrame(p,_,l,d,m);h&&h.on&&h.on("height-change",(function(e){h.updateStyle({height:"".concat(e.height,"px")})})),this._secondaryFrame=h,h.appendTo(a),this._listenerRegistry.addEventListener(window,"click",(function(){return r._handleOutsideClick()}))}if(a.appendChild(c),k.Ah&&l!==U.Yj.paymentRequestButton){var y=function(){var e=Ee(Ce.tk);return e.setAttribute("tabindex","-1"),e}();a.appendChild(y)}this._frame=f,this._fakeInput=c,this._setupEvents(n),this._updateFrameHeight(t,!0)}}]),e}(),an=on,cn={amount:g.Rx,currency:(0,g.kw)("USD","CAD"),logoColor:(0,g.jt)((0,g.kw)("primary","black","white")),fontColor:(0,g.jt)(g.Z_),fontSize:(0,g.jt)(g.Z_),textAlign:(0,g.jt)(g.Z_),stripeMerchantId:(0,g.jt)(g.Z_)},sn=(0,g.mC)(cn),un=n(9900),ln=n(6274).Promise,dn=["options"],pn=function(e){var t,n=e.options,r=(0,m.Z)(e,dn),o=e.emitEvent,i=e.listenerRegistry,a=n.controller,c=n.componentName,l=n.publicOptions,d=n.groupId,p=n.locale,f=new mt.E,_=function(e){var t=(0,g.Gu)(sn,e||{},"create()"),n=t.value,r=t.warnings;if(!Math.floor(n.amount)===n.amount)throw new P.No("'Amount' must be a whole integer number that represents the lowest denomination (cents).");return r.forEach((function(e){return a.warn(e)})),n},h=_(l),y=function(e,n){return e.apply(void 0,[t].concat((0,u.Z)(n)))},v=[],b=function(e){return function(){for(var n=arguments.length,r=new Array(n),o=0;o0)||-1!==["linkAuthentication","payment","shippingAddress","address"].indexOf(e)},or=n(6274).Promise,ir=function(e){var t,n=e.elementFrame,r=e.component,o=e.componentName,i=e.loaderEnabled,a=e.elementOptions,u=0,l=function(e){if(!e)return null;var t=function(e){var t=[],n=function e(n){var r=document.createElement("div");return(0,w.yq)(r,n.style),n.isShimmerNode&&t.push(r),Array.isArray(n.children)&&n.children.forEach((function(t){return r.appendChild(e(t))})),r}(e);return n.className="__PrivateStripeElementLoader",{loaderComponent:n,shimmerNodes:t}}(e),n=t.loaderComponent,r=t.shimmerNodes;return(0,s.Z)({loaderComponent:n},function(e){var t,n,r=3e3,o=function(){t&&clearTimeout(t),n&&clearTimeout(n)};return{startAnimation:function(){o();var i=function(t){(0,w.Ql)((function(){e.forEach((function(e){e.style.transition="start"===t?"transform ".concat(r,"ms ease"):"",e.style.transform="start"===t?"translateX(200%)":"translateX(-100%)"}))}))};!function e(){i("start"),n=setTimeout((function(){return i("stop")}),r),t=setTimeout(e,3500)}()},stopAnimation:o}}(r))},d=new or((function(e){var t=c;t&&i?(t._emit("get-element-loader-ui",{componentName:o,elementOptions:a}),t._on("element-loader-ui-callback",(function(t){var n=t.message,r=n.componentName,i=n.loaderUiNodes;o===r&&e(l(i))}))):e(null)})),p=function(e){return function(){var t=++u;return d.then((function(n){return n&&t===u?e(n):{err:"stale call"}}))}},m=function(e){e.height&&(r.style.height=e.height)},f=function(e){var t=e.loaderComponent,o=e.stopAnimation;n._off("set_styles",m),r.style.height="",o();try{r.contains(t)&&r.removeChild(t)}catch(e){}},_=p((function(e){var t=e.loaderComponent,o=e.startAnimation;t.style.opacity="1",n.updateStyle({opacity:"0"}),r.style.height=t.style.height,r.appendChild(t),o(),n._on("set_styles",m)})),h=p((function(e){e.loaderComponent.style.opacity="0",t=setTimeout((function(){f(e)}),316)})),y=p(f);return{show:function(){return t&&clearTimeout(t),_()},hide:function(){return n.updateStyle({opacity:"1"}),h()},unmount:function(){return n.updateStyle({opacity:"1"}),t&&clearTimeout(t),y()}}},ar=n(1119),cr={apple_pay:"applePay",google_pay:"googlePay"},sr={country:"US",currency:"usd",total:{amount:0,label:""},requestPayerName:!0,requestPayerEmail:!1,requestPayerPhone:!1},ur=function(e,t,n,r){var o="applePay"===r?"googlePay":"applePay",i=function(e){var t,n,r,o=e.options;if(o.publicOptions&&o.publicOptions.hasOwnProperty("applePay")&&null!==(t=o.publicOptions)&&void 0!==t&&t.applePay.hasOwnProperty("applePayLaterAvailability"))return null===(n=o.publicOptions)||void 0===n||null===(r=n.applePay)||void 0===r?void 0:r.applePayLaterAvailability}({options:e}),a=nr({options:e,key:"recurringPaymentRequest"}),c=nr({options:e,key:"deferredPaymentRequest"}),u=nr({options:e,key:"automaticReloadPaymentRequest"}),l=new pe.Z({controller:e.controller,authentication:{apiKey:e.controller._apiKey,accountId:e.controller._stripeAccount||null},mids:e.mids,rawOptions:(0,s.Z)((0,s.Z)({},sr),{},{disableWallets:["browserCard","link",o],__isPaymentElement:!0,__elementsGroupId:e.groupId,applePay:{applePayLaterAvailability:i,recurringPaymentRequest:a,deferredPaymentRequest:c,automaticReloadPaymentRequest:u}}),betas:e.betas,queryStrategyOverride:null,listenerRegistry:t}),d=function(){};l._on("token",(function(e){d({type:"token",token:e.token.id}),e.complete("success")})),l._on("cancel",(function(){d({type:"cancelled"})})),l._on("__private_do_not_use_error",(function(e){d({type:"error",error:e})}));var p=l.canMakePayment().then((function(e){e&&e[r]?(n.send({action:"should-list-wallet",payload:{wallet:r}}),n._on("show-upe-wallet",(function(e){var t=e.wallet;if(d=e.onComplete,cr[t]===r)try{l.show()}catch(e){throw console.error(e),e}}))):n.send({action:"should-not-list-wallet",payload:{wallet:r}})}));return{pr:l,canMakePaymentPromise:p}},lr=n(3849),dr=n(1708),pr=function(e){if("object"==typeof e&&e&&e.hasOwnProperty("financialConnections")){var t=e.financialConnections;if("object"==typeof t&&t&&t.hasOwnProperty("onEvent")){var n=t.onEvent;if("function"==typeof n&&n)return n}return null}return null},mr=function(e,t,n){"financial_connections_session_cancelled"===e.error.code?t.action.completeLinkAccountSessionElements({groupId:n,error:lr.zb}):(e.error.code,t.action.completeLinkAccountSessionElements({groupId:n,error:lr.bT}))},fr=n(6241),_r=n(6977),hr=(n(8229),function(e){return function(e,t){return(0,A.G)(e.verification_sessions,(function(e){var n=e.type,r=e.state;return n===t&&"STARTED"===r}))}(e,"SIGNUP")}),yr=["redacted_payment_details"],vr="us_bank_account",gr=function(e,t){return t.controller.action.setInstrumentForConsumerSignUpIncentive({instrumentId:e,paymentMethodType:vr,groupId:t.groupId,instrumentEligible:!1})},br=function(e,t,n,r){var o,i,a=e.consumer,c=e.error;if(a&&!c&&!n&&r){var u,l=function(e){e.redacted_payment_details;var t=(0,m.Z)(e,yr);return(0,s.Z)((0,s.Z)({},t),{},{redacted_payment_details:[]})}(a);!function(e,t){t.controller.action.loginWithConsumerInfo({consumerInfo:e,groupId:t.groupId}),t.controller.action.prefillUsBankAccountFormWithConsumer({consumerInfo:e,groupId:t.groupId})}(l,t);var d=null===(u=l.new_payment_details)||void 0===u?void 0:u.id;if(l.country&&"US"!==l.country)!function(e){e.controller.action.resetConsumerIncentiveOffer({groupId:e.groupId,paymentMethodType:vr})}(t);else if(d){!function(e,t,n,r){hr(r.consumer_session)?n.controller.action.confirmConsumerSignUpIncentiveForPaymentDetails({instrumentId:e,paymentMethodType:vr,groupId:n.groupId,paymentDetailsId:t}):gr(e,n)}(e.linkAccountSession.id,d,t,l)}}var p=!c&&(null===(o=e.linkAccountSession)||void 0===o?void 0:o.paymentAccount);a&&null!=a&&null!==(i=a.new_payment_details)&&void 0!==i&&i.id||!p||!r||gr(e.linkAccountSession.id,t)},wr={PAYMENT_INTENT:"payment_intent",SETUP_INTENT:"setup_intent"},kr=function(e){return e?wr[e.type]:"deferred_intent"},Sr=function(e){if("object"==typeof e&&e&&e.hasOwnProperty("defaultValues")){var t,n,r,o=e.defaultValues,i=null==o||null===(t=o.billingDetails)||void 0===t?void 0:t.email,a=null==o||null===(n=o.billingDetails)||void 0===n?void 0:n.phone,c=null==o||null===(r=o.billingDetails)||void 0===r?void 0:r.name;return{email:"string"==typeof i?i:null,phone:"string"==typeof a?a:null,name:"string"==typeof c?c:null}}return null},Cr=function(e){var t=e.options,n=e.institutionId,r=e.manualEntryOnly,o=e.parsedClientSecret,i=e.searchSession,a=e.deferredIntentOptions,c=e.hostedSurface,s=e.linkMode,u=e.hasExistingConsumerSession,l=e.sharedSessionContext,d=e.merchantToken,p=e.shouldShareConsumerState,m=e.incentiveEligibilitySession,f=e.onEvent;!function(e){var t=e.options,n=e.institutionId,r=e.manualEntryOnly,o=e.parsedClientSecret,i=e.searchSession,a=e.deferredIntentOptions,c=e.hostedSurface,s=e.linkMode,u=e.hasExistingConsumerSession,l=e.sharedSessionContext,d=e.merchantToken,p=e.shouldShareConsumerState,m=e.incentiveEligibilitySession,f=e.billingDetails,_=e.onEvent;(0,ar.OJ)({linkAccountSessionCreatorClientSecret:null==o?void 0:o.clientSecret,linkAccountSessionCreatorType:kr(o),createdBy:(0,dr.Wg)(null==o?void 0:o.id,null==a?void 0:a.elementsSessionId),controller:t.controller,attachRequired:!1,institution:n,data:{type:"us_bank_account",billing_details:null!=f?f:void 0},searchSession:i,manualEntryOnly:r,paymentMethodOptions:null==a?void 0:a.paymentMethodOptions,amount:null==a?void 0:a.amount,onBehalfOf:null==a?void 0:a.onBehalfOf,hostedSurface:c,linkMode:s,hasExistingConsumerSession:u,sharedSessionContext:l,groupId:t.groupId,merchantToken:d,incentiveEligibilitySession:m,onEvent:_}).then((function(e){if(e.error)mr(e,t.controller,t.groupId);else if(e.linkAccountSession.paymentAccount){var n=e.linkAccountSession.paymentAccount;switch(n.object){case"financial_connections.account":case"linked_account":var r=n;t.controller.action.completeLinkAccountSessionElements({groupId:t.groupId,bankAccount:{sessionId:e.linkAccountSession.id,displayName:r.display_name,bankName:r.institution_name,last4:r.last4||"",type:"instant"}});break;case"financial_connections.bank_account":case void 0:var o=n;t.controller.action.completeLinkAccountSessionElements({groupId:t.groupId,bankAccount:{sessionId:e.linkAccountSession.id,displayName:"Bank account",bankName:o.bank_name,last4:o.last4,type:"manual"}});break;default:(0,de.Rz)(n)}}else t.controller.action.completeLinkAccountSessionElements({groupId:t.groupId,error:lr.zb});br(e,t,u,p)}))}({options:t,institutionId:n,manualEntryOnly:r,parsedClientSecret:o,searchSession:i,deferredIntentOptions:a,hostedSurface:c,linkMode:s,hasExistingConsumerSession:u,sharedSessionContext:l,merchantToken:d,shouldShareConsumerState:p,incentiveEligibilitySession:m,billingDetails:Sr(t.publicOptions),onEvent:f})},Er=function(e,t,n){var r=e.createHiddenFrame(ge.NC.GOOGLE_MAPS_APP,{apiKey:"AIzaSyCab6eIMNih34mQb3XI_QWXagmF2_rvQAg",elementMode:n});return r._on("get-google-maps-predictions",(function(e){!function(e,t){r.send({action:"get-google-maps-predictions",payload:{data:{search:e,countryRestrictions:t}}})}(e.search,e.countryRestrictions)})),r._on("get-google-maps-details",(function(e){!function(e){r.send({action:"get-google-maps-details",payload:{data:{placeId:e}}})}(e.placeId)})),r._on("google-maps-callback",(function(e){var n=e.event,r=e.message;switch(n){case"gotPredictions":!function(e){t.send({action:"google-maps-predictions",payload:{data:e}})}(r);break;case"gotDetails":!function(e){t.send({action:"google-maps-details",payload:{data:e}})}(r)}})),r},Ar=function(e){return(0,A.ei)(e,["defaultValues","paymentMethodOrder","allowedCardBrands","disallowedCardBrands","business","fields","readOnly","terms","wallets","layout","savePaymentMethod","allowedCountries","autocomplete","blockPoBox","defaultValues","contacts","fields","validation","mode","display","currency","countryCode","metaData","paymentMethodTypes","displayType","amount","_unmountAutomatically","__customCheckout"])},Pr=function(e){var t=e.controller,n=e.componentName,r=e.groupId,o=e.fonts,i=e.wait,a=e.publicOptions,c=e.controllingElement,s=e.controllingMode,u=e.mountedInternal,l=e.externalPaymentMethodTypes,d=e.locale,p=e.elementsInitSource,m={fonts:o,wait:i,rtl:ke(document.body),publicOptions:Ar(a),controllingElement:c,controllingMode:s,mountedInternal:u,externalPaymentMethodTypes:l,stripeAccount:t._stripeAccount,locale:d,elementsInitSource:p},f=Ce.P0[n];return"address"===n&&(f=Ce.P0[n][a.mode]),t.createElementFrame(f,n,r,m)},Mr=function(e){var t=e.props,n=e.componentName,r=e.controllingElement,o=e.controllingMode,i=e.ariaHidden,a=void 0===i?"false":i,c=t.component,u=t.elementTimings,l=t.getParent,d=t.options,p=Pr((0,s.Z)((0,s.Z)({},d),{},{componentName:n,controllingElement:r,controllingMode:o}));p.appendTo(c),p.updateStyle((0,s.Z)((0,s.Z)({},$n(n,!1)),{},{position:"absolute",zIndex:"1"})),p._iframe.setAttribute("aria-hidden",a),p._iframe.setAttribute("tabindex","-1");var m=(0,ze.$M)((function(){p.send({action:"stripe-timings",payload:{timestamps:{stripeJsLoad:u.stripeJsLoadTimestamp.getAsPosixTime(),stripeCreate:u.stripeCreateTimestamp.getAsPosixTime(),groupCreate:u.groupCreateTimestamp.getAsPosixTime(),create:u.createTimestamp.getAsPosixTime(),mount:(new mt.E).getAsPosixTime()}}})}));p._on("load",(function(){p.send({action:"stripe-user-mount",payload:{rtl:ke(l())}}),m()})),p._on("set_styles",(function(e){p.updateStyle(e)})),"achBankSearchResults"===n&&p._on("us-bank-account-v2-launch",(function(e){return Cr((0,s.Z)({options:d},e))}))},Rr=function(e){var t=e.controller,n=e.groupId,r=e.locale,o=e.type,i=e.isDarkMode,a=e.isRtl,c=e.purchaseProtectionsEnabled,s=e.businessName,u=e.selectedLast4,l=e.backupBrand,d=e.backupLast4,p=e.protectionType,m=e.allowedPaymentMethod,f=t.createLightboxFrame({type:ge.NC.LINK_INFO_MODAL,options:{locale:r,type:o,isDarkMode:i,isRtl:a,purchaseProtectionsEnabled:c,businessName:s,selectedLast4:u,backupBrand:l,backupLast4:d,protectionType:p,allowedPaymentMethod:m},groupId:n});f.show(),f.fadeInBackdrop();f._on("close",(function(){f.fadeOutBackdrop(),f.destroy(!0)}))},Ir=function(e){var t=e.controller,n=e.linkProtectionType,r=e.liveMode,o=e.readOnly,i=e.linkAccountSessionCreatorClientSecret,a=e.linkAccountSessionCreatorType,c=e.linkAccountSessionCreatorId,s=e.linkAccountSessionClientSecret,u=e.apiKey,l=e.stripeAccount,d=t.createLightboxFrame({type:ge.NC.LINK_PURCHASE_PROTECTION_MODAL,options:{linkProtectionType:n,liveMode:r,readOnly:o,linkAccountSessionCreatorClientSecret:i,linkAccountSessionCreatorType:a,linkAccountSessionCreatorId:c,linkAccountSessionClientSecret:s,apiKey:u,stripeAccount:l}});d.show(),d.fadeInBackdrop();d._on("close",(function(){d.fadeOutBackdrop(),d.backdropRunOnHide(),d.destroy(!0)}))},Nr=function(e){(0,un.a)().then((function(t){(0,t.mountModal)(e)}))},Tr=function(e){var t=e.unsafeOptions,n=e.openModalPayload,r=e.elementTimings,o=e.embeddedCheckoutMessenger,i=t.controller,a=t.groupId,c=t.wait,u=t.fonts,l=t.locale,d=i._apiKey,p=U.Yj.paymentMethodMessagingModal,m=(0,g.Gu)((0,g.mC)(In),{wait:c,rtl:ke(document.body),keyMode:(0,er.lO)(d),apiKey:d,stripeAccount:i._stripeAccount,fonts:u||[],componentName:p,publicOptions:n.publicOptions},"elements.create('".concat(p,"')")),f=m.value;if(m.warnings.forEach((function(e){i.warn(e)})),"object"==typeof o&&o&&o.hasOwnProperty("send"))o.send("mount-payment-method-messaging-info-modal-in-embedded-checkout",{type:ge.NC.PAYMENT_METHOD_MESSAGING_MODAL_ELEMENT,options:f});else{var _={stripeJsLoad:r.stripeJsLoadTimestamp.getAsPosixTime(),stripeCreate:r.stripeCreateTimestamp.getAsPosixTime(),groupCreate:r.groupCreateTimestamp.getAsPosixTime(),create:r.createTimestamp.getAsPosixTime(),mount:(new mt.E).getAsPosixTime()},h=i.createLightboxFrame({type:ge.NC.PAYMENT_METHOD_MESSAGING_MODAL_ELEMENT,options:(0,s.Z)((0,s.Z)({},f),{},{locale:null!=l?l:null}),groupId:a});0,h.show(),h.fadeInBackdrop();h._on("close",(function(){h.fadeOutBackdrop(),h.destroy(!0)})),h.send({action:"stripe-user-mount",payload:{rtl:ke(document.body)}}),h.send({action:"stripe-timings",payload:{timestamps:_}})}},Or=n(6835),xr=function(e){for(var t=Zr(),n=e,r=0,o=null;null!==(i=n)&&void 0!==i&&i.parentElement&&r<40;){var i,a,c=null===(a=(0,w.Dx)(n))||void 0===a?void 0:a.getPropertyValue("background-color");if(c&&c!==t){o=c;break}r+=1,n=n.parentElement}if(!o){var s,u,l=null===(s=(0,w.Dx)(document.body))||void 0===s?void 0:s.getPropertyValue("background-color"),d=null===(u=(0,w.Dx)(document.querySelector("html")))||void 0===u?void 0:u.getPropertyValue("background-color");o=l!==t?l||null:d!==t?d||null:Lr()}return{backgroundColor:o,textColor:jr(e),numberOfNodesTraversed:r}},jr=function(e){var t,n,r=document.createElement("p");r.style.display="none",e.appendChild(r);var o=null!==(t=null===(n=(0,w.Dx)(r))||void 0===n?void 0:n.getPropertyValue("color"))&&void 0!==t?t:null;return e.removeChild(r),o},Zr=function(){var e,t,n=document.createElement("div");n.style.display="none",document.body.appendChild(n);var r=null!==(e=null===(t=(0,w.Dx)(n))||void 0===t?void 0:t.getPropertyValue("background-color"))&&void 0!==e?e:null;return document.body.removeChild(n),r},Lr=function(){var e,t;if(!CSS.supports("color","Canvas"))return null;var n=document.createElement("div");n.style.display="none",n.style.backgroundColor="Canvas",document.body.appendChild(n);var r=null!==(e=null===(t=(0,w.Dx)(n))||void 0===t?void 0:t.getPropertyValue("background-color"))&&void 0!==e?e:null;return document.body.removeChild(n),r},Dr=n(6274).Promise,Br=["destruct"],qr=function(e,t){return function(e){try{var t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-1",t).then((function(e){var t=Array.from(new Uint8Array(e)).map((function(e){return e.toString(16).padStart(2,"0")})).join("");return parseInt(t.slice(0,4),16)/65536})).catch((function(){return null}))}catch(e){return new Dr((function(e){return e(null)}))}}(e).then((function(e){if(null===e)return"skipped_assignment";var n="treatment";return t.report("upe.prewarm_default_values.experiment_exposure",{variant:n}),n}))},Fr=function(e,t){return"object"==typeof e&&e&&e.hasOwnProperty(t)?e[t]:null},Ur=function(e,t){switch(t){case"payment":var n=function(e){if("object"==typeof e&&e&&e.hasOwnProperty("layout")){var t=e.layout;if("string"==typeof t){if(-1!==["auto","accordion","tabs"].indexOf(t))return{type:t,defaultCollapsed:!1,spacedAccordionItems:!1}}else{var n=t.type,r=t.defaultCollapsed;if("accordion"===n){var o=t.spacedAccordionItems;return t.visibleAccordionItemsCount,{type:n,defaultCollapsed:r,spacedAccordionItems:o}}if(-1!==["auto","tabs"].indexOf(n))return{type:n,defaultCollapsed:r}}}return{}}(e);return{payment:{layout:n}};case"address":return{address:{display:Fr(e,"display")}};default:return{}}},Gr=function(e){var t=e.component,r=e.listenerRegistry,o=e.elementTimings,i=e.getParent,a=e.emitEvent,c=e.options,u=e.selfDestruct,l=e.hasRegisteredListener,d=null,p=null,f=null,_=null,h=null,y=[],v=[],g=c.storeReadyPromise||Dr.resolve(),b=new Or.B,k=Pr(c),S=-1!==["auto","always"].indexOf(c.loader)&&rr(c.componentName,c.publicOptions),C=ir({controller:c.controller,elementFrame:k,component:t,componentName:c.componentName,loaderEnabled:S,elementOptions:Ur(c.publicOptions,c.componentName)}),A=function(e){if("object"==typeof e&&e&&e.hasOwnProperty("defaultValues")){var t,n,r=e.defaultValues,o=null!==(t=null==r||null===(n=r.billingDetails)||void 0===n?void 0:n.email)&&void 0!==t?t:null;return"string"==typeof o?o:null}return null}(c.publicOptions);if(A){var P=c.controller._stripeJsId;qr(P,c.controller).then((function(e){if("treatment"===e){var t,n,r,o=null,i=null,a=null;if("PAYMENT_INTENT"===(null===(t=c.clientSecret)||void 0===t?void 0:t.type))o=null===(r=c.clientSecret)||void 0===r?void 0:r.id;"payment"===(null===(n=c.deferredIntent)||void 0===n?void 0:n.mode)&&(i=c.deferredIntent.amount,a=c.deferredIntent.currency),c.controller.action.preloadConsumerLookup({email:{email:A,source:"default_value"},session_id:P,payment_intent:o,amount:i,currency:a,element:c.componentName,transaction_context:null})}}))}k._on("load-error",(function(e){var t=e.destruct,n=void 0===t||t,r=(0,m.Z)(e,Br);a("loaderror",{error:r}),n&&u()}));var M=Fr(c.publicOptions,"autocomplete");if(("shippingAddress"===c.componentName||"address"===c.componentName)&&(null==M?void 0:M.mode)!==wn.t0.disabled){var R=c.publicOptions.mode||wn.gC;k._on("setup-stripe-google-maps-autocomplete",(function(){!function(e,t,n){var r=Er(e,t,n);t._on("get-google-maps-predictions",(function(e){e.keyMode===wn.UH.stripe&&r._emit("get-google-maps-predictions",e)})),t._on("get-google-maps-details",(function(e){e.keyMode===wn.UH.stripe&&r._emit("get-google-maps-details",e)}))}(c.controller,k,R),Mr({props:e,componentName:"autocompleteSuggestions",controllingElement:"addressElement",controllingMode:R,ariaHidden:"true"})})),(null==M?void 0:M.mode)===wn.t0.google_maps_api&&(!function(e,t,n){e.action.initGoogleMapsService({apiKey:n}),t._on("get-google-maps-predictions",(function(n){n.keyMode===wn.UH.merchant&&e.action.getGoogleMapsPredictions({data:n,frameId:t.id})})),t._on("get-google-maps-details",(function(n){n.keyMode===wn.UH.merchant&&e.action.getGoogleMapsDetails({data:n,frameId:t.id})}))}(c.controller,k,M.apiKey),Mr({props:e,componentName:"autocompleteSuggestions",controllingElement:"addressElement",controllingMode:R}))}if("payment"===c.componentName){var I;if(c.publicOptions.parsedIntentSecret)g=c.controller.action.setupStoreForElementsGroup({req:{clientSecret:c.publicOptions.parsedIntentSecret,customerOptions:null,customerSessionClientSecret:null,currency:null,locale:c.locale,groupId:c.groupId,appearance:null!==(I=c.publicOptions.appearance)&&void 0!==I?I:c.appearance,loader:c.loader,externalPaymentMethodTypes:c.externalPaymentMethodTypes,mids:c.mids}});var N=null,T=function(){return _n().then((function(e){var t=e.mountModal,n=e.unmountModal;return y.push((function(){n()})),t}))};k._on("setup-afterpay-modal",(function(){N||(N=T())})),k._on("mount-afterpay-modal",(function(e){var t=e.currency,n=e.locale,o=e.modalTheme;N||(N=T()),N.then((function(e){e({controller:c.controller,listenerRegistry:r,currency:t,locale:n,modalTheme:o})}))}));var O=null,x=function(){return(0,un.a)().then((function(e){var t=e.mountModal,n=e.unmountModal;return y.push((function(){n()})),t}))};k._on("setup-affirm-modal",(function(){O||(O=x())})),k._on("affirm-modal-open",(function(e){var t=e.link;O||(O=x()),O.then((function(e){e({controller:c.controller,listenerRegistry:r,url:t})}))})),k._on("setup-us-bank-account",(function(){Mr({props:e,componentName:"achBankSearchResults",controllingElement:"paymentElement",ariaHidden:"true"})}));var j=null;!j&&tr({wallet:"applePay",options:c})&&(j=ur(c,r,k,"applePay")),k._on("update-apple-pay",(function(e){var t;null===(t=j)||void 0===t||t.pr.update(e)}));var Z=null;if(!Z&&tr({wallet:"googlePay",options:c})){var L=(Z=ur(c,r,k,"googlePay")).pr._backingLibraries.GOOGLE_PAY;L&&v.push(L._destroy)}if(k._on("update-google-pay",(function(e){var t;null===(t=Z)||void 0===t||t.pr.update(e)})),Z||j){var D,B,q;q=Z&&j?"both":Z?"googlePay":"applePay";var F=c.groupId;c.controller.action.fetchingWallets({groupId:F,isComplete:!1,wallet:q}),Dr.all([null===(D=Z)||void 0===D?void 0:D.canMakePaymentPromise,null===(B=j)||void 0===B?void 0:B.canMakePaymentPromise]).then((function(){c.controller.action.fetchingWallets({groupId:F,isComplete:!0,wallet:q})}))}k._on("link-launch",(function(e){var t=e.institutionId,n=e.parsedClientSecret,r=e.hasSession,o=e.sharedSessionContext,i=e.checkoutPriceAmount,a=e.email,s=e.linkMobilePhone,u=e.linkMobilePhoneCountry,l=e.instantDebitsIncentive,d=e.businessName,p=e.deferredIntentOptions,m=e.merchantToken,f=e.linkMode,_=e.useNewIncentiveApi;(0,ar.sx)(t,null==n?void 0:n.clientSecret,null==n?void 0:n.id,c.controller,o,c.groupId,i,a,s,u,l,d,p,r,dr.LJ.PaymentElement,m,f).then((function(e){var t=e.consumer;if(e.error)mr(e,c.controller,c.groupId);else if(t&&!r){var n;c.controller.action.loginWithConsumerInfo({consumerInfo:t,groupId:c.groupId});var o=null===(n=t.redacted_payment_details[0])||void 0===n?void 0:n.id;t.country&&"US"!==t.country?(c.controller.action.clearInstantDebitsIncentive({groupId:c.groupId}),c.controller.action.resetConsumerIncentiveOffer({groupId:c.groupId,paymentMethodType:"link_instant_debits"})):o&&hr(t.consumer_session)&&(_?c.controller.action.updateAvailableConsumerIncentives({paymentMethodType:"link_instant_debits",paymentDetailsId:o,groupId:c.groupId}):c.controller.action.confirmInstantDebitsIncentiveForPaymentDetails({bankPaymentDetailsId:o,groupId:c.groupId}))}else if(null!=t&&t.new_payment_details){var i=t.new_payment_details;c.controller.action.addPaymentDetails({paymentDetails:i,groupId:c.groupId})}else c.controller.action.completeLinkAccountSessionElements({groupId:c.groupId,error:lr.zb})}))})),k._on("us-bank-account-v2-launch",(function(e){Cr((0,s.Z)({options:c,onEvent:pr(c.publicOptions)},e))})),k._on("collect-link-prefill-data",(function(e){!function(e,t,n){try{Bt(n.source),e.send({action:"stripe-link-prefill-selectors",payload:Dt})}catch(e){t.report("prefill_data_selectors_error",{message:null==e?void 0:e.message,stack:null==e?void 0:e.stack,name:null==e?void 0:e.name})}}(k,c.controller,e)})),k._on("accumulate-link-prefill-data",(function(e){!function(e,t){try{Bt(t.source)}catch(t){e.report("prefill_data_selectors_error",{message:null==t?void 0:t.message,stack:null==t?void 0:t.stack,name:null==t?void 0:t.name})}}(c.controller,e)})),k._on("link-no-code-default-values-recall-selectors",(function(e){Ft(k,c.controller,e)})),k._once("link-modal-opened",(function(){y.push((function(){var e;null===(e=c.controller._linkModal)||void 0===e||e.frame.send({action:"stripe-link-modal-abort",payload:null})}))}))}if(k._on("mount-link-info-modal",(function(e){Rr((0,s.Z)({controller:c.controller,groupId:c.groupId},e))})),k._on("mount-link-purchase-protection-detail-modal",(function(e){Ir((0,s.Z)({controller:c.controller},e))})),k._on("mount-payment-method-messaging-info-modal",(function(e){!function(e){var t=e.openModalPayload,n=e.unsafeOptions,r=e.elementTimings,o=e.embeddedCheckoutMessenger,i=n.controller,a=t.type;switch(a){case"affirm_modal":if("object"==typeof o&&o&&o.hasOwnProperty("send")){o.send("mount-affirm-modal-in-embedded-checkout",{url:t.url});break}Nr({url:t.url,listenerRegistry:i._listenerRegistry,controller:i});break;case"payment_method_messaging_modal":Tr({openModalPayload:t,unsafeOptions:n,elementTimings:r,embeddedCheckoutMessenger:o});break;default:(0,de.Rz)(a)}}({openModalPayload:e,unsafeOptions:c,elementTimings:o,embeddedCheckoutMessenger:function(e){if("object"==typeof e&&e&&e.hasOwnProperty("_internalEmbeddedCheckoutMessenger"))return e._internalEmbeddedCheckoutMessenger}(c.publicOptions)})})),k._on("payment_method_messaging.unmount",(function(){H(),k.destroy()})),"payment"===c.componentName&&(0,E.uN)(c.betas,"payment_element_byof_beta_1")){var U=!1,G=[],z=function(e){U||G.push(e)};k._on("cpm-embed-init",(function(e){z({type:"cpm-embed-init",payload:e}),U||n.e(671).then(n.bind(n,1086)).then((function(e){var t=e.CpmEmbedManager;if(!U){var n=new t(k,c.customPaymentMethods,G);n.init(),U=!0,y.push((function(){n.destroyEntries()}))}}))})),k._on("cpm-embed-cleanup",(function(e){z({type:"cpm-embed-cleanup",payload:e})})),k._on("cpm-embed-position",(function(e){z({type:"cpm-embed-position",payload:e})})),k._on("cpm-embed-visibility",(function(e){z({type:"cpm-embed-visibility",payload:e})})),k._on("cpm-embed-focus-to-outer",(function(e){z({type:"cpm-embed-focus-to-outer",payload:e})}))}(0,w.yq)(t,(0,s.Z)((0,s.Z)({},we.KC),{},{margin:"-4px 0",transition:"height .35s ease"})),k.appendTo(t),k.updateStyle($n(c.componentName,S)),g.then((function(){_=new mt.E})),k._on("load",(function(){p=new mt.E,k.send({action:"stripe-user-mount",payload:{rtl:ke(i()),merchantPageProperties:xr(t)}})})),Ce.Nb.forEach((function(e){k._on(e,(function(t){return a(e,t)}))})),k._on("set_styles",(function(e){k.updateStyle(e),a("set_styles",e)})),k._on("redirectfocus",(function(e){var n,r=e.focusDirection;null===(n=(0,w.dh)(t,r))||void 0===n||n.focus()})),k._on("submit",(function(){a("submit");var e=t.closest("form");if(e){var n=['button[type="submit"]',"button:not([type])",'input[type="submit"]','input[type="image"]'].map((function(t){return e.querySelector(t)})).filter((function(e){return!!e}))[0];n&&n.click()}}));var V=function(){Se(),k.focus(),k.send({action:"stripe-user-focus",payload:{}})};k._on("manual_focus_frame",(function(){V()}));var K=(0,ze.$M)((function(){var e,t,n,r,i;k.send({action:"stripe-timings",payload:{timestamps:{stripeJsLoad:o.stripeJsLoadTimestamp.getAsPosixTime(),stripeCreate:o.stripeCreateTimestamp.getAsPosixTime(),groupCreate:o.groupCreateTimestamp.getAsPosixTime(),create:o.createTimestamp.getAsPosixTime(),store:null===(e=_)||void 0===e?void 0:e.getAsPosixTime(),mount:null===(t=d)||void 0===t?void 0:t.getAsPosixTime(),load:null===(n=p)||void 0===n?void 0:n.getAsPosixTime(),loaderStart:null===(r=f)||void 0===r?void 0:r.getAsPosixTime(),loaderEnabled:S,parentVisible:null===(i=h)||void 0===i?void 0:i.getAsPosixTime()}}})}));k._on("ready",(function(e){C.hide(),f||a("loaderstart"),b.promise.then((function(){K(),c.controller.report("parent_visible",{element:c.componentName})})),a("ready",e)})),k._on("parent_visible_fallback",(function(){b.resolve()})),k._on("has_registered_listener",(function(e){var t=e.eventName;k.send({action:"stripe-has-registered-listener",payload:!!l(t)})}));var H=function(){for(c.controller.action.elementUnmounted({elementName:c.componentName,groupId:c.groupId,frameId:k.id,mode:"address"===c.componentName&&c.publicOptions.mode});y.length;){var e;null===(e=y.pop())||void 0===e||e()}k.unmount()};return{update:function(e){e.appearance&&c.controller.action.updateElementsOptions({locale:void 0,appearance:e.appearance,groupId:c.groupId}),k.update(e)},focus:V,blur:function(){k.blur()},clear:function(){k.clear()},mount:function(){d=new mt.E;var e=i();if(e){S?(C.show().then((function(e){null!=e&&e.err||(f=new mt.E,a("loaderstart"))})),y.push((function(){C.unmount()}))):(f=new mt.E,a("loaderstart"));var t=(0,w.d3)(e,(function(){k.send({action:"stripe-parent-visible",payload:null}),h=new mt.E,b.resolve()}));y.push(t),(0,w.mb)(e,[[Ce.et,!0]]),y.push((function(){(0,w.mb)(e,[[Ce.et,!1]])}))}},unmount:H,destroy:function(){for(;v.length;){var e;null===(e=v.pop())||void 0===e||e()}},collapse:function(){k.collapse()},getValue:function(){return k.getValue(),new Dr((function(e){k._on("get-value-response",(function t(n){return k._off("get-value-response",t),e(n)}))}))},_frame:k}},zr=["options"],Vr=["controller","componentName","publicOptions"],Kr=["update"],Hr=function(e){var t=e.options,n=(0,m.Z)(e,zr),r=t.controller,o=t.componentName,i=t.publicOptions,a=(0,m.Z)(t,Vr),c=function(e){switch(e){case"linkAuthentication":case"payment":case"shippingAddress":case"address":case"autocompleteSuggestions":case"achBankSearchResults":case"paymentMethodMessaging":case"currencySelector":return e;default:throw new Error("Unexpected element type for implementation")}}(o);if(["address","shippingAddress"].indexOf(c)>-1&&r.keyMode()===er.Kl.unknown)throw new P.No("It looks like you're using an older Stripe key. The Address Element is only available for use with a modern API key, which is prefixed with 'pk_live_' or 'pk_test_'.\n You can roll your publishable key here: https://dashboard.stripe.com/account/apikeys");var u=Jn(c,i||{},"elements.create('".concat(c,"')"),!1,t.betas,t.elementsInitSource);u.warnings.forEach((function(e){return r.warn(e)}));var l=["payment","linkAuthentication"].indexOf(o)>-1,d="payment"===t.componentName&&(u.value.parsedIntentSecret||null);if(l&&!t.clientSecret&&!t.deferredIntent&&!d)throw new P.No("In order to create a ".concat(t.componentName,' element, you must pass a clientSecret or mode when creating the Elements group.\n\n e.g. stripe.elements({clientSecret: "{{CLIENT_SECRET}}"})'));var p=Gr((0,s.Z)((0,s.Z)({},n),{},{options:(0,s.Z)((0,s.Z)({},a),{},{controller:r,componentName:c,publicOptions:u.value})})),f=p.update,_=(0,m.Z)(p,Kr);return(0,s.Z)({update:function(e){var n=Jn(c,e||{},"".concat(c,".update()"),!0,t.betas,t.elementsInitSource);n.warnings.forEach((function(e){return r.warn(e)})),f(n.value)}},_)},Yr=function(e){return(0,E.uN)(e,"ume_beta_1")},Wr=function(e){if(Yr(e.options.betas)&&e.options.controller.warn("You're using a beta version of the Payment Method Messaging Element that is no longer supported. Learn how to upgrade to the new version: https://docs.stripe.com/payments/payment-method-messaging"),function(e){if(!Yr(e.betas))return!1;var t=e.controller._apiKey;return!t||0===t.toLowerCase().indexOf("pk_xx")}(e.options))return function(e){return e.options.controller.report("payment_method_messaging.noop_legacy_implementation",{options:{componentName:e.options.componentName},betas:e.options.betas}),{mount:function(){},unmount:function(){},update:function(){},focus:function(){},blur:function(){},clear:function(){}}}(e);var t=Hr(e),n=t._frame;return n&&n._on("click",(function(){e.emitEvent("click")})),t},Xr=n(3514),Qr=n(925),Jr=n(2543),$r=n(6274).Promise,eo=function(e){var t=e.controller,n=e.eventName,r=e.time,o=e.timeLabel,i=e.reject,a=e.rejectFunctionName,c=void 0===a?"reject":a,s=e.resolve,u=e.betas,l=null,d=!1,p=!1;return l=setTimeout((function(){p=!0;var e="Timed out waiting for a call to resolve() or ".concat(c,'(). If you listen to the "').concat(n,'" event, then you must call event.resolve() or event.').concat(c,'() in the "').concat(n,'" handler within ').concat(o,".");(0,E.uN)(u,E.M4.ece_temp_prevent_default_beta_1)||"preventDefault"!==c||(e='Timed out waiting for a call to resolve(). If you listen to the "'.concat(n,'" event, then you must call event.resolve in the "').concat(n,'" handler within ').concat(o,".")),t.warn(e),i("Stripe.js: Timeout hit")}),r),{resolve:function(e){if(p)t.warn("Call to resolve() was ignored because it has already timed out. Please ensure that resolve is called within ".concat(o,"."));else{if(d){var n="Call to resolve() was ignored because resolve or ".concat(c," has already been called. Do not call resolve or ").concat(c," more than once.");return(0,E.uN)(u,E.M4.ece_temp_prevent_default_beta_1)||"preventDefault"!==c||(n="Call to resolve() was ignored because resolve has already been called. Do not call resolve more than once."),void t.warn(n)}l&&clearTimeout(l),d=!0,s(e)}},reject:function(){p?t.warn("Call to ".concat(c,"() was ignored because it has already timed out. Please ensure that ").concat(c," is called within ").concat(o,".")):d?t.warn("Call to ".concat(c,"() was ignored because resolve or ").concat(c," has already been called. Do not call resolve or ").concat(c," more than once.")):(l&&clearTimeout(l),d=!0,i("Stripe.js: Called by merchant"))}}},to=function(){throw new P.No("You cannot update the currency if the payment interface is already open.")},no=function(e,t,n){return e(1===n?"ece.".concat(t):"ece.".concat(t,"s"))},ro=function(e){return"apple_pay_inner"===e||"apple_pay_outer"===e?"apple_pay":e},oo=function(e){var t=e.betas,n=e.publicOptions,r=e.isCreate,o=void 0!==r&&r;return!!n&&"object"==typeof n&&(0,E.uN)(t,"ece_temp_click_shape_changes_beta_1")&&("allowedShippingCountries"in n||"billingAddressRequired"in n||"phoneNumberRequired"in n||"shippingAddressRequired"in n||"shippingRates"in n||"emailRequired"in n||o&&("applePay"in n||"lineItems"in n||"business"in n))},io=n(2920),ao=n(7703),co=n(3234),so=n(7934),uo=0,lo=1,po=function(e){if(!e)return null;var t=[e.givenName,e.familyName].filter((function(e){return e&&"string"==typeof e})).join(" ");return""===t?null:t},mo=function(e,t,n,r){return{amount:(0,fr.Fe)(e,n,"apple"),label:t,type:r?"pending":"final"}},fo=function(e){var t=e.administrativeArea,n=e.countryCode,r=e.locality;return{city:null!=r?r:"",state:t||"",postal_code:e.postalCode||"",country:(null==n?void 0:n.toUpperCase())||""}},_o=function(e){if(e){var t=e.addressLines;return(0,s.Z)({line1:t&&Array.isArray(t)?t[0]:"",line2:t&&Array.isArray(t)?t.slice(1).join(", "):null},fo(e))}},ho=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5?arguments[5]:void 0,a=!1,c=(0,so.RO)(e,a,r,o,n,i);return c.push("maestro"),(0,E.uN)(t,"cup_apple_pay_beta_1")&&c.push("chinaUnionPay"),(0,E.uN)(t,"interac_apple_pay_beta_1")&&"cad"===n&&c.unshift("interac"),(0,E.uN)(t,"cartes_bancaires_apple_pay_beta_1")&&"eur"===n&&-1===c.indexOf("cartesBancaires")&&c.unshift("cartesBancaires"),c.filter((function(e){return null!==e}))},yo=function(e,t,n){var r=["supports3DS"];return null!=e&&e.cardFunding&&r.push(e.cardFunding),((0,E.uN)(t,"cup_apple_pay_beta_1")||(0,E.uN)(t,"interac_apple_pay_beta_1")&&"cad"===n)&&r.push("supportsEMV"),r},vo=function(e,t,n){if(e){return(0,ao.Fq)(e,(function(){t.report("ece.".concat(n,".missing_country_code"),{element:U.Yj.expressCheckout,country:e.country})}))}},go=n(6274).Promise,bo=function(e,t,n){t.report("ece.apple_pay_outer.session_creation_failed",{element:U.Yj.expressCheckout,error:n}),e.abort();var r=n.message;"string"==typeof r&&t.warn(r)},wo=function(e,t,n){var r=t.amount,o=t.deliveryEstimate,i=t.displayName,a=t.id;return function(e,t){if("string"==typeof e)return $r.resolve(e);var n=e.minimum,r=e.maximum;if(!n&&!r)return $r.resolve("");if(n&&!r){var o=n.value,i=n.unit;return no(t,i,o).then((function(e){return t("ece.delivery_in",{value:o.toString(),unit:e||""})}))}if(!n&&r){var a=r.value,c=r.unit;return no(t,c,a).then((function(e){return t("ece.delivery_within",{value:a.toString(),unit:e||""})}))}var s=n,u=s.unit,l=s.value,d=r,p=d.unit,m=d.value;return u===p?no(t,p,m).then((function(e){return t("ece.delivery_in_to",{minValue:l.toString(),maxValue:m.toString(),unit:e||""})})):no(t,u,l).then((function(e){return no(t,p,m).then((function(n){return t("ece.delivery_in_to_units",{minValue:l.toString(),minUnit:e||"",maxValue:m.toString(),maxUnit:n||""})}))}))}(o||{},e).then((function(e){return{label:i,detail:e||"",amount:(0,fr.Fe)(r,n,"apple"),identifier:a}}))},ko=function(e,t){if(t)return Object.values(t).every((function(e){return!e}))?void 0:{name:e,address:t}},So=function(e){var t=e.controller,n=e.eventHandlers,r=e.groupId,o=e.listenerRegistry,i=e.betas,a=e.blockedCardBrands,c=e.elementsInitSource,l=e.minApplePayVersion,d={isPaymentSheetShowing:!1,total:0,businessName:"",currency:"usd",pending:!1,shippingRates:void 0,selectedShippingRate:void 0,allowedShippingCountries:void 0,lineItems:void 0,privateSession:void 0,isUsingRecurringPaymentRequest:!1,isUsingAutomaticReloadPaymentRequest:!1,isUsingDeferredPaymentRequest:!1,recurringPaymentRequestBillingAgreement:void 0,automaticReloadPaymentRequestBillingAgreement:void 0,applePayTokenRevokeWebhookUrl:void 0},p=function(){d.isPaymentSheetShowing=!1,d.privateSession=void 0,t.action.expressCheckoutSheetClosed({groupId:r}),t.action.expressCheckoutConfirmEnd({groupId:r})};if("checkout"!==c&&"payment_link"!==c&&l)throw new P.No("The Apple Pay version cannot be customized.");var m="checkout"!==c&&"payment_link"!==c||!l?4:l,f=function(e,i){o.addEventListener(e,"validatemerchant",(0,ce.TC)(function(e){var t=e.privateSession,n=e.controller,r=e.displayName,o=e.isPaymentSheetShowing;return function(e){n.action.createApplePaySession({data:{validation_url:e.validationURL,domain_name:(0,co.A)(n.report),display_name:r},usesExpressCheckoutElement:!0}).then((function(e){switch(e.type){case"object":if(!o())return;t.completeMerchantValidation(JSON.parse(e.object.session));break;case"error":bo(t,n,e.error);break;default:(0,de.Rz)(e)}}),(function(e){return bo(t,n,e)}))}}({privateSession:e,controller:t,displayName:i,isPaymentSheetShowing:function(){return d.isPaymentSheetShowing}}))),o.addEventListener(e,"cancel",(0,ce.TC)((function(){p(),n.cancel({paymentMethodType:"apple_pay_outer"})})));var a=function(){var e=d.total,t=d.businessName,n=d.currency,r=d.pending;return mo(e,t,n,r)},u=function(e,n){var r;return d.total=null!==(r=e.amount)&&void 0!==r?r:d.total,function(e){var n=e.lineItems,r=e.shippingRates,o=e.applePay,i=d.currency,a=d.pending,c=d.isUsingRecurringPaymentRequest,u=d.isUsingAutomaticReloadPaymentRequest,l=d.isUsingDeferredPaymentRequest,p=d.recurringPaymentRequestBillingAgreement,m=d.automaticReloadPaymentRequestBillingAgreement;if(!c&&null!=o&&o.recurringPaymentRequest)throw new P.No("You tried to update an applePay.recurringPaymentRequest without creating the object first. You must provide an applePay.recurringPaymentRequest object while resolving the 'click' event in order to update it later.");if(!u&&null!=o&&o.automaticReloadPaymentRequest)throw new P.No("You tried to update an applePay.automaticReloadPaymentRequest without creating the object first. You must provide an applePay.automaticReloadPaymentRequest object while resolving the 'click' event in order to update it later.");if(!l&&null!=o&&o.deferredPaymentRequest)throw new P.No("You tried to update an applePay.deferredPaymentRequest without creating the object first. You must provide an applePay.deferredPaymentRequest object while resolving the 'click' event in order to update it later.");var f=null==n?void 0:n.map((function(e){var t=e.amount,n=e.name;return mo(t,n,i,a)})),_=(0,A.Xy)(r,d.shippingRates)||null==r?void 0:r.map((function(e){return wo((function(e,n){return t.action.unsafeLocalizeString({message:e,data:n})}),e,i)}));return go.all(null!=_?_:[]).then((function(e){var n=(0,ao.jQ)({recurringPaymentRequest:null!=o&&o.recurringPaymentRequest?(0,s.Z)((0,s.Z)({},null==o?void 0:o.recurringPaymentRequest),{},{billingAgreement:p}):void 0,currency:i,pending:a,warn:t.warn}),r=(0,ao.IK)({automaticReloadPaymentRequest:null!=o&&o.automaticReloadPaymentRequest?(0,s.Z)((0,s.Z)({},null==o?void 0:o.automaticReloadPaymentRequest),{},{billingAgreement:m}):void 0,currency:i,pending:a,warn:t.warn}),c=(0,ao.sI)({deferredPaymentRequest:null==o?void 0:o.deferredPaymentRequest,currency:i,pending:a,warn:t.warn});return{newLineItems:f,newShippingMethods:e.length?e:void 0,newRecurringPaymentRequest:n,newAutomaticReloadPaymentRequest:r,newDeferredPaymentRequest:c}}))}(e).then((function(t){var r=t.newLineItems,o=t.newShippingMethods,i=t.newRecurringPaymentRequest,c=t.newDeferredPaymentRequest,s=t.newAutomaticReloadPaymentRequest,u=a();return d.lineItems=r||d.lineItems,d.shippingRates=e.shippingRates||d.shippingRates,e.shippingRates&&!(0,A.Xy)(e.shippingRates,d.shippingRates)?d.selectedShippingRate=e.shippingRates[0].id:n&&(d.selectedShippingRate=n.identifier),i?i.tokenNotificationURL=d.applePayTokenRevokeWebhookUrl:s?s.tokenNotificationURL=d.applePayTokenRevokeWebhookUrl:c&&(c.tokenNotificationURL=d.applePayTokenRevokeWebhookUrl),{newLineItems:d.lineItems,newShippingMethods:o,newTotal:u,newRecurringPaymentRequest:i,newAutomaticReloadPaymentRequest:s,newDeferredPaymentRequest:c}}))};o.addEventListener(e,"shippingcontactselected",(0,ce.TC)((function(t){var r=t.shippingContact,o=fo(r);if(d.allowedShippingCountries&&d.allowedShippingCountries.length&&-1===d.allowedShippingCountries.indexOf(o.country)){var i=a(),c=d.lineItems,s=new window.ApplePayError("shippingContactInvalid","country","We can not ship to this country.");e.completeShippingContactSelection({newTotal:i,newLineItems:c,errors:[s]})}else{var l={paymentMethodType:"apple_pay_outer",name:"",address:o,resolve:function(t){u(t).then((function(t){e.completeShippingContactSelection(t)}))},reject:function(){var t=a(),n=d.lineItems,r=new window.ApplePayError("shippingContactInvalid","postalAddress");e.completeShippingContactSelection({newTotal:t,newLineItems:n,errors:[r]})}};n.shippingAddressChange(l)}})));o.addEventListener(e,"shippingmethodselected",(0,ce.TC)((function(r){var o=r.shippingMethod,i=(0,A.sE)(d.shippingRates||[],(function(e){return e.id===o.identifier}));if(i){var c={paymentMethodType:"apple_pay_outer",shippingRate:i,resolve:function(t){u(t,o).then((function(t){return e.completeShippingMethodSelection(t)}))},reject:function(){var t=a();e.completeShippingMethodSelection(lo,t,[]),p(),n.cancel({paymentMethodType:"apple_pay_outer"})}};n.shippingRateChange(c)}else{t.report("ece.apple_pay_outer.unexpected_shipping_rate",{element:U.Yj.expressCheckout});var s={newTotal:a()};e.completeShippingMethodSelection(s)}})));o.addEventListener(e,"paymentauthorized",(0,ce.TC)((function(o){var i=o.payment;t.action.expressCheckoutConfirmStart({groupId:r,paymentMethodType:"apple_pay_outer"}).then((function(){return t.action.tokenizeWithData({type:"apple_pay",elementName:U.Yj.expressCheckout,tokenData:(0,s.Z)((0,s.Z)({},i),{},{billingContact:vo(i.billingContact,t,"apple_pay_outer")}),mids:t.mids()})})).then((function(o){var a;if("error"===o.type){var c=new window.ApplePayError("unknown");return e.completePayment({status:lo,errors:[c]}),t.report("ece.apple_pay_outer.create_token_failed",{element:U.Yj.expressCheckout,error:o.error}),void t.action.expressCheckoutConfirmEnd({groupId:r})}var s=vo(i.shippingContact,t,"apple_pay_outer"),u=function(e){if(!e)return{};var t=e.addressLines,n=e.locality,r=e.administrativeArea,o=e.postalCode,i=e.countryCode;return{line1:t&&Array.isArray(t)?t[0]:void 0,line2:t&&Array.isArray(t)?t.slice(1).join(", "):void 0,city:n,state:r,postal_code:o,country:i}}(s),l=_o(i.shippingContact),p=vo(i.billingContact,t,"apple_pay_outer"),m=_o(i.billingContact),f=m||null!=s&&s.emailAddress||null!=s&&s.phoneNumber?{name:po(p)||void 0,email:null==s?void 0:s.emailAddress,phone:null==s?void 0:s.phoneNumber,address:m}:void 0,_=d.selectedShippingRate?(0,A.sE)(d.shippingRates||[],(function(e){return e.id===d.selectedShippingRate})):void 0,h={paymentMethodType:"apple_pay_outer",paymentFailed:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=n.reason,i=void 0===o?"fail":o,a="invalid_shipping_address"===i?new window.ApplePayError("shippingContactInvalid","addressLines"):new window.ApplePayError("unknown");e.completePayment({status:lo,errors:[a]}),t.action.expressCheckoutConfirmEnd({groupId:r})},billingDetails:f,shippingAddress:ko(null!==(a=po(s))&&void 0!==a?a:"",l),shippingRate:_};t.action.setExpressCheckoutConfirmData({groupId:r,shippingContact:{name:po(s),address:u,phone:null},paymentMethodData:{type:C.GS.card,card:{token:o.object.id},billing_details:{email:null==s?void 0:s.emailAddress,phone:null==s?void 0:s.phoneNumber}}}).then((function(){return n.confirm(h)}))}))})));"custom_checkout"!==c&&"checkout"!==c&&"payment_link"!==c||o.addEventListener(e,"paymentmethodselected",(0,ce.TC)((function(t){var r=t.paymentMethod,o={paymentMethodType:"apple_pay_outer",name:"",address:fo(r.billingContact||Qr.zc),resolve:function(t){u(t).then((function(t){return e.completePaymentMethodSelection(t)}))},reject:function(){var t=a(),n=d.lineItems,r=new window.ApplePayError("billingContactInvalid","postalAddress");e.completePaymentMethodSelection({newTotal:t,newLineItems:n,errors:[r]})}};n.__privateDoNotUseBillingAddressChange(o)})));"checkout"!==c&&"payment_link"!==c||o.addEventListener(e,"couponcodechanged",(0,ce.TC)((function(t){var r={paymentMethodType:"apple_pay_outer",couponCode:t.couponCode,changeFailed:function(t){var n=new window.ApplePayError("couponCodeInvalid");u(t).then((function(t){return e.completeCouponCodeChange({newTotal:t.newTotal,newLineItems:t.newLineItems,errors:[n]})}))},resolve:function(t){u(t).then((function(t){return e.completeCouponCodeChange(t)}))},reject:function(){var t=a(),n=d.lineItems,r=new window.ApplePayError("couponCodeInvalid");e.completeCouponCodeChange({newTotal:t,newLineItems:n,errors:[r]})}};n.__privateDoNotUseCouponCodeChange(r)})))};return{shouldShowButton:function(e){return t.action.shouldShowEceButton({groupId:r,shouldShowButton:e,button:"applePayOuter"})},clickHandler:function(e,n){var o,c,l,p,_=window.ApplePaySession;if(!_)return t.warn("User clicked on the Apple Pay button, but window.ApplePaySession does not exist."),void t.report("ece.apple_pay_outer.missing_window_session",{element:U.Yj.expressCheckout});var h=(null===(o=n.business)||void 0===o?void 0:o.name)||e.businessName,y=e.currency,v=e.applePayLaterDisabled,g=function(e,t){var n,r,o;return(0!==e.amount||0!==(null===(n=t.applePay)||void 0===n||null===(r=n.recurringPaymentRequest)||void 0===r||null===(o=r.trialBilling)||void 0===o?void 0:o.amount))&&e.pending}(e,n);d.total=e.amount,d.businessName=h,d.currency=y,d.pending=g,d.shippingRates=n.shippingRates,d.selectedShippingRate=null===(c=n.shippingRates)||void 0===c||null===(l=c[0])||void 0===l?void 0:l.id,d.allowedShippingCountries=n.allowedShippingCountries,d.lineItems=null===(p=n.lineItems)||void 0===p?void 0:p.map((function(e){var t=e.amount,n=e.name;return mo(t,n,y,g)}));var b=(0,s.Z)((0,s.Z)((0,s.Z)({},e),n),{},{pending:g,businessName:h,warn:t.warn,localizeString:function(e,n){return t.action.unsafeLocalizeString({message:e,data:n})},betas:i,blockedCardBrands:a,account:t.getCredentials().stripeAccount});v&&(b.applePay=(0,s.Z)((0,s.Z)({},b.applePay),{},{applePayLaterAvailability:Re.yv.unavailableItemIneligible})),function(e){var t=e.amount,n=e.billingAddressRequired,r=e.businessName,o=e.merchantCountry,i=e.currency,a=e.emailRequired,c=e.lineItems,l=e.pending,d=e.phoneNumberRequired,p=e.shippingAddressRequired,m=e.shippingRates,f=e.applePay,_=e.defaultBillingAgreement,h=e.applePayTokenRevokeWebhookUrl,y=e.warn,v=e.localizeString,g=e.betas,b=e.account,w=e.blockedCardBrands,k=e.capabilityEnabledCardNetworks,S=e.cartesBancairesEnabledForApplePay,C=[].concat((0,u.Z)(a?["email"]:[]),(0,u.Z)(d?["phone"]:[]),(0,u.Z)(p?["postalAddress"]:[])),E=n?["postalAddress"]:[],A=null==m?void 0:m.map((function(e){return wo(v,e,i)})),P=h+function(e,t){return"merchant.".concat((t?[e,t]:[e]).join("."),".stripe")}(window.location.hostname,b);return go.all(null!=A?A:[]).then((function(e){var n=null==c?void 0:c.map((function(e){var t=e.amount,n=e.name;return mo(t,n,i,l)})),a=null!=f?f:{},u=a.recurringPaymentRequest,d=a.deferredPaymentRequest,p=a.automaticReloadPaymentRequest,m=a.supportsCouponCode,h=a.couponCode;return(0,s.Z)({countryCode:o,currencyCode:i.toUpperCase(),lineItems:n,merchantCapabilities:yo(f,g,i),requiredBillingContactFields:E,requiredShippingContactFields:C,shippingMethods:e.length?e:void 0,supportedNetworks:ho(o,g,i,w,k,S),total:mo(t,r,i,l),recurringPaymentRequest:(0,ao.jQ)({recurringPaymentRequest:u,currency:i,pending:l,defaultBillingAgreement:_,applePayTokenRevokeWebhookUrl:P,warn:y}),deferredPaymentRequest:(0,ao.sI)({deferredPaymentRequest:d,currency:i,pending:l,defaultBillingAgreement:_,applePayTokenRevokeWebhookUrl:P,warn:y}),automaticReloadPaymentRequest:(0,ao.IK)({automaticReloadPaymentRequest:p,currency:i,pending:l,defaultBillingAgreement:_,applePayTokenRevokeWebhookUrl:P,warn:y}),applePayLaterAvailability:"auto"===(null==f?void 0:f.applePayLaterAvailability)?"available":null==f?void 0:f.applePayLaterAvailability,supportsCouponCode:m,couponCode:h},null==f?void 0:f.paymentRequestPassthrough)}))}(b).then((function(e){var n,o,i,a,c,s,u;d.isUsingRecurringPaymentRequest=!!e.recurringPaymentRequest,d.recurringPaymentRequestBillingAgreement=null===(n=e.recurringPaymentRequest)||void 0===n?void 0:n.billingAgreement,d.isUsingAutomaticReloadPaymentRequest=!!e.automaticReloadPaymentRequest,d.automaticReloadPaymentRequestBillingAgreement=null===(o=e.automaticReloadPaymentRequest)||void 0===o?void 0:o.billingAgreement,d.isUsingDeferredPaymentRequest=!!e.deferredPaymentRequest;var l=new _(m,e);d.applePayTokenRevokeWebhookUrl=null!==(i=null!==(a=null===(c=e.recurringPaymentRequest)||void 0===c?void 0:c.tokenNotificationURL)&&void 0!==a?a:null===(s=e.deferredPaymentRequest)||void 0===s?void 0:s.tokenNotificationURL)&&void 0!==i?i:null===(u=e.automaticReloadPaymentRequest)||void 0===u?void 0:u.tokenNotificationURL,d.privateSession=l,f(l,h),l.begin(),d.isPaymentSheetShowing=!0,t.action.expressCheckoutSheetOpened({groupId:r,paymentMethodType:"apple_pay_outer"}),t.report("ece.sheet_visible",{element:U.Yj.expressCheckout,payment_method:"apple_pay_outer"})}))},canMakePayments:function(e,n){var r=window.location.hostname,o=t.getCredentials().stripeAccount||n,i=t.keyMode()===er.Kl.test;return(0,io.Qt)(r,o,i,t.report,m,e)},completePayment:function(e){if(e){var n,o=new window.ApplePayError("unknown");null===(n=d.privateSession)||void 0===n||n.completePayment({status:lo,errors:[o]}),t.action.expressCheckoutConfirmEnd({groupId:r})}else{var i;null===(i=d.privateSession)||void 0===i||i.completePayment({status:uo}),p()}}}},Co=function(e){return e.reduce((function(e,t){return e.push.apply(e,(0,u.Z)(gn.L$[t])),e}),[])},Eo=function(e,t){if(null!=e&&e.length){var n=Co(e);return(0,u.Z)(U.iw).filter((function(e){return-1===n.indexOf(e)}))}return null!=t&&t.length?Co(t):[]},Ao=n(5490),Po=n(4417),Mo=n(6274).Promise,Ro=function(e){var t,n,r=e.component,o=e.elementTimings,i=e.getParent,a=e.emitEvent,c=e.options,u=e.selfDestruct,l=e.hasRegisteredListener,d=e.listenerRegistry,p=c.controller,m=c.groupId,f=c.publicOptions,_=c.betas,h=c.allowedCardBrands,y=c.disallowedCardBrands,v=null,g={runOnUnmount:[],updateRequest:{isCalled:!1,inMerchantEventHandler:!1},usesNewIntegrationShape:oo({betas:_,publicOptions:f,isCreate:!0})},b=null===(t=f.__checkout)||void 0===t?void 0:t.embeddedCheckoutMessengerSend,k=function(e){var t=e.controller,n=e.componentName,r=e.groupId,o=e.fonts,i=e.wait,a=e.publicOptions,c=e.controllingElement,s=e.elementsInitSource,u={fonts:o,wait:i,rtl:ke(document.body),publicOptions:a,controllingElement:c,elementsInitSource:s};return t.createElementFrame(ge.NC.EXPRESS_CHECKOUT_ELEMENT,n,r,u)}(c);(0,w.yq)(r,(0,s.Z)((0,s.Z)({},Qr.KC),{},{margin:"-4px 0",transition:"height .35s ease"})),k.appendTo(r),k.updateStyle(Qr.CF),k._on("set_styles",(function(e){k.updateStyle(e)})),k._on("redirectfocus",(function(e){var t,n=e.focusDirection;null===(t=(0,w.dh)(r,n))||void 0===t||t.focus()}));var S=(0,ze.$M)((function(){k.send({action:"stripe-timings",payload:{timestamps:{stripeJsLoad:o.stripeJsLoadTimestamp.getAsPosixTime(),stripeCreate:o.stripeCreateTimestamp.getAsPosixTime(),groupCreate:o.groupCreateTimestamp.getAsPosixTime(),create:o.createTimestamp.getAsPosixTime(),mount:v?v.getAsPosixTime():0}}})}));k._on("load",(function(){k.send({action:"stripe-user-mount",payload:{rtl:ke(i())}}),S()})),k._on("update-start",(function(){g.updateRequest.inMerchantEventHandler&&(g.updateRequest.isCalled=!0)})),k._on("update-end",(function(){var e,t;null===(e=(t=g.updateRequest).resolve)||void 0===e||e.call(t),g.updateRequest.isCalled=!1}));var C=function(e){new Mo((function(e){g.updateRequest.isCalled?g.updateRequest.resolve=e:e()})).then((function(){return c.controller.action.getElementsSessionAmountModeCurrency({groupId:m})})).then((function(t){var n=t.amount,r=t.mode,o=t.currency;g.amount=n,e(n,o,r)}))},M=function(){b&&b("hide_ece_overlay",null)},R=function(e,t){var n=t.paymentMethodType,r=!("nonce"in t),o="ece.".concat(function(e){return"shippingaddresschange"===e?"shipping_address_change":"shippingratechange"===e?"shipping_rate_change":"__private_do_not_use_billingaddresschange"===e?"__private_do_not_use_billing_address_change":"__private_do_not_use_coupon_code_change"}(e));if(p.report(o,{element:U.Yj.expressCheckout,payment_method:n}),l(e)){var i;i=r?function(){t.reject(),g.updateRequest.inMerchantEventHandler=!1}:function(){k.send({action:"stripe-ece-change-event",payload:{nonce:t.nonce}}),g.updateRequest.inMerchantEventHandler=!1};var u,d,m=eo({controller:p,eventName:e,time:19900,timeLabel:"20 seconds",reject:function(){p.report("".concat(o,".reject"),{element:U.Yj.expressCheckout,payment_method:n}),i()},resolve:function(i){C((function(a,u,l){g.lastCurrency&&u!==g.lastCurrency&&to();var d=(0,Xr.lK)(i,e,n,"SETUP_INTENT"===l,null==c?void 0:c.elementsInitSource),m=d.value;d.warnings.forEach((function(e){return p.warn(e)})),p.report("".concat(o,".resolve"),{element:U.Yj.expressCheckout,payment_method:n,hasLineItems:!!m.lineItems,hasShippingRates:!!m.shippingRates}),g.lineItems=m.lineItems||g.lineItems,(0,Xr.uU)(a,g.lineItems,p.keyMode(),n,p.warn,null==c?void 0:c.elementsInitSource),r?t.resolve((0,s.Z)((0,s.Z)({},m),{},{amount:a})):k.send({action:"stripe-ece-change-event",payload:{nonce:t.nonce,changePayload:(0,s.Z)((0,s.Z)({},m),{},{amount:a})}})})),g.updateRequest.inMerchantEventHandler=!1},betas:_}),f=m.resolve,h=m.reject;return"changeFailed"in t&&"__private_do_not_use_couponcodechange"===e&&(u=function(o){var i;i=o,C((function(o,a,u){g.lastCurrency&&a!==g.lastCurrency&&to();var l=(0,Xr.lK)(i,e,n,"SETUP_INTENT"===u,null==c?void 0:c.elementsInitSource),d=l.value;l.warnings.forEach((function(e){return p.warn(e)})),p.report("ece.__private_do_not_use_coupon_code_change.change_failed",{element:U.Yj.expressCheckout,payment_method:n}),g.lineItems=d.lineItems||g.lineItems,(0,Xr.uU)(o,g.lineItems,p.keyMode(),n,p.warn,null==c?void 0:c.elementsInitSource),r?t.changeFailed((0,s.Z)((0,s.Z)({},d),{},{amount:o})):k.send({action:"stripe-ece-change-event",payload:{nonce:t.nonce,changePayload:(0,s.Z)((0,s.Z)({},d),{},{amount:o})}})})),g.updateRequest.inMerchantEventHandler=!1}),d="name"in t?{name:t.name,address:t.address}:"shippingRate"in t?{shippingRate:t.shippingRate}:{couponCode:t.couponCode,changeFailed:u},g.updateRequest.inMerchantEventHandler=!0,void a(e,(0,s.Z)((0,s.Z)({},d),{},{reject:h,resolve:f}))}C((function(e,n){g.lastCurrency&&n!==g.lastCurrency&&to(),r?t.resolve({amount:e}):k.send({action:"stripe-ece-change-event",payload:{nonce:t.nonce,changePayload:{amount:e}}})}))},I=function(e){var t;a("cancel"),null===(t=g.unmountOverlay)||void 0===t||t.call(g);var n=e.paymentMethodType;p.report("ece.cancel",{element:U.Yj.expressCheckout,payment_method:n})},N=function(e){var t=e.paymentMethodType,n=e.billingDetails,r=e.shippingAddress,o=e.shippingRate;if(p.report("ece.confirm",{element:U.Yj.expressCheckout,payment_method:t}),!l("confirm"))throw new P.No("Unhandled expressCheckout Element confirm event. Make sure to register a confirm handler.");var i=(0,s.Z)((0,s.Z)({},(0,E.uN)(_,"express_checkout_element_beta_1")?{paymentMethodType:ro(t)}:{expressPaymentType:ro(t)}),{},{billingDetails:n,shippingAddress:r,shippingRate:o,paymentFailed:function(n){var r=(0,Xr.lH)(n),o=r.value;r.warnings.forEach((function(e){return p.warn(e)})),p.report("ece.confirm.payment_failed",{element:U.Yj.expressCheckout,payment_method:t,reason:o.reason}),p.action.getIsAwaitingConfirmCallback({groupId:m}).then((function(n){if(!n)throw new P.No("Unexpected call to paymentFailed(). Ensure you are either submitting a payment or calling paymentFailed() once per expressCheckout Element confirm event.");"apple_pay_outer"===t?e.paymentFailed(o):k.send({action:"stripe-ece-confirm-payment",payload:{nonce:e.nonce,paymentFailedPayload:o}})}))}},!1===f.__autoClose?{paymentSucceeded:function(){p.action.closeECEPaymentSheet({groupId:m,isError:!1,errorMessageMethodName:"paymentSucceeded()",forceClose:!0})}}:{});a("confirm",i)},T=So({controller:p,eventHandlers:{cancel:function(e){return I(e)},__privateDoNotUseBillingAddressChange:function(e){return R("__private_do_not_use_billingaddresschange",e)},__privateDoNotUseCouponCodeChange:function(e){return R("__private_do_not_use_couponcodechange",e)},shippingAddressChange:function(e){return R("shippingaddresschange",e)},shippingRateChange:function(e){return R("shippingratechange",e)},confirm:N},groupId:m,listenerRegistry:d,betas:_,blockedCardBrands:Eo(h,y),elementsInitSource:null==c?void 0:c.elementsInitSource,minApplePayVersion:null===(n=f.__checkout)||void 0===n?void 0:n.minApplePayVersion});p.action.getElementsSessionUnverifiedPaymentMethodsOnDomain({groupId:m,wallets:f.paymentMethods}).then((function(e){var t,n,r;if(-1!==e.indexOf("apple_pay")||"never"===(null===(t=f.paymentMethods)||void 0===t?void 0:t.applePay))T.shouldShowButton(!1);else if("always"===(null===(n=f.paymentMethods)||void 0===n?void 0:n.applePay)){var o;T.canMakePayments(!1,null===(o=f.__checkout)||void 0===o?void 0:o.applePayIdentifierAccount).then((function(e){T.shouldShowButton(e)}))}else{var i;T.canMakePayments(!0,null===(i=f.__checkout)||void 0===i?void 0:i.applePayIdentifierAccount).then((function(e){T.shouldShowButton(e)}))}-1===e.indexOf("google_pay")&&"never"!==(null===(r=f.paymentMethods)||void 0===r?void 0:r.googlePay)&&"https:"!==window.location.protocol&&(p.action.shouldShowEceButton({groupId:m,button:"googlePay",shouldShowButton:!1}),p.warn("You are testing over HTTP, so Google Pay will not appear. You must use HTTPS in order to use Google Pay."))})),k._on("ece-outer-pm-complete-payment",(function(e){"apple_pay_outer"===e.paymentMethodType&&T.completePayment(e.isError)})),k._on("dismiss-overlay",(function(){var e;null===(e=g.unmountOverlay)||void 0===e||e.call(g),p.report("ece.overlay.unmounted",{element:U.Yj.expressCheckout})})),k._on("cancel",(function(e){I(e)})),k._on("click",(function(e){var t=e.paymentMethodType,n="apple_pay_outer"===t,r=g.usesNewIntegrationShape?{}:Jr.GN,o="click";if(p.report("ece.click",{element:U.Yj.expressCheckout,payment_method:t}),function(e){var t=e.paymentMethodType;return"paypal"===t||"klarna"===t||"link"===t||(0,Po.r2)(t)||"google_pay"===t||"apple_pay_inner"===t}(e)){var i=e.overlayString,u=e.fontValues,d=e.paymentMethodType;if(b)!function(e,t,n){b&&b("show_ece_overlay",{pmt:e,overlayString:t,fontValues:n})}(d,i,u),g.unmountOverlay=M,g.runOnUnmount.push(M);else{var m=(0,Ao.C)(d,i,u),f=m.mount,h=m.unmount;f(),g.unmountOverlay=h,g.runOnUnmount.push(h),p.report("ece.overlay.mounted",{element:U.Yj.expressCheckout,payment_method:t})}}if(l(o)){var y=function(){g.updateRequest.inMerchantEventHandler=!1};n||(y=function(t){var n;k.send({action:"stripe-user-ece-button-click",payload:{nonce:e.nonce,errorReason:t}}),null===(n=g.unmountOverlay)||void 0===n||n.call(g)},g.updateRequest.inMerchantEventHandler=!1);var v=eo({controller:c.controller,eventName:o,time:800,timeLabel:"1 second",reject:y,rejectFunctionName:"preventDefault",resolve:function(o){C((function(i,a,u){var l,d,m,f,h,y,v;g.lastCurrency=a;try{var b=(0,Xr.PY)({payload:o,isSetupMode:"SETUP_INTENT"===u,paymentMethodType:t,usesNewIntegrationShape:g.usesNewIntegrationShape,betas:_,elementsInitSource:null==c?void 0:c.elementsInitSource});y=b.value,v=b.warnings}catch(e){throw"IntegrationError"===e.name&&p.report("integration_error",{name:e.name,message:e.message}),e}v.forEach((function(e){return p.warn(e)})),p.report("ece.click.options",(0,s.Z)((0,s.Z)({},(0,A.ei)(y,["allowedShippingCountries","business","billingAddressRequired","emailRequired","phoneNumberRequired","shippingAddressRequired"])),{},{usesApplePayRecurringPayment:!(null===(l=y.applePay)||void 0===l||!l.recurringPaymentRequest),usesApplePayDeferredPayment:!(null===(d=y.applePay)||void 0===d||!d.deferredPaymentRequest),usesApplePayAutomaticReloadPayment:!(null===(m=y.applePay)||void 0===m||!m.automaticReloadPaymentRequest),usesApplePayPaymentRequestPassthrough:!(null===(f=y.applePay)||void 0===f||!f.paymentRequestPassthrough),applePayLaterAvailability:null===(h=y.applePay)||void 0===h?void 0:h.applePayLaterAvailability,hasLineItems:!!y.lineItems,hasShippingRates:!!y.shippingRates,element:U.Yj.expressCheckout,payment_method:t})),g.lineItems=y.lineItems||g.lineItems,(0,Xr.uU)(i,g.lineItems,p.keyMode(),t,p.warn,null==c?void 0:c.elementsInitSource),n?T.clickHandler((0,s.Z)((0,s.Z)({},e),{},{amount:i,currency:a}),(0,s.Z)((0,s.Z)({},r),y)):k.send({action:"stripe-user-ece-button-click",payload:{nonce:e.nonce,clickPayload:(0,s.Z)((0,s.Z)((0,s.Z)({},r),y),{},{mids:p.mids(),amount:i})}})})),g.updateRequest.inMerchantEventHandler=!1},betas:_}),w=v.resolve,S=v.reject;return g.updateRequest.inMerchantEventHandler=!0,void((0,E.uN)(_,"express_checkout_element_beta_1")?a(o,(0,s.Z)({paymentMethodType:ro(t),resolve:w},(0,E.uN)(_,"ece_temp_prevent_default_beta_1")?{preventDefault:S}:{})):a(o,(0,s.Z)({expressPaymentType:ro(t),resolve:w},(0,E.uN)(_,"ece_temp_prevent_default_beta_1")?{preventDefault:S}:{})))}C((function(t,o){g.lastCurrency=o,n?T.clickHandler((0,s.Z)((0,s.Z)({},e),{},{amount:t,currency:o}),r):k.send({action:"stripe-user-ece-button-click",payload:{nonce:e.nonce,clickPayload:(0,s.Z)((0,s.Z)({},r),{},{mids:p.mids(),amount:t})}})}))})),k._on("shippingaddresschange",(function(e){return R("shippingaddresschange",e)})),k._on("shippingratechange",(function(e){return R("shippingratechange",e)})),k._on("confirm",N);return k._on("load-error",(function(e){a("loaderror",{error:e}),u()})),Qr.Nb.forEach((function(e){k._on(e,(function(t){return a(e,t)}))})),{update:function(e){g.usesNewIntegrationShape=g.usesNewIntegrationShape||oo({betas:_,publicOptions:e}),k.update(e)},focus:function(){Se(),k.focus(),k.send({action:"stripe-user-focus",payload:{}})},blur:function(){k.blur()},clear:function(){throw new P.No("clear() is not supported by the Express Checkout Element.")},mount:function(){v=new mt.E;var e=i();e&&((0,w.mb)(e,[[Qr.et,!0]]),g.runOnUnmount.push((function(){(0,w.mb)(e,[[Qr.et,!1]])})))},unmount:function(){for(;g.runOnUnmount.length;){var e;null===(e=g.runOnUnmount.pop())||void 0===e||e()}k.unmount()},destroy:function(){c.controller.action.resetExpressCheckoutState({groupId:m})},_frame:k}},Io=["options"],No=["controller","publicOptions","componentName"],To=["update"],Oo=function(e){var t=e.options,n=(0,m.Z)(e,Io),r=t.controller,o=t.publicOptions,i=(t.componentName,(0,m.Z)(t,No));if(r.keyMode()===er.Kl.unknown)throw new P.No("It looks like you're using an older Stripe key. The Pay Button Element is only available for use with a modern API key, which is prefixed with 'pk_live_' or 'pk_test_'.\n You can roll your publishable key here: https://dashboard.stripe.com/account/apikeys");var a=oo({betas:r._betas,publicOptions:o,isCreate:!0}),c=(0,Xr.oN)(o||{},t.elementsInitSource,a);"payButton"===e.options.componentName&&c.warnings.push("Pay Button Element is now Express Checkout Element.\nIt is advised to switch to the Express Checkout Element. For more information,\nsee https://stripe.com/docs/elements/express-checkout-element."),c.warnings.forEach((function(e){return r.warn(e)}));var u=Ro((0,s.Z)((0,s.Z)({},n),{},{options:(0,s.Z)((0,s.Z)({},i),{},{controller:r,componentName:"expressCheckout",publicOptions:c.value})})),l=u.update,d=(0,m.Z)(u,To);return(0,s.Z)((0,s.Z)({},d),{},{update:function(e){a=a||oo({betas:r._betas,publicOptions:e,isCreate:!1});var t=(0,Xr.a1)(e||{},a),n=t.value;t.warnings.forEach((function(e){return r.warn(e)})),l(n)}})},xo=function(e,t){var n=function(e){if(!se.YA[e])throw new Error("Unexpected Element type: ".concat(e,"."));return se.YA[e].implementation}(e);switch(n){case"legacy":return new an(t);case"affirm_message":return pn(t);case"afterpay_message":return yn(t);case"payment_method_messaging":return Wr(t);case"frame":return Hr(t);case"express_checkout":return Oo(t);default:return(0,de.Rz)(n,"Unexpected implementation type: ".concat(n,"."))}},jo=n(5311),Zo=new Set(["card","cardNumber","cardExpiry","cardCvc","postalCode","payment","linkAuthentication","expressCheckout","address"]),Lo={},Do=[],Bo=function(e){if(Lo[e]&&(Go("init",e),Lo[e].fastlaneOpen))for(Lo[e].fastlaneOpen=!1;Lo[e].queue.length;){var t=Lo[e].queue.shift();t&&t()}if(!Ko())for(;Do.length;){var n=Do.shift();n&&n()}},qo=function(e){if(Lo[e]){var t=Lo[e].fastPathFrameId;Lo[e].controllerReadyForMessages&&t&&((0,jo.oi)({type:"child",sourceFrameId:window.name,targetFrameId:t,controllerAppFrameId:Lo[e].controllerId,message:{action:"stripe-outer-controller-load-for-fastpath",payload:{}}}),Uo("store",e))}},Fo={register:5e3,init:15e3,store:15e3},Uo=function(e,t){Lo[t]&&(Lo[t].timeoutIds[e]=setTimeout((function(){Lo[t].onTimeout(e),Vo(t)&&Bo(t),delete Lo[t]}),Fo[e]))},Go=function(e,t){if(Lo[t]){var n=Lo[t].timeoutIds[e];n&&clearTimeout(n)}},zo=function(e,t){Lo[e]&&(Lo[e].fastPathFrameId=t,Bo(e),Lo[e].controllerReadyForMessages&&qo(e))},Vo=function(e){return e?void 0!==Lo[e]&&Lo[e].fastlaneOpen:Ko()},Ko=function(){return(0,A.VO)(Lo).some((function(e){return e.fastlaneOpen}))},Ho=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},(0,A.ei)(e,["business","fields","readOnly","terms","allowedCardBrands","disallowedCardBrands","customPaymentMethods","blockPoBox","validation","display","layout","paymentMethodOrder","wallets","buttonHeight","allowedShippingCountries","billingAddressRequired","emailRequired","phoneNumberRequired","shippingAddressRequired","shippingRates","accountHolderType","disabled","hideIcon","hidePostalCode","disableLink","disableMultipleButtons","iconStyle","placeholderCountry","rtl","showIcon","supportedCountries","preferredNetwork","betas","componentName","groupId","locale","loader","externalPaymentMethodTypes"])),e.autocomplete&&{disableAutocomplete:"disabled"===e.autocomplete.mode}),e.contacts&&{contacts:e.contacts.length}),e.savePaymentMethod&&{savePaymentMethod:(0,s.Z)((0,s.Z)({},e.savePaymentMethod),{},{messages:!!e.savePaymentMethod.messages})})},Yo=function(e){function t(e,r,o){var i,a;(0,l.Z)(this,t),(a=n.call(this)).mount=(0,ce.TC)((function(e){var t;if(a._checkDestroyed(),!e)throw new P.No("Missing argument. Make sure to call mount() with a valid DOM element or selector.");if("string"==typeof e){var n=document.querySelectorAll(e);if(n.length>1&&a._controller.warn("The selector you specified (".concat(e,") applies to ").concat(n.length," DOM elements that are currently on the page.\nThe Stripe Element will be mounted to the first one.")),!n.length)throw new P.No("The selector you specified (".concat(e,") applies to no DOM elements that are currently on the page.\nMake sure the element exists on the page before calling mount()."));t=n[0]}else{if(!e.appendChild)throw new P.No("Invalid DOM element. Make sure to call mount() with a valid DOM element or selector.");t=e}if("INPUT"===t.nodeName)throw new P.No("Stripe Elements must be mounted in a DOM element that\ncan contain child nodes. `input` elements are not permitted to have child\nnodes. Try using a `div` element instead.");t.children.length&&t!==document.body&&a._controller.warn("This Element will be mounted to a DOM element that contains child nodes."),a._mountToParent(t)})),a.update=(0,ce.TC)((function(e){return a._controller.report("update",{options:Ho(e),element:a._componentName,element_mode:a._componentMode}),a._checkDestroyed(),a._implementation.update(e),(0,h.Z)(a)})),a.focus=(0,ce.TC)((function(e){return a._checkDestroyed(),e&&e.preventDefault(),a._implementation.focus(),(0,h.Z)(a)})),a.blur=(0,ce.TC)((function(){return a._checkDestroyed(),a._implementation.blur(),(0,h.Z)(a)})),a.clear=(0,ce.TC)((function(){return a._checkDestroyed(),a._implementation.clear(),(0,h.Z)(a)})),a.collapse=(0,ce.TC)((function(){if(a._checkDestroyed(),!a._implementation.collapse)throw new P.No("Collapse is not supported by the ".concat(a._componentName," Element."));return a._implementation.collapse(),(0,h.Z)(a)})),a.unmount=(0,ce.TC)((function(){return a._checkDestroyed(),a._unmount(),(0,h.Z)(a)})),a.destroy=(0,ce.TC)((function(){var e,t;return a._checkDestroyed(),a.unmount(),null===(e=(t=a._implementation).destroy)||void 0===e||e.call(t),a._destroyed=!0,a._emitEvent("destroy"),(0,h.Z)(a)})),a.getValue=(0,ce.TC)((function(){a._checkDestroyed();var e=new Set(["address"]);if(a._implementation.getValue&&e.has(a._componentName))return a._implementation.getValue();throw new P.No("getValue is not supported by the ".concat(a._componentName," Element."))})),a._getParent=function(){return a._parent},a._emitEvent=function(e,t){return"loaderror"!==e||a._hasRegisteredListener("loaderror")||a._controller.keyMode()!==er.Kl.test||console.error("Unhandled ".concat(a._componentName," Element loaderror"),t),a._emit(e,(0,s.Z)({elementType:a._componentName},t))};var c=e.controller,u=e.componentName,d=e.groupId,p=e.locale,m=e.betas;e.mids;if(a._controller=c,a._componentName=u,a._componentMode=null===(i=e.publicOptions)||void 0===i?void 0:i.mode,a._destroyed=!1,a._groupId=d,"currencySelector"===u&&"custom_checkout"!==e.elementsInitSource&&"hip"!==e.elementsInitSource)throw new P.No("The `currencySelector` Element cannot be created without using Custom Checkout. See docs: https://docs.stripe.com/js/custom_checkout/create_element?type=currencySelector");var f=document.createElement("div");return f.className=se.A2,a._component=f,c.report("create",{options:Ho((0,s.Z)({componentName:u,groupId:d,locale:p,betas:m},e.publicOptions)),element:u,element_mode:a._componentMode,elements_init_source:e.elementsInitSource}),a._implementation=xo(a._componentName,{options:e,component:f,listenerRegistry:r,elementTimings:o,emitEvent:a._emitEvent,getParent:a._getParent,hasRegisteredListener:a._hasRegisteredListener,selfDestruct:function(){a.destroy()}}),a}(0,y.Z)(t,e);var n=(0,v.Z)(t);return(0,d.Z)(t,[{key:"_checkDestroyed",value:function(){if(this._destroyed)throw new P.No("This Element has already been destroyed. Please create a new one.")}},{key:"_isMounted",value:function(){return!!document.body&&document.body.contains(this._component)}},{key:"_unmount",value:function(){var e=this._component.parentElement;e&&e.removeChild(this._component),this._controller.report("unmount",{element:this._componentName,element_mode:this._componentMode}),this._implementation.unmount(),this._parent=null}},{key:"_mountToParent",value:function(e){var t=this._component.parentElement,n=this._isMounted();if(e===t){if(n)return;this.unmount(),this._mountTo(e)}else if(t){if(n)throw new P.No("This Element is already mounted. Use `unmount()` to unmount the Element before re-mounting.");this.unmount(),this._mountTo(e)}else this._mountTo(e)}},{key:"_mountTo",value:function(e){var t,n,r,o,i=this;for(this._parent=e;e.firstChild&&e!==document.body;)e.removeChild(e.firstChild);t={elementName:this._componentName,groupId:this._groupId},n=function(){i._parent&&i._parent.appendChild(i._component)},r=t.elementName,o=t.groupId,Lo[o]&&Vo(o)&&!Zo.has(r)?Lo[o].queue.push(n):n();var a=!1;try{var c;a=!(null===(c=window.top)||void 0===c||!c.document)}catch(e){}this._controller.report("mount",{element:this._componentName,element_mode:this._componentMode,is_mounted_in_iframe:window.top!==window,can_access_top:a}),this._implementation.mount()}}]),t}(le.Z),Wo=function(e,t){e._controller.report("legacy_private_property_used",{prop:t,componentName:e._componentName})};["_autofilled","_classes","_complete","_empty","_fakeInput","_focused","_frame","_invalid","_lastBackgroundColor","_lastFontSize","_lastHeight","_lastPadding","_lastSubmittedAt","_listenerRegistry","_paymentRequest"].forEach((function(e){Object.defineProperty(Yo.prototype,e,{enumerable:!1,get:function(){return Wo(this,e),this._implementation[e]}})}));["_formSubmit","_isIssuingDisplayElement"].forEach((function(e){Object.defineProperty(Yo.prototype,e,{enumerable:!1,writable:!1,value:function(){return Wo(this,e),this._implementation[e]()}})}));var Xo=Yo,Qo=["stripe.elements","custom_checkout","checkout","payment_link","hip"],Jo="stripe.js:",$o=function(e){if(void 0===e)return"unknown";if("/v3"===e||"/v3/"===e)return e;if(0!==e.indexOf("/v3/")&&0!==e.indexOf("/fingerprinted/"))return e;var t=e.split("/");return t[t.length-1].replace(/-[a-f0-9]{32}/,"")},ei=[],ti=function(e){if(window.performance){var t="".concat(Jo).concat(e);try{if(!ri())return void ei.push({name:t,startTime:performance.now()});performance.mark(t)}catch(e){}}},ni=!1,ri=function(){return ni},oi=function(){ni||(ni=!0,ei.forEach((function(e){return performance.mark(e.name,{startTime:e.startTime})})))},ii=function(e){return e.map((function(e){var t,n=e.domainLookupStart;n===e.startTime&&(n=void 0),n&&(n=Math.round(n));var r=e.name;0===r.indexOf(Jo)&&(r=r.substring(Jo.length));try{r=new URL(r).pathname}catch(e){}if("longtask"===e.entryType){r="lt-".concat(r);try{var o=e.attribution;t=o[0].containerName||$o(o[0].containerSrc)||void 0}catch(e){}}if("long-animation-frame"===e.entryType)try{r="laf",t=function(e){var t=e.scripts;if(t&&0!==t.length){var n=t[0].invoker;if(/^https?:\/\//.test(n))try{return $o(new URL(n).pathname)}catch(e){return}try{return"".concat($o(new URL(t[0].sourceURL).pathname),"::").concat(n)}catch(e){return n}}}(e)}catch(e){}return"visibility-state"===e.entryType&&(r="page-".concat(r)),{t:Math.round(e.startTime),d:Math.round(e.duration),n:r,f:n,i:t}}))},ai=function(e){var t=e.types,n=e.reporter,r=e.resourcePrefixFilter;try{if(!window.performance||!window.performance.getEntriesByType||!("PerformanceObserver"in window))return;var o,i=t.filter((function(e){return-1!==PerformanceObserver.supportedEntryTypes.indexOf(e)}));-1!==t.indexOf("visibility-state")&&-1===i.indexOf("visibility-state")&&document.visibilityState&&document.addEventListener("visibilitychange",(function(){ti("page-".concat(document.visibilityState))})),i.push("mark"),oi();var a=[],c=function(e,t){var i=function(e,t,n){return"resource"===e&&n?t.filter((function(e){return 0===e.name.indexOf(n)})):"mark"===e?t.filter((function(e){return 0===e.name.indexOf(Jo)})):t}(e,t,r);0!==i.length&&(clearTimeout(o),a.push.apply(a,(0,u.Z)(ii(i))),o=setTimeout((function(){n(a.splice(0))}),100))};i.forEach((function(e){var t=new PerformanceObserver((function(t){c(e,t.getEntries())}));t.observe({type:e,buffered:!0})}))}catch(e){}},ci={},si=function(e,t){var n=(0,A.VO)(t).reduce((function(e,t){return e+t}),0),r=Math.floor(parseInt(function(e){var t,n,r,o,i,a,c,s,u,l=e,d=function(e,t){return e<>>32-t},p=function(e){var t,n="";for(t=7;t>=0;t--)n+=(e>>>4*t&15).toString(16);return n},m=new Array(80),f=1732584193,_=4023233417,h=2562383102,y=271733878,v=3285377520,g=(l=function(e){var t=e;t=t.replace(/\r\n/g,"\n");for(var n="",r=0;r127&&o<2048?(n+=String.fromCharCode(o>>6|192),n+=String.fromCharCode(63&o|128)):(n+=String.fromCharCode(o>>12|224),n+=String.fromCharCode(o>>6&63|128),n+=String.fromCharCode(63&o|128))}return n}(l)).length,b=[];for(n=0;n>>29),b.push(g<<3&4294967295),t=0;t1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{treatment:5,control:5},r=void 0===t?Math.random().toString():t,o=void 0===t?e:"".concat(e,".").concat(t),i="".concat(e,".").concat(r);return ci[o]||(ci[o]=si(i,n)),ci[o]},li={},di=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=ui(t,n,r),a=(0,M.Z)(i,2),c=a[0],u=a[1];return li["".concat(t).concat(n)]||(e("light_experiment_exposure",(0,s.Z)({qualified:c,variant:u,experiment_name:t},o)),li["".concat(t).concat(n)]=!0),u},pi=["fonts","locale","customerOptions","customerSessionClientSecret"],mi={require_cvc_recollection:(0,g.jt)(g.Xg),installments:(0,g.jt)((0,g.mC)({enabled:g.Xg})),setup_future_usage:(0,g.jt)((0,g.AG)((0,g.kw)("none","off_session","on_session")))},fi={verification_method:(0,g.jt)(g.kw.apply(void 0,(0,u.Z)(dr.YQ))),financial_connections:(0,g.jt)((0,g.mC)({permissions:(0,g.jt)((0,g.CT)(g.kw.apply(void 0,(0,u.Z)(dr.pd)))),prefetch:(0,g.jt)((0,g.CT)(g.kw.apply(void 0,(0,u.Z)(dr.tt)))),return_url:(0,g.jt)(g.Z_)}))},_i={setup_future_usage:(0,g.jt)((0,g.AG)((0,g.kw)("none","off_session")))},hi={setup_future_usage:(0,g.jt)((0,g.AG)((0,g.kw)("none","off_session")))},yi={capture_method:(0,g.jt)((0,g.AG)((0,g.kw)("manual"))),setup_future_usage:(0,g.jt)((0,g.AG)((0,g.kw)("none","off_session")))},vi={amazon_pay:(0,g.jt)((0,g.mC)(_i)),card:(0,g.jt)((0,g.mC)(mi)),link:(0,g.jt)((0,g.mC)(hi)),paypal:(0,g.jt)((0,g.mC)(yi)),us_bank_account:(0,g.jt)((0,g.mC)(fi))},gi=function(e){var t=(0,g.jt)((0,g.AG)((0,g.CT)(g.kw.apply(void 0,(0,u.Z)(function(e){return(0,E.uN)(e,E.M4.elements_enable_deferred_intent_beta_1)?Object.keys(C.GS).concat(gn.Y4):Object.keys(C.GS)}(e)))))),n=(0,g.jt)((0,g.AG)((0,g.kw)("off_session","on_session"))),r=(0,g.jt)((0,g.AG)((0,g.kw)("automatic","automatic_async","manual"))),o=(0,g.jt)((0,g.AG)((0,g.mC)(vi))),i=(0,g.jt)((0,g.AG)(g.Z_)),a=(0,g.jt)((0,g.AG)(g.Z_));return{mode:(0,g.jt)((0,g.AG)((0,g.kw)("payment","setup","subscription"))),amount:(0,g.jt)((0,g.AG)(g.MZ)),currency:(0,g.jt)((0,g.AG)(g.cV)),paymentMethodCreation:(0,g.jt)((0,g.kw)("manual")),payment_method_types:t,paymentMethodTypes:t,setup_future_usage:n,setupFutureUsage:n,capture_method:r,captureMethod:r,payment_method_options:o,paymentMethodOptions:o,payment_method_configuration:i,paymentMethodConfiguration:i,on_behalf_of:a,onBehalfOf:a}},bi={customerOptions:(0,g.jt)((0,g.mC)({customer:g.Z_,ephemeralKey:g.Z_}))},wi={customerSessionClientSecret:(0,g.jt)((0,g.AG)(g.Z_))},ki=(0,g.jt)((0,g.UF)(100)),Si=function(e){return(0,E.uN)(e,"payment_element_byof_beta_1")?(0,g.mC)({id:(0,g.xe)("cpmt_"),options:(0,g.or)((0,g.mC)({type:(0,g.p3)("static"),subtitle:ki}),(0,g.mC)({type:(0,g.p3)("embedded"),subtitle:ki,handleRender:g.uz,handleDestroy:(0,g.jt)(g.uz)}))}):(0,g.mC)({id:(0,g.xe)("cpmt_"),options:(0,g.mC)({type:(0,g.p3)("static"),subtitle:ki})})},Ci=(0,g.jt)((0,g.mC)({fxQuoteId:g.Z_,activeCurrency:g.cV})),Ei=(0,g.mC)(Object.freeze({mode:(0,g.kw)("shipping","billing")})),Ai=function(e){if(e)return(0,s.Z)((0,s.Z)((0,s.Z)({},e),e.hasOwnProperty("rules")?{rules:""}:null),e.hasOwnProperty("variables")?{variables:""}:null)},Pi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},(0,A.ei)(e,["locale","loader","externalPaymentMethodTypes","paymentMethodCreation","allowedCardBrands","disallowedCardBrands"].concat(Ni))),e.hasOwnProperty("fonts")?{fonts:""}:null),{},{appearance:Ai(e.appearance)},e.customerOptions?{customerOptions:{customer:e.customerOptions.customer}}:null),e.customPaymentMethods?{customPaymentMethodIds:e.customPaymentMethods.map((function(e){return e.id}))}:null)},Mi=function(e,t){var n=e.mode,r=e.currency,o=e.amount,i=e.captureMethod,a=e.capture_method,c=void 0===a?i:a,s=e.setupFutureUsage,u=e.setup_future_usage,l=void 0===u?s:u,d=e.paymentMethodTypes,p=e.payment_method_types,m=void 0===p?d:p,f=e.paymentMethodOptions,_=e.payment_method_options,h=void 0===_?f:_,y=e.paymentMethodConfiguration,v=e.payment_method_configuration,g=void 0===v?y:v,b=e.onBehalfOf,w=e.on_behalf_of,k=void 0===w?b:w;return"payment"===n&&r?{mode:"payment",currency:r,amount:o||null,capture_method:c,setup_future_usage:l,payment_method_types:m,payment_method_options:h,payment_method_configuration:g,on_behalf_of:k}:"setup"===n?{mode:"setup",currency:r,capture_method:c,setup_future_usage:l||(t?"off_session":void 0),payment_method_types:m,payment_method_options:h,payment_method_configuration:g,on_behalf_of:k}:"subscription"===n&&r&&"number"==typeof o?{mode:"subscription",currency:r,amount:o,setup_future_usage:t?"off_session":void 0,payment_method_types:m,payment_method_options:h,payment_method_configuration:g,on_behalf_of:k}:void 0},Ri=["customerSessionClientSecret","adaptivePricing"],Ii=["mode","amount","payment_method_types","paymentMethodTypes","capture_method","captureMethod","setup_future_usage","setupFutureUsage","payment_method_options","paymentMethodOptions","payment_method_configuration","paymentMethodConfiguration"],Ni=[].concat(Ii,["currency","on_behalf_of","onBehalfOf","adaptivePricing"]),Ti=function(e,t,n){var r=e,o=t;if("setup"===(null==r?void 0:r.mode)&&null!=o&&o.amount)throw new P.No("Invalid value for ".concat(n,": `amount` is not applicable when `mode` is `'setup'`"))},Oi=function(e,t,n,r,o,i){var a,c,s=e.mode,u=e.amount,l=e.currency,d=e.paymentMethodTypes,p=e.payment_method_types,m=void 0===p?d:p,f=e.paymentMethodConfiguration,_=e.payment_method_configuration,h=void 0===_?f:_,y=e.paymentMethodOptions,v=e.payment_method_options,b=void 0===v?y:v,w=(0,E.uN)(r,E.M4.deferred_intent_pe_optional_amount_beta_0);if(null!=m&&m.length&&h)throw new P.No("Invalid value for ".concat(n,": You may only specify one of these parameters: `payment_method_types` or `payment_method_configuration`."));var k=Object.keys((0,A.ei)(t,Ii));if(null!=(null==b||null===(a=b.card)||void 0===a||null===(c=a.installments)||void 0===c?void 0:c.enabled)){if("payment"!==s)throw new P.No("Invalid value for ".concat(n,": `paymentMethodOptions.card.installments.enabled` is only applicable when `mode` is `'payment'`."));if(null==m||!m.length)throw new P.No("Invalid value for ".concat(n,": `paymentMethodOptions.card.installments.enabled` is only applicable when `paymentMethodTypes` is set."));if("manual"===i)throw new P.No("Invalid value for ".concat(n,": `paymentMethodOptions.card.installments.enabled` is not applicable when `paymentMethodCreation` is `'manual'`."))}if("payment"===s){var S=(0,g.mC)({amount:(0,g.jt)((0,g.AG)(g.Rx)),currency:g.Z_}),C=(0,g.mC)({amount:g.Rx,currency:g.Z_}),M=w?S:C,R=(0,g.Gu)(M,{amount:u,currency:l},"options").value;if(null!=R.amount&&R.amount<=0)throw new P.No("Invalid value for ".concat(n,": `amount` must be greater than 0"))}else if("setup"===s){!(0,E.uN)(r,E.M4.elements_enable_deferred_intent_beta_1)&&(m||(0,g.Gu)((0,g.mC)({currency:g.Z_}),{currency:l},"options"))}else{if(!s&&k.length)throw new P.No("Invalid value for ".concat(n,": `").concat(k.join("`, `"),"` ").concat(k.length>1?"are":"is"," only applicable when a `mode` is set."));if("subscription"===s){var I=(0,g.mC)({amount:(0,g.jt)((0,g.AG)(g.Rx)),currency:g.Z_}),N=(0,g.mC)({amount:g.Rx,currency:g.Z_}),T=w?I:N,O=(0,g.Gu)(T,{amount:u,currency:l},"options").value;if(O.amount&&O.amount<0)throw new P.No("Invalid value for ".concat(n,": `amount` must be 0 or greater"))}}if(b){var x,j,Z,L=null===(x=b.us_bank_account)||void 0===x||null===(j=x.financial_connections)||void 0===j?void 0:j.permissions;if(L&&!(L.indexOf("payment_method")>-1))throw new P.No("Invalid value for ".concat(n,": permissions array must include 'payment_method'. You provided: ").concat(L.join(", ")));if(void 0!==(null===(Z=b.card)||void 0===Z?void 0:Z.require_cvc_recollection)&&"setup"===s)throw new P.No("Invalid value for ".concat(n,": `require_cvc_recollection` is not applicable when `mode` is `'setup'`"));if("checkout"!==o&&"payment_link"!==o){var D;if(["amazon_pay","link","paypal"].forEach((function(e){if(void 0!==b[e])throw new P.No("Invalid value for ".concat(n,": `paymentMethodOptions[").concat(e,"]`"))})),void 0!==(null===(D=b.card)||void 0===D?void 0:D.setup_future_usage))throw new P.No("Invalid value for ".concat(n,": `paymentMethodOptions[card][setup_future_usage]`"))}}},xi=function(e){e._emit("update-end"),e._emit("updateend")},ji=Math.random()<0,Zi=function(e,t,n){t.createHiddenFrame(ge.NC.PAYMENT_API_INNER,{controllerId:t._id,elementsSessionsParams:JSON.stringify(n),isOwnFrame:!0},e),function(e){Lo[e]&&(Lo[e].fastlaneOpen=!0,Go("register",e),Uo("init",e))}(e)},Li=function(e){function t(e,r,o,i,a,d){var p;(0,l.Z)(this,t),(p=n.call(this)).getElement=(0,ce.W6)((function(e,t){var n,r=(null!=(n=e)&&n.__elementType&&"string"==typeof n.__elementType&&"function"==typeof n?n.__elementType:null)||e;if(ue(r,p._betas),"address"===r){var o=(null==t?void 0:t.mode)||function(e){return null!=e&&e.__elementMode&&"string"==typeof e.__elementMode&&"function"==typeof e?e.__elementMode:null}(e),i="address"===r&&o?Ei:(0,g.mC)(Object.freeze({})),a=(0,g.Gu)(i,t||{mode:o},"elements.getElement"),c=a.value;if(a.warnings.forEach((function(e){return p._controller.warn(e)})),c.mode)return(0,A.sE)(p._elements,(function(e){return e._componentName===r&&e._componentMode===c.mode}))||null;if(p._elements.filter((function(e){return e._componentName===r})).length>1)throw new P.No("In order to retrieve an Address Element, you must specify a mode.\n e.g. stripe.elements.getElement('address', 'shipping')")}return(0,A.sE)(p._elements,(function(e){return e._componentName===r}))||null})),p.update=(0,ce.TC)((function(e){var t,n,r=(0,s.Z)((0,s.Z)({},p._commonOptions),e);Ti(r,e,"elements.update()");var o=(0,g.Gu)(function(e){return(0,g.mC)((0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({locale:(0,g.jt)(g.Z_),appearance:(0,g.jt)(g.Ry)},gi(e)),bi),wi),{},{clientSecret:(0,g.jt)((0,g.AG)(bn._F)),adaptivePricing:Ci}))}(p._betas),e||{},"elements.update()"),i=o.value;if(o.warnings.forEach((function(e){return p._controller.warn(e)})),0!==Object.keys(i).length){var a,c,u=i.customerOptions,l=i.locale,d=i.appearance,m=i.on_behalf_of,_=i.clientSecret,y=i.customerSessionClientSecret,v=i.currency,b=i.onBehalfOf,w=void 0===b?m:b,k=(0,E.jk)(l,p._betas);k&&(p._controller.action.fetchLocale({locale:k}),p._elements.forEach((function(e){var t,n;t=e._implementation,"function"==typeof(null===(n=t._paymentRequest)||void 0===n?void 0:n._updateLocale)&&e._implementation._paymentRequest._updateLocale(k)})));var S=!1;if(!!Object.keys((0,A.ei)(i,["clientSecret"].concat(Ni,Ri))).length){var C;_=null!==(C=_)&&void 0!==C?C:p._commonOptions.clientSecret,y=void 0===y?p._commonOptions.customerSessionClientSecret:y,v=void 0===v?p._commonOptions.currency:v,w=void 0===w?p._commonOptions.onBehalfOf||p._commonOptions.on_behalf_of:w;var P=(0,A.ei)(i,[].concat(Ni,Ri)),M=(0,A.ei)(p._commonOptions,[].concat(Ni,Ri)),R=(0,s.Z)((0,s.Z)({},M),P);i.clientSecret&&Ii.forEach((function(e){R[e]=null})),i.mode&&(p._commonOptions.clientSecret=void 0),S=!(0,A.Xy)(R,M),Oi(R,P,"elements.update()",p._betas,p._commonOptions.__elementsInitSource||"stripe.elements",i.paymentMethodCreation),S&&(a=R,c=Mi(R,!0))}i.hasOwnProperty("customerOptions")&&(p._customerOptions=u||null),i.hasOwnProperty("customerSessionClientSecret")&&(p._commonOptions.customerSessionClientSecret=y||null),i.hasOwnProperty("appearance")&&(p._commonOptions.appearance=d),i.hasOwnProperty("clientSecret")&&(p._commonOptions.clientSecret=_),k&&(p._commonOptions.locale=k),(0,f.Z)(p._commonOptions,a);var I=(0,A.sE)(p._elements,(function(e){return"expressCheckout"===e._componentName||"payButton"===e._componentName}));null==I||null===(t=I._implementation._frame)||void 0===t||t._emit("update-start"),p._controller.action.updateElementsOptions((0,s.Z)({customerOptions:u,locale:k,appearance:d,groupId:p._id},S?{customerSessionClientSecret:y,clientSecret:_,currency:"SETUP_INTENT"===(null===(n=_)||void 0===n?void 0:n.type)?v:void 0,onBehalfOf:w,deferredIntent:c,adaptivePricing:i.adaptivePricing?{fxQuoteId:i.adaptivePricing.fxQuoteId,activeCurrency:i.adaptivePricing.activeCurrency}:void 0}:{})).then((function(){var e;xi((0,h.Z)(p)),null==I||null===(e=I._implementation._frame)||void 0===e||e._emit("update-end")}))}})),p.submit=(0,ce.P0)((function(){return p._isSubmitting&&p._controller.report("simultaneous_elements_submit_calls"),p._isSubmitting=!0,p._controller.action.validateElements({groupId:p._id,slug:"submit_elements"}).then((function(e){if(e&&"error"===e.type)return{error:e.error};var t=null==e?void 0:e.selectedPaymentMethod;return t&&"cpmt"===t.split("_",1)[0]&&p._controller.report("elements_submit_with_custom_payment_method",{selectedPaymentMethod:t}),p._controller.action.showWalletIfNecessary({groupId:p._id,locale:p._commonOptions.locale}).then((function(e){switch(null==e?void 0:e.type){case"error":return e.error?{error:e.error}:p._controller.action.localizeError({code:"unexpected",locale:p._commonOptions.locale}).then((function(e){return{error:e.error}}));case"cancelled":return p._controller.action.localizeError({code:"incomplete",type:"input_validation_error",locale:p._commonOptions.locale}).then((function(e){return{error:e.error}}));default:return{}}})).then((function(e){return e.error?e:t?{selectedPaymentMethod:t}:{}}))})).finally((function(){p._isSubmitting=!1}))})),p.create=(0,ce.W6)((function(e,t){ti("mount:".concat(e));var n=new mt.E,r=p._elements.map((function(e){return e._componentName})),o=p._elements.map((function(e){return e._componentMode}));!function(e,t,n,r,o){if(ue(e,r),"address"===e&&-1!==t.indexOf(e)&&-1!==n.indexOf(null==o?void 0:o.mode))throw new P.No("Can only create one Element of type ".concat(e," with mode ").concat(null==o?void 0:o.mode,"."));if(se.YA[e].unique&&-1!==t.indexOf(e))throw new P.No("Can only create one Element of type ".concat(e,"."));var i=se.YA[e].conflict,a=(0,A.dq)(t,i);if(a.length){var c=a[0];throw new P.No("Cannot create an Element of type ".concat(e," after an Element of type ").concat(c," has already been created."))}}(e,r,o,p._betas,t),function(e,t){"payment"===e&&(0,S.zd)()&&t.warn("It looks like you are using Payment Element in an iframe.\n Avoid placing the Payment Element within another iframe because some payment methods require redirecting to another page for payment confirmation.")}(e,p._controller);var i=(0,s.Z)((0,s.Z)((0,s.Z)({},(0,A.CE)(null!=t?t:{},"paymentRequest")),(0,A.ei)(p._commonOptions,["locale","fonts","appearance","clientSecret","loader","externalPaymentMethodTypes","customerSessionClientSecret","betas","paymentMethodCreation","disallowedCardBrands","allowedCardBrands"].concat(Ni))),{},{componentName:e,groupId:p._id}),a=(k.P0||k.JW)&&(0,S.qC)(i).length>2e3,l=!!p._pendingFonts||a;if("never"!==p._commonOptions.loader&&!p._isLoaderFrameMounted&&rr(e,t)){var d=function(e,t){return c||((c=e.createHiddenFrame(ge.NC.LOADER_UI_APP,{},t))._on("generate-loader-ui",(function(e){c.send({action:"generate-loader-ui",payload:{data:e}})})),c._on("get-element-loader-ui",(function(e){c.send({action:"get-element-loader-ui",payload:{data:e}})})),c)}(p._controller);d._emit("generate-loader-ui",{rawAppearanceConfig:p._commonOptions.appearance}),p._isLoaderFrameMounted=!0}var m=new Xo((0,s.Z)((0,s.Z)({publicOptions:t},(0,A.CE)(p._commonOptions,Ni)||{}),{},{deferredIntent:Mi(p._commonOptions,!0),componentName:e,groupId:p._id,fonts:a?null:p._commonOptions.fonts,controller:p._controller,wait:l,mids:p._controller.mids(),elementsInitSource:p._commonOptions.__elementsInitSource}),p._listenerRegistry,(0,s.Z)((0,s.Z)({},p._timings),{},{createTimestamp:n}));return p._elements=[].concat((0,u.Z)(p._elements),[m]),"address"===e&&-1!==r.indexOf(e)&&-1===o.indexOf(null==t?void 0:t.mode)&&p._controller.report("ae.two_aes_created"),m._on("destroy",(function(){p._elements=p._elements.filter((function(t){return t._componentName!==e}))})),a&&m._implementation.update({fonts:p._commonOptions.fonts}),m})),p.fetchUpdates=(0,ce.P0)((function(){if(p._commonOptions.clientSecret)return p._controller.action.fetchUpdates({clientSecret:p._commonOptions.clientSecret,customerOptions:p._customerOptions,customerSessionClientSecret:p._commonOptions.customerSessionClientSecret,locale:p._commonOptions.locale,groupId:p._id,currency:p._commonOptions.currency,customPaymentMethods:p._commonOptions.customPaymentMethods}).then((function(e){if("error"===(null==e?void 0:e.type)){var t=e.error,n=t.message,r=t.extra_fields;return null!=r&&r.status?{error:{message:n,status:r.status}}:{error:{message:n}}}return{}}));throw new P.No('In order to call fetchUpdates, you must pass a valid PaymentIntent or SetupIntent client secret when creating the Elements group.\n\n e.g. stripe.elements({clientSecret: "{{CLIENT_SECRET}}"})')})),ti("elements-group");var y=p._on;p._on=function(t,n,r){return e.report("register_elements_listener",{name:t}),y.call((0,h.Z)(p),t,n,r),(0,h.Z)(p)};var v=new mt.E;Ti(d,d,"elements()");var C=(0,g.Gu)(function(e){var t={locale:(0,g.jt)(g.Z_),fonts:(0,g.jt)((0,g.CT)(g.Ry)),appearance:(0,g.jt)(g.Ry),clientSecret:(0,g.jt)(bn._F),loader:(0,g.jt)((0,g.kw)("auto","always","never")),externalPaymentMethodTypes:(0,g.jt)(gn.iU),syncAddressCheckbox:(0,g.jt)((0,g.kw)("none","shipping","billing")),customPaymentMethods:(0,g.jt)((0,g.uw)("id")((0,g.CT)(Si(e)))),__elementsInitSource:(0,g.jt)(g.kw.apply(void 0,(0,u.Z)(Qo))),adaptivePricing:Ci},n=(0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},t),wi),(0,E.uN)(e,E.M4.elements_customers_beta_1)?bi:{}),(0,E.uN)(e,E.M4.blocked_card_brands_beta_2)?{allowedCardBrands:(0,g.jt)(gn.jX),disallowedCardBrands:(0,g.jt)(gn.jX)}:{}),gi(e));return(0,g.mC)(n)}(i),d||{},"elements()"),M=C.value;C.warnings.forEach((function(t){return e.warn(t)})),(0,bn.Z0)(i,!!M.customerSessionClientSecret);var R=M.__elementsInitSource||"stripe.elements",I=(0,A.ei)(M,Ni);if(Oi(I,I,"elements()",i,R,M.paymentMethodCreation),Object.keys((0,A.ei)(M,Ii)).length&&M.clientSecret)throw new P.No("Invalid options for elements(): Expected either mode or clientSecret, but not both.");!function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.clientSecret&&"SETUP_INTENT"!==(null===(e=t.clientSecret)||void 0===e?void 0:e.type)&&t.currency)throw new P.No("Invalid options for elements(): `currency` is only applicable with a SetupIntent client_secret or when a `mode` is set")}(M),(0,w.BO)(e.warn),e.updateLogParams({elements_init_source:R}),e.report("elements",{options:Pi(M)}),M.appearance&&Math.random()<.01&&e.report("appearance",{config:M.appearance}),M.loader||(M.loader="auto");var N=M.fonts,T=void 0===N?[]:N,O=M.locale,x=M.customerOptions,j=void 0===x?null:x,Z=M.customerSessionClientSecret,L=(0,m.Z)(M,pi),D=void 0!==Z?Z:void 0;p._customerOptions=j;var B=M.appearance?M.appearance:{};p._elements=[],p._id=(0,b.To)("elements-".concat((0,b.Vj)(),"-")),p._isSubmitting=!1,p._timings=(0,s.Z)((0,s.Z)({},o),{},{groupCreateTimestamp:v}),p._controller=e,p._betas=i,p._listenerRegistry=r,p._isLoaderFrameMounted=!1;var q=(0,E.jk)(O,i);p._controller.action.fetchLocale({locale:q||"auto"});var F=T.filter((function(e){return!e.cssSrc||"string"!=typeof e.cssSrc})).map((function(e){return(0,s.Z)((0,s.Z)({},e),{},{__resolveFontRelativeTo:window.location.href})})),U=T.map((function(e){return e.cssSrc})).reduce((function(e,t){return"string"==typeof t?[].concat((0,u.Z)(e),[t]):e}),[]).map((function(e){return(0,S.sD)(e)?e:(0,S.v_)(window.location.href,e)}));p._pendingFonts=U.length;var G,z,V,K,H,Y,W=(0,E.uN)(i,E.M4.payment_element_beta_1)&&!L.clientSecret,X=Mi(L,!0),Q=L.on_behalf_of,J=L.onBehalfOf,$=void 0===J?Q:J;if(!W){var ee={clientSecret:L.clientSecret,deferredIntent:X,onBehalfOf:$,customerOptions:j,customerSessionClientSecret:null!=D?D:null,currency:L.currency,loader:M.loader,locale:O,appearance:B,groupId:p._id,externalPaymentMethodTypes:L.externalPaymentMethodTypes,customPaymentMethods:L.customPaymentMethods,paymentMethodCreation:L.paymentMethodCreation,disallowedCardBrands:L.disallowedCardBrands,allowedCardBrands:L.allowedCardBrands,syncAddressCheckbox:L.syncAddressCheckbox,elementsInitSource:R,mids:a},te=L.clientSecret||X,ne=ji&&te&&!p._controller._controllerFrame.loaded&&!e._isCheckout&&!D?di((function(t,n){e.report(t,(0,s.Z)((0,s.Z)({},n),{},{population:0}))}),"payment_api_frame_v3",e._stripeJsId,{control:5,treatment:5}):null;if("treatment"===ne){var re=e.getCredentials(),oe={storeParams:ee,stripeJsId:e._stripeJsId,authentication:{key:re.publishableKey,_stripe_account:re.stripeAccount,_stripe_version:re.apiVersion},betas:e._betas,topOriginForCrossOriginFrame:(0,S.C9)()};z={groupId:p._id,controllerId:e._id,controllerLoaded:e._controllerFrame.loaded,onTimeout:function(t){e.report("fastlane_timeout_reached",{variant:ne,step:t}),e.action.setupStoreForElementsGroup({req:ee})}},V=z.groupId,K=z.controllerId,H=z.controllerLoaded,Y=z.onTimeout,Lo[V]={controllerId:K,controllerReadyForMessages:H,fastlaneOpen:!1,queue:[],timeoutIds:{register:null,init:null,store:null},onTimeout:Y},Uo("register",V),Zi(p._id,e,oe),e.action.preloadLinkStoredCredentials(),G=e.action.setupDeferredElementsStore({groupId:p._id}).then((function(){!function(e){Lo[e]&&(Go("store",e),delete Lo[e])}(p._id)}))}else G=e.action.setupStoreForElementsGroup({req:ee})}return p._commonOptions=(0,s.Z)((0,s.Z)({},L),{},{__elementsInitSource:R,betas:i,storeReadyPromise:G,appearance:B,locale:q,customerSessionClientSecret:D,get fonts(){return F}}),U.forEach((function(e){if("string"==typeof e){var t=new mt.E;ae(e).then((function(n){p._controller.report("font.loaded",{load_time:t.getElapsedTime(),font_count:n.length,css_src:e});var r=n.map((function(t){return(0,s.Z)((0,s.Z)({},t),{},{__resolveFontRelativeTo:e})}));p._controller.action.updateCSSFonts({fonts:r,groupId:p._id}),F.push.apply(F,(0,u.Z)(r))})).catch((function(n){p._controller.report("error.font.not_loaded",{load_time:t.getElapsedTime(),message:n&&n.message&&n.message,css_src:e}),p._controller.warn("Failed to load CSS file at ".concat(e,"."))}))}})),p._controller._controllerFrame._on("stripe-user-credentials-update",(function(e){var t;if(p._commonOptions.clientSecret)throw new P.No("It looks like you use client_secret in your Elements integration.\n You cannot use stripe.update() to change publishable key.\n Please follow https://stripe.com/docs/payments/defer-intent-creation to change your Elements integration.");if((0,A.sE)(p._elements,(function(e){return"linkAuthentication"===e._componentName})))throw new P.No("It looks like you use the Link Authentication Element in your Elements integration.\n stripe.update() is not supported when using the Link Authentication Element.");if((0,A.sE)(p._elements,(function(e){return"card"===e._componentName})))throw new P.No("It looks like you use the Card Element in your Elements integration.\n stripe.update() is not supported when using the Card Element. It is supported when showing the Payment Element and/or Express Checkout Element before creating an intent.\n To use stripe.update(), please follow https://docs.stripe.com/payments/payment-element/migration to change your Elements integration.");var n=(0,A.ei)(p._commonOptions,Ni),r=Mi(n,!0),o=(0,A.sE)(p._elements,(function(e){return"payButton"===e._componentName}));null==o||null===(t=o._implementation._frame)||void 0===t||t._emit("update-start"),p._controller.action.updateElementsOptions({customerOptions:void 0,customerSessionClientSecret:void 0,locale:void 0,appearance:void 0,groupId:p._id,deferredIntent:r,stripeUserCredentials:e}).then((function(){var e;xi((0,h.Z)(p)),null==o||null===(e=o._implementation._frame)||void 0===e||e._emit("update-end")}))})),(0,_.Z)(p,(0,h.Z)(p))}(0,y.Z)(t,e);var n=(0,v.Z)(t);return(0,d.Z)(t)}(le.Z),Di=Li,Bi=function(e,t,n,r,o,i,a){return new pe.Z({controller:e,authentication:t,mids:n,rawOptions:r,betas:o,queryStrategyOverride:i,listenerRegistry:a})},qi=n(1764),Fi=function(e){return function(t){return n.e(895).then(n.bind(n,9391)).then((function(n){return(0,n.makeInit)(e,t)}))}},Ui=n(2337),Gi=n(4478),zi=function(e){var t=e.controller,r=e.rawOptions,o=(0,Ui.zM)(r||{});o.warnings.forEach((function(e){t.warn(e)}));var i=o.value,a=i.clientSecret,c=i.fetchClientSecret,s=i.onComplete,u=i.onLineItemsChange,l=i.onShippingDetailsChange;if(a&&c)throw new P.No("You must provide only one of either `clientSecret` or `fetchClientSecret` to `initEmbeddedCheckout`.");if(!a&&!c)throw new P.No("You must provide one of either `clientSecret` or `fetchClientSecret` to `initEmbeddedCheckout`.");if(t.report("init_embedded_checkout",{clientSecretParam:c?"fetchClientSecret":"clientSecret",onComplete:!!s,onLineItemsChange:!!u,onShippingDetailsChange:!!l}),a){try{var d=t._betas&&(0,E.uN)(t._betas,"custom_domain_checkout");(0,Gi.V)(a,d)}catch(e){throw"InvalidCharacterError"===e.name?new P.No("Unable to parse client secret. Please ensure you are using a valid embedded Checkout client secret."):e}var p=(0,Ui.yY)(a,s);p&&t.warn(p)}return n.e(16).then(n.bind(n,4840)).then((function(e){return(0,e.init)({options:o.value,controller:t})}))},Vi=(0,g.mC)({name:(0,g.kw)("react-stripe-js","stripe-js","react-stripe-elements"),version:(0,g.AG)(g.Z_),startTime:(0,g.jt)(g.Rx)}),Ki=(0,g.ci)({name:(0,g.ui)(1,30),partner_id:(0,g.jt)(g.Z_),version:(0,g.jt)((0,g.ui)(5,15)),url:(0,g.jt)((0,g.ui)(4,60))}),Hi="stripe.js/".concat(G.X),Yi="".concat(Hi,"; stripe-js-v3/").concat(G.X),Wi=("".concat(Yi,"; raw-card"),"".concat(Yi,"; raw-stripe-js-api"),"".concat(Yi,"; create-source-card-data"),"checkout"),Xi=("".concat(Yi,"; ").concat(Wi),"".concat(Yi,"; ").concat("payment-link","; ").concat(Wi),"".concat(Yi,"; hip"),"".concat(Yi,"; payment-element")),Qi=("".concat(Xi,"; deferred-intent"),"".concat(Yi,"; card-element"),"".concat(Yi,"; split-card-element"),"".concat(Yi,"; lpm-element"),"".concat(Yi,"; payment-request-button"),"".concat(Yi,"; express-checkout-element")),Ji=("".concat(Qi,"; deferred-intent"),"dashboard"),$i=["elements","createToken","createPaymentMethod"],ea=["elements","createSource","createToken","createPaymentMethod"],ta=function(){function e(t){var n=this;(0,l.Z)(this,e),this._gets=[],this._didDetect=!1,this._onDetection=function(e){n._didDetect=!0,t(e)},window.Stripe&&window.Stripe.__cachedInstances&&this._onDetection("react-stripe-elements")}return(0,d.Z)(e,[{key:"got",value:function(e){this._didDetect||("elements"===e?this._gets=["elements"]:this._gets.push(e),this._checkForWrapper())}},{key:"called",value:function(e){this._didDetect||(this._gets=this._gets.filter((function(t){return t!==e})))}},{key:"_checkForWrapper",value:function(){(0,A.Xy)(this._gets,$i)?this._onDetection("react-stripe-js"):(0,A.Xy)(this._gets,ea)&&this._onDetection("react-stripe-elements")}}]),e}(),na=["type"],ra=function(e){if(!e||"object"!=typeof e)return null;var t=e.type;return{type:"string"==typeof t?t:null,data:(0,m.Z)(e,na)}},oa=function(e){switch(e.type){case"object":return{source:e.object};case"error":return{error:e.error};default:return(0,de.Rz)(e)}},ia={source:(0,g.mC)({id:(0,g.xe)("src_"),client_secret:(0,g.xe)("src_client_secret_")})},aa=(0,g.mC)(ia),ca=function(e){switch(e.type){case"object":return{paymentMethod:e.object};case"error":return{error:e.error};default:return(0,de.Rz)(e)}},sa=n(6274).Promise,ua=function(e,t,n,r,o,i){if("string"==typeof r)return function(e,t,n,r,o){var i=(0,g.rX)(r),a=ra(i?o:r),c=a||{type:null,data:{}},s=c.type,u=c.data;if(s&&n!==s)return sa.reject(new P.No("The type supplied in payment_method_data is not consistent."));if(i){var l=i._implementation._frame.id,d=i._componentName;return e.action.createPaymentMethodWithElement({frameId:l,elementName:d,type:n,paymentMethodData:u,mids:t,enforcePreSubmit:!1,enforcePaymentMethodCreationManual:!1}).then(ca)}return a?e.action.createPaymentMethodWithData({elementName:null,type:n,paymentMethodData:u,mids:t}).then(ca):sa.reject(new P.No("Please provide either an Element or PaymentMethod creation parameters to createPaymentMethod."))}(e,t,r,o,i);try{var a=function(e,t){return(0,g.Gu)((0,vn.q2)(null,t),e,"createPaymentMethod").value}(r,n),c=a.element,s=a.elements,u=a.type,l=a.data,d=(0,E.uN)(n,E.M4.elements_enable_deferred_intent_beta_1);if(c){var p=c._implementation._frame.id,m=c._componentName,f=["payment","expressCheckout","payButton"].indexOf(m)>-1;return e.action.createPaymentMethodWithElement({frameId:p,elementName:m,type:u,paymentMethodData:l,mids:t,enforcePreSubmit:f&&!d,enforcePaymentMethodCreationManual:f&&!d}).then(ca)}if(s){if(s._controller._id!==e._id)throw new P.No("Invalid value for stripe.createPaymentMethod(): the 'elements' provided was created by a different Stripe instance. Please use the same Stripe instance to create the 'elements' and call stripe.createPaymentMethod().");s._isSubmitting&&e.report("elements_submit_conflict.create_payment_method");var _,h=s._id,y="stripe.createPaymentMethod()";return e.action.getElementConfirmingPayment({groupId:h,errorMessageMethodName:y}).then((function(n){return _=n,e.action.createPaymentMethodWithElements({groupId:h,elements:s._elements,paymentMethodData:l,mids:t,elementConfirming:n,enforcePreSubmit:!d,enforcePaymentMethodCreationManual:!d})})).then((function(t){return(0,lr.tA)({groupId:h,elementConfirmingPayment:_,controller:e,isError:"error"in t,errorMessageMethodName:y}).then((function(){return t}))})).then((function(e){return ca(e)}))}if(u)return e.action.createPaymentMethodWithData({elementName:null,type:u,paymentMethodData:l,mids:t}).then(ca);throw new Error("No type or elements provided")}catch(e){return sa.reject(e)}},la=n(1849),da=n(125),pa=function(e){function t(e){return(0,l.Z)(this,t),n.call(this,{channel:"paypal-fraudnet",fingerprintedPath:"paypal-fraudnet-sdk-237d7a640c32a847b84ce3aab0f571ca.html",frameQueryParams:{flowId:e.flowId,sessionId:e.sessionId,sandbox:e.sandbox},on:e.on})}(0,y.Z)(t,e);var n=(0,v.Z)(t);return(0,d.Z)(t)}(da.K),ma=pa,fa=n(6274).Promise,_a=function(e,t){return new fa((function(n,r){setTimeout((function(){return r(new Error("Timeout in integrateFraudnet"))}),5e3);var o=(0,b.Vj)().replace(/-/g,""),i=new ma({sandbox:!t,flowId:e,sessionId:o,on:{onInit:function(){n(o)},onError:function(e){var t=e.error;r(t)}}});document.body&&i.mount(document.body)}))},ha=function(e){function t(e){return(0,l.Z)(this,t),n.call(this,{channel:"rechnung-device-fingerprint",fingerprintedPath:/*! STRIPE_JS_BUILD_SALT 46d24303a6*/"rechnung-device-fingerprint-sdk-80c805780bec7e13649f6347402037f8.html",frameQueryParams:{merchantId:e.merchantId,sessionId:e.sessionId,sandbox:e.sandbox},on:e.on})}(0,y.Z)(t,e);var n=(0,v.Z)(t);return(0,d.Z)(t)}(da.K),ya=ha,va=n(6274).Promise,ga=["acct_1P8KpGDMHO4ZxtzF"],ba=function(e,t,n){return new va((function(r,o){setTimeout((function(){return o(new Error("Timeout while loading Rechnung device fingerprint script"))}),1e4);var i=new ya({merchantId:e,sessionId:t,sandbox:!n,on:{onInit:function(){r()},onError:function(e){var t=e.error;o(t)}}});document.body&&i.mount(document.body)}))},wa=n(1452),ka=["payment_method","payment_method_data","payment_method_options","confirmation_token"],Sa={clientSecret:(0,g.jt)(g.Z_),redirect:(0,g.jt)((0,g.kw)("always","if_required")),confirmParams:(0,g.jt)(g.Ry),handleActions:(0,g.jt)(g.Xg)},Ca=(0,s.Z)((0,s.Z)({},Sa),{},{element:(0,g.jt)(g.Ry)}),Ea=(0,s.Z)((0,s.Z)({},Sa),{},{elements:(0,g.jt)(g.Ry)}),Aa={"stripe.confirmPayment()":{link:"https://stripe.com/docs/js/payment_intents/payment_method",action:"Payment"},"stripe.confirmSetup()":{link:"https://stripe.com/docs/js/setup_intents/payment_method",action:"Setup"}},Pa=function(e,t,n){var r=t.rawSecret,o=t.rawElement,i=t.rawElements,a=t.rawHandleActions,c=t.rawRedirect,s=t.validatedConfirmParams,u=t.elementConfirmingPayment;if((0,E.uN)(e,E.M4.payment_element_beta_1)){var l=(0,g.rX)(o);if(!l)throw new P.No("Invalid value for ".concat(n,": `element` should be a Payment Element. You specified: ").concat(typeof o,"."));return{type:"elements",element:l}}if(function(e,t){var n=e.rawSecret,r=e.rawElements;if(!n&&!r)throw new P.No("".concat(t,": expected either `elements` or `clientSecret`, but got neither."))}({rawElements:i,rawSecret:r},n),c&&!1===a)throw new P.No("".concat(n,": `redirect` not applicable when `handleActions` is false."));if(r&&!i){if(null!=s&&s.payment_method&&null!=s&&s.payment_method_data)throw new P.No("".concat(n,": Expected either `payment_method` or `payment_method_data`, but not both."));return{type:"clientSecret",clientSecret:r}}var d=(0,g.MO)(i);if(!d)throw new P.No("Invalid value for ".concat(n,": elements should be an Elements group. You specified: ").concat(typeof i,"."));var p=(0,A.sE)(d._elements,(function(e){return"payment"===e._componentName})),m=(0,A.sE)(d._elements,(function(e){return"expressCheckout"===e._componentName||"payButton"===e._componentName}));if(!p&&!m)throw new P.No("Invalid value for ".concat(n,": elements should have a mounted Payment Element or Express Checkout Element. ").concat(function(e,t){if(e&&Aa[t]){var n=Aa[t],r=n.link,o=n.action;return"It looks like you have other Elements on the page. Refer to ".concat(r," to confirm a ").concat(o," Intent by payment method.")}return""}(!!d._elements.length,n)));if("expressCheckout"===u){if(!m)throw new Error('Element confirming payment is "expressCheckout", but there is no Express Checkout Element mounted on the page.');return{type:"elements",elements:d,clientSecret:r,element:m}}if(!p){if(m)throw new P.No('Element confirming payment is "expressCheckout", but '.concat(n,' was not called within the "confirm" event. Please call ').concat(n,' in the "confirm" event (https://stripe.com/docs/js/elements_object/express_checkout_element_confirm_event).'));throw new Error('Element confirming payment is "payment", but there is no PaymentElement mounted on the page.')}if(d&&null!=s&&s.confirmation_token)throw new P.No("".concat(n,": Expected either `elements` or `confirmation_token`, but not both."));return{type:"elements",elements:d,clientSecret:r,element:p}},Ma=function(e){var t=e.betas,n=e.rawUpdateData,r=e.errorMessageMethodName,o=e.controller,i=e.elementConfirmingPayment,a=(0,g.Gu)((0,g.mC)(function(e){return(0,E.uN)(e,E.M4.payment_element_beta_1)?Ca:Ea}(t)),n,r),c=a.value,s=c.element,u=void 0===s?void 0:s,l=c.elements,d=void 0===l?void 0:l,p=c.confirmParams,m=c.clientSecret,f=c.redirect,_=c.handleActions,h=a.warnings,y=(0,g.Gu)((0,g.jt)((0,g.mC)({return_url:(0,g.jt)(g.Z_),confirmation_token:(0,g.jt)(g.Z_),payment_method:(0,g.jt)(g.Z_),payment_method_data:(0,g.jt)(g.Ry),payment_method_options:(0,g.jt)(g.Ry),setup_future_usage:(0,g.NM)("".concat(r,": do not pass setup_future_usage at confirm time. Instead, pass setup_future_usage when the PaymentIntent is created."))})),p,r,{path:["confirmParams"]}).value,v=Pa(t,{rawSecret:m,rawElement:u,rawElements:d,rawHandleActions:_,rawRedirect:f,validatedConfirmParams:y,elementConfirmingPayment:i},r),b=f||"always",w=(null==y?void 0:y.return_url)||null;return h.forEach((function(e){return o.warn(e)})),{validatedRedirect:b,validatedReturnUrl:w,validatedParams:v,validatedConfirmParams:y,validatedHandleActions:!1!==_,rawConfirmParams:p}},Ra=function(e){var t,n=e.controller,r=e.mids,o=e.betas,i=e.rawUpdateData,a=e.intentType,c=e.elementConfirmingPayment,u=e.errorMessageMethodName,l=Ma({betas:o,rawUpdateData:i,controller:n,errorMessageMethodName:u,elementConfirmingPayment:c}),d=l.validatedParams,p=l.validatedConfirmParams,f=l.validatedRedirect,_=l.validatedHandleActions,h=l.validatedReturnUrl,y=l.rawConfirmParams,v=null!=y?y:{},g=(v.payment_method,v.payment_method_data,v.payment_method_options,v.confirmation_token,(0,m.Z)(v,ka));if("clientSecret"===d.type?t=function(e){var t=e.validatedParams,n=e.validatedConfirmParams,r=e.validatedHandleActions,o=e.otherParams,i=e.intentType,a=e.mids,c=null!=n?n:{},u=c.confirmation_token,l=c.payment_method_data,d=c.payment_method,p=c.payment_method_options,m="payment"===i?(0,lr.cn)(t.clientSecret,"confirmPayment"):(0,lr.jH)(t.clientSecret,"confirmSetup"),f=(0,lr.k7)({payment_method:l}),_=(0,s.Z)((0,s.Z)({},n),o);return l&&f?{intentSecret:m,tag:"paymentMethod-from-data",type:f,data:l,options:null!=p?p:{},handleActions:r,mids:a,expectedType:f,otherParams:o,merchantParams:_}:d?{intentSecret:m,tag:"paymentMethod",paymentMethod:d,options:null!=p?p:{},handleActions:r,mids:a,expectedType:f,otherParams:(0,s.Z)({use_stripe_sdk:!0,mandate_data:{customer_acceptance:{type:"online",online:{infer_from_client:!0}}}},o),merchantParams:_}:u?{intentSecret:m,tag:"confirmationToken",confirmationToken:u,options:null!=p?p:{},handleActions:r,mids:a,expectedType:f,otherParams:o,merchantParams:_}:{tag:"none",intentSecret:m,handleActions:r,mids:a,expectedType:f,otherParams:(0,s.Z)({use_stripe_sdk:!0,mandate_data:{customer_acceptance:{type:"online",online:{infer_from_client:!0}}}},o),merchantParams:_}}({validatedParams:d,validatedConfirmParams:p,validatedHandleActions:_,otherParams:g,intentType:a,mids:r}):(!function(e){var t,n,r,o=e.validatedParams,i=e.betas,a=e.validatedReturnUrl,c=e.errorMessageMethodName;if("clientSecret"!==o.type){var s=!(null===(t=o.elements)||void 0===t||!t._commonOptions.mode),u=!(null===(n=o.elements)||void 0===n||!n._commonOptions.payment_method_types)||!(null===(r=o.elements)||void 0===r||!r._commonOptions.paymentMethodTypes);if(!(0,E.uN)(i,E.M4.elements_enable_deferred_intent_beta_1)&&s&&!u&&!a)throw new P.No("".concat(c,": the `confirmParams.return_url` argument is required when using automatic payment methods."))}}({validatedParams:d,validatedReturnUrl:h,betas:o,errorMessageMethodName:u}),t=function(e){var t,n,r,o=e.validatedParams,i=e.validatedConfirmParams,a=e.validatedHandleActions,c=e.otherParams,u=e.mids,l=e.elementConfirmingPayment,d=e.enforcePreSubmit,p=o.clientSecret?(0,_r.RY)(o.clientSecret):null;return{tag:"elements",groupId:o.element._groupId,frameId:null===(t=o.element)||void 0===t?void 0:t._implementation._frame.id,elementName:l,data:null!==(n=null==i?void 0:i.payment_method_data)&&void 0!==n?n:{},options:null!==(r=null==i?void 0:i.payment_method_options)&&void 0!==r?r:{},intentSecret:p||void 0,enforcePreSubmit:d&&!!p,otherParams:c,expectedType:null,mids:u,handleActions:a,merchantParams:(0,s.Z)((0,s.Z)({},i),c)}}({validatedParams:d,validatedConfirmParams:p,validatedHandleActions:_,otherParams:g,mids:r,elementConfirmingPayment:c,enforcePreSubmit:!(0,E.uN)(o,E.M4.elements_enable_deferred_intent_beta_1)})),"if_required"===f)return{intentMutationRequest:t,redirect:f,returnUrl:null};if("always"===f&&h)return{intentMutationRequest:t,redirect:f,returnUrl:h};throw new P.No("".concat(u,": the `confirmParams.return_url` argument is required unless passing `redirect: 'if_required'`"))},Ia=["payment_method","payment_method_data","payment_method_options"],Na="stripe.updatePaymentIntent()",Ta=(0,g.mC)({clientSecret:(0,g.jt)(vn.f4),params:(0,g.jt)((0,g.TX)({payment_method:(0,g.jt)(g.Z_),payment_method_data:(0,g.jt)(g.Ry),payment_method_options:(0,g.jt)(g.Ry)})),elements:(0,g.jt)(g.oQ)}),Oa=n(6274).Promise,xa=function(e,t){return function(n,r,o,i,a,c){var s=(0,lr.cn)(o,e),u=(0,lr.el)(e,a).handleActions,l=(0,lr.o1)({expectedType:t,label:e,rawData:i,intentSecret:s,handleActions:u,mids:r});c&&"options"in l&&(l.options=(0,A.TS)(l.options,c));var d="none"===l.tag,p=n.action.confirmPaymentIntent(l);return u?p.then((0,wa.nq)(n,d,!1,!1,l.otherParams.expand)):p.then(_r.PA)}},ja=xa("confirmAcssDebitPayment",C.GS.acss_debit),Za=xa("confirmAffirmPayment",C.GS.affirm),La=xa("confirmAfterpayClearpayPayment",C.GS.afterpay_clearpay),Da=xa("confirmAuBecsDebitPayment",C.GS.au_becs_debit),Ba=xa("confirmBacsDebitPayment",C.GS.bacs_debit),qa=xa("confirmBancontactPayment",C.GS.bancontact),Fa=xa("confirmBoletoPayment",C.GS.boleto),Ua=xa("confirmCardPayment",C.GS.card),Ga=xa("confirmEpsPayment",C.GS.eps),za=xa("confirmFpxPayment",C.GS.fpx),Va=xa("confirmGiropayPayment",C.GS.giropay),Ka=xa("confirmGopayPayment",C.GS.gopay),Ha=xa("confirmShopeepayPayment",C.GS.shopeepay),Ya=xa("confirmQrisPayment",C.GS.qris),Wa=xa("confirmGrabPayPayment",C.GS.grabpay),Xa=xa("confirmIdealPayment",C.GS.ideal),Qa=xa("confirmKlarnaPayment",C.GS.klarna),Ja=xa("confirmKonbiniPayment",C.GS.konbini),$a=xa("confirmKrCardPayment",C.GS.kr_card),ec=xa("confirmNaverPayPayment",C.GS.naver_pay),tc=xa("confirmKakaoPayPayment",C.GS.kakao_pay),nc=xa("confirmPaycoPayment",C.GS.payco),rc=xa("confirmSamsungPayPayment",C.GS.samsung_pay),oc=xa("confirmKrMarketPayment",C.GS.kr_market),ic=xa("confirmMobilepayPayment",C.GS.mobilepay),ac=xa("confirmVippsPayment",C.GS.vipps),cc=xa("confirmOxxoPayment",C.GS.oxxo),sc=xa("confirmAlipayPayment",C.GS.alipay),uc=xa("confirmP24Payment",C.GS.p24),lc=xa("confirmPayByBankPayment",C.GS.pay_by_bank),dc=xa("confirmSequraPayment",C.GS.sequra),pc=xa("confirmCapchasePayPayment",C.GS.capchase_pay),mc=xa("confirmMonduPayment",C.GS.mondu),fc=xa("confirmKriyaPayment",C.GS.kriya),_c=xa("confirmNgWalletPayment",C.GS.ng_wallet),hc=function(e,t,n,r,o){if("error"===(0,g.ld)((0,g.jt)((0,g.mC)({payment_method_options:(0,g.jt)((0,g.mC)({paypal:(0,g.jt)(g.Ry)}))})),r,"internal").type)return xa("confirmPayPalPayment",C.GS.paypal)(e,t,n,r,o);var i=(0,lr.cn)(n,"confirmPayPalPayment");return function(e,t){var n=e.keyMode()===er.Kl.live;return new fa((function(r,o){setTimeout((function(){o(new Error("Timeout in initPaypalRiskLibrary"))}),5e3),e.action.retrievePaypalMerchantId({paymentIntentId:t}).then((function(e){if("object"===e.type){var t=e.object.paypal_merchant_id,i="stripe_".concat(t,"_payments");_a(i,n).then((function(e){r(e)})).catch((function(e){o(e)}))}else o()})).catch((function(e){o(e)}))}))}(e,i.id).then((function(i){var a={paypal:{risk_correlation_id:i}};return xa("confirmPayPalPayment",C.GS.paypal)(e,t,n,r,o,a)})).catch((function(){return xa("confirmPayPalPayment",C.GS.paypal)(e,t,n,r,o)}))},yc=xa("confirmPayToPayment",C.GS.payto),vc=function(e,t,n,r,o){var i,a,c,s,u;return"error"===(0,g.ld)((0,g.jt)((0,g.mC)({payment_method_options:(0,g.jt)((0,g.mC)({rechnung:(0,g.jt)(g.Ry)}))})),r,"internal").type?xa("confirmRechnungPayment",C.GS.rechnung)(e,t,n,r,o):(i=e.keyMode()===er.Kl.live,c=(0,b.Vj)().replaceAll("-",""),s=a||"test-1",u="".concat("ud1X0qwDppce","_").concat(s,"_").concat(c),i||-1!==ga.indexOf(s)?ba(s,c,i).then((function(){return u})):va.resolve("".concat("test","_").concat(u))).then((function(i){var a={rechnung:{risk_correlation_id:i}};return xa("confirmRechnungPayment",C.GS.rechnung)(e,t,n,r,o,a)})).catch((function(){throw new P.No("Missing risk_correlation_id in payment_method_options.")}))},gc=xa("confirmSepaDebitPayment",C.GS.sepa_debit),bc=xa("confirmSofortPayment",C.GS.sofort),wc=xa("confirmIdBankTransferPayment",C.GS.id_bank_transfer),kc=xa("confirmUpiPayment",C.GS.upi),Sc=xa("confirmUsBankAccountPayment",C.GS.us_bank_account),Cc=xa("confirmNzBankAccountPayment",C.GS.nz_bank_account),Ec=xa("confirmBlikPayment",C.GS.blik),Ac=xa("confirmZipPayment",C.GS.zip),Pc=xa("confirmCustomerBalancePayment",C.GS.customer_balance),Mc=function(e,t,n,r,o){if(o&&!0===o.handleActions)throw new P.No("Expected option `handleActions` to be `false`.");var i=(0,s.Z)((0,s.Z)({},r),{},{payment_method:(0,s.Z)({},r&&r.payment_method||{})});return xa("confirmWechatPayPayment",C.GS.wechat_pay)(e,t,n,i,o,{wechat_pay:{client:"web"}})},Rc=function(e,t,n,r,o){if(!r||!r.payment_method_options||!r.payment_method_options.wechat_pay||"web"!==r.payment_method_options.wechat_pay.client&&"mobile_web"!==r.payment_method_options.wechat_pay.client)throw new P.No("Expected client value `web` or `mobile_web` in payment_method_options.");var i={};"string"==typeof r.payment_method&&(i=r.payment_method),"object"==typeof r.payment_method&&(i=(0,s.Z)({},r.payment_method||{}));var a=(0,s.Z)((0,s.Z)({},r),{},{payment_method:i,payment_method_options:(0,s.Z)((0,s.Z)({},r&&r.payment_method_options||{}),{},{wechat_pay:(0,s.Z)({},r&&r.payment_method_options&&r.payment_method_options.wechat_pay||{})})});return xa("confirmWechatPayPayment",C.GS.wechat_pay)(e,t,n,a,o)},Ic=xa("confirmCashappPayment",C.GS.cashapp),Nc=xa("confirmPayNowPayment",C.GS.paynow),Tc=xa("confirmPayNowDisplayBeta1",C.GS.paynow),Oc=xa("confirmPixPayment",C.GS.pix),xc=xa("confirmPromptPayPayment",C.GS.promptpay),jc=xa("confirmRevolutPayPayment",C.GS.revolut_pay),Zc=xa("confirmAmazonPayPayment",C.GS.amazon_pay),Lc=xa("confirmSunbitPayment",C.GS.sunbit),Dc=xa("confirmBilliePayment",C.GS.billie),Bc=xa("confirmScalapayPayment",C.GS.scalapay),qc=xa("confirmSatispayPayment",C.GS.satispay),Fc=xa("confirmNgMarketPayment",C.GS.ng_market),Uc=xa("confirmNgMarketPayment",C.GS.ng_bank),Gc=xa("confirmNgMarketPayment",C.GS.ng_bank_transfer),zc=xa("confirmNgMarketPayment",C.GS.ng_card),Vc=xa("confirmNgMarketPayment",C.GS.ng_ussd),Kc=xa("confirmNetbankingPayment",C.GS.netbanking),Hc=xa("confirmSouthKoreaMarketPayment",C.GS.south_korea_market),Yc=xa("confirmSwishPayment",C.GS.swish),Wc=xa("confirmTwintPayment",C.GS.twint),Xc=xa("confirmMultibancoPayment",C.GS.multibanco),Qc=xa("confirmMbWayPayment",C.GS.mb_way),Jc=function(e,t,n){var r=function(e,t,n){var r=(0,g.Gu)(Ta,n,Na);r.warnings.forEach((function(t){return e.warn(t)}));var o=r.value,i=o.elements,a=o.params,c=void 0===a?{}:a,u=c.payment_method,l=c.payment_method_data,d=c.payment_method_options,p=(0,m.Z)(c,Ia),f=o.clientSecret;if(i){var _=(0,A.sE)(i._elements,(function(e){return"payment"===e._componentName}));return _?{tag:"elements",elementName:"payment",frameId:_._implementation._frame.id,groupId:i._id,data:null!=l?l:{},options:null!=d?d:{},intentSecret:f,otherParams:p,handleActions:!1,expectedType:null,enforcePreSubmit:!1,mids:t,merchantParams:r.value.params}:{tag:"shipping-from-elements",groupId:i._id,data:null!=l?l:{},options:null!=d?d:{},intentSecret:f,otherParams:p,handleActions:!1,expectedType:(0,lr.IV)(null==l?void 0:l.type),mids:t,merchantParams:r.value.params}}if(!f)throw new P.No("".concat(Na,": expected either `elements` or `clientSecret`, but got neither."));if(u&&l)throw new P.No("".concat(Na,": Expected either `payment_method` or `payment_method_data`, but not both."));var h=(0,lr.IV)(null==l?void 0:l.type);return l&&h?{intentSecret:f,tag:"paymentMethod-from-data",type:h,data:l,options:null!=d?d:{},mids:t,expectedType:h,otherParams:p,handleActions:!1,merchantParams:r.value.params}:u?{intentSecret:f,tag:"paymentMethod",paymentMethod:u,options:null!=d?d:{},mids:t,expectedType:h,otherParams:(0,s.Z)({mandate_data:{customer_acceptance:{type:"online",online:{infer_from_client:!0}}}},p),handleActions:!1,merchantParams:r.value.params}:{intentSecret:f,tag:"none",mids:t,expectedType:h,otherParams:p,handleActions:!1,merchantParams:r.value.params}}(e,t,n);return e.action.updatePaymentIntent(r).then(_r.PA)},$c=function(e,t,n,r){var o=(0,lr.cn)(n,"updatePaymentIntent"),i=(0,lr.k7)(r),a=(0,lr.o1)({expectedType:i,label:"updatePaymentIntent",rawData:r,intentSecret:o,mids:t,handleActions:!1});return e.action.updatePaymentIntent((0,s.Z)({},a)).then(_r.PA)},es=function(e){var t;return"error"in e&&"external_payment_method_selected"===e.error.code?{selectedPaymentMethod:null===(t=e.error.extra_fields)||void 0===t?void 0:t.selectedPaymentMethod}:e},ts=function(e,t){return function(e,t){var n=(0,lr.cn)(e,"retrievePaymentIntent");return t.action.retrievePaymentIntent({intentSecret:n,hosted:!1})}(e,t).then(_r.PA)},ns=function(e,t,n){var r=(0,lr.cn)(t,"verifyMicrodepositsForPayment"),o=(0,g.Gu)(g.Ry,n,"stripe.verifyMicrodepositsForPayment");return e.action.verifyMicrodepositsForPayment({intentSecret:r,data:o.value}).then(_r.PA)},rs=function(e,t,n){var r=(0,lr.cn)(t,"collectUsBankAccountForPayment"),o=(0,g.Gu)((0,vn.ZY)("us_bank_account"),n,"stripe.collectUsBankAccountForPayment").value,i=o.paymentMethodData,a=o.otherParams;return(0,ar.ri)(r.clientSecret,r.id,e,i).then((function(t){return t.error?e.action.localizeError(t.error).then((function(e){var t=e.error;return Oa.resolve({error:t})})):t.linkAccountSession.paymentAccount?e.action.attachLinkAccountSessionForPayment({intentSecret:r,linkAccountSessionId:t.linkAccountSession.id,expandParam:a.expand}).then((function(e){return(0,_r.PA)(e)})):e.action.retrievePaymentIntent({intentSecret:r,hosted:!1}).then(_r.PA)}))},os=function(e,t,n){var r=(0,g.Gu)((0,vn.as)(vn.f4,t),n,"stripe.collectBankAccountForPayment").value,o=r.clientSecret,i=r.paymentMethodData,a=r.onEvent,c=r.otherParams;return(0,ar.ri)(o.clientSecret,o.id,e,i,a).then((function(t){return t.error?e.action.localizeError(t.error).then((function(e){var t=e.error;return Oa.resolve({error:t})})):t.linkAccountSession.paymentAccount?e.action.attachLinkAccountSessionForPayment({intentSecret:o,linkAccountSessionId:t.linkAccountSession.id,expandParam:c.expand}).then((function(e){return(0,_r.PA)(e)})):e.action.retrievePaymentIntent({intentSecret:o,hosted:!1}).then(_r.PA)}))},is=function(e,t){var n=(0,lr.cn)(e,"handleCardAction");return t.action.retrievePaymentIntent({intentSecret:n,hosted:!1}).then((function(e){var n=(0,wa.Fh)(e);switch(n.type){case"error":return Oa.resolve((0,_r.PA)(e));case"object":var r=n.object;if((0,_r.mD)(r.status)){if("manual"!==r.confirmation_method)throw new P.No("handleCardAction: The PaymentIntent supplied does not require manual server-side confirmation. Please use confirmCardPayment instead to complete the payment.");return(0,wa.gO)(t,r,n.locale,!1,!1)}throw new P.No("handleCardAction: The PaymentIntent supplied is not in the requires_action state.");default:return(0,de.Rz)(n)}}))},as=n(6042),cs=n(6274).Promise,ss=lr.OV,us=function(e){return!("paymentMethod-from-data"===e.tag&&e.data.acss_debit)},ls=function(e){return null!==e&&"object"==typeof e&&!0===e.skipMandate},ds=function(e){return null!==e&&"object"==typeof e&&!!e.shouldCreatePaymentMethod},ps=function(e){var t=e.controller,n=e.shouldCreatePaymentMethod,r=e.intentSecret,o=e.confirmIntentData,i=e.embeddedContext,a=e.locale;if(i){var c=i.embeddedToOuterMessenger;return c.send("show_acss_dialog",{intentSecret:r,shouldCreatePaymentMethod:n,confirmIntentData:o,localeOverride:a}),new cs((function(e){c.on("show_acss_dialog_result",(function(t){e(t)}))}))}return t.action.createAcssDebitSession({intentSecret:r,shouldCreatePaymentMethod:n,confirmIntentData:o,localeOverride:a}).then((function(e){if("error"===e.type)return{type:"error",error:e.error};var n=(0,as.q)(t,{url:(0,ge.jr)(e.object.url),size:"400x600",locale:e.locale,frameTitle:"acss.dialog_frame_title",useLightboxHostedCloseButton:!1});return new cs((function(e){n._on("request-close",(function(){(0,as.G)(n).then((function(){return t.action.localizeError(lr.LR)})).then((function(t){var n=t.error;e({type:"error",error:n})}))})),n._on("session-complete",(function(t){var r=t.paymentMethod;(0,as.G)(n).then((function(){e({type:"success",paymentMethod:r})}))}))}))}))},ms=function(e,t,n,r,o){var i="confirmAcssDebitPayment",a=C.GS.acss_debit,c=(0,lr.cn)(n,i),s=(0,lr.o1)({expectedType:a,label:i,rawData:r,intentSecret:c,mids:t,handleActions:!1}),u=ds(o);return ss(o,i),ls(o)||!us(s)?e.action.confirmPaymentIntent(s).then(_r.PA):ps({controller:e,shouldCreatePaymentMethod:u,intentSecret:c,confirmIntentData:s}).then((function(n){switch(n.type){case"error":return{error:n.error};case"success":return e.action.confirmPaymentIntent({tag:"paymentMethod",paymentMethod:n.paymentMethod,options:"options"in s&&s.options?s.options:{},intentSecret:c,otherParams:s.otherParams,expectedType:a,handleActions:!1,mids:t,merchantParams:s.merchantParams}).then(_r.PA);default:return(0,de.Rz)(n)}}))},fs=function(e,t,n,r,o){var i="confirmAcssDebitSetup",a=C.GS.acss_debit,c=(0,lr.jH)(n,i),s=(0,lr.o1)({expectedType:a,label:i,rawData:r,intentSecret:c,mids:t,handleActions:!1}),u=ds(o);return ss(o,i),ls(o)||!us(s)?e.action.confirmSetupIntent(s).then(_r.e3):ps({controller:e,shouldCreatePaymentMethod:u,intentSecret:c,confirmIntentData:s}).then((function(n){switch(n.type){case"error":return{error:n.error};case"success":return e.action.confirmSetupIntent({tag:"paymentMethod",paymentMethod:n.paymentMethod,options:"options"in s&&s.options?s.options:{},intentSecret:c,otherParams:s.otherParams,expectedType:a,handleActions:!1,mids:t,merchantParams:s.merchantParams}).then(_r.e3);default:return(0,de.Rz)(n)}}))},_s=n(623),hs=n(6274).Promise,ys=function(e,t){var n=(0,g.Gu)((0,g.mC)({clientSecret:vn.Hv}),t,"stripe.handleNextAction").value.clientSecret;return"SETUP_INTENT"===n.type?function(e,t){return e.action.retrieveSetupIntent({intentSecret:t,hosted:!1}).then((function(t){switch(t.type){case"error":return hs.resolve((0,_r.e3)(t));case"object":var n=t.object;if((0,_r.mD)(n.status))return(0,_s.i)(e,n,t.locale,!1);throw new P.No("handleNextAction: The SetupIntent supplied is not in the requires_action state.");default:return(0,de.Rz)(t)}}))}(e,n):function(e,t){return e.action.retrievePaymentIntent({intentSecret:t,hosted:!1}).then((function(t){switch(t.type){case"error":return hs.resolve((0,_r.PA)(t));case"object":var n=t.object;if((0,_r.mD)(n.status))return(0,wa.gO)(e,n,t.locale,!1,!1);throw new P.No("handleNextAction: The PaymentIntent supplied is not in the requires_action state.");default:return(0,de.Rz)(t)}}))}(e,n)},vs=["type"],gs=["source","source_data","payment_method","payment_method_data"],bs=["payment_intent"],ws=function(e,t,n){if(null==e)return(0,g.x4)(null);var r=e.type,o=(0,m.Z)(e,vs),i=(0,g.Wc)(g.Z_,(function(){return null}))(r,t,(0,g.NQ)(n,"type"));return"error"===i.type?i:(0,g.x4)({type:i.value,data:o})},ks=function(e,t,n,r){if(null===e){if(null===t){var o=r?"source_data":"payment_method_data";throw new P.No("".concat(n,": you must additionally specify the type of payment method to create within ").concat(o,"."))}return t}if(null===t)return e;if(t!==e)throw new P.No("".concat(n,": you specified `type: ").concat(t,"`, but ").concat(n," will create a ").concat(e," payment method."));return e},Ss=function(e){return function(t,n,r){if((0,ze.Kn)(t)){var o=t.source,i=t.source_data,a=t.payment_method,c=t.payment_method_data,u=(0,m.Z)(t,gs);if(null!=o&&"string"!=typeof o)return(0,g.RH)("string",typeof o,n,(0,g.NQ)(r,"source"));if(null!=a&&"string"!=typeof a)return(0,g.RH)("string",typeof a,n,(0,g.NQ)(r,"payment_method"));if(null!=i&&!(0,ze.Kn)(i))return(0,g.RH)("object",typeof i,n,(0,g.NQ)(r,"source_data"));if(null!=c&&!(0,ze.Kn)(c))return(0,g.RH)("object",typeof c,n,(0,g.NQ)(r,"payment_method_data"));var l=ws(i,n,(0,g.NQ)(r,"source_data"));if("error"===l.type)return l;var d=l.value,p=ws(c,n,(0,g.NQ)(r,"payment_method_data"));if("error"===p.type)return p;var f=p.value;return(0,g.x4)({sourceData:d,source:null==o?null:o,paymentMethodData:f,paymentMethod:null==a?null:a,otherParams:(0,s.Z)((0,s.Z)({},e),u)})}return null===t?(0,g.RH)("object","null",n,r):(0,g.RH)("object",typeof t,n,r)}},Cs=function(e){return function(t,n,r){if(void 0===t)return(0,g.x4)({sourceData:null,paymentMethodData:null,source:null,paymentMethod:null,otherParams:{}});if("object"!=typeof t)return(0,g.RH)("object",typeof t,n,r);if(null===t)return(0,g.RH)("object","null",n,r);if(e){if(!t.payment_intent){var o=(0,g.Gu)((0,g.mC)({return_url:(0,g.jt)(g.Z_),expand:(0,g.jt)((0,g.CT)(g.Z_)),shipping:(0,g.jt)((0,g.ci)({name:g.Z_,address:(0,g.ci)({line1:(0,g.jt)(g.Z_),line2:(0,g.jt)(g.Z_),city:(0,g.jt)(g.Z_),state:(0,g.jt)(g.Z_),postal_code:(0,g.jt)(g.Z_),country:(0,g.jt)(g.Z_)})}))}),t,"validate otherParams").value,i=(0,s.Z)((0,s.Z)({},t),o);return(0,g.x4)({sourceData:null,paymentMethodData:null,source:null,paymentMethod:null,otherParams:i})}var a=t.payment_intent,c=(0,m.Z)(t,bs);return Ss(c)(a,n,(0,g.NQ)(r,"payment_intent"))}return t.payment_intent?(0,g.zS)(new P.No("The payment_intent parameter has been removed. To fix, move everything nested under the payment_intent parameter to the top-level object.")):Ss({})(t,n,r)}},Es=function(e){var t=e.allowSourceCreation,n=e.useLegacyConfirmShape,r=e.expectedType,o=e.label,i=e.intentSecret,a=e.elementOrData,c=e.possibleData,u=e.mids,l=e.handleActions,d=function(e){var t=e.allowSourceCreation,n=e.useLegacyConfirmShape,r=e.expectedType,o=e.label,i=e.elementOrData,a=e.possibleData,c=e.intentSecret,u=e.mids,l=e.handleActions,d=(0,g.rX)(i);if(!d)return null;var p=(0,g.Gu)(Cs(n),a,o).value,m=p.sourceData,f=p.source,_=p.paymentMethodData,h=p.paymentMethod,y=p.otherParams;if(!t&&m)throw new P.No("".concat(o,": Expected payment_method_data, not source_data."));if(null!=f)throw new P.No("When calling ".concat(o," on an Element, you can't pass in a pre-existing source ID, as a source will be created using the Element."));if(null!=h)throw new P.No("When calling ".concat(o," on an Element, you can't pass in a pre-existing PaymentMethod ID, as a PaymentMethod will be created using the Element."));var v=d._componentName,b=d._implementation._frame.id,w=m||_||{type:null,data:{}},k=w.type,S=w.data,E=(0,C.ZX)(v,k),A=t&&!_,M={elementName:v,frameId:b,type:ks(r,E,o,A),data:S};return A?(0,s.Z)({tag:"source-from-element",intentSecret:c,otherParams:y,mids:u,expectedType:r,handleActions:l,merchantParams:(0,s.Z)({source_data:S},y)},M):(0,s.Z)({tag:"paymentMethod-from-element",options:null,intentSecret:c,otherParams:y,mids:u,expectedType:r,handleActions:l,merchantParams:(0,s.Z)({payment_method_data:S},y)},M)}({allowSourceCreation:t,useLegacyConfirmShape:n,expectedType:r,label:o,elementOrData:a,possibleData:c,intentSecret:i,mids:u,handleActions:l});if(d)return d;var p=function(e){var t=e.allowSourceCreation,n=e.useLegacyConfirmShape,r=e.expectedType,o=e.label,i=e.rawData,a=e.intentSecret,c=e.mids,u=e.handleActions,l=(0,g.Gu)(Cs(n),i,o).value,d=l.sourceData,p=l.source,m=l.paymentMethodData,f=l.paymentMethod,_=l.otherParams;if(!t&&d)throw new P.No("".concat(o,": Expected payment_method, source, or payment_method_data, not source_data."));var h=d||m;if(null!==p&&null!==d)throw new P.No("".concat(o,": Expected either source or source_data, but not both."));if(null!==f&&null!==m)throw new P.No("".concat(o,": Expected either payment_method or payment_method_data, but not both."));if(null!==f&&null!==p)throw new P.No("".concat(o,": Expected either payment_method or source, but not both."));if(h){var y=h.type,v=h.data,b=t&&!m,w=ks(r,y,o,b);return b?{tag:"source-from-data",intentSecret:a,type:w,data:v,mids:c,expectedType:r,otherParams:_,handleActions:u,merchantParams:(0,s.Z)({source_data:(0,s.Z)({type:w},v)},_)}:{tag:"paymentMethod-from-data",type:w,data:v,intentSecret:a,options:null,mids:c,expectedType:r,otherParams:_,handleActions:u,merchantParams:(0,s.Z)({payment_method_data:(0,s.Z)({type:w},v)},_)}}return null!==p?{tag:"source",intentSecret:a,source:p,mids:c,expectedType:r,otherParams:_,handleActions:u,merchantParams:(0,s.Z)({source:p},_)}:null!==f?{tag:"paymentMethod",paymentMethod:f,intentSecret:a,options:null,mids:c,expectedType:r,otherParams:_,handleActions:u,merchantParams:(0,s.Z)({payment_method:f},_)}:{tag:"none",intentSecret:a,mids:c,expectedType:r,otherParams:_,handleActions:u,merchantParams:_}}({allowSourceCreation:t,useLegacyConfirmShape:n,expectedType:r,label:o,rawData:a,intentSecret:i,mids:u,handleActions:l});if(p)return p;throw new P.No("Expected: stripe.".concat(o,"(intentSecret, element[, data]) or stripe.").concat(o,"(intentSecret[, data]). Please see the docs for more usage examples https://stripe.com/docs/payments/dynamic-authentication"))},As=function(e,t,n,r,o,i){var a=(0,g.Gu)(vn.f4,r,"stripe.confirmPaymentIntent intent secret").value,c=Es({allowSourceCreation:e,useLegacyConfirmShape:!1,expectedType:null,label:"confirmPaymentIntent",intentSecret:a,elementOrData:o,possibleData:i,handleActions:!1,mids:n});return t.action.confirmPaymentIntent(c).then(_r.PA)},Ps=function(e,t,n,r,o,i,a){var c=(0,g.Gu)(vn.f4,o,"stripe.handleCardPayment intent secret").value,s=C.GS.card,u=Es({allowSourceCreation:e,useLegacyConfirmShape:r,expectedType:s,label:"handleCardPayment",intentSecret:c,elementOrData:i,possibleData:a,handleActions:!0,mids:n}),l=!i&&!a;return t.action.confirmPaymentIntent(u).then((0,wa.nq)(t,l,!1,!1))},Ms=function(e,t,n,r,o,i){var a=(0,g.Gu)(vn.f4,r,"stripe.handleSepaDebitPayment intent secret").value,c=C.GS.sepa_debit,s=Es({allowSourceCreation:!1,useLegacyConfirmShape:n,expectedType:c,label:"handleSepaDebitPayment",intentSecret:a,elementOrData:o,possibleData:i,handleActions:!0,mids:t}),u=!o&&!i;return e.action.confirmPaymentIntent(s).then((0,wa.nq)(e,u,!1,!1))},Rs=function(e,t,n,r,o,i,a){var c=(0,g.Gu)(vn.f4,o,"stripe.handleIdealPayment intent secret").value,s=C.GS.ideal,u=Es({allowSourceCreation:e,useLegacyConfirmShape:r,expectedType:s,label:"handleIdealPayment",intentSecret:c,elementOrData:i,possibleData:a,handleActions:!0,mids:n}),l=!i&&!a;return t.action.confirmPaymentIntent(u).then((0,wa.nq)(t,l,!1,!1))},Is=function(e,t,n,r,o,i){var a=(0,g.Gu)(vn.f4,r,"stripe.handleFpxPayment intent secret").value,c=C.GS.fpx,s=Es({allowSourceCreation:!1,useLegacyConfirmShape:n,expectedType:c,label:"handleFpxPayment",intentSecret:a,elementOrData:o,possibleData:i,handleActions:!0,mids:t}),u=!o&&!i;return e.action.confirmPaymentIntent(s).then((0,wa.nq)(e,u,!1,!1))},Ns=function(e){switch(e.type){case"object":return{returnIntent:e.object};case"error":return{error:e.error};default:return(0,de.Rz)(e)}},Ts=function(e,t,n){var r=(0,g.Gu)((0,g.jt)(g.Ry),n,"stripe.confirmReturnIntent"),o=r.warnings,i=r.value;return o.forEach((function(t){return e.warn(t)})),e.action.confirmReturnIntent({returnIntentId:t,data:i||{}}).then(Ns)},Os=n(6274).Promise,xs=function(e,t){return function(n,r,o,i,a){var c=(0,lr.jH)(o,e),s=(0,lr.el)(e,a).handleActions,u=(0,lr.o1)({expectedType:t,label:e,rawData:i,intentSecret:c,mids:r,handleActions:s}),l="none"===u.tag,d=n.action.confirmSetupIntent(u);return s?d.then((0,_s.k)(n,l,!1,u.otherParams.expand)):d.then(_r.e3)}},js=xs("confirmAcssDebitSetup",C.GS.acss_debit),Zs=xs("confirmAfterpayClearpaySetup",C.GS.afterpay_clearpay),Ls=xs("confirmAmazonPaySetup",C.GS.amazon_pay),Ds=xs("confirmCardSetup",C.GS.card),Bs=xs("confirmSepaDebitSetup",C.GS.sepa_debit),qs=xs("confirmAuBecsDebitSetup",C.GS.au_becs_debit),Fs=xs("confirmBacsDebitSetup",C.GS.bacs_debit),Us=xs("confirmCashappSetup",C.GS.cashapp),Gs=xs("confirmIdealSetup",C.GS.ideal),zs=xs("confirmKrCardSetup",C.GS.kr_card),Vs=xs("confirmKrMarketSetup",C.GS.kr_market),Ks=xs("confirmKrMarketSetup",C.GS.ng_market),Hs=xs("confirmNgCardSetup",C.GS.ng_card),Ys=xs("confirmAlipaySetup",C.GS.alipay),Ws=xs("confirmSofortSetup",C.GS.sofort),Xs=xs("confirmBancontactSetup",C.GS.bancontact),Qs=xs("confirmIdBankTransferSetup",C.GS.id_bank_transfer),Js=xs("confirmPayPalSetup",C.GS.paypal),$s=xs("confirmPayToSetup",C.GS.payto),eu=xs("confirmRevolutPaySetup",C.GS.revolut_pay),tu=xs("confirmUsBankAccountSetup",C.GS.us_bank_account),nu=xs("confirmUpiSetup",C.GS.upi),ru=xs("confirmNzBankAccountSetup",C.GS.nz_bank_account),ou=xs("confirmKlarnaSetup",C.GS.klarna),iu=function(e){var t;return"error"in e&&"external_payment_method_selected"===e.error.code?{selectedPaymentMethod:null===(t=e.error.extra_fields)||void 0===t?void 0:t.selectedPaymentMethod}:e},au=function(e,t){return function(e,t){var n=(0,lr.jH)(e,"retrieveSetupIntent");return t.action.retrieveSetupIntent({intentSecret:n,hosted:!1})}(e,t).then(_r.e3)},cu=function(e,t,n){var r=(0,lr.jH)(t,"verifyMicrodepositsForSetup"),o=(0,g.Gu)(g.Ry,n,"stripe.verifyMicrodepositsForSetup");return e.action.verifyMicrodepositsForSetup({intentSecret:r,data:o.value}).then(_r.e3)},su=function(e,t,n){var r=(0,lr.jH)(t,"collectUsBankAccountForSetup"),o=(0,g.Gu)((0,vn.ZY)("us_bank_account"),n,"stripe.collectUsBankAccountForSetup").value,i=o.paymentMethodData,a=o.otherParams;return(0,ar.At)(r.clientSecret,r.id,e,i).then((function(t){return t.error?e.action.localizeError(t.error).then((function(e){var t=e.error;return Os.resolve({error:t})})):t.linkAccountSession.paymentAccount?e.action.attachLinkAccountSessionForSetup({intentSecret:r,linkAccountSessionId:t.linkAccountSession.id,expandParam:a.expand}).then((function(e){return(0,_r.e3)(e)})):e.action.retrieveSetupIntent({intentSecret:r,hosted:!1}).then(_r.e3)}))},uu=function(e,t,n){var r=(0,g.Gu)((0,vn.as)(vn.Yj,t),n,"stripe.collectBankAccountForSetup").value,o=r.clientSecret,i=r.paymentMethodData,a=r.onEvent,c=r.otherParams;return(0,ar.At)(o.clientSecret,o.id,e,i,a).then((function(t){return t.error?e.action.localizeError(t.error).then((function(e){var t=e.error;return Os.resolve({error:t})})):t.linkAccountSession.paymentAccount?e.action.attachLinkAccountSessionForSetup({intentSecret:o,linkAccountSessionId:t.linkAccountSession.id,expandParam:c.expand}).then((function(e){return(0,_r.e3)(e)})):e.action.retrieveSetupIntent({intentSecret:o,hosted:!1}).then(_r.e3)}))},lu=function(e,t,n,r,o){var i=(0,g.Gu)(vn.Yj,n,"stripe.handleCardSetup intent secret").value,a=C.GS.card,c=Es({allowSourceCreation:!1,useLegacyConfirmShape:!1,expectedType:a,label:"handleCardSetup",intentSecret:i,elementOrData:r,possibleData:o,handleActions:!0,mids:t}),s=!r&&!o;return e.action.confirmSetupIntent(c).then((0,_s.k)(e,s,!1,c.otherParams.expand))},du=function(e,t,n,r,o){var i=(0,g.Gu)(vn.Yj,n,"stripe.handleSepaDebitSetup intent secret").value,a=C.GS.sepa_debit,c=Es({allowSourceCreation:!1,useLegacyConfirmShape:!1,expectedType:a,label:"handleSepaDebitSetup",intentSecret:i,elementOrData:r,possibleData:o,handleActions:!0,mids:t}),s=!r&&!o;return e.action.confirmSetupIntent(c).then((0,_s.k)(e,s,!1))},pu=function(e,t,n,r,o){var i=(0,g.Gu)(vn.Yj,n,"stripe.confirmSetupIntent intent secret").value,a=Es({allowSourceCreation:!1,useLegacyConfirmShape:!1,expectedType:null,label:"confirmSetupIntent",intentSecret:i,elementOrData:r,possibleData:o,mids:t,handleActions:!1});return e.action.confirmSetupIntent(a).then(_r.e3)},mu=n(6274).Promise,fu=function(e,t){var n=function(e){if("string"==typeof e){var t=e.trim().match(/^((vi|vs)_[0-9a-zA-Z]+)_secret_(.+)$/);if(!t)throw new P.No("stripe.verifyIdentity: Could not parse client secret.");return{identityClientSecret:t[0],id:t[1],token:t[3]}}throw new P.No("stripe.verifyIdentity: Could not parse client secret.")}(e),r=n.id,o=function(e){return"".concat(U.Ht,"start/").concat(e)}(n.token);return function(e){var t=e.controller,n=e.url,r=(e.id,e.locale),o=void 0===r?"en-US":r,i=(0,as.q)(t,{url:(0,ge.jr)(n),size:"400x600",frameTitle:"identity.verification_frame_title",locale:o,useLightboxHostedCloseButton:!0,allowCamera:!0,appType:"identity"});return new mu((function(e){var t={type:"user_action",code:"session_cancelled"};i._on("identity-frame-close",(function(){(0,as.G)(i).then((function(){e({error:t})}))})),i._on("identity-frame-error",(function(e){var n=e.type,r=e.code;t={type:n,code:r}})),i._on("identity-frame-session-complete",(function(){t=null})),i._on("request-close",(function(){(0,as.G)(i).then((function(){e({error:t})}))}))}))}({controller:t,url:o,id:r})},_u=["number","cvc","pin.number"],hu=function(e,t,n){if("string"!=typeof e)return(0,g.$3)("an Issuing card ID of the form ic_xxx",e,t,n);var r,o=(r=e.trim().match(/ic_[a-zA-Z0-9_]+$/))?r[0]:null;return null===o?(0,g.$3)("an Issuing card ID of the form ic_xxx",e,t,n):(0,g.x4)(o,[])},yu=function(e,t){return(0,g.Gu)(hu,e,"stripe.".concat(t," cardId")).value},vu=function(e,t,n){if("string"!=typeof e)return(0,g.$3)("an ephemeral key secret of the form ek_xxx",e,t,n);var r,o=(r=e.trim().match(/ek_[a-zA-Z0-9_]+$/))?r[0]:null;return null===o?(0,g.$3)("an ephemeral key secret of the form ek_xxx",e,t,n):(0,g.x4)(o,[])},gu=function(e,t,n){return"string"!=typeof e?(0,g.$3)("a string",e,t,n):_u.indexOf(e)<0?(0,g.$3)("any of ".concat(_u.join(", ")),e,t,n):(0,g.x4)(e,[])},bu=function(e,t){return(0,g.Gu)(vu,e,"stripe.".concat(t," ephemeral key secret")).value},wu=function(e,t,n){if("string"!=typeof e)return(0,g.$3)("an ephemeral key nonce of the form ephkn_xxx",e,t,n);var r,o=(r=e.trim().match(/ephkn_[a-zA-Z0-9_]+$/))?r[0]:null;return null===o?(0,g.$3)("an ephemeral key nonce of the form ephkn_xxx",e,t,n):(0,g.x4)(o,[])},ku=function(e){if("object"==typeof e&&e&&e.ephemeralKeySecret&&e.nonce){var t,n=bu(e.ephemeralKeySecret,"retrieveIssuingCard"),r=(o=e.nonce,i="retrieveIssuingCard",(0,g.Gu)(wu,o,"stripe.".concat(i," ephemeral key nonce")).value);return Array.isArray(e.expand)&&(t=e.expand.map((function(e){return function(e,t){return(0,g.Gu)(gu,e,"stripe.".concat(t," expand param")).value}(e,"retrieveIssuingCard")}))),{ephemeralKeySecret:n,publicNonce:r,expand:t}}throw new P.No("When retrieving an Issuing card, you must specify an ephemeral key secret and an ephemeral key nonce in the options argument of stripe.retrieveIssuingCard.");var o,i},Su=function(e,t){return function(e){if("object"==typeof e&&e&&e.issuingCard)return{issuingCard:yu(e.issuingCard,"createEphemeralKeyNonce")};throw new P.No("When creating an ephemeral key nonce, you must specify an Issuing card ID in the options argument of stripe.createEphemeralKeyNonce.")}(e),t.action.createEphemeralKeyNonce().then(pt)},Cu=[E.M4.checkout_beta_2,E.M4.checkout_beta_3,E.M4.checkout_beta_4],Eu=[E.M4.checkout_beta_2,E.M4.checkout_beta_3,E.M4.checkout_beta_4,E.M4.checkout_beta_locales,E.M4.checkout_beta_testcards],Au={bg:"bg",cs:"cs",da:"da",de:"de",el:"el",en:"en","en-GB":"en-GB",es:"es","es-419":"es-419",et:"et",fi:"fi",fil:"fil",fr:"fr","fr-CA":"fr-CA",hr:"hr",hu:"hu",id:"id",it:"it",ja:"ja",ko:"ko",lt:"lt",lv:"lv",ms:"ms",mt:"mt",nb:"nb",nl:"nl",pl:"pl",pt:"pt","pt-BR":"pt-BR",ro:"ro",ru:"ru",sk:"sk",sl:"sl",sv:"sv",th:"th",tr:"tr",vi:"vi",zh:"zh","zh-HK":"zh-HK","zh-TW":"zh-TW"},Pu={"pt-PT":"pt-PT"},Mu=Object.keys(Au),Ru=Object.keys(Pu),Iu=["sku","plan","items"],Nu=["sessionId","sku","plan","items","lineItems","successUrl","cancelUrl","mode"],Tu={sku:(0,g.jt)(g.Z_),plan:(0,g.jt)(g.Z_),clientReferenceId:(0,g.jt)(g.Z_),locale:(0,g.jt)(g.kw.apply(void 0,["auto"].concat((0,u.Z)(Mu)))),customerEmail:(0,g.jt)(g.Z_),billingAddressCollection:(0,g.jt)((0,g.kw)("required","auto")),submitType:(0,g.jt)((0,g.kw)("auto","pay","book","donate")),allowIncompleteSubscriptions:(0,g.jt)(g.Xg),shippingAddressCollection:(0,g.jt)((0,g.ci)({allowedCountries:(0,g.CT)(g.Z_)}))},Ou=/cs_(test|live)_.+/,xu=function(e,t){var n=(0,g.ci)((0,s.Z)((0,s.Z)({},Tu),{},{items:(0,g.jt)((0,g.or)((0,g.CT)((0,g.ci)({type:(0,g.kw)("plan"),quantity:(0,g.M4)(0),id:g.Z_})),(0,g.CT)((0,g.ci)({type:(0,g.kw)("sku"),quantity:(0,g.M4)(0),id:g.Z_})))),successUrl:g.Z_,cancelUrl:g.Z_})),r=(0,g.Gu)(n,t,"stripe.redirectToCheckout").value,o=r.sku,i=r.plan,a=r.items,c=(0,m.Z)(r,Iu),u=function(e,t,n){if(e&&t||(e||t)&&n)throw new P.No("stripe.redirectToCheckout: Expected only one of sku, plan, or items.");if("string"==typeof e)return[{sku:e,quantity:1}];if("string"==typeof t)return[{plan:t,quantity:1}];if(n)return n.map((function(e){return"sku"===e.type?{sku:e.id,quantity:e.quantity}:{plan:e.id,quantity:e.quantity}}));throw new P.No("stripe.redirectToCheckout: You must provide either sku, plan, or items.")}(o,i,a);return(0,s.Z)({tag:"no-session",items:u},c)},ju=function(e,t,n){var r=(0,g.ci)((0,s.Z)((0,s.Z)({},Tu),{},{sessionId:(0,g.jt)(g.Z_),successUrl:(0,g.jt)(g.Z_),cancelUrl:(0,g.jt)((0,g.AG)(g.Z_)),mode:(0,g.jt)((0,g.kw)("subscription","payment")),items:(0,g.jt)((0,g.or)((0,g.CT)((0,g.ci)({quantity:(0,g.M4)(0),plan:g.Z_})),(0,g.CT)((0,g.ci)({quantity:(0,g.M4)(0),sku:g.Z_})))),lineItems:(0,g.jt)((0,g.CT)((0,g.ci)({quantity:(0,g.M4)(0),price:g.Z_})))},-1!==e.indexOf("checkout_beta_locales")?{locale:(0,g.jt)(g.kw.apply(void 0,["auto"].concat((0,u.Z)(Mu),(0,u.Z)(Ru))))}:{})),o=(0,g.Gu)(r,t,"stripe.redirectToCheckout").value;if(o.sessionId){var i=o.sessionId;if(Object.keys(o).length>1)throw new P.No("stripe.redirectToCheckout: Do not provide other parameters when providing sessionId. Specify all parameters on your server when creating the CheckoutSession.");if(!/^cs_/.test(i))throw new P.No("stripe.redirectToCheckout: Invalid value for sessionId. You specified '".concat(i,"'."));if("live"===n&&/^cs_test_/.test(i))throw new P.No("stripe.redirectToCheckout: the provided sessionId is for a test mode Checkout Session, whereas Stripe.js was initialized with a live mode publishable key.");if("test"===n&&/^cs_live_/.test(i))throw new P.No("stripe.redirectToCheckout: the provided sessionId is for a live mode Checkout Session, whereas Stripe.js was initialized with a test mode publishable key.");return{tag:"session",sessionId:i}}o.sessionId,o.sku,o.plan;var a=o.items,c=o.lineItems,l=o.successUrl,d=o.cancelUrl,p=o.mode,f=(0,m.Z)(o,Nu);if(!c&&!a)throw new P.No("stripe.redirectToCheckout: You must provide one of lineItems, items, or sessionId.");if(!l)throw new P.No("stripe.redirectToCheckout: You must provide successUrl.");return(0,s.Z)({tag:"no-session",items:a,lineItems:c,successUrl:l,cancelUrl:d,mode:p},f)},Zu=function(e,t,n){var r=ju(e,t,n);if("no-session"===r.tag){var o=r.successUrl,i=r.cancelUrl;if(!(0,S.sD)(o))throw new P.No("stripe.redirectToCheckout: successUrl must start with either http:// or https://.");if(i&&!(0,S.sD)(i))throw new P.No("stripe.redirectToCheckout: cancelUrl must start with either http:// or https://.");return r}return r},Lu=function(e,t){return"session"===t.tag||null==e||t.locale||-1===["auto"].concat((0,u.Z)(Mu)).indexOf(e)?t:(0,s.Z)((0,s.Z)({},t),{},{locale:e})},Du=function(e,t,n){var r=(0,A.sE)(Cu,(function(t){return(0,E.uN)(e,t)}));if(t&&t.lineItems&&r)throw new P.No("Prices cannot be used with ".concat(r));if("string"==typeof t&&Ou.test(t))throw new P.No("stripe.redirectToCheckout: Checkout Session IDs must be passed in as an object with a key of `sessionId` and the Session ID as the value.");switch(r){case"checkout_beta_2":return xu(0,t);case"checkout_beta_3":return ju(e,t,n);default:return Zu(e,t,n)}},Bu=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unknown";return Lu(t,Du(e,n,r))},qu=["tag","items","lineItems","mode","successUrl","cancelUrl","clientReferenceId","customerEmail","billingAddressCollection","submitType","allowIncompleteSubscriptions","shippingAddressCollection"],Fu=function(e,t){var n=t;return Boolean(!1)&&window.__STRIPE_CHECKOUT_URL_OVERRIDE__&&(n=t.replace(/^https?:\/\/[^/]+\//,window.__STRIPE_CHECKOUT_URL_OVERRIDE__)),(0,la.U)(n).then((function(t){return(0,la.d)(e,"redirectToCheckout",t),{error:t.error}}))},Uu={border:"0",margin:"0",padding:"0",width:"1px","min-width":"100%",overflow:"hidden",display:"block","user-select":"none",transform:"translate(0)","color-scheme":"only light"},Gu=function(e){function t(e){var r;return(0,l.Z)(this,t),r=n.call(this,e),k.s$&&r._listenerRegistry.addEventListener(document,"transitionstart",(function(e){switch(e.propertyName){case"opacity":case"transform":case"visibility":var t=e.target;r._isMounted()&&t.contains(r._iframe)&&r._forceRepaint()}}),{passive:!0}),r}(0,y.Z)(t,e);var n=(0,v.Z)(t);return(0,d.Z)(t,[{key:"update",value:function(e){this.send({action:"stripe-user-update",payload:e})}},{key:"updateStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t._iframe.style[n]=e[n]}))}},{key:"focus",value:function(){this.loaded&&(k.s$||k.yv?this._iframe.focus():this.send({action:"stripe-user-focus",payload:{}}))}},{key:"blur",value:function(){this.loaded&&(this._iframe.contentWindow.blur(),this._iframe.blur(),document.activeElement===this._iframe&&(window.focus(),document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()))}},{key:"clear",value:function(){this.send({action:"stripe-user-clear",payload:{}})}},{key:"collapse",value:function(){this.send({action:"stripe-user-collapse",payload:{}})}},{key:"getValue",value:function(){this.send({action:"stripe-user-get-value",payload:{}})}},{key:"_createIFrame",value:function(t,n,r){var o=e.prototype._createIFrame.call(this,t,n,r);return o.setAttribute("title","Secure payment input frame"),(0,w.yq)(o,Uu),o}},{key:"_forceRepaint",value:function(){var e=this._iframe,t=e.style.display;e.style.display="none";var n=e.offsetHeight;return e.style.display=t,n}}]),t}(He),zu=n(8731),Vu={position:"absolute",left:"0",top:"0",height:"100%",width:"100%","color-scheme":"normal","pointer-events":"auto"},Ku=function(e){function t(r){var o,i=r.type,a=r.controllerId,c=r.listenerRegistry,s=r.options;return(0,l.Z)(this,t),(o=n.call(this,{type:i,controllerId:a,listenerRegistry:c,appParams:s}))._autoMount=function(){o.appendTo(o._backdrop.domElement),o._backdrop.mount()},o.show=function(){o._backdrop.show(),(0,w.yq)(o._iframe,Vu),o.isVisible=!0},o.fadeInBackdrop=function(){o._backdrop.fadeIn()},o._backdropFadeoutPromise=null,o.fadeOutBackdrop=function(){return o._backdropFadeoutPromise||(o._backdropFadeoutPromise=o._backdrop.fadeOut()),o._backdropFadeoutPromise.then((function(){o._backdropFadeoutPromise=null}))},o.backdropRunOnHide=function(){o._backdrop.runOnHide()},o.destroy=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=o.fadeOutBackdrop().then((function(){o._backdrop.unmount(),t||e.prototype.destroy.call((0,h.Z)(o))}));return t&&e.prototype.destroy.call((0,h.Z)(o)),o.isVisible=!1,n},o._backdrop=new zu.Z({lockScrolling:!0,lockScrollingIOSSpecialFix:ge.NC.LINK_MODAL===i,lockFocus:!0,lockFocusOn:o._iframe,appendElement:ge.NC.LINK_MODAL===i,backgroundTransition:i===ge.NC.LINK_MODAL?"".concat(250,"ms ease-out"):"400ms ease",listenerRegistry:c}),o._autoMount(),o.isVisible=!1,o}(0,y.Z)(t,e);var n=(0,v.Z)(t);return(0,d.Z)(t)}(He),Hu=Ku,Yu={display:"block",position:"absolute","z-index":"1000",width:"1px","min-width":"100%",margin:"2px 0 0 0",padding:"0",border:"none",overflow:"hidden"},Wu=function(e){function t(){return(0,l.Z)(this,t),n.apply(this,arguments)}(0,y.Z)(t,e);var n=(0,v.Z)(t);return(0,d.Z)(t,[{key:"updateStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t._iframe.style[n]=e[n]}))}},{key:"update",value:function(e){this.send({action:"stripe-user-update",payload:e})}},{key:"_createIFrame",value:function(t,n,r){var o=e.prototype._createIFrame.call(this,t,n,r&&"object"==typeof r?(0,s.Z)((0,s.Z)({},r),{},{isSecondaryFrame:!0}):r);return(0,w.yq)(o,Yu),o.style.height="0",o}}]),t}(He),Xu=Wu,Qu=!1,Ju=function(e){Qu||"null"===(null!=e?e:window.origin)&&(Qu=!0,console.error("Stripe.js requires 'allow-same-origin' if sandboxed."))},$u="https://maps.googleapis.com/maps/api/js",el=/^https:\/\/maps\.googleapis\.com\/maps\/api\/js\/?(\?.*)?libraries=(.*,)?places((,|&)+.*)?$/;window.noop=function(){};var tl,nl,rl=n(6274).Promise,ol=function(e){switch(e){case"INVALID_REQUEST":case"NOT_FOUND":case"OK":case"OVER_QUERY_LIMIT":case"REQUEST_DENIED":case"UNKNOWN_ERROR":case"ZERO_RESULTS":return e;default:return"UNKNOWN_ERROR"}},il="ADDRESS_AUTOCOMPLETE_PREDICTION_RESULTS",al="ADDRESS_AUTOCOMPLETE_PLACE_DETAILS",cl=null,sl=function(e){return null!==cl||(cl=new rl((function(t,n){if("undefined"!=typeof window)if(window.google&&window.google.maps&&window.google.maps.places)t(window.google.maps.places);else try{var r=function(){var e=document.querySelectorAll('script[src^="'.concat($u,'"]'));for(var t in e)if(el.test(e[t].src))return e[t];return null}();r||(r=function(e){var t=document.createElement("script");return t.src="".concat($u,"?key=").concat(e,"&libraries=places&callback=noop"),(document.head||document.body).appendChild(t),t}(e)),r.onload=function(){window.google.maps.places?t(window.google.maps.places):n(new Error("Google Maps API not available"))}}catch(e){n(e)}else t(null)}))),cl},ul=function(e,t,n){var r=e.search,o=e.countryRestrictions;var i=function(e){return{predictions:[],status:"error",error:{status:ol(e),message:"Google Maps returned an API error"}}};void 0===t||tl?n.send({action:"google-maps-predictions",payload:{data:{tag:il,value:i("UNKNOWN_ERROR")}}}):function(e,t){try{t()}catch(t){e.send({action:"google-maps-predictions",payload:{data:{tag:il,value:{predictions:[],status:"error",error:{status:"UNKNOWN_ERROR",message:t.message}}}}})}}(n,(function(){var e=t.autocompleteService,a=t.sessionToken;e.getPlacePredictions({input:r,sessionToken:a,componentRestrictions:{country:o}},(function(e,t){var r;switch(t){case google.maps.places.PlacesServiceStatus.OK:r={predictions:e,status:"ok"};break;case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:r={predictions:[],status:"zeroResults"};break;default:r=i(t)}n.send({action:"google-maps-predictions",payload:{data:{tag:il,value:r}}})}))}))},ll=["attachLinkAccountSessionForPayment","attachLinkAccountSessionForSetup","authenticate3DS2","cancelCardImageVerificationChallenge","cancelPaymentIntentSource","cancelSetupIntentSource","clearInstantDebitsIncentive","resetConsumerIncentiveOffer","completeLinkAccountSessionElements","confirmPaymentIntent","confirmReturnIntent","confirmSetupIntent","createAcssDebitSession","createApplePaySession","addPaymentDetails","createConfirmationTokenWithElements","createConsumerPaymentDetails","createEphemeralKeyNonce","createPaymentMethodWithData","createPaymentMethodWithElement","createPaymentMethodWithElements","createPaymentPage","createPaymentPageWithSession","initPaymentPage","updatePaymentPage","retrievePaymentPage","confirmPaymentPage","createRadarSession","attachHCaptchaTokenToRadarSession","createSourceWithData","createSourceWithElement","confirmInstantDebitsIncentiveForPaymentDetails","confirmConsumerSignUpIncentiveForPaymentDetails","fetchingWallets","shouldShowEceButton","eceNotifySheetAuthenticationNeeded","expressCheckoutConfirmStart","expressCheckoutConfirmEnd","expressCheckoutSheetOpened","expressCheckoutSheetClosed","getElementConfirmingPayment","getIsAwaitingConfirmCallback","getEcePaymentSheetState","getElementsSessionAmountModeCurrency","getElementsSessionUnverifiedPaymentMethodsOnDomain","setExpressCheckoutConfirmData","closeECEPaymentSheet","fetchLocale","fetchUpdates","localizeError","unsafeLocalizeString","loginWithConsumerInfo","retrieveIssuingCard","retrieveIssuingCardWithoutNonce","retrievePaymentIntent","retrieveSetupIntent","retrieveSource","rememberLinkLogin","forgetLinkLogin","createSharedSessionContext","removeElementsExperimentId","resetExpressCheckoutState","getGoogleMapsPredictions","getGoogleMapsDetails","initGoogleMapsService","setupDeferredElementsStore","setupStoreForElementsGroup","showWalletIfNecessary","tokenizeCvcUpdate","tokenizeWithData","tokenizeWithElement","updateAvailableConsumerIncentives","updateCSSFonts","updateElementsOptions","updatePaymentIntent","verifyCardImageVerificationChallenge","verifyMicrodepositsForPayment","verifyMicrodepositsForSetup","retrieveCardNetworks","isCardMetadataRequired","userFacingRetrieveCardNetworks","retrieveWalletConfigAvailability","retrieveWalletConfig","getOnBehalfOfError","checkForLinkClientSecret","resolveLocale","elementMounted","elementUnmounted","logOutOfLinkInElements","clearLinkAuthCredentials","updateStripeUserCredentials","validateElements","retrievePaypalMerchantId","linkPopupPreloadedDataStale","linkPopupLogOut","updateLoggingParams","internalSetFormValueForAddressElement","preloadConsumerLookup","midsChange","createV2CardPaymentMethod","parseLuxeNextAction","recordOuterPerformanceTimeline","linkFunnelEvent","preloadLinkStoredCredentials","prefillUsBankAccountFormWithConsumer","setInstrumentForConsumerSignUpIncentive"],dl=n(6274).Promise,pl=function(e){var t=0,n=[];return{acquire:function(){if(t0&&t=c)return o;if(l&&"function"==typeof n.toJSON&&!0!==n[vl])return function(e){e[vl]=!0;var t=e.toJSON();return delete e[vl],t}(n);for(var p=function(t){return e({from:t,seen:(0,u.Z)(r),forceEnumerable:a,maxDepth:c,depth:s,useToJSON:l,serialize:d})},m=0,f=Object.keys(n);m1&&void 0!==arguments[1]?arguments[1]:{};r._controllerFrame.send({action:"stripe-controller-report",payload:{event:e,data:(0,s.Z)({timestamp:Date.now()},t)}})},this.updateLogParams=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r._controllerFrame.send({action:"stripe-controller-update-log-params",payload:{data:e}})},this.reportErrorToApp=function(e){r._controllerFrame.send({action:"report-error",payload:{app:e.app,error:o(e.exception)}})},this.warn=function(){for(var e=arguments.length,t=new Array(e),n=0;n0;){var i=r.shift();n._registerWrapper(i)}return t}("lazy")}}})},Zl=function(e){e.stripe._isCheckout||e.lazilyAttachController?jl(e):0===Tl?function(e){xl(e.stripe,Ol((0,s.Z)((0,s.Z)({},e),{},{initStrategy:"eager"})))}(e):jl(e)},Ll=function(e){switch(e.type){case"object":return{token:e.object};case"error":return{error:e.error};default:return(0,de.Rz)(e)}},Dl=function(e){return"object"==typeof e&&null!==e?e:{}},Bl=function(e){return e.action.createRadarSession().then((function(t){var n=function(e){switch(e.type){case"object":return{radarSession:e.object};case"error":return{error:e.error};default:return(0,de.Rz)(e)}}(t),r="radarSession"in n?n.radarSession:null,o=null==r?void 0:r.passive_captcha_site_key;return o?((0,ml.Cn)(),(0,ml.Ul)({siteKey:o,logger:{log:e.report}}),(0,ml.ky)(o,{log:e.report},!0).then((function(t){return t?e.action.attachHCaptchaTokenToRadarSession({session:r.id,token:t.response,ekey:t.ekey}):null})).catch((function(t){e.warn("Error attaching hCaptcha token to Radar session",t)})).then((function(){return n}))):n}))},ql=n(6274).Promise,Fl="securitypolicyviolation",Ul=window,Gl=/^require-trusted-types-for/,zl="LOAD_ERROR",Vl="REPORT_ONLY",Kl="BLOCKED",Hl={"controller.js":!0,"elements-inner-authentication.js":!0,"elements-inner-card.js":!0,"elements-inner-payment.js":!0,"phone-numbers-lib.js":!0},Yl=["_1057540218"],Wl=["_1541774781"],Xl="block",Ql="allow",Jl="list",$l="query-param",ed="real-rollout",td="no-rollout",nd=n(7600),rd=function(e,t){var n=(0,s.Z)({event:e},t);var r="".concat("https://q.stripe.com","?").concat((0,S.qC)(n));(new Image).src=r},od="Stripe is being used in an unsupported browser and will not function. See https://stripe.com/docs/js/appendix/supported_browsers for details.",id=n(6274).Promise,ad=function(){function e(){(0,l.Z)(this,e),this._element=null}return(0,d.Z)(e,[{key:"on",value:function(){}},{key:"once",value:function(){}},{key:"mount",value:function(e){var t=null;if((t="string"==typeof e?document.querySelector(e):e)&&"function"==typeof t.appendChild){var n=document.createElement("div");n.innerText="Browser unsupported",this._element=n,t.appendChild(n)}}},{key:"update",value:function(){}},{key:"focus",value:function(){}},{key:"blur",value:function(){}},{key:"clear",value:function(){}},{key:"off",value:function(){}},{key:"unmount",value:function(){var e,t;null===(e=this._element)||void 0===e||null===(t=e.parentElement)||void 0===t||t.removeChild(this._element),this._element=null}},{key:"destroy",value:function(){var e,t;null===(e=this._element)||void 0===e||null===(t=e.parentElement)||void 0===t||t.removeChild(this._element),this._element=null}}]),e}(),cd=function(){function e(){(0,l.Z)(this,e)}return(0,d.Z)(e,[{key:"update",value:function(){}},{key:"fetchUpdates",value:function(){return id.resolve()}},{key:"getElement",value:function(){return null}},{key:"create",value:function(){return new ad}},{key:"on",value:function(){}},{key:"addListener",value:function(){}},{key:"addEventListener",value:function(){}},{key:"off",value:function(){}},{key:"removeListener",value:function(){}},{key:"removeEventListener",value:function(){}},{key:"once",value:function(){}},{key:"hasRegisteredListener",value:function(){}},{key:"removeAllListeners",value:function(){}},{key:"emit",value:function(){}}]),e}(),sd=function(){function e(){(0,l.Z)(this,e)}return(0,d.Z)(e,[{key:"canMakePayment",value:function(){return id.reject(od)}},{key:"show",value:function(){}},{key:"abort",value:function(){}},{key:"isShowing",value:function(){return!1}},{key:"update",value:function(){}},{key:"on",value:function(){}},{key:"once",value:function(){}},{key:"off",value:function(){}}]),e}(),ud=function(){function e(){(0,l.Z)(this,e),this.IS_NOOP_BUILD=!0,console.error(od)}return(0,d.Z)(e,[{key:"elements",value:function(){return new cd}},{key:"redirectToCheckout",value:function(){return id.reject(new Error(od))}},{key:"paymentRequest",value:function(){return new sd}},{key:"createToken",value:function(){return id.reject(new Error(od))}},{key:"createSource",value:function(){return id.reject(new Error(od))}},{key:"handleCardPayment",value:function(){return id.reject(new Error(od))}},{key:"createPaymentMethod",value:function(){return id.reject(new Error(od))}},{key:"confirmCardPayment",value:function(){return id.reject(new Error(od))}}]),e}(),ld=function(e){var t=e.elements,n=e.params,r=(0,g.MO)(t);return r?(0,g.x4)({elements:r,params:n}):(0,g.zS)(new P.No("stripe.createConfirmationToken(): elements should be provided."))},dd=n(6274).Promise,pd=function(e,t,n,r){try{var o=(l=r,{value:(d=(0,g.Gu)(ld,l,"createConfirmationToken")).value,warnings:d.warnings}),i=o.value,a=i.elements,c=i.params;if(o.warnings.forEach((function(t){e.warn(t)})),a._controller._id!==e._id)throw new P.No("Invalid value for stripe.createConfirmationToken(): the 'elements' provided was created by a different Stripe instance. Please use the same Stripe instance to create the 'elements' and call stripe.createConfirmationToken().");a._isSubmitting&&e.report("elements_submit_conflict.create_confirmation_token");var s=a._id,u="stripe.createConfirmationToken()";return e.action.getElementConfirmingPayment({groupId:s,errorMessageMethodName:u}).then((function(n){var r={groupId:s,elements:a._elements,params:c,mids:t,elementConfirming:n};return e.action.createConfirmationTokenWithElements(r).then((function(t){return(0,lr.tA)({groupId:s,elementConfirmingPayment:n,controller:e,isError:"error"in t,errorMessageMethodName:u}).then((function(){return t}))}))})).then((function(e){return"error"===e.type?{error:e.error}:{confirmationToken:e.object}}))}catch(e){return dd.reject(e)}var l,d},md=n(6274).Promise.resolve(Yt),fd=n(6274).Promise,_d=function(){function e(t){var n=this;(0,l.Z)(this,e),this._controllerFrame=null,this._buildFrameQueryString=function(){var e=n._frameParams;return Object.keys(e).map((function(t){return null!=e[t]?"".concat(t,"=").concat(encodeURIComponent(e[t].toString())):null})).join("&")},this._handleMessage=function(e){return function(t){var n=t.data,r=t.origin;if((0,S.Qg)(r))try{var o=(0,ge.$G)(n);if(o)"stripe-outer-logger-iframe-ready"===o.message.action&&e()}catch(e){}}};var r=t.apiKey,o=t.stripeAccount,i=t.stripeJsId,a=t.logPrefix;this._id=(0,b.To)("__privateStripeOuterLoggerController"),this._frameParams={apiKey:r,stripeAccount:null!=o?o:void 0,stripeJsId:i,referrer:document.referrer,controllerId:this._id,logPrefix:a},this._listenerRegistry=(0,Ue.E)(),this._controllerFrame=new Qe({type:ge.NC.OUTER_LOGGER_CONTROLLER,controllerId:this._id,listenerRegistry:this._listenerRegistry,autoload:!0,appParams:this._buildFrameQueryString()}),this._loggerFrameReadyPromise=new fd((function(e){n._listenerRegistry.addEventListener(window,"message",n._handleMessage(e))}))}return(0,d.Z)(e,[{key:"log",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._loggerFrameReadyPromise.then((function(){var r;null===(r=t._controllerFrame)||void 0===r||r.send({action:"stripe-outer-logger-report",payload:{event:e,data:n}})}))}},{key:"logError",value:function(e){var t=this;this._loggerFrameReadyPromise.then((function(){var n;null===(n=t._controllerFrame)||void 0===n||n.send({action:"stripe-outer-logger-report-error",payload:{error:o(e)}})}))}}]),e}(),hd=n(6274).Promise,yd="true"===(nl=r(window.document),(0,nd.v)(nl.slice(nl.indexOf("?")+1))).forceBrowserDeprecationRollout,vd=new mt.E(qi.q),gd=!1,bd=function(e){if(!(Fe||e._controllerCount>5)){var t="https://js.stripe.com/v3/".replace(/\/$/,"");ai({types:["resource"],reporter:function(t){return e.action.recordOuterPerformanceTimeline(t)},resourcePrefixFilter:t})}},wd=function e(t,r){var o,i=t.controller,a=t.controllerLoadTimestamp,c=t.controllerInitTimestamp;if(Pd._ec&&Pd._ec.setOnIdsUpdate((function(e){i.action.midsChange({mids:e})})),!gd||a){gd=!0;var u=a||new mt.E;if("complete"===document.readyState){bd(i);var l=null;if(window.performance&&window.performance.getEntriesByType){var d="https://js.stripe.com/v3/".replace(/\/$/,"");l=window.performance.getEntriesByType("resource").reduce((function(e,t){if(0===t.name.indexOf(d)){var n=t.name.match(/\/([^/#?]*)\/?(?:$|[#?])/);if(n&&n[1]){var r=n[1].replace(/-[0-9a-f]{32}\./,".");return"v3"===r&&(r="stripe.js"),(0,s.Z)((0,s.Z)({},e),{},(0,p.Z)({},r,(0,s.Z)({raw_size:t.decodedBodySize,transfer_size:t.transferSize,duration:Math.round(t.duration)},r in Hl?(o=t,{duration:Math.round(o.duration),transfer_size:null!==(i=o.transferSize)&&void 0!==i?i:null,tcp_handshake_duration:0!==o.connectStart?Math.round(o.connectEnd-o.connectStart):null,dns_lookup_duration:0!==o.domainLookupStart?Math.round(o.domainLookupEnd-o.domainLookupStart):null,redirect_duration:0!==o.redirectStart?Math.round(o.redirectEnd-o.redirectStart):null,request_duration:0!==o.requestStart?Math.round(o.responseStart-o.requestStart):null,response_duration:0!==o.responseStart?Math.round(o.responseEnd-o.responseStart):null,tls_negotiation_duration:0!==o.secureConnectionStart?Math.round(o.requestStart-o.secureConnectionStart):null,fetch_duration:0!==o.fetchStart?Math.round(o.responseEnd-o.fetchStart):null,service_worker_duration:0!==o.workerStart?Math.round(o.fetchStart-o.workerStart):null,raw_size:null!==(a=o.decodedBodySize)&&void 0!==a?a:null,compressed:"number"==typeof o.encodedBodySize&&"number"==typeof o.decodedBodySize?o.encodedBodySize===o.decodedBodySize:null,cached_locally:"number"==typeof o.transferSize?0===o.transferSize:null,next_hop_protocol:o.nextHopProtocol||null,is_http3:"string"==typeof o.nextHopProtocol?"h3"===o.nextHopProtocol:null}):{})))}}var o,i,a;return e}),{})}var m=Math.round(n(8622).x-qi.q),f=c.getElapsedTime(u),_=null!==(o=l)&&void 0!==o&&o["stripe.js"]?l["stripe.js"].duration+m+f:null;i.report("init_timings",{element:i.controllerFor(),match_frame:t.source===i._controllerFrame._iframe.contentWindow,until_first_create:vd.getElapsedTime(i._createTimestamp),until_first_load:vd.getElapsedTime(u),stripe_create_duration:f,stripe_js_init_duration:m,stripe_js_load_duration:_,resource_timings:l,controller_init_delay:t.stripeCreateTimestamp.getElapsedTime(c),controller_init_strategy:t.initStrategy,controller:t.controllerMetrics}),setTimeout((function(){new ql((function(e){if(Ul.trustedTypes&&Ul.Promise){var t,r=!1,o=function(e){(Gl.test(e.effectiveDirective)||Gl.test(e.violatedDirective))&&((0,S.vo)(e.blockedURI)||(0,S.vo)(e.sourceFile))&&(r=!0)},i=function(){return r?Kl:zl};Ul.addEventListener(Fl,o);try{t=n.e(913).then(n.bind(n,9554)).then((function(e){return(e.loaded&&r?Vl:"ALLOWED")||zl}),i)}catch(e){t=new ql((function(e){return setTimeout(e,0)})).then(i)}t.then((function(){Ul.removeEventListener(Fl,o)})),e(t)}else e("NOT_SUPPORTED")})).then((function(e){(function(e){switch(e){case Vl:case Kl:return!0}return!1})(e)&&i.warn("We noticed that you are using Trusted Types. Nothing has broken, but we plan to add dynamic loading to parts of Stripe.js. Please allow scripts from 'https://js.stripe.com' in your default Trusted Types policy. For more information: https://stripe.com/docs/security/guide#content-security-policy")}))}),5e3);var h=new mt.E,y=setTimeout((function(){r._controller.report("metricscontroller.timings",{timeout:!0,delta:h.getElapsedTime(),afs:!!Be,isCheckout:!!Fe})}),15e3);r._midsPromise().then((function(e){clearTimeout(y),r._controller.report("metricscontroller.timings",{timeout:!1,delta:h.getElapsedTime(),afs:!!Be,isCheckout:!!Fe}),e&&r._controller.action.midsChange({mids:e})}))}else window.addEventListener("load",(function(){try{e((0,s.Z)((0,s.Z)({},t),{},{controllerLoadTimestamp:u}),r)}catch(e){}}))}else bd(i)},kd=(0,g.mC)((0,s.Z)((0,s.Z)({apiKey:g.Z_,__v2PrivateBeta:(0,g.jt)((0,g.mC)({authToken:g.Z_,stripeContext:g.Z_})),stripeAccount:(0,g.jt)(g.Z_),locale:(0,g.jt)(g.Z_),apiVersion:(0,g.jt)(g.Z_)},qe?{__privateSharedSessionContext:(0,g.jt)(g.Ry)}:{}),{},{__privateApiUrl:(0,g.jt)(g.Z_),__checkout:(0,g.jt)((0,g.mC)({mids:(0,g.mC)({muid:g.Z_,sid:g.Z_})})),__lazilyAttachController:(0,g.jt)(g.Xg),__dashboard:(0,g.jt)(g.Ry),__hosted3DS:(0,g.jt)(g.Xg),__hostedInvoicePage:(0,g.jt)(g.Ry),canCreateRadarSession:(0,g.jt)(g.Xg),betas:(0,g.jt)((0,g.CT)(g.Z_))})),Sd=function(e){return"You have an in-flight ".concat(e,"! Please be sure to disable your form submit button when ").concat(e," is called.")},Cd=function(e){return function(){throw new P.No("You cannot call `stripe.".concat(e,"` without supplying an appropriate beta flag when initializing Stripe.js."))}},Ed=function(e){return function(){throw new P.No("You cannot call `stripe.".concat(e,"` without supplying an Issuing beta flag when initializing Stripe.js."))}},Ad=pl(1),Pd=function(){function e(t,n){var r=this;(0,l.Z)(this,e),this._listenerRegistry=(0,Ue.E)(),this.elements=(0,ce.TC)((function(e){return new Di(r._controller,r._listenerRegistry,{stripeJsLoadTimestamp:vd,stripeCreateTimestamp:r._controller._createTimestamp},r._betas,r._mids(),(0,s.Z)((0,s.Z)({},r._locale?{locale:r._locale}:{}),e))}),void 0,"elements"),this.createToken=(0,ce.mx)((function(e,t){var n=r._mids();return"cvc_update"===e?function(e,t){var n=(0,g.rX)(t);if(n&&"cardCvc"===n._componentName){var r=n._implementation._frame.id;return e.action.tokenizeCvcUpdate({frameId:r}).then(Ll)}throw new P.No("You must provide a `cardCvc` Element to create a `cvc_update` token.")}(r._controller,t):function(e,t){return function(n,r){var o=(0,g.rX)(n);if(o){var i=o._implementation._frame.id,a=o._componentName,c=Dl(r);return e.action.tokenizeWithElement({frameId:i,elementName:a,tokenData:c,mids:t}).then(Ll)}if("string"==typeof n){var s=n,u=Dl(r);return e.action.tokenizeWithData({elementName:null,type:s,tokenData:u,mids:t}).then(Ll)}throw new P.No("You must provide a Stripe Element or a valid token type to create a Token.")}}(r._controller,n)(e,t)}),void 0,"createToken"),this.createSource=(0,ce.mx)((function(e,t){var n=(0,g.rX)(e),o=ra(n?t:e),i=o||{type:null,data:{}},a=i.type,c=i.data;if(n){var s=n._implementation._frame.id,u=n._componentName;return!o&&(0,C.ke)(u)?hd.reject(new P.No("Please provide Source creation parameters to createSource.")):r._controller.action.createSourceWithElement({frameId:s,elementName:u,type:a,sourceData:c,mids:r._mids()}).then(oa)}return o?a?r._controller.action.createSourceWithData({elementName:null,type:a,sourceData:c,mids:r._mids()}).then(oa):hd.reject(new P.No("Please provide a source type to createSource.")):hd.reject(new P.No("Please provide either an Element or Source creation parameters to createSource."))}),void 0,"createSource"),this.retrieveSource=(0,ce.xy)((function(e){var t=(0,g.Gu)(aa,{source:e},"retrieveSource"),n=t.value;return t.warnings.forEach((function(e){return r._controller.warn(e)})),r._controller.action.retrieveSource(n).then(oa)}),void 0,"retrieveSource"),this.paymentRequest=(0,ce.W6)((function(e,t){(0,er.pF)(r._keyMode);var n=t;return Bi(r._controller,{apiKey:r._apiKey,accountId:r._stripeAccount},r._mids(),e,r._betas,n,r._listenerRegistry)}),void 0,"paymentRequest");try{var o=new mt.E,i=(0,g.Gu)(kd,t||{},"Stripe()"),a=i.value,c=i.warnings,u=function(e){var t=e.apiKey,n=e.context,r=e.forceRollout,o=e.isAffectedBrowser,i=e.rolloutSlice,a=e.log,c=Oe()(t),u={apiKey:t,hashedKey:c,isAffectedBrowser:o,context:n},l=function(e){var t=e.mechanism,r=e.action;o&&a("legacy-deprecation-rollout",(0,s.Z)((0,s.Z)({},u),{},{mechanism:t,action:r,state:[n,t,r].join("-")}))};return r?(l({mechanism:$l,action:o?Xl:Ql}),o):"___TESTMODE_FORCE_UNSUPPORTED_BROWSER"===t||(-1!==(0,A.cx)(Wl,(function(e){return e===c}))?(l({mechanism:Jl,action:o?Xl:Ql}),o):-1!==(0,A.cx)(Yl,(function(e){return e===c}))?(l({mechanism:Jl,action:Ql}),!1):function(e,t){return t<100}(0,i)?(l({mechanism:ed,action:o?Xl:Ql}),o):(l({mechanism:td,action:Ql}),!1))}({apiKey:a.apiKey,context:"outer",forceRollout:yd,isAffectedBrowser:!window.Promise,rolloutSlice:Math.floor(100*Math.random()),log:rd});if(u)return this._apiKey="",this._keyMode="live",this._betas=[],this._isCheckout=!1,this._isHostedInvoicePage=!1,new ud;var d=a.apiKey,p=a.stripeAccount,m=a.apiVersion,f=a.locale,_=a.__v2PrivateBeta,h=a.__dashboard,y=a.__privateApiUrl,v=a.__checkout,b=a.__hosted3DS,w=a.__hostedInvoicePage,k=a.__privateSharedSessionContext,S=a.__lazilyAttachController,M=a.betas,R=(0,E.dZ)(M||null),I=R.validBetas,N=R.betaWarning,T=R.betaError;if(T)throw new P.No(T);N&&c.push(N),(0,er.Tj)(d),null!=v&&v.mids&&(e._ec=ct({checkoutIds:v.mids,stripeJsId:e.stripeJsId})),this._apiKey=d.trim(),this._keyMode=(0,er.lO)(this._apiKey),this._betas=I,this._locale=(0,E.jk)(f,this._betas)||null,this._stripeAccount=p||null,this._isCheckout=!!v,this._isHostedInvoicePage=!!w;var O=h?Ji:w?"hip":void 0;this._attachControllerGetter({stripeCreateTimestamp:o,apiVersion:m,privateApiUrl:y,privatePaymentUserAgentSuffix:O,privateSharedSessionContext:k,lazilyAttachController:S,stripeAccount:p,v2:_}),c.forEach((function(e){return r._controller.warn(e)})),Ju(),this._ensureHTTPOnlyLinkCookie(),this._ensureHTTPS(),this._ensureStripeHosted(n),this._attachPaymentIntentMethods(this._betas,!!b),this._attachLegacyPaymentIntentMethods(this._betas),this._attachCheckoutMethods(this._betas),this._attachEmbeddedCheckoutMethods(),this._attachCustomCheckoutMethods(this._betas),this._attachPrivateMethodsForCheckout(this._isCheckout),this._attachPrivateMethodsForHostedInvoicePage(this._isHostedInvoicePage),this._attachPrivateMethodsForConsumer(qe),this._attachCreateRadarSession(),this._attachGetters(),this._attachIssuingCardMethods(this._betas),this._attachIdentityMethods(),this._attachLinkedAccountsMethods(this._betas),this._attachAppInfo(),this._attachStripeUpdate(),this._attachCardBrandChoiceMethods(),this._attachV2PrivateBetaMethods(_),ti("init")}catch(t){throw e._outerLogger||(e._outerLogger=function(e){return new _d(e)}({apiKey:this._apiKey,stripeAccount:this._stripeAccount,stripeJsId:e.stripeJsId})),e._outerLogger.logError(t),t instanceof P.No?t:new Error("[Stripe.js] There was an issue with Stripe.js initialization")}}return(0,d.Z)(e,[{key:"_attachStripeUpdate",value:function(){var e=this;this.update=Cd("update"),(0,E.uN)(this._betas,E.M4.enable_stripe_update_api_key_beta_0)&&(this.update=(0,ce.W6)((function(t,n){var r=(0,s.Z)({apiKey:t},n&&"object"==typeof n?n:{}),o=(0,g.Gu)(kd,r||{},"Stripe()"),i=o.value,a=o.warnings,c=i.apiKey,u=i.stripeAccount,l=i.apiVersion;(0,er.Tj)(c);var d=e._controller.getCredentials(),p={publishableKey:c.trim()||d.publishableKey,stripeAccount:u||d.stripeAccount,apiVersion:l||d.apiVersion};p.publishableKey===d.publishableKey&&p.stripeAccount===d.stripeAccount&&p.apiVersion===d.apiVersion||(e._apiKey=p.publishableKey,e._keyMode=(0,er.lO)(e._apiKey),e._stripeAccount=p.stripeAccount,a.forEach((function(t){return e._controller.warn(t)})),e._controller.setCredentials(p),e._controller.action.updateStripeUserCredentials(p))}),void 0,"update"))}},{key:"_attachCreateRadarSession",value:function(){var e=this;this.createRadarSession=(0,ce.P0)((function(){return e._midsPromise().then((function(){return Bl(e._controller)}))}))}},{key:"_attachPaymentIntentMethods",value:function(e,t){var n=this,r=function(){return n._mids()};this.createPaymentMethod=(0,ce.g5)((function(){for(var t=arguments.length,o=new Array(t),i=0;i=8&&t.report("retrieve_card_networks.success",{networksCount:null!==(n=null===(o=e.networks)||void 0===o?void 0:o.length)&&void 0!==n?n:0}),e})).catch((function(){return t.report("retrieve_card_networks.error"),Yt}));return md=o,o}({controller:e._controller,rawCardNumber:t})}}},{key:"_attachCustomCheckoutMethods",value:function(e){if((0,E.uN)(e,[E.M4.custom_checkout_beta_1,E.M4.custom_checkout_beta_2,E.M4.custom_checkout_beta_3,E.M4.custom_checkout_beta_4,E.M4.custom_checkout_beta_5,E.M4.custom_checkout_beta_6,E.M4.custom_checkout_internal_dev_beta,E.M4.custom_checkout_adaptive_pricing_1,E.M4.custom_checkout_server_updates_1])){var t=Fi({stripe:this,controller:this._controller});this.initCheckout=t,(0,E.uN)(e,[E.M4.custom_checkout_beta_1,E.M4.custom_checkout_beta_2,E.M4.custom_checkout_beta_3,E.M4.custom_checkout_beta_4,E.M4.custom_checkout_internal_dev_beta,E.M4.custom_checkout_adaptive_pricing_1])&&(this.initCustomCheckout=t)}}},{key:"_attachPrivateMethodsForConsumer",value:function(e){var t=this;e&&(this.__createConsumerPaymentDetails=(0,ce.mx)((function(e,n){var r,o={};if(!n.email)return hd.reject(new P.No("You must pass email"));if(!e)return hd.reject(new P.No("You must pass a clientSecret"));if(n.cardElement){if(!n.billing_details||!n.billing_details.country_code)return hd.reject(new P.No("You must pass in billing_details.country_code if you are using the Card Element"));var i=(0,g.rX)(n.cardElement);if(!i)return hd.reject(new P.No("Card Element is invalid"));var a=i._implementation._frame.id,c=i._componentName;if("card"!==c&&"cardNumber"!==c)return hd.reject(new P.No("Please provide a Card Element to __createConsumerPaymentDetails"));o={frameId:a,elementName:c,billingDetails:n.billing_details,requestSurface:n.request_surface}}return o.frameId&&o.elementName&&null!=n&&null!==(r=n.billing_details)&&void 0!==r&&r.country_code?t._controller.action.createConsumerPaymentDetails({email:n.email,clientSecret:e,billingDetails:o.billingDetails,isDefault:!!n.is_default,requestSurface:n.request_surface,nickname:n.nickname,frameId:o.frameId,elementName:o.elementName}):hd.reject(new P.No("Please provide Card Element creation parameters to __createConsumerPaymentDetails."))}),void 0,"__createConsumerPaymentDetails"),this.__rememberLinkLogin=(0,ce.xy)((function(e){return"string"==typeof e?t._controller.action.rememberLinkLogin({authSessionClientSecret:e}):t._controller.action.rememberLinkLogin(e)}),void 0,"__rememberLinkLogin"),this.__forgetLinkLogin=(0,ce.xy)((function(){return t._controller.action.forgetLinkLogin()}),void 0,"__forgetLinkLogin"),this.__getLinkWebAuthnFrameFingerprintedPath=(0,ce.t_)((function(){return"link-web-authn-frame-46d24303a6dc483f877ab5c26da685eeba140e05.html"}),void 0,"__getLinkWebAuthnFrameFingerprintedPath"),this.__collectFinancialConnectionsAccountsForLinkApp=(0,ce.xy)((function(e){return(0,ar.nD)(t._controller,[],e)}),void 0,"__collectFinancialConnectionsAccountsForLinkApp"))}},{key:"_attachGetters",value:function(){var e=this,t=new ta((function(t){e._registerWrapper({name:t,version:null})}));["elements","createToken","createSource","createPaymentMethod"].forEach((function(n){if(e.hasOwnProperty(n)){var r=e[n],o=function(){t.called(n);for(var e=arguments.length,o=new Array(e),i=0;i=10?(Rd[n].hasWarned=!0,window.console&&console.warn("[Stripe.js] It looks like Stripe() was called many times with the same API key and options. For best performance, create and share a single instance of the Stripe object. https://stripe.com/docs/js/initializing")):null===Id&&(Id=setTimeout((function(){Object.keys(Rd).forEach((function(e){Rd[e].count=0})),Id=null}),1e4))}catch(e){}}(e,t),new Md((0,s.Z)({apiKey:e},t&&"object"==typeof t?t:{}),Nd)};Td.version=Md.version,window.Stripe&&2===window.Stripe.version&&!window.Stripe.StripeV3?window.Stripe.StripeV3=Td:window.Stripe?window.console&&console.warn("[Stripe.js] It looks like Stripe.js was loaded more than one time. Please only load it once per page."):window.Stripe=Td},1278:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(5326),o=n(6977),i=n(6274).Promise,a=function(e){var t=e.controller,n=e.intent,o=e.locale,a=e.action,s=e.expandParam,u=e.groupId;return new i((function(e){return a.authenticationUrl&&t.action.eceNotifySheetAuthenticationNeeded({authenticationUrl:a.authenticationUrl,groupId:u}),(0,r.ct)({controller:t,initialDelay:5e3,pollTimeGap:2e3,intent:n,expandParam:s,checkIntent:function(e){return"requires_action"!==e.status&&"requires_source_action"!==e.status||"use_stripe_sdk"!==e.next_action.type||"express_checkout_authentication_needed"!==e.next_action.use_stripe_sdk.type},locale:o}).then((function(n){var r=c(n);r?t.action.localizeError(r).then((function(t){var n=t.error;e({error:n})})):e(n)}))}))},c=function(e){var t=null,n=null;return(0,o.Lj)(e)?(n=e.paymentIntent.status,t=e.paymentIntent.last_payment_error):(0,o.vF)(e)&&(n=e.setupIntent.status,t=e.setupIntent.last_setup_error),"requires_payment_method"===n||"requires_source"===n?t:null}},5326:function(e,t,n){"use strict";n.d(t,{$o:function(){return d},Eo:function(){return m},NO:function(){return l},ct:function(){return f},gg:function(){return u},yn:function(){return p}});var r=n(9581),o=n(942),i=n(6977),a=n(3849),c=n(6274).Promise,s=function(e){switch(e.type){case"error":return{error:e.error};case"object":switch(e.object.object){case"payment_intent":return{paymentIntent:e.object};case"setup_intent":return{setupIntent:e.object};default:return(0,r.Rz)(e.object)}default:return(0,r.Rz)(e)}},u=function(e,t,n,r,i,a,c){return t===o.kE.PAYMENT_INTENT?n.action.retrievePaymentIntent({hosted:i,intentSecret:e,locale:r,asErrorIfNotSucceeded:a,expandParam:c||[]}).then(s):n.action.retrieveSetupIntent({hosted:i,intentSecret:e,locale:r,asErrorIfNotSucceeded:a,expandParam:c||[]}).then(s)},l=function(e,t,n,r,o){return u(e,t,n,r,!1,!0,o)},d=function(e,t,n,r,i,a,c){return t===o.kE.PAYMENT_INTENT?n.action.cancelPaymentIntentSource({intentSecret:e,locale:i,sourceId:r,sourceIntentId:a,publishableKey:c}).then(s):n.action.cancelSetupIntentSource({intentSecret:e,locale:i,sourceId:r,sourceIntentId:a,publishableKey:c}).then(s)},p=function(e){return(e.error?e.error.payment_intent||e.error.setup_intent:e.paymentIntent||e.setupIntent)||null},m=function(e,t,n,r,o,i){var a,c=!0,s=3,u=0;return function d(){u+=1,l(e,t,n,r,o).then((function(e){if(c){var t=p(e);if(null!==t)switch(s=3,t.status){case"requires_action":case"requires_source_action":return void(a=setTimeout(d,5e3));case"processing":return void(a=setTimeout(d,1e3));default:i(e,u)}else if(s>0){var n=500*Math.pow(2,3-s);a=setTimeout(d,n),s-=1}else i(e,u)}}))}(),function(){clearTimeout(a),c=!1}},f=function(e){var t=e.initialDelay,n=e.pollTimeGap,r=e.checkIntent,o=e.locale,u=e.controller,l=e.intent,d=e.expandParam,p=void 0===d?[]:d,m=e.shouldPoll,f=void 0===m?function(){return!0}:m,_="payment_intent"===l.object?{paymentIntent:l}:{setupIntent:l};return new c((function(e){setTimeout((function(){var t=!1,c=setInterval((function(){if(!f())return e(_),void clearInterval(c);var n;t||(t=!0,(n={hosted:!1,intentSecret:(0,i.O3)(l),locale:o,expandParam:p},"payment_intent"===l.object?u.action.retrievePaymentIntent(n):u.action.retrieveSetupIntent(n)).then((function(n){if(t=!1,_=s(n),n.error){if("lock_timeout"===n.error.code||"rate_limit"===n.error.code)return;u.action.localizeError(a.I4).then((function(e){return{error:e.error}})).then(e),clearInterval(c)}else r(n.object)&&(e(_),clearInterval(c))})))}),n)}),t-n)}))}},8147:function(e,t,n){"use strict";n.d(t,{z:function(){return s}});var r=n(3849),o=n(6183),i=n(9792),a=n(6274).Promise,c=function(e){return e?"payment_intent"===e.object?e.last_payment_error:e.last_setup_error:null},s=function(e,t,n,s){return new a((function(a){var u=new i.E,l=n.createLightboxFrame({type:o.NC.HCAPTCHA_APP,options:{intentId:t.id,clientSecret:t.client_secret,locale:s,sitekey:e.site_key,verifyUrl:e.verification_url,rqdata:e.rqdata,startTime:u.getAsPosixTime()}}),d=function(e){var t=r.I4;return null!=e&&(t=e),n.action.localizeError(t).then((function(e){return{error:e.error}}))};n.report("intent_confirmation_challenge.start"),l._on("load",(function(){n.report("intent_confirmation_challenge.stripe_js_frame_loaded",{duration_since_start_ms:u.getElapsedTime()}),l.fadeInBackdrop()})),l.show(),l._on("request-cancel",(function(e){l.fadeOutBackdrop(),l.destroy(!0),n.report("intent_confirmation_challenge.cancel"),a(d(c(null==e?void 0:e.intent)))})),l._on("request-close",(function(e){l.fadeOutBackdrop(),l.destroy(!0);var t=null==e?void 0:e.intent;if(t){var o=c(t);o?/Captcha/.test(o.message||"")?(n.report("intent_confirmation_challenge.verification_failed"),a(d(o))):(n.report("intent_confirmation_challenge.success"),a(d(o))):(n.report("intent_confirmation_challenge.success"),function(e,t){"payment_intent"===t.object?e({paymentIntent:t}):e({setupIntent:t})}(a,t))}else n.report("intent_confirmation_challenge.verification_error"),a(d(r.I4))}))}))}},2262:function(e,t,n){"use strict";n.d(t,{g:function(){return a}});var r=n(5326),o=n(6977),i=n(6274).Promise,a=function(e){var t=e.controller,n=e.intent,a=e.locale;return new i((function(e){return(0,r.ct)({controller:t,initialDelay:8e3,pollTimeGap:5e3,intent:n,checkIntent:function(e){return!(0,o.mD)(e.status)&&"processing"!==e.status},locale:a}).then((function(t){return e(t)}))}))}},6090:function(e,t,n){"use strict";n.d(t,{U:function(){return m}});var r=n(1413),o=n(5987),i=n(6042),a=n(6183),c=n(5326),s=n(6977),u=n(3333),l=n(6274).Promise,d=["size"],p=function(e){return!(0,s.mD)(e.status)},m=function(e){var t=e.controller,n=e.initialDelay,s=void 0===n?5e3:n,m=e.intent,f=e.lightboxOptions,_=e.locale,h=e.pollInterval,y=void 0===h?2e3:h,v=e.url,g=f.size,b=(0,o.Z)(f,d),w=(0,i.q)(t,(0,r.Z)({url:(0,a.jr)(v),size:u.q$?"fullScreen":g||"400x600",locale:_,useLightboxHostedCloseButton:!1},b)),k=!1;return new l((function(e){return w._on("load",(function(){w.show(),w.fadeInBackdrop()})),w._once("request-close",(function(){(0,i.G)(w).then((function(){k=!0,"payment_intent"===m.object&&e({paymentIntent:m}),"setup_intent"===m.object&&e({setupIntent:m})}))})),w._on("complete",(function(t){(0,i.G)(w).then((function(){k=!0,e(t)}))})),(0,c.ct)({controller:t,initialDelay:s,pollTimeGap:y,intent:m,checkIntent:p,shouldPoll:function(){return!k},locale:_}).then((function(t){"error"in t&&t.error||k||w.destroy(!0).then((function(){e(t)}))}))}))}},6790:function(e,t,n){"use strict";n.d(t,{e:function(){return s},k:function(){return c}});var r=n(1849),o=n(6977),i=n(3379),a=n(6617),c=function(e,t,n,c){var s,u;if("affirm-hooks.stripe.com"===(null===(s=(0,a.Ds)(t))||void 0===s?void 0:s.host)&&-1!==(null===(u=n._betas)||void 0===u?void 0:u.indexOf("affirm_in_context_beta_1")))return new i.H({paymentIntent:e,redirectUrl:t,controller:n,paymentSurface:c?"payment_element":"direct_integration",paymentMethod:"affirm",fallbackToRedirectOnErrors:!1}).collectPayment();return(0,r.U)(t).then((function(t){return(0,r.d)(n,"next_action redirect",t),(0,o.PA)(t,e)}))},s=function(e,t,n){return(0,r.U)(t).then((function(t){return(0,r.d)(n,"next_action redirect",t),(0,o.e3)(t,e)}))}},4243:function(e,t,n){"use strict";n.d(t,{O:function(){return c}});var r=n(6183),o=n(5326),i=n(6977),a=n(6274).Promise,c=function(e){var t=e.action,n=e.controller,c=e.intent,s=e.hosted,u=n.createLightboxFrame({type:r.NC.SMTC_COLLECTION_INNER,options:{collectionUrl:t.collectionUrl,cardBrand:t.cardBrand,merchantDisplayName:t.merchantDisplayName,livemode:t.livemode,threeDSecureSource:t.threeDSecureSource}});return new a((function(e){u._on("load",(function(){u.show(),u.fadeInBackdrop()})),u._on("request-close",(function(r){var a=r.isUserCanceled,l=(0,i.RY)(c.client_secret);if(!l)return e({error:new Error("Invalid client secret")});var d="payment_intent"===c.object?"PAYMENT_INTENT":"SETUP_INTENT";return(!0===a&&t.threeDSecureSource&&t.threeDSecureSource.length>0?(0,o.$o)(l,d,n,t.threeDSecureSource,"en"):(0,o.gg)(l,d,n,"en",s,!1,void 0)).then((function(t){u.destroy(!0).then((function(){var n=(0,o.yn)(t);return n?"payment_intent"===n.object?e({paymentIntent:n}):e({setupIntent:n}):e({error:new Error("Invalid intent")})}))}))}))}))}},122:function(e,t,n){"use strict";n.d(t,{s:function(){return l}});var r=n(3324),o=n(1413),i=n(4200),a=n(6183),c=n(5326),s=n(9792),u=n(6274).Promise,l=function(e,t,n,l,d,p){var m=(0,i.xz)(),f=new s.E,_=function(e,t,n,r,i){return e.createLightboxFrame({type:a.NC.AUTHORIZE_WITH_URL,options:(0,o.Z)({url:t,locale:i,intentId:n},r?{source:r}:{})})}(l,e.url,t.id,e.source,d);return _.show(),l.report("authorize_with_url.loading",{viewport:m,intentId:t.id}),_._on("load",(function(){l.report("authorize_with_url.loaded",{loadDuration:f.getElapsedTime(),intentId:t.id}),_.fadeInBackdrop()})),_._on("challenge_complete",(function(){_.fadeOutBackdrop()})),new u((function(o){var i=e.source;i&&_._once("cancel",(function(){u.all([(0,c.$o)(t,n,l,i,d),_.destroy()]).then((function(e){var t=(0,r.Z)(e,1)[0];return o(t)}))})),_._once("authorize_with_url_done",(function(){var e=_.destroy();(0,c.Eo)(t,n,l,d,p,(function(n,r){e.then((function(){l.report("authorize_with_url.done",{shownDuration:f.getElapsedTime(),success:!("error"in n),intentId:t.id,iterations:r}),o(n)}))}))}))}))}},9488:function(e,t,n){"use strict";n.d(t,{A:function(){return Q}});var r=n(3324),o=n(9581),i=n(9792),a=n(1413),c=n(5987),s=n(6183),u=n(6274).Promise,l=["type","optimizations","oneClickAuthn"],d=function(e,t){var n=t.intentSecret,r=t.controller,o=t.locale,i=t.hosted,a=r.createLightboxFrame({type:s.NC.STRIPE_3DS2_CHALLENGE,options:{intentId:n.id,hosted:i,locale:o}});r.report("3ds2.challenge_frame.loading",{intentId:n.id,hosted:i}),a._on("challenge_complete",(function(){a.fadeOutBackdrop()}));var c=function(e){return new u((function(t){e._on("load",(function(){return t(e)}))}))}(a);return c.then((function(){return r.report("3ds2.challenge_frame.loaded",{intentId:n.id,hosted:i})})),i&&(a.show(),a.action.show3DS2Spinner({cardBrand:e.cardBrand})),c},p=function(e,t){var n=t.oneClickAuthnDeviceSupport,r=t.oneClickAuthnOptedOut,o=t.challengeFrame;return new u((function(t,i){o.then((function(o){var u=function(){return i(new Error("User canceled"))};o._once("cancel",u),o.isVisible||(o.show(),o.fadeInBackdrop());e.type;var d=e.optimizations,p=(e.oneClickAuthn,(0,c.Z)(e,l));o.action.perform3DS2Challenge((0,a.Z)((0,a.Z)({},p),{},{shouldSandbox:d.sandboxChallengeFrame,recordFinalCres:d.recordFinalCres,oneClickAuthnDeviceSupport:n,oneClickAuthnOptedOut:r,oneClickWebauthnEnrollmentAppUrl:(0,s.xS)("one-click-webauthn-enrollment-6e0490ddf611d843f92752660240a113.html")})).then((function(){o._off("cancel",u),t()}))}))}))},m=n(6274).Promise,f=function(e,t,n){var r=n.authenticateResponse,i=n.oneClickAuthnDeviceSupport,a=n.oneClickAuthnOptedOut,c=n.challengeFrame,s=t.controller,l=t.hosted,d=t.intentSecret;if("error"===r.type)return m.resolve();var f,_=r.object,h=_.state,y=_.ares,v=_.creq;if("delegated"===h)return m.resolve();if(null===y)return m.resolve();if(y.transStatus&&["N","R","U"].indexOf(y.transStatus)>-1&&y.cardholderInfo&&y.cardholderInfo.length>15)return function(e,t){return new u((function(n){t.then((function(t){t._once("cancel",n),t.isVisible||(t.show(),t.fadeInBackdrop()),t.action.showCardholderInfoMessage({cardholderInfo:e,onMessageDismiss:function(){}}).then((function(){t._off("cancel",n),n()}))}))}))}(y.cardholderInfo,c);if("C"!==y.transStatus||null==v)return s.report("3ds2.frictionless",{hosted:l,intentId:d.id}),m.resolve();switch(e.gateway){case"emvco":f={type:"3ds2-challenge",gateway:e.gateway,threeDS2Source:e.threeDS2Source,cardBrand:e.cardBrand,transactionId:e.transactionId,acsUrl:y.acsURL,acsTransactionId:y.acsTransID,optimizations:e.optimizations,oneClickAuthn:e.oneClickAuthn,creq:v,publishableKey:e.publishableKey};break;case"itmx":var g=r.object.itmx;f={type:"3ds2-challenge",gateway:e.gateway,threeDS2Source:e.threeDS2Source,cardBrand:e.cardBrand,transactionId:e.transactionId,acsUrl:y.acsURL,acsTransactionId:y.acsTransID,optimizations:e.optimizations,oneClickAuthn:e.oneClickAuthn,creq:v,publishableKey:e.publishableKey,stepUpUrl:null==g?void 0:g.stepUpUrl,accessToken:null==g?void 0:g.accessToken};break;default:(0,o.Rz)(e)}return p(f,{oneClickAuthnDeviceSupport:i,oneClickAuthnOptedOut:a,challengeFrame:c})},_=n(5326),h=n(8948),y=n(6274).Promise,v=function(e,t,n){var r=t.intentSecret,o=t.intentType,i=t.controller,a=t.locale;return(0,_.NO)(r,o,i,a,n)},g=function(e,t){var n=t.controller,r=t.intentSecret,o=t.intentType,i=t.locale;return(0,_.$o)(r,o,n,e.threeDS2Source,i,e.threeDS2Intent,e.publishableKey)},b=function(e,t){var n=e.intentSecret,o=e.controller,i=e.hosted,c=t.intent,s=t.challengeFrame,u=t.startTimestamp;return y.all([c,s.then((function(e){return e.destroy()}))]).then((function(e){var t=(0,r.Z)(e,1)[0];return o.report("3ds2.done",(0,a.Z)({intentId:n.id,hosted:i,totalDuration:u.getElapsedTime()},t.error?{error:(0,h.Am)(t.error),success:!1}:{success:!0})),t}))},w=n(6274).Promise,k=function(e){var t=e.intentSecret,n=e.controller,r=e.hosted,o=e.locale,i=n.createHiddenFrame(s.NC.STRIPE_3DS2_FINGERPRINT,{intentId:t.id,locale:o,hosted:r});n.report("3ds2.fingerprint_frame.loading",{hosted:r,intentId:t.id});var a=function(e){return new w((function(t){e._on("load",(function(){return t(e)}))}))}(i);return a.then((function(){n.report("3ds2.fingerprint_frame.loaded",{hosted:r,intentId:t.id})})),a},S=function(e,t){var n=t.intentSecret,r=t.controller,i=t.hosted;return e.optimizations.skipFingerprint?w.resolve({fingerprintAttempted:!1,fingerprintData:null}):""===e.methodUrl?(r.report("3ds2.fingerprint.no_method_url",{hosted:i,intentId:n.id}),w.resolve({fingerprintAttempted:!1,fingerprintData:null})):k(t).then((function(t){var n;switch(e.gateway){case"emvco":n={gateway:e.gateway,threeDS2Source:e.threeDS2Source,merchant:e.merchant,transactionId:e.transactionId,methodUrl:e.methodUrl,shouldSandbox:e.optimizations.sandboxFingerprintFrame};break;case"itmx":n={gateway:e.gateway,threeDS2Source:e.threeDS2Source,merchant:e.merchant,transactionId:e.transactionId,methodUrl:e.methodUrl,shouldSandbox:e.optimizations.sandboxFingerprintFrame,accessToken:e.accessToken};break;default:return(0,o.Rz)(e)}return t.action.perform3DS2Fingerprint(n).then((function(e){return t.destroy(),e}))}))},C=n(3333),E=n(6274).Promise,A=function(){if(void 0===window.PublicKeyCredential||function(){if(!/CrOS/i.test(window.navigator.userAgent))return!1;var e=window.navigator.userAgent.match(/Chrome\/\d+\.\d+\.(\d+)\.(\d+)/)||[],t=Number(e[1]),n=Number(e[2]);return!(4389===t&&n>=82||4430===t&&n>=11||t>=4431)}()||function(){var e=/iPad|iPhone/i.test(window.navigator.userAgent),t=/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent)&&!/SamsungBrowser/.test(window.navigator.userAgent);if(!e||t)return!1;var n=window.navigator.userAgent.match(/OS (\d+)_(\d+)(_\d+)? like Mac OS X/)||[],r=parseInt(n[1],10),o=parseInt(n[2],10);return!isNaN(r)&&!isNaN(o)&&(15===r&&o>=4||r>15)}())return E.resolve(!1);var e=window.PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable(),t=new E((function(e){return setTimeout((function(){return e(!1)}),500)}));return E.race([e,t]).catch((function(){return!1}))},P=n(6274).Promise,M=function(){if(void 0===window.PaymentRequest)return P.resolve(!1);if(!/Chrome\/(9[5-9]|[1-9]\d\d)/.test(window.navigator.userAgent))return P.resolve(!1);if(C.sV&&!/Chrome\/(109|1[1-9]\d|[2-9]\d{2}|[1-9]\d{3,})/.test(window.navigator.userAgent))return P.resolve(!1);try{var e=[{supportedMethods:"secure-payment-confirmation",data:{action:"authenticate",credentialIds:[new Uint8Array(1)],challenge:new Uint8Array(1),fallbackUrl:window.location,rpId:"stripe.com",payeeOrigin:"https://stripe.com",instrument:{displayName:"Mock ····1234",icon:'data:image/svg+xml;utf8,'}}}];return new window.PaymentRequest(e,{total:{label:"Total",amount:{currency:"USD",value:"0"}}}).canMakePayment().catch((function(){return!1}))}catch(e){return P.resolve(!1)}},R="stripe-js-one-click-authn",I="W",N="S",T="SE/WA",O=function(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},x=function(e){return atob(e.replace(/-/g,"+").replace(/_/g,"/"))},j=function(e){var t=x(e);return Uint8Array.from(t,(function(e){return e.charCodeAt(0)}))},Z=(n(3637),n(3407),n(8037),function(e){return"data:image/svg+xml,".concat(encodeURIComponent(e.replace(/\n/g,"").replace(/\s+/g," ")))}),L=function(e){switch(e){case"visa":return Z('\n \n \n \n \n');case"amex":return Z('\n \n \n \n \n \n \n \n \n \n');case"mastercard":return Z('\n \n \n \n \n \n \n');case"unionpay":case"discover":case"jcb":case"diners":case"unknown":case"elo":return Z('');default:return(0,o.Rz)(e)}},D=n(5558),B=n(6977),q=n(6274).Promise,F=function(e,t,n){var r=e.threeDS2Source,o=e.oneClickAuthn,i=t.controller,c=n.deviceSupport,s=n.startTimestamp,u=q.resolve({authenticationAPIParam:null,optedOut:!1,isSPCRequested:!1}),l=q.resolve({authenticationAPIParam:null,optedOut:!1,isSPCRequested:!0});if(!o)return u;var d,p=o.credentials.filter((function(e){return e.type===B.QS}));if(0===p.length)return i.report("one_click_authn.request_spc_authn.empty_credentials_list",{client_id:R,source:r,device_support:c}),u;try{var m=o.merchant.origin;if(!m)return i.report("one_click_authn.request_spc_authn.empty_merchant_origin",{client_id:R,source:r,device_support:c}),u;(d=document.createElement("meta")).name=(0,D.To)("__privateStripeMeta"),d.httpEquiv="origin-trial",d.content="A2ZxBmgWRc3CxEGqZ0aWPMB4MUSx1dSjXn2pGXpMq8NLQh00TMwiKf5A8NEQegaXHfDY7IxdHtYPxI0KRKEWNgQAAAB6eyJvcmlnaW4iOiJodHRwczovL2pzLnN0cmlwZS5jb206NDQzIiwiZmVhdHVyZSI6IlNlY3VyZVBheW1lbnRDb25maXJtYXRpb25PcHRPdXQiLCJleHBpcnkiOjE2Nzg0MDYzOTksImlzVGhpcmRQYXJ0eSI6dHJ1ZX0=",document.head.appendChild(d);var f=new window.PaymentRequest(function(e,t,n){var r=n.authenticationChallenge,o=n.instrument,i=o.cardBrand,a=o.cardName,c=o.cardLast4,s=n.merchant;return[{supportedMethods:"secure-payment-confirmation",data:{action:"authenticate",rpId:"stripe.com",credentialIds:e.map((function(e){return j(e.id)})),challenge:j(r),timeout:6e4,fallbackUrl:window.location.toString(),instrument:{displayName:"".concat(a," ····").concat(c),icon:L(i)},payeeOrigin:t,payeeName:s.name,showOptOut:!0}}]}(p,m,o),{total:{label:"Total",amount:o.amount}});return i.report("one_click_authn.request_spc_authn.prompted",{client_id:R,source:r,timeToComplete:s.getElapsedTime(),device_support:c}),f.show().then((function(e){var t;return e.complete("success"),i.report("one_click_authn.request_spc_authn.completed",{client_id:R,source:r,timeToComplete:s.getElapsedTime(),device_support:c}),{authenticationAPIParam:{type:B.QS,assertion:(t=e.details,{type:"public-key",id:t.id,raw_id:t.id,response:{authenticator_data:O(t.response.authenticatorData),client_data_json:O(t.response.clientDataJSON),signature:O(t.response.signature)}}),payment_data:{merchant_data:{merchant_origin:m,total:o.amount},network_data:o.authenticationChallenge}},optedOut:!1,isSPCRequested:!0}})).catch((function(e){if(function(e){return"OptOutError"===e.name&&-1!==e.message.indexOf("opted out")}(e))return i.report("one_click_authn.request_spc_authn.opted_out",{client_id:R,source:r,timeToOptedOut:s.getElapsedTime(),device_support:c}),q.resolve({authenticationAPIParam:null,optedOut:!0,isSPCRequested:!0});var t={AbortError:"request_aborted",InvalidStateError:"payment_already_shown",NotSupportedError:"payment_method_not_supported",SecurityError:"security_error"}[e.name]||"unexpected_error";return i.report("one_click_authn.request_spc_authn.error",{reason:t,client_id:R,source:r,timeToError:s.getElapsedTime(),device_support:c,error:(0,a.Z)({name:e.name,message:e.message},e)}),l}))}catch(e){i.report("one_click_authn.request_spc_authn.error",{client_id:R,reason:"unexpected_error",source:r,timeToError:s.getElapsedTime(),device_support:c,error:(0,a.Z)({name:e.name,message:e.message},e)})}return l},U=n(6274).Promise,G=n(6274).Promise,z=function(e,t){var n=e.threeDS2Source,r=e.oneClickAuthn,o=t.controller;if(!r)return null;var i=C.s$?"safari":C.D1?"firefox":C.P0||C.Bh?"edge":C.G9?C.sV?"chrome_android":/Chrome\/10[4-9]/.test(window.navigator.userAgent)?"chrome_in_opt_out_trial":/Chrome\/(1[1-9]\d|[2-9]\d{2}|[1-9]\d{3,})/.test(window.navigator.userAgent)?"chrome_with_opt_out":"chrome":null;if(!i)return o.report("one_click_authn.configuration.error",{client_id:R,reason:"browser_not_found",source:n}),null;try{switch(new URLSearchParams(x(r.configuration)).get(i)){case I:return I;case N:return N;case T:return T;default:return null}}catch(e){return o.report("one_click_authn.configuration.error",{client_id:R,reason:"unexpected_error",source:n,error:(0,a.Z)({name:e.name,message:e.message},e)}),null}},V=function(){try{return 0==="https://js.stripe.com/v3/".indexOf(window.top.location.origin)}catch(e){return!1}},K=function(){var e=document.featurePolicy;if(!e)return!1;try{return-1!==e.allowedFeatures().indexOf("publickey-credentials-get")}catch(e){return!1}},H=function(e,t,n,r,o){return function(e,t,n){var r=t.controller,o=n.deviceSupport,i=n.challengeFrame,a=n.startTimestamp,c=e.oneClickAuthn;if(!c)return U.resolve(null);var u=c.credentials;return 0===u.length?(r.report("one_click_authn.request_webauthn_authn.empty_credentials_list",{client_id:R,source:e.threeDS2Source,device_support:o}),U.resolve(null)):new U((function(t,n){i.then((function(r){var i=function(){return n(new Error("User canceled"))};r._once("cancel",i),r.isVisible||(r.show(),r.fadeInBackdrop());var l={amount:c.amount,instrument:c.instrument,merchant:c.merchant,authenticationChallenge:c.authenticationChallenge,layout:c.layout,allowCredentials:u};return r.action.performOneClickWebauthnAuthentication({threeDS2Source:e.threeDS2Source,cardBrand:e.cardBrand,appUrl:(0,s.xS)("one-click-webauthn-authentication-06d0f1c53872d12a75080ab20ce9cdec.html"),deviceSupport:o,payload:l,startPosixTime:a.getAsPosixTime()}).then((function(e){r._off("cancel",i),t(e)}))}))}))}(e,t,{deviceSupport:n,challengeFrame:r,startTimestamp:o}).then((function(e){return{deviceSupport:n,authenticationAPIParam:e,optedOut:!1}}))},Y=function(e,t){return G.all([M(),A()]).then((function(n){var o=(0,r.Z)(n,2),i=o[0],a=o[1];return{sameOriginFrame:V(),spcEligible:i,webauthnEligible:a,publickeyCredentialsGetAllowed:K(),configurationType:z(e,t)}}))},W=function(e,t,n){var r=n.challengeFrame,o=n.startTimestamp;return Y(e,t).then((function(n){return a=(i=n).webauthnEligible,c=i.configurationType,!a||c!==I&&c!==T?function(e){var t=e.spcEligible,n=e.configurationType;return t&&n===N}(n)?F(e,t,{deviceSupport:n,startTimestamp:o}).then((function(i){var a=i.authenticationAPIParam,c=i.optedOut;return!i.isSPCRequested&&n.webauthnEligible?H(e,t,n,r,o):{deviceSupport:n,authenticationAPIParam:a,optedOut:c}})):{deviceSupport:n,authenticationAPIParam:null,optedOut:!1}:H(e,t,n,r,o);var i,a,c}))},X=n(6274).Promise,Q=function(e,t,n){var a=new i.E,c=d(e,t);switch(e.type){case"3ds2-challenge":return Y(e,t).then((function(r){return p(e,{oneClickAuthnDeviceSupport:r,oneClickAuthnOptedOut:!1,challengeFrame:c}).then((function(){return b(t,{intent:v(0,t,n),challengeFrame:c,startTimestamp:a})}),(function(){return b(t,{intent:g(e,t),challengeFrame:c,startTimestamp:a})}))}));case"3ds2-fingerprint":return X.all([S(e,t),W(e,t,{challengeFrame:c,startTimestamp:a})]).then((function(n){var o=(0,r.Z)(n,2),i=o[0],a=o[1];return function(e,t,n){var r=n.fingerprintResult,o=n.oneClickAuthn,i=t.controller,a=t.hosted,c=t.intentSecret;return i.report("3ds2.authenticate",{hosted:a,intentId:c.id}),i.action.authenticate3DS2({threeDS2Source:e.threeDS2Source,gateway:e.gateway,outerWindowWidth:window.innerWidth,hosted:a,fingerprintResult:r,oneClickAuthnDeviceSupportAPIParam:{hosted:a,same_origin_frame:o.deviceSupport.sameOriginFrame,spc_eligible:o.deviceSupport.spcEligible,webauthn_eligible:o.deviceSupport.webauthnEligible,publickey_credentials_get_allowed:o.deviceSupport.publickeyCredentialsGetAllowed},oneClickAuthnAuthenticationAPIParam:o.authenticationAPIParam,publishableKey:e.publishableKey}).then((function(e){return"error"===e.type?i.report("3ds2.authenticate.error",{error:e.error,hosted:a,intentId:c.id}):i.report("3ds2.authenticate.success",{hosted:a,intentId:c.id}),e}))}(e,t,{fingerprintResult:i,oneClickAuthn:a}).then((function(n){return f(e,t,{authenticateResponse:n,oneClickAuthnDeviceSupport:a.deviceSupport,oneClickAuthnOptedOut:a.optedOut,challengeFrame:c})}))})).then((function(){return b(t,{intent:v(0,t,n),challengeFrame:c,startTimestamp:a})}),(function(){return b(t,{intent:g(e,t),challengeFrame:c,startTimestamp:a})}));default:return(0,o.Rz)(e)}}},1788:function(e,t,n){"use strict";n.d(t,{Y:function(){return c}});var r=n(5326),o=n(6274).Promise,i=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.interval||1e4,i=n.timeout||3e5,a=(new Date).getTime();return new o((function(n){setTimeout((function c(){o.resolve(e(t)).catch((function(e){return{error:e}})).then((function(e){if(null==e)if((new Date).getTime()-a>i){n({error:new Error("Polling timed out without a valid response")})}else setTimeout(c,r);else n(e)}))}),r)}))}},a=n(6274).Promise,c=i((function(e){var t=e.intentSecret,n=e.intentType,o=e.controller,i=e.locale;return a.resolve((0,r.NO)(t,n,o,i)).then((function(e){var t=(0,r.yn)(e);return t?"requires_action"===t.status||"requires_source_action"===t.status?null:e:"error"in e&&"lock_timeout"===e.error.code?null:e}))}))},1297:function(e,t,n){"use strict";n.d(t,{l:function(){return c}});var r=n(6790),o=n(3333),i=n(6090),a=n(9581),c=function(e){var t=e.controller,n=e.locale,c=e.intent,s=e.groupId,u=e.clientSecret;return t.action.parseLuxeNextAction({intent:c,groupId:s,clientSecret:u}).then((function(e){if(null==e)return null;switch(e.type){case"luxe_confirm_on_mobile_device":return function(e){var t=e.controller,n=e.intent,c=e.parsedNextAction,s=e.locale;if(!o.q$||"on_mobile_only"!==(null==c?void 0:c.redirectBehavior)||!c.appUrl)return(0,i.U)({controller:t,intent:n,locale:s,url:c.hostedInstructionsUrl,lightboxOptions:{frameTitle:"hosted_qr_code_instructions.luxe.frame_title"}});switch(n.object){case"payment_intent":return(0,r.k)(n,c.appUrl,t);case"setup_intent":return(0,r.e)(n,c.appUrl,t);default:return(0,a.Rz)(n)}}({controller:t,intent:c,parsedNextAction:e,locale:n});case"luxe_in_context_completion":return function(e){var t=e.controller,n=e.intent,r=e.parsedNextAction,o=e.locale;return(0,i.U)({controller:t,intent:n,locale:o,url:r.url,lightboxOptions:{frameTitle:"luxe.in_context.frame_title"}})}({controller:t,intent:c,parsedNextAction:e,locale:n});default:return null}}))}},1452:function(e,t,n){"use strict";n.d(t,{Fh:function(){return z},nq:function(){return H},gO:function(){return K}});var r=n(1413),o=n(6977),i=n(3550),a=n(7549),c=n(122),s=n(9488),u=n(6042),l=n(6183),d=n(6274).Promise,p=n(8147),m=n(6274).Promise,f=n(6274).Promise,_=n(6274).Promise,h=n(1788),y=n(5326),v=n(6274).Promise,g=n(6274).Promise,b=n(6090),w=n(2262),k=n(6274).Promise,S=n(6274).Promise,C=n(6790),E=n(4243),A=n(1278),P=n(9581),M=n(942),R=n(8812),I=n(1765),N=function(e){return["id_bank_account","id_bank_transfer"].indexOf(e.bankTransferType)>-1},T=n(3379),O=n(5671),x=n(3144),j=n(9038),Z=function(){function e(t){(0,O.Z)(this,e),this._inContextData=t,this._inContextOuter=new j.B({inContextData:t,paymentMethodBehavior:{lightboxFrameOptions:this._lightboxFrameOptions.bind(this),addModalListeners:this._addModalListeners.bind(this),inContextOuterConfig:{showLightboxBackdrop:!1}}})}return(0,x.Z)(e,[{key:"collectPayment",value:function(){return this._inContextOuter.collectPayment()}},{key:"_lightboxFrameOptions",value:function(){var e=this._inContextData,t=e.paymentMethod,n=e.paymentIntent,r=e.controller,o=e.paymentSurface;return{paymentMethodType:t,clientToken:e.clientToken,stripeReturnUrl:e.stripeReturnUrl,interactionMode:e.interactionMode,controllerId:r._id,paymentSurface:o,intentId:n.id}}},{key:"_addModalListeners",value:function(e){var t=this;e._once("sdk_initialized",(function(){t._inContextOuter.clearModalLoadTimeout()}))}}]),e}(),L=function(){function e(t){(0,O.Z)(this,e),this._inContextData=t,this._inContextOuter=new j.B({inContextData:t,paymentMethodBehavior:{lightboxFrameOptions:this._lightboxFrameOptions.bind(this),addModalListeners:this._addModalListeners.bind(this),inContextOuterConfig:{showLightboxBackdrop:!0}}})}return(0,x.Z)(e,[{key:"collectPayment",value:function(){return this._inContextOuter.collectPayment()}},{key:"_lightboxFrameOptions",value:function(){var e=this._inContextData,t=e.paymentMethod,n=e.paymentIntent,r=e.controller,o=e.paymentSurface;return{paymentMethodType:t,redirectUrl:e.redirectUrl,controllerId:r._id,paymentSurface:o,intentId:n.id}}},{key:"_addModalListeners",value:function(e){var t=this;e._once("checkout_launched",(function(){t._inContextOuter.clearModalLoadTimeout()})),e._once("close_modal",(function(){t._inContextOuter.closeModal()}))}}]),e}(),D=n(1297),B=n(3849),q=n(9792),F=n(6274).Promise,U=function(e){return e?"payment_intent"===e.object?e.last_payment_error:e.last_setup_error:null},G=n(6274).Promise,z=function(e){switch(e.type){case"error":var t=e.error;if("payment_intent_unexpected_state"===t.code&&"object"==typeof t.payment_intent&&null!=t.payment_intent&&"string"==typeof t.payment_intent.status&&(0,o.mD)(t.payment_intent.status)){var n=t.payment_intent;return{type:"object",locale:e.locale,object:n}}return e;case"object":return e;default:return(0,P.Rz)(e)}},V=function(e,t,i,P,O,x,j,z){var V=j||(0,o.G2)(t);if(null==V||!V.type)return G.resolve({paymentIntent:t});var K=(0,a.l)(V),H=(0,o.O3)(t);if(!K)return(0,D.l)({controller:e,intent:t,locale:i,clientSecret:H,groupId:z}).then((function(e){return null!=e?e:{paymentIntent:t}}));switch(K.type){case"cardimageverification-challenge":return n.e(428).then(n.bind(n,5798)).then((function(n){return(0,n.performCardImageVerification)(K,t,e,i)}));case"captcha-challenge":return(0,p.z)(K,t,e,i);case"card-details-recollection":return function(e,t,n,r){return new F((function(o){var i=new q.E,a=n.createLightboxFrame({type:l.NC.CARD_DETAILS_RECOLLECTION_MODAL,options:{intentId:t.id,clientSecret:t.client_secret,cardDetails:e.card_details,completeUrl:e.complete_url,locale:r,cardBrand:e.card_brand,cardName:e.card_name,cardCountry:e.card_country,cardLast4:e.card_last4,buttonColor:e.button_color}}),c=function(e){var t=B.I4;return null!=e&&(t=e),n.action.localizeError(t).then((function(e){return{error:e.error}}))};n.report("card_details_recollection.start"),a._on("load",(function(){n.report("intent_confirmation_challenge.stripe_js_frame_loaded",{duration_since_start_ms:i.getElapsedTime()}),a.fadeInBackdrop()})),a.show(),a._on("request-cancel",(function(e){a.fadeOutBackdrop(),a.destroy(!0),n.report("card_details_recollection.cancel"),o(c(U(null==e?void 0:e.intent)))})),a._on("request-close",(function(e){a.fadeOutBackdrop(),a.destroy(!0);var t=null==e?void 0:e.intent;if(t){var r=U(t);r?/CardDetailsRecollection/.test(r.message||"")?(n.report("card_details_recollection.error"),o(c(r))):(n.report("card_details_recollection.success"),o(c(r))):(n.report("card_details_recollection.success"),function(e,t){"payment_intent"===t.object?e({paymentIntent:t}):e({setupIntent:t})}(o,t))}else o(c(B.I4))}))}))}(K,t,e,i);case"3ds1-modal":return(0,c.s)(K,H,M.kE.PAYMENT_INTENT,e,i,O);case"3ds2-fingerprint":case"3ds2-challenge":return(0,s.A)(K,{intentSecret:H,intentType:M.kE.PAYMENT_INTENT,controller:e,locale:i,hosted:P},O);case"redirect":return(0,C.k)(t,K.redirectUrl,e,x);case"blik_authorize":return function(e){var t=e.controller,n=e.intent,r=e.locale,o=e.shouldDisplayInstructionsModal;return new v((function(e){var i,a=!1;return o&&((i=t.createLightboxFrame({type:l.NC.BLIK_INNER,options:{locale:r}}))._on("load",(function(){var e,t;null===(e=i)||void 0===e||e.show(),null===(t=i)||void 0===t||t.fadeInBackdrop()})),i._once("request-close",(function(){i&&(0,u.G)(i).then((function(){a=!0,e({paymentIntent:n})}))}))),(0,y.ct)({controller:t,initialDelay:8e3,pollTimeGap:5e3,intent:n,checkIntent:function(e){return"requires_action"!==e.status&&"requires_source_action"!==e.status||"blik_authorize"!==e.next_action.type},locale:r,shouldPoll:function(){return!a}}).then((function(t){var n;null!==(n=i)&&void 0!==n&&n.isVisible&&i.destroy(!0),a||e(t)}))}))}({controller:e,intent:t,locale:i,shouldDisplayInstructionsModal:x});case"boleto-display":if(void 0===K.hostedVoucherUrl)throw new R.No("Expect `next_action.boleto_display_details.hosted_voucher_url` of `PaymentIntent` to be not undefined. Please refer to \n\nhttps://stripe.com/docs/api/payment_intents/object#payment_intent_object-next_action-boleto_display_details-hosted_voucher_url");return function(e){var t=e.controller,n=e.url,r=e.intent,o=e.locale,i=(0,u.q)(t,{url:(0,l.jr)(n),size:"600x700",locale:o,frameTitle:"boleto.voucher_frame_title",useLightboxHostedCloseButton:!1});return new d((function(e){i._on("request-close",(function(){(0,u.G)(i).then((function(){e({paymentIntent:r})}))}))}))}({controller:e,locale:i,url:K.hostedVoucherUrl,intent:t});case"konbini-display":if(void 0===K.hostedVoucherUrl)throw new R.No("Expected option `handleActions` to be `false`. The Konbini pilot does not handle the next actions for you automatically yet (e.g. displaying Konbini payment details). Please refer to the Stripe Konbini integration guide for more info: \n\nhttps://stripe.com/docs/payments/konbini");return function(e){var t=e.controller,n=e.url,r=e.intent,o=e.locale,i=(0,u.q)(t,{url:(0,l.jr)(n),size:"600x900",locale:o,frameTitle:"konbini.voucher_frame_title",useLightboxHostedCloseButton:!1});return new m((function(e){i._on("request-close",(function(){(0,u.G)(i).then((function(){e({paymentIntent:r})}))}))}))}({controller:e,locale:i,url:K.hostedVoucherUrl,intent:t});case"mb_way_await_authorization":return function(e){var t=e.controller,n=e.intent,r=e.locale,i=e.expandParam;return new g((function(e){return(0,y.ct)({controller:t,initialDelay:3e3,pollTimeGap:3e3,intent:n,checkIntent:function(e){return!(0,o.mD)(e.status)},locale:r,expandParam:i}).then((function(t){return e(t)}))}))}({controller:e,intent:t,locale:i,expandParam:O});case"multibanco-display":if(void 0===K.hostedVoucherUrl)throw new R.No("Expect `next_action.multibanco_display_details.hosted_voucher_url` of `PaymentIntent` to be not undefined.");return function(e){var t=e.controller,n=e.url,r=e.intent,o=e.locale,i=(0,u.q)(t,{url:(0,l.jr)(n),size:"600x700",locale:o,frameTitle:"multibanco.voucher_frame_title",useLightboxHostedCloseButton:!1});return new f((function(e){i._on("request-close",(function(){(0,u.G)(i).then((function(){e({paymentIntent:r})}))}))}))}({controller:e,locale:i,url:K.hostedVoucherUrl,intent:t});case"in_context_completion":var Y={paymentIntent:t,redirectUrl:K.url,controller:e,paymentSurface:x?"payment_element":"checkout",fallbackToRedirectOnErrors:!0};switch(K.paymentMethodType){case"klarna":return new Z((0,r.Z)((0,r.Z)({},Y),{},{clientToken:K.klarna.clientToken,interactionMode:K.klarna.interactionMode,stripeReturnUrl:K.klarna.returnUrl,paymentMethod:"klarna"})).collectPayment();case"affirm":return new T.H((0,r.Z)((0,r.Z)({},Y),{},{paymentMethod:"affirm"})).collectPayment();case"afterpay_clearpay":return new L((0,r.Z)((0,r.Z)({},Y),{},{paymentMethod:"afterpay_clearpay"})).collectPayment();default:throw new R.No("paymentMethodType is unsupported")}case"oxxo-display":if(void 0===K.hostedVoucherUrl)throw new R.No("To handle the next actions automatically, set the API version to oxxo_beta=v2. Please refer to the Stripe OXXO integration guide for more info: \n\nhttps://stripe.com/docs/payments/oxxo");return function(e){var t=e.controller,n=e.url,r=e.intent,o=e.locale,i=(0,u.q)(t,{url:(0,l.jr)(n),size:"600x700",locale:o,frameTitle:"oxxo.voucher_frame_title",useLightboxHostedCloseButton:!1});return new _((function(e){i._on("request-close",(function(){(0,u.G)(i).then((function(){e({paymentIntent:r})}))}))}))}({controller:e,locale:i,url:K.hostedVoucherUrl,intent:t});case"upi_await_notification":return(0,h.Y)({controller:e,intentSecret:H,intentType:M.kE.PAYMENT_INTENT,locale:i});case"wechat_pay_display_qr_code":return function(e){var t=e.controller,n=e.intent,r=e.locale,o=e.url;return(0,b.U)({controller:t,intent:n,locale:r,url:o,lightboxOptions:{frameTitle:"hosted_qr_code_instructions.wechat_pay.frame_title"}})}({controller:e,locale:i,url:K.hostedInstructionsUrl,intent:t,intentSecret:H,intentType:M.kE.PAYMENT_INTENT});case"paynow_display_qr_code":return function(e){var t=e.controller,n=e.intent,r=e.locale,o=e.url;return(0,b.U)({controller:t,intent:n,locale:r,url:o,lightboxOptions:{frameTitle:"hosted_qr_code_instructions.paynow.frame_title"}})}({controller:e,locale:i,url:K.hostedInstructionsUrl,intent:t,intentSecret:H,intentType:M.kE.PAYMENT_INTENT});case"payto_await_authorization":return(0,w.g)({controller:e,intent:t,locale:i});case"pix_display_qr_code":if(void 0===K.hostedInstructionsUrl)throw new R.No("Expect `next_action.pix_display_qr_code.hosted_instructions_url` of `PaymentIntent` to be not undefined. Please refer to \n\nhttps://stripe.com/docs/api/payment_intents/object#payment_intent_object-next_action-pix_display_qr_code-hosted_instructions_url");return function(e){var t=e.controller,n=e.intent,r=e.intentSecret,o=e.intentType,i=e.locale,a=e.url,c=(0,u.q)(t,{url:(0,l.jr)(a),size:"450x750",locale:i,frameTitle:"pix.instructions_frame_title",useLightboxHostedCloseButton:!1}),s=null;return new k((function(e){c._on("load",(function(){c.show(),c.fadeInBackdrop()})),c._once("request-close",(function(){(0,u.G)(c).then((function(){s&&clearTimeout(s),e({paymentIntent:n})}))})),c._on("complete",(function(t){(0,u.G)(c).then((function(){s&&clearTimeout(s),e(t)}))})),s=setTimeout((function n(){(0,y.NO)(r,o,t,i).then((function(t){var r=(0,y.yn)(t);if(r)switch(r.status){case"requires_source_action":case"requires_action":return void(s=setTimeout(n,2e3));default:c.destroy(!0).then((function(){"payment_intent"===r.object?e({paymentIntent:r}):e({setupIntent:r})}))}}))}),5e3)}))}({controller:e,locale:i,url:K.hostedInstructionsUrl,intent:t,intentSecret:H,intentType:M.kE.PAYMENT_INTENT});case"promptpay_display_qr_code":return function(e){var t=e.controller,n=e.intent,r=e.locale,o=e.url;return(0,b.U)({controller:t,intent:n,locale:r,url:o,lightboxOptions:{frameTitle:"hosted_qr_code_instructions.promptpay.frame_title"}})}({controller:e,locale:i,intent:t,intentSecret:H,url:K.hostedInstructionsUrl,intentType:M.kE.PAYMENT_INTENT});case"display_bank_transfer_instructions":return function(e,t){return!!N(e)&&!(0,I.uN)(t||[],I.M4.id_bank_transfer_beta_1)}(K,e._betas)?(0,C.k)(t,K.hostedInstructionsUrl,e):function(e){return!N(e)}(K)?function(e){var t=e.controller,n=e.url,r=e.intent,o=e.locale,i=(0,u.q)(t,{url:(0,l.jr)(n),size:"600x700",locale:o,frameTitle:"display_bank_transfer_instructions.voucher_frame_title",useLightboxHostedCloseButton:!1});return new S((function(e){i._on("request-close",(function(){(0,u.G)(i).then((function(){e({paymentIntent:r})}))}))}))}({controller:e,url:K.hostedInstructionsUrl,intent:t,locale:i}):G.resolve({paymentIntent:t});case"swish_handle_redirect_or_display_qr_code":return function(e){var t=e.controller,n=e.intent,r=e.locale,i=(0,o.G2)(n);if(!i||"swish_handle_redirect_or_display_qr_code"!==i.type)throw new Error("Expected next_action.swish_handle_redirect_or_display_qr_code");return(0,b.U)({controller:t,intent:n,locale:r,url:i.swish_handle_redirect_or_display_qr_code.hosted_instructions_url,lightboxOptions:{frameTitle:"hosted_qr_code_instructions.swish.frame_title"}})}({controller:e,locale:i,intent:t});case"smtc-collection":return(0,E.O)({action:K,controller:e,intent:t,hosted:P});case"express_checkout_authentication_needed":if(!z)throw new Error("Unexpected Error, groupId is null/undefined.");return(0,A._)({controller:e,intent:t,locale:i,action:K,expandParam:O,groupId:z});default:return G.resolve({paymentIntent:t})}},K=function e(t,n,r,o,a,c){var s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=arguments.length>8?arguments[8]:void 0;if(M.kO5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6?arguments[6]:void 0;if(r.kO1?"properties":"property",": `").concat(v.join("`, `"),"`. Put additional API properties in `params`."));return(0,u.zS)(g)}if(f){var b=f._componentName,w=d._b[b];return(0,u.x4)({type:w,element:f,elements:null,data:p||{}})}if(y)return(0,u.x4)({type:null,element:null,elements:y,data:p||{}});if(p)return(0,u.x4)({type:p.type,element:null,elements:null,data:p})}var k,S=t.type,C=(0,c.Z)(t,h);if(null===e){if("string"!=typeof S)return(0,u.RH)("a string such as 'card', 'ideal', or 'sepa_debit'",typeof S,n,(0,u.NQ)(o,"type"));k=S}else{if(void 0!==S&&S!==e)return"string"!=typeof S?(0,u.RH)("a string such as 'card', 'ideal', or 'sepa_debit'",typeof S,n,(0,u.NQ)(o,"type")):(0,u.RH)('"'.concat(S,'"'),'"'.concat(e,'"'),n,(0,u.NQ)(o,"type"));k=e}var E=C[k],A=(C[k],(0,c.Z)(C,[k].map(r)));if(-1!==["acss_debit","affirm","afterpay_clearpay","alipay","amazon_pay","bancontact","cashapp","customer_balance","eps","giropay","grabpay","klarna","konbini","kr_market","mb_way","mobilepay","multibanco","ng_market","oxxo","p24","pay_by_bank","paynow","paypal","payto","pix","promptpay","rechnung","revolut_pay","south_korea_market","swish","twint","us_bank_account","wechat_pay","zip"].indexOf(k)&&void 0===E&&(E={}),"object"!=typeof E)return(0,u.RH)("an object or element",typeof t[k],n,(0,u.NQ)(o,k));if(null===E)return(0,u.RH)("an object or element","null",n,(0,u.NQ)(o,k));var P=(0,u.rX)(E);if(P){var M=P._componentName;if(d._b[M]!==k){var R=[].concat((0,i.Z)(o),[k]).join("."),I=n.label,N=new s.No("Invalid value for ".concat(I,": ").concat(R," was `").concat(M,"` Element, which cannot be used to create ").concat(k," PaymentMethods."));return(0,u.zS)(N)}return(0,u.x4)({type:k,element:P,elements:null,data:A})}return(0,u.x4)({type:k,element:null,elements:null,data:C})}},P=function(e,t,n){if(null==e)return(0,u.x4)(null);if(!(0,f.Kn)(e))return(0,u.RH)("object",typeof e,t,n);var r=e.card,i=(0,c.Z)(e,y);if(!(0,f.Kn)(r))return(0,u.x4)(e);var a=r.cvc,s=(0,c.Z)(r,v);if(null==a)return(0,u.x4)(e);var d=(0,u.rX)(a),p=d?d._componentName:"";return l.Yj.cardCvc!==p?(0,u.RH)("`".concat(l.Yj.cardCvc,"` Element"),p?"`".concat(p,"` Element"):typeof a,t,(0,u.NQ)(n,"card.cvc")):(0,u.x4)((0,o.Z)((0,o.Z)({},i),{},{card:(0,o.Z)((0,o.Z)({},s),{},{cvc:d})}))},M=(0,u.Wc)((0,u.mC)({handleActions:(0,u.Wc)(u.Xg,(function(){return!0}))}),(function(){return{handleActions:!0}})),R=function(e){return function(t,n,r){if("object"!=typeof t)return(0,u.RH)("object",typeof t,n,r);if(null===t)return(0,u.RH)("object","null",n,r);var o=t.billing_details,i=(0,c.Z)(t,g);return(0,u.x4)({paymentMethodData:{type:"".concat(e),billing_details:o},otherParams:i})}},I=function(e,t){return function(n,r,i){if("object"!=typeof n)return(0,u.RH)("object",typeof n,r,i);if(null===n)return(0,u.RH)("object","null",r,i);var a=n.clientSecret,s=n.params,l=n.onEvent,d=(0,c.Z)(n,b),p=(0,u.ld)(e,a,r.label,{path:["clientSecret"]});if("error"===p.type)return p;if("object"!=typeof s)return(0,u.RH)("object",typeof s,r,(0,u.NQ)(i,"params"));if(null===s)return(0,u.RH)("object","null",r,(0,u.NQ)(i,"params"));var f=s.payment_method_type,_=s.payment_method_data;if("string"!=typeof f)return(0,u.RH)("string",typeof f,r,(0,u.NQ)((0,u.NQ)(i,"params"),"payment_method_type"));if("object"!=typeof _&&void 0!==_)return(0,u.RH)("object",typeof _,r,(0,u.NQ)((0,u.NQ)(i,"params"),"payment_method_data"));var h=l;return void 0===l||(0,m.uN)(t,m.M4.financial_connections_on_event_beta_1)||(h=void 0),(0,u.x4)({clientSecret:p.value,paymentMethodData:(0,o.Z)({type:f},(null==_?void 0:_.billing_details)&&{billing_details:null==_?void 0:_.billing_details}),onEvent:h,otherParams:d})}},N=function(e,t){return function(n,r,o){if(void 0===n)return(0,u.x4)({paymentMethodData:null,paymentMethodOptions:null,source:null,paymentMethod:null,otherParams:{}});if(!(0,f.Kn)(n))return(0,u.RH)("object",null===n?"null":typeof n,r,o);var a=n.source,l=n.source_data,d=n.payment_method_data,p=n.payment_method_options,m=n.payment_method,_=(0,c.Z)(n,w);if(null!=l)throw new s.No("".concat(t,": Expected payment_method, or source, not source_data."));if(null!=d)throw new s.No("".concat(t,": Expected payment_method, or source, not payment_method_data."));if(null!=a&&null!=m)throw new s.No("".concat(t,": Expected either payment_method or source, but not both."));if(null===e&&null!=m&&"string"!=typeof m)throw new s.No("".concat(t,": Expected payment_method[type] to be set if payment_method is passed."));if(null!=a){if("string"!=typeof a)return(0,u.RH)("string",typeof a,r,(0,u.NQ)(o,"source"));if("updatePaymentIntent"===t)throw new s.No("".concat(t,": Expected payment_method, not source to be passed."));return(0,u.x4)({source:a,paymentMethodData:null,paymentMethodOptions:null,paymentMethod:null,otherParams:_})}if(null!=m&&"string"!=typeof m&&"object"!=typeof m)return(0,u.RH)("string or object",typeof m,r,(0,u.NQ)(o,"payment_method"));var h=(0,u.ld)(P,p,t,{path:[].concat((0,i.Z)(o),["payment_method_options"])});if("error"===h.type)return h;if("string"==typeof m)return(0,u.x4)({source:null,paymentMethodData:null,paymentMethodOptions:h.value,paymentMethod:m,otherParams:_});if("object"==typeof m&&null!==m){var y=(0,u.ld)(A(e),m,t,{path:[].concat((0,i.Z)(o),["payment_method"])});if("error"===y.type)return y;var v=y.value;return(0,u.x4)({source:null,paymentMethod:null,paymentMethodOptions:h.value,paymentMethodData:v,otherParams:_})}return(0,u.x4)({source:null,paymentMethodData:null,paymentMethodOptions:null,paymentMethod:null,otherParams:_})}},T=function(e,t,n){if(null===e)return(0,u.RH)("object","null",t,n);if("object"!=typeof e)return(0,u.RH)("object",typeof e,t,n);var r=e.type;if("string"!=typeof r)return(0,u.RH)("a string such as 'use_stripe_sdk', 'redirect_to_url'",typeof r,t,(0,u.NQ)(n,"type"));if("use_stripe_sdk"!==r)return(0,u.RH)("a 3DS2 NextAction type such as 'use_stripe_sdk'",r,t,(0,u.NQ)(n,"type"));var o=e.use_stripe_sdk;if("object"!=typeof o)return(0,u.RH)("an object",o,t,(0,u.NQ)(n,"type"));var i=e;return(0,u.x4)(i,[])}},6042:function(e,t,n){"use strict";n.d(t,{G:function(){return i},q:function(){return o}});var r=n(6183),o=function(e,t){var n=e.createLightboxFrame({type:r.NC.LIGHTBOX_APP,options:t});return n.show(),n._on("nested-frame-loaded",(function(){n.fadeInBackdrop(),setTimeout((function(){n.action.openLightboxFrame()}),200)})),n},i=function(e){return e.action.closeLightboxFrame(),e.destroy()}},1119:function(e,t,n){"use strict";n.d(t,{sl:function(){return S},Yn:function(){return C},nD:function(){return E},OJ:function(){return R},sx:function(){return A},ri:function(){return P},At:function(){return M}});var r=n(1413),o=n(5987),i=n(6183),a=n(4200),c=n(9581),s=n(6274).Promise,u=function(e,t){var n=e.id,r=e.filters,o=e.permissions,i=e.prefetch,a=e.return_url,c=e.status,s=e.status_details,u={id:n,accounts:t,status:c};return r&&(u.filters=r),o&&(u.permissions=o),i&&(u.prefetch=i),a&&(u.return_url=a),s&&(u.status_details=s),u},l=n(1708),d=n(1873),p=n(6274).Promise,m=function(e){if(void 0!==e)return!0},f=function(e,t,n){return new p((function(o){var a;try{a=t.createLightboxFrame({type:i.NC.LINKED_ACCOUNTS_INNER,options:e})}catch(e){return o({error:{message:e.message}})}return window.addEventListener("popstate",(function e(){a._emit(l.Oh.COMPLETE,{linkAccountSessionCompleteResponse:{type:"error",error:{type:"input_validation_error",code:"financial_connections_session_cancelled"}},linkedAccounts:[],consumer:null}),a._emit(l.Oh.CLOSE),window.removeEventListener("popstate",e)})),a._on(l.Oh.LOAD,(function(){var e=document.querySelector('iframe[name="'.concat(a.id,'"]'));e&&(null==e||e.focus())})),null==n||n(a),a.show(),a.fadeInBackdrop(),a._on(l.Oh.CLOSE,(function(){a.fadeOutBackdrop();t.action.localizeError({type:"input_validation_error",code:"financial_connections_session_cancelled"}).then((function(e){var t=e.error;o({error:t})}))})),a._on(l.Oh.COMPLETE,(function(e){a.destroy(!0).then((function(){return function(e,t){switch(e.linkAccountSessionCompleteResponse.type){case"object":var n=e.linkedAccounts,o=e.linkAccountSessionCompleteResponse,i=e.consumer,a=o.object,l=a.id,d=a.filters,p=a.permissions,m=a.prefetch,f=a.payment_account,_=a.bank_account_token,h=a.return_url,y={id:l,linkedAccounts:n};return _&&(y.bankAccountToken=_),f&&!_&&(y.paymentAccount=f),d&&(y.filters=d),p&&(y.permissions=p),m&&(y.prefetch=m),h&&(y.returnUrl=h),s.resolve({linkAccountSession:y,consumer:i});case"error":var v,g=e.linkAccountSessionCompleteResponse.error;return g.financial_connections_session&&(v=u(e.linkAccountSessionCompleteResponse.error.financial_connections_session,[])),t.action.localizeError(g).then((function(e){return{error:(0,r.Z)((0,r.Z)({},e.error),{},{financial_connections_session:v})}}));default:return(0,c.Rz)(e.linkAccountSessionCompleteResponse)}}(e,t)})).then((function(e){o(e)}))})),null}))},_=function(e,t,n){return new p((function(o){var a;try{a=t.createLightboxFrame({type:i.NC.LINKED_ACCOUNTS_INNER,options:e})}catch(e){return o({error:{message:e.message}})}return window.addEventListener("popstate",(function e(){a._emit(l.Oh.COMPLETE,{linkAccountSessionCompleteResponse:{type:"error",error:{type:"input_validation_error",code:"financial_connections_session_cancelled"}},linkedAccounts:[],consumer:null}),a._emit(l.Oh.CLOSE),window.removeEventListener("popstate",e)})),a._on(l.Oh.LOAD,(function(){var e=document.querySelector('iframe[name="'.concat(a.id,'"]'));e&&(null==e||e.focus())})),null==n||n(a),a.show(),a.fadeInBackdrop(),a._on(l.Oh.CLOSE,(function(){a.fadeOutBackdrop()})),a._on(l.Oh.COMPLETE,(function(e){a.destroy(!0).then((function(){return function(e,t){switch(e.linkAccountSessionCompleteResponse.type){case"object":var n=e.linkedAccounts,o=e.linkAccountSessionCompleteResponse,i=e.consumer,a=u(o.object,n);return s.resolve({financialConnectionsSession:a,consumer:i});case"error":var l,d=e.linkAccountSessionCompleteResponse.error;return d.financial_connections_session&&(l=u(e.linkAccountSessionCompleteResponse.error.financial_connections_session,[])),t.action.localizeError(d).then((function(e){return{error:(0,r.Z)((0,r.Z)({},e.error),{},{financial_connections_session:l})}}));default:return(0,c.Rz)(e.linkAccountSessionCompleteResponse)}}(e,t)})).then((function(e){o(e)}))})),null}))},h=function(e){var t=e.linkAccountSessionCreatorClientSecret,n=e.linkAccountSessionCreatorType,r=e.linkAccountSessionCreatorId,o=e.controller,i=e.groupId,c=e.sharedSessionContext,s=e.linkAccountSessionCreationParams,u=e.checkoutPriceAmount,l=e.email,d=e.linkMobilePhone,p=e.linkMobilePhoneCountry,_=e.useContinueButtonOnSuccess,h=e.instantDebitsIncentive,y=e.incentiveEligibilitySession,v=e.businessName,g=e.merchantToken,b=e.hasExistingConsumerSession,w=void 0!==b&&b,k=e.onEvent,S=e.onFrameLoad;(0,a.xc)(o.warn);var C=o._stripeAccount,E=o._apiVersion,A=o._apiKey;return k&&o.setFinancialConnectionsOnEventHandler(k),f({clientSecret:t,linkAccountSessionCreatorType:n,linkAccountSessionCreatorId:r,linkAccountSessionCreationParams:s,apiKey:A,sharedSessionContext:c,groupId:i,stripeAccount:C,stripeVersion:E,checkoutPriceAmount:u,email:l,linkMobilePhone:d,linkMobilePhoneCountry:p,useContinueButtonOnSuccess:_,instantDebitsIncentive:h,incentiveEligibilitySession:y,businessName:v,merchantToken:g,hasExistingConsumerSession:w,emitEvents:m(k),stripeJsId:o._stripeJsId},o,S)},y=function(e){var t=e.linkAccountSessionCreatorClientSecret,n=e.linkAccountSessionCreatorType,r=e.linkAccountSessionCreatorId,o=e.controller,i=e.sharedSessionContext,c=e.linkAccountSessionCreationParams,s=e.checkoutPriceAmount,u=e.email,l=e.linkMobilePhone,p=e.linkMobilePhoneCountry,f=e.onEvent,h=e.hasExistingConsumerSession,y=void 0!==h&&h,v=e.onFrameLoad;(0,a.xc)(o.warn),(0,d.kG)(t,"Must provide client secret to launchFinancialConnections");var g=o._stripeAccount,b=o._apiVersion,w=o._apiKey;return f&&o.setFinancialConnectionsOnEventHandler(f),_({clientSecret:t,linkAccountSessionCreatorType:n,linkAccountSessionCreatorId:r,linkAccountSessionCreationParams:c,apiKey:w,sharedSessionContext:i,stripeAccount:g,stripeVersion:b,checkoutPriceAmount:s,email:u,linkMobilePhone:l,linkMobilePhoneCountry:p,useContinueButtonOnSuccess:!1,hasExistingConsumerSession:y,stripeJsId:o._stripeJsId,emitEvents:m(f)},o,v)},v=n(1765),g=["clientSecret","onEvent"],b=function(e){return function(t,n,r){if(null===t)return(0,d.RH)("object","null",n,r);if("object"!=typeof t)return(0,d.RH)("object",typeof t,n,r);var i=t.clientSecret,a=t.onEvent;(0,o.Z)(t,g);if("string"!=typeof i)return(0,d.RH)("string",typeof i,n,["clientSecret"]);var c=a;return void 0===a||(0,v.uN)(e,v.M4.financial_connections_on_event_beta_1)||(c=void 0),(0,d.x4)({clientSecret:i,onEvent:c})}},w=["linkedAccounts"],k=["consumerInfo"],S=function(e,t,n){var i=(0,d.Gu)(b(t),n,"stripe.collectBankAccountToken").value;return h({linkAccountSessionCreatorClientSecret:i.clientSecret,linkAccountSessionCreatorType:"link_account_session",controller:e,checkoutPriceAmount:{amount:null,currency:null},email:null,linkMobilePhone:null,linkMobilePhoneCountry:null,useContinueButtonOnSuccess:!1,onEvent:i.onEvent}).then((function(e){if(e.error)return e;var t=e.linkAccountSession,n=t.linkedAccounts,i=(0,o.Z)(t,w);return{token:e.linkAccountSession.bankAccountToken,linkAccountSession:e.linkAccountSession,financialConnectionsSession:(0,r.Z)((0,r.Z)({},i),{},{accounts:n})}}))},C=function(e,t,n){var r=(0,d.Gu)(b(t),n,"stripe.collectFinancialConnectionsAccounts").value;return y({linkAccountSessionCreatorClientSecret:r.clientSecret,linkAccountSessionCreatorType:"link_account_session",controller:e,checkoutPriceAmount:{amount:null,currency:null},email:null,linkMobilePhone:null,linkMobilePhoneCountry:null,useContinueButtonOnSuccess:!1,onEvent:r.onEvent}).then((function(e){return"error"in e?e:{financialConnectionsSession:e.financialConnectionsSession}}))},E=function(e,t,n){var r=n.consumerInfo,i=(0,o.Z)(n,k),a=(0,d.Gu)(b(t),i,"stripe.collectFinancialConnectionsAccounts").value;return e.action.createSharedSessionContext("frame_to_frame").then((function(t){return y({linkAccountSessionCreatorClientSecret:a.clientSecret,linkAccountSessionCreatorType:"link_account_session",controller:e,checkoutPriceAmount:{amount:null,currency:null},email:null,linkMobilePhone:null,linkMobilePhoneCountry:null,useContinueButtonOnSuccess:!1,onEvent:a.onEvent,sharedSessionContext:t,linkAccountSessionCreationParams:{hosted_surface:l.LJ.LinkApp},hasExistingConsumerSession:!0,onFrameLoad:function(e){e.send({action:"financial-connections-consumer-info",payload:{publishable_key:r.publishableKey,consumer_session:{email_address:r.emailAddress,redacted_formatted_phone_number:r.redactedFormattedPhoneNumber,redacted_phone_number:r.redactedFormattedPhoneNumber,verification_sessions:[],support_payment_details_types:[]},experiments:[],settings:{},redacted_payment_details:[],shipping_addresses:[]}})}}).then((function(e){return"error"in e?e:{financialConnectionsSession:e.financialConnectionsSession}}))}))},A=function(e,t,n,r,o,i,a,c,s,u,d,p,m,f,_,y,v){return h({linkAccountSessionCreatorClientSecret:t,linkAccountSessionCreatorType:n?"link_payment_intent":"link_deferred_intent",linkAccountSessionCreatorId:(0,l.Wg)(n,null==m?void 0:m.elementsSessionId),controller:r,linkAccountSessionCreationParams:{initial_institution:e,hosted_surface:_,link_mode:v},sharedSessionContext:o,groupId:i,checkoutPriceAmount:a,email:c,linkMobilePhone:s,linkMobilePhoneCountry:u,useContinueButtonOnSuccess:!1,instantDebitsIncentive:d,incentiveEligibilitySession:n,businessName:p,hasExistingConsumerSession:f,merchantToken:y})},P=function(e,t,n,r,o){return h({linkAccountSessionCreatorClientSecret:e,linkAccountSessionCreatorType:"payment_intent",linkAccountSessionCreatorId:t,controller:n,linkAccountSessionCreationParams:{payment_method_data:r},checkoutPriceAmount:{amount:null,currency:null},email:null,linkMobilePhone:null,linkMobilePhoneCountry:null,useContinueButtonOnSuccess:!1,onEvent:o})},M=function(e,t,n,r,o){return h({linkAccountSessionCreatorClientSecret:e,linkAccountSessionCreatorType:"setup_intent",linkAccountSessionCreatorId:t,controller:n,linkAccountSessionCreationParams:{payment_method_data:r},checkoutPriceAmount:{amount:null,currency:null},email:null,linkMobilePhone:null,linkMobilePhoneCountry:null,useContinueButtonOnSuccess:!1,onEvent:o})},R=function(e){var t=e.linkAccountSessionCreatorClientSecret,n=e.linkAccountSessionCreatorType,r=e.createdBy,o=e.controller,i=e.attachRequired,a=e.institution,c=e.data,s=e.email,u=e.linkMobilePhone,l=e.linkMobilePhoneCountry,d=e.manualEntryOnly,p=e.searchSession,m=e.instantDebitsIncentive,f=e.incentiveEligibilitySession,_=e.paymentMethodOptions,y=e.amount,v=e.onBehalfOf,g=e.merchantToken,b=e.hostedSurface,w=e.linkMode,k=e.hasExistingConsumerSession,S=e.sharedSessionContext,C=e.groupId,E=e.onFrameLoad,A=e.stripeJsId,P=e.onEvent;return h({linkAccountSessionCreatorClientSecret:t,linkAccountSessionCreatorType:n,linkAccountSessionCreatorId:r,controller:o,onFrameLoad:E,linkAccountSessionCreationParams:{attach_required:i,initial_institution:a,payment_method_data:c,manual_entry_only:d,search_session:p,payment_method_options:_,on_behalf_of:v,hosted_surface:b,link_mode:w},checkoutPriceAmount:y||{amount:null,currency:null},email:null!=s?s:null,linkMobilePhone:null!=u?u:null,linkMobilePhoneCountry:null!=l?l:null,useContinueButtonOnSuccess:!0,instantDebitsIncentive:m,incentiveEligibilitySession:f,merchantToken:g,hasExistingConsumerSession:k,sharedSessionContext:S,groupId:C,stripeJsId:A,onEvent:P})}},7710:function(e,t,n){"use strict";n.d(t,{Z:function(){return kt}});var r,o,i,a=n(4942),c=n(5987),s=n(1413),u=n(3144),l=n(5671),d=n(136),p=n(9388),m=n(1873),f=n(9581),_=n(2024),h=n(3550),y=n(8812),v=n(3333),g=function(){return(v.Wt||v.j3)&&(0,v.gG)()},b=(n(7294),function(e){return e.PaymentSurfaceRendered="payment_surface_rendered",e.LinkRendered="link_rendered",e.LinkServerSideEnablement="link_server_side_enablement",e.LinkLookupSuccessful="link_lookup_successful",e.LinkAccountCreationSuccessful="link_account_creation_success",e.LinkInteraction="link_interaction",e.LinkPaymentMethodSelected="link_payment_method_selected",e.LinkCheckoutConfirmationAttempted="link_checkout_confirmation_attempted",e.NonLinkCheckoutConfirmationAttempted="non_link_checkout_confirmation_attempted",e.LinkCheckoutConfirmationSucceeded="link_checkout_confirmation_succeeded",e.NonLinkCheckoutConfirmationSucceeded="non_link_checkout_confirmation_succeeded",e.LinkCheckoutConfirmationError="link_checkout_confirmation_error",e.NonLinkCheckoutConfirmationError="non_link_checkout_confirmation_error",e.Authentication="authentication",e.AuthenticationError="authentication_error",e.Fatal="fatal",e}({})),w=function(e){return e.Checkout="checkout",e.EmbeddedCheckout="embedded-checkout",e.HostedInvoicePage="hosted-invoice-page",e.CardElement="card-element",e.SplitCardElement="split-card-element",e.LinkAuthenticationElement="link-authentication-element",e.PaymentElement="payment-element",e.PaymentRequestButtonElement="payment-request-button-element",e.ExpressCheckoutElement="express-checkout-element",e.MobileElement="mobile-element",e.GlobalElements="global-elements",e}({}),k=n(942),S=n(8547),C=n(4505),E=n(9062),A=n(5558),P={applePay:"applePay",googlePay:"googlePay",browserCard:"browserCard",link:"link"},M=function(e,t){return e.indexOf(t)>=0},R=function(){return Object.keys(P)},I=n(1743),N=n(1765),T=n(8229),O=(0,m.mC)({amount:m.MZ,label:m.Z_,pending:(0,m.jt)(m.Xg)}),x=(0,m.mC)({amount:m.Bi,label:m.Z_,pending:(0,m.jt)(m.Xg)}),j=(0,m.mC)({isEligible:m.Xg,type:m.kw.apply(void 0,(0,E.Z)(T.mY))}),Z=(0,m.mC)({amount:m.Bi,label:m.Z_,pending:(0,m.jt)(m.Xg),id:(0,m.Wc)(m.Z_,(function(){return(0,A.To)("shippingOption")})),detail:(0,m.Wc)(m.Z_,(function(){return""}))}),L=(0,m.mC)({major:m.Rx,minor:m.Rx}),D=m.kw.apply(void 0,(0,E.Z)(Object.keys(I.Uz))),B=(0,m.mC)({origin:m.Z_,name:m.Z_,accountId:(0,m.jt)(m.Z_),applePayIdentifierAccount:(0,m.jt)(m.Z_)}),q=(0,m.mC)({amount:m.Bi,label:m.Z_,pending:(0,m.jt)(m.Xg),recurringPaymentStartDate:(0,m.jt)(m.Kr),recurringPaymentEndDate:(0,m.jt)(m.Kr),recurringPaymentIntervalCount:(0,m.jt)(m.Rx),recurringPaymentIntervalUnit:(0,m.jt)((0,m.kw)("year","month","day","hour","minute"))}),F=Object.freeze({paymentDescription:m.Z_,managementURL:m.Z_,automaticReloadBilling:(0,m.mC)({amount:m.MZ,label:m.Z_,automaticReloadPaymentThresholdAmount:m.MZ})}),U=(0,m.ci)(F),G=(0,m.mC)({paymentDescription:m.Z_,managementURL:m.Z_,deferredBilling:(0,m.mC)({amount:m.MZ,label:m.Z_,deferredPaymentDate:m.Kr}),freeCancellationDate:(0,m.jt)(m.Kr),freeCancellationDateTimeZone:(0,m.jt)(m.Z_),billingAgreement:(0,m.jt)(m.Z_)}),z=Object.freeze({paymentDescription:m.Z_,managementURL:m.Z_,regularBilling:q,trialBilling:(0,m.jt)(q),billingAgreement:(0,m.jt)(m.Z_)}),V=(0,m.ci)(z),K=Object.keys(I.yv),H=(0,m.jt)(m.kw.apply(void 0,K)),Y=(0,m.mC)({automaticReloadPaymentRequest:(0,m.jt)(U),deferredPaymentRequest:(0,m.jt)(G),recurringPaymentRequest:(0,m.jt)(V)}),W=(0,m.mC)({automaticReloadPaymentRequest:(0,m.jt)((0,m.AG)((0,m.mC)((0,s.Z)((0,s.Z)({},F),{},{billingAgreement:(0,m.jt)(m.Z_)})))),deferredPaymentRequest:(0,m.jt)((0,m.AG)(G)),recurringPaymentRequest:(0,m.jt)((0,m.AG)((0,m.mC)((0,s.Z)((0,s.Z)({},z),{},{billingAgreement:(0,m.jt)(m.Z_)})))),applePayLaterAvailability:H}),X=(0,m.ci)({__merchantDetails:(0,m.jt)(B),__supportsCouponCode:(0,m.jt)(m.Xg),__couponCode:(0,m.jt)(m.Z_),__billingDetailsEmailOverride:(0,m.jt)(m.Z_),applePay:(0,m.jt)(W),country:(0,m.jt)(m.hN),currency:(0,m.jt)(m.cV),displayItems:(0,m.jt)((0,m.CT)(x)),shippingOptions:(0,m.jt)((0,m.uw)("id")((0,m.CT)(Z))),total:(0,m.jt)(O),blockedCardBrands:(0,m.jt)((0,m.CT)(m.kw.apply(void 0,(0,E.Z)(k.iw)))),capabilityEnabledCardNetworks:(0,m.jt)((0,m.CT)(m.kw.apply(void 0,(0,E.Z)(k.P4)))),isConnectPlatform:(0,m.jt)(m.Xg)}),Q=Object.keys(I.kB),J=(0,m.mC)({displayItems:(0,m.jt)((0,m.CT)(x)),shippingOptions:(0,m.jt)((0,m.uw)("id")((0,m.CT)(Z))),total:(0,m.jt)(O),status:function(e,t,n){if(-1!==Q.indexOf(e))return m.kw.apply(void 0,Q)(e,t,n);var r=Object.keys(I.aH).filter((function(e){return-1===Q.indexOf(e)}));return m.kw.apply(void 0,(0,E.Z)(r))(-1!==["invalid_payer_name","invalid_payer_email","invalid_payer_phone"].indexOf(e)?"fail":e,t,n)},errorMessage:(0,m.jt)(m.Z_),applePay:(0,m.jt)(Y)}),$=function(e,t,n){if(-1!==Q.indexOf(e))return m.kw.apply(void 0,Q)(e,t,n);var r=Object.keys(I.qp).filter((function(e){return-1===Q.indexOf(e)}));return m.kw.apply(void 0,(0,E.Z)(r))(e,t,n)},ee=function(e){var t=[];return window.ApplePaySession?(M(e,P.applePay)&&t.push("APPLE_PAY"),M(e,P.link)&&t.push("LINK"),t):(M(e,P.link)&&t.push("LINK"),M(e,P.googlePay)&&(t.push("GOOGLE_PAY"),v.sV&&t.push("BROWSER")),M(e,P.browserCard)&&-1===t.indexOf("BROWSER")&&t.push("BROWSER"),t)},te=n(3324),ne=n(2920),re=n(7934),oe=n(6241),ie=function(e,t){return{amount:(0,oe.Fe)(e.amount,t.currency,"apple"),label:e.label,type:e.pending?"pending":"final"}},ae=function(e,t){return(0,s.Z)((0,s.Z)({},ie(e,t)),{},{automaticReloadPaymentThresholdAmount:(0,oe.Fe)(e.automaticReloadPaymentThresholdAmount,t.currency,"apple"),paymentTiming:"automaticReload"})},ce=function(e,t){return(0,s.Z)((0,s.Z)({},ie(e,t)),{},{deferredPaymentDate:e.deferredPaymentDate,paymentTiming:"deferred"})},se=function(e,t){return(0,s.Z)((0,s.Z)({},ie(e,t)),{},{recurringPaymentStartDate:e.recurringPaymentStartDate,recurringPaymentEndDate:e.recurringPaymentEndDate,recurringPaymentIntervalUnit:e.recurringPaymentIntervalUnit,recurringPaymentIntervalCount:e.recurringPaymentIntervalCount,paymentTiming:"recurring"})},ue=function(e,t,n){return new window.ApplePayError(e,t,n)},le=function(e){return function(t){return t[e]&&"string"==typeof t[e]?t[e].toUpperCase():null}},de=(r={},(0,a.Z)(r,I.qp.success,0),(0,a.Z)(r,I.qp.fail,1),(0,a.Z)(r,I.qp.invalid_payer_name,2),(0,a.Z)(r,I.qp.invalid_shipping_address,3),(0,a.Z)(r,I.qp.invalid_payer_phone,4),(0,a.Z)(r,I.qp.invalid_payer_email,4),(0,a.Z)(r,I.qp.invalid_coupon_code,1),(0,a.Z)(r,I.qp.expired_coupon_code,1),(0,a.Z)(r,I.qp.invalid_payer_zip,2),r),pe=(o={},(0,a.Z)(o,I.qp.success,(function(){return null})),(0,a.Z)(o,I.qp.fail,(function(){return null})),(0,a.Z)(o,I.qp.invalid_payer_name,(function(){return ue("billingContactInvalid","name")})),(0,a.Z)(o,I.qp.invalid_shipping_address,(function(){return ue("shippingContactInvalid","postalAddress")})),(0,a.Z)(o,I.qp.invalid_payer_phone,(function(){return ue("shippingContactInvalid","phoneNumber")})),(0,a.Z)(o,I.qp.invalid_payer_email,(function(e){return ue("shippingContactInvalid","emailAddress",e)})),(0,a.Z)(o,I.qp.invalid_payer_zip,(function(e){return ue("billingContactInvalid","postalCode",e)})),(0,a.Z)(o,I.qp.invalid_coupon_code,(function(e){return ue((0,ne.VC)(12)?"couponCodeInvalid":"unknown",void 0,e)})),(0,a.Z)(o,I.qp.expired_coupon_code,(function(e){return ue((0,ne.VC)(12)?"couponCodeInvalid":"unknown",void 0,e)})),o),me=(i={},(0,a.Z)(i,I.Uz.pickup,"storePickup"),(0,a.Z)(i,I.Uz.shipping,"shipping"),(0,a.Z)(i,I.Uz.delivery,"delivery"),i),fe={total:function(e){return ie(e.total,e)},lineItems:function(e){return e.displayItems?e.displayItems.map((function(t){return ie(t,e)})):[]},shippingMethods:function(e){return e.shippingOptions?e.shippingOptions.map((function(t){return function(e,t){return{amount:(0,oe.Fe)(e.amount,t.currency,"apple"),label:e.label,detail:e.detail,identifier:e.id}}(t,e)})):[]},applicationData:function(e){return e.applicationData||null},supportsCouponCode:function(e){return e.__supportsCouponCode||!1},couponCode:function(e){return e.__supportsCouponCode?e.__couponCode:""},applePayLaterAvailability:function(e){var t,n;return"auto"===(null===(t=e.applePay)||void 0===t?void 0:t.applePayLaterAvailability)?"available":null===(n=e.applePay)||void 0===n?void 0:n.applePayLaterAvailability},automaticReloadPaymentRequest:function(e){var t,n;return null!==(t=e.applePay)&&void 0!==t&&t.automaticReloadPaymentRequest?function(e,t){return(0,s.Z)((0,s.Z)({},e),{},{tokenNotificationURL:t.tokenNotificationURL,automaticReloadBilling:ae(e.automaticReloadBilling,t)})}(null===(n=e.applePay)||void 0===n?void 0:n.automaticReloadPaymentRequest,e):null},deferredPaymentRequest:function(e){var t,n;return null!==(t=e.applePay)&&void 0!==t&&t.deferredPaymentRequest?function(e,t){return(0,s.Z)((0,s.Z)({},e),{},{tokenNotificationURL:t.tokenNotificationURL,deferredBilling:ce(e.deferredBilling,t),freeCancellationDate:e.freeCancellationDate})}(null===(n=e.applePay)||void 0===n?void 0:n.deferredPaymentRequest,e):null},recurringPaymentRequest:function(e){var t,n;return null!==(t=e.applePay)&&void 0!==t&&t.recurringPaymentRequest?function(e,t){return(0,s.Z)((0,s.Z)({},e),{},{tokenNotificationURL:t.tokenNotificationURL,regularBilling:se(e.regularBilling,t),trialBilling:e.trialBilling?se(e.trialBilling,t):void 0})}(null===(n=e.applePay)||void 0===n?void 0:n.recurringPaymentRequest,e):null}},_e={shippingType:function(e){var t=e.shippingType;if(!t)return null;var n=me[t];if(void 0!==n)return n;throw new y.No("Invalid value for shippingType: ".concat(t))},requiredBillingContactFields:function(e){return e.requestPayerName?["postalAddress"]:null},requiredShippingContactFields:function(e){var t=[];return e.requestShipping&&t.push("postalAddress"),e.requestPayerEmail&&t.push("email"),e.requestPayerPhone&&t.push("phone"),t.length?t:null},countryCode:le("country"),currencyCode:le("currency"),merchantCapabilities:function(e){var t=e.merchantCapabilities||I.WN.merchantCapabilities;return e.__betas&&((0,N.uN)(e.__betas,"cup_apple_pay_beta_1")||(0,N.uN)(e.__betas,"interac_apple_pay_beta_1")&&"cad"===e.currency)&&t.push("supportsEMV"),t},supportedNetworks:function(e){var t=(0,re.RO)(e.country,e.jcbEnabled||!1,e.blockedCardBrands||[],e.capabilityEnabledCardNetworks||[],e.currency,e.cartesBancairesEnabledForApplePay);return(0,ne.VC)(4)&&-1===(e.blockedCardBrands||[]).indexOf("mastercard")&&t.push("maestro"),e.__betas&&(0,N.uN)(e.__betas,"cup_apple_pay_beta_1")&&-1===(e.blockedCardBrands||[]).indexOf("unionpay")&&t.push("chinaUnionPay"),e.__betas&&(0,N.uN)(e.__betas,"interac_apple_pay_beta_1")&&"cad"===e.currency&&t.unshift("interac"),(0,ne.VC)(4)&&e.__betas&&(0,N.uN)(e.__betas,"cartes_bancaires_apple_pay_beta_1")&&"eur"===e.currency&&-1===t.indexOf("cartesBancaires")&&t.unshift("cartesBancaires"),t}},he={status:function(e){var t=de[e.status];return(0,ne.VC)(3)&&t>1?1:t},error:function(e){return(0,ne.VC)(3)?pe[e.status](e.errorMessage):null}},ye=(0,s.Z)((0,s.Z)({},fe),_e),ve=(0,s.Z)((0,s.Z)({},fe),he),ge=function(e){return Object.keys(ve).reduce((function(t,n){var r=(0,ve[n])(e);return null!==r?(0,s.Z)((0,s.Z)({},t),{},(0,a.Z)({},n,r)):t}),{})},be=function(e){return"string"==typeof e?e:null},we=function(e){return e?be(e.phoneNumber):null},ke=function(e){return e?be(e.emailAddress):null},Se=function(e){return e?[e.givenName,e.familyName].filter((function(e){return e&&"string"==typeof e})).join(" "):null},Ce=function(e){var t=e.addressLines,n=e.countryCode,r=e.postalCode,o=e.administrativeArea,i=e.locality,a=e.phoneNumber,c=be(n);return{addressLine:Array.isArray(t)?t.reduce((function(e,t){return"string"==typeof t?[].concat((0,E.Z)(e),[t]):e}),[]):[],country:c?c.toUpperCase():"",postalCode:be(r)||"",recipient:Se(e)||"",region:be(o)||"",city:be(i)||"",phone:be(a)||"",sortingCode:"",dependentLocality:"",organization:""}},Ee=function(e,t){var n=e.identifier,r=e.label;return t.filter((function(e){return e.id===n&&e.label===r}))[0]},Ae=function(e,t){var n=e.shippingContact,r=e.shippingMethod,o=e.billingContact;return{shippingOption:r&&t.shippingOptions&&t.shippingOptions.length?Ee(r,t.shippingOptions):null,shippingAddress:n?Ce(n):null,payerEmail:ke(n),payerPhone:we(n),payerName:Se(o),walletName:"applePay",methodName:"apple-pay"}},Pe=n(9620),Me=n(7703),Re=n(3234),Ie=n(6274).Promise,Ne=function(e,t){return e&&"object"==typeof e?t(e):null},Te=function(e,t){var n,r,o;null!=e&&e.applePay&&(null===(null===(n=t.applePay)||void 0===n?void 0:n.recurringPaymentRequest)&&(e.applePay.recurringPaymentRequest=void 0,t.applePay.recurringPaymentRequest=void 0),null===(null===(r=t.applePay)||void 0===r?void 0:r.deferredPaymentRequest)&&(e.applePay.deferredPaymentRequest=void 0,t.applePay.deferredPaymentRequest=void 0),null===(null===(o=t.applePay)||void 0===o?void 0:o.automaticReloadPaymentRequest)&&(e.applePay.automaticReloadPaymentRequest=void 0,t.applePay.automaticReloadPaymentRequest=void 0));return(0,_.PM)(e,t)},Oe=function(e){var t,n,r;return 0===e.total.amount&&0===(null===(t=e.applePay)||void 0===t||null===(n=t.recurringPaymentRequest)||void 0===n||null===(r=n.trialBilling)||void 0===r?void 0:r.amount)?(0,s.Z)((0,s.Z)({},e),{},{total:(0,s.Z)((0,s.Z)({},e.total),{},{pending:!1})}):e},xe=function(){function e(t){var n=this;(0,l.Z)(this,e),this._wasCompleted=!1,this._onEvent=function(){},this._paymentRequestTypeUsed=null,this._billingAgreements={default:""},this.setEventHandler=function(e){n._onEvent=e},this.canMakePayment=function(){var e,t,r,o,i=n._controller.action.retrieveWalletConfigAvailability({wallet:"apple_pay",isCheckout:!!n._initialPaymentRequest.__isCheckout,isHostedInvoicePage:!!n._initialPaymentRequest.__isHostedInvoicePage,isPaymentElement:!!n._initialPaymentRequest.__isPaymentElement,onBehalfOf:n._initialPaymentRequest.onBehalfOf,amount:n._initialPaymentRequest.total.amount,currency:n._initialPaymentRequest.currency}),a=n._controller.action.retrieveWalletConfigAvailability({wallet:"apple_pay_later",isCheckout:!!n._initialPaymentRequest.__isCheckout,isHostedInvoicePage:!!n._initialPaymentRequest.__isHostedInvoicePage,isPaymentElement:!!n._initialPaymentRequest.__isPaymentElement,onBehalfOf:n._initialPaymentRequest.onBehalfOf,amount:n._initialPaymentRequest.total.amount,currency:n._initialPaymentRequest.currency}),c=Boolean(n._authentication.accountId||(null===(e=n._initialPaymentRequest.__merchantDetails)||void 0===e?void 0:e.applePayIdentifierAccount)),s=(0,ne.Qt)(window.location.hostname,n._authentication.accountId||(null===(t=n._initialPaymentRequest.__merchantDetails)||void 0===t?void 0:t.applePayIdentifierAccount)||null,(0,Pe.lO)(n._authentication.apiKey)===Pe.Kl.test,n._report,n._minimumVersion,!v.QH&&!v.ub||!c);(0,Me.Mt)()&&(r=null!==(o=n._initialPaymentRequest.__merchantDetails)&&void 0!==o&&o.name?n._controller.action.unsafeLocalizeString({message:"upe.mandates.card",data:{businessName:n._initialPaymentRequest.__merchantDetails.name}}):n._controller.action.unsafeLocalizeString({message:"upe.mandates.cardNoBusinessName",data:null}));var u=n._getWalletConfig();return Ie.all([i,s,a,r,u]).then((function(e){var t,r=(0,te.Z)(e,5),o=r[0],i=r[1],a=r[2],c=r[3],s=r[4];n._billingAgreements.default=null!=c?c:"";var u={};a.availability||(u.applePayLaterAvailability=I.yv.unavailableItemIneligible);var l=n._paymentRequestOptions.tokenNotificationURL;return n._initialPaymentRequest=Oe((0,_.PM)(n._paymentRequestOptions,{tokenNotificationURL:l||o.tokenNotificationURL,applePay:u,capabilityEnabledCardNetworks:null==s?void 0:s.capability_enabled_card_networks,cartesBancairesEnabledForApplePay:!(null!=s&&s.is_connect_platform)||(null===(t=s.flags)||void 0===t?void 0:t.wallet_config_enable_cb_apple_pay_for_connect_platforms)})),n._initializeSessionState(),{available:o.availability&&i}}))},this.update=function(e){n._initialPaymentRequest=Oe(Te(n._paymentRequestOptions,e)),n._initializeSessionState()},this.show=function(){var e,t,r;n._wasCompleted&&n._report("pr.show_called_after_completion"),n._initializeSessionState(),n._setAndLoadBillingAgreements({isUpdate:!1});try{e=new window.ApplePaySession(n._minimumVersion,(t=n._paymentRequestOptions,r=(0,s.Z)((0,s.Z)({},I.WN),t),Object.keys(ye).reduce((function(e,t){var n=(0,ye[t])(r);return null!==n?(0,s.Z)((0,s.Z)({},e),{},(0,a.Z)({},t,n)):e}),{})))}catch(e){throw"Must create a new ApplePaySession from a user gesture handler."===e.message?new y.No("The code that shows the Apple Pay payment sheet must be invoked directly by a user activation event, like a click or a touch gesture. To prevent this error make sure the code that shows the payment sheet is at or near the top of your user gesture event handler, before any async or long-running code."):e}n._privateSession=e,n._setupSession(e,n._usesButtonElement()),e.begin(),n._isShowing=!0},this.abort=function(){n._privateSession&&n._privateSession.abort()},this._warn=function(){},this._report=function(e,t){n._controller.report(e,(0,s.Z)((0,s.Z)({},t),{},{backingLibrary:"APPLE_PAY",usesButtonElement:n._usesButtonElement()}))},this._setAndLoadBillingAgreements=function(e){var t=e.isUpdate;if(void 0!==n._paymentRequestOptions.applePay){var r=n._paymentRequestOptions.applePay;n._fillDefaultBillingAgreement(r),t?n._loadCurrentBillingAgreement(r):(n._savePaymentRequestTypeUsed(r),n._saveCurrentBillingAgreement(r))}},this._validateMerchant=function(e,t){return function(r){n._controller.action.createApplePaySession({data:{validation_url:r.validationURL,domain_name:(0,Re.A)(n._report),display_name:n._paymentRequestOptions.total.label},usesButtonElement:t,paymentRequestType:n._paymentRequestTypeUsed}).then((function(t){if(n._isShowing)switch(t.type){case"object":e.completeMerchantValidation(JSON.parse(t.object.session));break;case"error":n._handleValidationError(e)(t.error);break;default:(0,f.Rz)(t)}}),n._handleValidationError(e))}},this._handleValidationError=function(e){return function(t){n._report("error.pr.apple_pay.session_creation_failed",{error:t}),e.abort(),n._onEvent({type:"__private_do_not_use_error",payload:{error:{code:"apple_pay.session_creation_failed"}}});var r=t.message;"string"==typeof r&&n._controller.warn(r)}},this._paymentAuthorized=function(e){return function(t){var r=t.payment,o=n._usesButtonElement()?k.Yj.paymentRequestButton:null;n._controller.action.tokenizeWithData({type:"apple_pay",elementName:o,tokenData:(0,s.Z)((0,s.Z)({},r),{},{billingContact:Ne(r.billingContact,n._normalizeContact)}),mids:n._controller.mids()}).then((function(t){if("error"===t.type)(0,ne.VC)(14)?e.abort():e.completePayment(window.ApplePaySession.STATUS_FAILURE),n._report("error.pr.create_token_failed",{error:t.error}),n._onEvent({type:"__private_do_not_use_error",payload:{error:t.error}});else{var o=Ne(r.shippingContact,n._normalizeContact),i=Ne(r.billingContact,n._normalizeContact);o&&n._paymentRequestOptions.requestShipping&&!o.countryCode&&e.completePayment(window.ApplePaySession.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS);var a=Ae({shippingContact:o,billingContact:i},n._paymentRequestOptions);n._onToken(e)((0,s.Z)((0,s.Z)({},a),{},{shippingOption:n._privateShippingOption,token:t.object}))}}))}},this._normalizeContact=function(e){return(0,Me.Fq)(e,(function(){n._report("warn.pr.apple_pay.missing_country_code",{country:e.country})}))},this._onToken=function(e){return function(t){n._onEvent({type:"paymentresponse",payload:(0,s.Z)((0,s.Z)({},t),{},{complete:(0,C.TC)(n._completePayment(e))})})}},this._completePayment=function(e){return function(t,r){"success"===t&&(n._wasCompleted=!0),n._paymentRequestOptions=(0,_.PM)(n._paymentRequestOptions,{status:t,errorMessage:r});var o=ge(n._paymentRequestOptions),i=o.status,a=o.error;n._isShowing&&(a?e.completePayment({status:i,errors:[a]}):i!==window.ApplePaySession.STATUS_FAILURE?e.completePayment(i):(0,ne.VC)(14)?e.abort():e.completePayment(i)),(0===i||1===i&&null==a)&&(n._isShowing=!1,n._onEvent&&n._onEvent({type:"close"}))}},this._paymentMethodSelected=function(e){return function(t){n._onEvent({type:"__private_do_not_use_billingaddresschange",payload:{billingAddress:t.paymentMethod.billingContact?Ce(n._normalizeContact(t.paymentMethod.billingContact)):{addressLine:[],country:"",postalCode:"",recipient:"",region:"",city:"",phone:"",sortingCode:"",dependentLocality:"",organization:""},updateWith:(0,C.TC)(n._completePaymentMethodSelection(e))}})}},this._shippingContactSelected=function(e){return function(t){n._onEvent({type:"shippingaddresschange",payload:{shippingAddress:Ce(n._normalizeContact(t.shippingContact)),updateWith:(0,C.TC)(n._completeShippingContactSelection(e))}})}},this._completePaymentMethodSelection=function(e){return function(t){n._paymentRequestOptions=(0,_.PM)(n._paymentRequestOptions,t);var r=ge(n._paymentRequestOptions),o=r.total,i={newLineItems:r.lineItems,newTotal:o,newRecurringPaymentRequest:r.recurringPaymentRequest};e.completePaymentMethodSelection(i)}},this._completeShippingContactSelection=function(e){return function(t){var r,o=t.applePay;o&&n._validatePaymentRequestCreated(o),n._paymentRequestOptions=Te(n._paymentRequestOptions,t),null!==(r=n._paymentRequestOptions.shippingOptions)&&void 0!==r&&r.length&&(n._privateShippingOption=n._paymentRequestOptions.shippingOptions[0]),n._setAndLoadBillingAgreements({isUpdate:!0});var i=ge(n._paymentRequestOptions),a=i.status,c=i.shippingMethods,s=i.total,u=i.lineItems,l=i.error,d=i.recurringPaymentRequest,p=i.deferredPaymentRequest,m=i.automaticReloadPaymentRequest;if(l)e.completeShippingContactSelection({newTotal:s,newLineItems:u,newShippingMethods:c,newRecurringPaymentRequest:d,errors:[l]});else if((0,ne.VC)(14)&&1===a){var f=ue("shippingContactInvalid","postalAddress");e.completeShippingContactSelection({newTotal:s,newLineItems:u,newShippingMethods:c,newRecurringPaymentRequest:d,errors:[f]})}else(0,ne.VC)(14)&&d?e.completeShippingContactSelection({newTotal:s,newLineItems:u,newShippingMethods:c,newRecurringPaymentRequest:d}):(0,ne.VC)(15)&&p?e.completeShippingContactSelection({newTotal:s,newLineItems:u,newShippingMethods:c,newDeferredPaymentRequest:p}):(0,ne.VC)(14)&&m?e.completeShippingContactSelection({newTotal:s,newLineItems:u,newShippingMethods:c,newAutomaticReloadPaymentRequest:m}):e.completeShippingContactSelection(a,c,s,u)}},this._shippingMethodSelected=function(e){return function(t){if(n._paymentRequestOptions.shippingOptions){var r=Ee(t.shippingMethod,n._paymentRequestOptions.shippingOptions);n._privateShippingOption=r,n._onEvent({type:"shippingoptionchange",payload:{shippingOption:r,updateWith:(0,C.TC)(n._completeShippingMethodSelection(e))}})}}},this._completeShippingMethodSelection=function(e){return function(t){var r=t.applePay;r&&n._validatePaymentRequestCreated(r),n._paymentRequestOptions=Te(n._paymentRequestOptions,t),n._setAndLoadBillingAgreements({isUpdate:!0});var o=ge(n._paymentRequestOptions),i=o.status,a=o.total,c=o.lineItems,s=o.recurringPaymentRequest,u=o.deferredPaymentRequest,l=o.automaticReloadPaymentRequest;(0,ne.VC)(14)&&s?e.completeShippingMethodSelection({newTotal:a,newLineItems:c,newRecurringPaymentRequest:s}):(0,ne.VC)(15)&&u?e.completeShippingMethodSelection({newTotal:a,newLineItems:c,newDeferredPaymentRequest:u}):(0,ne.VC)(14)&&l?e.completeShippingMethodSelection({newTotal:a,newLineItems:c,newAutomaticReloadPaymentRequest:l}):e.completeShippingMethodSelection(i,a,c)}},this._couponCodeChanged=function(e){return function(t){var r=t.couponCode;n._onEvent({type:"__private_do_not_use_couponcodechange",payload:{couponCode:r,updateWith:(0,C.TC)(n._completeCouponCodeChange(e))}})}},this._completeCouponCodeChange=function(e){return function(t){n._paymentRequestOptions=(0,_.PM)(n._paymentRequestOptions,t);var r=ge(n._paymentRequestOptions),o=r.total,i=r.lineItems,a=r.error,c=r.recurringPaymentRequest;e.completeCouponCodeChange({newTotal:o,newLineItems:i,newRecurringPaymentRequest:c,errors:a?[a]:void 0})}},this._savePaymentRequestTypeUsed=function(e){e.automaticReloadPaymentRequest?n._paymentRequestTypeUsed="automaticReload":e.deferredPaymentRequest?n._paymentRequestTypeUsed="deferred":e.recurringPaymentRequest?n._paymentRequestTypeUsed="recurring":n._paymentRequestTypeUsed=null},this._saveCurrentBillingAgreement=function(e){var t,r;n._billingAgreements.automaticReload=null===(t=e.automaticReloadPaymentRequest)||void 0===t?void 0:t.billingAgreement,n._billingAgreements.recurring=null===(r=e.recurringPaymentRequest)||void 0===r?void 0:r.billingAgreement},this._loadCurrentBillingAgreement=function(e){var t=e.recurringPaymentRequest;t&&n._billingAgreements.recurring&&(t.billingAgreement=n._billingAgreements.recurring);var r=e.automaticReloadPaymentRequest;r&&n._billingAgreements.automaticReload&&(r.billingAgreement=n._billingAgreements.automaticReload)},this._getWalletConfig=function(){return n._controller.action.retrieveWalletConfig({onBehalfOf:n._initialPaymentRequest.onBehalfOf,amount:n._initialPaymentRequest.total.amount,currency:n._initialPaymentRequest.currency}).then((function(e){return"error"!==e.type?e.object:void 0}))};var r=t.controller,o=t.authentication,i=(t.mids,t.options),c=t.usesButtonElement,u=t.listenerRegistry;this._controller=r,this._authentication=o,this._minimumVersion=i.__minApplePayVersion||ne.lU,this._usesButtonElement=c,this._listenerRegistry=u,this._initialPaymentRequest=Oe(i),this._isShowing=!1,this._initializeSessionState(),this._controller._controllerFrame._on("stripe-user-credentials-update",(function(e){n._authentication={apiKey:e.publishableKey,accountId:e.stripeAccount},n._initializeSessionState()}))}return(0,u.Z)(e,[{key:"_initializeSessionState",value:function(){var e=btoa(this._authentication.accountId?"".concat(this._authentication.apiKey,":").concat(this._authentication.accountId):this._authentication.apiKey);this._paymentRequestOptions=(0,s.Z)((0,s.Z)((0,s.Z)({},I.WN),this._initialPaymentRequest),{},{status:I.qp.success,applicationData:e}),this._privateSession=null,this._privateShippingOption=null;var t=this._paymentRequestOptions.shippingOptions;null!=t&&t.length&&(this._privateShippingOption=t[0])}},{key:"_setupSession",value:function(e,t){var n=this;this._listenerRegistry.addEventListener(e,"validatemerchant",(0,C.TC)(this._validateMerchant(e,t))),this._listenerRegistry.addEventListener(e,"paymentauthorized",(0,C.TC)(this._paymentAuthorized(e))),this._listenerRegistry.addEventListener(e,"cancel",(0,C.TC)((function(){n._report("pr.apple_pay.cancel",{paymentRequestType:n._paymentRequestTypeUsed}),n._isShowing=!1,n._onEvent({type:"cancel"}),n._onEvent({type:"close"})}))),this._listenerRegistry.addEventListener(e,"paymentmethodselected",(0,C.TC)(this._paymentMethodSelected(e))),this._listenerRegistry.addEventListener(e,"shippingcontactselected",(0,C.TC)(this._shippingContactSelected(e))),this._listenerRegistry.addEventListener(e,"shippingmethodselected",(0,C.TC)(this._shippingMethodSelected(e))),this._listenerRegistry.addEventListener(e,"couponcodechanged",(0,C.TC)(this._couponCodeChanged(e)))}},{key:"_validatePaymentRequestCreated",value:function(e){if("recurring"!==this._paymentRequestTypeUsed&&null!=e&&e.recurringPaymentRequest)throw new y.No("You tried to change an applePay.recurringPaymentRequest without creating the object first. You must provide an applePay.recurringPaymentRequest object on `stripe.paymentRequest` in order to change it later.");if("automaticReload"!==this._paymentRequestTypeUsed&&null!=e&&e.automaticReloadPaymentRequest)throw new y.No("You tried to change an applePay.automaticReloadPaymentRequest without creating the object first. You must provide an applePay.automaticReloadPaymentRequest object on `stripe.paymentRequest` in order to change it later.");if("deferred"!==this._paymentRequestTypeUsed&&null!=e&&e.deferredPaymentRequest)throw new y.No("You tried to change an applePay.deferredPaymentRequest without creating the object first. You must provide an applePay.deferredPaymentRequest object on `stripe.paymentRequest` in order to change it later.")}},{key:"_fillDefaultBillingAgreement",value:function(e){if(this._billingAgreements.default&&(0,Me.Mt)()){var t,n=e.automaticReloadPaymentRequest;if(n)null!==(t=n.billingAgreement)&&void 0!==t||(n.billingAgreement=this._billingAgreements.default);var r,o=e.recurringPaymentRequest;if(o)null!==(r=o.billingAgreement)&&void 0!==r||(o.billingAgreement=this._billingAgreements.default)}}}]),e}(),je=xe,Ze=n(6183),Le=n(8731),De=n(6274).Promise,Be=null;var qe=function(e){return"https:"===window.location.protocol&&(!(!v.Wt&&!v.j3)&&(!v.Bh&&(!(!e.isCheckout&&!window.PaymentRequest)&&!(!e.isCheckout&&v.sV))))},Fe=n(6274).Promise,Ue=(0,u.Z)((function e(t){var n=this;(0,l.Z)(this,e),this._mids=null,this._frame=null,this._initFrame=function(e){var t=n._controller.createHiddenFrame(Ze.NC.PAYMENT_REQUEST_GOOGLE_PAY,{authentication:n._authentication,mids:n._controller.mids(),origin:n._origin});t.send({action:"stripe-pr-initialize",payload:{data:e}}),n._initFrameEventHandlers(t),n._frame=t},this._initFrameEventHandlers=function(e){e._on("pr-cancel",(function(){n._onEvent({type:"cancel"})})),e._on("pr-close",(function(){n._backdrop.fadeOut().then((function(){n._backdrop.unmount()})),n._onEvent({type:"close"})})),e._on("pr-error",(function(e){n._onEvent({type:"error",payload:{errorMessage:e.errorMessage,errorCode:e.errorCode}})})),e._on("pr-exception",(function(e){n._onEvent({type:"__private_do_not_use_error",payload:e})})),e._on("pr-callback",(function(t){var r=t.event,o=t.options,i=t.nonce;switch(r){case"paymentresponse":n._handlePaymentResponse(e,o,i);break;case"shippingaddresschange":n._handleShippingAddressChange(e,o,i);break;case"shippingoptionchange":n._handleShippingOptionChange(e,o,i);break;default:throw new Error("Unexpected event name: ".concat(r))}}))},this._handlePaymentResponse=function(e,t,r){n._onEvent({type:"paymentresponse",payload:(0,s.Z)((0,s.Z)({},t),{},{complete:function(t){e.send({action:"stripe-pr-callback-complete",payload:{nonce:r,data:{status:t}}})}})})},this._handleShippingAddressChange=function(e,t,r){n._onEvent({type:"shippingaddresschange",payload:(0,s.Z)((0,s.Z)({},t),{},{updateWith:function(t){e.send({action:"stripe-pr-callback-complete",payload:{nonce:r,data:t}})}})})},this._handleShippingOptionChange=function(e,t,r){n._onEvent({type:"shippingoptionchange",payload:(0,s.Z)((0,s.Z)({},t),{},{updateWith:function(t){e.send({action:"stripe-pr-callback-complete",payload:{nonce:r,data:t}})}})})},this._destroy=function(){n._frame&&(n._frame.destroy(),n._frame=null)},this.setEventHandler=function(e){n._onEvent=e},this.canMakePayment=function(){if(!qe({isCheckout:n._isCheckout}))return Fe.resolve({available:!1});if(!n._frame)throw new Error("Frame not initialized.");var e,t=n._frame;return(e=function(){return t.action.checkCanMakePayment(void 0).then((function(e){return!0===e.available}))},null!==Be?De.resolve(Be):e().then((function(e){return Be=e}))).then((function(e){return{available:e}}))},this.show=function(){n._frame&&(n._frame.send({delegate:"payment",action:"stripe-pr-show",payload:{data:{usesButtonElement:n._usesButtonElement(),stripeJsId:n._controller._stripeJsId,mids:n._controller.mids()}}}),n._backdrop.mount(),n._backdrop.show(),n._backdrop.fadeIn())},this.update=function(e){n._frame&&n._frame.send({action:"stripe-pr-update",payload:{data:e}})},this.abort=function(){n._frame&&n._frame.send({action:"stripe-pr-abort",payload:{}})},this._controller=t.controller,this._authentication=t.authentication,this._origin=t.origin,this._usesButtonElement=t.usesButtonElement,this._backdrop=new Le.Z({lockScrolling:!1,lockFocus:!0,lockFocusOn:null,listenerRegistry:t.listenerRegistry}),this._isCheckout=!!t.options.__isCheckout,qe({isCheckout:this._isCheckout})&&this._controller&&(this._controller.action.fetchLocale({locale:"auto"}),this._initFrame(t.options)),this._controller._controllerFrame._on("stripe-user-credentials-update",(function(e){n._authentication={apiKey:e.publishableKey,accountId:e.stripeAccount},n._frame&&n._frame.send({action:"stripe-pr-update",payload:{data:{__stripeUserCredentials:(0,s.Z)({},n._authentication)}}})}))})),Ge=n(6274).Promise,ze=function(){if(!window.PaymentRequest)return null;if(/CriOS\/59/.test(navigator.userAgent))return null;if(/.*\(.*; wv\).*Chrome\/(?:53|54)\.\d.*/g.test(navigator.userAgent))return null;if(v.xz)return null;var e=window.PaymentRequest;return e.prototype.canMakePayment||(e.prototype.canMakePayment=function(){return Ge.resolve(!1)}),e}(),Ve=n(6274).Promise,Ke=null,He=(0,u.Z)((function e(t){var n=this;(0,l.Z)(this,e),this._onEvent=function(){},this.setEventHandler=function(e){n._onEvent=e},this.canMakePayment=function(){return(e=n._prFrame,(0,Pe.lO)(n._authentication.apiKey),Pe.Kl.test,"https:"!==window.location.protocol?Ve.resolve(!1):null!==Ke?Ve.resolve(Ke):ze&&e?e.action.checkCanMakePayment(void 0).then((function(e){var t=e.available;return Ke=!0===t})):Ve.resolve(!1)).then((function(e){return{available:e}}));var e},this.update=function(e){var t=n._prFrame;t&&t.send({action:"stripe-pr-update",payload:{data:e}})},this.show=function(){if(!n._prFrame)throw new y.No("Payment Request is not available in this browser.");n._prFrame.send({delegate:"payment",action:"stripe-pr-show",payload:{data:{usesButtonElement:n._usesButtonElement(),stripeJsId:n._controller._stripeJsId,mids:n._controller.mids()}}})},this.abort=function(){n._prFrame&&n._prFrame.send({action:"stripe-pr-abort",payload:{}})},this._setupPrFrame=function(e,t){e.send({action:"stripe-pr-initialize",payload:{data:t}}),e._on("pr-cancel",(function(){n._onEvent({type:"cancel"})})),e._on("pr-close",(function(){n._onEvent({type:"close"})})),e._on("pr-error",(function(e){n._onEvent({type:"error",payload:{errorMessage:e.message||"",errorCode:e.code||""}})})),e._on("pr-callback",(function(t){var r=t.event,o=t.nonce,i=t.options;switch(r){case"token":n._onEvent({type:"paymentresponse",payload:(0,s.Z)((0,s.Z)({},i),{},{complete:function(t){e.send({action:"stripe-pr-callback-complete",payload:{data:{status:t},nonce:o}})}})});break;case"shippingaddresschange":n._onEvent({type:"shippingaddresschange",payload:{shippingAddress:i.shippingAddress,updateWith:function(t){e.send({action:"stripe-pr-callback-complete",payload:{nonce:o,data:t}})}}});break;case"shippingoptionchange":n._onEvent({type:"shippingoptionchange",payload:{shippingOption:i.shippingOption,updateWith:function(t){e.send({action:"stripe-pr-callback-complete",payload:{nonce:o,data:t}})}}});break;default:throw new Error("Unexpected event from PaymentRequest inner: ".concat(r))}}))};var r=t.authentication,o=t.controller,i=t.mids,a=t.origin,c=t.usesButtonElement,u=t.options;if(this._authentication=r,this._controller=o,this._usesButtonElement=c,ze&&"https:"===window.location.protocol){this._controller.action.fetchLocale({locale:"auto"});var d=this._controller.createHiddenFrame(Ze.NC.PAYMENT_REQUEST_BROWSER,{authentication:r,mids:i,origin:a});this._setupPrFrame(d,u),this._prFrame=d}else this._prFrame=null;this._controller._controllerFrame._on("stripe-user-credentials-update",(function(e){n._authentication={apiKey:e.publishableKey,accountId:e.stripeAccount},n._prFrame&&n._prFrame.send({action:"stripe-pr-update",payload:{data:{__stripeUserCredentials:(0,s.Z)({},n._authentication)}}})}))})),Ye=n(4436),We=(m.Z_,(0,m.or)(m.Z_,(0,m.p3)(null)),(0,m.or)(m.Z_,(0,m.p3)(null)),(0,m.or)(m.Z_,(0,m.p3)(null)),(0,m.or)(m.Z_,(0,m.p3)(null)),{isMerchantEligibleForCBC:!1,stripePreferredNetworks:["cartes_bancaires"],supportedCobrandedNetworks:{cartes_bancaires:!1}}),Xe=function(e){return encodeURIComponent(btoa(function(e){var t=3-e.length%3,n=new Array(t+1).join(" ");return"".concat(e).concat(n)}(JSON.stringify(e))))},Qe=n(6617),Je={PAY:"pay",SELECT:"select",SAVE:"save",MOBILE_PAY:"mobile_pay"},$e=(Object.keys(Je).map((function(e){return Je[e]})),n(6835)),et=["eject_no_sensitive_data","get_initial_state_no_sensitive_data","link_prb_shipping_option_change_no_sensitive_data","log_out_in_elements_no_sensitive_data","link_popup_log_out_no_sensitive_data","ready_for_messages_no_sensitive_data","unload_no_sensitive_data","ping_no_sensitive_data","pong_no_sensitive_data"],tt=[].concat(et,["link_prb_payment_data_no_sensitive_data","link_prb_shipping_address_change_no_sensitive_data"]),nt=function(e){return-1!==tt.indexOf(e)},rt=n(1939),ot=n(6274).Promise,it=function(e){var t=(0,Qe.P$)("https://js.stripe.com/v3/"),n=(0,Qe.P$)("https://checkout.link.com/");if(!t||!n)throw new Error("Could not validate origin due to a misconfigured environment.");return e!==t&&e!==n},at=function(){function e(t){var n=this;(0,l.Z)(this,e),this.messageQueue=[],this.isDisconnected=!1,this.runOnDisconnect=[],this.deferredDomainRegistrationResult=new $e.B,this.callbacks={},this.deferredMessageResponses={},this.onClose=function(){},this.onPingTiming=function(){},this.setDomainRegistrationResult=function(e){if(n.deferredDomainRegistrationResult.isResolved())throw new Error("Cannot set domain registration result multiple times");n.deferredDomainRegistrationResult.resolve(e)},this.on=function(e,t){var r;((r=n.callbacks)[e]||(r[e]=[])).push(t)},this.off=function(e,t){var r;n.callbacks[e]=null===(r=n.callbacks[e])||void 0===r?void 0:r.filter((function(e){return e!==t}))},this.send=function(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{skipEnrollmentCheck:!1,useCheckoutAvailabilityCheck:!1},n=d._backingLibraries[e];if(!n){var r="Unexpectedly calling canMakePayment on uninitialized backing library ".concat(e);throw new Error(r)}var o=!0;return ht.race([new ht((function(e){return setTimeout(e,1e4)})).then((function(){return o&&d._report("pr.can_make_payment_timed_out"),{available:!1}})),n.canMakePayment({skipEnrollmentCheck:t.skipEnrollmentCheck,useCheckoutAvailabilityCheck:t.useCheckoutAvailabilityCheck,locale:d._locale})]).then((function(t){var n=t.available,r="LINK"===e&&t.linkExperimentAssignments?t.linkExperimentAssignments:null;return d._canMakePaymentAvailability=(0,s.Z)((0,s.Z)({},d._canMakePaymentAvailability),{},(0,a.Z)({},e,n)),o=!1,{backingLibraryName:e,available:n,linkExperimentAssignments:r}}))},d._isGooglePayOnAndroid=function(){var e=d._initialOptions.wallets,t=e&&-1===e.indexOf("googlePay"),n=!!d._canMakePaymentAvailability.BROWSER;return v.sV&&!t&&n},d._constructCanMakePaymentResponse=function(){var e=d._isGooglePayOnAndroid();return{applePay:!!d._canMakePaymentAvailability.APPLE_PAY,googlePay:!!d._canMakePaymentAvailability.GOOGLE_PAY||e,link:!!d._canMakePaymentAvailability.LINK}},d.canMakePayment=(0,C.TC)((function(){d._report("pr.can_make_payment");var e=!d._initialOptions.__isCheckout;if(d._canMakePaymentResolved){var t,n=null!==d._activeBackingLibrary?d._constructCanMakePaymentResponse():null;return d._report("pr.can_make_payment_response",{response:n,cached:!0,activeBackingLibrary:d._activeBackingLibrary,amount:null===(t=d._reportOnlyTotal)||void 0===t?void 0:t.amount,currency:d._reportOnlyCurrency}),ht.resolve(n)}if("https:"!==window.location.protocol)return bt||(d._controller.warn("If you are testing Apple Pay or Google Pay, you must serve this page over HTTPS as it will not work over HTTP. Please read https://stripe.com/docs/stripe-js/elements/payment-request-button#html-js-prerequisites for more details."),bt=!0),d._canMakePaymentResolved=!0,d._controller.deferredCanMakePaymentResponse.resolve(null),ht.resolve(null);var r=d._queryStrategy.map((function(e){return function(){return d._canMakePaymentForBackingLibrary(e)}})),o=[];if(-1!==d._queryStrategy.indexOf("LINK"))if(d._initialOptions.__linkOnly&&d._initialOptions.__isCheckout){r=[function(){return d._canMakePaymentForBackingLibrary("LINK",{skipEnrollmentCheck:!0,useCheckoutAvailabilityCheck:!0})}]}else[r,o].forEach((function(e){return e.push((function(){return d._canMakePaymentForBackingLibrary("LINK",{skipEnrollmentCheck:!0,useCheckoutAvailabilityCheck:!1})}))}));var i,a=new ft.E,c=(0,h.tN)(r,(function(e){var t=e.backingLibraryName,n=e.available;return n&&(d._activeBackingLibraryName=t,d._activeBackingLibrary=d._backingLibraries[t],d._buttonTypeName=d._activeBackingLibraryName,d._isGooglePayOnAndroid()&&(d._buttonTypeName="GOOGLE_PAY")),n})),s=e?(0,h.tN)(o,(function(e){return e.available})):null;if(e){var u=ht.all([c,s]);i=u.then((function(e){var t,n=new ft.E,r=e[0],o=e[1];d._canMakePaymentResolved=!0,"SATISFIED"===r.type&&-1!==["APPLE_PAY","GOOGLE_PAY","BROWSER"].indexOf(r.value.backingLibraryName)&&"SATISFIED"===(null==o?void 0:o.type)&&(d._secondaryActiveBackingLibraryName=o.value.backingLibraryName,d._secondaryActiveBackingLibrary=d._backingLibraries[o.value.backingLibraryName],d._secondaryButtonTypeName=d._secondaryActiveBackingLibraryName);var i=null;return"SATISFIED"===r.type&&(i=d._constructCanMakePaymentResponse()),d._report("pr.can_make_payment_response",{response:i,cached:!1,duration:a.getElapsedTime(n),activeBackingLibrary:d._activeBackingLibrary,amount:null===(t=d._reportOnlyTotal)||void 0===t?void 0:t.amount,currency:d._reportOnlyCurrency}),d._controller.deferredCanMakePaymentResponse.resolve(i),i}))}else{i=c.then((function(e){var t,n=new ft.E;d._canMakePaymentResolved=!0;var r=null;return"SATISFIED"===e.type&&(r=d._constructCanMakePaymentResponse()),d._report("pr.can_make_payment_response",{response:r,cached:!1,duration:a.getElapsedTime(n),activeBackingLibrary:d._activeBackingLibrary,amount:null===(t=d._reportOnlyTotal)||void 0===t?void 0:t.amount,currency:d._reportOnlyCurrency}),d._controller.deferredCanMakePaymentResponse.resolve(r),r}))}return d._getOnBehalfOfError().then((function(e){return e?ht.reject(e):i}))})),d.update=(0,C.TC)((function(e){if(d._isShowing)throw d._report("pr.update_called_while_showing"),new y.No("You cannot update Payment Request options while the payment sheet is showing.");d._privateForcedUpdate(e)})),d._privateForcedUpdate=function(e){var t,n=(0,m.Gu)(X,e,"PaymentRequest update()"),r=n.value,o=n.warnings;d._report("pr.update"),o.forEach((function(e){return d._warn(e)}));var i=r.__billingDetailsEmailOverride,a=(0,c.Z)(r,gt);if(i){if(d._initialOptions.requestPayerEmail)throw new y.No("When providing `__billingDetailsEmailOverride`, `requestPayerEmail` has to be `false` so that the customer is not prompted for their email in the payment sheet.");d._initialOptions.__billingDetailsEmailOverride=i}!a.shippingOptions||null!==(t=d._initialOptions)&&void 0!==t&&t.requestShipping||d._report("pr.update_shipping_options_without_shipping"),a.total&&(d._reportOnlyTotal=a.total),a.currency&&(d._reportOnlyCurrency=a.currency),(0,_.VO)(d._backingLibraries).forEach((function(e){e&&e.update(a)}))},d.show=(0,C.TC)((function(){var e;if(d._usedByButtonElement&&!d._showCalledByButtonElement&&(d._report("pr.show_called_with_button"),d._warn("Do not call show() yourself if you are using the paymentRequestButton Element. The Element handles showing the payment sheet.")),!d._canMakePaymentResolved)throw d._report("pr.show_called_before_can_make_payment"),new y.No("You must first check the Payment Request API's availability using paymentRequest.canMakePayment() before calling show().");if(!d._activeBackingLibrary)throw d._report("pr.show_called_with_can_make_payment_false"),new y.No("Payment Request is not available in this browser.");("LINK"!==d._activeBackingLibraryName||d._initialOptions.__linkOnly||(d._usedByButtonElement||d._report("pr.show_called_with_link_custom_button"),!d._showCalledByButtonElement&&d._usedByButtonElement&&d._report("pr.show_called_with_link_hybrid_button")),"APPLE_PAY"===d._activeBackingLibraryName&&d._initialOptions.applePay)&&(0,_t.EH)({applePay:d._initialOptions.applePay}).forEach((function(e){return d._warn(e)}));var t=null;if("secondary"===d._lastClickedButtonPosition){if(!d._secondaryActiveBackingLibrary)throw Error('The relevant backing library for position "'.concat(d._lastClickedButtonPosition,'" was unavailable.'));t=d._secondaryActiveBackingLibrary}else t=d._activeBackingLibrary;var n=d._showCalledByButtonElement?"pr.show_from_element":"pr.show_from_custom";d._report(n),d._report("pr.show",{amount:null===(e=d._reportOnlyTotal)||void 0===e?void 0:e.amount,currency:d._reportOnlyCurrency,listeners:Object.keys(d._callbacks).sort()}),d._isShowing=!0,t.show({locale:d._locale})})),d.abort=(0,C.TC)((function(){if(d._activeBackingLibrary){var e=d._activeBackingLibrary;d._report("pr.abort"),e.abort()}})),d.isShowing=function(){return d._isShowing},d._controller=e.controller,d._authentication=e.authentication,d._listenerRegistry=e.listenerRegistry;var p=(0,m.Gu)((e.betas,(0,m.mC)({displayItems:(0,m.jt)((0,m.CT)(x)),shippingOptions:(0,m.jt)((0,m.uw)("id")((0,m.CT)(Z))),wallets:(0,m.jt)((0,m.CT)(m.kw.apply(void 0,(0,E.Z)(R())))),disableWallets:(0,m.jt)((0,m.CT)(m.kw.apply(void 0,(0,E.Z)(R())))),blockedCardBrands:(0,m.jt)((0,m.CT)(m.kw.apply(void 0,(0,E.Z)(k.iw)))),tokenNotificationURL:(0,m.jt)(m.Z_),total:O,requestShipping:(0,m.jt)(m.Xg),requestPayerName:(0,m.jt)(m.Xg),requestPayerEmail:(0,m.jt)(m.Xg),requestPayerPhone:(0,m.jt)(m.Xg),shippingType:(0,m.jt)(D),currency:m.cV,country:m.hN,applePay:(0,m.jt)(W),onBehalfOf:(0,m.jt)(m.Z_),jcbEnabled:(0,m.jt)(m.Xg),__billingDetailsEmailOverride:(0,m.jt)(m.Z_),__minApplePayVersion:(0,m.jt)(m.Rx),__minGooglePayVersion:(0,m.jt)(L),__merchantDetails:(0,m.jt)(B),__linkOnly:(0,m.jt)(m.Xg),__isCheckout:(0,m.jt)(m.Xg),__isHostedInvoicePage:(0,m.jt)(m.Xg),__checkoutSessionId:(0,m.jt)(m.Z_),__isPaymentElement:(0,m.jt)(m.Xg),__elementsGroupId:(0,m.jt)(m.Z_),__isExpressCheckoutElement:(0,m.jt)(m.Xg),__betas:(0,m.jt)((0,m.CT)(m.z$.apply(void 0,(0,E.Z)(N.Lv)))),__supportsCouponCode:(0,m.jt)(m.Xg),__couponCode:(0,m.jt)(m.Z_),__linkPurchaseProtectionsData:(0,m.jt)(j),__linkProtectionsEligibleAndRolledOut:(0,m.jt)(m.Xg),__linkUnrecognizedProtectionsHoldback:(0,m.jt)(m.Xg)})),e.rawOptions||{},"paymentRequest()"),g=p.value,S=p.warnings;if(d._report("pr.options",{options:(0,s.Z)((0,s.Z)({},(0,_.ei)(g,["country","currency","jcbEnabled","requestPayerEmail","requestPayerName","requestPayerPhone","requestShipping","disableWallets","wallets","blockedCardBrands"])),{},{applePay:(0,s.Z)((0,s.Z)({},(0,_.ei)(null!==(r=g.applePay)&&void 0!==r?r:{},["applePayLaterAvailability"])),{},{usesAutomaticReloadPaymentRequest:!(null===(o=g.applePay)||void 0===o||!o.automaticReloadPaymentRequest),usesDeferredPaymentRequest:!(null===(i=g.applePay)||void 0===i||!i.deferredPaymentRequest),usesRecurringPaymentRequest:!(null===(u=g.applePay)||void 0===u||!u.recurringPaymentRequest)})})}),S.forEach((function(e){return d._warn(e)})),g.__billingDetailsEmailOverride&&g.requestPayerEmail)throw new y.No("When providing `__billingDetailsEmailOverride`, `requestPayerEmail` has to be `false` so that the customer is not prompted for their email in the payment sheet.");g.applePay&&(0,_t.AB)({applePay:g.applePay});var A=R(),P=g.disableWallets,M=P?A.filter((function(e){return-1===P.indexOf(e)})):g.wallets;return e.queryStrategyOverride?d._queryStrategy=e.queryStrategyOverride:g.__linkOnly?d._queryStrategy=["LINK"]:d._queryStrategy=ee(M||A),d._report("pr.query_strategy",{queryStrategy:d._queryStrategy}),d._initialOptions=(0,s.Z)((0,s.Z)({},g),{},{__betas:e.betas,wallets:M}),d._reportOnlyCurrency=g.currency,d._reportOnlyTotal=g.total,d._initBackingLibraries(d._initialOptions),d._controller._controllerFrame._on("stripe-user-credentials-update",(function(e){d._authentication={apiKey:e.publishableKey,accountId:e.stripeAccount},d._canMakePaymentResolved&&(d._canMakePaymentResolved=!1,d._controller.deferredCanMakePaymentResponse.resolve(null),d.canMakePayment())})),d}(0,d.Z)(t,e);var n=(0,p.Z)(t);return(0,u.Z)(t)}(S.Z),kt=wt},3234:function(e,t,n){"use strict";n.d(t,{A:function(){return i},C:function(){return o}});var r=n(6617),o=function(e){try{if((0,r.zd)()){var t=(0,r.Uy)();return t||e("pr.apple_pay.top_level_domain_unavailable"),t}}catch(e){}return null},i=function(e){var t=o(e);return t?new URL(t).hostname:window.location.hostname}},2920:function(e,t,n){"use strict";n.d(t,{Qt:function(){return d},VC:function(){return l},lU:function(){return s}});var r=n(3550),o=n(3333),i=n(3234),a=n(6274).Promise,c=function(e){if(!function(){try{var e;return window.location.origin===(null===(e=window.top)||void 0===e?void 0:e.location.origin)}catch(e){return!1}}()){var t=(0,i.C)(e);return!o.OV||!t||(e("pr.apple_pay.cross_domain_iframe"),!1)}return!1},s=2,u=(0,r.HP)((function(e){return window.ApplePaySession.canMakePaymentsWithActiveCard(e)})),l=function(e){if(!window.ApplePaySession)return!1;try{return window.ApplePaySession.supportsVersion(e)}catch(e){return!1}},d=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s,i=arguments.length>5?arguments[5]:void 0;if("https:"!==window.location.protocol)return a.resolve(!1);var l=Math.max(s,o);if(window.ApplePaySession){if(c(r))return a.resolve(!1);if(window.ApplePaySession.supportsVersion(l)){var d=t?[e,t]:[e],p="merchant.".concat(d.join("."),".stripe");if(i)return u(p).then((function(o){if(r("pr.apple_pay.can_make_payment_native_response",{available:o,identifier:p}),n&&!o&&window.console){var i=t?"or stripeAccount parameter (".concat(t,") "):"";window.console.warn("Either you do not have a card saved to your Wallet or the current domain (".concat(e,") ").concat(i,"is not registered for Apple Pay."))}return o}));var m=window.ApplePaySession.canMakePayments();return a.resolve(m)}return n&&window.console&&window.console.warn("This version of Safari does not support ApplePay JS version ".concat(l,".")),a.resolve(!1)}return a.resolve(!1)}},4436:function(e,t,n){"use strict";n.d(t,{ud:function(){return o},Nj:function(){return d}});var r={ar:"ar",bg:"bg",cs:"cs",da:"da",de:"de",el:"el",en:"en","en-GB":"en-GB","en-NL":"en-NL",es:"es","es-419":"es-419",et:"et",fi:"fi",fil:"fil",fr:"fr","fr-CA":"fr-CA",he:"he",hr:"hr",hu:"hu",id:"id",it:"it",ja:"ja",ko:"ko",lt:"lt",lv:"lv",ms:"ms",mt:"mt",nb:"nb",nl:"nl","nl-BE":"nl-BE",no:"no",pl:"pl",pt:"pt","pt-BR":"pt-BR",ru:"ru",ro:"ro",sk:"sk",sl:"sl",sv:"sv",th:"th",tr:"tr",vi:"vi",zh:"zh","zh-HK":"zh-HK","zh-TW":"zh-TW"},o=["ar","he"],i=(Object.keys(r),r),a={"es-HN":"es-419","es-MX":"es-419","es-US":"es-419"},c=function(e){try{var t=function(e){var t=e.split("-"),n=t[0],r=null,o=null,i=null;if(t.length>1&&(4===t[1].length?o=t[1]:2===t[1].length||3===t[1].length?r=t[1]:i=t[1]),t.length>2&&(2===t[2].length||3===t[2].length?r=t[2]:i=t[2]),t.length>3&&(i=t[3]),2!==n.length&&3!==n.length)throw new Error("invalid locale ".concat(e));var a=n.toLowerCase(),c=r?r.toUpperCase():null,s=o?"".concat(o[0].toUpperCase()).concat(o.substring(1).toLowerCase()):null;return{locale:a+(s?"-".concat(s):"")+(c?"-".concat(c):"")+(i?"-".concat(i):""),language:a,region:c,script:s,variant:i}}(e),n=t.locale,r=t.language,o=[n];return a[n]&&o.push(a[n]),n!==r&&o.push(r),o.push("en"),o}catch(t){return[e,"en"]}},s=n(3333),u=n(1765),l=function(e){return function(e){for(var t=c(e),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,{Z:function(){return r}});var o=n(3366)},3366:function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}n.d(t,{Z:function(){return r}})},2963:function(e,t,n){"use strict";function r(e,t){if(t&&("object"===(0,o.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}n.d(t,{Z:function(){return r}});var o=n(1002),i=n(7326)},9611:function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{Z:function(){return r}})},3324:function(e,t,n){"use strict";function r(e,t){return(0,o.Z)(e)||(0,i.Z)(e,t)||(0,a.Z)(e,t)||(0,c.Z)()}n.d(t,{Z:function(){return r}});var o=n(3878),i=n(1902),a=n(181),c=n(5267)},9062:function(e,t,n){"use strict";function r(e){return(0,o.Z)(e)||(0,i.Z)(e)||(0,a.Z)(e)||(0,c.Z)()}n.d(t,{Z:function(){return r}});var o=n(5057),i=n(9199),a=n(181),c=n(2786)},1002:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{Z:function(){return r}})},181:function(e,t,n){"use strict";function r(e,t){if(e){if("string"==typeof e)return(0,o.Z)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?(0,o.Z)(e,t):void 0}}n.d(t,{Z:function(){return r}});var o=n(907)},7112:function(e,t,n){"use strict";function r(e){var t="function"==typeof Map?new Map:void 0;return r=function(e){function n(){return(0,c.Z)(e,arguments,(0,o.Z)(this).constructor)}if(null===e||!(0,a.Z)(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),(0,i.Z)(n,e)},r(e)}n.d(t,{Z:function(){return r}});var o=n(1120),i=n(9611),a=n(8989),c=n(5647)}},o={};e.m=r,e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},e.d=function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.f={},e.e=function(t){return Promise.all(Object.keys(e.f).reduce((function(n,r){return e.f[r](t,n),n}),[]))},e.u=function(e){return"fingerprinted/js/"+{1:"elements-affirm-modal",16:"embedded-checkout-outer",209:"elements-affirm-message",259:"elements-afterpay-clearpay-modal",428:"payment-intent-outer-actions-cardimageverification",578:"elements-afterpay-clearpay-message",671:"elements-cpm-embed-manager",895:"custom-checkout",897:"sentry",913:"trusted-types-checker",944:"phone-numbers-lib"}[e]+"-"+{1:"220c0b11f25a381e58cb86e2dbab9ec3",16:"23d0635f8c9c5c32a995ed006bcf232c",209:"93a1169e3436baaa0021bb9a2e401006",259:"d170dcc5dd0c100fbcbcfb8a11288160",428:"fea9855d3775972a394b54782116ca24",578:"13bfaa4d98c0813ed252362bd19bfd49",671:"fc6ec84f8f6637e3139fbc5ea544775f",895:"41f397bdaa3a55119b22faca6b2348cd",897:"e46620bb9d51e447c284bd46a6383ed1",913:"efd8cf45ce422659c098993bfc62531b",944:"2e4b163cc1a1989623e99b9224e9eda8"}[e]+".js"},e.miniCssF=function(){},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t={},n="stripe-js-v3:",e.l=function(r,o,i){if(t[r])t[r].push(o);else{var a,c;if(void 0!==i)for(var s=document.getElementsByTagName("script"),u=0;u; }; }; diff --git a/packages/shared/src/utils/openUrlUtils.ts b/packages/shared/src/utils/openUrlUtils.ts index cfc16c76cde..e9bdef7a22c 100644 --- a/packages/shared/src/utils/openUrlUtils.ts +++ b/packages/shared/src/utils/openUrlUtils.ts @@ -14,6 +14,7 @@ import { import appGlobals from '../appGlobals'; import type { IPrefType } from '../../types/desktop'; +import { EWebEmbedRoutePath } from '../consts/webEmbedConsts'; const openUrlByWebview = (url: string, title?: string) => { appGlobals.$navigationRef.current?.navigate(ERootRoutes.Modal, { @@ -28,6 +29,34 @@ const openUrlByWebview = (url: string, title?: string) => { }); }; +function openUrlByWebviewPro({ + url, + title, + isWebEmbed, + hashRoutePath, + hashRouteQueryParams, +}: { + url: string; + title: string; + isWebEmbed?: boolean; + hashRoutePath?: EWebEmbedRoutePath; + hashRouteQueryParams?: Record; +}) { + appGlobals.$navigationRef.current?.navigate(ERootRoutes.Modal, { + screen: EModalRoutes.WebViewModal, + params: { + screen: EModalWebViewRoutes.WebView, + params: { + url, + title, + isWebEmbed, + hashRoutePath, + hashRouteQueryParams, + }, + }, + }); +} + const openUrlOutsideNative = (url: string): void => { if (platformEnv.isExtension) { void chrome.tabs.create({ @@ -65,6 +94,7 @@ export const openSettings = (prefType: IPrefType) => { }; export default { + openUrlByWebviewPro, openUrlInApp, openUrlExternal, openSettings, diff --git a/packages/shared/src/utils/promiseUtils.ts b/packages/shared/src/utils/promiseUtils.ts index de4f2c49cf5..3f3602282e8 100644 --- a/packages/shared/src/utils/promiseUtils.ts +++ b/packages/shared/src/utils/promiseUtils.ts @@ -150,14 +150,14 @@ export async function promiseAllSettledEnhanced( class PromiseTarget { ready = new Promise((resolve) => { - this.resolve = resolve; + this._resolveFn = resolve; }); - resolve: ((value: T) => void) | undefined; + _resolveFn: ((value: T) => void) | undefined; resolveTarget(value: T, delay = 0) { setTimeout(() => { - this.resolve?.(value); + this._resolveFn?.(value); }, delay); } } diff --git a/packages/shared/src/utils/stringUtils.ts b/packages/shared/src/utils/stringUtils.ts index 3197a2f6ca5..40cf3033652 100644 --- a/packages/shared/src/utils/stringUtils.ts +++ b/packages/shared/src/utils/stringUtils.ts @@ -1,5 +1,9 @@ /* eslint-disable no-bitwise */ import safeStringify from 'fast-safe-stringify'; +import { isString } from 'lodash'; +import validator from 'validator'; + +import { generateUUID } from './miscUtils'; export function equalsIgnoreCase( a: string | undefined | null, @@ -96,8 +100,17 @@ export function isUTF8(buf: Buffer): boolean { return true; } +function isValidEmail(email: string): boolean { + if (!email || !isString(email)) { + return false; + } + return validator.isEmail(email); +} export default { + generateUUID, + validator, + isValidEmail, stableStringify, safeStringify, randomString, diff --git a/packages/shared/src/utils/uriUtils.ts b/packages/shared/src/utils/uriUtils.ts index 72723b57992..c3228d81a83 100644 --- a/packages/shared/src/utils/uriUtils.ts +++ b/packages/shared/src/utils/uriUtils.ts @@ -200,11 +200,19 @@ function buildUrl({ // eslint-disable-next-line no-param-reassign path = path.replace(/\/+$/, ''); + let search = ''; + if (query) { + search = new URLSearchParams(query).toString(); + } + + if (path && !protocol && !hostname) { + return `/${path}${search ? `?${search}` : ''}`; + } const url = new URL( `${protocol}://${[hostname, path].filter(Boolean).join('/')}`, ); - if (query) { - url.search = new URLSearchParams(query).toString(); + if (search) { + url.search = search; } return url.toString(); } diff --git a/packages/shared/src/web/index.html.ejs b/packages/shared/src/web/index.html.ejs index 2b11cf5dbb2..89475bb73b5 100644 --- a/packages/shared/src/web/index.html.ejs +++ b/packages/shared/src/web/index.html.ejs @@ -108,7 +108,11 @@ -
+
+ <% if ( platform == 'webEmbed' ) { %> + webEmbed index.html + <% } %> +
<% if ( platform !== 'webEmbed' ) { %> - <% } %> + <% } %> diff --git a/packages/shared/types/endpoint.ts b/packages/shared/types/endpoint.ts index 859d74aa8aa..78210b85449 100644 --- a/packages/shared/types/endpoint.ts +++ b/packages/shared/types/endpoint.ts @@ -6,6 +6,7 @@ export enum EServiceEndpointEnum { Earn = 'earn', Notification = 'notification', NotificationWebSocket = 'notificationWebSocket', + Prime = 'prime', } export type IEndpointEnv = 'test' | 'prod'; diff --git a/packages/shared/types/prime/primeTypes.ts b/packages/shared/types/prime/primeTypes.ts new file mode 100644 index 00000000000..f959d8e8a5f --- /dev/null +++ b/packages/shared/types/prime/primeTypes.ts @@ -0,0 +1,26 @@ +export type IPrimeSubscriptionInfo = { + isActive: boolean; + expiresAt: number; +}; +export type IPrimeUserInfo = { + isLoggedIn: boolean; + email: string | undefined; + privyUserId: string | undefined; + subscriptionManageUrl: string | undefined; + primeSubscription: IPrimeSubscriptionInfo | undefined; +}; + +export type IPrimeServerUserInfo = { + createdAt: string; + updatedAt: string; + + lastChangeUUID: string; + + isPrime: boolean; + primeExpiredAt: number; + level: 'PRIME' | 'NORMAL'; + salt: string; + userId: string; + // email + // isLogin +}; diff --git a/patches/@privy-io+expo-native-extensions+0.0.3.patch b/patches/@privy-io+expo-native-extensions+0.0.3.patch new file mode 100644 index 00000000000..94e01cd3943 --- /dev/null +++ b/patches/@privy-io+expo-native-extensions+0.0.3.patch @@ -0,0 +1,22 @@ +diff --git a/node_modules/@privy-io/expo-native-extensions/ios/ExpoNativeExtensionsModule.swift b/node_modules/@privy-io/expo-native-extensions/ios/ExpoNativeExtensionsModule.swift +index f74584a..7d6cd89 100644 +--- a/node_modules/@privy-io/expo-native-extensions/ios/ExpoNativeExtensionsModule.swift ++++ b/node_modules/@privy-io/expo-native-extensions/ios/ExpoNativeExtensionsModule.swift +@@ -20,7 +20,7 @@ public class ExpoNativeExtensionsModule: Module { + return "Hello from privy native extensions! 👋" + } + +- AsyncFunction("writeRecoverySecretToICloud") { (options: WriteICloudRecoverySecretOptions) in ++ AsyncFunction("writeRecoverySecretToICloud") { (options: WriteICloudRecoverySecretOptions) -> WriteICloudRecoverySecretResponse in + // Ensure user is logged into iCloud, or throw an error + let isUserLoggedIntoICloud = await isUserLoggedIntoICloud(containerIdentifier: options.containerId) + if !isUserLoggedIntoICloud { +@@ -49,7 +49,7 @@ public class ExpoNativeExtensionsModule: Module { + } + + // TODO: after finalizing how we want to handle async functions, update this function to match +- AsyncFunction("readRecoverySecretFromICloud") { (options: ReadICloudRecoverySecretOptions) in ++ AsyncFunction("readRecoverySecretFromICloud") { (options: ReadICloudRecoverySecretOptions) -> ReadICloudRecoverySecretResponse in + // Ensure user is logged into iCloud, or throw an error + let isUserLoggedIntoICloud = await isUserLoggedIntoICloud(containerIdentifier: options.containerId) + if !isUserLoggedIntoICloud { diff --git a/patches/@privy-io+react-auth+1.98.4.patch b/patches/@privy-io+react-auth+1.98.4.patch new file mode 100644 index 00000000000..f42dc3df1b5 --- /dev/null +++ b/patches/@privy-io+react-auth+1.98.4.patch @@ -0,0 +1,30 @@ +diff --git a/node_modules/@privy-io/react-auth/dist/cjs/privy-provider-zFh8lpI0.js b/node_modules/@privy-io/react-auth/dist/cjs/privy-provider-zFh8lpI0.js +index 2a1898a..c4357cd 100644 +--- a/node_modules/@privy-io/react-auth/dist/cjs/privy-provider-zFh8lpI0.js ++++ b/node_modules/@privy-io/react-auth/dist/cjs/privy-provider-zFh8lpI0.js +@@ -1,2 +1,2 @@ + "use strict";var e=require("react/jsx-runtime"),t=require("@ethersproject/address"),r=require("@ethersproject/providers"),a=require("mipd"),n=require("react"),i=require("react-device-detect"),o=require("@privy-io/js-sdk-core"),s=require("./auth-flows/custom-jwt-account.js"),l=require("./auth-flows/email.js"),c=require("./auth-flows/farcaster.js"),d=require("./auth-flows/guest.js"),u=require("./auth-flows/passkey.js"),h=require("./auth-flows/siwe.js"),y=require("./auth-flows/siws.js"),p=require("./auth-flows/sms.js"),w=require("./auth-flows/telegram.js"),E=require("uuid"),v=require("./accessToken.js"),m=require("./client/user.js"),g=require("eventemitter3"),f=require("./constants.js"),C=require("./storage.js"),P=require("./utils/index.js"),A=require("./connectors/coinbase.js"),_=require("./connectors/embedded.js"),T=require("./embedded-wallets/rpc/types.js"),W=require("./components/Captcha.js"),I=require("./components/LoginModal.js"),S=require("./components/TelegramLoginButton.js"),N=require("./configuration/context.js"),k=require("./connectors/areWalletArraysEqual.js"),U=require("./connectors/errors.js"),b=require("./connectors/is-wallet-installed.js"),O=require("./connectors/isBaseConnectedEthereumWallet.js"),R=require("./connectors/privyProxyProvider.js"),D=require("./connectors/solana/index.js"),M=require("./connectors/walletconnect-v2.js"),L=require("./embedded-wallets/EmbeddedWalletIframe.js"),F=require("./embedded-wallets/delegated-actions.js"),x=require("./embedded-wallets/errors.js"),q=require("./embedded-wallets/rpc/index.js"),j=require("./errors.js"),B=require("./embedded-wallets/solana/transaction.js"),H=require("./lib/caip2.js"),K=require("./lib/cross-app/index.js"),V=require("./lib/cross-app/authFlow.js"),G=require("./lib/cross-app/popupCrossAppAuthFlow.js"),z=require("./lib/cross-app/sendCrossAppRequest.js"),Y=require("./lib/embeddedWalletRecovery.js"),$=require("./lib/funding/index.js"),X=require("./lib/funding/isFundingEnabled.js"),J=require("./lib/isEmbeddedWebview.js"),Q=require("./lib/popup/triggerPopup.js"),Z=require("./lib/popupOAuthFlow.js"),ee=require("./lib/siwe.js"),te=require("./lib/solana/transaction.js"),re=require("./lib/toDisplayFromAccountType.js"),ae=require("./passkeys/transformResponseToSnakeCase.js"),ne=require("./plugins/context/PrivyPluginContext.js"),ie=require("./plugins/solana-funding/id.js"),oe=require("./recent-login/context.js"),se=require("./screens/index.js"),le=require("./screens/LandingScreen/styles.js"),ce=require("./styles.js"),de=require("./hooks/index.js"),ue=require("./hooks/captcha-context.js"),he=require("./hooks/events-context.js"),ye=require("./hooks/internal-context.js"),pe=require("./hooks/modal-context.js"),we=require("./hooks/privy-context.js"),Ee=require("./hooks/useWallets.js"),ve=require("./lib/funding/prepareFundingModalData.js"),me=require("./auth-flows/oauth/detectCompletingOAuthFlow.js"),ge=require("./auth-flows/oauth/OAuthFlow.js"),fe=require("./connectors/getRpcTimeout.js"),Ce=require("./connectors/providerTypes.js"),Pe=require("./connectors/ethereum/index.js"),Ae=require("./connectors/injected.js"),_e=require("./connectors/metamask.js"),Te=require("./connectors/phantom.js"),We=require("./connectors/phantom-solana.js"),Ie=require("./http.js"),Se=require("./lib/smart-wallet-helpers.js"),Ne=require("./passkeys/transformOptionsToCamelCase.js"),ke=require("./paths.js"),Ue=require("./session.js");function be(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var Oe=/*#__PURE__*/be(g);class Re extends Oe.default{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new Ce.EmbeddedProviderError(`Invalid params for ${e.method}`,4200);let t=e.params[0];if(!await Xe()||!this.address)throw new Ce.EmbeddedProviderError("Disconnected",4900);return(await Ze(t,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new Ce.EmbeddedProviderError(`Invalid params for ${e.method}`,4200);if("string"==typeof e.params[0])t=e.params[0];else{if(!("chainId"in e.params[0])||"string"!=typeof e.params[0].chainId)throw new Ce.EmbeddedProviderError(`Invalid params for ${e.method}`,4200);t=e.params[0].chainId}this.chainId=Number(t),this.provider=P.getJsonRpcProvider(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",t)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let t=e.params[0],r=e.params[1];return await Je(t,void 0,r)}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let t=e.params[0],r="string"==typeof e.params[1]?JSON.parse(e.params[1]):e.params[1];return await Qe(P.generateTypedDataWithDomainType(r),void 0,t)}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let t={...e.params[0],chainId:P.toHex(this.chainId)};try{return await this.provider.send("eth_estimateGas",[t])}catch(e){console.warn(`Gas estimation failed with error: ${e}. Retrying gas estimation by omitting the 'from' address`);try{return delete t.from,await this.provider.send("eth_estimateGas",[t])}catch(t){throw console.warn(`Gas estimation failed with error: ${t} when omitting the 'from' address`),e}}}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return P.toHex(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!T.isSupportedEthereumRpcMethod(e.method))return this.provider.send(e.method,e.params);{let t=await Xe();if(await et(),!t||!this.address)throw new Ce.EmbeddedProviderError("Disconnected",4900);try{return(await this.walletProxy.rpc({accessToken:t,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:{method:e.method,params:e.params}})).response.data}catch(e){throw console.error(e),new Ce.EmbeddedProviderError("Disconnected",4900)}}}constructor({walletProxy:e,address:t,entropyId:r,entropyIdVerifier:a,rpcConfig:n,chains:i,appId:o,chainId:s=1,walletIndex:l}){super(),this.walletProxy=e,this.address=t,this.entropyId=r,this.entropyIdVerifier=a,this.chainId=s,this.rpcConfig=n,this.chains=i,this.provider=P.getJsonRpcProvider(s,this.chains,n,{appId:o}),this.rpcTimeoutDuration=fe.getRpcTimeout(n,"privy"),this.appId=o,this.walletIndex=l}}class De extends Oe.default{get wallets(){let e=new Set,t=this.walletConnectors.flatMap((e=>e.wallets)).sort(((e,t)=>e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0)).filter((t=>{let r=`${t.address}${t.walletClientType}${t.connectorType}`;return!e.has(r)&&(e.add(r),!0)})),r=t.findIndex((e=>e.address===(this.activeWallet?this.activeWallet:"unknown")));return r>=0&&t.unshift(t.splice(r,1)[0]),t}async initialize(){if(this.initialized)return;C.default.get(f.CONNECTORS_STATE_KEY)&&(C.default.getKeys().forEach((e=>{e.startsWith("walletconnect")&&C.default.del(e)})),C.default.del(f.CONNECTORS_STATE_KEY));let e=P.detectInjectedConnectors({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then((e=>{e.forEach((({type:e,eip6963InjectedProvider:t,legacyInjectedProvider:r})=>{this.createEthereumWalletConnector("injected",e,{eip6963InjectedProvider:t,legacyInjectedProvider:r})}))}));this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector("coinbase_wallet","coinbase_wallet"),!b.isPhantomInstalled()&&this.walletList.includes("phantom")&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&this.createEthereumWalletConnector("phantom","phantom"),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&this.addWalletConnector(new We.PhantomSolanaNullWalletConnector)),this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector("wallet_connect_v2","unknown"),this.externalWalletConfig.solana.connectors?.get().forEach(this.addSolanaWalletConnector),this.externalWalletConfig.solana.connectors?._setOnConnectorsUpdated?.((e=>{e?.forEach(this.addSolanaWalletConnector)})),await e,this.initialized=!0}findWalletConnector(e,t){return"wallet_connect_v2"===e?this.walletConnectors.filter(Pe.isEthereumWalletConnector).find((t=>t.connectorType===e))??null:this.walletConnectors.filter(Pe.isEthereumWalletConnector).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findSolanaWalletConnector(e,t){return this.walletConnectors.filter(D.isSolanaWalletConnector).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter((e=>"embedded"===e.connectorType))}onInitialized(e){e.wallets.forEach((e=>{let t=this.storedConnections.find((t=>t.address===e.address&&t.connectorType===e.connectorType&&t.walletClientType===e.walletClientType));t&&(e.connectedAt=t.connectedAt)})),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:e,rootWallet:t,embeddedWallets:r,defaultChain:a,appId:n}){for(let i of r){let r=this.findEmbeddedWalletConnectors().find((e=>e.walletIndex===i.walletIndex));if(r&&Pe.isEthereumWalletConnector(r))r.proxyProvider.walletProxy=e;else{let{entropyId:r,entropyIdVerifier:o}=m.getEntropyDetailsFromAccount(t),s=new _.EmbeddedWalletConnector({provider:new Re({walletProxy:e,address:i.address,entropyId:r,entropyIdVerifier:o,rpcConfig:this.rpcConfig,chains:this.chains,appId:n,chainId:a.id,walletIndex:i.walletIndex}),chains:this.chains,defaultChain:a,rpcConfig:this.rpcConfig,imported:!1,walletIndex:i.walletIndex});this.addWalletConnector(s)}}}addImportedWalletConnector(e,t,r,a){let n=this.findWalletConnector("embedded_imported","privy");if(n&&Pe.isEthereumWalletConnector(n))n.proxyProvider.walletProxy=e;else{let n=new _.EmbeddedWalletConnector({provider:new Re({walletProxy:e,address:t,entropyId:t,entropyIdVerifier:"ethereum-address-verifier",walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:r.id}),chains:this.chains,walletIndex:0,defaultChain:r,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(n)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter((e=>"embedded"!==e.connectorType)),this.saveConnectionHistory(),this.storedConnections=Me(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1),this.saveConnectionHistory(),this.storedConnections=Me(),this.emit("walletsUpdated")}}async createEthereumWalletConnector(e,t,r){let a=this.findWalletConnector(e,t);if(a&&Pe.isEthereumWalletConnector(a))return a instanceof M.WalletConnectV2WalletConnector&&a.resetConnection(t),a;let n=(()=>"injected"!==e?"coinbase_wallet"===e?new A.CoinbaseWalletConnector(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):"phantom"===e?new Te.PhantomEthereumNullWalletConnector(this.defaultChain):new M.WalletConnectV2WalletConnector(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,t):"metamask"===t&&r?.eip6963InjectedProvider?new _e.MetamaskWalletConnector(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):"metamask"===t&&r?.legacyInjectedProvider?new Ae.LegacyInjectedWalletConnector(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):"phantom"===t&&r?.legacyInjectedProvider?new Ae.LegacyInjectedWalletConnector(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&"unknown_browser_extension"===t?new Ae.LegacyInjectedWalletConnector(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new Ae.Injected6963WalletConnector(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,t):void 0)();return n&&this.addWalletConnector(n),n||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",(()=>this.onInitialized(e))),e.on("walletsUpdated",(()=>this.onWalletsUpdated(e))),e.initialize().catch((e=>{console.debug("Failed to initialize connector",e)}))}saveConnectionHistory(){let e=this.wallets.map((e=>({address:e.address,connectorType:e.connectorType,walletClientType:e.walletClientType,connectedAt:e.connectedAt})));C.default.put(f.CONNECTIONS_HISTORY_KEY,e)}async activeWalletSign(e){let t=this.wallets,r=t.length>0?t[0]:null;return r&&O.isBaseConnectedEthereumWallet(r)?r.sign(e):null}setActiveWallet(e){this.activeWallet=t.getAddress(e),this.emit("walletsUpdated")}constructor(e,t,r,a,n,i,o,s,l,c,d,u){super(),this.addSolanaWalletConnector=async e=>{this.findSolanaWalletConnector("solana_adapter",e.walletClientType)||this.addWalletConnector(e)},this.getEthereumProvider=()=>{let e=this.wallets[0],t=this.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new R.PrivyProxyProvider},this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=r,this.chains=a,this.defaultChain=n,this.walletConnectors=[],this.initialized=!1,this.store=i,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=s,this.externalWalletConfig=l,this.privyAppName=c,this.privyAppLogo=d,this.walletChainType=u||"ethereum-only",this.storedConnections=Me()}}const Me=()=>{let e=C.default.get(f.CONNECTIONS_HISTORY_KEY);return e&&Array.isArray(e)&&e.map((e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e))).every(Boolean)?e:[]};let Le;var Fe=0,xe="__private_"+Fe+++"__getOrGenerateClientAnalyticsId";class qe{initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:a,store:n,walletList:i,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:s,appName:l,walletChainType:c}){this.connectors||(this.connectors=new De(this.appId,e,t,r,a,n,i,o,s,l,void 0,c))}generateApi(){let e=new Ie.Http({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new j.PrivyClientError("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new j.PrivyClientError("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter((e=>"cross_app"===e.type)).forEach((e=>{this.storeProviderAccessToken(e.providerApp.id,null)}))}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(ke.mfaPasswordlessSmsInitPath,{action:"verify"})}catch(e){throw j.formatApiError(e)}}async initMfaPasskeyVerification(){try{let e=await this.api.post(ke.mfaPasskeyInitPath,{});return Ne.transformOptionsToCamelCase(e.options)}catch(e){throw j.formatApiError(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(e){console.error("Error fetching cross app provider details",e)}}async acceptTerms(){try{let e=await this.api.post(ke.acceptTermsPath,{});return m.convertUserResponseToUser(e)}catch(e){throw j.formatPrivyError(e)}}async unlinkEmail(e){try{let t=await this.api.post(ke.unlinkEmailPath,{address:e});return await this.getAuthenticatedUser()??m.convertUserResponseToUser(t)}catch(e){throw j.formatPrivyError(e)}}async unlinkPhone(e){try{let t=await this.api.post(ke.unlinkPhonePath,{phoneNumber:e});return await this.getAuthenticatedUser()??m.convertUserResponseToUser(t)}catch(e){throw j.formatPrivyError(e)}}async unlinkEthereumWallet(e){try{let t=await this.api.post(ke.unlinkWalletPath,{address:e});return await this.getAuthenticatedUser()??m.convertUserResponseToUser(t)}catch(e){throw j.formatPrivyError(e)}}async unlinkSolanaWallet(e){try{let t=await this.api.post(ke.siwsUnlinkWalletPath,{address:e});return await this.getAuthenticatedUser()??m.convertUserResponseToUser(t)}catch(e){throw j.formatPrivyError(e)}}async unlinkOAuth(e,t){try{let r=await this.api.post(ke.unlinkOAuthPath,{provider:e,subject:t});return await this.getAuthenticatedUser()??m.convertUserResponseToUser(r)}catch(e){throw j.formatPrivyError(e)}}async unlinkFarcaster(e){try{let t=await this.api.post(ke.unlinkFarcasterPath,{fid:e});return await this.getAuthenticatedUser()??m.convertUserResponseToUser(t)}catch(e){throw j.formatPrivyError(e)}}async unlinkTelegram(e){try{let t=await this.api.post(ke.telegramAccountUnlinkPath,{telegram_user_id:e});return await this.getAuthenticatedUser()??m.convertUserResponseToUser(t)}catch(e){throw j.formatPrivyError(e)}}async unlinkPasskey(e){try{let t=await this.api.post(ke.unlinkPasskeyPath,{credential_id:e});return await this.getAuthenticatedUser()??m.convertUserResponseToUser(t)}catch(e){throw j.formatPrivyError(e)}}async revokeDelegatedWallet(){try{await this.api.post(ke.delegatedActionsRevokePath,{})}catch(e){throw j.formatPrivyError(e)}}async createAnalyticsEvent({eventName:e,payload:t,timestamp:r,options:a}){if("undefined"!=typeof window)try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(ke.analyticsEventsPath,{event_name:e,client_id:this.clientAnalyticsId,payload:{...t||{},clientTimestamp:r?r.toISOString():(new Date).toISOString()}},{retry:-1,keepalive:a?.keepAlive??!1})}catch(e){}}async signMoonpayOnRampUrl(e){try{return this.api.post(ke.moonpayPluginOnRampPath,e)}catch(e){throw j.formatPrivyError(e)}}async initCoinbaseOnRamp(e){try{return this.api.post(ke.coinbaseOnRampInitPath,e)}catch(e){throw j.formatPrivyError(e)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`${ke.coinbaseOnRampStatusPath}?partnerUserId=${e}`)}catch(e){throw j.formatPrivyError(e)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(Ue.AccessTokenTypes.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(Ue.AccessTokenTypes.PRIVY,e)}async _getToken(e,t){return this.session.getToken(e)?this.session.hasActiveAccessToken(e)?this.session.hasRefreshCredentials(e)?v.AccessToken.parse(this.session.getToken(e))?.appId!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null):!t?.disableAutoRefresh&&this.session.hasRefreshCredentials(e)?(await this.session.refresh(),this.session.getToken(e)):null:null}async getSmartWalletsConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:e});return r.enabled?{enabled:r.enabled,smartWalletType:r.smart_wallet_type,configuredNetworks:r.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:Se.getPaymasterContext(e.paymaster_url,e.paymaster_context)})))}:{enabled:r.enabled}}catch(e){throw j.formatPrivyError(e)}}async getServerConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:e}),a=r.telegram_auth_config?{botId:r.telegram_auth_config.bot_id,botName:r.telegram_auth_config.bot_name,linkEnabled:r.telegram_auth_config.link_enabled,seamlessAuthEnabled:r.telegram_auth_config.seamless_auth_enabled}:void 0,n=r.funding_config?{methods:r.funding_config.methods,options:r.funding_config.options,defaultRecommendedAmount:r.funding_config.default_recommended_amount,defaultRecommendedCurrency:r.funding_config.default_recommended_currency,promptFundingOnWalletCreation:r.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:r.funding_config.cross_chain_bridging_enabled}:void 0;return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,solanaWalletAuth:r.solana_wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,spotifyOAuth:r.spotify_oauth,instagramOAuth:r.instagram_oauth,tiktokOAuth:r.tiktok_oauth,linkedinOAuth:r.linkedin_oauth,appleOAuth:r.apple_oauth,farcasterAuth:r.farcaster_auth,passkeyAuth:r.passkey_auth,telegramAuth:r.telegram_auth,disablePlusEmails:r.disable_plus_emails,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:r.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:r.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:r.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:r.privacy_policy_url,requireUsersAcceptTerms:r.require_users_accept_terms,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,fiatOnRampEnabled:r.fiat_on_ramp_enabled,captchaEnabled:r.captcha_enabled,captchaSiteKey:r.captcha_site_key,createdAt:new Date(1e3*r.created_at),updatedAt:new Date(1e3*r.updated_at),mfaMethods:r.mfa_methods,enforceWalletUis:r.enforce_wallet_uis,legacyWalletUiConfig:r.legacy_wallet_ui_config,telegramAuthConfiguration:a,fundingConfig:n}}catch(e){throw j.formatPrivyError(e)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch(t){return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch(e){return void console.error("Unable to fetch token price for SOL")}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:e,captchaToken:t}){try{return(await this.api.post(ke.siweInitPath,{address:e,token:t})).nonce}catch(e){throw j.formatPrivyError(e)}}async authenticateWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n,mode:i}){return await this.api.post(ke.siweAuthenticatePath,{message:e,signature:t,chainId:r,walletClientType:a,connectorType:n,mode:i})}async linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}){return await this.api.post(ke.siweLinkPath,{message:e,signature:t,chainId:r,walletClientType:a,connectorType:n})}async linkSmartWallet({message:e,signature:t,smartWalletType:r}){try{let a=await this.api.post(ke.smartWalletLinkPath,{message:e,signature:t,smart_wallet_type:r});return m.convertUserResponseToUser(a)}catch(e){throw j.formatPrivyError(e)}}async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}){try{let i=await this.linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n});return m.convertUserResponseToUser(i)}catch(e){throw j.formatPrivyError(e)}}async generateSiwsNonce({address:e,captchaToken:t}){try{return(await this.api.post(ke.siwsInitPath,{address:e,token:t})).nonce}catch(e){throw j.formatPrivyError(e)}}async authenticateWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a,mode:n}){return await this.api.post(ke.siwsAuthenticatePath,{message:e,signature:t,walletClientType:r,connectorType:a,mode:n})}async sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o}){try{let s,l;switch(r){case"email":s=ke.transferEmailPath,l={nonce:e,email:t};break;case"sms":s=ke.transferPhonePath,l={nonce:e,phoneNumber:t};break;case"siwe":if(s=ke.transferWalletPath,!a)throw Error("Wallet parameters must be defined");l={nonce:e,address:t,...a};break;case"farcaster":s=ke.transferFarcasterPath,l={nonce:e,farcaster_id:t,farcaster_embedded_address:i};break;case"telegram":s=ke.telegramAccountTransferPath,l={nonce:e,telegram_auth_result:n};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:s=ke.transferOAuthPath,l={nonce:e,userInfo:o}}let c=await this.api.post(s,l);return await this.getAuthenticatedUser()??m.convertUserResponseToUser(c)}catch(e){throw j.formatPrivyError(e)}}async linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a}){return await this.api.post(ke.siwsLinkPath,{message:e,signature:t,walletClientType:r,connectorType:a})}async linkWithSiws({message:e,signature:t,walletClientType:r,connectorType:a}){try{let n=await this.linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a});return m.convertUserResponseToUser(n)}catch(e){throw j.formatPrivyError(e)}}constructor({apiUrl:e=f.DEFAULT_PRIVY_API_URL,appId:t,appClientId:r,timeout:a=f.DEFAULT_API_TIMEOUT_MS}){Object.defineProperty(this,xe,{value:je}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==f.DEFAULT_PRIVY_API_URL&&e.startsWith("https://privy."),this.timeout=a,this.appId=t,this.appClientId=r,this.clientAnalyticsId=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}(this,xe)[xe](),Le||(Le=new Ue.Session),this.session=Le,this.api=this.generateApi(),this.session.client=this}}function je(){if("undefined"==typeof window)return null;try{let e=C.default.get(f.CLIENT_ANALYTICS_ID_KEY);if("string"==typeof e&&e.length>0)return e}catch(e){}let e=E.v4();try{return C.default.put(f.CLIENT_ANALYTICS_ID_KEY,e),e}catch(t){return e}}class Be{async handleSignMessage(e){if(!e.params||"string"!=typeof e.params.message)throw Error("Message must be provided as a string for Solana signMessage RPC");return await rt({message:e.params.message,address:this.address})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await Xe())throw Error("User must be authenticated to use embedded Solana wallet");if(!await tt())throw new j.PrivyClientError("Unable to connect to Solana embedded wallet");if("signMessage"===e.method)return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}constructor(e,t){this.walletProxy=e,this.address=t}}let He,Ke,Ve,Ge,ze,Ye,$e;async function Xe(){return He?He.getAccessToken():Promise.resolve(C.default.get(f.PRIVY_ACCESS_TOKEN_STORAGE_KEY)||C.default.get(f.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY)||null)}const Je=(e,t,r)=>Ke(e,t,r),Qe=(e,t,r)=>Ve(e,t,r),Ze=(e,t,r,a)=>Ge(e,t,r,a),et=()=>ze(),tt=()=>Ye(),rt=({message:e,address:t})=>$e({message:e,address:t});let at=E=>{let v=E.client,g=ne.usePlugins(),[A,_]=n.useState(!1),[T,fe]=n.useState(!1),[Ce,Pe]=n.useState(!1),[Ae,_e]=n.useState(null),[Te,We]=n.useState([]),[Ie,Se]=n.useState([]),[Ne,ke]=n.useState([]),Ue=n.useRef(Te),[be,Oe]=n.useState(!1),[Re,De]=n.useState(null),[Me,Le]=n.useState(!1),[Fe,xe]=n.useState({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:de.notImplemented}),[qe,je]=n.useState({status:"initial"}),[Je,Qe]=n.useState({status:"initial"}),[Ze,et]=n.useState({status:"initial"}),[tt,rt]=n.useState({status:"initial"}),[at,nt]=n.useState({status:"initial"}),[it,ot]=n.useState(null),st=N.useAppConfig(),lt=N.useIsServerConfigLoaded(),[ct,dt]=n.useState(!0),[ut,ht]=n.useState({}),[yt,pt]=n.useState(null),[wt,Et]=n.useState(null),[vt,mt]=n.useState(!1),[gt,ft]=n.useState(!1),[Ct,Pt]=n.useState(st.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),At=n.useRef(null),_t=n.useRef(null),Tt=n.useRef(he.privyEventsDefault),[Wt,It]=n.useState(!1);v.onStoreCustomerAccessToken=e=>{e&&he.emitPrivyEvent(Tt,"accessToken","onAccessTokenGranted",e)},v.onDeleteCustomerAccessToken=()=>{_e(null),Pe(!1),he.emitPrivyEvent(Tt,"accessToken","onAccessTokenRemoved")};let St=n.useRef(null),Nt=n.useRef(null),kt=n.useRef(!1),Ut=({showWalletUIs:e,typedData:t})=>kt.current?kt.current:void 0!==e?!e:void 0!==st.embeddedWallets.showWalletUIs?!st.embeddedWallets.showWalletUIs:t?st.embeddedWallets.noPromptOnSignature||(st.legacyWalletUiConfig??!1):!!st.embeddedWallets.noPromptOnSignature,bt=e=>{De(e),setTimeout((()=>{_(!0)}),15),v.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:e}})},Ot=e=>{"off"!==st.embeddedWallets.createOnLogin&&dt(!0),bt(e)};n.useEffect((()=>{let e=[...m.getPrivySolanaHDWallets(Ae),m.getImportedPrivySolanaWallet(Ae)].filter((e=>!!e));it&&ke(e.map((e=>({type:"solana",imported:e.imported,address:e.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",walletIndex:e.walletIndex??void 0,meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund(){throw new j.PrivyClientError("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:()=>{throw new j.PrivyClientError("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new Be(it,e.address),async signMessage(t){let r=await Xe();if(!r||!it)throw new j.PrivyClientError("Must have valid access token and Privy wallet to send transaction",j.PrivyErrorCode.MUST_BE_AUTHENTICATED);let a=e.imported?m.getImportedPrivySolanaWallet(Ae):m.getPrivyPrimaryWallet(Ae);if(!a)throw new j.PrivyClientError("Attempting to sign a transaction without a root wallet");let{entropyId:n,entropyIdVerifier:i}=m.getEntropyDetailsFromAccount(a);if(!await or.recoverPrimaryWallet().catch((()=>!1)))throw new j.PrivyClientError("Wallet couldn't be connected",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR);if(!Ae)throw new j.PrivyClientError("Attempting to sign a transaction with no user initialized");let{response:o}=await it.rpc({accessToken:r,entropyId:n,entropyIdVerifier:i,chainType:"solana",hdWalletIndex:this.walletIndex??0,request:{method:"signMessage",params:{message:Buffer.from(t).toString("base64")}}});return Buffer.from(o.data.signature,"base64")},async sendTransaction(e,t,r){let{signature:a}=await Zt({transaction:e,connection:t,transactionOptions:r,wallet:this});return a},async signTransaction(t){let r=await Xe();if(!r||!it)throw new j.PrivyClientError("Must have valid access token and Privy wallet to send transaction",j.PrivyErrorCode.MUST_BE_AUTHENTICATED);if(!await or.recoverPrimaryWallet().catch((()=>!1)))throw new j.PrivyClientError("Wallet couldn't be connected",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR);let{entropyId:a,entropyIdVerifier:n}=m.getEntropyDetailsFromAccount(e);return await B.signSolanaTransaction({tx:t,accessToken:r,walletProxy:it,entropyId:a,entropyIdVerifier:n,transactingWalletAddress:this.address,transactingWalletIndex:this.walletIndex??0}),t},loginOrLink:async()=>{throw new j.PrivyClientError("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{},isConnected:async()=>!0}))))}),[it,Ae]),n.useEffect((()=>{if(!Ae)return void v.connectors?.removeEmbeddedWalletConnectors();let e=m.getPrivyEthereumWallet(Ae),t=m.getPrivyEthereumHDWallets(Ae),r=m.getImportedPrivyEthereumWallet(Ae);e&&t.length||v.connectors?.removeEmbeddedWalletConnectors(),r||v.connectors?.removeImportedWalletConnector(),v.connectors?it?(e&&v.connectors.addEmbeddedWalletConnectors({walletProxy:it,rootWallet:e,embeddedWallets:t,defaultChain:st.defaultChain,appId:E.appId}),r&&v.connectors.addImportedWalletConnector(it,r.address,st.defaultChain,E.appId)):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")}),[it,Ae]),n.useEffect((()=>{it&&wt?.(it)}),[it]);let Rt=n.useRef();n.useEffect((()=>{(async()=>{if(!st.customAuth?.enabled)return void Pt({status:"not-enabled"});dt(!0);let{getCustomAccessToken:e,isLoading:t}=st.customAuth;if(T&&!t&&"loading"!==Ct.status){Pt({status:"loading"});try{let t=await e();if(t===Rt.current)return void Pt({status:"done"});if(!t&&Ce)return Rt.current=t,await ir.logout(),Pt({status:"done"}),void he.emitPrivyEvent(Tt,"customAuth","onUnauthenticated");if(!t)return Rt.current=t,void Pt({status:"done"});v.startAuthFlow(new s.CustomJwtAccountFlow(t));let{user:r,isNewUser:a}=await v.authenticate();if(!r)return await ir.logout(),Pt({status:"error",error:new j.PrivyClientError("Failed to sync with custom auth provider")}),void he.emitPrivyEvent(Tt,"customAuth","onUnauthenticated");void 0!==a&&he.emitPrivyEvent(Tt,"login","onComplete",r,a,!1,"custom",null),Rt.current=t,he.emitPrivyEvent(Tt,"customAuth","onAuthenticated",{user:r}),Pt({status:"done"}),_e(r||null),Oe(a||!1),Pe(!0),ft(!0)}catch(e){if(console.warn(e),await ir.logout(),he.emitPrivyEvent(Tt,"customAuth","onUnauthenticated"),"User already exists with provided custom JWT account."===e.message)return void Pt({status:"initial"});he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),Pt({status:"error",error:e})}}})()}),["initial"===Ct.status,st.customAuth?.enabled,st.customAuth?.getCustomAccessToken,st.customAuth?.isLoading,T,Ce]),n.useEffect((()=>{gt&&it&&Ae&&m.shouldProceedtoEmbeddedWalletCreationFlow(Ae,st.embeddedWallets.createOnLogin)&&(ft(!1),zt(Ae,f.WALLET_PROXY_TIMEOUT).catch(console.error))}),[gt&&it&&Ae]),n.useEffect((()=>{if(st.externalWallets.solana.connectors)return st.externalWallets.solana.connectors.onMount(),()=>st.externalWallets.solana.connectors?.onUnmount()}),[st.externalWallets.solana.connectors]),n.useEffect((()=>{!T&<&&async function(){let e,t=Dt(),r=Mt();(()=>{let e=new URLSearchParams(window.location.search).get("privy_token");if(!e)return;C.default.put(f.FORKED_TOKEN_STORAGE_KEY,e);let t=new URL(window.location.href);t.searchParams.delete("privy_token"),window.history.pushState({},"",t)})();let n=a.createStore();v.initializeConnectorManager({walletConnectCloudProjectId:st.walletConnectCloudProjectId,rpcConfig:st.rpcConfig,chains:st.chains,defaultChain:st.defaultChain,store:n,walletList:st.appearance.walletList,shouldEnforceDefaultChainOnConnect:st.shouldEnforceDefaultChainOnConnect,externalWalletConfig:st.externalWallets,appName:st.name??"Privy",walletChainType:st.appearance.walletChainType}),v.connectors?.on("connectorInitialized",(()=>{e&&clearTimeout(e);let t=v.connectors.walletConnectors.length,r=v.connectors.walletConnectors.reduce(((e,t)=>e+(t.initialized?1:0)),0);r===t?It(!0):e=setTimeout((()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:r,expected:t}),It(!0)}),1500)})),v.connectors?.initialize().then((()=>{jt()}));let i=await v.getAuthenticatedUser(),o=!!i;st.legal.requireUsersAcceptTerms&&i&&!i.hasAcceptedTerms?(await v.logout(),or.setReadyToTrue(!0),he.emitPrivyEvent(Tt,"logout","onSuccess")):(st.customAuth?.enabled||(Pe(!!i),i&&he.emitPrivyEvent(Tt,"login","onComplete",i,!1,!0,null,null),_e(i)),t?Nt.current=o?"link":"login":r&&!o?(Nt.current="login",ht({telegramAuthModalData:{seamlessAuth:!0}}),Ot(se.ModalScreen.TELEGRAM_AUTH_SCREEN)):or.setReadyToTrue(!!i))}()}),[v,yt,T,lt]),n.useEffect((()=>{if(T){if(!Ae||!Ae.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType)))return void mt(!0);mt(!!Te.find((e=>"privy"===e.walletClientType)))}}),[T,Ae,Te]);let Dt=()=>{let e=me.detectCompletingOAuthFlow();return e.inProgress&&e.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):"error"===e.authorizationCode?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}):(e.inProgress&&K.isPrivyTheOAuthProvider(e.provider)&&!e.popupFlow&&(new BroadcastChannel(K.CROSS_APP_BROADCAST_CHANNEL_NAME).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}),window.close()),!!e.inProgress&&!!e.withPrivyUi&&(v.startAuthFlow(new ge.OAuthFlow(e)),Ot(se.ModalScreen.AWAITING_OAUTH_SCREEN),!0))},Mt=()=>{let e=w.detectCompletingTelegramFlow();if(!e||!st.loginMethods.telegram||!st.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let t=new w.TelegramAuthFlow;return v.startAuthFlow(t),"login-url"===e.flowType&&(t.meta.telegramWebAppData=void 0,t.meta.telegramAuthResult=e.authData),"web-app"===e.flowType&&(t.meta.telegramAuthResult=void 0,t.meta.telegramWebAppData=e.authData),!0},Lt=async(e,t,r,a)=>{Ft(await(v.connectors?.createEthereumWalletConnector(e,t))||null,t,r,a)};async function Ft(e,t,r,a){if(!e)return xe({status:"disconnected",connectedWallet:null,connectError:new j.PrivyConnectorError("Unable to connect to wallet."),connector:null,connectRetry:de.notImplemented}),a?.(null,r);xe({status:"disconnected",connectedWallet:null,connectError:null,connector:e,connectRetry:de.notImplemented}),e instanceof M.WalletConnectV2WalletConnector&&t&&await e.resetConnection(t),xe({connector:e,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ft(e,t,r,a)});try{let t=await e.connect({showPrompt:!0});if((!t||O.isBaseConnectedEthereumWallet(t))&&st.shouldEnforceDefaultChainOnConnect&&!st.chains.find((e=>e.id===Number(t?.chainId.replace("eip155:",""))))&&("wallet_connect_v2"!==t?.connectorType||"metamask"!==t?.walletClientType)){xe((t=>({...t,connector:e,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:de.notImplemented})));try{await(t?.switchChain(st.defaultChain.id)),t&&(t.chainId=P.formatChainIdToCAIP2(P.toHex(st.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${st.defaultChain.id}`)}}return xe((e=>({...e,status:"connected",connectedWallet:t,connectError:null,connectRetry:de.notImplemented}))),t&&he.emitPrivyEvent(Tt,"connectWallet","onSuccess",(e.chainType,t)),a?.(t,r)}catch(e){return e instanceof j.PrivyError?(console.warn(e.cause?e.cause:e.message),he.emitPrivyEvent(Tt,"connectWallet","onError",e.privyErrorCode||j.PrivyErrorCode.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),he.emitPrivyEvent(Tt,"connectWallet","onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR)),xe((t=>({...t,status:"disconnected",connectedWallet:null,connectError:e}))),a?.(null,r)}}let xt=async(e,t,r)=>{if(null===e||!O.isBaseConnectedEthereumWallet(e))return;let a=new h.SiweFlow(e,v,t,r);v.startAuthFlow(a)},qt=async(e,t)=>{if(null===e||!D.isBaseConnectedSolanaWallet(e))return;let r=new y.SiwsFlow(e,v,t);v.startAuthFlow(r)},jt=()=>{let e=new URLSearchParams(window.location.search),t=e.get("privy_connector"),r=e.get("privy_wallet_client");if(!t||!r)return;if("phantom"!==r||b.isPhantomInstalled()||Ot(se.ModalScreen.LOGIN_FAILED_SCREEN),!v.connectors)throw new j.PrivyClientError("Connector not initialized");bt(se.ModalScreen.AWAITING_CONNECTION);let a=new URL(window.location.href);a.searchParams.delete("privy_connector"),a.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",a),Lt(t,r,void 0,xt)};n.useEffect((()=>{T&&Ce&&null===Ae&&v.getAuthenticatedUser().then(_e)}),[T,Ce,Ae,v]);let Bt=e=>{if(!Ce)throw he.emitPrivyEvent(Tt,"linkAccount","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:e}),new j.PrivyClientError("User must be authenticated before linking an account.")},Ht=()=>{Bt("siwe"),St.current="siwe",Nt.current="link",bt(se.ModalScreen.LINK_WALLET_SCREEN)},Kt=e=>{if(!Ce||!Ae)return!1;if("privy"===e.walletClientType)return!0;for(let t of Ae.linkedAccounts)if("wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType)return!0;return!1},Vt=async e=>{let t;if(!v.connectors)throw new j.PrivyClientError("Connector not initialized");t="ethereum"===e.type?v.connectors.findWalletConnector(e.connectorType,e.walletClientType)||null:v.connectors.findSolanaWalletConnector(e.connectorType,e.walletClientType)||null,xe((r=>({...r,connector:t,status:"connected",connectedWallet:e,connectError:null,connectRetry:de.notImplemented}))),st.captchaEnabled&&!Ce?(ht({captchaModalData:{callback:t=>O.isBaseConnectedEthereumWallet(e)?xt(e,t):qt(e,t),userIntentRequired:!1,onSuccessNavigateTo:se.ModalScreen.AWAITING_CONNECTION,onErrorNavigateTo:se.ModalScreen.ERROR_SCREEN}}),Ot(se.ModalScreen.CAPTCHA_SCREEN)):(O.isBaseConnectedEthereumWallet(e)?await xt(e):await qt(e),Ot(se.ModalScreen.AWAITING_CONNECTION))},Gt=()=>{We((e=>{let t=v.connectors?.wallets.filter(O.isBaseConnectedEthereumWallet).map((e=>({...e,linked:Kt(e),loginOrLink:async()=>{if(!await e.isConnected())throw new j.PrivyClientError("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new j.PrivyClientError("Cannot link or login with embedded wallet");Vt(e)},fund:async t=>{await or.fundWallet(e.address,t)},unlink:async()=>{if(!Ce)throw new j.PrivyClientError("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new j.PrivyClientError("Cannot unlink an embedded wallet");_e(await v.unlinkEthereumWallet(e.address))}})))||[];return k.areWalletArraysEqual(e,t)?e:t})),Se((e=>{let t=(v.connectors?.wallets??[]).concat(Ne).filter(D.isBaseConnectedSolanaWallet).map((e=>({...e,linked:Kt(e),loginOrLink:async()=>{if(!await e.isConnected())throw new j.PrivyClientError("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new j.PrivyClientError("Cannot link or login with embedded wallet");Vt(e)},fund:async()=>{throw new j.PrivyClientError("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:async()=>{if(!Ce)throw new j.PrivyClientError("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new j.PrivyClientError("Cannot unlink an embedded wallet");_e(await v.unlinkSolanaWallet(e.address))}})));return k.areWalletArraysEqual(e,t)?e:t}))};n.useEffect((()=>{Gt()}),[Ae?.linkedAccounts,Ce,T,Ne]),n.useEffect((()=>{if(T){if(!v.connectors)throw new j.PrivyClientError("Connector not initialized");Gt(),v.connectors.on("walletsUpdated",Gt)}}),[T]),n.useEffect((()=>{[...st.loginMethodsAndOrder?.primary??[],...st.loginMethodsAndOrder?.overflow??[]].filter((e=>e.startsWith("privy:"))).forEach((e=>v.getCrossAppProviderDetails(e.replace("privy:",""))))}),[!!v]),n.useEffect((()=>{let e;if(!Te[0])return;let t=Te[0],r=Ue.current.find((e=>e.address===t.address));if(e="privy"===t.walletClientType?Ae?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"===e.walletClientType)):Ae?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"!==e.walletClientType)),!r&&e){let t=Object.assign({},Ae);t.wallet=e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,imported:e.imported,delegated:e.delegated,walletIndex:e.walletIndex},_e(t)}Ue.current=Te}),[Te]);let zt=async(e,t,r)=>{let a=m.getPrivyEthereumWallet(e),n=m.getPrivySolanaWallet(e);if(r&&"walletIndex"in r)return $t(e,t,r.walletIndex,a,n);let i=r&&"createAdditional"in r&&r.createAdditional;if(a&&!i)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");let[o,s]=await Promise.all([or.initializeWalletProxy(t),Xe()]);if(!o&&st.customAuth?.enabled)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!o||!s||st.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return Yt();if(!a)return await o.create({accessToken:s,solanaAddress:n?.address}),Jt(0,"ethereum");{let t=(m.getLatestPrivyEthereumWallet(e)?.walletIndex??0)+1,{entropyId:r,entropyIdVerifier:a}=m.getEntropyDetailsFromAccount(m.getPrivyPrimaryWallet(e));return await or.recoverPrimaryWallet(),await o.addWallet({accessToken:s,entropyId:r,entropyIdVerifier:a,chainType:"ethereum",hdWalletIndex:t}),Jt(t,"ethereum")}},Yt=async()=>new Promise(((e,t)=>{dt(!0),ht({createWallet:{onSuccess:t=>{he.emitPrivyEvent(Tt,"createWallet","onSuccess",t),e(t)},onFailure:e=>{he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),t(e)},callAuthOnSuccessOnClose:!1}}),bt(se.ModalScreen.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)})),$t=async(e,t,r,a,n)=>{if(r<0)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${r}) is invalid.`);let[i,o]=await Promise.all([or.initializeWalletProxy(t),Xe()]);if(!i&&st.customAuth?.enabled)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!i||!o||st.embeddedWallets?.requireUserOwnedRecoveryOnCreate){if(0==r)return Yt();throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Create wallet UI can only be displayed when walletIndex is 0.")}if(0==r){if(a)return a;await i.create({accessToken:o,solanaAddress:n?.address})}else{if(!a)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error("A user must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let t=m.getPrivyEthereumHDWallets(e).find((e=>e.walletIndex===r));if(t)return t;let{entropyId:n,entropyIdVerifier:s}=m.getEntropyDetailsFromAccount(m.getPrivyPrimaryWallet(e));await or.recoverPrimaryWallet(),await i.addWallet({accessToken:o,entropyId:n,entropyIdVerifier:s,chainType:"ethereum",hdWalletIndex:r})}return Jt(r,"ethereum")},Xt=async({user:e,wp:t,accessToken:r,walletIndex:a,ethereumWallet:n})=>{let i=m.getPrivySolanaHDWallets(e).find((e=>e.walletIndex===a));if(i)return i;if(0===a)await t.createSolana({accessToken:r,ethereumAddress:n?.address});else{let n=m.getPrivyPrimaryWallet(e);if(!n)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error("User must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let{entropyId:i,entropyIdVerifier:o}=m.getEntropyDetailsFromAccount(n);await or.recoverPrimaryWallet(),await t.addWallet({accessToken:r,entropyId:i,entropyIdVerifier:o,chainType:"solana",hdWalletIndex:a})}return Jt(a,"solana")},Jt=async(e,t)=>{let r=await or.refreshUser(),a=("ethereum"===t?m.getPrivyEthereumHDWallets(r):m.getPrivySolanaHDWallets(r)).find((t=>t.walletIndex===e));if(!a)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");return he.emitPrivyEvent(Tt,"createWallet","onSuccess",a),a},Qt=(e,r,a,n)=>new Promise((async(i,s)=>{let{requesterAppId:l}=r||{};if(!Ce||!Ae)return he.emitPrivyEvent(Tt,"sendTransaction","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED),void s(Error("User must be authenticated before signing with a Privy wallet"));let c=n??m.getPrivyEthereumWallet(Ae)?.address;if(!c)throw new j.PrivyClientError("User must have an embedded wallet to send a transaction.");let{signingWallet:d,rootWallet:u}=m.getEthereumSigningAndRootWallet(Ae,c);if(!u||!d)return he.emitPrivyEvent(Tt,"sendTransaction","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),void s(Error("Must have a Privy wallet before signing"));dt(!0);let h=sr.wallets.find((e=>"privy"===e.walletClientType&&t.getAddress(e.address)===t.getAddress(d.address))),y=await(h?.getEthereumProvider());if(!h||!y)throw new j.PrivyClientError(`Cannot sendTransaction before embedded wallet ${d.address} is connected`);let p=e.chainId?Number(e.chainId):H.extractChainIdFromCAIP2(h.chainId);(e=>{if(!st.chains.map((e=>e.id)).includes(e))throw new j.PrivyConnectorError(`Chain ID ${e} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,j.PrivyErrorCode.UNSUPPORTED_CHAIN_ID)})(p);let w=Object.assign({},e,{chainId:p});if(Ut({showWalletUIs:r?.showWalletUIs}))(async()=>{let e=await Xe();if(!e||!it)return he.emitPrivyEvent(Tt,"sendTransaction","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),void s(Error("Must have valid access token and Privy wallet to send transaction"));try{if(!await or.recoverPrimaryWallet())return he.emitPrivyEvent(Tt,"sendTransaction","onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR),void s(Error("Unable to connect to wallet"));let t=P.getJsonRpcProvider(w.chainId,st.chains,st.rpcConfig,{appId:E.appId}),a=await o.populateTransactionRequest(d.address,w,t);if(Ut({showWalletUIs:r?.showWalletUIs})){let{totalGasEstimate:e}=await o.calculateTotalGasEstimate(a,t),{hasSufficientFunds:r}=await q.getAndCheckBalance(d.address,a,e,t);if(!r)throw new U.PrivyProviderRpcError(new U.ProviderRpcError("Wallet has insufficient funds for this transaction.",o.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let{entropyId:n,entropyIdVerifier:c}=m.getEntropyDetailsFromAccount(u),h=await q.sendTransaction({accessToken:e,entropyId:n,entropyIdVerifier:c,transactingWallet:d,walletProxy:it,transactionRequest:a,provider:t,requesterAppId:l});he.emitPrivyEvent(Tt,"sendTransaction","onSuccess",h),i(h)}catch(e){he.emitPrivyEvent(Tt,"sendTransaction","onError",j.PrivyErrorCode.TRANSACTION_FAILURE),s(e)}})();else{let{entropyId:e,entropyIdVerifier:t}=m.getEntropyDetailsFromAccount(u),n={entropyId:e,entropyIdVerifier:t,onCompleteNavigateTo:se.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:e=>{he.emitPrivyEvent(Tt,"sendTransaction","onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR),s(e)}},o=X.isFundingEnabled(st)?ve.prepareFundingModalData({address:d.address,appConfig:st,fundWalletConfig:a,methodScreen:se.ModalScreen.FUNDING_METHOD_SELECTION_SCREEN,chainIdOverride:w.chainId,comingFromSendTransactionScreen:!0}):void 0;ht({connectWallet:n,sendTransaction:{transactionRequest:w,transactingWallet:d,entropyId:e,entropyIdVerifier:t,onSuccess:e=>{he.emitPrivyEvent(Tt,"sendTransaction","onSuccess",e),i(e)},onFailure:e=>{he.emitPrivyEvent(Tt,"sendTransaction","onError",j.PrivyErrorCode.TRANSACTION_FAILURE),s(e)},uiOptions:r||{},fundWalletConfig:a,requesterAppId:l},funding:o}),bt(se.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),Zt=({transaction:e,connection:t,transactionOptions:r,fundWalletConfig:a,uiOptions:n,wallet:i})=>new Promise((async(o,s)=>{let{requesterAppId:l}=n||{};if(!Ce||!Ae)return he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED),void s(new j.PrivyClientError("User must be authenticated before signing with a Privy wallet",j.PrivyErrorCode.MUST_BE_AUTHENTICATED));let c=i?Ae.linkedAccounts.find((e=>"wallet"===e.type&&e.address===i.address)):m.getPrivySolanaWallet(Ae);if(!c)return he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),void s(new j.PrivyClientError("Must have a Privy wallet before signing",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND));dt(!0);let{rootWallet:d}=m.getSolanaSigningAndRootWallet(Ae,c.address);if(!await or.recoverPrimaryWallet().catch((()=>!1))||!d)throw he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),new j.PrivyClientError(`Cannot sendSolanaTransaction before embedded wallet ${c.address} is connected`,j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND);if(Ut({showWalletUIs:n?.showWalletUIs}))(async()=>{let a=await Xe();if(!a||!it)return he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),void s(new j.PrivyClientError("Must have valid access token and Privy wallet to send transaction",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND));try{if(!await or.recoverPrimaryWallet())return he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR),void s(new j.PrivyClientError("Unable to connect to wallet",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR));if(Ut({showWalletUIs:n?.showWalletUIs})){let{instructions:r}=await te.decodeSolanaTransaction(e,t);r.every((e=>e.hasFunds))||(he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.INSUFFICIENT_BALANCE),s(new j.PrivyClientError("Solana wallet has insufficient funds for this transaction.",j.PrivyErrorCode.INSUFFICIENT_BALANCE)))}let{entropyId:i,entropyIdVerifier:l}=m.getEntropyDetailsFromUser(Ae),{signature:d,receipt:u}=await B.sendSolanaTransaction({accessToken:a,tx:e,connection:t,walletProxy:it,transactionOptions:r,entropyId:i,entropyIdVerifier:l,transactingWalletAddress:c.address,transactingWalletIndex:c.walletIndex??0}),h=te.createSolanaTransactionReceipt(d,u);he.emitPrivyEvent(Tt,"sendSolanaTransaction","onSuccess",h),o(h)}catch(e){he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.TRANSACTION_FAILURE),s(e)}})();else{let{entropyId:i,entropyIdVerifier:u}=m.getEntropyDetailsFromAccount(d),h={entropyId:i,entropyIdVerifier:u,onCompleteNavigateTo:se.ModalScreen.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN,onFailure:e=>{he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR),s(e)}},y=X.isFundingEnabled(st)?ve.prepareSolanaFundingModalData({address:c.address,appConfig:st,methodScreen:se.ModalScreen.FUNDING_METHOD_SELECTION_SCREEN,fundWalletConfig:a,comingFromSendTransactionScreen:!0}):void 0;ht({connectWallet:h,sendSolanaTransaction:{transactionRequest:e,connection:t,transactionOptions:r,transactingWallet:c,onSuccess:e=>{he.emitPrivyEvent(Tt,"sendSolanaTransaction","onSuccess",e),o(e)},onFailure:e=>{he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.TRANSACTION_FAILURE),s(e)},uiOptions:n||{},requesterAppId:l},funding:y}),bt(se.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)}}));function er(){return new Promise((async(e,t)=>{let r=await Xe();if(!r||!it)throw Error("Must have valid access token to enroll in MFA");try{await it.verifyMfa({accessToken:r}),e()}catch(e){t(e)}}))}let tr=e=>e?.linkedAccounts.filter((e=>null!==e.latestVerifiedAt&&!("wallet"===e.type&&"privy"===e.walletClientType))).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0],rr=e=>{let t=Ae?.linkedAccounts.filter((t=>t.type===e)).length??0,{displayName:r,loginMethod:a}=re.toDisplayFromAccountType(e);if("passkey"===e&&t>=5||"passkey"!==e&&t>=1)throw he.emitPrivyEvent(Tt,"linkAccount","onError",j.PrivyErrorCode.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:a}),new j.PrivyClientError(`User already has an account of type ${r} linked.`)};async function ar({showAutomaticRecovery:e=!1,legacySetWalletPasswordFlow:t=!1}){De(null);let r=t?"setWalletPassword":"setWalletRecovery";if(!Ce||!Ae)throw he.emitPrivyEvent(Tt,r,"onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let a=m.getPrivyPrimaryWallet(Ae);if(!a||!it)throw he.emitPrivyEvent(Tt,r,"onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");try{await er()}catch(e){throw he.emitPrivyEvent(Tt,r,"onError",j.PrivyErrorCode.MISSING_MFA_CREDENTIALS),e}return new Promise(((n,i)=>{dt(!0);let o={onSuccess:e=>{he.emitPrivyEvent(Tt,r,"onSuccess","user-passcode",e),n(e)},onFailure:e=>{he.emitPrivyEvent(Tt,r,"onError",j.PrivyErrorCode.USER_EXITED_SET_PASSWORD_FLOW),i(e)},callAuthOnSuccessOnClose:!1},s="user-passcode"===a.recoveryMethod,l=Y.toEmbeddedWalletSetRecoveryScreen({walletAction:"update",availableRecoveryMethods:st.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:t,isResettingPassword:s,showAutomaticRecovery:e}),{entropyId:c,entropyIdVerifier:d}=m.getEntropyDetailsFromAccount(a);ht({setWalletPassword:o,recoverWallet:{entropyId:c,entropyIdVerifier:d,onFailure:i},createWallet:o,connectWallet:{onCompleteNavigateTo:l,shouldForceMFA:!1,entropyId:c,entropyIdVerifier:d,onFailure:e=>{he.emitPrivyEvent(Tt,r,"onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR),i(e)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:s}}),bt(se.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)}))}async function nr({appId:e,action:t}){let r=await Xe();if("link"===t&&!r)throw he.emitPrivyEvent(Tt,"linkAccount","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${e}`}),new j.PrivyClientError("User must be authenticated before linking an account.");if("login"===t&&r)throw he.emitPrivyEvent(Tt,"login","onError",j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),new j.PrivyClientError("Attempted to log in, but user is already logged in. Use a `link` helper instead.");St.current=`privy:${e}`,Nt.current=t;let a=Q.triggerPopup();return v.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:e}}),new Promise((async(r,n)=>{let{name:i,logoUrl:o}=await V.getProviderAppMetadata({api:v.api,providerAppId:e,requesterAppId:st.id});ht({crossAppAuth:{appId:e,name:i,logoUrl:o,action:t,popup:a,onSuccess:r,onError:n}}),Ot(se.ModalScreen.CROSS_APP_AUTH_SCREEN)}))}let ir={ready:T,authenticated:Ce,user:Ae,walletConnectors:v.connectors||null,connectWallet:e=>{e&&"target"in e&&e&&(e=void 0),ht({externalConnectWallet:{walletList:e?.walletList&&e?.walletList.length>0?e.walletList:void 0,suggestedAddress:e?.suggestedAddress}}),bt(Ce?se.ModalScreen.CONNECT_ONLY_AUTHENTICATED_SCREEN:se.ModalScreen.CONNECT_ONLY_LANDING_SCREEN)},linkWallet:Ht,startCrossAppAuthFlow:nr,linkEmail:()=>{Bt("email"),rr("email"),St.current="email",Nt.current="link",bt(se.ModalScreen.LINK_EMAIL_SCREEN)},linkPhone:()=>{Bt("sms"),rr("phone"),St.current="sms",Nt.current="link",bt(se.ModalScreen.LINK_PHONE_SCREEN)},linkGoogle:async()=>{Bt("google"),rr("google_oauth"),Nt.current="link",await or.initLoginWithOAuth("google")},linkTwitter:async()=>{Bt("twitter"),rr("twitter_oauth"),Nt.current="link",await or.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Bt("discord"),rr("discord_oauth"),Nt.current="link",await or.initLoginWithOAuth("discord")},linkGithub:async()=>{Bt("github"),rr("github_oauth"),Nt.current="link",await or.initLoginWithOAuth("github")},linkSpotify:async()=>{Bt("spotify"),rr("spotify_oauth"),Nt.current="link",await or.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Bt("instagram"),rr("instagram_oauth"),Nt.current="link",await or.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Bt("tiktok"),rr("tiktok_oauth"),Nt.current="link",await or.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Bt("linkedin"),rr("linkedin_oauth"),Nt.current="link",await or.initLoginWithOAuth("linkedin")},linkApple:async()=>{Bt("apple"),rr("apple_oauth"),Nt.current="link",await or.initLoginWithOAuth("apple")},linkPasskey:async()=>{Bt("passkey"),rr("passkey"),await or.initLinkWithPasskey(),bt(se.ModalScreen.LINK_PASSKEY_SCREEN)},linkTelegram:async()=>{Bt("telegram"),rr("telegram"),Nt.current="link",St.current="telegram",await or.initLoginWithTelegram(),bt(se.ModalScreen.TELEGRAM_AUTH_SCREEN)},linkFarcaster:async()=>{Bt("farcaster"),rr("farcaster"),await or.initLoginWithFarcaster(),Nt.current="link",St.current="farcaster",bt(se.ModalScreen.AWAITING_FARCASTER_CONNECTION)},updateEmail:()=>{if(Bt("email"),!Ae?.email)throw new j.PrivyClientError("User does not have an email linked to their account.");Nt.current="update",St.current="email",bt(se.ModalScreen.UPDATE_EMAIL_SCREEN)},updatePhone:()=>{if(Bt("sms"),!Ae?.phone)throw new j.PrivyClientError("User does not have a phone number linked to their account.");Nt.current="update",St.current="sms",bt(se.ModalScreen.UPDATE_PHONE_SCREEN)},login:async e=>{e&&"target"in e&&e&&(e=void 0);let t="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!T){let e=await new Promise((e=>{pt((t=>e.bind(t)))}));if(pt(null),e)return void console.warn(t)}!Ae||Ae.isGuest?(Nt.current="login",ht({login:e}),Ot(se.ModalScreen.LANDING)):console.warn(t)},connectOrCreateWallet:async()=>{T||(await new Promise((e=>{pt((()=>e))})),pt(null)),Ce?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(Nt.current="login",Ot(se.ModalScreen.CONNECT_OR_CREATE))},logout:async()=>{if(Nt.current=null,St.current=null,Ae&&v.clearProviderAcccessTokens(Ae),De(null),await v.logout(),Ae&&it)try{await it.clearMfa({userId:Ae.id})}catch(e){}_e(null),Pe(!1),he.emitPrivyEvent(Tt,"logout","onSuccess"),_(!1),C.default.del(f.CLIENT_ANALYTICS_ID_KEY),C.default.del(f.getGuestCredentialStorageKey(st.id))},getAccessToken:()=>v.getCustomerAccessToken(),getEthereumProvider:()=>{if(!Ae||!Ae.wallet)return new R.PrivyProxyProvider;let e=Te.find((e=>Ae.wallet&&e.address===Ae.wallet.address)),t=v.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new R.PrivyProxyProvider},getEthersProvider:()=>{if(!Ae||!Ae.wallet)return new r.Web3Provider(new R.AsExternalProvider(new R.PrivyProxyProvider));let e=Te.find((e=>Ae.wallet&&e.address===Ae.wallet.address)),t=v.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new r.Web3Provider(new R.AsExternalProvider(e&&t?t.proxyProvider:new R.PrivyProxyProvider))},getWeb3jsProvider:()=>{if(!Ae||!Ae.wallet)return new R.AsAbstractProvider(new R.PrivyProxyProvider);let e=Te.find((e=>Ae.wallet&&e.address===Ae.wallet.address)),t=v.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new R.AsAbstractProvider(e&&t?t.proxyProvider:new R.PrivyProxyProvider)},unlinkWallet:async e=>{let t;return _e(t=e.startsWith("0x")?await v.unlinkEthereumWallet(e):await v.unlinkSolanaWallet(e)),t},unlinkEmail:async e=>{let t=await v.unlinkEmail(e);return _e(t),t},unlinkPhone:async e=>{let t=await v.unlinkPhone(e);return _e(t),t},unlinkGoogle:async e=>{let t=await v.unlinkOAuth("google",e);return _e(t),t},unlinkTwitter:async e=>{let t=await v.unlinkOAuth("twitter",e);return _e(t),t},unlinkDiscord:async e=>{let t=await v.unlinkOAuth("discord",e);return _e(t),t},unlinkGithub:async e=>{let t=await v.unlinkOAuth("github",e);return _e(t),t},unlinkSpotify:async e=>{let t=await v.unlinkOAuth("spotify",e);return _e(t),t},unlinkInstagram:async e=>{let t=await v.unlinkOAuth("instagram",e);return _e(t),t},unlinkTiktok:async e=>{let t=await v.unlinkOAuth("tiktok",e);return _e(t),t},unlinkLinkedIn:async e=>{let t=await v.unlinkOAuth("linkedin",e);return _e(t),t},unlinkApple:async e=>{let t=await v.unlinkOAuth("apple",e);return _e(t),t},unlinkFarcaster:async e=>{let t=await v.unlinkFarcaster(e);return _e(t),t},unlinkTelegram:async e=>{let t=await v.unlinkTelegram(e);return _e(t),t},unlinkPasskey:async e=>{let t=await v.unlinkPasskey(e);return _e(t),t},unlinkCrossAppAccount:async({subject:e})=>{let t=Ae?.linkedAccounts.find((t=>"cross_app"===t.type&&t.subject===e))?.providerApp;if(!t)throw new j.PrivyClientError("Invalid subject");v.storeProviderAccessToken(t.id,null);let r=await v.unlinkOAuth(`privy:${t.id}`,e);return _e(r),r},setActiveWallet:async e=>{let r=Te.find((r=>t.getAddress(r.address)===t.getAddress(e))),a=Ae?.linkedAccounts.find((r=>"wallet"===r.type&&t.getAddress(r.address)===t.getAddress(e)));if(r&&await r.isConnected())if(r.linked){let e=Object.assign({},Ae);e.wallet=a&&{address:a.address,chainType:a.chainType,chainId:a.chainId,walletClient:a.walletClient,walletClientType:a.walletClientType,connectorType:a.connectorType,imported:a.imported,delegated:a.delegated,walletIndex:a.walletIndex},_e(e)}else r.loginOrLink();else ht({externalConnectWallet:{suggestedAddress:e}}),Ht()},forkSession:()=>v.forkSession(),createWallet:async e=>{if(e&&"target"in e&&e&&(e=void 0),!Ce||!Ae)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return zt(Ae,15e3,e)},setWalletRecovery:async e=>ar({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:e?.showAutomaticRecovery??!1}),setWalletPassword:async()=>ar({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(e,t,r)=>new Promise((async(a,n)=>{let{requesterAppId:i}=t||{};if(!Ce||!Ae)return he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED),void n(Error("User must be authenticated before signing with a Privy wallet"));let o=r??m.getPrivyEthereumWallet(Ae)?.address;if(!o)throw new j.PrivyClientError("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:l}=m.getEthereumSigningAndRootWallet(Ae,o);if(!s||!l)return he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),void n(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.INVALID_MESSAGE),void n(Error("Message must be a non-empty string"));dt(!0);let c=async()=>{if(!Ce)throw Error("User must be authenticated before signing with a Privy wallet");let t=await Xe();if(!it||!t||!await or.recoverPrimaryWallet())throw Error("Unable to connect to wallet");v.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:s.address,requesterAppId:i}});let{entropyId:r,entropyIdVerifier:a}=m.getEntropyDetailsFromAccount(l),{response:n}=await it.rpc({accessToken:t,entropyId:r,entropyIdVerifier:a,chainType:"ethereum",hdWalletIndex:s.walletIndex??0,requesterAppId:i,request:{method:"personal_sign",params:[e,s.address]}}),o=n.data;return v.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:s.address,requesterAppId:i}}),o};if(Ut({showWalletUIs:t?.showWalletUIs}))try{let e=await c();he.emitPrivyEvent(Tt,"signMessage","onSuccess",e),a(e)}catch(e){he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.UNABLE_TO_SIGN),n(e??new U.PrivyProviderRpcError("Unable to sign message"))}else{let{entropyId:r,entropyIdVerifier:i}=m.getEntropyDetailsFromAccount(l);ht({signMessage:{method:"personal_sign",data:e,confirmAndSign:c,onSuccess:e=>{he.emitPrivyEvent(Tt,"signMessage","onSuccess",e),a(e)},onFailure:e=>{he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.UNABLE_TO_SIGN),n(e)},uiOptions:t||{}},connectWallet:{entropyId:r,entropyIdVerifier:i,onCompleteNavigateTo:se.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR),n(e)}}}),bt(se.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),signTypedData:(e,t,r)=>new Promise((async(a,n)=>{let{requesterAppId:i}=t||{};if(!Ce||!Ae)return he.emitPrivyEvent(Tt,"signTypedData","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED),void n(Error("User must be authenticated before signing with a Privy wallet"));let o=r??m.getPrivyEthereumWallet(Ae)?.address;if(!o)throw new j.PrivyClientError("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:l}=m.getEthereumSigningAndRootWallet(Ae,o);if(!l||!s)return he.emitPrivyEvent(Tt,"signTypedData","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),void n(Error("Must have a Privy wallet before signing"));dt(!0);let c=P.generateTypedDataWithDomainType(e),d=async()=>{if(!Ce)throw Error("User must be authenticated before signing with a Privy wallet");let e=await Xe();if(!it||!e||!await or.recoverPrimaryWallet())throw Error("Unable to connect to wallet");v.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:s.address,requesterAppId:i}});let{entropyId:t,entropyIdVerifier:r}=m.getEntropyDetailsFromAccount(l),{response:a}=await it.rpc({accessToken:e,entropyId:t,entropyIdVerifier:r,chainType:"ethereum",hdWalletIndex:s.walletIndex??0,requesterAppId:i,request:{method:"eth_signTypedData_v4",params:[s.address,c]}}),n=a.data;return v.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:s.address,requesterAppId:i}}),n};if(Ut({showWalletUIs:t?.showWalletUIs,typedData:!0}))try{let e=await d();he.emitPrivyEvent(Tt,"signTypedData","onSuccess",e),a(e)}catch(e){he.emitPrivyEvent(Tt,"signTypedData","onError",j.PrivyErrorCode.UNABLE_TO_SIGN),n(e??new U.PrivyProviderRpcError("Unable to sign message"))}else{let{entropyId:e,entropyIdVerifier:r}=m.getEntropyDetailsFromAccount(l);ht({signMessage:{method:"eth_signTypedData_v4",data:c,confirmAndSign:d,onSuccess:e=>{he.emitPrivyEvent(Tt,"signTypedData","onSuccess",e),a(e)},onFailure:e=>{he.emitPrivyEvent(Tt,"signTypedData","onError",j.PrivyErrorCode.UNABLE_TO_SIGN),n(e)},uiOptions:t||{}},connectWallet:{entropyId:e,entropyIdVerifier:r,onCompleteNavigateTo:se.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR),n(e)}}}),bt(se.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),sendTransaction:async(e,t,r,a)=>{let n=await Qt(e,t,r,a);return q.formatReceipt(await n.wait())},sendSolanaTransaction:async(e,t,r,a,n,i)=>{let o=i?Ie.find((({address:e})=>e===i)):Ie.slice().sort(((e,t)=>(e.walletIndex??0)-(t.walletIndex??0)))[0];if(!o)throw he.emitPrivyEvent(Tt,"sendSolanaTransaction","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),new j.PrivyClientError("Embedded wallet not found",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND);return await Zt({transaction:e,connection:t,transactionOptions:a,uiOptions:r,fundWalletConfig:n,wallet:o})},exportWallet:e=>new Promise((async(t,r)=>{if(!Ce||!Ae)return void r(Error("User must be authenticated before exporting their Privy wallet"));e&&"target"in e&&e&&(e=void 0);let a=e?.address??m.getPrivyEthereumWallet(Ae)?.address;if(!a)return void r(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));let{signingWallet:n,rootWallet:i}=m.getEthereumSigningAndRootWallet(Ae,a);if(!n||!i)return void r(Error("Must have a Privy wallet before exporting"));dt(!0);let{entropyId:o,entropyIdVerifier:s}=m.getEntropyDetailsFromAccount(i),l={entropyId:o,entropyIdVerifier:s,onCompleteNavigateTo:se.ModalScreen.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:r,shouldForceMFA:!0};ht(ut),await Xe()&&it?it?(ht({keyExport:{appId:E.appId,appClientId:E.clientId,origin:v.apiUrl,walletToExport:n,primaryWallet:i,onSuccess:t,onFailure:r},connectWallet:l}),bt(se.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)):r(Error("Must have a Privy wallet before exporting")):r(Error("Must have valid access token to enroll in MFA"))})),promptMfa:er,async init(e){switch(e){case"sms":return void await v.initMfaSmsVerification();case"passkey":return await v.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${e}`)}},async submit(e,t){switch(e){case"totp":case"sms":if("string"!=typeof t)throw new j.PrivyClientError("Invalid MFA code");At.current?.resolve({mfaMethod:e,mfaCode:t,relyingParty:window.origin}),await new Promise(((e,t)=>{_t.current={resolve:e,reject:t}}));break;case"passkey":if("string"==typeof t)throw new j.PrivyClientError("Invalid authenticator response");let r=await import("@simplewebauthn/browser"),a=ae.transformResponseToSnakeCase(await r.startAuthentication(t));At.current?.resolve({mfaMethod:e,mfaCode:a,relyingParty:window.origin}),await new Promise(((e,t)=>{_t.current={resolve:e,reject:t}}));break;default:throw At.current?.reject(new j.PrivyClientError("Unsupported MFA method")),new j.PrivyClientError(`Unsupported MFA method: ${e}`)}},cancel(){At.current?.reject(new j.PrivyClientError("MFA canceled"))},async initEnrollmentWithSms(e){let t=await Xe();if(!t||!it)throw Error("Must have valid access token to enroll in MFA");await it.initEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber})},enrollInMfa:e=>new Promise(((t,r)=>{if(!e)return or.closePrivyModal(),void t();st.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),ht({mfaEnrollmentFlow:{mfaMethods:st.mfa.methods,onSuccess:t,onFailure:r}}),bt(se.ModalScreen.MFA_ENROLLMENT_FLOW_SCREEN)})),async initEnrollmentWithTotp(){let e=await Xe();if(!e||!it)throw Error("Must have valid access token to enroll in MFA");let t=await it.initEnrollMfa({method:"totp",accessToken:e});return{secret:t.secret,authUrl:t.authUrl}},async submitEnrollmentWithSms(e){let t=await Xe();if(!t||!it)throw Error("Must have valid access token to enroll in MFA");await it.submitEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber,code:e.mfaCode}),_e(await v.getAuthenticatedUser())},async submitEnrollmentWithTotp(e){let t=await Xe();if(!t||!it)throw Error("Must have valid access token to enroll in MFA");await it.submitEnrollMfa({method:"totp",accessToken:t,code:e.mfaCode}),_e(await v.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:e}){let t=await Xe();if(!t||!it)throw Error("Must have valid access token to enroll in MFA");await it.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:e}),_e(await v.getAuthenticatedUser())},async unenroll(e){let t=await Xe();if(!t||!it)throw Error("Must have valid access token to remove MFA");"passkey"===e?await it.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:[]}):await it.unenrollMfa({method:e,accessToken:t}),_e(await v.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{let e=await Xe(),t=Ae?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!e)throw Error("Must have valid access token to connect with Farcaster");if(!it||!t)throw Error("Must have an embedded wallet to use Farcaster signers");if(!Ae?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await or.recoverPrimaryWallet())throw Error("Unable to connect to wallet");let r=await it.initFarcasterSigner({address:t.address,hdWalletIndex:null,accessToken:e,mfaCode:null,mfaMethod:null,relyingParty:window.origin});"approved"===r.status&&_e(await v.getAuthenticatedUser()||Ae||null),ht({farcasterSigner:r}),bt(se.ModalScreen.AWAITING_FARCASTER_SIGNER)},getFarcasterSignerPublicKey:async()=>{let e,t=await Xe(),r=Ae?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!it||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!Ae?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await or.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!Ae.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");return e=Ae.farcaster.signerPublicKey.slice(2),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},signFarcasterMessage:async e=>{let t=await Xe(),r=Ae?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!it||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!Ae?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await or.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!Ae.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");let a=await import("@simplewebauthn/browser"),n=await it.signFarcasterMessage({address:r.address,hdWalletIndex:null,accessToken:t,mfaCode:null,mfaMethod:null,payload:{hash:a.bufferToBase64URLString(e)},fid:BigInt(Ae.farcaster.fid),relyingParty:window.origin});return new Uint8Array(a.base64URLStringToBuffer(n.signature))},createGuestAccount:async()=>{if(Ae&&!Ae.isGuest)throw Error("User cannot already be authenticated to create a guest account");return Ae?.isGuest?Ae:or.loginWithGuestAccountFlow()},signMessageWithCrossAppWallet(e,{address:t}){let r=Ae?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t))));return z.sendCrossAppRequest({user:Ae,client:v,address:t,requesterAppId:st.id,request:{method:r?"privy_signSmartWalletMessage":"personal_sign",params:[e,t]},reconnect:nr})},signTypedDataWithCrossAppWallet(e,{address:t}){let r=Ae?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t)))),a=P.generateTypedDataWithDomainType(e);return z.sendCrossAppRequest({user:Ae,client:v,address:t,requesterAppId:st.id,request:{method:r?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[t,a]},reconnect:nr})},sendTransactionWithCrossAppWallet(e,{address:t}){let r=Ae?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t))));return z.sendCrossAppRequest({user:Ae,client:v,address:t,requesterAppId:st.id,request:{method:r?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[e]},reconnect:nr})},isModalOpen:A,mfaMethods:st.mfa.methods};Ke=ir.signMessage,Ve=ir.signTypedData,Ge=async(...e)=>{let t=await Qt(...e);return st.embeddedWallets.waitForTransactionConfirmation&&await t.wait(),t};let or={setAuthenticated:Pe,setUser:_e,isNewUserThisSession:be,pendingTransaction:null,walletConnectionStatus:Fe,connectors:v.connectors?.walletConnectors??[],solanaWallets:Ie,rpcConfig:st.rpcConfig,chains:st.chains,appId:E.appId,showFiatPrices:"native-token"!==st.embeddedWallets.priceDisplay.primary,clientAnalyticsId:v.clientAnalyticsId,customAuthStatus:Ct,noPromptOnSignature:kt,emailOtpState:Je,setEmailOtpState:Qe,smsOtpState:Ze,setSmsOtpState:et,oAuthState:at,setOAuthState:nt,siweState:tt,setSiweState:rt,isHeadlessOAuthLoading:Me,nativeTokenSymbolForChainId:e=>st.chains.find((t=>t.id===Number(e)))?.nativeCurrency.symbol,initializeWalletProxy:async e=>{if(it)return it;let t=new Promise((e=>{Et((()=>t=>e(t)))})),r=new Promise((t=>setTimeout((()=>t(null)),e))),a=await Promise.race([t,r]);return Et(null),a},getAuthFlow:()=>v.authFlow,getAuthMeta:()=>v.authFlow?.meta,client:v,closePrivyModal:async(e={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let t,r=T&&Ce&&Ae;r&&St.current&&(t=tr(Ae)),"login"===Nt.current?e.shouldCallAuthOnSuccess&&r&&St.current?(he.emitPrivyEvent(Tt,"login","onComplete",Ae,be,!1,St.current,t??null),E.onSuccess?.(Ae,be)):he.emitPrivyEvent(Tt,"login","onError",j.PrivyErrorCode.USER_EXITED_AUTH_FLOW):"link"===Nt.current&&t?e.isSuccess&&r&&St.current?he.emitPrivyEvent(Tt,"linkAccount","onSuccess",Ae,St.current,t):St.current&&he.emitPrivyEvent(Tt,"linkAccount","onError",j.PrivyErrorCode.USER_EXITED_LINK_FLOW,{linkMethod:St.current}):"update"===Nt.current&&t&&(e.isSuccess&&r&&St.current?he.emitPrivyEvent(Tt,"update","onSuccess",Ae,St.current,t):St.current&&he.emitPrivyEvent(Tt,"update","onError",j.PrivyErrorCode.USER_EXITED_UPDATE_FLOW,{linkMethod:St.current}));let a=Re&&$.FUNDING_SCREENS.includes(Re),n=Re===se.ModalScreen.ERROR_SCREEN&&ut.errorModalData&&$.FUNDING_SCREENS.includes(ut.errorModalData.previousScreen);if((a||n)&&ut.funding){let e,t=$.fundingScreenMethodMap[Re]??null;if("solana"===ut.funding.chainType){let r=g(ie.SOLANA_FUNDING_PLUGIN_ID);if(!r)return void console.warn("Unable to load solana plugin, skipping balance");try{e=BigInt(await r.getBalance({address:ut.funding.address,cluster:ut.funding.cluster}))}catch{console.error("Unable to pull wallet balance")}he.emitPrivyEvent(Tt,"fundSolanaWallet","onUserExited",{address:ut.funding.address,cluster:ut.funding.cluster,fundingMethod:t,balance:e})}else{let r=P.getJsonRpcProvider(ut.funding.chain.id,st.chains,st.rpcConfig,{appId:E.appId});try{e=(await r.getBalance(ut.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}he.emitPrivyEvent(Tt,"fundWallet","onUserExited",{address:ut.funding.address,chain:ut.funding.chain,fundingMethod:t,balance:e})}}ht({...ut,externalConnectWallet:{suggestedAddress:void 0}}),Nt.current=null,St.current=null,Oe(!1),_(!1),setTimeout((()=>{v.authFlow=void 0}),200),v.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:({message:e,address:t})=>new Promise((async(r,a)=>{if(!Ce||!Ae)return he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED),void a(Error("User must be authenticated before signing with a Privy wallet"));let n=t??m.getPrivySolanaWallet(Ae)?.address;if(!n)throw new j.PrivyClientError("User must have an embedded wallet to sign a message.");let{signingWallet:i,rootWallet:o}=m.getSolanaSigningAndRootWallet(Ae,n);if(!i||!o)return he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),void a(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.INVALID_MESSAGE),void a(Error("Message must be a non-empty string"));dt(!0);let s=async()=>{if(!Ce)throw Error("User must be authenticated before signing with a Privy wallet");let t=await v.getAccessToken();if(!t)throw Error("User must be authenticated to use their embedded wallet.");let r=or.walletProxy??await or.initializeWalletProxy(15e3);if(!r)throw Error("Failed to initialize embedded wallet proxy.");if(!await or.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!o)throw Error("No root wallet for signing wallet found");let{entropyId:a,entropyIdVerifier:n}=m.getEntropyDetailsFromAccount(o),{response:s}=await r.rpc({accessToken:t,entropyId:a,entropyIdVerifier:n,chainType:"solana",hdWalletIndex:i.walletIndex??0,request:{method:"signMessage",params:{message:e}}});return s.data.signature};if(Ut({showWalletUIs:void 0}))try{let e=await s();r({signature:e})}catch(e){a(e)}else{let{entropyId:t,entropyIdVerifier:n}=m.getEntropyDetailsFromAccount(o);ht({signMessage:{method:"solana_signMessage",data:e,confirmAndSign:s,onSuccess:e=>{r({signature:e})},onFailure:e=>{a(e)},uiOptions:{}},connectWallet:{entropyId:t,entropyIdVerifier:n,onCompleteNavigateTo:se.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{he.emitPrivyEvent(Tt,"signMessage","onError",j.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR),a(e)}}}),Ot(se.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),openPrivyModal:bt,connectWallet:Ft,initLoginWithWallet:async(e,t,r)=>{O.isBaseConnectedEthereumWallet(e)?(St.current="siwe",xt(e,t,r)):(St.current="siws",qt(e,t))},loginWithWallet:async()=>{let e,t,r;if(!T)throw new j.PrivyNotReadyError;if(v.authFlow instanceof h.SiweFlow?e="siwe":v.authFlow instanceof y.SiwsFlow&&(e="siws"),!e)throw new j.PrivyClientError("Must initialize SIWE/SIWS flow first.");if(null!==await v.getAccessToken())try{({user:t}=await v.link()),St.current=e}catch(t){throw he.emitPrivyEvent(Tt,"linkAccount","onError",t.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{({user:t,isNewUser:r}=await v.authenticate()),St.current=e}catch(e){throw he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.GENERIC_CONNECT_WALLET_ERROR),e}_e(t||Ae||null),Oe(r||!1),Pe(!0)},delegateWallet:async({address:e,chainType:t})=>new Promise((async(r,a)=>{let n=await Xe();if(!Ce||!Ae||!n)throw new j.PrivyClientError("User must be authenticated and have an embedded wallet to delegate actions.");if("solana"!==t&&"ethereum"!==t)throw new j.PrivyClientError("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let i=or.walletProxy??await or.initializeWalletProxy(15e3);if(!i)throw new j.PrivyClientError("Wallet proxy not initialized.");if(F.isWalletDelegated({address:e,chainType:t,user:Ae}))return r();let o=F.getDelegatedWalletsData({address:e,user:Ae}),s=F.getRootWalletDataForDelegation({address:e,user:Ae});await or.recoverPrimaryWallet(),ht({delegatedActions:{consent:{address:e,onDelegate:async()=>{await i.createDelegatedAction({accessToken:n,rootWallet:s,delegatedWallets:[o]}),await or.refreshUser()},onSuccess:async()=>{r()},onError:async e=>{a(e)}}}}),bt(se.ModalScreen.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN)})),revokeDelegatedWallets:async()=>new Promise((async(e,t)=>{if(!Ce||!Ae)throw new j.PrivyClientError("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");if(0===F.getDelegatedWalletsForUser(Ae).length)throw new j.PrivyClientError("User has no delegated wallets to revoke.");ht({delegatedActions:{revoke:{onRevoke:async()=>{await v.revokeDelegatedWallet(),await or.refreshUser()},onSuccess:async()=>{e()},onError:async e=>{t(e)}}}}),bt(se.ModalScreen.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN)})),initLoginWithFarcaster:async(e,t)=>{let r=new c.FarcasterFlow(e,t);v.startAuthFlow(r);try{St.current="farcaster",await r.initializeFarcasterConnect()}catch(e){throw"login"===Nt.current?he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR):"link"===Nt.current&&he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),e}},loginWithFarcaster:async()=>{let e,t;if(!T)throw new j.PrivyNotReadyError;if(!(v.authFlow instanceof c.FarcasterFlow))throw new j.PrivyClientError("Must initialize Farcaster flow first.");if(null!==await v.getAccessToken())try{({user:e}=await v.link()),St.current="farcaster"}catch(e){throw he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),e}else try{({user:e,isNewUser:t}=await v.authenticate()),St.current="farcaster"}catch(e){throw he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),e}_e(e||null),Oe(t||!1),Pe(!0)},async loginWithGuestAccountFlow(){let e=new d.GuestFlow(this.appId);v.startAuthFlow(e);try{Nt.current="login",St.current="guest";let{user:e,isNewUser:t}=await v.authenticate();if(t=t||!1,!e)throw new j.PrivyClientError("Unable to authenticate guest account");if(m.shouldProceedtoEmbeddedWalletCreationFlow(e,st.embeddedWallets.createOnLogin))try{await zt(e,15e3),e=await or.refreshUser()}catch(t){_e(e),console.warn("Unable to create embedded wallet for guest account")}else _e(e);return Oe(t),Pe(!0),he.emitPrivyEvent(Tt,"login","onComplete",e,t,!1,"guest",null),e}catch(e){throw he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),e}},async crossAppAuthFlow({appId:e,popup:t,action:r}){let a=`privy:${e}`;St.current=a;let{url:n,stateCode:i,codeVerifier:o}=await V.getCrossAppAuthorizationUrl({api:v.api,appId:e});if(!n)throw v.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:e}}),new j.PrivyClientError("No authorization URL returned for cross-app auth.");try{let s=await G.popupCrossAppAuthFlow({url:n,popup:t,provider:a}),l=s.stateCode,c=s.authorizationCode;if(l!==i)throw v.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:a,storedStateCode:i??"",returnedStateCode:l??""}}),new j.PrivyClientError("Unexpected auth flow. This may be a phishing attempt.",void 0,j.PrivyErrorCode.OAUTH_UNEXPECTED);let d=await V.authenticateCrossAppAccount({appId:e,codeVerifier:o,stateCode:l,authorizationCode:c,action:r,client:v});d&&v.storeProviderAccessToken(e,d);let u=await or.refreshUser();if(!u)throw new j.PrivyClientError("Unable to update user");return v.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:e}}),u}catch(e){throw v.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:e.toString(),provider:a}}),e}},async initLoginWithOAuth(e,t,r){if(St.current=e,!C.isLocalStorageAccessible())return void Ot(se.ModalScreen.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);if("google"===e&&J.default(window.navigator.userAgent))return void Ot(se.ModalScreen.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);"twitter"===e&&window.opener&&window.opener.postMessage({type:K.USE_BROADCAST_CHANNEL_EVENT_TYPE},"*"),C.default.del(f.HEADLESS_OAUTH_KEY),C.default.del(f.OAUTH_DISABLE_SIGNUP_KEY);let a=new ge.OAuthFlow({provider:e,disableSignup:!!r,withPrivyUi:!0});t&&a.addCaptchaToken(t),v.startAuthFlow(a);let n=await v.authFlow.getAuthorizationUrl();n&&n.url&&("twitter"===e&&i.isAndroid&&(n.url=n.url.replace("x.com","twitter.com")),window.location.assign(n.url))},async initLoginWithTelegram(e,t){if(!T)throw new j.PrivyNotReadyError;St.current="telegram";let r=new w.TelegramAuthFlow(e,t);v.startAuthFlow(r),r.meta.telegramWebAppData=void 0,r.meta.telegramAuthResult=await new Promise(((e,t)=>st.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:st.loginConfig.telegramAuthConfiguration.botId,request_access:!0},(r=>r?e(r):t(new j.PrivyClientError("Telegram auth failed or was canceled by the client")))):t(new j.PrivyClientError("Telegram was not initialized")):t(new j.PrivyClientError("Telegram Auth configuration is not loaded"))))},async loginWithTelegram(e){let t,r;if(!(v.authFlow instanceof w.TelegramAuthFlow))throw new j.PrivyClientError("Must initialize Telegram flow before calling loginWithTelegram");if(v.authFlow.meta.captchaToken||=e,"login"===Nt.current)try{let e=await v.authenticate();t=e.user,r=e.isNewUser,St.current="telegram"}catch(e){throw he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),e}else{if("link"!==Nt.current)throw new j.PrivyClientError("Unknown auth intent");try{t=(await v.link()).user,St.current="telegram"}catch(e){throw he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),e}}_e(t),Oe(r||!1),Pe(!0)},async recoveryOAuthFlow(e,t,r){let a,n;function i(t){if(!t)throw v.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:e}}),new j.PrivyClientError("Recovery OAuth failed")}switch(e){case"google-drive":{let t,o,{url:s,codeVerifier:l,stateCode:c}=await Y.getRecoveryAuthorizationUrl({api:He.api,provider:e});i(s);try{let a=await Z.popupOAuthFlow({url:s,popup:r,provider:e});if(t=a.stateCode,o=a.authorizationCode,t!==c)throw v.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:c??"",returnedStateCode:t??""}}),new j.PrivyClientError("Unexpected auth flow. This may be a phishing attempt.",void 0,j.PrivyErrorCode.OAUTH_UNEXPECTED)}catch(t){throw v.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:e}}),new j.PrivyClientError("Recovery OAuth failed")}[a,n]=await Promise.all([Xe(),Y.authenticateRecovery({api:He.api,provider:e,codeVerifier:l,stateCode:t,authorizationCode:o})]);break}case"icloud":{let{url:t}=await Y.getRecoveryAuthorizationUrl({api:He.api,provider:e});i(t);let{ckWebAuthToken:o}=await Z.popupOAuthFlow({url:t,popup:r,provider:e});n=o,a=await Xe()}}if(!it)throw new j.PrivyClientError("Cannot connect to wallet proxy");if(!a)throw new j.PrivyClientError("Unable to authorize user");switch(t){case"recover":{let t=ut.recoverWallet?.entropyId,r=ut.recoverWallet?.entropyIdVerifier;if(!t||!r)throw new j.PrivyClientError("Recovery OAuth failed");v.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:t,recoveryMethod:e}}),await it.recover({accessToken:a,entropyId:t,entropyIdVerifier:r,recoveryAccessToken:n}),v.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t,recoveryMethod:e}});break}case"create-wallet":{v.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await it.create({accessToken:a,recoveryAccessToken:n,recoveryMethod:e});let t=m.getPrivyEthereumWallet(await or.refreshUser());if(!t)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");v.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.address}}),he.emitPrivyEvent(Tt,"createWallet","onSuccess",t);break}case"set-recovery":{let t=m.getPrivyPrimaryWallet(Ae);if(!t)throw he.emitPrivyEvent(Tt,"setWalletRecovery","onError",j.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");v.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:t.address,existingRecoveryMethod:t.recoveryMethod,targetRecoveryMethod:e}});let{entropyId:r,entropyIdVerifier:i}=m.getEntropyDetailsFromAccount(t);await it.setRecovery({accessToken:a,entropyId:r,entropyIdVerifier:i,recoveryMethod:e,recoveryAccessToken:n});let o=m.getPrivyPrimaryWallet(await or.refreshUser());if(!o)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");v.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:t.address,existingRecoveryMethod:t.recoveryMethod,targetRecoveryMethod:e}}),he.emitPrivyEvent(Tt,"setWalletRecovery","onSuccess",e,o);break}default:throw new j.PrivyClientError("Unsupported recovery action")}},async loginWithOAuth(e){let t,r,a;if(!(v.authFlow instanceof ge.OAuthFlow))throw new j.PrivyClientError("Must initialize OAuth flow before calling loginWithOAuth");let n=C.default.get(f.STATE_CODE_KEY),i=v.authFlow.meta.stateCode;if(n!==i)throw v.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:n??"",returnedStateCode:i??""}}),new j.PrivyClientError("Unexpected auth flow. This may be a phishing attempt.",void 0,j.PrivyErrorCode.OAUTH_UNEXPECTED);if(null!==await v.getAccessToken())try{let r=await v.link();t=r.user,a=r.oAuthTokens,St.current=e}catch(t){throw he.emitPrivyEvent(Tt,"linkAccount","onError",t.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{let n=await v.authenticate();t=n.user,r=n.isNewUser,a=n.oAuthTokens,St.current=e}catch(t){throw"login"===Nt.current?he.emitPrivyEvent(Tt,"login","onError",t.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR):"link"===Nt.current&&he.emitPrivyEvent(Tt,"linkAccount","onError",t.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}return _e(t),Oe(r||!1),Pe(!0),a&&t&&he.emitPrivyEvent(Tt,"oAuthAuthorization","onOAuthTokenGrant",a,{user:t}),a},passkeyAuthState:qe,setPasskeyAuthState:je,async initLoginWithPasskey({captchaToken:e,withPrivyUi:t}){let r=new u.PasskeyFlow({captchaToken:e,setPasskeyAuthState:je});v.startAuthFlow(r),Nt.current="login";try{St.current="passkey",je({status:"generating-challenge"}),await r.initAuthenticationFlow(t),je({status:"awaiting-passkey"})}catch(e){throw je({status:"error",error:e}),he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),e}},async loginWithPasskey(){let e,t;if(!T)throw new j.PrivyNotReadyError;if(!(v.authFlow instanceof u.PasskeyFlow))throw new j.PrivyClientError("Must initialize Passkey flow first.");if("passkey"!==St.current){let e=new j.PrivyClientError("Must init login with Passkey flow first.");throw je({status:"error",error:e}),e}let r=await Xe();try{St.current="passkey",je({status:"awaiting-passkey"}),({user:e,isNewUser:t}=await v.authenticate())}catch(e){throw je({status:"error",error:e}),he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),e}_e(e),Oe(t||!1),Pe(!0),je({status:"done"});let a=e?.linkedAccounts.find((({type:e})=>"passkey"===e))||null;return{user:e,isNewUser:t||!1,wasAlreadyAuthenticated:!!r,loginAccount:a}},async initLinkWithPasskey(e){let t=new u.PasskeyFlow({captchaToken:e});v.startAuthFlow(t),Nt.current="link",St.current="passkey",je({status:"generating-challenge"});try{await t.initLinkFlow(),je({status:"awaiting-passkey"})}catch(e){throw he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),je({status:"error",error:e}),e}},async linkWithPasskey(){let e;if(!T)throw new j.PrivyNotReadyError;if(!(v.authFlow instanceof u.PasskeyFlow))throw new j.PrivyClientError("Must initialize Passkey flow first.");if("passkey"!==St.current)throw new j.PrivyClientError("Must init login with Passkey flow first.");try{St.current="passkey",({user:e}=await v.link())}catch(e){throw he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),e}return _e(e||Ae||null),je({status:"done"}),e},async initLoginWithHeadlessOAuth(e,t,r){if(!C.isLocalStorageAccessible())throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");if("google"===e&&J.default(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let a=new ge.OAuthFlow({provider:e,withPrivyUi:!1,disableSignup:r??!1});t&&a.addCaptchaToken(t),nt({status:"loading"});let n=await v.startAuthFlow(a).getAuthorizationUrl();n?.url&&window.location.assign(n.url)},async loginWithHeadlessOAuth(e){let t,r,a;Le(!0),nt({status:"loading"}),v.startAuthFlow(new ge.OAuthFlow(e));let n=C.default.get(f.STATE_CODE_KEY),i=e.stateCode;if(n!==i)throw v.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e.provider,storedStateCode:n??"",returnedStateCode:i??""}}),Le(!1),new j.PrivyClientError("Unexpected auth flow. This may be a phishing attempt.",void 0,j.PrivyErrorCode.OAUTH_UNEXPECTED);if(null!==await v.getAccessToken())try{({user:t,oAuthTokens:a}=await v.link()),St.current=e.provider;let r=tr(t);t&&r&&he.emitPrivyEvent(Tt,"linkAccount","onSuccess",t,St.current,r)}catch(t){throw Le(!1),he.emitPrivyEvent(Tt,"linkAccount","onError",t.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:e.provider}),t}else try{({user:t,isNewUser:r,oAuthTokens:a}=await v.authenticate()),St.current=e.provider;let n=tr(t);t&&n&&void 0!==r&&he.emitPrivyEvent(Tt,"login","onComplete",t,r,!1,St.current,n)}catch(e){throw Le(!1),nt({status:"error",error:e}),he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),e}return _e(t),Oe(r||!1),Pe(!0),Le(!1),nt({status:"done"}),a&&t&&he.emitPrivyEvent(Tt,"oAuthAuthorization","onOAuthTokenGrant",a,{user:t}),t??void 0},initLoginWithEmail:async({email:e,captchaToken:t,disableSignup:r,withPrivyUi:a})=>{let n=new l.EmailFlow({email:e,captchaToken:t,disableSignup:r});v.startAuthFlow(n);try{St.current="email",Qe({status:"sending-code"}),await n.sendCodeEmail({withPrivyUi:a}),Qe({status:"awaiting-code-input"})}catch(e){throw Qe({status:"error",error:e}),"login"===Nt.current?he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR):"link"===Nt.current&&he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),e}},initUpdateEmail:async(e,t,r)=>{let a=new l.UpdateEmailFlow(e,t,r);v.startAuthFlow(a);try{await a.sendCodeEmail({withPrivyUi:!0})}catch(e){he.emitPrivyEvent(Tt,"update","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR,{linkMethod:St.current})}},initUpdatePhone:async(e,t,r)=>{let a=new p.UpdateSmsFlow(e,t,r);v.startAuthFlow(a);try{await a.sendSmsCode({withPrivyUi:!0})}catch(e){he.emitPrivyEvent(Tt,"update","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR,{linkMethod:St.current})}},initLoginWithSms:async({phoneNumber:e,captchaToken:t,disableSignup:r,withPrivyUi:a})=>{et({status:"sending-code"});let n=new p.SmsFlow({phoneNumber:e,captchaToken:t,disableSignup:r});v.startAuthFlow(n);try{St.current="sms",await n.sendSmsCode({withPrivyUi:a}),et({status:"awaiting-code-input"})}catch(e){throw et({status:"error",error:e}),"login"===Nt.current?he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR):"link"===Nt.current&&he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),e}},resendEmailCode:async()=>{await(v.authFlow?.sendCodeEmail({withPrivyUi:!0}))},resendSmsCode:async()=>{await(v.authFlow?.sendSmsCode({withPrivyUi:!0}))},loginWithCode:async e=>{let t,r;function a(e){v.authFlow instanceof l.EmailFlow?Qe(e):v.authFlow instanceof p.SmsFlow&&et(e)}if(a({status:"submitting-code"}),!T){let e=new j.PrivyNotReadyError;throw a({status:"error",error:e}),e}if(v.authFlow instanceof l.EmailFlow)v.authFlow.meta.emailCode=e.trim();else{if(!(v.authFlow instanceof p.SmsFlow)){let e=new j.PrivyClientError("Must initialize a passwordless code flow first");throw a({status:"error",error:e}),e}v.authFlow.meta.smsCode=e.trim()}let n=await Xe();if("link"===Nt.current)try{({user:t}=await v.link())}catch(e){throw a({status:"error",error:e}),he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:St.current}),e}else if("update"===Nt.current)try{({user:t}=await v.link())}catch(e){throw a({status:"error",error:e}),he.emitPrivyEvent(Tt,"update","onError",e.privyErrorCode||j.PrivyErrorCode.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:St.current}),e}else try{({user:t,isNewUser:r}=await v.authenticate())}catch(e){throw a({status:"error",error:e}),he.emitPrivyEvent(Tt,"login","onError",e.privyErrorCode||j.PrivyErrorCode.UNKNOWN_AUTH_ERROR),e}let i=t||Ae;_e(i||null),Oe(r||!1),Pe(!0),a({status:"done"});let o=null;return v.authFlow instanceof l.EmailFlow?o=i?.linkedAccounts.find((({type:e})=>"email"===e))||null:v.authFlow instanceof p.SmsFlow&&(o=i?.linkedAccounts.find((({type:e})=>"phone"===e))||null),{user:i,isNewUser:r||!1,wasAlreadyAuthenticated:!!n,linkedAccount:o}},generateSiweMessage:async({address:e,chainId:t,captchaToken:r})=>{Nt.current="link",St.current="siwe",rt({status:"generating-message"});let a=await v.generateSiweNonce({address:e,captchaToken:r});return rt({status:"awaiting-signature"}),ee.prepareSiweMessageWithNonce({address:e,chainId:t.replace("eip155:",""),nonce:a})},generateSiweMessageForSmartWallet:async({address:e,chainId:t})=>{let r=await v.generateSiweNonce({address:e});return ee.prepareSiweMessageWithNonce({address:e,chainId:t.replace("eip155:",""),nonce:r})},linkSmartWallet:async({message:e,signature:t,smartWalletType:r})=>{let a;a=await v.linkSmartWallet({message:e,signature:t,smartWalletType:r}),_e((a=await or.refreshUser()??a)||Ae||null)},linkWithSiwe:async({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n})=>{let i;Bt("siwe");let o=null;try{rt({status:"submitting-signature"}),i=await v.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}),i=await or.refreshUser()??i,rt({status:"done"}),(o=tr(i)||null)&&he.emitPrivyEvent(Tt,"linkAccount","onSuccess",i,"siwe",o)}catch(e){throw he.emitPrivyEvent(Tt,"linkAccount","onError",e.privyErrorCode||j.PrivyErrorCode.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Nt.current=null,St.current=null,rt({status:"error",error:e}),e}let s=i||Ae;return _e(s||null),Nt.current=null,St.current=null,{user:s,linkedAccount:o}},refreshUser:async()=>{let e=await v.getAuthenticatedUser();return Pe(!!e),_e(e),e},walletProxy:it,createAnalyticsEvent:({eventName:e,payload:t,timestamp:r})=>v.createAnalyticsEvent({eventName:e,payload:t,timestamp:r}),acceptTerms:async()=>{let e=await v.acceptTerms();return _e(e),e},getUsdTokenPrice:e=>v.getUsdTokenPrice(e),getUsdPriceForSol:()=>v.getUsdPriceForSol(),recoverPrimaryWallet:async e=>new Promise((async(t,r)=>{let a=m.getPrivyPrimaryWallet(e?.user??Ae)||m.getImportedPrivyEthereumWallet(e?.user??Ae)||m.getImportedPrivySolanaWallet(e?.user??Ae),n=await Xe();if(!n||!it||!a)return void r(Error("Must have valid access token and Privy wallet to recover wallet"));dt(!0);let{entropyId:i,entropyIdVerifier:o}=m.getEntropyDetailsFromAccount(a);try{await it.connect({accessToken:n,entropyId:i,entropyIdVerifier:o}),t(!0)}catch(e){x.errorIndicatesRecoveryIsNeeded(e)&&"privy"===a.recoveryMethod?(v.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:a.address}}),(await it.recover({entropyId:i,entropyIdVerifier:o,accessToken:n})).entropyId||r(Error("Unable to recover wallet")),v.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:a.address}}),t(!0)):x.errorIndicatesRecoveryIsNeeded(e)&&"privy"!==a.recoveryMethod?(ht({recoverWallet:{entropyId:i,entropyIdVerifier:o,onFailure:r,onSuccess:()=>t(!0)},recoveryOAuthStatus:{provider:a.recoveryMethod,action:"recover"}}),bt(Y.embeddedWalletRecoveryScreen(a.recoveryMethod))):r(e)}})),createEmbeddedSolanaWallet:async e=>{if(e&&"target"in e&&(e=void 0),!Ce||!Ae)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return(async(e,t,r)=>{let a=m.getPrivyEthereumWallet(e),n=m.getPrivySolanaWallet(e),i=r&&"createAdditional"in r&&r.createAdditional,o=r&&"walletIndex"in r?r.walletIndex:void 0,s=(m.getLatestPrivySolanaWallet(e)?.walletIndex??-1)+1;if(n&&!i&&"number"!=typeof o)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");if("number"==typeof o&&o<0)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${o}) is invalid.`);let[l,c]=await Promise.all([or.initializeWalletProxy(t),Xe()]);if(!l||!c)throw he.emitPrivyEvent(Tt,"createWallet","onError",j.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return await Xt({user:e,wp:l,accessToken:c,walletIndex:o??s,ethereumWallet:a})})(Ae,15e3,e)},exportSolanaWallet:e=>new Promise((async(t,r)=>{if(!Ce||!Ae)return void r(Error("User must be authenticated before exporting their Privy wallet"));let a=e?.address??m.getPrivySolanaWallet(Ae)?.address;if(!a)return void r(Error("User does not have an HD Solana wallet."));let{signingWallet:n,rootWallet:i}=m.getSolanaSigningAndRootWallet(Ae,a);if(!n||!i)return void r(Error("Must have a Privy wallet before exporting"));if(dt(!0),!await Xe()||!it)return void r(Error("Must have valid access token to enroll in MFA"));if(!it)return void r(Error("Must have a Privy wallet before exporting"));let{entropyId:o,entropyIdVerifier:s}=m.getEntropyDetailsFromAccount(i);ht({connectWallet:{entropyId:o,entropyIdVerifier:s,onCompleteNavigateTo:se.ModalScreen.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:r,shouldForceMFA:!0},keyExport:{appId:E.appId,appClientId:E.clientId,origin:v.apiUrl,walletToExport:n,primaryWallet:i,onSuccess:t,onFailure:r}}),bt(se.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})),setReadyToTrue:e=>{fe(!0),yt?.(e)},updateWallets:()=>Gt(),fundWallet:async(e,t)=>{let r=se.ModalScreen.FUNDING_METHOD_SELECTION_SCREEN;ht({funding:ve.prepareFundingModalData({address:e,appConfig:st,fundWalletConfig:t,methodScreen:r})}),bt(r)},openModal:bt,requestFarcasterSignerStatus:async e=>{let t=await Xe(),r=Ae?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!it||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!Ae?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");let a=await v.requestFarcasterSignerStatus(e);return"approved"===a.status&&_e(await v.getAuthenticatedUser()||Ae||null),a},connectCoinbaseSmartWallet:async()=>{st.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let e=v.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||v.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(e)return e.updateConnectionPreference("smartWalletOnly"),Ft(e);await Lt("coinbase_wallet","coinbase_smart_wallet")},initiateAccountTransfer:async({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o})=>{let s=await v.sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o});return _e(s),s}};ze=or.recoverPrimaryWallet,Ye=or.recoverPrimaryWallet,$e=or.solanaSignMessage;let sr=n.useMemo((()=>({wallets:Te,ready:vt&&Wt})),[Te,vt,Wt]),lr=v.authFlow instanceof w.TelegramAuthFlow,cr=!st.headless&&st.captchaEnabled&&!Ce&&(T||lr);/*#__PURE__*/return e.jsx(we.PrivyContext.Provider,{value:ir,children:/*#__PURE__*/e.jsx(he.PrivyEventsContext.Provider,{value:Tt,children:/*#__PURE__*/e.jsx(Ee.UseWalletsContext.Provider,{value:sr,children:/*#__PURE__*/e.jsx(ue.CaptchaProvider,{...st,children:/*#__PURE__*/e.jsxs(ye.InternalPrivyContext.Provider,{value:or,children:[/*#__PURE__*/e.jsx(oe.RecentlyUsedAccountProvider,{children:/*#__PURE__*/e.jsxs(pe.ModalProvider,{data:ut,setModalData:ht,setInitialScreen:De,initialScreen:Re,authenticated:Ce,open:A,children:[E.children,cr&&/*#__PURE__*/e.jsx(W.Captcha,{delayedExecution:!1}),/*#__PURE__*/e.jsx(ce.GlobalStyle,{theme:{...st.appearance.palette||{}}}),!st.render.standalone&&/*#__PURE__*/e.jsx(I.LoginModal,{open:A})]})}),ct&<?/*#__PURE__*/e.jsx(L.EmbeddedWalletIframe,{appId:E.appId,appClientId:E.clientId,clientAnalyticsId:v.clientAnalyticsId,origin:v.apiUrl,mfaMethods:Ae?.mfaMethods,mfaPromise:At,mfaSubmitPromise:_t,onLoad:ot,onLoadFailed:()=>null}):null,st.loginConfig.telegramAuthConfiguration&& +-/*#__PURE__*/e.jsx(le.Hide,{$if:!0,children:/*#__PURE__*/e.jsx(S.TelegramLoginButton,{scriptHost:E.apiUrl||f.DEFAULT_PRIVY_API_URL,botUsername:st.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};exports.ConnectorManager=De,exports.Embedded1193Provider=Re,exports.EmbeddedSolanaProvider=Be,exports.PrivyClient=qe,exports.PrivyProvider=({config:t,...r})=>{var a;if("undefined"!=typeof window&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&"https:"!==window.location.protocol)throw new j.PrivyClientError("Embedded wallet is only available over HTTPS");if("string"!=typeof(a=r.appId)||25!==a.length)throw new j.PrivyClientError("Cannot initialize the Privy provider with an invalid Privy app ID");He||(He=new qe({appId:r.appId,appClientId:r.clientId,apiUrl:r.apiUrl}));let n=Object.assign({},t);return void 0!==r.createPrivyWalletOnLogin&&void 0===n.embeddedWallets?.createOnLogin&&(n.embeddedWallets||(n.embeddedWallets={}),n.embeddedWallets.createOnLogin=r.createPrivyWalletOnLogin?"users-without-wallets":"off"),void 0!==r.createPrivyWalletOnLogin&&t?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),/*#__PURE__*/e.jsx(N.PrivyAppConfigProvider,{client:He,clientConfig:n,legacyCreateEmbeddedWalletFlag:r.createPrivyWalletOnLogin,children:/*#__PURE__*/e.jsx(ne.PrivyPluginProvider,{children:/*#__PURE__*/e.jsx(at,{...r,client:He})})})},exports.getAccessToken=Xe,exports.getCustomerAccessToken=function(){return He?He.getCustomerAccessToken():Promise.resolve(C.default.get(f.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY)||null)},exports.globalRecoverEthereumModal=et,exports.globalRecoverSolanaModal=tt,exports.globalSignMessageModal=Je,exports.globalSignSolanaModal=rt,exports.globalSignTypedDataModal=Qe,exports.globalTransactModal=Ze,exports.loadConnectionHistory=Me; ++/*#__PURE__*/e.jsx(le.Hide,{$if:!0,children:/*#__PURE__*/e.jsx(S.TelegramLoginButton,{scriptHost:E.apiUrl||f.DEFAULT_PRIVY_API_URL,botUsername:st.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};exports.ConnectorManager=De,exports.Embedded1193Provider=Re,exports.EmbeddedSolanaProvider=Be,exports.PrivyClient=qe,exports.PrivyProvider=({config:t,...r})=>{var a;if("undefined"!=typeof window&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&0>["https:","chrome-extension:","file:"].indexOf(window.location.protocol))throw new j.PrivyClientError("Embedded wallet is only available over HTTPS/CHROME-EXTENSION/FILE");if("string"!=typeof(a=r.appId)||25!==a.length)throw new j.PrivyClientError("Cannot initialize the Privy provider with an invalid Privy app ID");He||(He=new qe({appId:r.appId,appClientId:r.clientId,apiUrl:r.apiUrl}));let n=Object.assign({},t);return void 0!==r.createPrivyWalletOnLogin&&void 0===n.embeddedWallets?.createOnLogin&&(n.embeddedWallets||(n.embeddedWallets={}),n.embeddedWallets.createOnLogin=r.createPrivyWalletOnLogin?"users-without-wallets":"off"),void 0!==r.createPrivyWalletOnLogin&&t?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),/*#__PURE__*/e.jsx(N.PrivyAppConfigProvider,{client:He,clientConfig:n,legacyCreateEmbeddedWalletFlag:r.createPrivyWalletOnLogin,children:/*#__PURE__*/e.jsx(ne.PrivyPluginProvider,{children:/*#__PURE__*/e.jsx(at,{...r,client:He})})})},exports.getAccessToken=Xe,exports.getCustomerAccessToken=function(){return He?He.getCustomerAccessToken():Promise.resolve(C.default.get(f.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY)||null)},exports.globalRecoverEthereumModal=et,exports.globalRecoverSolanaModal=tt,exports.globalSignMessageModal=Je,exports.globalSignSolanaModal=rt,exports.globalSignTypedDataModal=Qe,exports.globalTransactModal=Ze,exports.loadConnectionHistory=Me; +diff --git a/node_modules/@privy-io/react-auth/dist/cjs/svg/protected-by-privy.js b/node_modules/@privy-io/react-auth/dist/cjs/svg/protected-by-privy.js +index 4d18d30..64c2a3f 100644 +--- a/node_modules/@privy-io/react-auth/dist/cjs/svg/protected-by-privy.js ++++ b/node_modules/@privy-io/react-auth/dist/cjs/svg/protected-by-privy.js +@@ -1 +1 @@ +-"use strict";var c=require("react/jsx-runtime");exports.ProtectedByPrivy=function(a){/*#__PURE__*/return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...a,children:/*#__PURE__*/c.jsx("g",{fill:a.color||"var(--privy-color-foreground)",children:/*#__PURE__*/c.jsx("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}; ++"use strict";var c=require("react/jsx-runtime");exports.ProtectedByPrivy=function(a){/*#__PURE__*/return c.jsx("div",{...a})}; +diff --git a/node_modules/@privy-io/react-auth/dist/esm/privy-provider-BnF-KW5M.mjs b/node_modules/@privy-io/react-auth/dist/esm/privy-provider-BnF-KW5M.mjs +index d64b2d9..68fa640 100644 +--- a/node_modules/@privy-io/react-auth/dist/esm/privy-provider-BnF-KW5M.mjs ++++ b/node_modules/@privy-io/react-auth/dist/esm/privy-provider-BnF-KW5M.mjs +@@ -1,2 +1,2 @@ +-import{jsx as e,jsxs as t}from"react/jsx-runtime";import{getAddress as r}from"@ethersproject/address";import{Web3Provider as a}from"@ethersproject/providers";import{createStore as n}from"mipd";import{useState as i,useRef as o,useEffect as s,useMemo as l}from"react";import{isAndroid as c}from"react-device-detect";import{populateTransactionRequest as d,calculateTotalGasEstimate as u,ProviderErrors as h}from"@privy-io/js-sdk-core";import{CustomJwtAccountFlow as p}from"./auth-flows/custom-jwt-account.mjs";import{UpdateEmailFlow as w,EmailFlow as m}from"./auth-flows/email.mjs";import{FarcasterFlow as y}from"./auth-flows/farcaster.mjs";import{GuestFlow as f}from"./auth-flows/guest.mjs";import{PasskeyFlow as g}from"./auth-flows/passkey.mjs";import{SiweFlow as E}from"./auth-flows/siwe.mjs";import{SiwsFlow as _}from"./auth-flows/siws.mjs";import{UpdateSmsFlow as A,SmsFlow as T}from"./auth-flows/sms.mjs";import{TelegramAuthFlow as v,detectCompletingTelegramFlow as C}from"./auth-flows/telegram.mjs";import{v4 as I}from"uuid";import{AccessToken as W}from"./accessToken.mjs";import{getEntropyDetailsFromAccount as k,convertUserResponseToUser as N,getPrivySolanaHDWallets as b,getImportedPrivySolanaWallet as U,getPrivyPrimaryWallet as O,getPrivyEthereumWallet as S,getPrivyEthereumHDWallets as R,getImportedPrivyEthereumWallet as P,shouldProceedtoEmbeddedWalletCreationFlow as D,getPrivySolanaWallet as L,getLatestPrivyEthereumWallet as M,getSolanaSigningAndRootWallet as F,getEthereumSigningAndRootWallet as x,getLatestPrivySolanaWallet as j,getEntropyDetailsFromUser as B}from"./client/user.mjs";import V from"eventemitter3";import{CONNECTORS_STATE_KEY as H,CONNECTIONS_HISTORY_KEY as K,DEFAULT_PRIVY_API_URL as G,DEFAULT_API_TIMEOUT_MS as z,CLIENT_ANALYTICS_ID_KEY as q,CUSTOMER_ACCESS_TOKEN_STORAGE_KEY as $,PRIVY_ACCESS_TOKEN_STORAGE_KEY as Y,getGuestCredentialStorageKey as X,HEADLESS_OAUTH_KEY as Q,OAUTH_DISABLE_SIGNUP_KEY as J,STATE_CODE_KEY as Z,WALLET_PROXY_TIMEOUT as ee,FORKED_TOKEN_STORAGE_KEY as te}from"./constants.mjs";import re,{isLocalStorageAccessible as ae}from"./storage.mjs";import{getJsonRpcProvider as ne,generateTypedDataWithDomainType as ie,toHex as oe,detectInjectedConnectors as se,formatChainIdToCAIP2 as le}from"./utils/index.mjs";import{CoinbaseWalletConnector as ce}from"./connectors/coinbase.mjs";import{EmbeddedWalletConnector as de}from"./connectors/embedded.mjs";import{isSupportedEthereumRpcMethod as ue}from"./embedded-wallets/rpc/types.mjs";import{Captcha as he}from"./components/Captcha.mjs";import{LoginModal as pe}from"./components/LoginModal.mjs";import{TelegramLoginButton as we}from"./components/TelegramLoginButton.mjs";import{PrivyAppConfigProvider as me,useAppConfig as ye,useIsServerConfigLoaded as fe}from"./configuration/context.mjs";import{areWalletArraysEqual as ge}from"./connectors/areWalletArraysEqual.mjs";import{PrivyProviderRpcError as Ee,ProviderRpcError as _e}from"./connectors/errors.mjs";import{isPhantomInstalled as Ae}from"./connectors/is-wallet-installed.mjs";import{isBaseConnectedEthereumWallet as Te}from"./connectors/isBaseConnectedEthereumWallet.mjs";import{PrivyProxyProvider as ve,AsExternalProvider as Ce,AsAbstractProvider as Ie}from"./connectors/privyProxyProvider.mjs";import{isSolanaWalletConnector as We,isBaseConnectedSolanaWallet as ke}from"./connectors/solana/index.mjs";import{WalletConnectV2WalletConnector as Ne}from"./connectors/walletconnect-v2.mjs";import{EmbeddedWalletIframe as be}from"./embedded-wallets/EmbeddedWalletIframe.mjs";import{isWalletDelegated as Ue,getDelegatedWalletsData as Oe,getRootWalletDataForDelegation as Se,getDelegatedWalletsForUser as Re}from"./embedded-wallets/delegated-actions.mjs";import{errorIndicatesRecoveryIsNeeded as Pe}from"./embedded-wallets/errors.mjs";import{formatReceipt as De,getAndCheckBalance as Le,sendTransaction as Me}from"./embedded-wallets/rpc/index.mjs";import{PrivyClientError as Fe,formatApiError as xe,formatPrivyError as je,PrivyErrorCode as Be,PrivyNotReadyError as Ve,PrivyConnectorError as He,PrivyError as Ke}from"./errors.mjs";import{signSolanaTransaction as Ge,sendSolanaTransaction as ze}from"./embedded-wallets/solana/transaction.mjs";import{extractChainIdFromCAIP2 as qe}from"./lib/caip2.mjs";import{USE_BROADCAST_CHANNEL_EVENT_TYPE as $e,isPrivyTheOAuthProvider as Ye,CROSS_APP_BROADCAST_CHANNEL_NAME as Xe}from"./lib/cross-app/index.mjs";import{getCrossAppAuthorizationUrl as Qe,authenticateCrossAppAccount as Je,getProviderAppMetadata as Ze}from"./lib/cross-app/authFlow.mjs";import{popupCrossAppAuthFlow as et}from"./lib/cross-app/popupCrossAppAuthFlow.mjs";import{sendCrossAppRequest as tt}from"./lib/cross-app/sendCrossAppRequest.mjs";import{getRecoveryAuthorizationUrl as rt,authenticateRecovery as at,embeddedWalletRecoveryScreen as nt,toEmbeddedWalletSetRecoveryScreen as it}from"./lib/embeddedWalletRecovery.mjs";import{FUNDING_SCREENS as ot,fundingScreenMethodMap as st}from"./lib/funding/index.mjs";import{isFundingEnabled as lt}from"./lib/funding/isFundingEnabled.mjs";import ct from"./lib/isEmbeddedWebview.mjs";import{triggerPopup as dt}from"./lib/popup/triggerPopup.mjs";import{popupOAuthFlow as ut}from"./lib/popupOAuthFlow.mjs";import{prepareSiweMessageWithNonce as ht}from"./lib/siwe.mjs";import{decodeSolanaTransaction as pt,createSolanaTransactionReceipt as wt}from"./lib/solana/transaction.mjs";import{toDisplayFromAccountType as mt}from"./lib/toDisplayFromAccountType.mjs";import{transformResponseToSnakeCase as yt}from"./passkeys/transformResponseToSnakeCase.mjs";import{PrivyPluginProvider as ft,usePlugins as gt}from"./plugins/context/PrivyPluginContext.mjs";import{SOLANA_FUNDING_PLUGIN_ID as Et}from"./plugins/solana-funding/id.mjs";import{RecentlyUsedAccountProvider as _t}from"./recent-login/context.mjs";import{ModalScreen as At}from"./screens/index.mjs";import{Hide as Tt}from"./screens/LandingScreen/styles.mjs";import{GlobalStyle as vt}from"./styles.mjs";import{notImplemented as Ct}from"./hooks/index.mjs";import{CaptchaProvider as It}from"./hooks/captcha-context.mjs";import{privyEventsDefault as Wt,emitPrivyEvent as kt,PrivyEventsContext as Nt}from"./hooks/events-context.mjs";import{InternalPrivyContext as bt}from"./hooks/internal-context.mjs";import{ModalProvider as Ut}from"./hooks/modal-context.mjs";import{PrivyContext as Ot}from"./hooks/privy-context.mjs";import{UseWalletsContext as St}from"./hooks/useWallets.mjs";import{prepareSolanaFundingModalData as Rt,prepareFundingModalData as Pt}from"./lib/funding/prepareFundingModalData.mjs";import{detectCompletingOAuthFlow as Dt}from"./auth-flows/oauth/detectCompletingOAuthFlow.mjs";import{OAuthFlow as Lt}from"./auth-flows/oauth/OAuthFlow.mjs";import{getRpcTimeout as Mt}from"./connectors/getRpcTimeout.mjs";import{EmbeddedProviderError as Ft}from"./connectors/providerTypes.mjs";import{isEthereumWalletConnector as xt}from"./connectors/ethereum/index.mjs";import{LegacyInjectedWalletConnector as jt,Injected6963WalletConnector as Bt}from"./connectors/injected.mjs";import{MetamaskWalletConnector as Vt}from"./connectors/metamask.mjs";import{PhantomEthereumNullWalletConnector as Ht}from"./connectors/phantom.mjs";import{PhantomSolanaNullWalletConnector as Kt}from"./connectors/phantom-solana.mjs";import{Http as Gt}from"./http.mjs";import{getPaymasterContext as zt}from"./lib/smart-wallet-helpers.mjs";import{transformOptionsToCamelCase as qt}from"./passkeys/transformOptionsToCamelCase.mjs";import{mfaPasswordlessSmsInitPath as $t,mfaPasskeyInitPath as Yt,acceptTermsPath as Xt,unlinkEmailPath as Qt,unlinkPhonePath as Jt,unlinkWalletPath as Zt,siwsUnlinkWalletPath as er,unlinkOAuthPath as tr,unlinkFarcasterPath as rr,telegramAccountUnlinkPath as ar,unlinkPasskeyPath as nr,delegatedActionsRevokePath as ir,analyticsEventsPath as or,moonpayPluginOnRampPath as sr,coinbaseOnRampInitPath as lr,coinbaseOnRampStatusPath as cr,siweInitPath as dr,siweAuthenticatePath as ur,siweLinkPath as hr,smartWalletLinkPath as pr,siwsInitPath as wr,siwsAuthenticatePath as mr,transferOAuthPath as yr,telegramAccountTransferPath as fr,transferFarcasterPath as gr,transferWalletPath as Er,transferPhonePath as _r,transferEmailPath as Ar,siwsLinkPath as Tr}from"./paths.mjs";import{AccessTokenTypes as vr,Session as Cr}from"./session.mjs";class Ir extends V{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new Ft(`Invalid params for ${e.method}`,4200);let t=e.params[0];if(!await Vr()||!this.address)throw new Ft("Disconnected",4900);return(await Gr(t,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new Ft(`Invalid params for ${e.method}`,4200);if("string"==typeof e.params[0])t=e.params[0];else{if(!("chainId"in e.params[0])||"string"!=typeof e.params[0].chainId)throw new Ft(`Invalid params for ${e.method}`,4200);t=e.params[0].chainId}this.chainId=Number(t),this.provider=ne(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",t)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let t=e.params[0],r=e.params[1];return await Hr(t,void 0,r)}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let t=e.params[0],r="string"==typeof e.params[1]?JSON.parse(e.params[1]):e.params[1];return await Kr(ie(r),void 0,t)}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let t={...e.params[0],chainId:oe(this.chainId)};try{return await this.provider.send("eth_estimateGas",[t])}catch(e){console.warn(`Gas estimation failed with error: ${e}. Retrying gas estimation by omitting the 'from' address`);try{return delete t.from,await this.provider.send("eth_estimateGas",[t])}catch(t){throw console.warn(`Gas estimation failed with error: ${t} when omitting the 'from' address`),e}}}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return oe(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!ue(e.method))return this.provider.send(e.method,e.params);{let t=await Vr();if(await zr(),!t||!this.address)throw new Ft("Disconnected",4900);try{return(await this.walletProxy.rpc({accessToken:t,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:{method:e.method,params:e.params}})).response.data}catch(e){throw console.error(e),new Ft("Disconnected",4900)}}}constructor({walletProxy:e,address:t,entropyId:r,entropyIdVerifier:a,rpcConfig:n,chains:i,appId:o,chainId:s=1,walletIndex:l}){super(),this.walletProxy=e,this.address=t,this.entropyId=r,this.entropyIdVerifier=a,this.chainId=s,this.rpcConfig=n,this.chains=i,this.provider=ne(s,this.chains,n,{appId:o}),this.rpcTimeoutDuration=Mt(n,"privy"),this.appId=o,this.walletIndex=l}}class Wr extends V{get wallets(){let e=new Set,t=this.walletConnectors.flatMap((e=>e.wallets)).sort(((e,t)=>e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0)).filter((t=>{let r=`${t.address}${t.walletClientType}${t.connectorType}`;return!e.has(r)&&(e.add(r),!0)})),r=t.findIndex((e=>e.address===(this.activeWallet?this.activeWallet:"unknown")));return r>=0&&t.unshift(t.splice(r,1)[0]),t}async initialize(){if(this.initialized)return;re.get(H)&&(re.getKeys().forEach((e=>{e.startsWith("walletconnect")&&re.del(e)})),re.del(H));let e=se({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then((e=>{e.forEach((({type:e,eip6963InjectedProvider:t,legacyInjectedProvider:r})=>{this.createEthereumWalletConnector("injected",e,{eip6963InjectedProvider:t,legacyInjectedProvider:r})}))}));this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector("coinbase_wallet","coinbase_wallet"),!Ae()&&this.walletList.includes("phantom")&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&this.createEthereumWalletConnector("phantom","phantom"),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&this.addWalletConnector(new Kt)),this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector("wallet_connect_v2","unknown"),this.externalWalletConfig.solana.connectors?.get().forEach(this.addSolanaWalletConnector),this.externalWalletConfig.solana.connectors?._setOnConnectorsUpdated?.((e=>{e?.forEach(this.addSolanaWalletConnector)})),await e,this.initialized=!0}findWalletConnector(e,t){return"wallet_connect_v2"===e?this.walletConnectors.filter(xt).find((t=>t.connectorType===e))??null:this.walletConnectors.filter(xt).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findSolanaWalletConnector(e,t){return this.walletConnectors.filter(We).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter((e=>"embedded"===e.connectorType))}onInitialized(e){e.wallets.forEach((e=>{let t=this.storedConnections.find((t=>t.address===e.address&&t.connectorType===e.connectorType&&t.walletClientType===e.walletClientType));t&&(e.connectedAt=t.connectedAt)})),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:e,rootWallet:t,embeddedWallets:r,defaultChain:a,appId:n}){for(let i of r){let r=this.findEmbeddedWalletConnectors().find((e=>e.walletIndex===i.walletIndex));if(r&&xt(r))r.proxyProvider.walletProxy=e;else{let{entropyId:r,entropyIdVerifier:o}=k(t),s=new de({provider:new Ir({walletProxy:e,address:i.address,entropyId:r,entropyIdVerifier:o,rpcConfig:this.rpcConfig,chains:this.chains,appId:n,chainId:a.id,walletIndex:i.walletIndex}),chains:this.chains,defaultChain:a,rpcConfig:this.rpcConfig,imported:!1,walletIndex:i.walletIndex});this.addWalletConnector(s)}}}addImportedWalletConnector(e,t,r,a){let n=this.findWalletConnector("embedded_imported","privy");if(n&&xt(n))n.proxyProvider.walletProxy=e;else{let n=new de({provider:new Ir({walletProxy:e,address:t,entropyId:t,entropyIdVerifier:"ethereum-address-verifier",walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:r.id}),chains:this.chains,walletIndex:0,defaultChain:r,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(n)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter((e=>"embedded"!==e.connectorType)),this.saveConnectionHistory(),this.storedConnections=kr(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1),this.saveConnectionHistory(),this.storedConnections=kr(),this.emit("walletsUpdated")}}async createEthereumWalletConnector(e,t,r){let a=this.findWalletConnector(e,t);if(a&&xt(a))return a instanceof Ne&&a.resetConnection(t),a;let n=(()=>"injected"!==e?"coinbase_wallet"===e?new ce(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):"phantom"===e?new Ht(this.defaultChain):new Ne(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,t):"metamask"===t&&r?.eip6963InjectedProvider?new Vt(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):"metamask"===t&&r?.legacyInjectedProvider?new jt(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):"phantom"===t&&r?.legacyInjectedProvider?new jt(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&"unknown_browser_extension"===t?new jt(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new Bt(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,t):void 0)();return n&&this.addWalletConnector(n),n||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",(()=>this.onInitialized(e))),e.on("walletsUpdated",(()=>this.onWalletsUpdated(e))),e.initialize().catch((e=>{console.debug("Failed to initialize connector",e)}))}saveConnectionHistory(){let e=this.wallets.map((e=>({address:e.address,connectorType:e.connectorType,walletClientType:e.walletClientType,connectedAt:e.connectedAt})));re.put(K,e)}async activeWalletSign(e){let t=this.wallets,r=t.length>0?t[0]:null;return r&&Te(r)?r.sign(e):null}setActiveWallet(e){this.activeWallet=r(e),this.emit("walletsUpdated")}constructor(e,t,r,a,n,i,o,s,l,c,d,u){super(),this.addSolanaWalletConnector=async e=>{this.findSolanaWalletConnector("solana_adapter",e.walletClientType)||this.addWalletConnector(e)},this.getEthereumProvider=()=>{let e=this.wallets[0],t=this.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new ve},this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=r,this.chains=a,this.defaultChain=n,this.walletConnectors=[],this.initialized=!1,this.store=i,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=s,this.externalWalletConfig=l,this.privyAppName=c,this.privyAppLogo=d,this.walletChainType=u||"ethereum-only",this.storedConnections=kr()}}const kr=()=>{let e=re.get(K);return e&&Array.isArray(e)&&e.map((e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e))).every(Boolean)?e:[]};let Nr;var br=0,Ur="__private_"+br+++"__getOrGenerateClientAnalyticsId";class Or{initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:a,store:n,walletList:i,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:s,appName:l,walletChainType:c}){this.connectors||(this.connectors=new Wr(this.appId,e,t,r,a,n,i,o,s,l,void 0,c))}generateApi(){let e=new Gt({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new Fe("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new Fe("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter((e=>"cross_app"===e.type)).forEach((e=>{this.storeProviderAccessToken(e.providerApp.id,null)}))}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post($t,{action:"verify"})}catch(e){throw xe(e)}}async initMfaPasskeyVerification(){try{let e=await this.api.post(Yt,{});return qt(e.options)}catch(e){throw xe(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(e){console.error("Error fetching cross app provider details",e)}}async acceptTerms(){try{let e=await this.api.post(Xt,{});return N(e)}catch(e){throw je(e)}}async unlinkEmail(e){try{let t=await this.api.post(Qt,{address:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkPhone(e){try{let t=await this.api.post(Jt,{phoneNumber:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkEthereumWallet(e){try{let t=await this.api.post(Zt,{address:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkSolanaWallet(e){try{let t=await this.api.post(er,{address:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkOAuth(e,t){try{let r=await this.api.post(tr,{provider:e,subject:t});return await this.getAuthenticatedUser()??N(r)}catch(e){throw je(e)}}async unlinkFarcaster(e){try{let t=await this.api.post(rr,{fid:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkTelegram(e){try{let t=await this.api.post(ar,{telegram_user_id:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkPasskey(e){try{let t=await this.api.post(nr,{credential_id:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async revokeDelegatedWallet(){try{await this.api.post(ir,{})}catch(e){throw je(e)}}async createAnalyticsEvent({eventName:e,payload:t,timestamp:r,options:a}){if("undefined"!=typeof window)try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(or,{event_name:e,client_id:this.clientAnalyticsId,payload:{...t||{},clientTimestamp:r?r.toISOString():(new Date).toISOString()}},{retry:-1,keepalive:a?.keepAlive??!1})}catch(e){}}async signMoonpayOnRampUrl(e){try{return this.api.post(sr,e)}catch(e){throw je(e)}}async initCoinbaseOnRamp(e){try{return this.api.post(lr,e)}catch(e){throw je(e)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`${cr}?partnerUserId=${e}`)}catch(e){throw je(e)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(vr.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(vr.PRIVY,e)}async _getToken(e,t){return this.session.getToken(e)?this.session.hasActiveAccessToken(e)?this.session.hasRefreshCredentials(e)?W.parse(this.session.getToken(e))?.appId!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null):!t?.disableAutoRefresh&&this.session.hasRefreshCredentials(e)?(await this.session.refresh(),this.session.getToken(e)):null:null}async getSmartWalletsConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:e});return r.enabled?{enabled:r.enabled,smartWalletType:r.smart_wallet_type,configuredNetworks:r.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:zt(e.paymaster_url,e.paymaster_context)})))}:{enabled:r.enabled}}catch(e){throw je(e)}}async getServerConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:e}),a=r.telegram_auth_config?{botId:r.telegram_auth_config.bot_id,botName:r.telegram_auth_config.bot_name,linkEnabled:r.telegram_auth_config.link_enabled,seamlessAuthEnabled:r.telegram_auth_config.seamless_auth_enabled}:void 0,n=r.funding_config?{methods:r.funding_config.methods,options:r.funding_config.options,defaultRecommendedAmount:r.funding_config.default_recommended_amount,defaultRecommendedCurrency:r.funding_config.default_recommended_currency,promptFundingOnWalletCreation:r.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:r.funding_config.cross_chain_bridging_enabled}:void 0;return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,solanaWalletAuth:r.solana_wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,spotifyOAuth:r.spotify_oauth,instagramOAuth:r.instagram_oauth,tiktokOAuth:r.tiktok_oauth,linkedinOAuth:r.linkedin_oauth,appleOAuth:r.apple_oauth,farcasterAuth:r.farcaster_auth,passkeyAuth:r.passkey_auth,telegramAuth:r.telegram_auth,disablePlusEmails:r.disable_plus_emails,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:r.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:r.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:r.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:r.privacy_policy_url,requireUsersAcceptTerms:r.require_users_accept_terms,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,fiatOnRampEnabled:r.fiat_on_ramp_enabled,captchaEnabled:r.captcha_enabled,captchaSiteKey:r.captcha_site_key,createdAt:new Date(1e3*r.created_at),updatedAt:new Date(1e3*r.updated_at),mfaMethods:r.mfa_methods,enforceWalletUis:r.enforce_wallet_uis,legacyWalletUiConfig:r.legacy_wallet_ui_config,telegramAuthConfiguration:a,fundingConfig:n}}catch(e){throw je(e)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch(t){return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch(e){return void console.error("Unable to fetch token price for SOL")}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:e,captchaToken:t}){try{return(await this.api.post(dr,{address:e,token:t})).nonce}catch(e){throw je(e)}}async authenticateWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n,mode:i}){return await this.api.post(ur,{message:e,signature:t,chainId:r,walletClientType:a,connectorType:n,mode:i})}async linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}){return await this.api.post(hr,{message:e,signature:t,chainId:r,walletClientType:a,connectorType:n})}async linkSmartWallet({message:e,signature:t,smartWalletType:r}){try{let a=await this.api.post(pr,{message:e,signature:t,smart_wallet_type:r});return N(a)}catch(e){throw je(e)}}async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}){try{let i=await this.linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n});return N(i)}catch(e){throw je(e)}}async generateSiwsNonce({address:e,captchaToken:t}){try{return(await this.api.post(wr,{address:e,token:t})).nonce}catch(e){throw je(e)}}async authenticateWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a,mode:n}){return await this.api.post(mr,{message:e,signature:t,walletClientType:r,connectorType:a,mode:n})}async sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o}){try{let s,l;switch(r){case"email":s=Ar,l={nonce:e,email:t};break;case"sms":s=_r,l={nonce:e,phoneNumber:t};break;case"siwe":if(s=Er,!a)throw Error("Wallet parameters must be defined");l={nonce:e,address:t,...a};break;case"farcaster":s=gr,l={nonce:e,farcaster_id:t,farcaster_embedded_address:i};break;case"telegram":s=fr,l={nonce:e,telegram_auth_result:n};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:s=yr,l={nonce:e,userInfo:o}}let c=await this.api.post(s,l);return await this.getAuthenticatedUser()??N(c)}catch(e){throw je(e)}}async linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a}){return await this.api.post(Tr,{message:e,signature:t,walletClientType:r,connectorType:a})}async linkWithSiws({message:e,signature:t,walletClientType:r,connectorType:a}){try{let n=await this.linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a});return N(n)}catch(e){throw je(e)}}constructor({apiUrl:e=G,appId:t,appClientId:r,timeout:a=z}){Object.defineProperty(this,Ur,{value:Sr}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==G&&e.startsWith("https://privy."),this.timeout=a,this.appId=t,this.appClientId=r,this.clientAnalyticsId=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}(this,Ur)[Ur](),Nr||(Nr=new Cr),this.session=Nr,this.api=this.generateApi(),this.session.client=this}}function Sr(){if("undefined"==typeof window)return null;try{let e=re.get(q);if("string"==typeof e&&e.length>0)return e}catch(e){}let e=I();try{return re.put(q,e),e}catch(t){return e}}class Rr{async handleSignMessage(e){if(!e.params||"string"!=typeof e.params.message)throw Error("Message must be provided as a string for Solana signMessage RPC");return await $r({message:e.params.message,address:this.address})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await Vr())throw Error("User must be authenticated to use embedded Solana wallet");if(!await qr())throw new Fe("Unable to connect to Solana embedded wallet");if("signMessage"===e.method)return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}constructor(e,t){this.walletProxy=e,this.address=t}}let Pr,Dr,Lr,Mr,Fr,xr,jr;function Br(){return Pr?Pr.getCustomerAccessToken():Promise.resolve(re.get($)||null)}async function Vr(){return Pr?Pr.getAccessToken():Promise.resolve(re.get(Y)||re.get($)||null)}const Hr=(e,t,r)=>Dr(e,t,r),Kr=(e,t,r)=>Lr(e,t,r),Gr=(e,t,r,a)=>Mr(e,t,r,a),zr=()=>Fr(),qr=()=>xr(),$r=({message:e,address:t})=>jr({message:e,address:t});const Yr=({config:t,...r})=>{var a;if("undefined"!=typeof window&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&"https:"!==window.location.protocol)throw new Fe("Embedded wallet is only available over HTTPS");if("string"!=typeof(a=r.appId)||25!==a.length)throw new Fe("Cannot initialize the Privy provider with an invalid Privy app ID");Pr||(Pr=new Or({appId:r.appId,appClientId:r.clientId,apiUrl:r.apiUrl}));let n=Object.assign({},t);return void 0!==r.createPrivyWalletOnLogin&&void 0===n.embeddedWallets?.createOnLogin&&(n.embeddedWallets||(n.embeddedWallets={}),n.embeddedWallets.createOnLogin=r.createPrivyWalletOnLogin?"users-without-wallets":"off"),void 0!==r.createPrivyWalletOnLogin&&t?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),/*#__PURE__*/e(me,{client:Pr,clientConfig:n,legacyCreateEmbeddedWalletFlag:r.createPrivyWalletOnLogin,children:/*#__PURE__*/e(ft,{children:/*#__PURE__*/e(Xr,{...r,client:Pr})})})};let Xr=I=>{let W=I.client,N=gt(),[V,H]=i(!1),[K,z]=i(!1),[$,Y]=i(!1),[se,ce]=i(null),[de,ue]=i([]),[me,We]=i([]),[xe,je]=i([]),ft=o(de),[Mt,Ft]=i(!1),[xt,jt]=i(null),[Bt,Vt]=i(!1),[Ht,Kt]=i({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:Ct}),[Gt,zt]=i({status:"initial"}),[qt,$t]=i({status:"initial"}),[Yt,Xt]=i({status:"initial"}),[Qt,Jt]=i({status:"initial"}),[Zt,er]=i({status:"initial"}),[tr,rr]=i(null),ar=ye(),nr=fe(),[ir,or]=i(!0),[sr,lr]=i({}),[cr,dr]=i(null),[ur,hr]=i(null),[pr,wr]=i(!1),[mr,yr]=i(!1),[fr,gr]=i(ar.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),Er=o(null),_r=o(null),Ar=o(Wt),[Tr,vr]=i(!1);W.onStoreCustomerAccessToken=e=>{e&&kt(Ar,"accessToken","onAccessTokenGranted",e)},W.onDeleteCustomerAccessToken=()=>{ce(null),Y(!1),kt(Ar,"accessToken","onAccessTokenRemoved")};let Cr=o(null),Ir=o(null),Wr=o(!1),kr=({showWalletUIs:e,typedData:t})=>Wr.current?Wr.current:void 0!==e?!e:void 0!==ar.embeddedWallets.showWalletUIs?!ar.embeddedWallets.showWalletUIs:t?ar.embeddedWallets.noPromptOnSignature||(ar.legacyWalletUiConfig??!1):!!ar.embeddedWallets.noPromptOnSignature,Nr=e=>{jt(e),setTimeout((()=>{H(!0)}),15),W.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:e}})},br=e=>{"off"!==ar.embeddedWallets.createOnLogin&&or(!0),Nr(e)};s((()=>{let e=[...b(se),U(se)].filter((e=>!!e));tr&&je(e.map((e=>({type:"solana",imported:e.imported,address:e.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",walletIndex:e.walletIndex??void 0,meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund(){throw new Fe("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:()=>{throw new Fe("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new Rr(tr,e.address),async signMessage(t){let r=await Vr();if(!r||!tr)throw new Fe("Must have valid access token and Privy wallet to send transaction",Be.MUST_BE_AUTHENTICATED);let a=e.imported?U(se):O(se);if(!a)throw new Fe("Attempting to sign a transaction without a root wallet");let{entropyId:n,entropyIdVerifier:i}=k(a);if(!await ua.recoverPrimaryWallet().catch((()=>!1)))throw new Fe("Wallet couldn't be connected",Be.UNKNOWN_CONNECT_WALLET_ERROR);if(!se)throw new Fe("Attempting to sign a transaction with no user initialized");let{response:o}=await tr.rpc({accessToken:r,entropyId:n,entropyIdVerifier:i,chainType:"solana",hdWalletIndex:this.walletIndex??0,request:{method:"signMessage",params:{message:Buffer.from(t).toString("base64")}}});return Buffer.from(o.data.signature,"base64")},async sendTransaction(e,t,r){let{signature:a}=await na({transaction:e,connection:t,transactionOptions:r,wallet:this});return a},async signTransaction(t){let r=await Vr();if(!r||!tr)throw new Fe("Must have valid access token and Privy wallet to send transaction",Be.MUST_BE_AUTHENTICATED);if(!await ua.recoverPrimaryWallet().catch((()=>!1)))throw new Fe("Wallet couldn't be connected",Be.UNKNOWN_CONNECT_WALLET_ERROR);let{entropyId:a,entropyIdVerifier:n}=k(e);return await Ge({tx:t,accessToken:r,walletProxy:tr,entropyId:a,entropyIdVerifier:n,transactingWalletAddress:this.address,transactingWalletIndex:this.walletIndex??0}),t},loginOrLink:async()=>{throw new Fe("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{},isConnected:async()=>!0}))))}),[tr,se]),s((()=>{if(!se)return void W.connectors?.removeEmbeddedWalletConnectors();let e=S(se),t=R(se),r=P(se);e&&t.length||W.connectors?.removeEmbeddedWalletConnectors(),r||W.connectors?.removeImportedWalletConnector(),W.connectors?tr?(e&&W.connectors.addEmbeddedWalletConnectors({walletProxy:tr,rootWallet:e,embeddedWallets:t,defaultChain:ar.defaultChain,appId:I.appId}),r&&W.connectors.addImportedWalletConnector(tr,r.address,ar.defaultChain,I.appId)):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")}),[tr,se]),s((()=>{tr&&ur?.(tr)}),[tr]);let Ur=o();s((()=>{(async()=>{if(!ar.customAuth?.enabled)return void gr({status:"not-enabled"});or(!0);let{getCustomAccessToken:e,isLoading:t}=ar.customAuth;if(K&&!t&&"loading"!==fr.status){gr({status:"loading"});try{let t=await e();if(t===Ur.current)return void gr({status:"done"});if(!t&&$)return Ur.current=t,await da.logout(),gr({status:"done"}),void kt(Ar,"customAuth","onUnauthenticated");if(!t)return Ur.current=t,void gr({status:"done"});W.startAuthFlow(new p(t));let{user:r,isNewUser:a}=await W.authenticate();if(!r)return await da.logout(),gr({status:"error",error:new Fe("Failed to sync with custom auth provider")}),void kt(Ar,"customAuth","onUnauthenticated");void 0!==a&&kt(Ar,"login","onComplete",r,a,!1,"custom",null),Ur.current=t,kt(Ar,"customAuth","onAuthenticated",{user:r}),gr({status:"done"}),ce(r||null),Ft(a||!1),Y(!0),yr(!0)}catch(e){if(console.warn(e),await da.logout(),kt(Ar,"customAuth","onUnauthenticated"),"User already exists with provided custom JWT account."===e.message)return void gr({status:"initial"});kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),gr({status:"error",error:e})}}})()}),["initial"===fr.status,ar.customAuth?.enabled,ar.customAuth?.getCustomAccessToken,ar.customAuth?.isLoading,K,$]),s((()=>{mr&&tr&&se&&D(se,ar.embeddedWallets.createOnLogin)&&(yr(!1),Jr(se,ee).catch(console.error))}),[mr&&tr&&se]),s((()=>{if(ar.externalWallets.solana.connectors)return ar.externalWallets.solana.connectors.onMount(),()=>ar.externalWallets.solana.connectors?.onUnmount()}),[ar.externalWallets.solana.connectors]),s((()=>{!K&&nr&&async function(){let e,t=Or(),r=Sr();(()=>{let e=new URLSearchParams(window.location.search).get("privy_token");if(!e)return;re.put(te,e);let t=new URL(window.location.href);t.searchParams.delete("privy_token"),window.history.pushState({},"",t)})();let a=n();W.initializeConnectorManager({walletConnectCloudProjectId:ar.walletConnectCloudProjectId,rpcConfig:ar.rpcConfig,chains:ar.chains,defaultChain:ar.defaultChain,store:a,walletList:ar.appearance.walletList,shouldEnforceDefaultChainOnConnect:ar.shouldEnforceDefaultChainOnConnect,externalWalletConfig:ar.externalWallets,appName:ar.name??"Privy",walletChainType:ar.appearance.walletChainType}),W.connectors?.on("connectorInitialized",(()=>{e&&clearTimeout(e);let t=W.connectors.walletConnectors.length,r=W.connectors.walletConnectors.reduce(((e,t)=>e+(t.initialized?1:0)),0);r===t?vr(!0):e=setTimeout((()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:r,expected:t}),vr(!0)}),1500)})),W.connectors?.initialize().then((()=>{zr()}));let i=await W.getAuthenticatedUser(),o=!!i;ar.legal.requireUsersAcceptTerms&&i&&!i.hasAcceptedTerms?(await W.logout(),ua.setReadyToTrue(!0),kt(Ar,"logout","onSuccess")):(ar.customAuth?.enabled||(Y(!!i),i&&kt(Ar,"login","onComplete",i,!1,!0,null,null),ce(i)),t?Ir.current=o?"link":"login":r&&!o?(Ir.current="login",lr({telegramAuthModalData:{seamlessAuth:!0}}),br(At.TELEGRAM_AUTH_SCREEN)):ua.setReadyToTrue(!!i))}()}),[W,cr,K,nr]),s((()=>{if(K){if(!se||!se.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType)))return void wr(!0);wr(!!de.find((e=>"privy"===e.walletClientType)))}}),[K,se,de]);let Or=()=>{let e=Dt();return e.inProgress&&e.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):"error"===e.authorizationCode?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}):(e.inProgress&&Ye(e.provider)&&!e.popupFlow&&(new BroadcastChannel(Xe).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}),window.close()),!!e.inProgress&&!!e.withPrivyUi&&(W.startAuthFlow(new Lt(e)),br(At.AWAITING_OAUTH_SCREEN),!0))},Sr=()=>{let e=C();if(!e||!ar.loginMethods.telegram||!ar.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let t=new v;return W.startAuthFlow(t),"login-url"===e.flowType&&(t.meta.telegramWebAppData=void 0,t.meta.telegramAuthResult=e.authData),"web-app"===e.flowType&&(t.meta.telegramAuthResult=void 0,t.meta.telegramWebAppData=e.authData),!0},Br=async(e,t,r,a)=>{Hr(await(W.connectors?.createEthereumWalletConnector(e,t))||null,t,r,a)};async function Hr(e,t,r,a){if(!e)return Kt({status:"disconnected",connectedWallet:null,connectError:new He("Unable to connect to wallet."),connector:null,connectRetry:Ct}),a?.(null,r);Kt({status:"disconnected",connectedWallet:null,connectError:null,connector:e,connectRetry:Ct}),e instanceof Ne&&t&&await e.resetConnection(t),Kt({connector:e,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Hr(e,t,r,a)});try{let t=await e.connect({showPrompt:!0});if((!t||Te(t))&&ar.shouldEnforceDefaultChainOnConnect&&!ar.chains.find((e=>e.id===Number(t?.chainId.replace("eip155:",""))))&&("wallet_connect_v2"!==t?.connectorType||"metamask"!==t?.walletClientType)){Kt((t=>({...t,connector:e,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:Ct})));try{await(t?.switchChain(ar.defaultChain.id)),t&&(t.chainId=le(oe(ar.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${ar.defaultChain.id}`)}}return Kt((e=>({...e,status:"connected",connectedWallet:t,connectError:null,connectRetry:Ct}))),t&&kt(Ar,"connectWallet","onSuccess",(e.chainType,t)),a?.(t,r)}catch(e){return e instanceof Ke?(console.warn(e.cause?e.cause:e.message),kt(Ar,"connectWallet","onError",e.privyErrorCode||Be.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),kt(Ar,"connectWallet","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR)),Kt((t=>({...t,status:"disconnected",connectedWallet:null,connectError:e}))),a?.(null,r)}}let Kr=async(e,t,r)=>{if(null===e||!Te(e))return;let a=new E(e,W,t,r);W.startAuthFlow(a)},Gr=async(e,t)=>{if(null===e||!ke(e))return;let r=new _(e,W,t);W.startAuthFlow(r)},zr=()=>{let e=new URLSearchParams(window.location.search),t=e.get("privy_connector"),r=e.get("privy_wallet_client");if(!t||!r)return;if("phantom"!==r||Ae()||br(At.LOGIN_FAILED_SCREEN),!W.connectors)throw new Fe("Connector not initialized");Nr(At.AWAITING_CONNECTION);let a=new URL(window.location.href);a.searchParams.delete("privy_connector"),a.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",a),Br(t,r,void 0,Kr)};s((()=>{K&&$&&null===se&&W.getAuthenticatedUser().then(ce)}),[K,$,se,W]);let qr=e=>{if(!$)throw kt(Ar,"linkAccount","onError",Be.MUST_BE_AUTHENTICATED,{linkMethod:e}),new Fe("User must be authenticated before linking an account.")},$r=()=>{qr("siwe"),Cr.current="siwe",Ir.current="link",Nr(At.LINK_WALLET_SCREEN)},Yr=e=>{if(!$||!se)return!1;if("privy"===e.walletClientType)return!0;for(let t of se.linkedAccounts)if("wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType)return!0;return!1},Xr=async e=>{let t;if(!W.connectors)throw new Fe("Connector not initialized");t="ethereum"===e.type?W.connectors.findWalletConnector(e.connectorType,e.walletClientType)||null:W.connectors.findSolanaWalletConnector(e.connectorType,e.walletClientType)||null,Kt((r=>({...r,connector:t,status:"connected",connectedWallet:e,connectError:null,connectRetry:Ct}))),ar.captchaEnabled&&!$?(lr({captchaModalData:{callback:t=>Te(e)?Kr(e,t):Gr(e,t),userIntentRequired:!1,onSuccessNavigateTo:At.AWAITING_CONNECTION,onErrorNavigateTo:At.ERROR_SCREEN}}),br(At.CAPTCHA_SCREEN)):(Te(e)?await Kr(e):await Gr(e),br(At.AWAITING_CONNECTION))},Qr=()=>{ue((e=>{let t=W.connectors?.wallets.filter(Te).map((e=>({...e,linked:Yr(e),loginOrLink:async()=>{if(!await e.isConnected())throw new Fe("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new Fe("Cannot link or login with embedded wallet");Xr(e)},fund:async t=>{await ua.fundWallet(e.address,t)},unlink:async()=>{if(!$)throw new Fe("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new Fe("Cannot unlink an embedded wallet");ce(await W.unlinkEthereumWallet(e.address))}})))||[];return ge(e,t)?e:t})),We((e=>{let t=(W.connectors?.wallets??[]).concat(xe).filter(ke).map((e=>({...e,linked:Yr(e),loginOrLink:async()=>{if(!await e.isConnected())throw new Fe("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new Fe("Cannot link or login with embedded wallet");Xr(e)},fund:async()=>{throw new Fe("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:async()=>{if(!$)throw new Fe("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new Fe("Cannot unlink an embedded wallet");ce(await W.unlinkSolanaWallet(e.address))}})));return ge(e,t)?e:t}))};s((()=>{Qr()}),[se?.linkedAccounts,$,K,xe]),s((()=>{if(K){if(!W.connectors)throw new Fe("Connector not initialized");Qr(),W.connectors.on("walletsUpdated",Qr)}}),[K]),s((()=>{[...ar.loginMethodsAndOrder?.primary??[],...ar.loginMethodsAndOrder?.overflow??[]].filter((e=>e.startsWith("privy:"))).forEach((e=>W.getCrossAppProviderDetails(e.replace("privy:",""))))}),[!!W]),s((()=>{let e;if(!de[0])return;let t=de[0],r=ft.current.find((e=>e.address===t.address));if(e="privy"===t.walletClientType?se?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"===e.walletClientType)):se?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"!==e.walletClientType)),!r&&e){let t=Object.assign({},se);t.wallet=e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,imported:e.imported,delegated:e.delegated,walletIndex:e.walletIndex},ce(t)}ft.current=de}),[de]);let Jr=async(e,t,r)=>{let a=S(e),n=L(e);if(r&&"walletIndex"in r)return ea(e,t,r.walletIndex,a,n);let i=r&&"createAdditional"in r&&r.createAdditional;if(a&&!i)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");let[o,s]=await Promise.all([ua.initializeWalletProxy(t),Vr()]);if(!o&&ar.customAuth?.enabled)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!o||!s||ar.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return Zr();if(!a)return await o.create({accessToken:s,solanaAddress:n?.address}),ra(0,"ethereum");{let t=(M(e)?.walletIndex??0)+1,{entropyId:r,entropyIdVerifier:a}=k(O(e));return await ua.recoverPrimaryWallet(),await o.addWallet({accessToken:s,entropyId:r,entropyIdVerifier:a,chainType:"ethereum",hdWalletIndex:t}),ra(t,"ethereum")}},Zr=async()=>new Promise(((e,t)=>{or(!0),lr({createWallet:{onSuccess:t=>{kt(Ar,"createWallet","onSuccess",t),e(t)},onFailure:e=>{kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),t(e)},callAuthOnSuccessOnClose:!1}}),Nr(At.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)})),ea=async(e,t,r,a,n)=>{if(r<0)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${r}) is invalid.`);let[i,o]=await Promise.all([ua.initializeWalletProxy(t),Vr()]);if(!i&&ar.customAuth?.enabled)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!i||!o||ar.embeddedWallets?.requireUserOwnedRecoveryOnCreate){if(0==r)return Zr();throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Create wallet UI can only be displayed when walletIndex is 0.")}if(0==r){if(a)return a;await i.create({accessToken:o,solanaAddress:n?.address})}else{if(!a)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_CREATE_ERROR),Error("A user must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let t=R(e).find((e=>e.walletIndex===r));if(t)return t;let{entropyId:n,entropyIdVerifier:s}=k(O(e));await ua.recoverPrimaryWallet(),await i.addWallet({accessToken:o,entropyId:n,entropyIdVerifier:s,chainType:"ethereum",hdWalletIndex:r})}return ra(r,"ethereum")},ta=async({user:e,wp:t,accessToken:r,walletIndex:a,ethereumWallet:n})=>{let i=b(e).find((e=>e.walletIndex===a));if(i)return i;if(0===a)await t.createSolana({accessToken:r,ethereumAddress:n?.address});else{let n=O(e);if(!n)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_CREATE_ERROR),Error("User must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let{entropyId:i,entropyIdVerifier:o}=k(n);await ua.recoverPrimaryWallet(),await t.addWallet({accessToken:r,entropyId:i,entropyIdVerifier:o,chainType:"solana",hdWalletIndex:a})}return ra(a,"solana")},ra=async(e,t)=>{let r=await ua.refreshUser(),a=("ethereum"===t?R(r):b(r)).find((t=>t.walletIndex===e));if(!a)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");return kt(Ar,"createWallet","onSuccess",a),a},aa=(e,t,a,n)=>new Promise((async(i,o)=>{let{requesterAppId:s}=t||{};if(!$||!se)return kt(Ar,"sendTransaction","onError",Be.MUST_BE_AUTHENTICATED),void o(Error("User must be authenticated before signing with a Privy wallet"));let l=n??S(se)?.address;if(!l)throw new Fe("User must have an embedded wallet to send a transaction.");let{signingWallet:c,rootWallet:p}=x(se,l);if(!p||!c)return kt(Ar,"sendTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void o(Error("Must have a Privy wallet before signing"));or(!0);let w=ha.wallets.find((e=>"privy"===e.walletClientType&&r(e.address)===r(c.address))),m=await(w?.getEthereumProvider());if(!w||!m)throw new Fe(`Cannot sendTransaction before embedded wallet ${c.address} is connected`);let y=e.chainId?Number(e.chainId):qe(w.chainId);(e=>{if(!ar.chains.map((e=>e.id)).includes(e))throw new He(`Chain ID ${e} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,Be.UNSUPPORTED_CHAIN_ID)})(y);let f=Object.assign({},e,{chainId:y});if(kr({showWalletUIs:t?.showWalletUIs}))(async()=>{let e=await Vr();if(!e||!tr)return kt(Ar,"sendTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void o(Error("Must have valid access token and Privy wallet to send transaction"));try{if(!await ua.recoverPrimaryWallet())return kt(Ar,"sendTransaction","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),void o(Error("Unable to connect to wallet"));let r=ne(f.chainId,ar.chains,ar.rpcConfig,{appId:I.appId}),a=await d(c.address,f,r);if(kr({showWalletUIs:t?.showWalletUIs})){let{totalGasEstimate:e}=await u(a,r),{hasSufficientFunds:t}=await Le(c.address,a,e,r);if(!t)throw new Ee(new _e("Wallet has insufficient funds for this transaction.",h.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let{entropyId:n,entropyIdVerifier:l}=k(p),w=await Me({accessToken:e,entropyId:n,entropyIdVerifier:l,transactingWallet:c,walletProxy:tr,transactionRequest:a,provider:r,requesterAppId:s});kt(Ar,"sendTransaction","onSuccess",w),i(w)}catch(e){kt(Ar,"sendTransaction","onError",Be.TRANSACTION_FAILURE),o(e)}})();else{let{entropyId:e,entropyIdVerifier:r}=k(p),n={entropyId:e,entropyIdVerifier:r,onCompleteNavigateTo:At.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:e=>{kt(Ar,"sendTransaction","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),o(e)}},l=lt(ar)?Pt({address:c.address,appConfig:ar,fundWalletConfig:a,methodScreen:At.FUNDING_METHOD_SELECTION_SCREEN,chainIdOverride:f.chainId,comingFromSendTransactionScreen:!0}):void 0;lr({connectWallet:n,sendTransaction:{transactionRequest:f,transactingWallet:c,entropyId:e,entropyIdVerifier:r,onSuccess:e=>{kt(Ar,"sendTransaction","onSuccess",e),i(e)},onFailure:e=>{kt(Ar,"sendTransaction","onError",Be.TRANSACTION_FAILURE),o(e)},uiOptions:t||{},fundWalletConfig:a,requesterAppId:s},funding:l}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),na=({transaction:e,connection:t,transactionOptions:r,fundWalletConfig:a,uiOptions:n,wallet:i})=>new Promise((async(o,s)=>{let{requesterAppId:l}=n||{};if(!$||!se)return kt(Ar,"sendSolanaTransaction","onError",Be.MUST_BE_AUTHENTICATED),void s(new Fe("User must be authenticated before signing with a Privy wallet",Be.MUST_BE_AUTHENTICATED));let c=i?se.linkedAccounts.find((e=>"wallet"===e.type&&e.address===i.address)):L(se);if(!c)return kt(Ar,"sendSolanaTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void s(new Fe("Must have a Privy wallet before signing",Be.EMBEDDED_WALLET_NOT_FOUND));or(!0);let{rootWallet:d}=F(se,c.address);if(!await ua.recoverPrimaryWallet().catch((()=>!1))||!d)throw kt(Ar,"sendSolanaTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),new Fe(`Cannot sendSolanaTransaction before embedded wallet ${c.address} is connected`,Be.EMBEDDED_WALLET_NOT_FOUND);if(kr({showWalletUIs:n?.showWalletUIs}))(async()=>{let a=await Vr();if(!a||!tr)return kt(Ar,"sendSolanaTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void s(new Fe("Must have valid access token and Privy wallet to send transaction",Be.EMBEDDED_WALLET_NOT_FOUND));try{if(!await ua.recoverPrimaryWallet())return kt(Ar,"sendSolanaTransaction","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),void s(new Fe("Unable to connect to wallet",Be.UNKNOWN_CONNECT_WALLET_ERROR));if(kr({showWalletUIs:n?.showWalletUIs})){let{instructions:r}=await pt(e,t);r.every((e=>e.hasFunds))||(kt(Ar,"sendSolanaTransaction","onError",Be.INSUFFICIENT_BALANCE),s(new Fe("Solana wallet has insufficient funds for this transaction.",Be.INSUFFICIENT_BALANCE)))}let{entropyId:i,entropyIdVerifier:l}=B(se),{signature:d,receipt:u}=await ze({accessToken:a,tx:e,connection:t,walletProxy:tr,transactionOptions:r,entropyId:i,entropyIdVerifier:l,transactingWalletAddress:c.address,transactingWalletIndex:c.walletIndex??0}),h=wt(d,u);kt(Ar,"sendSolanaTransaction","onSuccess",h),o(h)}catch(e){kt(Ar,"sendSolanaTransaction","onError",Be.TRANSACTION_FAILURE),s(e)}})();else{let{entropyId:i,entropyIdVerifier:u}=k(d),h={entropyId:i,entropyIdVerifier:u,onCompleteNavigateTo:At.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN,onFailure:e=>{kt(Ar,"sendSolanaTransaction","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),s(e)}},p=lt(ar)?Rt({address:c.address,appConfig:ar,methodScreen:At.FUNDING_METHOD_SELECTION_SCREEN,fundWalletConfig:a,comingFromSendTransactionScreen:!0}):void 0;lr({connectWallet:h,sendSolanaTransaction:{transactionRequest:e,connection:t,transactionOptions:r,transactingWallet:c,onSuccess:e=>{kt(Ar,"sendSolanaTransaction","onSuccess",e),o(e)},onFailure:e=>{kt(Ar,"sendSolanaTransaction","onError",Be.TRANSACTION_FAILURE),s(e)},uiOptions:n||{},requesterAppId:l},funding:p}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}}));function ia(){return new Promise((async(e,t)=>{let r=await Vr();if(!r||!tr)throw Error("Must have valid access token to enroll in MFA");try{await tr.verifyMfa({accessToken:r}),e()}catch(e){t(e)}}))}let oa=e=>e?.linkedAccounts.filter((e=>null!==e.latestVerifiedAt&&!("wallet"===e.type&&"privy"===e.walletClientType))).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0],sa=e=>{let t=se?.linkedAccounts.filter((t=>t.type===e)).length??0,{displayName:r,loginMethod:a}=mt(e);if("passkey"===e&&t>=5||"passkey"!==e&&t>=1)throw kt(Ar,"linkAccount","onError",Be.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:a}),new Fe(`User already has an account of type ${r} linked.`)};async function la({showAutomaticRecovery:e=!1,legacySetWalletPasswordFlow:t=!1}){jt(null);let r=t?"setWalletPassword":"setWalletRecovery";if(!$||!se)throw kt(Ar,r,"onError",Be.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let a=O(se);if(!a||!tr)throw kt(Ar,r,"onError",Be.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");try{await ia()}catch(e){throw kt(Ar,r,"onError",Be.MISSING_MFA_CREDENTIALS),e}return new Promise(((n,i)=>{or(!0);let o={onSuccess:e=>{kt(Ar,r,"onSuccess","user-passcode",e),n(e)},onFailure:e=>{kt(Ar,r,"onError",Be.USER_EXITED_SET_PASSWORD_FLOW),i(e)},callAuthOnSuccessOnClose:!1},s="user-passcode"===a.recoveryMethod,l=it({walletAction:"update",availableRecoveryMethods:ar.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:t,isResettingPassword:s,showAutomaticRecovery:e}),{entropyId:c,entropyIdVerifier:d}=k(a);lr({setWalletPassword:o,recoverWallet:{entropyId:c,entropyIdVerifier:d,onFailure:i},createWallet:o,connectWallet:{onCompleteNavigateTo:l,shouldForceMFA:!1,entropyId:c,entropyIdVerifier:d,onFailure:e=>{kt(Ar,r,"onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),i(e)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:s}}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}))}async function ca({appId:e,action:t}){let r=await Vr();if("link"===t&&!r)throw kt(Ar,"linkAccount","onError",Be.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${e}`}),new Fe("User must be authenticated before linking an account.");if("login"===t&&r)throw kt(Ar,"login","onError",Be.UNKNOWN_AUTH_ERROR),new Fe("Attempted to log in, but user is already logged in. Use a `link` helper instead.");Cr.current=`privy:${e}`,Ir.current=t;let a=dt();return W.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:e}}),new Promise((async(r,n)=>{let{name:i,logoUrl:o}=await Ze({api:W.api,providerAppId:e,requesterAppId:ar.id});lr({crossAppAuth:{appId:e,name:i,logoUrl:o,action:t,popup:a,onSuccess:r,onError:n}}),br(At.CROSS_APP_AUTH_SCREEN)}))}let da={ready:K,authenticated:$,user:se,walletConnectors:W.connectors||null,connectWallet:e=>{e&&"target"in e&&e&&(e=void 0),lr({externalConnectWallet:{walletList:e?.walletList&&e?.walletList.length>0?e.walletList:void 0,suggestedAddress:e?.suggestedAddress}}),Nr($?At.CONNECT_ONLY_AUTHENTICATED_SCREEN:At.CONNECT_ONLY_LANDING_SCREEN)},linkWallet:$r,startCrossAppAuthFlow:ca,linkEmail:()=>{qr("email"),sa("email"),Cr.current="email",Ir.current="link",Nr(At.LINK_EMAIL_SCREEN)},linkPhone:()=>{qr("sms"),sa("phone"),Cr.current="sms",Ir.current="link",Nr(At.LINK_PHONE_SCREEN)},linkGoogle:async()=>{qr("google"),sa("google_oauth"),Ir.current="link",await ua.initLoginWithOAuth("google")},linkTwitter:async()=>{qr("twitter"),sa("twitter_oauth"),Ir.current="link",await ua.initLoginWithOAuth("twitter")},linkDiscord:async()=>{qr("discord"),sa("discord_oauth"),Ir.current="link",await ua.initLoginWithOAuth("discord")},linkGithub:async()=>{qr("github"),sa("github_oauth"),Ir.current="link",await ua.initLoginWithOAuth("github")},linkSpotify:async()=>{qr("spotify"),sa("spotify_oauth"),Ir.current="link",await ua.initLoginWithOAuth("spotify")},linkInstagram:async()=>{qr("instagram"),sa("instagram_oauth"),Ir.current="link",await ua.initLoginWithOAuth("instagram")},linkTiktok:async()=>{qr("tiktok"),sa("tiktok_oauth"),Ir.current="link",await ua.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{qr("linkedin"),sa("linkedin_oauth"),Ir.current="link",await ua.initLoginWithOAuth("linkedin")},linkApple:async()=>{qr("apple"),sa("apple_oauth"),Ir.current="link",await ua.initLoginWithOAuth("apple")},linkPasskey:async()=>{qr("passkey"),sa("passkey"),await ua.initLinkWithPasskey(),Nr(At.LINK_PASSKEY_SCREEN)},linkTelegram:async()=>{qr("telegram"),sa("telegram"),Ir.current="link",Cr.current="telegram",await ua.initLoginWithTelegram(),Nr(At.TELEGRAM_AUTH_SCREEN)},linkFarcaster:async()=>{qr("farcaster"),sa("farcaster"),await ua.initLoginWithFarcaster(),Ir.current="link",Cr.current="farcaster",Nr(At.AWAITING_FARCASTER_CONNECTION)},updateEmail:()=>{if(qr("email"),!se?.email)throw new Fe("User does not have an email linked to their account.");Ir.current="update",Cr.current="email",Nr(At.UPDATE_EMAIL_SCREEN)},updatePhone:()=>{if(qr("sms"),!se?.phone)throw new Fe("User does not have a phone number linked to their account.");Ir.current="update",Cr.current="sms",Nr(At.UPDATE_PHONE_SCREEN)},login:async e=>{e&&"target"in e&&e&&(e=void 0);let t="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!K){let e=await new Promise((e=>{dr((t=>e.bind(t)))}));if(dr(null),e)return void console.warn(t)}!se||se.isGuest?(Ir.current="login",lr({login:e}),br(At.LANDING)):console.warn(t)},connectOrCreateWallet:async()=>{K||(await new Promise((e=>{dr((()=>e))})),dr(null)),$?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(Ir.current="login",br(At.CONNECT_OR_CREATE))},logout:async()=>{if(Ir.current=null,Cr.current=null,se&&W.clearProviderAcccessTokens(se),jt(null),await W.logout(),se&&tr)try{await tr.clearMfa({userId:se.id})}catch(e){}ce(null),Y(!1),kt(Ar,"logout","onSuccess"),H(!1),re.del(q),re.del(X(ar.id))},getAccessToken:()=>W.getCustomerAccessToken(),getEthereumProvider:()=>{if(!se||!se.wallet)return new ve;let e=de.find((e=>se.wallet&&e.address===se.wallet.address)),t=W.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new ve},getEthersProvider:()=>{if(!se||!se.wallet)return new a(new Ce(new ve));let e=de.find((e=>se.wallet&&e.address===se.wallet.address)),t=W.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new a(new Ce(e&&t?t.proxyProvider:new ve))},getWeb3jsProvider:()=>{if(!se||!se.wallet)return new Ie(new ve);let e=de.find((e=>se.wallet&&e.address===se.wallet.address)),t=W.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new Ie(e&&t?t.proxyProvider:new ve)},unlinkWallet:async e=>{let t;return ce(t=e.startsWith("0x")?await W.unlinkEthereumWallet(e):await W.unlinkSolanaWallet(e)),t},unlinkEmail:async e=>{let t=await W.unlinkEmail(e);return ce(t),t},unlinkPhone:async e=>{let t=await W.unlinkPhone(e);return ce(t),t},unlinkGoogle:async e=>{let t=await W.unlinkOAuth("google",e);return ce(t),t},unlinkTwitter:async e=>{let t=await W.unlinkOAuth("twitter",e);return ce(t),t},unlinkDiscord:async e=>{let t=await W.unlinkOAuth("discord",e);return ce(t),t},unlinkGithub:async e=>{let t=await W.unlinkOAuth("github",e);return ce(t),t},unlinkSpotify:async e=>{let t=await W.unlinkOAuth("spotify",e);return ce(t),t},unlinkInstagram:async e=>{let t=await W.unlinkOAuth("instagram",e);return ce(t),t},unlinkTiktok:async e=>{let t=await W.unlinkOAuth("tiktok",e);return ce(t),t},unlinkLinkedIn:async e=>{let t=await W.unlinkOAuth("linkedin",e);return ce(t),t},unlinkApple:async e=>{let t=await W.unlinkOAuth("apple",e);return ce(t),t},unlinkFarcaster:async e=>{let t=await W.unlinkFarcaster(e);return ce(t),t},unlinkTelegram:async e=>{let t=await W.unlinkTelegram(e);return ce(t),t},unlinkPasskey:async e=>{let t=await W.unlinkPasskey(e);return ce(t),t},unlinkCrossAppAccount:async({subject:e})=>{let t=se?.linkedAccounts.find((t=>"cross_app"===t.type&&t.subject===e))?.providerApp;if(!t)throw new Fe("Invalid subject");W.storeProviderAccessToken(t.id,null);let r=await W.unlinkOAuth(`privy:${t.id}`,e);return ce(r),r},setActiveWallet:async e=>{let t=de.find((t=>r(t.address)===r(e))),a=se?.linkedAccounts.find((t=>"wallet"===t.type&&r(t.address)===r(e)));if(t&&await t.isConnected())if(t.linked){let e=Object.assign({},se);e.wallet=a&&{address:a.address,chainType:a.chainType,chainId:a.chainId,walletClient:a.walletClient,walletClientType:a.walletClientType,connectorType:a.connectorType,imported:a.imported,delegated:a.delegated,walletIndex:a.walletIndex},ce(e)}else t.loginOrLink();else lr({externalConnectWallet:{suggestedAddress:e}}),$r()},forkSession:()=>W.forkSession(),createWallet:async e=>{if(e&&"target"in e&&e&&(e=void 0),!$||!se)throw kt(Ar,"createWallet","onError",Be.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return Jr(se,15e3,e)},setWalletRecovery:async e=>la({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:e?.showAutomaticRecovery??!1}),setWalletPassword:async()=>la({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(e,t,r)=>new Promise((async(a,n)=>{let{requesterAppId:i}=t||{};if(!$||!se)return kt(Ar,"signMessage","onError",Be.MUST_BE_AUTHENTICATED),void n(Error("User must be authenticated before signing with a Privy wallet"));let o=r??S(se)?.address;if(!o)throw new Fe("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:l}=x(se,o);if(!s||!l)return kt(Ar,"signMessage","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void n(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return kt(Ar,"signMessage","onError",Be.INVALID_MESSAGE),void n(Error("Message must be a non-empty string"));or(!0);let c=async()=>{if(!$)throw Error("User must be authenticated before signing with a Privy wallet");let t=await Vr();if(!tr||!t||!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");W.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:s.address,requesterAppId:i}});let{entropyId:r,entropyIdVerifier:a}=k(l),{response:n}=await tr.rpc({accessToken:t,entropyId:r,entropyIdVerifier:a,chainType:"ethereum",hdWalletIndex:s.walletIndex??0,requesterAppId:i,request:{method:"personal_sign",params:[e,s.address]}}),o=n.data;return W.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:s.address,requesterAppId:i}}),o};if(kr({showWalletUIs:t?.showWalletUIs}))try{let e=await c();kt(Ar,"signMessage","onSuccess",e),a(e)}catch(e){kt(Ar,"signMessage","onError",Be.UNABLE_TO_SIGN),n(e??new Ee("Unable to sign message"))}else{let{entropyId:r,entropyIdVerifier:i}=k(l);lr({signMessage:{method:"personal_sign",data:e,confirmAndSign:c,onSuccess:e=>{kt(Ar,"signMessage","onSuccess",e),a(e)},onFailure:e=>{kt(Ar,"signMessage","onError",Be.UNABLE_TO_SIGN),n(e)},uiOptions:t||{}},connectWallet:{entropyId:r,entropyIdVerifier:i,onCompleteNavigateTo:At.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{kt(Ar,"signMessage","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),n(e)}}}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),signTypedData:(e,t,r)=>new Promise((async(a,n)=>{let{requesterAppId:i}=t||{};if(!$||!se)return kt(Ar,"signTypedData","onError",Be.MUST_BE_AUTHENTICATED),void n(Error("User must be authenticated before signing with a Privy wallet"));let o=r??S(se)?.address;if(!o)throw new Fe("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:l}=x(se,o);if(!l||!s)return kt(Ar,"signTypedData","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void n(Error("Must have a Privy wallet before signing"));or(!0);let c=ie(e),d=async()=>{if(!$)throw Error("User must be authenticated before signing with a Privy wallet");let e=await Vr();if(!tr||!e||!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");W.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:s.address,requesterAppId:i}});let{entropyId:t,entropyIdVerifier:r}=k(l),{response:a}=await tr.rpc({accessToken:e,entropyId:t,entropyIdVerifier:r,chainType:"ethereum",hdWalletIndex:s.walletIndex??0,requesterAppId:i,request:{method:"eth_signTypedData_v4",params:[s.address,c]}}),n=a.data;return W.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:s.address,requesterAppId:i}}),n};if(kr({showWalletUIs:t?.showWalletUIs,typedData:!0}))try{let e=await d();kt(Ar,"signTypedData","onSuccess",e),a(e)}catch(e){kt(Ar,"signTypedData","onError",Be.UNABLE_TO_SIGN),n(e??new Ee("Unable to sign message"))}else{let{entropyId:e,entropyIdVerifier:r}=k(l);lr({signMessage:{method:"eth_signTypedData_v4",data:c,confirmAndSign:d,onSuccess:e=>{kt(Ar,"signTypedData","onSuccess",e),a(e)},onFailure:e=>{kt(Ar,"signTypedData","onError",Be.UNABLE_TO_SIGN),n(e)},uiOptions:t||{}},connectWallet:{entropyId:e,entropyIdVerifier:r,onCompleteNavigateTo:At.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{kt(Ar,"signMessage","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),n(e)}}}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),sendTransaction:async(e,t,r,a)=>{let n=await aa(e,t,r,a);return De(await n.wait())},sendSolanaTransaction:async(e,t,r,a,n,i)=>{let o=i?me.find((({address:e})=>e===i)):me.slice().sort(((e,t)=>(e.walletIndex??0)-(t.walletIndex??0)))[0];if(!o)throw kt(Ar,"sendSolanaTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),new Fe("Embedded wallet not found",Be.EMBEDDED_WALLET_NOT_FOUND);return await na({transaction:e,connection:t,transactionOptions:a,uiOptions:r,fundWalletConfig:n,wallet:o})},exportWallet:e=>new Promise((async(t,r)=>{if(!$||!se)return void r(Error("User must be authenticated before exporting their Privy wallet"));e&&"target"in e&&e&&(e=void 0);let a=e?.address??S(se)?.address;if(!a)return void r(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));let{signingWallet:n,rootWallet:i}=x(se,a);if(!n||!i)return void r(Error("Must have a Privy wallet before exporting"));or(!0);let{entropyId:o,entropyIdVerifier:s}=k(i),l={entropyId:o,entropyIdVerifier:s,onCompleteNavigateTo:At.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:r,shouldForceMFA:!0};lr(sr),await Vr()&&tr?tr?(lr({keyExport:{appId:I.appId,appClientId:I.clientId,origin:W.apiUrl,walletToExport:n,primaryWallet:i,onSuccess:t,onFailure:r},connectWallet:l}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)):r(Error("Must have a Privy wallet before exporting")):r(Error("Must have valid access token to enroll in MFA"))})),promptMfa:ia,async init(e){switch(e){case"sms":return void await W.initMfaSmsVerification();case"passkey":return await W.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${e}`)}},async submit(e,t){switch(e){case"totp":case"sms":if("string"!=typeof t)throw new Fe("Invalid MFA code");Er.current?.resolve({mfaMethod:e,mfaCode:t,relyingParty:window.origin}),await new Promise(((e,t)=>{_r.current={resolve:e,reject:t}}));break;case"passkey":if("string"==typeof t)throw new Fe("Invalid authenticator response");let r=await import("@simplewebauthn/browser"),a=yt(await r.startAuthentication(t));Er.current?.resolve({mfaMethod:e,mfaCode:a,relyingParty:window.origin}),await new Promise(((e,t)=>{_r.current={resolve:e,reject:t}}));break;default:throw Er.current?.reject(new Fe("Unsupported MFA method")),new Fe(`Unsupported MFA method: ${e}`)}},cancel(){Er.current?.reject(new Fe("MFA canceled"))},async initEnrollmentWithSms(e){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to enroll in MFA");await tr.initEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber})},enrollInMfa:e=>new Promise(((t,r)=>{if(!e)return ua.closePrivyModal(),void t();ar.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),lr({mfaEnrollmentFlow:{mfaMethods:ar.mfa.methods,onSuccess:t,onFailure:r}}),Nr(At.MFA_ENROLLMENT_FLOW_SCREEN)})),async initEnrollmentWithTotp(){let e=await Vr();if(!e||!tr)throw Error("Must have valid access token to enroll in MFA");let t=await tr.initEnrollMfa({method:"totp",accessToken:e});return{secret:t.secret,authUrl:t.authUrl}},async submitEnrollmentWithSms(e){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to enroll in MFA");await tr.submitEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber,code:e.mfaCode}),ce(await W.getAuthenticatedUser())},async submitEnrollmentWithTotp(e){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to enroll in MFA");await tr.submitEnrollMfa({method:"totp",accessToken:t,code:e.mfaCode}),ce(await W.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:e}){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to enroll in MFA");await tr.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:e}),ce(await W.getAuthenticatedUser())},async unenroll(e){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to remove MFA");"passkey"===e?await tr.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:[]}):await tr.unenrollMfa({method:e,accessToken:t}),ce(await W.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{let e=await Vr(),t=se?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!e)throw Error("Must have valid access token to connect with Farcaster");if(!tr||!t)throw Error("Must have an embedded wallet to use Farcaster signers");if(!se?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");let r=await tr.initFarcasterSigner({address:t.address,hdWalletIndex:null,accessToken:e,mfaCode:null,mfaMethod:null,relyingParty:window.origin});"approved"===r.status&&ce(await W.getAuthenticatedUser()||se||null),lr({farcasterSigner:r}),Nr(At.AWAITING_FARCASTER_SIGNER)},getFarcasterSignerPublicKey:async()=>{let e,t=await Vr(),r=se?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!tr||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!se?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!se.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");return e=se.farcaster.signerPublicKey.slice(2),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},signFarcasterMessage:async e=>{let t=await Vr(),r=se?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!tr||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!se?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!se.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");let a=await import("@simplewebauthn/browser"),n=await tr.signFarcasterMessage({address:r.address,hdWalletIndex:null,accessToken:t,mfaCode:null,mfaMethod:null,payload:{hash:a.bufferToBase64URLString(e)},fid:BigInt(se.farcaster.fid),relyingParty:window.origin});return new Uint8Array(a.base64URLStringToBuffer(n.signature))},createGuestAccount:async()=>{if(se&&!se.isGuest)throw Error("User cannot already be authenticated to create a guest account");return se?.isGuest?se:ua.loginWithGuestAccountFlow()},signMessageWithCrossAppWallet(e,{address:t}){let r=se?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t))));return tt({user:se,client:W,address:t,requesterAppId:ar.id,request:{method:r?"privy_signSmartWalletMessage":"personal_sign",params:[e,t]},reconnect:ca})},signTypedDataWithCrossAppWallet(e,{address:t}){let r=se?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t)))),a=ie(e);return tt({user:se,client:W,address:t,requesterAppId:ar.id,request:{method:r?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[t,a]},reconnect:ca})},sendTransactionWithCrossAppWallet(e,{address:t}){let r=se?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t))));return tt({user:se,client:W,address:t,requesterAppId:ar.id,request:{method:r?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[e]},reconnect:ca})},isModalOpen:V,mfaMethods:ar.mfa.methods};Dr=da.signMessage,Lr=da.signTypedData,Mr=async(...e)=>{let t=await aa(...e);return ar.embeddedWallets.waitForTransactionConfirmation&&await t.wait(),t};let ua={setAuthenticated:Y,setUser:ce,isNewUserThisSession:Mt,pendingTransaction:null,walletConnectionStatus:Ht,connectors:W.connectors?.walletConnectors??[],solanaWallets:me,rpcConfig:ar.rpcConfig,chains:ar.chains,appId:I.appId,showFiatPrices:"native-token"!==ar.embeddedWallets.priceDisplay.primary,clientAnalyticsId:W.clientAnalyticsId,customAuthStatus:fr,noPromptOnSignature:Wr,emailOtpState:qt,setEmailOtpState:$t,smsOtpState:Yt,setSmsOtpState:Xt,oAuthState:Zt,setOAuthState:er,siweState:Qt,setSiweState:Jt,isHeadlessOAuthLoading:Bt,nativeTokenSymbolForChainId:e=>ar.chains.find((t=>t.id===Number(e)))?.nativeCurrency.symbol,initializeWalletProxy:async e=>{if(tr)return tr;let t=new Promise((e=>{hr((()=>t=>e(t)))})),r=new Promise((t=>setTimeout((()=>t(null)),e))),a=await Promise.race([t,r]);return hr(null),a},getAuthFlow:()=>W.authFlow,getAuthMeta:()=>W.authFlow?.meta,client:W,closePrivyModal:async(e={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let t,r=K&&$&&se;r&&Cr.current&&(t=oa(se)),"login"===Ir.current?e.shouldCallAuthOnSuccess&&r&&Cr.current?(kt(Ar,"login","onComplete",se,Mt,!1,Cr.current,t??null),I.onSuccess?.(se,Mt)):kt(Ar,"login","onError",Be.USER_EXITED_AUTH_FLOW):"link"===Ir.current&&t?e.isSuccess&&r&&Cr.current?kt(Ar,"linkAccount","onSuccess",se,Cr.current,t):Cr.current&&kt(Ar,"linkAccount","onError",Be.USER_EXITED_LINK_FLOW,{linkMethod:Cr.current}):"update"===Ir.current&&t&&(e.isSuccess&&r&&Cr.current?kt(Ar,"update","onSuccess",se,Cr.current,t):Cr.current&&kt(Ar,"update","onError",Be.USER_EXITED_UPDATE_FLOW,{linkMethod:Cr.current}));let a=xt&&ot.includes(xt),n=xt===At.ERROR_SCREEN&&sr.errorModalData&&ot.includes(sr.errorModalData.previousScreen);if((a||n)&&sr.funding){let e,t=st[xt]??null;if("solana"===sr.funding.chainType){let r=N(Et);if(!r)return void console.warn("Unable to load solana plugin, skipping balance");try{e=BigInt(await r.getBalance({address:sr.funding.address,cluster:sr.funding.cluster}))}catch{console.error("Unable to pull wallet balance")}kt(Ar,"fundSolanaWallet","onUserExited",{address:sr.funding.address,cluster:sr.funding.cluster,fundingMethod:t,balance:e})}else{let r=ne(sr.funding.chain.id,ar.chains,ar.rpcConfig,{appId:I.appId});try{e=(await r.getBalance(sr.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}kt(Ar,"fundWallet","onUserExited",{address:sr.funding.address,chain:sr.funding.chain,fundingMethod:t,balance:e})}}lr({...sr,externalConnectWallet:{suggestedAddress:void 0}}),Ir.current=null,Cr.current=null,Ft(!1),H(!1),setTimeout((()=>{W.authFlow=void 0}),200),W.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:({message:e,address:t})=>new Promise((async(r,a)=>{if(!$||!se)return kt(Ar,"signMessage","onError",Be.MUST_BE_AUTHENTICATED),void a(Error("User must be authenticated before signing with a Privy wallet"));let n=t??L(se)?.address;if(!n)throw new Fe("User must have an embedded wallet to sign a message.");let{signingWallet:i,rootWallet:o}=F(se,n);if(!i||!o)return kt(Ar,"signMessage","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void a(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return kt(Ar,"signMessage","onError",Be.INVALID_MESSAGE),void a(Error("Message must be a non-empty string"));or(!0);let s=async()=>{if(!$)throw Error("User must be authenticated before signing with a Privy wallet");let t=await W.getAccessToken();if(!t)throw Error("User must be authenticated to use their embedded wallet.");let r=ua.walletProxy??await ua.initializeWalletProxy(15e3);if(!r)throw Error("Failed to initialize embedded wallet proxy.");if(!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!o)throw Error("No root wallet for signing wallet found");let{entropyId:a,entropyIdVerifier:n}=k(o),{response:s}=await r.rpc({accessToken:t,entropyId:a,entropyIdVerifier:n,chainType:"solana",hdWalletIndex:i.walletIndex??0,request:{method:"signMessage",params:{message:e}}});return s.data.signature};if(kr({showWalletUIs:void 0}))try{let e=await s();r({signature:e})}catch(e){a(e)}else{let{entropyId:t,entropyIdVerifier:n}=k(o);lr({signMessage:{method:"solana_signMessage",data:e,confirmAndSign:s,onSuccess:e=>{r({signature:e})},onFailure:e=>{a(e)},uiOptions:{}},connectWallet:{entropyId:t,entropyIdVerifier:n,onCompleteNavigateTo:At.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{kt(Ar,"signMessage","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),a(e)}}}),br(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),openPrivyModal:Nr,connectWallet:Hr,initLoginWithWallet:async(e,t,r)=>{Te(e)?(Cr.current="siwe",Kr(e,t,r)):(Cr.current="siws",Gr(e,t))},loginWithWallet:async()=>{let e,t,r;if(!K)throw new Ve;if(W.authFlow instanceof E?e="siwe":W.authFlow instanceof _&&(e="siws"),!e)throw new Fe("Must initialize SIWE/SIWS flow first.");if(null!==await W.getAccessToken())try{({user:t}=await W.link()),Cr.current=e}catch(t){throw kt(Ar,"linkAccount","onError",t.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{({user:t,isNewUser:r}=await W.authenticate()),Cr.current=e}catch(e){throw kt(Ar,"login","onError",e.privyErrorCode||Be.GENERIC_CONNECT_WALLET_ERROR),e}ce(t||se||null),Ft(r||!1),Y(!0)},delegateWallet:async({address:e,chainType:t})=>new Promise((async(r,a)=>{let n=await Vr();if(!$||!se||!n)throw new Fe("User must be authenticated and have an embedded wallet to delegate actions.");if("solana"!==t&&"ethereum"!==t)throw new Fe("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let i=ua.walletProxy??await ua.initializeWalletProxy(15e3);if(!i)throw new Fe("Wallet proxy not initialized.");if(Ue({address:e,chainType:t,user:se}))return r();let o=Oe({address:e,user:se}),s=Se({address:e,user:se});await ua.recoverPrimaryWallet(),lr({delegatedActions:{consent:{address:e,onDelegate:async()=>{await i.createDelegatedAction({accessToken:n,rootWallet:s,delegatedWallets:[o]}),await ua.refreshUser()},onSuccess:async()=>{r()},onError:async e=>{a(e)}}}}),Nr(At.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN)})),revokeDelegatedWallets:async()=>new Promise((async(e,t)=>{if(!$||!se)throw new Fe("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");if(0===Re(se).length)throw new Fe("User has no delegated wallets to revoke.");lr({delegatedActions:{revoke:{onRevoke:async()=>{await W.revokeDelegatedWallet(),await ua.refreshUser()},onSuccess:async()=>{e()},onError:async e=>{t(e)}}}}),Nr(At.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN)})),initLoginWithFarcaster:async(e,t)=>{let r=new y(e,t);W.startAuthFlow(r);try{Cr.current="farcaster",await r.initializeFarcasterConnect()}catch(e){throw"login"===Ir.current?kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR):"link"===Ir.current&&kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),e}},loginWithFarcaster:async()=>{let e,t;if(!K)throw new Ve;if(!(W.authFlow instanceof y))throw new Fe("Must initialize Farcaster flow first.");if(null!==await W.getAccessToken())try{({user:e}=await W.link()),Cr.current="farcaster"}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),e}else try{({user:e,isNewUser:t}=await W.authenticate()),Cr.current="farcaster"}catch(e){throw kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}ce(e||null),Ft(t||!1),Y(!0)},async loginWithGuestAccountFlow(){let e=new f(this.appId);W.startAuthFlow(e);try{Ir.current="login",Cr.current="guest";let{user:e,isNewUser:t}=await W.authenticate();if(t=t||!1,!e)throw new Fe("Unable to authenticate guest account");if(D(e,ar.embeddedWallets.createOnLogin))try{await Jr(e,15e3),e=await ua.refreshUser()}catch(t){ce(e),console.warn("Unable to create embedded wallet for guest account")}else ce(e);return Ft(t),Y(!0),kt(Ar,"login","onComplete",e,t,!1,"guest",null),e}catch(e){throw kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}},async crossAppAuthFlow({appId:e,popup:t,action:r}){let a=`privy:${e}`;Cr.current=a;let{url:n,stateCode:i,codeVerifier:o}=await Qe({api:W.api,appId:e});if(!n)throw W.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:e}}),new Fe("No authorization URL returned for cross-app auth.");try{let s=await et({url:n,popup:t,provider:a}),l=s.stateCode,c=s.authorizationCode;if(l!==i)throw W.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:a,storedStateCode:i??"",returnedStateCode:l??""}}),new Fe("Unexpected auth flow. This may be a phishing attempt.",void 0,Be.OAUTH_UNEXPECTED);let d=await Je({appId:e,codeVerifier:o,stateCode:l,authorizationCode:c,action:r,client:W});d&&W.storeProviderAccessToken(e,d);let u=await ua.refreshUser();if(!u)throw new Fe("Unable to update user");return W.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:e}}),u}catch(e){throw W.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:e.toString(),provider:a}}),e}},async initLoginWithOAuth(e,t,r){if(Cr.current=e,!ae())return void br(At.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);if("google"===e&&ct(window.navigator.userAgent))return void br(At.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);"twitter"===e&&window.opener&&window.opener.postMessage({type:$e},"*"),re.del(Q),re.del(J);let a=new Lt({provider:e,disableSignup:!!r,withPrivyUi:!0});t&&a.addCaptchaToken(t),W.startAuthFlow(a);let n=await W.authFlow.getAuthorizationUrl();n&&n.url&&("twitter"===e&&c&&(n.url=n.url.replace("x.com","twitter.com")),window.location.assign(n.url))},async initLoginWithTelegram(e,t){if(!K)throw new Ve;Cr.current="telegram";let r=new v(e,t);W.startAuthFlow(r),r.meta.telegramWebAppData=void 0,r.meta.telegramAuthResult=await new Promise(((e,t)=>ar.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:ar.loginConfig.telegramAuthConfiguration.botId,request_access:!0},(r=>r?e(r):t(new Fe("Telegram auth failed or was canceled by the client")))):t(new Fe("Telegram was not initialized")):t(new Fe("Telegram Auth configuration is not loaded"))))},async loginWithTelegram(e){let t,r;if(!(W.authFlow instanceof v))throw new Fe("Must initialize Telegram flow before calling loginWithTelegram");if(W.authFlow.meta.captchaToken||=e,"login"===Ir.current)try{let e=await W.authenticate();t=e.user,r=e.isNewUser,Cr.current="telegram"}catch(e){throw kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}else{if("link"!==Ir.current)throw new Fe("Unknown auth intent");try{t=(await W.link()).user,Cr.current="telegram"}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),e}}ce(t),Ft(r||!1),Y(!0)},async recoveryOAuthFlow(e,t,r){let a,n;function i(t){if(!t)throw W.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:e}}),new Fe("Recovery OAuth failed")}switch(e){case"google-drive":{let t,o,{url:s,codeVerifier:l,stateCode:c}=await rt({api:Pr.api,provider:e});i(s);try{let a=await ut({url:s,popup:r,provider:e});if(t=a.stateCode,o=a.authorizationCode,t!==c)throw W.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:c??"",returnedStateCode:t??""}}),new Fe("Unexpected auth flow. This may be a phishing attempt.",void 0,Be.OAUTH_UNEXPECTED)}catch(t){throw W.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:e}}),new Fe("Recovery OAuth failed")}[a,n]=await Promise.all([Vr(),at({api:Pr.api,provider:e,codeVerifier:l,stateCode:t,authorizationCode:o})]);break}case"icloud":{let{url:t}=await rt({api:Pr.api,provider:e});i(t);let{ckWebAuthToken:o}=await ut({url:t,popup:r,provider:e});n=o,a=await Vr()}}if(!tr)throw new Fe("Cannot connect to wallet proxy");if(!a)throw new Fe("Unable to authorize user");switch(t){case"recover":{let t=sr.recoverWallet?.entropyId,r=sr.recoverWallet?.entropyIdVerifier;if(!t||!r)throw new Fe("Recovery OAuth failed");W.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:t,recoveryMethod:e}}),await tr.recover({accessToken:a,entropyId:t,entropyIdVerifier:r,recoveryAccessToken:n}),W.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t,recoveryMethod:e}});break}case"create-wallet":{W.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await tr.create({accessToken:a,recoveryAccessToken:n,recoveryMethod:e});let t=S(await ua.refreshUser());if(!t)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");W.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.address}}),kt(Ar,"createWallet","onSuccess",t);break}case"set-recovery":{let t=O(se);if(!t)throw kt(Ar,"setWalletRecovery","onError",Be.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");W.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:t.address,existingRecoveryMethod:t.recoveryMethod,targetRecoveryMethod:e}});let{entropyId:r,entropyIdVerifier:i}=k(t);await tr.setRecovery({accessToken:a,entropyId:r,entropyIdVerifier:i,recoveryMethod:e,recoveryAccessToken:n});let o=O(await ua.refreshUser());if(!o)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");W.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:t.address,existingRecoveryMethod:t.recoveryMethod,targetRecoveryMethod:e}}),kt(Ar,"setWalletRecovery","onSuccess",e,o);break}default:throw new Fe("Unsupported recovery action")}},async loginWithOAuth(e){let t,r,a;if(!(W.authFlow instanceof Lt))throw new Fe("Must initialize OAuth flow before calling loginWithOAuth");let n=re.get(Z),i=W.authFlow.meta.stateCode;if(n!==i)throw W.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:n??"",returnedStateCode:i??""}}),new Fe("Unexpected auth flow. This may be a phishing attempt.",void 0,Be.OAUTH_UNEXPECTED);if(null!==await W.getAccessToken())try{let r=await W.link();t=r.user,a=r.oAuthTokens,Cr.current=e}catch(t){throw kt(Ar,"linkAccount","onError",t.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{let n=await W.authenticate();t=n.user,r=n.isNewUser,a=n.oAuthTokens,Cr.current=e}catch(t){throw"login"===Ir.current?kt(Ar,"login","onError",t.privyErrorCode||Be.UNKNOWN_AUTH_ERROR):"link"===Ir.current&&kt(Ar,"linkAccount","onError",t.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}return ce(t),Ft(r||!1),Y(!0),a&&t&&kt(Ar,"oAuthAuthorization","onOAuthTokenGrant",a,{user:t}),a},passkeyAuthState:Gt,setPasskeyAuthState:zt,async initLoginWithPasskey({captchaToken:e,withPrivyUi:t}){let r=new g({captchaToken:e,setPasskeyAuthState:zt});W.startAuthFlow(r),Ir.current="login";try{Cr.current="passkey",zt({status:"generating-challenge"}),await r.initAuthenticationFlow(t),zt({status:"awaiting-passkey"})}catch(e){throw zt({status:"error",error:e}),kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}},async loginWithPasskey(){let e,t;if(!K)throw new Ve;if(!(W.authFlow instanceof g))throw new Fe("Must initialize Passkey flow first.");if("passkey"!==Cr.current){let e=new Fe("Must init login with Passkey flow first.");throw zt({status:"error",error:e}),e}let r=await Vr();try{Cr.current="passkey",zt({status:"awaiting-passkey"}),({user:e,isNewUser:t}=await W.authenticate())}catch(e){throw zt({status:"error",error:e}),kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}ce(e),Ft(t||!1),Y(!0),zt({status:"done"});let a=e?.linkedAccounts.find((({type:e})=>"passkey"===e))||null;return{user:e,isNewUser:t||!1,wasAlreadyAuthenticated:!!r,loginAccount:a}},async initLinkWithPasskey(e){let t=new g({captchaToken:e});W.startAuthFlow(t),Ir.current="link",Cr.current="passkey",zt({status:"generating-challenge"});try{await t.initLinkFlow(),zt({status:"awaiting-passkey"})}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),zt({status:"error",error:e}),e}},async linkWithPasskey(){let e;if(!K)throw new Ve;if(!(W.authFlow instanceof g))throw new Fe("Must initialize Passkey flow first.");if("passkey"!==Cr.current)throw new Fe("Must init login with Passkey flow first.");try{Cr.current="passkey",({user:e}=await W.link())}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),e}return ce(e||se||null),zt({status:"done"}),e},async initLoginWithHeadlessOAuth(e,t,r){if(!ae())throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");if("google"===e&&ct(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let a=new Lt({provider:e,withPrivyUi:!1,disableSignup:r??!1});t&&a.addCaptchaToken(t),er({status:"loading"});let n=await W.startAuthFlow(a).getAuthorizationUrl();n?.url&&window.location.assign(n.url)},async loginWithHeadlessOAuth(e){let t,r,a;Vt(!0),er({status:"loading"}),W.startAuthFlow(new Lt(e));let n=re.get(Z),i=e.stateCode;if(n!==i)throw W.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e.provider,storedStateCode:n??"",returnedStateCode:i??""}}),Vt(!1),new Fe("Unexpected auth flow. This may be a phishing attempt.",void 0,Be.OAUTH_UNEXPECTED);if(null!==await W.getAccessToken())try{({user:t,oAuthTokens:a}=await W.link()),Cr.current=e.provider;let r=oa(t);t&&r&&kt(Ar,"linkAccount","onSuccess",t,Cr.current,r)}catch(t){throw Vt(!1),kt(Ar,"linkAccount","onError",t.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:e.provider}),t}else try{({user:t,isNewUser:r,oAuthTokens:a}=await W.authenticate()),Cr.current=e.provider;let n=oa(t);t&&n&&void 0!==r&&kt(Ar,"login","onComplete",t,r,!1,Cr.current,n)}catch(e){throw Vt(!1),er({status:"error",error:e}),kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}return ce(t),Ft(r||!1),Y(!0),Vt(!1),er({status:"done"}),a&&t&&kt(Ar,"oAuthAuthorization","onOAuthTokenGrant",a,{user:t}),t??void 0},initLoginWithEmail:async({email:e,captchaToken:t,disableSignup:r,withPrivyUi:a})=>{let n=new m({email:e,captchaToken:t,disableSignup:r});W.startAuthFlow(n);try{Cr.current="email",$t({status:"sending-code"}),await n.sendCodeEmail({withPrivyUi:a}),$t({status:"awaiting-code-input"})}catch(e){throw $t({status:"error",error:e}),"login"===Ir.current?kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR):"link"===Ir.current&&kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),e}},initUpdateEmail:async(e,t,r)=>{let a=new w(e,t,r);W.startAuthFlow(a);try{await a.sendCodeEmail({withPrivyUi:!0})}catch(e){kt(Ar,"update","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR,{linkMethod:Cr.current})}},initUpdatePhone:async(e,t,r)=>{let a=new A(e,t,r);W.startAuthFlow(a);try{await a.sendSmsCode({withPrivyUi:!0})}catch(e){kt(Ar,"update","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR,{linkMethod:Cr.current})}},initLoginWithSms:async({phoneNumber:e,captchaToken:t,disableSignup:r,withPrivyUi:a})=>{Xt({status:"sending-code"});let n=new T({phoneNumber:e,captchaToken:t,disableSignup:r});W.startAuthFlow(n);try{Cr.current="sms",await n.sendSmsCode({withPrivyUi:a}),Xt({status:"awaiting-code-input"})}catch(e){throw Xt({status:"error",error:e}),"login"===Ir.current?kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR):"link"===Ir.current&&kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),e}},resendEmailCode:async()=>{await(W.authFlow?.sendCodeEmail({withPrivyUi:!0}))},resendSmsCode:async()=>{await(W.authFlow?.sendSmsCode({withPrivyUi:!0}))},loginWithCode:async e=>{let t,r;function a(e){W.authFlow instanceof m?$t(e):W.authFlow instanceof T&&Xt(e)}if(a({status:"submitting-code"}),!K){let e=new Ve;throw a({status:"error",error:e}),e}if(W.authFlow instanceof m)W.authFlow.meta.emailCode=e.trim();else{if(!(W.authFlow instanceof T)){let e=new Fe("Must initialize a passwordless code flow first");throw a({status:"error",error:e}),e}W.authFlow.meta.smsCode=e.trim()}let n=await Vr();if("link"===Ir.current)try{({user:t}=await W.link())}catch(e){throw a({status:"error",error:e}),kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:Cr.current}),e}else if("update"===Ir.current)try{({user:t}=await W.link())}catch(e){throw a({status:"error",error:e}),kt(Ar,"update","onError",e.privyErrorCode||Be.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:Cr.current}),e}else try{({user:t,isNewUser:r}=await W.authenticate())}catch(e){throw a({status:"error",error:e}),kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}let i=t||se;ce(i||null),Ft(r||!1),Y(!0),a({status:"done"});let o=null;return W.authFlow instanceof m?o=i?.linkedAccounts.find((({type:e})=>"email"===e))||null:W.authFlow instanceof T&&(o=i?.linkedAccounts.find((({type:e})=>"phone"===e))||null),{user:i,isNewUser:r||!1,wasAlreadyAuthenticated:!!n,linkedAccount:o}},generateSiweMessage:async({address:e,chainId:t,captchaToken:r})=>{Ir.current="link",Cr.current="siwe",Jt({status:"generating-message"});let a=await W.generateSiweNonce({address:e,captchaToken:r});return Jt({status:"awaiting-signature"}),ht({address:e,chainId:t.replace("eip155:",""),nonce:a})},generateSiweMessageForSmartWallet:async({address:e,chainId:t})=>{let r=await W.generateSiweNonce({address:e});return ht({address:e,chainId:t.replace("eip155:",""),nonce:r})},linkSmartWallet:async({message:e,signature:t,smartWalletType:r})=>{let a;a=await W.linkSmartWallet({message:e,signature:t,smartWalletType:r}),ce((a=await ua.refreshUser()??a)||se||null)},linkWithSiwe:async({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n})=>{let i;qr("siwe");let o=null;try{Jt({status:"submitting-signature"}),i=await W.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}),i=await ua.refreshUser()??i,Jt({status:"done"}),(o=oa(i)||null)&&kt(Ar,"linkAccount","onSuccess",i,"siwe",o)}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Ir.current=null,Cr.current=null,Jt({status:"error",error:e}),e}let s=i||se;return ce(s||null),Ir.current=null,Cr.current=null,{user:s,linkedAccount:o}},refreshUser:async()=>{let e=await W.getAuthenticatedUser();return Y(!!e),ce(e),e},walletProxy:tr,createAnalyticsEvent:({eventName:e,payload:t,timestamp:r})=>W.createAnalyticsEvent({eventName:e,payload:t,timestamp:r}),acceptTerms:async()=>{let e=await W.acceptTerms();return ce(e),e},getUsdTokenPrice:e=>W.getUsdTokenPrice(e),getUsdPriceForSol:()=>W.getUsdPriceForSol(),recoverPrimaryWallet:async e=>new Promise((async(t,r)=>{let a=O(e?.user??se)||P(e?.user??se)||U(e?.user??se),n=await Vr();if(!n||!tr||!a)return void r(Error("Must have valid access token and Privy wallet to recover wallet"));or(!0);let{entropyId:i,entropyIdVerifier:o}=k(a);try{await tr.connect({accessToken:n,entropyId:i,entropyIdVerifier:o}),t(!0)}catch(e){Pe(e)&&"privy"===a.recoveryMethod?(W.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:a.address}}),(await tr.recover({entropyId:i,entropyIdVerifier:o,accessToken:n})).entropyId||r(Error("Unable to recover wallet")),W.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:a.address}}),t(!0)):Pe(e)&&"privy"!==a.recoveryMethod?(lr({recoverWallet:{entropyId:i,entropyIdVerifier:o,onFailure:r,onSuccess:()=>t(!0)},recoveryOAuthStatus:{provider:a.recoveryMethod,action:"recover"}}),Nr(nt(a.recoveryMethod))):r(e)}})),createEmbeddedSolanaWallet:async e=>{if(e&&"target"in e&&(e=void 0),!$||!se)throw kt(Ar,"createWallet","onError",Be.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return(async(e,t,r)=>{let a=S(e),n=L(e),i=r&&"createAdditional"in r&&r.createAdditional,o=r&&"walletIndex"in r?r.walletIndex:void 0,s=(j(e)?.walletIndex??-1)+1;if(n&&!i&&"number"!=typeof o)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");if("number"==typeof o&&o<0)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${o}) is invalid.`);let[l,c]=await Promise.all([ua.initializeWalletProxy(t),Vr()]);if(!l||!c)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return await ta({user:e,wp:l,accessToken:c,walletIndex:o??s,ethereumWallet:a})})(se,15e3,e)},exportSolanaWallet:e=>new Promise((async(t,r)=>{if(!$||!se)return void r(Error("User must be authenticated before exporting their Privy wallet"));let a=e?.address??L(se)?.address;if(!a)return void r(Error("User does not have an HD Solana wallet."));let{signingWallet:n,rootWallet:i}=F(se,a);if(!n||!i)return void r(Error("Must have a Privy wallet before exporting"));if(or(!0),!await Vr()||!tr)return void r(Error("Must have valid access token to enroll in MFA"));if(!tr)return void r(Error("Must have a Privy wallet before exporting"));let{entropyId:o,entropyIdVerifier:s}=k(i);lr({connectWallet:{entropyId:o,entropyIdVerifier:s,onCompleteNavigateTo:At.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:r,shouldForceMFA:!0},keyExport:{appId:I.appId,appClientId:I.clientId,origin:W.apiUrl,walletToExport:n,primaryWallet:i,onSuccess:t,onFailure:r}}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)})),setReadyToTrue:e=>{z(!0),cr?.(e)},updateWallets:()=>Qr(),fundWallet:async(e,t)=>{let r=At.FUNDING_METHOD_SELECTION_SCREEN;lr({funding:Pt({address:e,appConfig:ar,fundWalletConfig:t,methodScreen:r})}),Nr(r)},openModal:Nr,requestFarcasterSignerStatus:async e=>{let t=await Vr(),r=se?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!tr||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!se?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");let a=await W.requestFarcasterSignerStatus(e);return"approved"===a.status&&ce(await W.getAuthenticatedUser()||se||null),a},connectCoinbaseSmartWallet:async()=>{ar.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let e=W.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||W.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(e)return e.updateConnectionPreference("smartWalletOnly"),Hr(e);await Br("coinbase_wallet","coinbase_smart_wallet")},initiateAccountTransfer:async({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o})=>{let s=await W.sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o});return ce(s),s}};Fr=ua.recoverPrimaryWallet,xr=ua.recoverPrimaryWallet,jr=ua.solanaSignMessage;let ha=l((()=>({wallets:de,ready:pr&&Tr})),[de,pr,Tr]),pa=W.authFlow instanceof v,wa=!ar.headless&&ar.captchaEnabled&&!$&&(K||pa);/*#__PURE__*/return e(Ot.Provider,{value:da,children:/*#__PURE__*/e(Nt.Provider,{value:Ar,children:/*#__PURE__*/e(St.Provider,{value:ha,children:/*#__PURE__*/e(It,{...ar,children:/*#__PURE__*/t(bt.Provider,{value:ua,children:[/*#__PURE__*/e(_t,{children:/*#__PURE__*/t(Ut,{data:sr,setModalData:lr,setInitialScreen:jt,initialScreen:xt,authenticated:$,open:V,children:[I.children,wa&&/*#__PURE__*/e(he,{delayedExecution:!1}),/*#__PURE__*/e(vt,{theme:{...ar.appearance.palette||{}}}),!ar.render.standalone&&/*#__PURE__*/e(pe,{open:V})]})}),ir&&nr?/*#__PURE__*/e(be,{appId:I.appId,appClientId:I.clientId,clientAnalyticsId:W.clientAnalyticsId,origin:W.apiUrl,mfaMethods:se?.mfaMethods,mfaPromise:Er,mfaSubmitPromise:_r,onLoad:rr,onLoadFailed:()=>null}):null,ar.loginConfig.telegramAuthConfiguration&& ++import{jsx as e,jsxs as t}from"react/jsx-runtime";import{getAddress as r}from"@ethersproject/address";import{Web3Provider as a}from"@ethersproject/providers";import{createStore as n}from"mipd";import{useState as i,useRef as o,useEffect as s,useMemo as l}from"react";import{isAndroid as c}from"react-device-detect";import{populateTransactionRequest as d,calculateTotalGasEstimate as u,ProviderErrors as h}from"@privy-io/js-sdk-core";import{CustomJwtAccountFlow as p}from"./auth-flows/custom-jwt-account.mjs";import{UpdateEmailFlow as w,EmailFlow as m}from"./auth-flows/email.mjs";import{FarcasterFlow as y}from"./auth-flows/farcaster.mjs";import{GuestFlow as f}from"./auth-flows/guest.mjs";import{PasskeyFlow as g}from"./auth-flows/passkey.mjs";import{SiweFlow as E}from"./auth-flows/siwe.mjs";import{SiwsFlow as _}from"./auth-flows/siws.mjs";import{UpdateSmsFlow as A,SmsFlow as T}from"./auth-flows/sms.mjs";import{TelegramAuthFlow as v,detectCompletingTelegramFlow as C}from"./auth-flows/telegram.mjs";import{v4 as I}from"uuid";import{AccessToken as W}from"./accessToken.mjs";import{getEntropyDetailsFromAccount as k,convertUserResponseToUser as N,getPrivySolanaHDWallets as b,getImportedPrivySolanaWallet as U,getPrivyPrimaryWallet as O,getPrivyEthereumWallet as S,getPrivyEthereumHDWallets as R,getImportedPrivyEthereumWallet as P,shouldProceedtoEmbeddedWalletCreationFlow as D,getPrivySolanaWallet as L,getLatestPrivyEthereumWallet as M,getSolanaSigningAndRootWallet as F,getEthereumSigningAndRootWallet as x,getLatestPrivySolanaWallet as j,getEntropyDetailsFromUser as B}from"./client/user.mjs";import V from"eventemitter3";import{CONNECTORS_STATE_KEY as H,CONNECTIONS_HISTORY_KEY as K,DEFAULT_PRIVY_API_URL as G,DEFAULT_API_TIMEOUT_MS as z,CLIENT_ANALYTICS_ID_KEY as q,CUSTOMER_ACCESS_TOKEN_STORAGE_KEY as $,PRIVY_ACCESS_TOKEN_STORAGE_KEY as Y,getGuestCredentialStorageKey as X,HEADLESS_OAUTH_KEY as Q,OAUTH_DISABLE_SIGNUP_KEY as J,STATE_CODE_KEY as Z,WALLET_PROXY_TIMEOUT as ee,FORKED_TOKEN_STORAGE_KEY as te}from"./constants.mjs";import re,{isLocalStorageAccessible as ae}from"./storage.mjs";import{getJsonRpcProvider as ne,generateTypedDataWithDomainType as ie,toHex as oe,detectInjectedConnectors as se,formatChainIdToCAIP2 as le}from"./utils/index.mjs";import{CoinbaseWalletConnector as ce}from"./connectors/coinbase.mjs";import{EmbeddedWalletConnector as de}from"./connectors/embedded.mjs";import{isSupportedEthereumRpcMethod as ue}from"./embedded-wallets/rpc/types.mjs";import{Captcha as he}from"./components/Captcha.mjs";import{LoginModal as pe}from"./components/LoginModal.mjs";import{TelegramLoginButton as we}from"./components/TelegramLoginButton.mjs";import{PrivyAppConfigProvider as me,useAppConfig as ye,useIsServerConfigLoaded as fe}from"./configuration/context.mjs";import{areWalletArraysEqual as ge}from"./connectors/areWalletArraysEqual.mjs";import{PrivyProviderRpcError as Ee,ProviderRpcError as _e}from"./connectors/errors.mjs";import{isPhantomInstalled as Ae}from"./connectors/is-wallet-installed.mjs";import{isBaseConnectedEthereumWallet as Te}from"./connectors/isBaseConnectedEthereumWallet.mjs";import{PrivyProxyProvider as ve,AsExternalProvider as Ce,AsAbstractProvider as Ie}from"./connectors/privyProxyProvider.mjs";import{isSolanaWalletConnector as We,isBaseConnectedSolanaWallet as ke}from"./connectors/solana/index.mjs";import{WalletConnectV2WalletConnector as Ne}from"./connectors/walletconnect-v2.mjs";import{EmbeddedWalletIframe as be}from"./embedded-wallets/EmbeddedWalletIframe.mjs";import{isWalletDelegated as Ue,getDelegatedWalletsData as Oe,getRootWalletDataForDelegation as Se,getDelegatedWalletsForUser as Re}from"./embedded-wallets/delegated-actions.mjs";import{errorIndicatesRecoveryIsNeeded as Pe}from"./embedded-wallets/errors.mjs";import{formatReceipt as De,getAndCheckBalance as Le,sendTransaction as Me}from"./embedded-wallets/rpc/index.mjs";import{PrivyClientError as Fe,formatApiError as xe,formatPrivyError as je,PrivyErrorCode as Be,PrivyNotReadyError as Ve,PrivyConnectorError as He,PrivyError as Ke}from"./errors.mjs";import{signSolanaTransaction as Ge,sendSolanaTransaction as ze}from"./embedded-wallets/solana/transaction.mjs";import{extractChainIdFromCAIP2 as qe}from"./lib/caip2.mjs";import{USE_BROADCAST_CHANNEL_EVENT_TYPE as $e,isPrivyTheOAuthProvider as Ye,CROSS_APP_BROADCAST_CHANNEL_NAME as Xe}from"./lib/cross-app/index.mjs";import{getCrossAppAuthorizationUrl as Qe,authenticateCrossAppAccount as Je,getProviderAppMetadata as Ze}from"./lib/cross-app/authFlow.mjs";import{popupCrossAppAuthFlow as et}from"./lib/cross-app/popupCrossAppAuthFlow.mjs";import{sendCrossAppRequest as tt}from"./lib/cross-app/sendCrossAppRequest.mjs";import{getRecoveryAuthorizationUrl as rt,authenticateRecovery as at,embeddedWalletRecoveryScreen as nt,toEmbeddedWalletSetRecoveryScreen as it}from"./lib/embeddedWalletRecovery.mjs";import{FUNDING_SCREENS as ot,fundingScreenMethodMap as st}from"./lib/funding/index.mjs";import{isFundingEnabled as lt}from"./lib/funding/isFundingEnabled.mjs";import ct from"./lib/isEmbeddedWebview.mjs";import{triggerPopup as dt}from"./lib/popup/triggerPopup.mjs";import{popupOAuthFlow as ut}from"./lib/popupOAuthFlow.mjs";import{prepareSiweMessageWithNonce as ht}from"./lib/siwe.mjs";import{decodeSolanaTransaction as pt,createSolanaTransactionReceipt as wt}from"./lib/solana/transaction.mjs";import{toDisplayFromAccountType as mt}from"./lib/toDisplayFromAccountType.mjs";import{transformResponseToSnakeCase as yt}from"./passkeys/transformResponseToSnakeCase.mjs";import{PrivyPluginProvider as ft,usePlugins as gt}from"./plugins/context/PrivyPluginContext.mjs";import{SOLANA_FUNDING_PLUGIN_ID as Et}from"./plugins/solana-funding/id.mjs";import{RecentlyUsedAccountProvider as _t}from"./recent-login/context.mjs";import{ModalScreen as At}from"./screens/index.mjs";import{Hide as Tt}from"./screens/LandingScreen/styles.mjs";import{GlobalStyle as vt}from"./styles.mjs";import{notImplemented as Ct}from"./hooks/index.mjs";import{CaptchaProvider as It}from"./hooks/captcha-context.mjs";import{privyEventsDefault as Wt,emitPrivyEvent as kt,PrivyEventsContext as Nt}from"./hooks/events-context.mjs";import{InternalPrivyContext as bt}from"./hooks/internal-context.mjs";import{ModalProvider as Ut}from"./hooks/modal-context.mjs";import{PrivyContext as Ot}from"./hooks/privy-context.mjs";import{UseWalletsContext as St}from"./hooks/useWallets.mjs";import{prepareSolanaFundingModalData as Rt,prepareFundingModalData as Pt}from"./lib/funding/prepareFundingModalData.mjs";import{detectCompletingOAuthFlow as Dt}from"./auth-flows/oauth/detectCompletingOAuthFlow.mjs";import{OAuthFlow as Lt}from"./auth-flows/oauth/OAuthFlow.mjs";import{getRpcTimeout as Mt}from"./connectors/getRpcTimeout.mjs";import{EmbeddedProviderError as Ft}from"./connectors/providerTypes.mjs";import{isEthereumWalletConnector as xt}from"./connectors/ethereum/index.mjs";import{LegacyInjectedWalletConnector as jt,Injected6963WalletConnector as Bt}from"./connectors/injected.mjs";import{MetamaskWalletConnector as Vt}from"./connectors/metamask.mjs";import{PhantomEthereumNullWalletConnector as Ht}from"./connectors/phantom.mjs";import{PhantomSolanaNullWalletConnector as Kt}from"./connectors/phantom-solana.mjs";import{Http as Gt}from"./http.mjs";import{getPaymasterContext as zt}from"./lib/smart-wallet-helpers.mjs";import{transformOptionsToCamelCase as qt}from"./passkeys/transformOptionsToCamelCase.mjs";import{mfaPasswordlessSmsInitPath as $t,mfaPasskeyInitPath as Yt,acceptTermsPath as Xt,unlinkEmailPath as Qt,unlinkPhonePath as Jt,unlinkWalletPath as Zt,siwsUnlinkWalletPath as er,unlinkOAuthPath as tr,unlinkFarcasterPath as rr,telegramAccountUnlinkPath as ar,unlinkPasskeyPath as nr,delegatedActionsRevokePath as ir,analyticsEventsPath as or,moonpayPluginOnRampPath as sr,coinbaseOnRampInitPath as lr,coinbaseOnRampStatusPath as cr,siweInitPath as dr,siweAuthenticatePath as ur,siweLinkPath as hr,smartWalletLinkPath as pr,siwsInitPath as wr,siwsAuthenticatePath as mr,transferOAuthPath as yr,telegramAccountTransferPath as fr,transferFarcasterPath as gr,transferWalletPath as Er,transferPhonePath as _r,transferEmailPath as Ar,siwsLinkPath as Tr}from"./paths.mjs";import{AccessTokenTypes as vr,Session as Cr}from"./session.mjs";class Ir extends V{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new Ft(`Invalid params for ${e.method}`,4200);let t=e.params[0];if(!await Vr()||!this.address)throw new Ft("Disconnected",4900);return(await Gr(t,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new Ft(`Invalid params for ${e.method}`,4200);if("string"==typeof e.params[0])t=e.params[0];else{if(!("chainId"in e.params[0])||"string"!=typeof e.params[0].chainId)throw new Ft(`Invalid params for ${e.method}`,4200);t=e.params[0].chainId}this.chainId=Number(t),this.provider=ne(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",t)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let t=e.params[0],r=e.params[1];return await Hr(t,void 0,r)}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let t=e.params[0],r="string"==typeof e.params[1]?JSON.parse(e.params[1]):e.params[1];return await Kr(ie(r),void 0,t)}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let t={...e.params[0],chainId:oe(this.chainId)};try{return await this.provider.send("eth_estimateGas",[t])}catch(e){console.warn(`Gas estimation failed with error: ${e}. Retrying gas estimation by omitting the 'from' address`);try{return delete t.from,await this.provider.send("eth_estimateGas",[t])}catch(t){throw console.warn(`Gas estimation failed with error: ${t} when omitting the 'from' address`),e}}}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return oe(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!ue(e.method))return this.provider.send(e.method,e.params);{let t=await Vr();if(await zr(),!t||!this.address)throw new Ft("Disconnected",4900);try{return(await this.walletProxy.rpc({accessToken:t,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:{method:e.method,params:e.params}})).response.data}catch(e){throw console.error(e),new Ft("Disconnected",4900)}}}constructor({walletProxy:e,address:t,entropyId:r,entropyIdVerifier:a,rpcConfig:n,chains:i,appId:o,chainId:s=1,walletIndex:l}){super(),this.walletProxy=e,this.address=t,this.entropyId=r,this.entropyIdVerifier=a,this.chainId=s,this.rpcConfig=n,this.chains=i,this.provider=ne(s,this.chains,n,{appId:o}),this.rpcTimeoutDuration=Mt(n,"privy"),this.appId=o,this.walletIndex=l}}class Wr extends V{get wallets(){let e=new Set,t=this.walletConnectors.flatMap((e=>e.wallets)).sort(((e,t)=>e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0)).filter((t=>{let r=`${t.address}${t.walletClientType}${t.connectorType}`;return!e.has(r)&&(e.add(r),!0)})),r=t.findIndex((e=>e.address===(this.activeWallet?this.activeWallet:"unknown")));return r>=0&&t.unshift(t.splice(r,1)[0]),t}async initialize(){if(this.initialized)return;re.get(H)&&(re.getKeys().forEach((e=>{e.startsWith("walletconnect")&&re.del(e)})),re.del(H));let e=se({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then((e=>{e.forEach((({type:e,eip6963InjectedProvider:t,legacyInjectedProvider:r})=>{this.createEthereumWalletConnector("injected",e,{eip6963InjectedProvider:t,legacyInjectedProvider:r})}))}));this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector("coinbase_wallet","coinbase_wallet"),!Ae()&&this.walletList.includes("phantom")&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&this.createEthereumWalletConnector("phantom","phantom"),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&this.addWalletConnector(new Kt)),this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector("wallet_connect_v2","unknown"),this.externalWalletConfig.solana.connectors?.get().forEach(this.addSolanaWalletConnector),this.externalWalletConfig.solana.connectors?._setOnConnectorsUpdated?.((e=>{e?.forEach(this.addSolanaWalletConnector)})),await e,this.initialized=!0}findWalletConnector(e,t){return"wallet_connect_v2"===e?this.walletConnectors.filter(xt).find((t=>t.connectorType===e))??null:this.walletConnectors.filter(xt).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findSolanaWalletConnector(e,t){return this.walletConnectors.filter(We).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter((e=>"embedded"===e.connectorType))}onInitialized(e){e.wallets.forEach((e=>{let t=this.storedConnections.find((t=>t.address===e.address&&t.connectorType===e.connectorType&&t.walletClientType===e.walletClientType));t&&(e.connectedAt=t.connectedAt)})),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:e,rootWallet:t,embeddedWallets:r,defaultChain:a,appId:n}){for(let i of r){let r=this.findEmbeddedWalletConnectors().find((e=>e.walletIndex===i.walletIndex));if(r&&xt(r))r.proxyProvider.walletProxy=e;else{let{entropyId:r,entropyIdVerifier:o}=k(t),s=new de({provider:new Ir({walletProxy:e,address:i.address,entropyId:r,entropyIdVerifier:o,rpcConfig:this.rpcConfig,chains:this.chains,appId:n,chainId:a.id,walletIndex:i.walletIndex}),chains:this.chains,defaultChain:a,rpcConfig:this.rpcConfig,imported:!1,walletIndex:i.walletIndex});this.addWalletConnector(s)}}}addImportedWalletConnector(e,t,r,a){let n=this.findWalletConnector("embedded_imported","privy");if(n&&xt(n))n.proxyProvider.walletProxy=e;else{let n=new de({provider:new Ir({walletProxy:e,address:t,entropyId:t,entropyIdVerifier:"ethereum-address-verifier",walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:r.id}),chains:this.chains,walletIndex:0,defaultChain:r,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(n)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter((e=>"embedded"!==e.connectorType)),this.saveConnectionHistory(),this.storedConnections=kr(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1),this.saveConnectionHistory(),this.storedConnections=kr(),this.emit("walletsUpdated")}}async createEthereumWalletConnector(e,t,r){let a=this.findWalletConnector(e,t);if(a&&xt(a))return a instanceof Ne&&a.resetConnection(t),a;let n=(()=>"injected"!==e?"coinbase_wallet"===e?new ce(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):"phantom"===e?new Ht(this.defaultChain):new Ne(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,t):"metamask"===t&&r?.eip6963InjectedProvider?new Vt(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):"metamask"===t&&r?.legacyInjectedProvider?new jt(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):"phantom"===t&&r?.legacyInjectedProvider?new jt(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&"unknown_browser_extension"===t?new jt(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new Bt(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,t):void 0)();return n&&this.addWalletConnector(n),n||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",(()=>this.onInitialized(e))),e.on("walletsUpdated",(()=>this.onWalletsUpdated(e))),e.initialize().catch((e=>{console.debug("Failed to initialize connector",e)}))}saveConnectionHistory(){let e=this.wallets.map((e=>({address:e.address,connectorType:e.connectorType,walletClientType:e.walletClientType,connectedAt:e.connectedAt})));re.put(K,e)}async activeWalletSign(e){let t=this.wallets,r=t.length>0?t[0]:null;return r&&Te(r)?r.sign(e):null}setActiveWallet(e){this.activeWallet=r(e),this.emit("walletsUpdated")}constructor(e,t,r,a,n,i,o,s,l,c,d,u){super(),this.addSolanaWalletConnector=async e=>{this.findSolanaWalletConnector("solana_adapter",e.walletClientType)||this.addWalletConnector(e)},this.getEthereumProvider=()=>{let e=this.wallets[0],t=this.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new ve},this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=r,this.chains=a,this.defaultChain=n,this.walletConnectors=[],this.initialized=!1,this.store=i,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=s,this.externalWalletConfig=l,this.privyAppName=c,this.privyAppLogo=d,this.walletChainType=u||"ethereum-only",this.storedConnections=kr()}}const kr=()=>{let e=re.get(K);return e&&Array.isArray(e)&&e.map((e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e))).every(Boolean)?e:[]};let Nr;var br=0,Ur="__private_"+br+++"__getOrGenerateClientAnalyticsId";class Or{initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:a,store:n,walletList:i,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:s,appName:l,walletChainType:c}){this.connectors||(this.connectors=new Wr(this.appId,e,t,r,a,n,i,o,s,l,void 0,c))}generateApi(){let e=new Gt({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new Fe("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new Fe("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter((e=>"cross_app"===e.type)).forEach((e=>{this.storeProviderAccessToken(e.providerApp.id,null)}))}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post($t,{action:"verify"})}catch(e){throw xe(e)}}async initMfaPasskeyVerification(){try{let e=await this.api.post(Yt,{});return qt(e.options)}catch(e){throw xe(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(e){console.error("Error fetching cross app provider details",e)}}async acceptTerms(){try{let e=await this.api.post(Xt,{});return N(e)}catch(e){throw je(e)}}async unlinkEmail(e){try{let t=await this.api.post(Qt,{address:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkPhone(e){try{let t=await this.api.post(Jt,{phoneNumber:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkEthereumWallet(e){try{let t=await this.api.post(Zt,{address:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkSolanaWallet(e){try{let t=await this.api.post(er,{address:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkOAuth(e,t){try{let r=await this.api.post(tr,{provider:e,subject:t});return await this.getAuthenticatedUser()??N(r)}catch(e){throw je(e)}}async unlinkFarcaster(e){try{let t=await this.api.post(rr,{fid:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkTelegram(e){try{let t=await this.api.post(ar,{telegram_user_id:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async unlinkPasskey(e){try{let t=await this.api.post(nr,{credential_id:e});return await this.getAuthenticatedUser()??N(t)}catch(e){throw je(e)}}async revokeDelegatedWallet(){try{await this.api.post(ir,{})}catch(e){throw je(e)}}async createAnalyticsEvent({eventName:e,payload:t,timestamp:r,options:a}){if("undefined"!=typeof window)try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(or,{event_name:e,client_id:this.clientAnalyticsId,payload:{...t||{},clientTimestamp:r?r.toISOString():(new Date).toISOString()}},{retry:-1,keepalive:a?.keepAlive??!1})}catch(e){}}async signMoonpayOnRampUrl(e){try{return this.api.post(sr,e)}catch(e){throw je(e)}}async initCoinbaseOnRamp(e){try{return this.api.post(lr,e)}catch(e){throw je(e)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`${cr}?partnerUserId=${e}`)}catch(e){throw je(e)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(vr.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(vr.PRIVY,e)}async _getToken(e,t){return this.session.getToken(e)?this.session.hasActiveAccessToken(e)?this.session.hasRefreshCredentials(e)?W.parse(this.session.getToken(e))?.appId!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null):!t?.disableAutoRefresh&&this.session.hasRefreshCredentials(e)?(await this.session.refresh(),this.session.getToken(e)):null:null}async getSmartWalletsConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:e});return r.enabled?{enabled:r.enabled,smartWalletType:r.smart_wallet_type,configuredNetworks:r.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:zt(e.paymaster_url,e.paymaster_context)})))}:{enabled:r.enabled}}catch(e){throw je(e)}}async getServerConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:e}),a=r.telegram_auth_config?{botId:r.telegram_auth_config.bot_id,botName:r.telegram_auth_config.bot_name,linkEnabled:r.telegram_auth_config.link_enabled,seamlessAuthEnabled:r.telegram_auth_config.seamless_auth_enabled}:void 0,n=r.funding_config?{methods:r.funding_config.methods,options:r.funding_config.options,defaultRecommendedAmount:r.funding_config.default_recommended_amount,defaultRecommendedCurrency:r.funding_config.default_recommended_currency,promptFundingOnWalletCreation:r.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:r.funding_config.cross_chain_bridging_enabled}:void 0;return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,solanaWalletAuth:r.solana_wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,spotifyOAuth:r.spotify_oauth,instagramOAuth:r.instagram_oauth,tiktokOAuth:r.tiktok_oauth,linkedinOAuth:r.linkedin_oauth,appleOAuth:r.apple_oauth,farcasterAuth:r.farcaster_auth,passkeyAuth:r.passkey_auth,telegramAuth:r.telegram_auth,disablePlusEmails:r.disable_plus_emails,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:r.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:r.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:r.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:r.privacy_policy_url,requireUsersAcceptTerms:r.require_users_accept_terms,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,fiatOnRampEnabled:r.fiat_on_ramp_enabled,captchaEnabled:r.captcha_enabled,captchaSiteKey:r.captcha_site_key,createdAt:new Date(1e3*r.created_at),updatedAt:new Date(1e3*r.updated_at),mfaMethods:r.mfa_methods,enforceWalletUis:r.enforce_wallet_uis,legacyWalletUiConfig:r.legacy_wallet_ui_config,telegramAuthConfiguration:a,fundingConfig:n}}catch(e){throw je(e)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch(t){return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch(e){return void console.error("Unable to fetch token price for SOL")}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:e,captchaToken:t}){try{return(await this.api.post(dr,{address:e,token:t})).nonce}catch(e){throw je(e)}}async authenticateWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n,mode:i}){return await this.api.post(ur,{message:e,signature:t,chainId:r,walletClientType:a,connectorType:n,mode:i})}async linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}){return await this.api.post(hr,{message:e,signature:t,chainId:r,walletClientType:a,connectorType:n})}async linkSmartWallet({message:e,signature:t,smartWalletType:r}){try{let a=await this.api.post(pr,{message:e,signature:t,smart_wallet_type:r});return N(a)}catch(e){throw je(e)}}async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}){try{let i=await this.linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n});return N(i)}catch(e){throw je(e)}}async generateSiwsNonce({address:e,captchaToken:t}){try{return(await this.api.post(wr,{address:e,token:t})).nonce}catch(e){throw je(e)}}async authenticateWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a,mode:n}){return await this.api.post(mr,{message:e,signature:t,walletClientType:r,connectorType:a,mode:n})}async sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o}){try{let s,l;switch(r){case"email":s=Ar,l={nonce:e,email:t};break;case"sms":s=_r,l={nonce:e,phoneNumber:t};break;case"siwe":if(s=Er,!a)throw Error("Wallet parameters must be defined");l={nonce:e,address:t,...a};break;case"farcaster":s=gr,l={nonce:e,farcaster_id:t,farcaster_embedded_address:i};break;case"telegram":s=fr,l={nonce:e,telegram_auth_result:n};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:s=yr,l={nonce:e,userInfo:o}}let c=await this.api.post(s,l);return await this.getAuthenticatedUser()??N(c)}catch(e){throw je(e)}}async linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a}){return await this.api.post(Tr,{message:e,signature:t,walletClientType:r,connectorType:a})}async linkWithSiws({message:e,signature:t,walletClientType:r,connectorType:a}){try{let n=await this.linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:a});return N(n)}catch(e){throw je(e)}}constructor({apiUrl:e=G,appId:t,appClientId:r,timeout:a=z}){Object.defineProperty(this,Ur,{value:Sr}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==G&&e.startsWith("https://privy."),this.timeout=a,this.appId=t,this.appClientId=r,this.clientAnalyticsId=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}(this,Ur)[Ur](),Nr||(Nr=new Cr),this.session=Nr,this.api=this.generateApi(),this.session.client=this}}function Sr(){if("undefined"==typeof window)return null;try{let e=re.get(q);if("string"==typeof e&&e.length>0)return e}catch(e){}let e=I();try{return re.put(q,e),e}catch(t){return e}}class Rr{async handleSignMessage(e){if(!e.params||"string"!=typeof e.params.message)throw Error("Message must be provided as a string for Solana signMessage RPC");return await $r({message:e.params.message,address:this.address})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await Vr())throw Error("User must be authenticated to use embedded Solana wallet");if(!await qr())throw new Fe("Unable to connect to Solana embedded wallet");if("signMessage"===e.method)return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}constructor(e,t){this.walletProxy=e,this.address=t}}let Pr,Dr,Lr,Mr,Fr,xr,jr;function Br(){return Pr?Pr.getCustomerAccessToken():Promise.resolve(re.get($)||null)}async function Vr(){return Pr?Pr.getAccessToken():Promise.resolve(re.get(Y)||re.get($)||null)}const Hr=(e,t,r)=>Dr(e,t,r),Kr=(e,t,r)=>Lr(e,t,r),Gr=(e,t,r,a)=>Mr(e,t,r,a),zr=()=>Fr(),qr=()=>xr(),$r=({message:e,address:t})=>jr({message:e,address:t});const Yr=({config:t,...r})=>{var a;if("undefined"!=typeof window&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&0>["https:","chrome-extension:","file:"].indexOf(window.location.protocol))throw new Fe("Embedded wallet is only available over HTTPS/CHROME-EXTENSION/FILE");if("string"!=typeof(a=r.appId)||25!==a.length)throw new Fe("Cannot initialize the Privy provider with an invalid Privy app ID");Pr||(Pr=new Or({appId:r.appId,appClientId:r.clientId,apiUrl:r.apiUrl}));let n=Object.assign({},t);return void 0!==r.createPrivyWalletOnLogin&&void 0===n.embeddedWallets?.createOnLogin&&(n.embeddedWallets||(n.embeddedWallets={}),n.embeddedWallets.createOnLogin=r.createPrivyWalletOnLogin?"users-without-wallets":"off"),void 0!==r.createPrivyWalletOnLogin&&t?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),/*#__PURE__*/e(me,{client:Pr,clientConfig:n,legacyCreateEmbeddedWalletFlag:r.createPrivyWalletOnLogin,children:/*#__PURE__*/e(ft,{children:/*#__PURE__*/e(Xr,{...r,client:Pr})})})};let Xr=I=>{let W=I.client,N=gt(),[V,H]=i(!1),[K,z]=i(!1),[$,Y]=i(!1),[se,ce]=i(null),[de,ue]=i([]),[me,We]=i([]),[xe,je]=i([]),ft=o(de),[Mt,Ft]=i(!1),[xt,jt]=i(null),[Bt,Vt]=i(!1),[Ht,Kt]=i({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:Ct}),[Gt,zt]=i({status:"initial"}),[qt,$t]=i({status:"initial"}),[Yt,Xt]=i({status:"initial"}),[Qt,Jt]=i({status:"initial"}),[Zt,er]=i({status:"initial"}),[tr,rr]=i(null),ar=ye(),nr=fe(),[ir,or]=i(!0),[sr,lr]=i({}),[cr,dr]=i(null),[ur,hr]=i(null),[pr,wr]=i(!1),[mr,yr]=i(!1),[fr,gr]=i(ar.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),Er=o(null),_r=o(null),Ar=o(Wt),[Tr,vr]=i(!1);W.onStoreCustomerAccessToken=e=>{e&&kt(Ar,"accessToken","onAccessTokenGranted",e)},W.onDeleteCustomerAccessToken=()=>{ce(null),Y(!1),kt(Ar,"accessToken","onAccessTokenRemoved")};let Cr=o(null),Ir=o(null),Wr=o(!1),kr=({showWalletUIs:e,typedData:t})=>Wr.current?Wr.current:void 0!==e?!e:void 0!==ar.embeddedWallets.showWalletUIs?!ar.embeddedWallets.showWalletUIs:t?ar.embeddedWallets.noPromptOnSignature||(ar.legacyWalletUiConfig??!1):!!ar.embeddedWallets.noPromptOnSignature,Nr=e=>{jt(e),setTimeout((()=>{H(!0)}),15),W.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:e}})},br=e=>{"off"!==ar.embeddedWallets.createOnLogin&&or(!0),Nr(e)};s((()=>{let e=[...b(se),U(se)].filter((e=>!!e));tr&&je(e.map((e=>({type:"solana",imported:e.imported,address:e.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",walletIndex:e.walletIndex??void 0,meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund(){throw new Fe("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:()=>{throw new Fe("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new Rr(tr,e.address),async signMessage(t){let r=await Vr();if(!r||!tr)throw new Fe("Must have valid access token and Privy wallet to send transaction",Be.MUST_BE_AUTHENTICATED);let a=e.imported?U(se):O(se);if(!a)throw new Fe("Attempting to sign a transaction without a root wallet");let{entropyId:n,entropyIdVerifier:i}=k(a);if(!await ua.recoverPrimaryWallet().catch((()=>!1)))throw new Fe("Wallet couldn't be connected",Be.UNKNOWN_CONNECT_WALLET_ERROR);if(!se)throw new Fe("Attempting to sign a transaction with no user initialized");let{response:o}=await tr.rpc({accessToken:r,entropyId:n,entropyIdVerifier:i,chainType:"solana",hdWalletIndex:this.walletIndex??0,request:{method:"signMessage",params:{message:Buffer.from(t).toString("base64")}}});return Buffer.from(o.data.signature,"base64")},async sendTransaction(e,t,r){let{signature:a}=await na({transaction:e,connection:t,transactionOptions:r,wallet:this});return a},async signTransaction(t){let r=await Vr();if(!r||!tr)throw new Fe("Must have valid access token and Privy wallet to send transaction",Be.MUST_BE_AUTHENTICATED);if(!await ua.recoverPrimaryWallet().catch((()=>!1)))throw new Fe("Wallet couldn't be connected",Be.UNKNOWN_CONNECT_WALLET_ERROR);let{entropyId:a,entropyIdVerifier:n}=k(e);return await Ge({tx:t,accessToken:r,walletProxy:tr,entropyId:a,entropyIdVerifier:n,transactingWalletAddress:this.address,transactingWalletIndex:this.walletIndex??0}),t},loginOrLink:async()=>{throw new Fe("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{},isConnected:async()=>!0}))))}),[tr,se]),s((()=>{if(!se)return void W.connectors?.removeEmbeddedWalletConnectors();let e=S(se),t=R(se),r=P(se);e&&t.length||W.connectors?.removeEmbeddedWalletConnectors(),r||W.connectors?.removeImportedWalletConnector(),W.connectors?tr?(e&&W.connectors.addEmbeddedWalletConnectors({walletProxy:tr,rootWallet:e,embeddedWallets:t,defaultChain:ar.defaultChain,appId:I.appId}),r&&W.connectors.addImportedWalletConnector(tr,r.address,ar.defaultChain,I.appId)):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")}),[tr,se]),s((()=>{tr&&ur?.(tr)}),[tr]);let Ur=o();s((()=>{(async()=>{if(!ar.customAuth?.enabled)return void gr({status:"not-enabled"});or(!0);let{getCustomAccessToken:e,isLoading:t}=ar.customAuth;if(K&&!t&&"loading"!==fr.status){gr({status:"loading"});try{let t=await e();if(t===Ur.current)return void gr({status:"done"});if(!t&&$)return Ur.current=t,await da.logout(),gr({status:"done"}),void kt(Ar,"customAuth","onUnauthenticated");if(!t)return Ur.current=t,void gr({status:"done"});W.startAuthFlow(new p(t));let{user:r,isNewUser:a}=await W.authenticate();if(!r)return await da.logout(),gr({status:"error",error:new Fe("Failed to sync with custom auth provider")}),void kt(Ar,"customAuth","onUnauthenticated");void 0!==a&&kt(Ar,"login","onComplete",r,a,!1,"custom",null),Ur.current=t,kt(Ar,"customAuth","onAuthenticated",{user:r}),gr({status:"done"}),ce(r||null),Ft(a||!1),Y(!0),yr(!0)}catch(e){if(console.warn(e),await da.logout(),kt(Ar,"customAuth","onUnauthenticated"),"User already exists with provided custom JWT account."===e.message)return void gr({status:"initial"});kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),gr({status:"error",error:e})}}})()}),["initial"===fr.status,ar.customAuth?.enabled,ar.customAuth?.getCustomAccessToken,ar.customAuth?.isLoading,K,$]),s((()=>{mr&&tr&&se&&D(se,ar.embeddedWallets.createOnLogin)&&(yr(!1),Jr(se,ee).catch(console.error))}),[mr&&tr&&se]),s((()=>{if(ar.externalWallets.solana.connectors)return ar.externalWallets.solana.connectors.onMount(),()=>ar.externalWallets.solana.connectors?.onUnmount()}),[ar.externalWallets.solana.connectors]),s((()=>{!K&&nr&&async function(){let e,t=Or(),r=Sr();(()=>{let e=new URLSearchParams(window.location.search).get("privy_token");if(!e)return;re.put(te,e);let t=new URL(window.location.href);t.searchParams.delete("privy_token"),window.history.pushState({},"",t)})();let a=n();W.initializeConnectorManager({walletConnectCloudProjectId:ar.walletConnectCloudProjectId,rpcConfig:ar.rpcConfig,chains:ar.chains,defaultChain:ar.defaultChain,store:a,walletList:ar.appearance.walletList,shouldEnforceDefaultChainOnConnect:ar.shouldEnforceDefaultChainOnConnect,externalWalletConfig:ar.externalWallets,appName:ar.name??"Privy",walletChainType:ar.appearance.walletChainType}),W.connectors?.on("connectorInitialized",(()=>{e&&clearTimeout(e);let t=W.connectors.walletConnectors.length,r=W.connectors.walletConnectors.reduce(((e,t)=>e+(t.initialized?1:0)),0);r===t?vr(!0):e=setTimeout((()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:r,expected:t}),vr(!0)}),1500)})),W.connectors?.initialize().then((()=>{zr()}));let i=await W.getAuthenticatedUser(),o=!!i;ar.legal.requireUsersAcceptTerms&&i&&!i.hasAcceptedTerms?(await W.logout(),ua.setReadyToTrue(!0),kt(Ar,"logout","onSuccess")):(ar.customAuth?.enabled||(Y(!!i),i&&kt(Ar,"login","onComplete",i,!1,!0,null,null),ce(i)),t?Ir.current=o?"link":"login":r&&!o?(Ir.current="login",lr({telegramAuthModalData:{seamlessAuth:!0}}),br(At.TELEGRAM_AUTH_SCREEN)):ua.setReadyToTrue(!!i))}()}),[W,cr,K,nr]),s((()=>{if(K){if(!se||!se.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType)))return void wr(!0);wr(!!de.find((e=>"privy"===e.walletClientType)))}}),[K,se,de]);let Or=()=>{let e=Dt();return e.inProgress&&e.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):"error"===e.authorizationCode?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}):(e.inProgress&&Ye(e.provider)&&!e.popupFlow&&(new BroadcastChannel(Xe).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}),window.close()),!!e.inProgress&&!!e.withPrivyUi&&(W.startAuthFlow(new Lt(e)),br(At.AWAITING_OAUTH_SCREEN),!0))},Sr=()=>{let e=C();if(!e||!ar.loginMethods.telegram||!ar.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let t=new v;return W.startAuthFlow(t),"login-url"===e.flowType&&(t.meta.telegramWebAppData=void 0,t.meta.telegramAuthResult=e.authData),"web-app"===e.flowType&&(t.meta.telegramAuthResult=void 0,t.meta.telegramWebAppData=e.authData),!0},Br=async(e,t,r,a)=>{Hr(await(W.connectors?.createEthereumWalletConnector(e,t))||null,t,r,a)};async function Hr(e,t,r,a){if(!e)return Kt({status:"disconnected",connectedWallet:null,connectError:new He("Unable to connect to wallet."),connector:null,connectRetry:Ct}),a?.(null,r);Kt({status:"disconnected",connectedWallet:null,connectError:null,connector:e,connectRetry:Ct}),e instanceof Ne&&t&&await e.resetConnection(t),Kt({connector:e,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Hr(e,t,r,a)});try{let t=await e.connect({showPrompt:!0});if((!t||Te(t))&&ar.shouldEnforceDefaultChainOnConnect&&!ar.chains.find((e=>e.id===Number(t?.chainId.replace("eip155:",""))))&&("wallet_connect_v2"!==t?.connectorType||"metamask"!==t?.walletClientType)){Kt((t=>({...t,connector:e,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:Ct})));try{await(t?.switchChain(ar.defaultChain.id)),t&&(t.chainId=le(oe(ar.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${ar.defaultChain.id}`)}}return Kt((e=>({...e,status:"connected",connectedWallet:t,connectError:null,connectRetry:Ct}))),t&&kt(Ar,"connectWallet","onSuccess",(e.chainType,t)),a?.(t,r)}catch(e){return e instanceof Ke?(console.warn(e.cause?e.cause:e.message),kt(Ar,"connectWallet","onError",e.privyErrorCode||Be.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),kt(Ar,"connectWallet","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR)),Kt((t=>({...t,status:"disconnected",connectedWallet:null,connectError:e}))),a?.(null,r)}}let Kr=async(e,t,r)=>{if(null===e||!Te(e))return;let a=new E(e,W,t,r);W.startAuthFlow(a)},Gr=async(e,t)=>{if(null===e||!ke(e))return;let r=new _(e,W,t);W.startAuthFlow(r)},zr=()=>{let e=new URLSearchParams(window.location.search),t=e.get("privy_connector"),r=e.get("privy_wallet_client");if(!t||!r)return;if("phantom"!==r||Ae()||br(At.LOGIN_FAILED_SCREEN),!W.connectors)throw new Fe("Connector not initialized");Nr(At.AWAITING_CONNECTION);let a=new URL(window.location.href);a.searchParams.delete("privy_connector"),a.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",a),Br(t,r,void 0,Kr)};s((()=>{K&&$&&null===se&&W.getAuthenticatedUser().then(ce)}),[K,$,se,W]);let qr=e=>{if(!$)throw kt(Ar,"linkAccount","onError",Be.MUST_BE_AUTHENTICATED,{linkMethod:e}),new Fe("User must be authenticated before linking an account.")},$r=()=>{qr("siwe"),Cr.current="siwe",Ir.current="link",Nr(At.LINK_WALLET_SCREEN)},Yr=e=>{if(!$||!se)return!1;if("privy"===e.walletClientType)return!0;for(let t of se.linkedAccounts)if("wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType)return!0;return!1},Xr=async e=>{let t;if(!W.connectors)throw new Fe("Connector not initialized");t="ethereum"===e.type?W.connectors.findWalletConnector(e.connectorType,e.walletClientType)||null:W.connectors.findSolanaWalletConnector(e.connectorType,e.walletClientType)||null,Kt((r=>({...r,connector:t,status:"connected",connectedWallet:e,connectError:null,connectRetry:Ct}))),ar.captchaEnabled&&!$?(lr({captchaModalData:{callback:t=>Te(e)?Kr(e,t):Gr(e,t),userIntentRequired:!1,onSuccessNavigateTo:At.AWAITING_CONNECTION,onErrorNavigateTo:At.ERROR_SCREEN}}),br(At.CAPTCHA_SCREEN)):(Te(e)?await Kr(e):await Gr(e),br(At.AWAITING_CONNECTION))},Qr=()=>{ue((e=>{let t=W.connectors?.wallets.filter(Te).map((e=>({...e,linked:Yr(e),loginOrLink:async()=>{if(!await e.isConnected())throw new Fe("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new Fe("Cannot link or login with embedded wallet");Xr(e)},fund:async t=>{await ua.fundWallet(e.address,t)},unlink:async()=>{if(!$)throw new Fe("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new Fe("Cannot unlink an embedded wallet");ce(await W.unlinkEthereumWallet(e.address))}})))||[];return ge(e,t)?e:t})),We((e=>{let t=(W.connectors?.wallets??[]).concat(xe).filter(ke).map((e=>({...e,linked:Yr(e),loginOrLink:async()=>{if(!await e.isConnected())throw new Fe("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new Fe("Cannot link or login with embedded wallet");Xr(e)},fund:async()=>{throw new Fe("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:async()=>{if(!$)throw new Fe("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new Fe("Cannot unlink an embedded wallet");ce(await W.unlinkSolanaWallet(e.address))}})));return ge(e,t)?e:t}))};s((()=>{Qr()}),[se?.linkedAccounts,$,K,xe]),s((()=>{if(K){if(!W.connectors)throw new Fe("Connector not initialized");Qr(),W.connectors.on("walletsUpdated",Qr)}}),[K]),s((()=>{[...ar.loginMethodsAndOrder?.primary??[],...ar.loginMethodsAndOrder?.overflow??[]].filter((e=>e.startsWith("privy:"))).forEach((e=>W.getCrossAppProviderDetails(e.replace("privy:",""))))}),[!!W]),s((()=>{let e;if(!de[0])return;let t=de[0],r=ft.current.find((e=>e.address===t.address));if(e="privy"===t.walletClientType?se?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"===e.walletClientType)):se?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"!==e.walletClientType)),!r&&e){let t=Object.assign({},se);t.wallet=e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,imported:e.imported,delegated:e.delegated,walletIndex:e.walletIndex},ce(t)}ft.current=de}),[de]);let Jr=async(e,t,r)=>{let a=S(e),n=L(e);if(r&&"walletIndex"in r)return ea(e,t,r.walletIndex,a,n);let i=r&&"createAdditional"in r&&r.createAdditional;if(a&&!i)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");let[o,s]=await Promise.all([ua.initializeWalletProxy(t),Vr()]);if(!o&&ar.customAuth?.enabled)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!o||!s||ar.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return Zr();if(!a)return await o.create({accessToken:s,solanaAddress:n?.address}),ra(0,"ethereum");{let t=(M(e)?.walletIndex??0)+1,{entropyId:r,entropyIdVerifier:a}=k(O(e));return await ua.recoverPrimaryWallet(),await o.addWallet({accessToken:s,entropyId:r,entropyIdVerifier:a,chainType:"ethereum",hdWalletIndex:t}),ra(t,"ethereum")}},Zr=async()=>new Promise(((e,t)=>{or(!0),lr({createWallet:{onSuccess:t=>{kt(Ar,"createWallet","onSuccess",t),e(t)},onFailure:e=>{kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),t(e)},callAuthOnSuccessOnClose:!1}}),Nr(At.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)})),ea=async(e,t,r,a,n)=>{if(r<0)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${r}) is invalid.`);let[i,o]=await Promise.all([ua.initializeWalletProxy(t),Vr()]);if(!i&&ar.customAuth?.enabled)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!i||!o||ar.embeddedWallets?.requireUserOwnedRecoveryOnCreate){if(0==r)return Zr();throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Create wallet UI can only be displayed when walletIndex is 0.")}if(0==r){if(a)return a;await i.create({accessToken:o,solanaAddress:n?.address})}else{if(!a)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_CREATE_ERROR),Error("A user must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let t=R(e).find((e=>e.walletIndex===r));if(t)return t;let{entropyId:n,entropyIdVerifier:s}=k(O(e));await ua.recoverPrimaryWallet(),await i.addWallet({accessToken:o,entropyId:n,entropyIdVerifier:s,chainType:"ethereum",hdWalletIndex:r})}return ra(r,"ethereum")},ta=async({user:e,wp:t,accessToken:r,walletIndex:a,ethereumWallet:n})=>{let i=b(e).find((e=>e.walletIndex===a));if(i)return i;if(0===a)await t.createSolana({accessToken:r,ethereumAddress:n?.address});else{let n=O(e);if(!n)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_CREATE_ERROR),Error("User must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let{entropyId:i,entropyIdVerifier:o}=k(n);await ua.recoverPrimaryWallet(),await t.addWallet({accessToken:r,entropyId:i,entropyIdVerifier:o,chainType:"solana",hdWalletIndex:a})}return ra(a,"solana")},ra=async(e,t)=>{let r=await ua.refreshUser(),a=("ethereum"===t?R(r):b(r)).find((t=>t.walletIndex===e));if(!a)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");return kt(Ar,"createWallet","onSuccess",a),a},aa=(e,t,a,n)=>new Promise((async(i,o)=>{let{requesterAppId:s}=t||{};if(!$||!se)return kt(Ar,"sendTransaction","onError",Be.MUST_BE_AUTHENTICATED),void o(Error("User must be authenticated before signing with a Privy wallet"));let l=n??S(se)?.address;if(!l)throw new Fe("User must have an embedded wallet to send a transaction.");let{signingWallet:c,rootWallet:p}=x(se,l);if(!p||!c)return kt(Ar,"sendTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void o(Error("Must have a Privy wallet before signing"));or(!0);let w=ha.wallets.find((e=>"privy"===e.walletClientType&&r(e.address)===r(c.address))),m=await(w?.getEthereumProvider());if(!w||!m)throw new Fe(`Cannot sendTransaction before embedded wallet ${c.address} is connected`);let y=e.chainId?Number(e.chainId):qe(w.chainId);(e=>{if(!ar.chains.map((e=>e.id)).includes(e))throw new He(`Chain ID ${e} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,Be.UNSUPPORTED_CHAIN_ID)})(y);let f=Object.assign({},e,{chainId:y});if(kr({showWalletUIs:t?.showWalletUIs}))(async()=>{let e=await Vr();if(!e||!tr)return kt(Ar,"sendTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void o(Error("Must have valid access token and Privy wallet to send transaction"));try{if(!await ua.recoverPrimaryWallet())return kt(Ar,"sendTransaction","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),void o(Error("Unable to connect to wallet"));let r=ne(f.chainId,ar.chains,ar.rpcConfig,{appId:I.appId}),a=await d(c.address,f,r);if(kr({showWalletUIs:t?.showWalletUIs})){let{totalGasEstimate:e}=await u(a,r),{hasSufficientFunds:t}=await Le(c.address,a,e,r);if(!t)throw new Ee(new _e("Wallet has insufficient funds for this transaction.",h.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let{entropyId:n,entropyIdVerifier:l}=k(p),w=await Me({accessToken:e,entropyId:n,entropyIdVerifier:l,transactingWallet:c,walletProxy:tr,transactionRequest:a,provider:r,requesterAppId:s});kt(Ar,"sendTransaction","onSuccess",w),i(w)}catch(e){kt(Ar,"sendTransaction","onError",Be.TRANSACTION_FAILURE),o(e)}})();else{let{entropyId:e,entropyIdVerifier:r}=k(p),n={entropyId:e,entropyIdVerifier:r,onCompleteNavigateTo:At.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:e=>{kt(Ar,"sendTransaction","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),o(e)}},l=lt(ar)?Pt({address:c.address,appConfig:ar,fundWalletConfig:a,methodScreen:At.FUNDING_METHOD_SELECTION_SCREEN,chainIdOverride:f.chainId,comingFromSendTransactionScreen:!0}):void 0;lr({connectWallet:n,sendTransaction:{transactionRequest:f,transactingWallet:c,entropyId:e,entropyIdVerifier:r,onSuccess:e=>{kt(Ar,"sendTransaction","onSuccess",e),i(e)},onFailure:e=>{kt(Ar,"sendTransaction","onError",Be.TRANSACTION_FAILURE),o(e)},uiOptions:t||{},fundWalletConfig:a,requesterAppId:s},funding:l}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),na=({transaction:e,connection:t,transactionOptions:r,fundWalletConfig:a,uiOptions:n,wallet:i})=>new Promise((async(o,s)=>{let{requesterAppId:l}=n||{};if(!$||!se)return kt(Ar,"sendSolanaTransaction","onError",Be.MUST_BE_AUTHENTICATED),void s(new Fe("User must be authenticated before signing with a Privy wallet",Be.MUST_BE_AUTHENTICATED));let c=i?se.linkedAccounts.find((e=>"wallet"===e.type&&e.address===i.address)):L(se);if(!c)return kt(Ar,"sendSolanaTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void s(new Fe("Must have a Privy wallet before signing",Be.EMBEDDED_WALLET_NOT_FOUND));or(!0);let{rootWallet:d}=F(se,c.address);if(!await ua.recoverPrimaryWallet().catch((()=>!1))||!d)throw kt(Ar,"sendSolanaTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),new Fe(`Cannot sendSolanaTransaction before embedded wallet ${c.address} is connected`,Be.EMBEDDED_WALLET_NOT_FOUND);if(kr({showWalletUIs:n?.showWalletUIs}))(async()=>{let a=await Vr();if(!a||!tr)return kt(Ar,"sendSolanaTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void s(new Fe("Must have valid access token and Privy wallet to send transaction",Be.EMBEDDED_WALLET_NOT_FOUND));try{if(!await ua.recoverPrimaryWallet())return kt(Ar,"sendSolanaTransaction","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),void s(new Fe("Unable to connect to wallet",Be.UNKNOWN_CONNECT_WALLET_ERROR));if(kr({showWalletUIs:n?.showWalletUIs})){let{instructions:r}=await pt(e,t);r.every((e=>e.hasFunds))||(kt(Ar,"sendSolanaTransaction","onError",Be.INSUFFICIENT_BALANCE),s(new Fe("Solana wallet has insufficient funds for this transaction.",Be.INSUFFICIENT_BALANCE)))}let{entropyId:i,entropyIdVerifier:l}=B(se),{signature:d,receipt:u}=await ze({accessToken:a,tx:e,connection:t,walletProxy:tr,transactionOptions:r,entropyId:i,entropyIdVerifier:l,transactingWalletAddress:c.address,transactingWalletIndex:c.walletIndex??0}),h=wt(d,u);kt(Ar,"sendSolanaTransaction","onSuccess",h),o(h)}catch(e){kt(Ar,"sendSolanaTransaction","onError",Be.TRANSACTION_FAILURE),s(e)}})();else{let{entropyId:i,entropyIdVerifier:u}=k(d),h={entropyId:i,entropyIdVerifier:u,onCompleteNavigateTo:At.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN,onFailure:e=>{kt(Ar,"sendSolanaTransaction","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),s(e)}},p=lt(ar)?Rt({address:c.address,appConfig:ar,methodScreen:At.FUNDING_METHOD_SELECTION_SCREEN,fundWalletConfig:a,comingFromSendTransactionScreen:!0}):void 0;lr({connectWallet:h,sendSolanaTransaction:{transactionRequest:e,connection:t,transactionOptions:r,transactingWallet:c,onSuccess:e=>{kt(Ar,"sendSolanaTransaction","onSuccess",e),o(e)},onFailure:e=>{kt(Ar,"sendSolanaTransaction","onError",Be.TRANSACTION_FAILURE),s(e)},uiOptions:n||{},requesterAppId:l},funding:p}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}}));function ia(){return new Promise((async(e,t)=>{let r=await Vr();if(!r||!tr)throw Error("Must have valid access token to enroll in MFA");try{await tr.verifyMfa({accessToken:r}),e()}catch(e){t(e)}}))}let oa=e=>e?.linkedAccounts.filter((e=>null!==e.latestVerifiedAt&&!("wallet"===e.type&&"privy"===e.walletClientType))).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0],sa=e=>{let t=se?.linkedAccounts.filter((t=>t.type===e)).length??0,{displayName:r,loginMethod:a}=mt(e);if("passkey"===e&&t>=5||"passkey"!==e&&t>=1)throw kt(Ar,"linkAccount","onError",Be.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:a}),new Fe(`User already has an account of type ${r} linked.`)};async function la({showAutomaticRecovery:e=!1,legacySetWalletPasswordFlow:t=!1}){jt(null);let r=t?"setWalletPassword":"setWalletRecovery";if(!$||!se)throw kt(Ar,r,"onError",Be.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let a=O(se);if(!a||!tr)throw kt(Ar,r,"onError",Be.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");try{await ia()}catch(e){throw kt(Ar,r,"onError",Be.MISSING_MFA_CREDENTIALS),e}return new Promise(((n,i)=>{or(!0);let o={onSuccess:e=>{kt(Ar,r,"onSuccess","user-passcode",e),n(e)},onFailure:e=>{kt(Ar,r,"onError",Be.USER_EXITED_SET_PASSWORD_FLOW),i(e)},callAuthOnSuccessOnClose:!1},s="user-passcode"===a.recoveryMethod,l=it({walletAction:"update",availableRecoveryMethods:ar.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:t,isResettingPassword:s,showAutomaticRecovery:e}),{entropyId:c,entropyIdVerifier:d}=k(a);lr({setWalletPassword:o,recoverWallet:{entropyId:c,entropyIdVerifier:d,onFailure:i},createWallet:o,connectWallet:{onCompleteNavigateTo:l,shouldForceMFA:!1,entropyId:c,entropyIdVerifier:d,onFailure:e=>{kt(Ar,r,"onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),i(e)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:s}}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}))}async function ca({appId:e,action:t}){let r=await Vr();if("link"===t&&!r)throw kt(Ar,"linkAccount","onError",Be.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${e}`}),new Fe("User must be authenticated before linking an account.");if("login"===t&&r)throw kt(Ar,"login","onError",Be.UNKNOWN_AUTH_ERROR),new Fe("Attempted to log in, but user is already logged in. Use a `link` helper instead.");Cr.current=`privy:${e}`,Ir.current=t;let a=dt();return W.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:e}}),new Promise((async(r,n)=>{let{name:i,logoUrl:o}=await Ze({api:W.api,providerAppId:e,requesterAppId:ar.id});lr({crossAppAuth:{appId:e,name:i,logoUrl:o,action:t,popup:a,onSuccess:r,onError:n}}),br(At.CROSS_APP_AUTH_SCREEN)}))}let da={ready:K,authenticated:$,user:se,walletConnectors:W.connectors||null,connectWallet:e=>{e&&"target"in e&&e&&(e=void 0),lr({externalConnectWallet:{walletList:e?.walletList&&e?.walletList.length>0?e.walletList:void 0,suggestedAddress:e?.suggestedAddress}}),Nr($?At.CONNECT_ONLY_AUTHENTICATED_SCREEN:At.CONNECT_ONLY_LANDING_SCREEN)},linkWallet:$r,startCrossAppAuthFlow:ca,linkEmail:()=>{qr("email"),sa("email"),Cr.current="email",Ir.current="link",Nr(At.LINK_EMAIL_SCREEN)},linkPhone:()=>{qr("sms"),sa("phone"),Cr.current="sms",Ir.current="link",Nr(At.LINK_PHONE_SCREEN)},linkGoogle:async()=>{qr("google"),sa("google_oauth"),Ir.current="link",await ua.initLoginWithOAuth("google")},linkTwitter:async()=>{qr("twitter"),sa("twitter_oauth"),Ir.current="link",await ua.initLoginWithOAuth("twitter")},linkDiscord:async()=>{qr("discord"),sa("discord_oauth"),Ir.current="link",await ua.initLoginWithOAuth("discord")},linkGithub:async()=>{qr("github"),sa("github_oauth"),Ir.current="link",await ua.initLoginWithOAuth("github")},linkSpotify:async()=>{qr("spotify"),sa("spotify_oauth"),Ir.current="link",await ua.initLoginWithOAuth("spotify")},linkInstagram:async()=>{qr("instagram"),sa("instagram_oauth"),Ir.current="link",await ua.initLoginWithOAuth("instagram")},linkTiktok:async()=>{qr("tiktok"),sa("tiktok_oauth"),Ir.current="link",await ua.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{qr("linkedin"),sa("linkedin_oauth"),Ir.current="link",await ua.initLoginWithOAuth("linkedin")},linkApple:async()=>{qr("apple"),sa("apple_oauth"),Ir.current="link",await ua.initLoginWithOAuth("apple")},linkPasskey:async()=>{qr("passkey"),sa("passkey"),await ua.initLinkWithPasskey(),Nr(At.LINK_PASSKEY_SCREEN)},linkTelegram:async()=>{qr("telegram"),sa("telegram"),Ir.current="link",Cr.current="telegram",await ua.initLoginWithTelegram(),Nr(At.TELEGRAM_AUTH_SCREEN)},linkFarcaster:async()=>{qr("farcaster"),sa("farcaster"),await ua.initLoginWithFarcaster(),Ir.current="link",Cr.current="farcaster",Nr(At.AWAITING_FARCASTER_CONNECTION)},updateEmail:()=>{if(qr("email"),!se?.email)throw new Fe("User does not have an email linked to their account.");Ir.current="update",Cr.current="email",Nr(At.UPDATE_EMAIL_SCREEN)},updatePhone:()=>{if(qr("sms"),!se?.phone)throw new Fe("User does not have a phone number linked to their account.");Ir.current="update",Cr.current="sms",Nr(At.UPDATE_PHONE_SCREEN)},login:async e=>{e&&"target"in e&&e&&(e=void 0);let t="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!K){let e=await new Promise((e=>{dr((t=>e.bind(t)))}));if(dr(null),e)return void console.warn(t)}!se||se.isGuest?(Ir.current="login",lr({login:e}),br(At.LANDING)):console.warn(t)},connectOrCreateWallet:async()=>{K||(await new Promise((e=>{dr((()=>e))})),dr(null)),$?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(Ir.current="login",br(At.CONNECT_OR_CREATE))},logout:async()=>{if(Ir.current=null,Cr.current=null,se&&W.clearProviderAcccessTokens(se),jt(null),await W.logout(),se&&tr)try{await tr.clearMfa({userId:se.id})}catch(e){}ce(null),Y(!1),kt(Ar,"logout","onSuccess"),H(!1),re.del(q),re.del(X(ar.id))},getAccessToken:()=>W.getCustomerAccessToken(),getEthereumProvider:()=>{if(!se||!se.wallet)return new ve;let e=de.find((e=>se.wallet&&e.address===se.wallet.address)),t=W.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new ve},getEthersProvider:()=>{if(!se||!se.wallet)return new a(new Ce(new ve));let e=de.find((e=>se.wallet&&e.address===se.wallet.address)),t=W.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new a(new Ce(e&&t?t.proxyProvider:new ve))},getWeb3jsProvider:()=>{if(!se||!se.wallet)return new Ie(new ve);let e=de.find((e=>se.wallet&&e.address===se.wallet.address)),t=W.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new Ie(e&&t?t.proxyProvider:new ve)},unlinkWallet:async e=>{let t;return ce(t=e.startsWith("0x")?await W.unlinkEthereumWallet(e):await W.unlinkSolanaWallet(e)),t},unlinkEmail:async e=>{let t=await W.unlinkEmail(e);return ce(t),t},unlinkPhone:async e=>{let t=await W.unlinkPhone(e);return ce(t),t},unlinkGoogle:async e=>{let t=await W.unlinkOAuth("google",e);return ce(t),t},unlinkTwitter:async e=>{let t=await W.unlinkOAuth("twitter",e);return ce(t),t},unlinkDiscord:async e=>{let t=await W.unlinkOAuth("discord",e);return ce(t),t},unlinkGithub:async e=>{let t=await W.unlinkOAuth("github",e);return ce(t),t},unlinkSpotify:async e=>{let t=await W.unlinkOAuth("spotify",e);return ce(t),t},unlinkInstagram:async e=>{let t=await W.unlinkOAuth("instagram",e);return ce(t),t},unlinkTiktok:async e=>{let t=await W.unlinkOAuth("tiktok",e);return ce(t),t},unlinkLinkedIn:async e=>{let t=await W.unlinkOAuth("linkedin",e);return ce(t),t},unlinkApple:async e=>{let t=await W.unlinkOAuth("apple",e);return ce(t),t},unlinkFarcaster:async e=>{let t=await W.unlinkFarcaster(e);return ce(t),t},unlinkTelegram:async e=>{let t=await W.unlinkTelegram(e);return ce(t),t},unlinkPasskey:async e=>{let t=await W.unlinkPasskey(e);return ce(t),t},unlinkCrossAppAccount:async({subject:e})=>{let t=se?.linkedAccounts.find((t=>"cross_app"===t.type&&t.subject===e))?.providerApp;if(!t)throw new Fe("Invalid subject");W.storeProviderAccessToken(t.id,null);let r=await W.unlinkOAuth(`privy:${t.id}`,e);return ce(r),r},setActiveWallet:async e=>{let t=de.find((t=>r(t.address)===r(e))),a=se?.linkedAccounts.find((t=>"wallet"===t.type&&r(t.address)===r(e)));if(t&&await t.isConnected())if(t.linked){let e=Object.assign({},se);e.wallet=a&&{address:a.address,chainType:a.chainType,chainId:a.chainId,walletClient:a.walletClient,walletClientType:a.walletClientType,connectorType:a.connectorType,imported:a.imported,delegated:a.delegated,walletIndex:a.walletIndex},ce(e)}else t.loginOrLink();else lr({externalConnectWallet:{suggestedAddress:e}}),$r()},forkSession:()=>W.forkSession(),createWallet:async e=>{if(e&&"target"in e&&e&&(e=void 0),!$||!se)throw kt(Ar,"createWallet","onError",Be.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return Jr(se,15e3,e)},setWalletRecovery:async e=>la({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:e?.showAutomaticRecovery??!1}),setWalletPassword:async()=>la({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(e,t,r)=>new Promise((async(a,n)=>{let{requesterAppId:i}=t||{};if(!$||!se)return kt(Ar,"signMessage","onError",Be.MUST_BE_AUTHENTICATED),void n(Error("User must be authenticated before signing with a Privy wallet"));let o=r??S(se)?.address;if(!o)throw new Fe("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:l}=x(se,o);if(!s||!l)return kt(Ar,"signMessage","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void n(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return kt(Ar,"signMessage","onError",Be.INVALID_MESSAGE),void n(Error("Message must be a non-empty string"));or(!0);let c=async()=>{if(!$)throw Error("User must be authenticated before signing with a Privy wallet");let t=await Vr();if(!tr||!t||!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");W.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:s.address,requesterAppId:i}});let{entropyId:r,entropyIdVerifier:a}=k(l),{response:n}=await tr.rpc({accessToken:t,entropyId:r,entropyIdVerifier:a,chainType:"ethereum",hdWalletIndex:s.walletIndex??0,requesterAppId:i,request:{method:"personal_sign",params:[e,s.address]}}),o=n.data;return W.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:s.address,requesterAppId:i}}),o};if(kr({showWalletUIs:t?.showWalletUIs}))try{let e=await c();kt(Ar,"signMessage","onSuccess",e),a(e)}catch(e){kt(Ar,"signMessage","onError",Be.UNABLE_TO_SIGN),n(e??new Ee("Unable to sign message"))}else{let{entropyId:r,entropyIdVerifier:i}=k(l);lr({signMessage:{method:"personal_sign",data:e,confirmAndSign:c,onSuccess:e=>{kt(Ar,"signMessage","onSuccess",e),a(e)},onFailure:e=>{kt(Ar,"signMessage","onError",Be.UNABLE_TO_SIGN),n(e)},uiOptions:t||{}},connectWallet:{entropyId:r,entropyIdVerifier:i,onCompleteNavigateTo:At.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{kt(Ar,"signMessage","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),n(e)}}}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),signTypedData:(e,t,r)=>new Promise((async(a,n)=>{let{requesterAppId:i}=t||{};if(!$||!se)return kt(Ar,"signTypedData","onError",Be.MUST_BE_AUTHENTICATED),void n(Error("User must be authenticated before signing with a Privy wallet"));let o=r??S(se)?.address;if(!o)throw new Fe("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:l}=x(se,o);if(!l||!s)return kt(Ar,"signTypedData","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void n(Error("Must have a Privy wallet before signing"));or(!0);let c=ie(e),d=async()=>{if(!$)throw Error("User must be authenticated before signing with a Privy wallet");let e=await Vr();if(!tr||!e||!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");W.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:s.address,requesterAppId:i}});let{entropyId:t,entropyIdVerifier:r}=k(l),{response:a}=await tr.rpc({accessToken:e,entropyId:t,entropyIdVerifier:r,chainType:"ethereum",hdWalletIndex:s.walletIndex??0,requesterAppId:i,request:{method:"eth_signTypedData_v4",params:[s.address,c]}}),n=a.data;return W.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:s.address,requesterAppId:i}}),n};if(kr({showWalletUIs:t?.showWalletUIs,typedData:!0}))try{let e=await d();kt(Ar,"signTypedData","onSuccess",e),a(e)}catch(e){kt(Ar,"signTypedData","onError",Be.UNABLE_TO_SIGN),n(e??new Ee("Unable to sign message"))}else{let{entropyId:e,entropyIdVerifier:r}=k(l);lr({signMessage:{method:"eth_signTypedData_v4",data:c,confirmAndSign:d,onSuccess:e=>{kt(Ar,"signTypedData","onSuccess",e),a(e)},onFailure:e=>{kt(Ar,"signTypedData","onError",Be.UNABLE_TO_SIGN),n(e)},uiOptions:t||{}},connectWallet:{entropyId:e,entropyIdVerifier:r,onCompleteNavigateTo:At.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{kt(Ar,"signMessage","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),n(e)}}}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),sendTransaction:async(e,t,r,a)=>{let n=await aa(e,t,r,a);return De(await n.wait())},sendSolanaTransaction:async(e,t,r,a,n,i)=>{let o=i?me.find((({address:e})=>e===i)):me.slice().sort(((e,t)=>(e.walletIndex??0)-(t.walletIndex??0)))[0];if(!o)throw kt(Ar,"sendSolanaTransaction","onError",Be.EMBEDDED_WALLET_NOT_FOUND),new Fe("Embedded wallet not found",Be.EMBEDDED_WALLET_NOT_FOUND);return await na({transaction:e,connection:t,transactionOptions:a,uiOptions:r,fundWalletConfig:n,wallet:o})},exportWallet:e=>new Promise((async(t,r)=>{if(!$||!se)return void r(Error("User must be authenticated before exporting their Privy wallet"));e&&"target"in e&&e&&(e=void 0);let a=e?.address??S(se)?.address;if(!a)return void r(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));let{signingWallet:n,rootWallet:i}=x(se,a);if(!n||!i)return void r(Error("Must have a Privy wallet before exporting"));or(!0);let{entropyId:o,entropyIdVerifier:s}=k(i),l={entropyId:o,entropyIdVerifier:s,onCompleteNavigateTo:At.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:r,shouldForceMFA:!0};lr(sr),await Vr()&&tr?tr?(lr({keyExport:{appId:I.appId,appClientId:I.clientId,origin:W.apiUrl,walletToExport:n,primaryWallet:i,onSuccess:t,onFailure:r},connectWallet:l}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)):r(Error("Must have a Privy wallet before exporting")):r(Error("Must have valid access token to enroll in MFA"))})),promptMfa:ia,async init(e){switch(e){case"sms":return void await W.initMfaSmsVerification();case"passkey":return await W.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${e}`)}},async submit(e,t){switch(e){case"totp":case"sms":if("string"!=typeof t)throw new Fe("Invalid MFA code");Er.current?.resolve({mfaMethod:e,mfaCode:t,relyingParty:window.origin}),await new Promise(((e,t)=>{_r.current={resolve:e,reject:t}}));break;case"passkey":if("string"==typeof t)throw new Fe("Invalid authenticator response");let r=await import("@simplewebauthn/browser"),a=yt(await r.startAuthentication(t));Er.current?.resolve({mfaMethod:e,mfaCode:a,relyingParty:window.origin}),await new Promise(((e,t)=>{_r.current={resolve:e,reject:t}}));break;default:throw Er.current?.reject(new Fe("Unsupported MFA method")),new Fe(`Unsupported MFA method: ${e}`)}},cancel(){Er.current?.reject(new Fe("MFA canceled"))},async initEnrollmentWithSms(e){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to enroll in MFA");await tr.initEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber})},enrollInMfa:e=>new Promise(((t,r)=>{if(!e)return ua.closePrivyModal(),void t();ar.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),lr({mfaEnrollmentFlow:{mfaMethods:ar.mfa.methods,onSuccess:t,onFailure:r}}),Nr(At.MFA_ENROLLMENT_FLOW_SCREEN)})),async initEnrollmentWithTotp(){let e=await Vr();if(!e||!tr)throw Error("Must have valid access token to enroll in MFA");let t=await tr.initEnrollMfa({method:"totp",accessToken:e});return{secret:t.secret,authUrl:t.authUrl}},async submitEnrollmentWithSms(e){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to enroll in MFA");await tr.submitEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber,code:e.mfaCode}),ce(await W.getAuthenticatedUser())},async submitEnrollmentWithTotp(e){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to enroll in MFA");await tr.submitEnrollMfa({method:"totp",accessToken:t,code:e.mfaCode}),ce(await W.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:e}){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to enroll in MFA");await tr.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:e}),ce(await W.getAuthenticatedUser())},async unenroll(e){let t=await Vr();if(!t||!tr)throw Error("Must have valid access token to remove MFA");"passkey"===e?await tr.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:[]}):await tr.unenrollMfa({method:e,accessToken:t}),ce(await W.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{let e=await Vr(),t=se?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!e)throw Error("Must have valid access token to connect with Farcaster");if(!tr||!t)throw Error("Must have an embedded wallet to use Farcaster signers");if(!se?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");let r=await tr.initFarcasterSigner({address:t.address,hdWalletIndex:null,accessToken:e,mfaCode:null,mfaMethod:null,relyingParty:window.origin});"approved"===r.status&&ce(await W.getAuthenticatedUser()||se||null),lr({farcasterSigner:r}),Nr(At.AWAITING_FARCASTER_SIGNER)},getFarcasterSignerPublicKey:async()=>{let e,t=await Vr(),r=se?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!tr||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!se?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!se.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");return e=se.farcaster.signerPublicKey.slice(2),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},signFarcasterMessage:async e=>{let t=await Vr(),r=se?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!tr||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!se?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!se.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");let a=await import("@simplewebauthn/browser"),n=await tr.signFarcasterMessage({address:r.address,hdWalletIndex:null,accessToken:t,mfaCode:null,mfaMethod:null,payload:{hash:a.bufferToBase64URLString(e)},fid:BigInt(se.farcaster.fid),relyingParty:window.origin});return new Uint8Array(a.base64URLStringToBuffer(n.signature))},createGuestAccount:async()=>{if(se&&!se.isGuest)throw Error("User cannot already be authenticated to create a guest account");return se?.isGuest?se:ua.loginWithGuestAccountFlow()},signMessageWithCrossAppWallet(e,{address:t}){let r=se?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t))));return tt({user:se,client:W,address:t,requesterAppId:ar.id,request:{method:r?"privy_signSmartWalletMessage":"personal_sign",params:[e,t]},reconnect:ca})},signTypedDataWithCrossAppWallet(e,{address:t}){let r=se?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t)))),a=ie(e);return tt({user:se,client:W,address:t,requesterAppId:ar.id,request:{method:r?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[t,a]},reconnect:ca})},sendTransactionWithCrossAppWallet(e,{address:t}){let r=se?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t))));return tt({user:se,client:W,address:t,requesterAppId:ar.id,request:{method:r?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[e]},reconnect:ca})},isModalOpen:V,mfaMethods:ar.mfa.methods};Dr=da.signMessage,Lr=da.signTypedData,Mr=async(...e)=>{let t=await aa(...e);return ar.embeddedWallets.waitForTransactionConfirmation&&await t.wait(),t};let ua={setAuthenticated:Y,setUser:ce,isNewUserThisSession:Mt,pendingTransaction:null,walletConnectionStatus:Ht,connectors:W.connectors?.walletConnectors??[],solanaWallets:me,rpcConfig:ar.rpcConfig,chains:ar.chains,appId:I.appId,showFiatPrices:"native-token"!==ar.embeddedWallets.priceDisplay.primary,clientAnalyticsId:W.clientAnalyticsId,customAuthStatus:fr,noPromptOnSignature:Wr,emailOtpState:qt,setEmailOtpState:$t,smsOtpState:Yt,setSmsOtpState:Xt,oAuthState:Zt,setOAuthState:er,siweState:Qt,setSiweState:Jt,isHeadlessOAuthLoading:Bt,nativeTokenSymbolForChainId:e=>ar.chains.find((t=>t.id===Number(e)))?.nativeCurrency.symbol,initializeWalletProxy:async e=>{if(tr)return tr;let t=new Promise((e=>{hr((()=>t=>e(t)))})),r=new Promise((t=>setTimeout((()=>t(null)),e))),a=await Promise.race([t,r]);return hr(null),a},getAuthFlow:()=>W.authFlow,getAuthMeta:()=>W.authFlow?.meta,client:W,closePrivyModal:async(e={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let t,r=K&&$&&se;r&&Cr.current&&(t=oa(se)),"login"===Ir.current?e.shouldCallAuthOnSuccess&&r&&Cr.current?(kt(Ar,"login","onComplete",se,Mt,!1,Cr.current,t??null),I.onSuccess?.(se,Mt)):kt(Ar,"login","onError",Be.USER_EXITED_AUTH_FLOW):"link"===Ir.current&&t?e.isSuccess&&r&&Cr.current?kt(Ar,"linkAccount","onSuccess",se,Cr.current,t):Cr.current&&kt(Ar,"linkAccount","onError",Be.USER_EXITED_LINK_FLOW,{linkMethod:Cr.current}):"update"===Ir.current&&t&&(e.isSuccess&&r&&Cr.current?kt(Ar,"update","onSuccess",se,Cr.current,t):Cr.current&&kt(Ar,"update","onError",Be.USER_EXITED_UPDATE_FLOW,{linkMethod:Cr.current}));let a=xt&&ot.includes(xt),n=xt===At.ERROR_SCREEN&&sr.errorModalData&&ot.includes(sr.errorModalData.previousScreen);if((a||n)&&sr.funding){let e,t=st[xt]??null;if("solana"===sr.funding.chainType){let r=N(Et);if(!r)return void console.warn("Unable to load solana plugin, skipping balance");try{e=BigInt(await r.getBalance({address:sr.funding.address,cluster:sr.funding.cluster}))}catch{console.error("Unable to pull wallet balance")}kt(Ar,"fundSolanaWallet","onUserExited",{address:sr.funding.address,cluster:sr.funding.cluster,fundingMethod:t,balance:e})}else{let r=ne(sr.funding.chain.id,ar.chains,ar.rpcConfig,{appId:I.appId});try{e=(await r.getBalance(sr.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}kt(Ar,"fundWallet","onUserExited",{address:sr.funding.address,chain:sr.funding.chain,fundingMethod:t,balance:e})}}lr({...sr,externalConnectWallet:{suggestedAddress:void 0}}),Ir.current=null,Cr.current=null,Ft(!1),H(!1),setTimeout((()=>{W.authFlow=void 0}),200),W.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:({message:e,address:t})=>new Promise((async(r,a)=>{if(!$||!se)return kt(Ar,"signMessage","onError",Be.MUST_BE_AUTHENTICATED),void a(Error("User must be authenticated before signing with a Privy wallet"));let n=t??L(se)?.address;if(!n)throw new Fe("User must have an embedded wallet to sign a message.");let{signingWallet:i,rootWallet:o}=F(se,n);if(!i||!o)return kt(Ar,"signMessage","onError",Be.EMBEDDED_WALLET_NOT_FOUND),void a(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return kt(Ar,"signMessage","onError",Be.INVALID_MESSAGE),void a(Error("Message must be a non-empty string"));or(!0);let s=async()=>{if(!$)throw Error("User must be authenticated before signing with a Privy wallet");let t=await W.getAccessToken();if(!t)throw Error("User must be authenticated to use their embedded wallet.");let r=ua.walletProxy??await ua.initializeWalletProxy(15e3);if(!r)throw Error("Failed to initialize embedded wallet proxy.");if(!await ua.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!o)throw Error("No root wallet for signing wallet found");let{entropyId:a,entropyIdVerifier:n}=k(o),{response:s}=await r.rpc({accessToken:t,entropyId:a,entropyIdVerifier:n,chainType:"solana",hdWalletIndex:i.walletIndex??0,request:{method:"signMessage",params:{message:e}}});return s.data.signature};if(kr({showWalletUIs:void 0}))try{let e=await s();r({signature:e})}catch(e){a(e)}else{let{entropyId:t,entropyIdVerifier:n}=k(o);lr({signMessage:{method:"solana_signMessage",data:e,confirmAndSign:s,onSuccess:e=>{r({signature:e})},onFailure:e=>{a(e)},uiOptions:{}},connectWallet:{entropyId:t,entropyIdVerifier:n,onCompleteNavigateTo:At.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{kt(Ar,"signMessage","onError",Be.UNKNOWN_CONNECT_WALLET_ERROR),a(e)}}}),br(At.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),openPrivyModal:Nr,connectWallet:Hr,initLoginWithWallet:async(e,t,r)=>{Te(e)?(Cr.current="siwe",Kr(e,t,r)):(Cr.current="siws",Gr(e,t))},loginWithWallet:async()=>{let e,t,r;if(!K)throw new Ve;if(W.authFlow instanceof E?e="siwe":W.authFlow instanceof _&&(e="siws"),!e)throw new Fe("Must initialize SIWE/SIWS flow first.");if(null!==await W.getAccessToken())try{({user:t}=await W.link()),Cr.current=e}catch(t){throw kt(Ar,"linkAccount","onError",t.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{({user:t,isNewUser:r}=await W.authenticate()),Cr.current=e}catch(e){throw kt(Ar,"login","onError",e.privyErrorCode||Be.GENERIC_CONNECT_WALLET_ERROR),e}ce(t||se||null),Ft(r||!1),Y(!0)},delegateWallet:async({address:e,chainType:t})=>new Promise((async(r,a)=>{let n=await Vr();if(!$||!se||!n)throw new Fe("User must be authenticated and have an embedded wallet to delegate actions.");if("solana"!==t&&"ethereum"!==t)throw new Fe("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let i=ua.walletProxy??await ua.initializeWalletProxy(15e3);if(!i)throw new Fe("Wallet proxy not initialized.");if(Ue({address:e,chainType:t,user:se}))return r();let o=Oe({address:e,user:se}),s=Se({address:e,user:se});await ua.recoverPrimaryWallet(),lr({delegatedActions:{consent:{address:e,onDelegate:async()=>{await i.createDelegatedAction({accessToken:n,rootWallet:s,delegatedWallets:[o]}),await ua.refreshUser()},onSuccess:async()=>{r()},onError:async e=>{a(e)}}}}),Nr(At.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN)})),revokeDelegatedWallets:async()=>new Promise((async(e,t)=>{if(!$||!se)throw new Fe("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");if(0===Re(se).length)throw new Fe("User has no delegated wallets to revoke.");lr({delegatedActions:{revoke:{onRevoke:async()=>{await W.revokeDelegatedWallet(),await ua.refreshUser()},onSuccess:async()=>{e()},onError:async e=>{t(e)}}}}),Nr(At.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN)})),initLoginWithFarcaster:async(e,t)=>{let r=new y(e,t);W.startAuthFlow(r);try{Cr.current="farcaster",await r.initializeFarcasterConnect()}catch(e){throw"login"===Ir.current?kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR):"link"===Ir.current&&kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),e}},loginWithFarcaster:async()=>{let e,t;if(!K)throw new Ve;if(!(W.authFlow instanceof y))throw new Fe("Must initialize Farcaster flow first.");if(null!==await W.getAccessToken())try{({user:e}=await W.link()),Cr.current="farcaster"}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),e}else try{({user:e,isNewUser:t}=await W.authenticate()),Cr.current="farcaster"}catch(e){throw kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}ce(e||null),Ft(t||!1),Y(!0)},async loginWithGuestAccountFlow(){let e=new f(this.appId);W.startAuthFlow(e);try{Ir.current="login",Cr.current="guest";let{user:e,isNewUser:t}=await W.authenticate();if(t=t||!1,!e)throw new Fe("Unable to authenticate guest account");if(D(e,ar.embeddedWallets.createOnLogin))try{await Jr(e,15e3),e=await ua.refreshUser()}catch(t){ce(e),console.warn("Unable to create embedded wallet for guest account")}else ce(e);return Ft(t),Y(!0),kt(Ar,"login","onComplete",e,t,!1,"guest",null),e}catch(e){throw kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}},async crossAppAuthFlow({appId:e,popup:t,action:r}){let a=`privy:${e}`;Cr.current=a;let{url:n,stateCode:i,codeVerifier:o}=await Qe({api:W.api,appId:e});if(!n)throw W.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:e}}),new Fe("No authorization URL returned for cross-app auth.");try{let s=await et({url:n,popup:t,provider:a}),l=s.stateCode,c=s.authorizationCode;if(l!==i)throw W.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:a,storedStateCode:i??"",returnedStateCode:l??""}}),new Fe("Unexpected auth flow. This may be a phishing attempt.",void 0,Be.OAUTH_UNEXPECTED);let d=await Je({appId:e,codeVerifier:o,stateCode:l,authorizationCode:c,action:r,client:W});d&&W.storeProviderAccessToken(e,d);let u=await ua.refreshUser();if(!u)throw new Fe("Unable to update user");return W.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:e}}),u}catch(e){throw W.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:e.toString(),provider:a}}),e}},async initLoginWithOAuth(e,t,r){if(Cr.current=e,!ae())return void br(At.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);if("google"===e&&ct(window.navigator.userAgent))return void br(At.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);"twitter"===e&&window.opener&&window.opener.postMessage({type:$e},"*"),re.del(Q),re.del(J);let a=new Lt({provider:e,disableSignup:!!r,withPrivyUi:!0});t&&a.addCaptchaToken(t),W.startAuthFlow(a);let n=await W.authFlow.getAuthorizationUrl();n&&n.url&&("twitter"===e&&c&&(n.url=n.url.replace("x.com","twitter.com")),window.location.assign(n.url))},async initLoginWithTelegram(e,t){if(!K)throw new Ve;Cr.current="telegram";let r=new v(e,t);W.startAuthFlow(r),r.meta.telegramWebAppData=void 0,r.meta.telegramAuthResult=await new Promise(((e,t)=>ar.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:ar.loginConfig.telegramAuthConfiguration.botId,request_access:!0},(r=>r?e(r):t(new Fe("Telegram auth failed or was canceled by the client")))):t(new Fe("Telegram was not initialized")):t(new Fe("Telegram Auth configuration is not loaded"))))},async loginWithTelegram(e){let t,r;if(!(W.authFlow instanceof v))throw new Fe("Must initialize Telegram flow before calling loginWithTelegram");if(W.authFlow.meta.captchaToken||=e,"login"===Ir.current)try{let e=await W.authenticate();t=e.user,r=e.isNewUser,Cr.current="telegram"}catch(e){throw kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}else{if("link"!==Ir.current)throw new Fe("Unknown auth intent");try{t=(await W.link()).user,Cr.current="telegram"}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),e}}ce(t),Ft(r||!1),Y(!0)},async recoveryOAuthFlow(e,t,r){let a,n;function i(t){if(!t)throw W.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:e}}),new Fe("Recovery OAuth failed")}switch(e){case"google-drive":{let t,o,{url:s,codeVerifier:l,stateCode:c}=await rt({api:Pr.api,provider:e});i(s);try{let a=await ut({url:s,popup:r,provider:e});if(t=a.stateCode,o=a.authorizationCode,t!==c)throw W.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:c??"",returnedStateCode:t??""}}),new Fe("Unexpected auth flow. This may be a phishing attempt.",void 0,Be.OAUTH_UNEXPECTED)}catch(t){throw W.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:e}}),new Fe("Recovery OAuth failed")}[a,n]=await Promise.all([Vr(),at({api:Pr.api,provider:e,codeVerifier:l,stateCode:t,authorizationCode:o})]);break}case"icloud":{let{url:t}=await rt({api:Pr.api,provider:e});i(t);let{ckWebAuthToken:o}=await ut({url:t,popup:r,provider:e});n=o,a=await Vr()}}if(!tr)throw new Fe("Cannot connect to wallet proxy");if(!a)throw new Fe("Unable to authorize user");switch(t){case"recover":{let t=sr.recoverWallet?.entropyId,r=sr.recoverWallet?.entropyIdVerifier;if(!t||!r)throw new Fe("Recovery OAuth failed");W.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:t,recoveryMethod:e}}),await tr.recover({accessToken:a,entropyId:t,entropyIdVerifier:r,recoveryAccessToken:n}),W.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t,recoveryMethod:e}});break}case"create-wallet":{W.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await tr.create({accessToken:a,recoveryAccessToken:n,recoveryMethod:e});let t=S(await ua.refreshUser());if(!t)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");W.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.address}}),kt(Ar,"createWallet","onSuccess",t);break}case"set-recovery":{let t=O(se);if(!t)throw kt(Ar,"setWalletRecovery","onError",Be.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");W.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:t.address,existingRecoveryMethod:t.recoveryMethod,targetRecoveryMethod:e}});let{entropyId:r,entropyIdVerifier:i}=k(t);await tr.setRecovery({accessToken:a,entropyId:r,entropyIdVerifier:i,recoveryMethod:e,recoveryAccessToken:n});let o=O(await ua.refreshUser());if(!o)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");W.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:t.address,existingRecoveryMethod:t.recoveryMethod,targetRecoveryMethod:e}}),kt(Ar,"setWalletRecovery","onSuccess",e,o);break}default:throw new Fe("Unsupported recovery action")}},async loginWithOAuth(e){let t,r,a;if(!(W.authFlow instanceof Lt))throw new Fe("Must initialize OAuth flow before calling loginWithOAuth");let n=re.get(Z),i=W.authFlow.meta.stateCode;if(n!==i)throw W.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:n??"",returnedStateCode:i??""}}),new Fe("Unexpected auth flow. This may be a phishing attempt.",void 0,Be.OAUTH_UNEXPECTED);if(null!==await W.getAccessToken())try{let r=await W.link();t=r.user,a=r.oAuthTokens,Cr.current=e}catch(t){throw kt(Ar,"linkAccount","onError",t.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{let n=await W.authenticate();t=n.user,r=n.isNewUser,a=n.oAuthTokens,Cr.current=e}catch(t){throw"login"===Ir.current?kt(Ar,"login","onError",t.privyErrorCode||Be.UNKNOWN_AUTH_ERROR):"link"===Ir.current&&kt(Ar,"linkAccount","onError",t.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}return ce(t),Ft(r||!1),Y(!0),a&&t&&kt(Ar,"oAuthAuthorization","onOAuthTokenGrant",a,{user:t}),a},passkeyAuthState:Gt,setPasskeyAuthState:zt,async initLoginWithPasskey({captchaToken:e,withPrivyUi:t}){let r=new g({captchaToken:e,setPasskeyAuthState:zt});W.startAuthFlow(r),Ir.current="login";try{Cr.current="passkey",zt({status:"generating-challenge"}),await r.initAuthenticationFlow(t),zt({status:"awaiting-passkey"})}catch(e){throw zt({status:"error",error:e}),kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}},async loginWithPasskey(){let e,t;if(!K)throw new Ve;if(!(W.authFlow instanceof g))throw new Fe("Must initialize Passkey flow first.");if("passkey"!==Cr.current){let e=new Fe("Must init login with Passkey flow first.");throw zt({status:"error",error:e}),e}let r=await Vr();try{Cr.current="passkey",zt({status:"awaiting-passkey"}),({user:e,isNewUser:t}=await W.authenticate())}catch(e){throw zt({status:"error",error:e}),kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}ce(e),Ft(t||!1),Y(!0),zt({status:"done"});let a=e?.linkedAccounts.find((({type:e})=>"passkey"===e))||null;return{user:e,isNewUser:t||!1,wasAlreadyAuthenticated:!!r,loginAccount:a}},async initLinkWithPasskey(e){let t=new g({captchaToken:e});W.startAuthFlow(t),Ir.current="link",Cr.current="passkey",zt({status:"generating-challenge"});try{await t.initLinkFlow(),zt({status:"awaiting-passkey"})}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),zt({status:"error",error:e}),e}},async linkWithPasskey(){let e;if(!K)throw new Ve;if(!(W.authFlow instanceof g))throw new Fe("Must initialize Passkey flow first.");if("passkey"!==Cr.current)throw new Fe("Must init login with Passkey flow first.");try{Cr.current="passkey",({user:e}=await W.link())}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),e}return ce(e||se||null),zt({status:"done"}),e},async initLoginWithHeadlessOAuth(e,t,r){if(!ae())throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");if("google"===e&&ct(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let a=new Lt({provider:e,withPrivyUi:!1,disableSignup:r??!1});t&&a.addCaptchaToken(t),er({status:"loading"});let n=await W.startAuthFlow(a).getAuthorizationUrl();n?.url&&window.location.assign(n.url)},async loginWithHeadlessOAuth(e){let t,r,a;Vt(!0),er({status:"loading"}),W.startAuthFlow(new Lt(e));let n=re.get(Z),i=e.stateCode;if(n!==i)throw W.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e.provider,storedStateCode:n??"",returnedStateCode:i??""}}),Vt(!1),new Fe("Unexpected auth flow. This may be a phishing attempt.",void 0,Be.OAUTH_UNEXPECTED);if(null!==await W.getAccessToken())try{({user:t,oAuthTokens:a}=await W.link()),Cr.current=e.provider;let r=oa(t);t&&r&&kt(Ar,"linkAccount","onSuccess",t,Cr.current,r)}catch(t){throw Vt(!1),kt(Ar,"linkAccount","onError",t.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:e.provider}),t}else try{({user:t,isNewUser:r,oAuthTokens:a}=await W.authenticate()),Cr.current=e.provider;let n=oa(t);t&&n&&void 0!==r&&kt(Ar,"login","onComplete",t,r,!1,Cr.current,n)}catch(e){throw Vt(!1),er({status:"error",error:e}),kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}return ce(t),Ft(r||!1),Y(!0),Vt(!1),er({status:"done"}),a&&t&&kt(Ar,"oAuthAuthorization","onOAuthTokenGrant",a,{user:t}),t??void 0},initLoginWithEmail:async({email:e,captchaToken:t,disableSignup:r,withPrivyUi:a})=>{let n=new m({email:e,captchaToken:t,disableSignup:r});W.startAuthFlow(n);try{Cr.current="email",$t({status:"sending-code"}),await n.sendCodeEmail({withPrivyUi:a}),$t({status:"awaiting-code-input"})}catch(e){throw $t({status:"error",error:e}),"login"===Ir.current?kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR):"link"===Ir.current&&kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),e}},initUpdateEmail:async(e,t,r)=>{let a=new w(e,t,r);W.startAuthFlow(a);try{await a.sendCodeEmail({withPrivyUi:!0})}catch(e){kt(Ar,"update","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR,{linkMethod:Cr.current})}},initUpdatePhone:async(e,t,r)=>{let a=new A(e,t,r);W.startAuthFlow(a);try{await a.sendSmsCode({withPrivyUi:!0})}catch(e){kt(Ar,"update","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR,{linkMethod:Cr.current})}},initLoginWithSms:async({phoneNumber:e,captchaToken:t,disableSignup:r,withPrivyUi:a})=>{Xt({status:"sending-code"});let n=new T({phoneNumber:e,captchaToken:t,disableSignup:r});W.startAuthFlow(n);try{Cr.current="sms",await n.sendSmsCode({withPrivyUi:a}),Xt({status:"awaiting-code-input"})}catch(e){throw Xt({status:"error",error:e}),"login"===Ir.current?kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR):"link"===Ir.current&&kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),e}},resendEmailCode:async()=>{await(W.authFlow?.sendCodeEmail({withPrivyUi:!0}))},resendSmsCode:async()=>{await(W.authFlow?.sendSmsCode({withPrivyUi:!0}))},loginWithCode:async e=>{let t,r;function a(e){W.authFlow instanceof m?$t(e):W.authFlow instanceof T&&Xt(e)}if(a({status:"submitting-code"}),!K){let e=new Ve;throw a({status:"error",error:e}),e}if(W.authFlow instanceof m)W.authFlow.meta.emailCode=e.trim();else{if(!(W.authFlow instanceof T)){let e=new Fe("Must initialize a passwordless code flow first");throw a({status:"error",error:e}),e}W.authFlow.meta.smsCode=e.trim()}let n=await Vr();if("link"===Ir.current)try{({user:t}=await W.link())}catch(e){throw a({status:"error",error:e}),kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:Cr.current}),e}else if("update"===Ir.current)try{({user:t}=await W.link())}catch(e){throw a({status:"error",error:e}),kt(Ar,"update","onError",e.privyErrorCode||Be.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:Cr.current}),e}else try{({user:t,isNewUser:r}=await W.authenticate())}catch(e){throw a({status:"error",error:e}),kt(Ar,"login","onError",e.privyErrorCode||Be.UNKNOWN_AUTH_ERROR),e}let i=t||se;ce(i||null),Ft(r||!1),Y(!0),a({status:"done"});let o=null;return W.authFlow instanceof m?o=i?.linkedAccounts.find((({type:e})=>"email"===e))||null:W.authFlow instanceof T&&(o=i?.linkedAccounts.find((({type:e})=>"phone"===e))||null),{user:i,isNewUser:r||!1,wasAlreadyAuthenticated:!!n,linkedAccount:o}},generateSiweMessage:async({address:e,chainId:t,captchaToken:r})=>{Ir.current="link",Cr.current="siwe",Jt({status:"generating-message"});let a=await W.generateSiweNonce({address:e,captchaToken:r});return Jt({status:"awaiting-signature"}),ht({address:e,chainId:t.replace("eip155:",""),nonce:a})},generateSiweMessageForSmartWallet:async({address:e,chainId:t})=>{let r=await W.generateSiweNonce({address:e});return ht({address:e,chainId:t.replace("eip155:",""),nonce:r})},linkSmartWallet:async({message:e,signature:t,smartWalletType:r})=>{let a;a=await W.linkSmartWallet({message:e,signature:t,smartWalletType:r}),ce((a=await ua.refreshUser()??a)||se||null)},linkWithSiwe:async({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n})=>{let i;qr("siwe");let o=null;try{Jt({status:"submitting-signature"}),i=await W.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:a,connectorType:n}),i=await ua.refreshUser()??i,Jt({status:"done"}),(o=oa(i)||null)&&kt(Ar,"linkAccount","onSuccess",i,"siwe",o)}catch(e){throw kt(Ar,"linkAccount","onError",e.privyErrorCode||Be.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Ir.current=null,Cr.current=null,Jt({status:"error",error:e}),e}let s=i||se;return ce(s||null),Ir.current=null,Cr.current=null,{user:s,linkedAccount:o}},refreshUser:async()=>{let e=await W.getAuthenticatedUser();return Y(!!e),ce(e),e},walletProxy:tr,createAnalyticsEvent:({eventName:e,payload:t,timestamp:r})=>W.createAnalyticsEvent({eventName:e,payload:t,timestamp:r}),acceptTerms:async()=>{let e=await W.acceptTerms();return ce(e),e},getUsdTokenPrice:e=>W.getUsdTokenPrice(e),getUsdPriceForSol:()=>W.getUsdPriceForSol(),recoverPrimaryWallet:async e=>new Promise((async(t,r)=>{let a=O(e?.user??se)||P(e?.user??se)||U(e?.user??se),n=await Vr();if(!n||!tr||!a)return void r(Error("Must have valid access token and Privy wallet to recover wallet"));or(!0);let{entropyId:i,entropyIdVerifier:o}=k(a);try{await tr.connect({accessToken:n,entropyId:i,entropyIdVerifier:o}),t(!0)}catch(e){Pe(e)&&"privy"===a.recoveryMethod?(W.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:a.address}}),(await tr.recover({entropyId:i,entropyIdVerifier:o,accessToken:n})).entropyId||r(Error("Unable to recover wallet")),W.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:a.address}}),t(!0)):Pe(e)&&"privy"!==a.recoveryMethod?(lr({recoverWallet:{entropyId:i,entropyIdVerifier:o,onFailure:r,onSuccess:()=>t(!0)},recoveryOAuthStatus:{provider:a.recoveryMethod,action:"recover"}}),Nr(nt(a.recoveryMethod))):r(e)}})),createEmbeddedSolanaWallet:async e=>{if(e&&"target"in e&&(e=void 0),!$||!se)throw kt(Ar,"createWallet","onError",Be.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return(async(e,t,r)=>{let a=S(e),n=L(e),i=r&&"createAdditional"in r&&r.createAdditional,o=r&&"walletIndex"in r?r.walletIndex:void 0,s=(j(e)?.walletIndex??-1)+1;if(n&&!i&&"number"!=typeof o)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");if("number"==typeof o&&o<0)throw kt(Ar,"createWallet","onError",Be.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${o}) is invalid.`);let[l,c]=await Promise.all([ua.initializeWalletProxy(t),Vr()]);if(!l||!c)throw kt(Ar,"createWallet","onError",Be.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return await ta({user:e,wp:l,accessToken:c,walletIndex:o??s,ethereumWallet:a})})(se,15e3,e)},exportSolanaWallet:e=>new Promise((async(t,r)=>{if(!$||!se)return void r(Error("User must be authenticated before exporting their Privy wallet"));let a=e?.address??L(se)?.address;if(!a)return void r(Error("User does not have an HD Solana wallet."));let{signingWallet:n,rootWallet:i}=F(se,a);if(!n||!i)return void r(Error("Must have a Privy wallet before exporting"));if(or(!0),!await Vr()||!tr)return void r(Error("Must have valid access token to enroll in MFA"));if(!tr)return void r(Error("Must have a Privy wallet before exporting"));let{entropyId:o,entropyIdVerifier:s}=k(i);lr({connectWallet:{entropyId:o,entropyIdVerifier:s,onCompleteNavigateTo:At.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:r,shouldForceMFA:!0},keyExport:{appId:I.appId,appClientId:I.clientId,origin:W.apiUrl,walletToExport:n,primaryWallet:i,onSuccess:t,onFailure:r}}),Nr(At.EMBEDDED_WALLET_CONNECTING_SCREEN)})),setReadyToTrue:e=>{z(!0),cr?.(e)},updateWallets:()=>Qr(),fundWallet:async(e,t)=>{let r=At.FUNDING_METHOD_SELECTION_SCREEN;lr({funding:Pt({address:e,appConfig:ar,fundWalletConfig:t,methodScreen:r})}),Nr(r)},openModal:Nr,requestFarcasterSignerStatus:async e=>{let t=await Vr(),r=se?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!tr||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!se?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");let a=await W.requestFarcasterSignerStatus(e);return"approved"===a.status&&ce(await W.getAuthenticatedUser()||se||null),a},connectCoinbaseSmartWallet:async()=>{ar.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let e=W.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||W.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(e)return e.updateConnectionPreference("smartWalletOnly"),Hr(e);await Br("coinbase_wallet","coinbase_smart_wallet")},initiateAccountTransfer:async({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o})=>{let s=await W.sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:a,telegramAuthResult:n,farcasterEmbeddedAddress:i,oAuthUserInfo:o});return ce(s),s}};Fr=ua.recoverPrimaryWallet,xr=ua.recoverPrimaryWallet,jr=ua.solanaSignMessage;let ha=l((()=>({wallets:de,ready:pr&&Tr})),[de,pr,Tr]),pa=W.authFlow instanceof v,wa=!ar.headless&&ar.captchaEnabled&&!$&&(K||pa);/*#__PURE__*/return e(Ot.Provider,{value:da,children:/*#__PURE__*/e(Nt.Provider,{value:Ar,children:/*#__PURE__*/e(St.Provider,{value:ha,children:/*#__PURE__*/e(It,{...ar,children:/*#__PURE__*/t(bt.Provider,{value:ua,children:[/*#__PURE__*/e(_t,{children:/*#__PURE__*/t(Ut,{data:sr,setModalData:lr,setInitialScreen:jt,initialScreen:xt,authenticated:$,open:V,children:[I.children,wa&&/*#__PURE__*/e(he,{delayedExecution:!1}),/*#__PURE__*/e(vt,{theme:{...ar.appearance.palette||{}}}),!ar.render.standalone&&/*#__PURE__*/e(pe,{open:V})]})}),ir&&nr?/*#__PURE__*/e(be,{appId:I.appId,appClientId:I.clientId,clientAnalyticsId:W.clientAnalyticsId,origin:W.apiUrl,mfaMethods:se?.mfaMethods,mfaPromise:Er,mfaSubmitPromise:_r,onLoad:rr,onLoadFailed:()=>null}):null,ar.loginConfig.telegramAuthConfiguration&& + /*#__PURE__*/e(Tt,{$if:!0,children:/*#__PURE__*/e(we,{scriptHost:I.apiUrl||G,botUsername:ar.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};export{Wr as C,Ir as E,Yr as P,Or as a,Rr as b,Vr as c,Hr as d,Kr as e,Gr as f,Br as g,zr as h,qr as i,$r as j,kr as l}; +diff --git a/node_modules/@privy-io/react-auth/dist/esm/svg/protected-by-privy.mjs b/node_modules/@privy-io/react-auth/dist/esm/svg/protected-by-privy.mjs +index a9ff591..a70467c 100644 +--- a/node_modules/@privy-io/react-auth/dist/esm/svg/protected-by-privy.mjs ++++ b/node_modules/@privy-io/react-auth/dist/esm/svg/protected-by-privy.mjs +@@ -1 +1 @@ +-import{jsx as c}from"react/jsx-runtime";function a(a){/*#__PURE__*/return c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...a,children:/*#__PURE__*/c("g",{fill:a.color||"var(--privy-color-foreground)",children:/*#__PURE__*/c("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}export{a as ProtectedByPrivy}; ++import{jsx as c}from"react/jsx-runtime";function a(a){/*#__PURE__*/return c("div",{...a})}export{a as ProtectedByPrivy}; diff --git a/patches/@privy-io+react-auth.readme.md b/patches/@privy-io+react-auth.readme.md new file mode 100644 index 00000000000..de7438df33e --- /dev/null +++ b/patches/@privy-io+react-auth.readme.md @@ -0,0 +1,29 @@ +# origin check support file and extension + + +## Protocol check + +```js +"https:"!==window.location.protocol +``` + +to + +```js +0>["https:","chrome-extension:","file:"].indexOf(window.location.protocol) +``` + +## Error message + +```js +Embedded wallet is only available over HTTPS +``` + +to + +```js +Embedded wallet is only available over HTTPS/CHROME-EXTENSION/FILE +``` + + + diff --git a/patches/README.md b/patches/README.md new file mode 100644 index 00000000000..afb836593fb --- /dev/null +++ b/patches/README.md @@ -0,0 +1,6 @@ +# How to patch a package + +- First remove the `resolutions` field from package.json +- Then run `npx patch-package package-name` (note: must use npx instead of yarn) to generate the patch normally +- Finally revert the removal of `resolutions` field + diff --git a/patches/expo-apple-authentication+6.3.0.patch b/patches/expo-apple-authentication+6.3.0.patch new file mode 100644 index 00000000000..055328d7014 --- /dev/null +++ b/patches/expo-apple-authentication+6.3.0.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/expo-apple-authentication/ios/AppleAuthenticationExceptions.swift b/node_modules/expo-apple-authentication/ios/AppleAuthenticationExceptions.swift +index 6eb50b1..753a6ea 100644 +--- a/node_modules/expo-apple-authentication/ios/AppleAuthenticationExceptions.swift ++++ b/node_modules/expo-apple-authentication/ios/AppleAuthenticationExceptions.swift +@@ -63,5 +63,7 @@ func exceptionForAuthorizationError(_ error: ASAuthorizationError) -> Exception + return RequestFailedException() + case .notInteractive: + return RequestNotInteractiveException() ++ @unknown default: ++ return RequestUnknownException() + } + } diff --git a/yarn.lock b/yarn.lock index 678d683f89e..77ddd765940 100644 --- a/yarn.lock +++ b/yarn.lock @@ -70,6 +70,13 @@ __metadata: languageName: node linkType: hard +"@adraffy/ens-normalize@npm:^1.10.1": + version: 1.11.0 + resolution: "@adraffy/ens-normalize@npm:1.11.0" + checksum: 10/abef75f21470ea43dd6071168e092d2d13e38067e349e76186c78838ae174a46c3e18ca50921d05bea6ec3203074147c9e271f8cb6531d1c2c0e146f3199ddcb + languageName: node + linkType: hard + "@aivenio/tsc-output-parser@npm:^2.1.1": version: 2.1.1 resolution: "@aivenio/tsc-output-parser@npm:2.1.1" @@ -2296,6 +2303,20 @@ __metadata: languageName: node linkType: hard +"@coinbase/wallet-sdk@npm:4.0.3": + version: 4.0.3 + resolution: "@coinbase/wallet-sdk@npm:4.0.3" + dependencies: + buffer: "npm:^6.0.3" + clsx: "npm:^1.2.1" + eventemitter3: "npm:^5.0.1" + keccak: "npm:^3.0.3" + preact: "npm:^10.16.0" + sha.js: "npm:^2.4.11" + checksum: 10/fcea81c315726d648d3453ff7930d5175db641d05a7840f343d48ff6861215f2d531df5a1e5d4fa34addc10401b1033d7bc7b7b6c2c0eac2e9e4d08325f94a50 + languageName: node + linkType: hard + "@conflux-dev/conflux-address-js@npm:1.3.16, @conflux-dev/conflux-address-js@npm:^1.2.1, @conflux-dev/conflux-address-js@npm:^1.3.16": version: 1.3.16 resolution: "@conflux-dev/conflux-address-js@npm:1.3.16" @@ -2451,6 +2472,15 @@ __metadata: languageName: node linkType: hard +"@emotion/is-prop-valid@npm:1.2.2": + version: 1.2.2 + resolution: "@emotion/is-prop-valid@npm:1.2.2" + dependencies: + "@emotion/memoize": "npm:^0.8.1" + checksum: 10/0fa3960abfbe845d40cc230ab8c9408e1f33d3c03b321980359911c7212133cdcb0344d249e9dab23342b304567eece7a10ec44b986f7230e0640ba00049dceb + languageName: node + linkType: hard + "@emotion/is-prop-valid@npm:^0.8.2": version: 0.8.8 resolution: "@emotion/is-prop-valid@npm:0.8.8" @@ -2481,6 +2511,13 @@ __metadata: languageName: node linkType: hard +"@emotion/unitless@npm:0.8.1": + version: 0.8.1 + resolution: "@emotion/unitless@npm:0.8.1" + checksum: 10/918f73c46ac0b7161e3c341cc07d651ce87e31ab1695e74b12adb7da6bb98dfbff8c69cf68a4e40d9eb3d820ca055dc1267aeb3007927ce88f98b885bf729b63 + languageName: node + linkType: hard + "@emurgo/cardano-message-signing-asmjs@npm:^1.0.1": version: 1.0.1 resolution: "@emurgo/cardano-message-signing-asmjs@npm:1.0.1" @@ -3054,7 +3091,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/contracts@npm:5.7.0": +"@ethersproject/contracts@npm:5.7.0, @ethersproject/contracts@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/contracts@npm:5.7.0" dependencies: @@ -3175,7 +3212,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/providers@npm:5.7.2, @ethersproject/providers@npm:^5.7.2": +"@ethersproject/providers@npm:5.7.2, @ethersproject/providers@npm:^5.7.1, @ethersproject/providers@npm:^5.7.2": version: 5.7.2 resolution: "@ethersproject/providers@npm:5.7.2" dependencies: @@ -3290,7 +3327,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/units@npm:5.7.0": +"@ethersproject/units@npm:5.7.0, @ethersproject/units@npm:^5.7.0": version: 5.7.0 resolution: "@ethersproject/units@npm:5.7.0" dependencies: @@ -3350,6 +3387,13 @@ __metadata: languageName: node linkType: hard +"@expo-google-fonts/inter@npm:^0.2.3": + version: 0.2.3 + resolution: "@expo-google-fonts/inter@npm:0.2.3" + checksum: 10/434dd414e4d4dd9b61283cc09dfc499d5a4162bcaa39d0ac88cc3664bac0f21d8c54c0be9868b36bcf6d562be077eec6fbe8874274bd447d29d4ee1e988d8682 + languageName: node + linkType: hard + "@expo/bunyan@npm:^4.0.0": version: 4.0.0 resolution: "@expo/bunyan@npm:4.0.0" @@ -3487,13 +3531,14 @@ __metadata: languageName: node linkType: hard -"@expo/config-plugins@npm:~7.2.0": - version: 7.2.5 - resolution: "@expo/config-plugins@npm:7.2.5" +"@expo/config-plugins@npm:~7.8.0, @expo/config-plugins@npm:~7.8.2": + version: 7.8.4 + resolution: "@expo/config-plugins@npm:7.8.4" dependencies: - "@expo/config-types": "npm:^49.0.0-alpha.1" - "@expo/json-file": "npm:~8.2.37" - "@expo/plist": "npm:^0.0.20" + "@expo/config-types": "npm:^50.0.0-alpha.1" + "@expo/fingerprint": "npm:^0.6.0" + "@expo/json-file": "npm:~8.3.0" + "@expo/plist": "npm:^0.1.0" "@expo/sdk-runtime-versions": "npm:^1.0.0" "@react-native/normalize-color": "npm:^2.0.0" chalk: "npm:^4.1.2" @@ -3504,41 +3549,33 @@ __metadata: resolve-from: "npm:^5.0.0" semver: "npm:^7.5.3" slash: "npm:^3.0.0" + slugify: "npm:^1.6.6" xcode: "npm:^3.0.1" xml2js: "npm:0.6.0" - checksum: 10/84192cb3ed6a3c1dfe1f6cf12754574836d6f0abc11228de0a4ab42b30d652597f8fab48de3d3b9fe57d4115bdcfb1f9dbfe64150aea13d348affabb4bfafc8e + checksum: 10/1931a524300a4269e79fa7716bd41df700d56d1aa77ab9cc4eb73c2d48ee1c5594513f9c17469755f204c8567650558a7d11a68d3936690349d095c32a972ced languageName: node linkType: hard -"@expo/config-plugins@npm:~7.8.0, @expo/config-plugins@npm:~7.8.2": - version: 7.8.4 - resolution: "@expo/config-plugins@npm:7.8.4" +"@expo/config-plugins@npm:~8.0.8": + version: 8.0.11 + resolution: "@expo/config-plugins@npm:8.0.11" dependencies: - "@expo/config-types": "npm:^50.0.0-alpha.1" - "@expo/fingerprint": "npm:^0.6.0" + "@expo/config-types": "npm:^51.0.3" "@expo/json-file": "npm:~8.3.0" "@expo/plist": "npm:^0.1.0" "@expo/sdk-runtime-versions": "npm:^1.0.0" - "@react-native/normalize-color": "npm:^2.0.0" chalk: "npm:^4.1.2" debug: "npm:^4.3.1" find-up: "npm:~5.0.0" getenv: "npm:^1.0.0" glob: "npm:7.1.6" resolve-from: "npm:^5.0.0" - semver: "npm:^7.5.3" + semver: "npm:^7.5.4" slash: "npm:^3.0.0" slugify: "npm:^1.6.6" xcode: "npm:^3.0.1" xml2js: "npm:0.6.0" - checksum: 10/1931a524300a4269e79fa7716bd41df700d56d1aa77ab9cc4eb73c2d48ee1c5594513f9c17469755f204c8567650558a7d11a68d3936690349d095c32a972ced - languageName: node - linkType: hard - -"@expo/config-types@npm:^49.0.0-alpha.1": - version: 49.0.0 - resolution: "@expo/config-types@npm:49.0.0" - checksum: 10/992192c9c98d215af061e518f64eb62211089045c79ddfc47b33df0d819dd51001b0d4c5739f53504b9569e3977da63398a0da9e881dc2454bb3c013ef5db124 + checksum: 10/17def868d25d2e038936bd6a28f55e397e850a6af86db6c5467f8f2de1edc15eff51388bc5e65a049526c701a142fa45caf0cfab1889bc84785c84b8f4fb4e85 languageName: node linkType: hard @@ -3549,6 +3586,13 @@ __metadata: languageName: node linkType: hard +"@expo/config-types@npm:^51.0.3": + version: 51.0.3 + resolution: "@expo/config-types@npm:51.0.3" + checksum: 10/6ef412823d810c6f715f399d704e59af3024ccc5224675d963abe05b84b38fce6f1c4cdaa3d6418764a8564c9936f36ef90110f495f25f46a196638860749b3a + languageName: node + linkType: hard + "@expo/config@npm:8.5.6": version: 8.5.6 resolution: "@expo/config@npm:8.5.6" @@ -3568,13 +3612,13 @@ __metadata: languageName: node linkType: hard -"@expo/config@npm:~8.1.0": - version: 8.1.2 - resolution: "@expo/config@npm:8.1.2" +"@expo/config@npm:~8.5.0": + version: 8.5.4 + resolution: "@expo/config@npm:8.5.4" dependencies: "@babel/code-frame": "npm:~7.10.4" - "@expo/config-plugins": "npm:~7.2.0" - "@expo/config-types": "npm:^49.0.0-alpha.1" + "@expo/config-plugins": "npm:~7.8.2" + "@expo/config-types": "npm:^50.0.0" "@expo/json-file": "npm:^8.2.37" getenv: "npm:^1.0.0" glob: "npm:7.1.6" @@ -3582,27 +3626,27 @@ __metadata: resolve-from: "npm:^5.0.0" semver: "npm:7.5.3" slugify: "npm:^1.3.4" - sucrase: "npm:^3.20.0" - checksum: 10/665b2d864ca05f60894bb55fe3079f20c9449991f01a7247107c81fa053c2863eab101d7613b5e4b9654a26ad916cb206ac058c54aa7a08aa92e6a7fd788511e + sucrase: "npm:3.34.0" + checksum: 10/15f3f32f08f39e986ed20ba95075a490af2c7c83234bb132e0e34dbc846c63c2a2a0e766bdfe5a8fac20433b848072e2079bba67cadb9e3d7ef4cdb1f50dcdcb languageName: node linkType: hard -"@expo/config@npm:~8.5.0": - version: 8.5.4 - resolution: "@expo/config@npm:8.5.4" +"@expo/config@npm:~9.0.0": + version: 9.0.4 + resolution: "@expo/config@npm:9.0.4" dependencies: "@babel/code-frame": "npm:~7.10.4" - "@expo/config-plugins": "npm:~7.8.2" - "@expo/config-types": "npm:^50.0.0" - "@expo/json-file": "npm:^8.2.37" + "@expo/config-plugins": "npm:~8.0.8" + "@expo/config-types": "npm:^51.0.3" + "@expo/json-file": "npm:^8.3.0" getenv: "npm:^1.0.0" glob: "npm:7.1.6" require-from-string: "npm:^2.0.2" resolve-from: "npm:^5.0.0" - semver: "npm:7.5.3" + semver: "npm:^7.6.0" slugify: "npm:^1.3.4" sucrase: "npm:3.34.0" - checksum: 10/15f3f32f08f39e986ed20ba95075a490af2c7c83234bb132e0e34dbc846c63c2a2a0e766bdfe5a8fac20433b848072e2079bba67cadb9e3d7ef4cdb1f50dcdcb + checksum: 10/a2fb6f06eede3b773bf2e43d444a9beeec4645844ab85b609f739c5a115b77fd37d0a1572f52a1a8340a9c4a311c5567961a0deaaada2b829099a2206038cbb7 languageName: node linkType: hard @@ -3640,6 +3684,19 @@ __metadata: languageName: node linkType: hard +"@expo/env@npm:~0.3.0": + version: 0.3.0 + resolution: "@expo/env@npm:0.3.0" + dependencies: + chalk: "npm:^4.0.0" + debug: "npm:^4.3.4" + dotenv: "npm:~16.4.5" + dotenv-expand: "npm:~11.0.6" + getenv: "npm:^1.0.0" + checksum: 10/b6e87be9eec4bfeb2e5518c5425107bb522882b649d5c879995b58468e035d21a91f9fd2e0974e646f31e84818f3ef1243fc7e4a2bd62d6ee5077d81a1680783 + languageName: node + linkType: hard + "@expo/fingerprint@npm:^0.6.0": version: 0.6.0 resolution: "@expo/fingerprint@npm:0.6.0" @@ -3705,14 +3762,14 @@ __metadata: languageName: node linkType: hard -"@expo/json-file@npm:~8.2.37": - version: 8.2.37 - resolution: "@expo/json-file@npm:8.2.37" +"@expo/json-file@npm:^8.3.0": + version: 8.3.3 + resolution: "@expo/json-file@npm:8.3.3" dependencies: "@babel/code-frame": "npm:~7.10.4" json5: "npm:^2.2.2" write-file-atomic: "npm:^2.3.0" - checksum: 10/a17de23cc75474f668bbf6eb07d244b6b3ac7076356871b41b381950f1975ab44b086de899b564616405654d0746643729eb3e3fae66dcf67e282c9ea85ad62c + checksum: 10/621b21d42023c5a8d7bc3d9be53911434416fd84fd06de527dc4c6b0b54119fa0324a8e1ecb4c716ff6c30d1a12b9b3bfc2317a093bf2a111de40aad991dd6d0 languageName: node linkType: hard @@ -3776,17 +3833,6 @@ __metadata: languageName: node linkType: hard -"@expo/plist@npm:^0.0.20": - version: 0.0.20 - resolution: "@expo/plist@npm:0.0.20" - dependencies: - "@xmldom/xmldom": "npm:~0.7.7" - base64-js: "npm:^1.2.3" - xmlbuilder: "npm:^14.0.0" - checksum: 10/793095f826b44414d119567099a5a7de641446083403df31a3c6d2dceec6e87ea893509a04a5f01e658a284112ddf3974dbca0a858b5be180b4b76ac66706b55 - languageName: node - linkType: hard - "@expo/plist@npm:^0.1.0": version: 0.1.0 resolution: "@expo/plist@npm:0.1.0" @@ -3980,7 +4026,7 @@ __metadata: languageName: node linkType: hard -"@floating-ui/react-dom@npm:^2.0.0": +"@floating-ui/react-dom@npm:^2.0.0, @floating-ui/react-dom@npm:^2.1.2": version: 2.1.2 resolution: "@floating-ui/react-dom@npm:2.1.2" dependencies: @@ -4042,6 +4088,20 @@ __metadata: languageName: node linkType: hard +"@floating-ui/react@npm:^0.26.22": + version: 0.26.28 + resolution: "@floating-ui/react@npm:0.26.28" + dependencies: + "@floating-ui/react-dom": "npm:^2.1.2" + "@floating-ui/utils": "npm:^0.2.8" + tabbable: "npm:^6.0.0" + peerDependencies: + react: ">=16.8.0" + react-dom: ">=16.8.0" + checksum: 10/7f8e6b27db48b68ca94756687af21857be04e7360ac922d7c8e22411f2895df6384af7bd40f4b48663d3cc5809bb5c6574cd9c9ea15543ec747b9a8e1c8c3008 + languageName: node + linkType: hard + "@floating-ui/utils@npm:^0.1.3": version: 0.1.6 resolution: "@floating-ui/utils@npm:0.1.6" @@ -4056,6 +4116,13 @@ __metadata: languageName: node linkType: hard +"@floating-ui/utils@npm:^0.2.8": + version: 0.2.9 + resolution: "@floating-ui/utils@npm:0.2.9" + checksum: 10/0ca786347db3dd8d9034b86d1449fabb96642788e5900cc5f2aee433cd7b243efbcd7a165bead50b004ee3f20a90ddebb6a35296fc41d43cfd361b6f01b69ffb + languageName: node + linkType: hard + "@formatjs/ecma402-abstract@npm:1.11.4": version: 1.11.4 resolution: "@formatjs/ecma402-abstract@npm:1.11.4" @@ -4297,6 +4364,30 @@ __metadata: languageName: node linkType: hard +"@headlessui/react@npm:^2.2.0": + version: 2.2.0 + resolution: "@headlessui/react@npm:2.2.0" + dependencies: + "@floating-ui/react": "npm:^0.26.16" + "@react-aria/focus": "npm:^3.17.1" + "@react-aria/interactions": "npm:^3.21.3" + "@tanstack/react-virtual": "npm:^3.8.1" + peerDependencies: + react: ^18 || ^19 || ^19.0.0-rc + react-dom: ^18 || ^19 || ^19.0.0-rc + checksum: 10/baaa65f2cadf87d6ef5a15de5c8e532b79f491258166af6f3fe7b05a9196de4db9f3414b62192b4588c610786acb6623e3d775fc23d9001f6b31d13c4a5854c1 + languageName: node + linkType: hard + +"@heroicons/react@npm:^2.1.1": + version: 2.2.0 + resolution: "@heroicons/react@npm:2.2.0" + peerDependencies: + react: ">= 16 || ^19.0.0-rc" + checksum: 10/5bf8a3faa16f1566165bfaec2448ce3c2bd3e4f49e446ccf233f6aa63626155585eaf7e89f01fb4e8e92dfca3d7113b8c517c3b3c04036b9243c818595db3908 + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.11.13": version: 0.11.13 resolution: "@humanwhocodes/config-array@npm:0.11.13" @@ -5171,7 +5262,17 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-sig-util@npm:^5.0.2": +"@marsidev/react-turnstile@npm:^0.4.1": + version: 0.4.1 + resolution: "@marsidev/react-turnstile@npm:0.4.1" + peerDependencies: + react: ">=16.8.0" + react-dom: ">=16.8.0" + checksum: 10/3e7beb7531e44ee9501ea8b1d47ecf371fbd1022e099ce9b8bb229aef14716e1a0b8cca60b5cdeab7875c14ec617073a6a800bc1b2b0a67418f3e5917bef2171 + languageName: node + linkType: hard + +"@metamask/eth-sig-util@npm:5.1.0": version: 5.1.0 resolution: "@metamask/eth-sig-util@npm:5.1.0" dependencies: @@ -5812,6 +5913,15 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:1.7.0, @noble/curves@npm:~1.7.0": + version: 1.7.0 + resolution: "@noble/curves@npm:1.7.0" + dependencies: + "@noble/hashes": "npm:1.6.0" + checksum: 10/2a11ef4895907d0b241bd3b72f9e6ebe56f0e705949bfd5efe003f25233549f620d287550df2d24ad56a1f953b82ec5f7cf4bd7cb78b1b2e76eb6dd516d44cf8 + languageName: node + linkType: hard + "@noble/curves@npm:^1.1.0, @noble/curves@npm:^1.3.0, @noble/curves@npm:~1.3.0": version: 1.3.0 resolution: "@noble/curves@npm:1.3.0" @@ -5839,6 +5949,15 @@ __metadata: languageName: node linkType: hard +"@noble/curves@npm:^1.6.0, @noble/curves@npm:^1.8.0, @noble/curves@npm:~1.8.0": + version: 1.8.0 + resolution: "@noble/curves@npm:1.8.0" + dependencies: + "@noble/hashes": "npm:1.7.0" + checksum: 10/c54ce84cf54b8bda1a37a10dfae2e49e5b6cdf5dd98b399efa8b8a80a286b3f8f27bde53202cb308353bfd98719938991a78bed6e43f81f13b17f8181b7b82eb + languageName: node + linkType: hard + "@noble/ed25519@npm:^1.6.0, @noble/ed25519@npm:^1.6.1": version: 1.7.3 resolution: "@noble/ed25519@npm:1.7.3" @@ -5888,6 +6007,27 @@ __metadata: languageName: node linkType: hard +"@noble/hashes@npm:1.6.0": + version: 1.6.0 + resolution: "@noble/hashes@npm:1.6.0" + checksum: 10/b44b043b02adbecd33596adeed97d9f9864c24a2410f7ac3b847986c2ecf1f6f0df76024b3f1b14d6ea954932960d88898fe551fb9d39844a8b870e9f9044ea1 + languageName: node + linkType: hard + +"@noble/hashes@npm:1.6.1, @noble/hashes@npm:~1.6.0": + version: 1.6.1 + resolution: "@noble/hashes@npm:1.6.1" + checksum: 10/74d9ad7b1437a22ba3b877584add3367587fbf818113152f293025d20d425aa74c191d18d434797312f2270458bc9ab3241c34d14ec6115fb16438b3248f631f + languageName: node + linkType: hard + +"@noble/hashes@npm:1.7.0, @noble/hashes@npm:^1.5.0, @noble/hashes@npm:~1.7.0": + version: 1.7.0 + resolution: "@noble/hashes@npm:1.7.0" + checksum: 10/ab038a816c8c9bb986e92797e3d9c5a5b37c020e0c3edc55bcae5061dbdd457f1f0a22787f83f4787c17415ba0282a20a1e455d36ed0cdcace4ce21ef1869f60 + languageName: node + linkType: hard + "@noble/secp256k1@npm:1.7.1, @noble/secp256k1@npm:^1.7.1": version: 1.7.1 resolution: "@noble/secp256k1@npm:1.7.1" @@ -6680,6 +6820,8 @@ __metadata: "@polkadot/extension-inject": "npm:0.46.6" "@polkadot/types": "npm:11.3.1" "@polkadot/util-crypto": "npm:12.6.2" + "@privy-io/react-auth": "npm:1.98.4" + "@revenuecat/purchases-js": "npm:^0.15.1" "@sentry/babel-plugin-component-annotate": "npm:2.21.1" "@sentry/browser": "npm:8.42.0" "@sentry/core": "npm:8.42.0" @@ -6705,6 +6847,7 @@ __metadata: "@types/react": "npm:^18.2.29" "@types/react-beautiful-dnd": "npm:13.1.8" "@types/react-dom": "npm:~18.3.0" + "@types/validator": "npm:^13" "@types/web": "npm:0.0.151" "@typescript-eslint/eslint-plugin": "npm:^5.46.1" "@typescript-eslint/parser": "npm:^5.46.1" @@ -6799,6 +6942,7 @@ __metadata: react-native-web: "npm:0.18.12" react-refresh: "npm:^0.14.0" react-render-tracker: "npm:^0.7.6" + react-router-dom: "npm:^7.1.1" rimraf: "npm:^5.0.5" rlp: "npm:^3.0.0" semver: "npm:7.5.4" @@ -6816,6 +6960,7 @@ __metadata: ts-jest: "npm:^29.1.1" ultra-runner: "npm:^3.10.5" use-suspender: "npm:^2.0.0-beta.0" + validator: "npm:^13.12.0" viem: "npm:^2.9.2" webpack: "npm:5.90.3" webpack-bundle-analyzer: "npm:^4.9.1" @@ -6998,7 +7143,6 @@ __metadata: react-redux: "npm:^8.0.5" redux-logger: "npm:^3.0.6" redux-persist: "npm:^6.0.0" - socket.io-client: "npm:^4.5.4" swr: "npm:^2.1.5" url-parse: "npm:^1.5.10" use-debounce: "npm:^9.0.4" @@ -7014,6 +7158,7 @@ __metadata: "@babel/core": "npm:^7.20.0" "@backpackapp-io/react-native-toast": "npm:0.10.0" "@bufgix/react-native-secure-window": "npm:0.1.1" + "@expo-google-fonts/inter": "npm:^0.2.3" "@formatjs/intl-getcanonicallocales": "npm:^1.9.2" "@formatjs/intl-locale": "npm:^2.4.47" "@formatjs/intl-pluralrules": "npm:^4.3.3" @@ -7026,6 +7171,8 @@ __metadata: "@onekeyhq/components": "npm:*" "@onekeyhq/kit": "npm:*" "@onekeyhq/shared": "npm:*" + "@privy-io/expo": "npm:^0.35.1" + "@privy-io/expo-native-extensions": "npm:^0.0.3" "@react-native-async-storage/async-storage": "npm:1.22.0" "@react-native-community/netinfo": "npm:^11.4.1" "@react-native-community/slider": "npm:4.4.3" @@ -7037,18 +7184,22 @@ __metadata: "@walletconnect/react-native-compat": "npm:2.11.2" burnt: "npm:0.12.2" expo: "npm:50.0.20" + expo-apple-authentication: "npm:6.3.0" expo-application: "npm:5.8.3" expo-barcode-scanner: "npm:12.9.3" expo-blur: "npm:12.9.1" expo-clipboard: "npm:5.0.1" + expo-constants: "npm:15.4.6" + expo-crypto: "npm:12.8.1" expo-device: "npm:5.9.3" + expo-font: "npm:11.10.3" expo-haptics: "npm:12.8.1" expo-image-manipulator: "npm:11.5.0" expo-image-picker: "npm:14.5.0" expo-intent-launcher: "npm:^10.5.2" expo-keep-awake: "npm:12.8.2" expo-linear-gradient: "npm:12.7.1" - expo-linking: "npm:^5.0.2" + expo-linking: "npm:^6.2.2" expo-local-authentication: "npm:13.6.0" expo-localization: "npm:14.5.0" expo-notifications: "npm:0.27.6" @@ -7056,7 +7207,8 @@ __metadata: expo-secure-store: "npm:12.5.0" expo-sharing: "npm:11.10.0" expo-splash-screen: "npm:0.26.4" - expo-status-bar: "npm:~1.6.0" + expo-status-bar: "npm:1.6.0" + expo-web-browser: "npm:12.8.2" folderslint: "npm:^1.2.0" https-browserify: "npm:^1.0.0" jcore-react-native: "https://github.com/OneKeyHQ/jcore-react-native.git#2cadf288224242cec715a2e260f872235c58874c" @@ -7087,7 +7239,11 @@ __metadata: react-native-modal: "npm:^13.0.1" react-native-nested-scroll-view: "https://github.com/OneKeyHQ/react-native-nested-scroll-view.git#feat/support-rn73" react-native-network-logger: "npm:^1.16.1" + react-native-passkeys: "npm:^0.3.0" react-native-permissions: "npm:^4.1.5" + react-native-purchases: "npm:^8.5.0" + react-native-purchases-ui: "npm:^8.5.0" + react-native-qrcode-styled: "npm:^0.3.3" react-native-randombytes: "npm:^3.6.1" react-native-reanimated: "npm:3.6.1" react-native-restart: "npm:0.0.27" @@ -8859,6 +9015,188 @@ __metadata: languageName: node linkType: hard +"@privy-io/api-base@npm:1.4.1": + version: 1.4.1 + resolution: "@privy-io/api-base@npm:1.4.1" + dependencies: + zod: "npm:^3.21.4" + checksum: 10/4a3d48670cdd2a9373071f3e911f421decf4b7eb4c6c8acca378854b7baaba239ec785d9bd67a3736e9ea284d424d2db0819a26a06c1e1834a0142d7e21cd63f + languageName: node + linkType: hard + +"@privy-io/api-base@npm:^1.4.1": + version: 1.4.2 + resolution: "@privy-io/api-base@npm:1.4.2" + dependencies: + zod: "npm:^3.21.4" + checksum: 10/a8b579e7736180594af72ff223c89cb84221cd2b0902d624d31d294d71cd1dc1dad0ee10e70b4a7621b1392ce00a055af29f919de72c12b39a6f880d4ec9c12a + languageName: node + linkType: hard + +"@privy-io/expo-native-extensions@npm:^0.0.3": + version: 0.0.3 + resolution: "@privy-io/expo-native-extensions@npm:0.0.3" + peerDependencies: + expo: "*" + react: "*" + react-native: "*" + checksum: 10/d0493d6d5faf48f64ee139a6d06b251464d35a1f14e7b969cf37bc6bcf774b89b03d29ab98610ed4e976d493e93bc336033c253e174cfc4bc034e5731dc878a1 + languageName: node + linkType: hard + +"@privy-io/expo@npm:^0.35.1": + version: 0.35.1 + resolution: "@privy-io/expo@npm:0.35.1" + dependencies: + "@privy-io/js-sdk-core": "npm:0.36.1" + react-fast-compare: "npm:^3.2.2" + zustand: "npm:^4.4.1" + peerDependencies: + "@expo-google-fonts/inter": "*" + "@privy-io/expo-native-extensions": 0.0.3 + expo-apple-authentication: "*" + expo-application: "*" + expo-clipboard: "*" + expo-constants: "*" + expo-crypto: "*" + expo-font: "*" + expo-linking: "*" + expo-secure-store: "*" + expo-web-browser: "*" + permissionless: ^0.2.10 + react: "*" + react-native: "*" + react-native-passkeys: ^0.3.0 + react-native-qrcode-styled: "*" + react-native-safe-area-context: "*" + react-native-svg: "*" + react-native-webview: "*" + viem: ^2.21.36 + peerDependenciesMeta: + "@expo-google-fonts/inter": + optional: true + expo-font: + optional: true + permissionless: + optional: true + viem: + optional: true + checksum: 10/6e0915f610f5e506491602ef680c820771c5070366a816c4cf54fcd079a2951603e4b89daf28cdcd0ed7a9f40a86bca0e7ecaeedd37986f2ea6b145fdd0c3ea1 + languageName: node + linkType: hard + +"@privy-io/js-sdk-core@npm:0.36.1": + version: 0.36.1 + resolution: "@privy-io/js-sdk-core@npm:0.36.1" + dependencies: + "@ethersproject/abstract-signer": "npm:^5.7.0" + "@ethersproject/bignumber": "npm:^5.7.0" + "@ethersproject/contracts": "npm:^5.7.0" + "@ethersproject/providers": "npm:^5.7.2" + "@ethersproject/transactions": "npm:^5.7.0" + "@ethersproject/units": "npm:^5.7.0" + "@privy-io/api-base": "npm:^1.4.1" + "@privy-io/public-api": "npm:2.15.8" + eventemitter3: "npm:^5.0.1" + fetch-retry: "npm:^5.0.6" + jose: "npm:^4.15.5" + js-cookie: "npm:^3.0.5" + libphonenumber-js: "npm:^1.10.44" + set-cookie-parser: "npm:^2.6.0" + uuid: "npm:>=8 <10" + peerDependencies: + permissionless: ^0.2.10 + viem: ^2.21.36 + peerDependenciesMeta: + permissionless: + optional: true + viem: + optional: true + checksum: 10/8f2e5dff2fbd37bdadcf680a1139d782cfa68d1cc33969f3ed1f88f963f0601bf4306362872442052f4d9737d613407a118d6f51d0279749ca4f17d4540a8966 + languageName: node + linkType: hard + +"@privy-io/public-api@npm:2.15.8": + version: 2.15.8 + resolution: "@privy-io/public-api@npm:2.15.8" + dependencies: + "@privy-io/api-base": "npm:1.4.1" + bs58: "npm:^5.0.0" + ethers: "npm:^5.7.2" + libphonenumber-js: "npm:^1.10.31" + zod: "npm:^3.22.4" + checksum: 10/bf7ec8d8c608c2ef206a4a1ae87354e3626d78e0d23f83e00b31056a0ab8f57fff144c60bb614665b2abc3d0aabc6076fcd85f85e82ef08f557ca3b16e638fba + languageName: node + linkType: hard + +"@privy-io/react-auth@npm:1.98.4": + version: 1.98.4 + resolution: "@privy-io/react-auth@npm:1.98.4" + dependencies: + "@coinbase/wallet-sdk": "npm:4.0.3" + "@ethersproject/abstract-signer": "npm:^5.7.0" + "@ethersproject/address": "npm:^5.7.0" + "@ethersproject/bignumber": "npm:^5.7.0" + "@ethersproject/bytes": "npm:^5.7.0" + "@ethersproject/contracts": "npm:^5.7.0" + "@ethersproject/logger": "npm:^5.7.0" + "@ethersproject/providers": "npm:^5.7.1" + "@ethersproject/strings": "npm:^5.7.0" + "@ethersproject/transactions": "npm:^5.7.0" + "@ethersproject/units": "npm:^5.7.0" + "@floating-ui/react": "npm:^0.26.22" + "@headlessui/react": "npm:^2.2.0" + "@heroicons/react": "npm:^2.1.1" + "@marsidev/react-turnstile": "npm:^0.4.1" + "@metamask/eth-sig-util": "npm:^6.0.0" + "@privy-io/js-sdk-core": "npm:0.36.1" + "@simplewebauthn/browser": "npm:^9.0.1" + "@solana/wallet-adapter-base": "npm:^0.9.23" + "@solana/wallet-standard-wallet-adapter-base": "npm:^1.1.2" + "@solana/wallet-standard-wallet-adapter-react": "npm:^1.1.2" + "@wallet-standard/app": "npm:^1.0.1" + "@walletconnect/ethereum-provider": "npm:^2.15.1" + "@walletconnect/modal": "npm:^2.6.2" + base64-js: "npm:^1.5.1" + dotenv: "npm:^16.0.3" + encoding: "npm:^0.1.13" + eventemitter3: "npm:^5.0.1" + fast-password-entropy: "npm:^1.1.1" + jose: "npm:^4.15.5" + js-cookie: "npm:^3.0.5" + lokijs: "npm:^1.5.12" + md5: "npm:^2.3.0" + mipd: "npm:^0.0.7" + ofetch: "npm:^1.3.4" + pino-pretty: "npm:^10.0.0" + qrcode: "npm:^1.5.1" + react-device-detect: "npm:^2.2.2" + secure-password-utilities: "npm:^0.2.1" + styled-components: "npm:^6.1.13" + stylis: "npm:^4.3.4" + tinycolor2: "npm:^1.6.0" + uuid: "npm:>=8 <10" + viem: "npm:^2.21.9" + web3-core: "npm:^1.8.0" + web3-core-helpers: "npm:^1.8.0" + zustand: "npm:^5.0.1" + peerDependencies: + "@abstract-foundation/agw-client": ^0.1.0 + "@solana/web3.js": ^1.95.8 + permissionless: ^0.2.10 + react: ^18 || ^19 + react-dom: ^18 || ^19 + peerDependenciesMeta: + "@abstract-foundation/agw-client": + optional: true + "@solana/web3.js": + optional: true + permissionless: + optional: true + checksum: 10/fcf98771e0cc03e2c472ea7a6876a5a5dd479348f7abda93ba01971eceba8aecb1e8973d99ed1a27fb6f98dda8a0cf6475f5ecf6004549823cbfa0aaeaa41245 + languageName: node + linkType: hard + "@project-serum/anchor@npm:^0.11.1": version: 0.11.1 resolution: "@project-serum/anchor@npm:0.11.1" @@ -9505,6 +9843,64 @@ __metadata: languageName: node linkType: hard +"@react-aria/focus@npm:^3.17.1": + version: 3.19.1 + resolution: "@react-aria/focus@npm:3.19.1" + dependencies: + "@react-aria/interactions": "npm:^3.23.0" + "@react-aria/utils": "npm:^3.27.0" + "@react-types/shared": "npm:^3.27.0" + "@swc/helpers": "npm:^0.5.0" + clsx: "npm:^2.0.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/2fe5e880c4d7f3fb612ba8f5ec46e3a6ef761dc8066ad51c043ec0c90b9f5985f49b9ef8e902f75f2bc37e75e54271aa1997afd03a0fd12c5df386190688a761 + languageName: node + linkType: hard + +"@react-aria/interactions@npm:^3.21.3, @react-aria/interactions@npm:^3.23.0": + version: 3.23.0 + resolution: "@react-aria/interactions@npm:3.23.0" + dependencies: + "@react-aria/ssr": "npm:^3.9.7" + "@react-aria/utils": "npm:^3.27.0" + "@react-types/shared": "npm:^3.27.0" + "@swc/helpers": "npm:^0.5.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/915f408708045b38fb25398b2de03610c246f571cb9414c46c00e3e51d3b2abafe778357c1720ff15dc8255fcc023b7eeff7205ddeb60ae3d1b5521f36220e24 + languageName: node + linkType: hard + +"@react-aria/ssr@npm:^3.9.7": + version: 3.9.7 + resolution: "@react-aria/ssr@npm:3.9.7" + dependencies: + "@swc/helpers": "npm:^0.5.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/a5c8e9ffee1dfd3c5b9f66051a7faab11d53ba001ac7f476b61fa4b38fd8b4835c1a85ff2157ec25fb5b63beb88fbae9e80610fa065a30cbe30875fcbca3114b + languageName: node + linkType: hard + +"@react-aria/utils@npm:^3.27.0": + version: 3.27.0 + resolution: "@react-aria/utils@npm:3.27.0" + dependencies: + "@react-aria/ssr": "npm:^3.9.7" + "@react-stately/utils": "npm:^3.10.5" + "@react-types/shared": "npm:^3.27.0" + "@swc/helpers": "npm:^0.5.0" + clsx: "npm:^2.0.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + react-dom: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/cacf892a6ae80bef854cd7278320cfc0fdc2582e27bcc57ad9fb5be1174dfc5370132592933921fbe633f4d7a6e0a0293ae607a973b23748d01ea1cae0d49205 + languageName: node + linkType: hard + "@react-native-async-storage/async-storage@npm:1.22.0": version: 1.22.0 resolution: "@react-native-async-storage/async-storage@npm:1.22.0" @@ -10524,6 +10920,40 @@ __metadata: languageName: node linkType: hard +"@react-stately/utils@npm:^3.10.5": + version: 3.10.5 + resolution: "@react-stately/utils@npm:3.10.5" + dependencies: + "@swc/helpers": "npm:^0.5.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/76133eb64fa945216e51d8a81a0ebd06eeb78aa2d9c91d79eeb80ff44c70a6b0d6d940618b31b499fee8216640b3bf6183391151dc1769e756b56ff6b5e167ec + languageName: node + linkType: hard + +"@react-types/shared@npm:^3.27.0": + version: 3.27.0 + resolution: "@react-types/shared@npm:3.27.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1 + checksum: 10/359be934dda6404824479d0dfdf9e694414252da4946b4e486f3cc546a080844a7d4f20507041d3f8f6f5a316c05b28785ca3f4377a7f4ea397ed1f21c2646af + languageName: node + linkType: hard + +"@revenuecat/purchases-js@npm:^0.15.1": + version: 0.15.1 + resolution: "@revenuecat/purchases-js@npm:0.15.1" + checksum: 10/14eecdd16a047e908a9b50ae6394c32ef55dd203674fcdc22db95d0a089281557e15f5dbfe2ae16a1a2f73abffc6444a35a90d6ab0f0c298ac19d275825bad5e + languageName: node + linkType: hard + +"@revenuecat/purchases-typescript-internal@npm:13.14.0": + version: 13.14.0 + resolution: "@revenuecat/purchases-typescript-internal@npm:13.14.0" + checksum: 10/202d41993ceca4586747afb49856ef6df2603988380034129bd3135604fc3351b8655aef05d4ff51b4b7f6450ede13d3ecd953064716872e5667bfa648435a04 + languageName: node + linkType: hard + "@rnx-kit/chromium-edge-launcher@npm:^1.0.0": version: 1.0.0 resolution: "@rnx-kit/chromium-edge-launcher@npm:1.0.0" @@ -10566,6 +10996,13 @@ __metadata: languageName: node linkType: hard +"@scure/base@npm:~1.2.1": + version: 1.2.1 + resolution: "@scure/base@npm:1.2.1" + checksum: 10/f7bdd17618ccae7a74c8cbe410a235e4adbe54aa8afe4e2fb1294338aa92f6fd04b1f1f5dea60552f638b5f5e3e74902b7baf59d3954e5e42c0a36c6baa2ebe0 + languageName: node + linkType: hard + "@scure/bip32@npm:1.3.1": version: 1.3.1 resolution: "@scure/bip32@npm:1.3.1" @@ -10599,6 +11036,17 @@ __metadata: languageName: node linkType: hard +"@scure/bip32@npm:1.6.0": + version: 1.6.0 + resolution: "@scure/bip32@npm:1.6.0" + dependencies: + "@noble/curves": "npm:~1.7.0" + "@noble/hashes": "npm:~1.6.0" + "@scure/base": "npm:~1.2.1" + checksum: 10/2efb81ed9a7b8d5d35233e10abebc114544a3783a2a32b9fb60e1e9a67965b272c9d17910e1649083b69c8ceb80241b05b59dbeb7a5b18ea34e497aed3f16709 + languageName: node + linkType: hard + "@scure/bip32@npm:^1.3.1": version: 1.3.3 resolution: "@scure/bip32@npm:1.3.3" @@ -10621,6 +11069,17 @@ __metadata: languageName: node linkType: hard +"@scure/bip32@npm:^1.5.0": + version: 1.6.1 + resolution: "@scure/bip32@npm:1.6.1" + dependencies: + "@noble/curves": "npm:~1.8.0" + "@noble/hashes": "npm:~1.7.0" + "@scure/base": "npm:~1.2.1" + checksum: 10/967be60ab99dad33e44f0813d194d2eccffc0c5877e93fa01bd9d787b15210b383a98114aafacb704e36e58a90075a3eb51a78983914fadaed3bf4469b384064 + languageName: node + linkType: hard + "@scure/bip39@npm:1.2.1": version: 1.2.1 resolution: "@scure/bip39@npm:1.2.1" @@ -10641,6 +11100,16 @@ __metadata: languageName: node linkType: hard +"@scure/bip39@npm:1.5.0": + version: 1.5.0 + resolution: "@scure/bip39@npm:1.5.0" + dependencies: + "@noble/hashes": "npm:~1.6.0" + "@scure/base": "npm:~1.2.1" + checksum: 10/b795ee31ac4c10603bf3b726cc0e5cf43834a68f05a535e0baf2162772bac100de470b4c6cf7ddbecb95d7a3fb82b8a959badced406c329ab696cd89104194bc + languageName: node + linkType: hard + "@scure/bip39@npm:^1.2.1": version: 1.2.2 resolution: "@scure/bip39@npm:1.2.2" @@ -10661,6 +11130,16 @@ __metadata: languageName: node linkType: hard +"@scure/bip39@npm:^1.4.0": + version: 1.5.1 + resolution: "@scure/bip39@npm:1.5.1" + dependencies: + "@noble/hashes": "npm:~1.7.0" + "@scure/base": "npm:~1.2.1" + checksum: 10/a7ba42169704173b687421a0f79e94d645d3954d4f6142b2edbb8466964ac8c7260337cfaab42f0372843da49595019bb1990a323ac6a7b6980b4d7c45924ddf + languageName: node + linkType: hard + "@segment/loosely-validate-event@npm:^2.0.0": version: 2.0.0 resolution: "@segment/loosely-validate-event@npm:2.0.0" @@ -11036,6 +11515,22 @@ __metadata: languageName: node linkType: hard +"@simplewebauthn/browser@npm:^9.0.1": + version: 9.0.1 + resolution: "@simplewebauthn/browser@npm:9.0.1" + dependencies: + "@simplewebauthn/types": "npm:^9.0.1" + checksum: 10/dda1f37d4e57bdf3fab611a716b5f54b29eb21c04981557cf236ee39ae8131b9ce6c8ea302d84cce4353a507f202cfbfa568691566f04e5328b80f95d65873ec + languageName: node + linkType: hard + +"@simplewebauthn/types@npm:^9.0.1": + version: 9.0.1 + resolution: "@simplewebauthn/types@npm:9.0.1" + checksum: 10/23c494b1db2d66027e87fe9047ddb86cdf026221e58f0bc1861395eb28f30f92a96e9cfb491d26b32334ff8cf34c60708290c1b68b56f6b81fd14bb7927346f2 + languageName: node + linkType: hard + "@sinclair/typebox@npm:^0.27.8": version: 0.27.8 resolution: "@sinclair/typebox@npm:0.27.8" @@ -11356,7 +11851,7 @@ __metadata: languageName: node linkType: hard -"@solana/wallet-adapter-base@npm:^0.9.2": +"@solana/wallet-adapter-base@npm:^0.9.2, @solana/wallet-adapter-base@npm:^0.9.23": version: 0.9.23 resolution: "@solana/wallet-adapter-base@npm:0.9.23" dependencies: @@ -11370,6 +11865,15 @@ __metadata: languageName: node linkType: hard +"@solana/wallet-standard-chains@npm:^1.1.1": + version: 1.1.1 + resolution: "@solana/wallet-standard-chains@npm:1.1.1" + dependencies: + "@wallet-standard/base": "npm:^1.1.0" + checksum: 10/8903840e721642e1699dc949f7c9e75e2d6f4c26b7e768e871d91d4006731356dea64426c7351381912671887979ef47193fc17cb8b12ba819334f95f83c0ba6 + languageName: node + linkType: hard + "@solana/wallet-standard-features@npm:^1.1.0": version: 1.2.0 resolution: "@solana/wallet-standard-features@npm:1.2.0" @@ -11380,6 +11884,60 @@ __metadata: languageName: node linkType: hard +"@solana/wallet-standard-features@npm:^1.3.0": + version: 1.3.0 + resolution: "@solana/wallet-standard-features@npm:1.3.0" + dependencies: + "@wallet-standard/base": "npm:^1.1.0" + "@wallet-standard/features": "npm:^1.1.0" + checksum: 10/9c4ef26346ef0b602ad4bde7a32e53716b96a427c4f7120571be949efeefa21a2458e9d6ef41bf1be7a1e3f2a45fa631fc4242503a87043d74bb7213c62509c2 + languageName: node + linkType: hard + +"@solana/wallet-standard-util@npm:^1.1.2": + version: 1.1.2 + resolution: "@solana/wallet-standard-util@npm:1.1.2" + dependencies: + "@noble/curves": "npm:^1.8.0" + "@solana/wallet-standard-chains": "npm:^1.1.1" + "@solana/wallet-standard-features": "npm:^1.3.0" + checksum: 10/7ff72a34404fae90c1aeea32f96a69b896e0a901c6f222c6083f5308e3b00f2fdd004210960c8f0d3c49d991d08f8f4e8d92a0a6d33bdb7f79bfd7ec5a844fd4 + languageName: node + linkType: hard + +"@solana/wallet-standard-wallet-adapter-base@npm:^1.1.2, @solana/wallet-standard-wallet-adapter-base@npm:^1.1.4": + version: 1.1.4 + resolution: "@solana/wallet-standard-wallet-adapter-base@npm:1.1.4" + dependencies: + "@solana/wallet-adapter-base": "npm:^0.9.23" + "@solana/wallet-standard-chains": "npm:^1.1.1" + "@solana/wallet-standard-features": "npm:^1.3.0" + "@solana/wallet-standard-util": "npm:^1.1.2" + "@wallet-standard/app": "npm:^1.1.0" + "@wallet-standard/base": "npm:^1.1.0" + "@wallet-standard/features": "npm:^1.1.0" + "@wallet-standard/wallet": "npm:^1.1.0" + peerDependencies: + "@solana/web3.js": ^1.98.0 + bs58: ^6.0.0 + checksum: 10/ab98f5b1f723d20ce469f567802a99ea209b666933b7d386a0336bd07fc302ef55b90190c0c2a24c3da6ca6ec4a25ae8db8011b7cf8c33c6fcf37b008157388d + languageName: node + linkType: hard + +"@solana/wallet-standard-wallet-adapter-react@npm:^1.1.2": + version: 1.1.4 + resolution: "@solana/wallet-standard-wallet-adapter-react@npm:1.1.4" + dependencies: + "@solana/wallet-standard-wallet-adapter-base": "npm:^1.1.4" + "@wallet-standard/app": "npm:^1.1.0" + "@wallet-standard/base": "npm:^1.1.0" + peerDependencies: + "@solana/wallet-adapter-base": "*" + react: "*" + checksum: 10/e354b7addf158e20d6b0ca790dd07c9b1e2430182d09ed47e6d23f40791db1701bc2c6007e3a369a4a38d7ab8da2e7e52b1b591344e0daf7072dfb5068d9e58f + languageName: node + linkType: hard + "@solana/web3.js@npm:^1.17.0, @solana/web3.js@npm:^1.21.0, @solana/web3.js@npm:^1.32.0, @solana/web3.js@npm:^1.35.1, @solana/web3.js@npm:^1.36.0, @solana/web3.js@npm:^1.47.3, @solana/web3.js@npm:^1.56.2, @solana/web3.js@npm:^1.65.0, @solana/web3.js@npm:^1.66.2": version: 1.91.8 resolution: "@solana/web3.js@npm:1.91.8" @@ -12100,6 +12658,15 @@ __metadata: languageName: node linkType: hard +"@swc/helpers@npm:^0.5.0": + version: 0.5.15 + resolution: "@swc/helpers@npm:0.5.15" + dependencies: + tslib: "npm:^2.8.0" + checksum: 10/e3f32c6deeecfb0fa3f22edff03a7b358e7ce16d27b0f1c8b5cdc3042c5c4ce4da6eac0b781ab7cc4f54696ece657467d56734fb26883439fb00017385364c4c + languageName: node + linkType: hard + "@swc/helpers@npm:^0.5.11": version: 0.5.12 resolution: "@swc/helpers@npm:0.5.12" @@ -13552,6 +14119,25 @@ __metadata: languageName: node linkType: hard +"@tanstack/react-virtual@npm:^3.8.1": + version: 3.11.2 + resolution: "@tanstack/react-virtual@npm:3.11.2" + dependencies: + "@tanstack/virtual-core": "npm:3.11.2" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 10/a1136da0ec4c2ecbd4f996d8b84f228f0b8d851b15806e01049a160ad1d9b2eef0e0a491035fe017c6f84a0e125334f69ea23b32c180df23614ea4a8eeb7490c + languageName: node + linkType: hard + +"@tanstack/virtual-core@npm:3.11.2": + version: 3.11.2 + resolution: "@tanstack/virtual-core@npm:3.11.2" + checksum: 10/8433044a5c801052ba2e4cdda098cdc8e32adfd3a76ba31af7064bbdda60062fe221a3558096987baa66cd94f528855e887c282cb0f9eb99d3751457c2a62872 + languageName: node + linkType: hard + "@tokenizer/token@npm:^0.3.0": version: 0.3.0 resolution: "@tokenizer/token@npm:0.3.0" @@ -13767,6 +14353,13 @@ __metadata: languageName: node linkType: hard +"@types/cookie@npm:^0.6.0": + version: 0.6.0 + resolution: "@types/cookie@npm:0.6.0" + checksum: 10/b883348d5bf88695fbc2c2276b1c49859267a55cae3cf11ea1dccc1b3be15b466e637ce3242109ba27d616c77c6aa4efe521e3d557110b4fdd9bc332a12445c2 + languageName: node + linkType: hard + "@types/cors@npm:^2.8.12": version: 2.8.17 resolution: "@types/cors@npm:2.8.17" @@ -14382,7 +14975,7 @@ __metadata: languageName: node linkType: hard -"@types/qs@npm:*, @types/qs@npm:^6.9.7": +"@types/qs@npm:*": version: 6.9.11 resolution: "@types/qs@npm:6.9.11" checksum: 10/620ca1628bf3da65662c54ed6ebb120b18a3da477d0bfcc872b696685a9bb1893c3c92b53a1190a8f54d52eaddb6af8b2157755699ac83164604329935e8a7f2 @@ -14564,6 +15157,13 @@ __metadata: languageName: node linkType: hard +"@types/stylis@npm:4.2.5": + version: 4.2.5 + resolution: "@types/stylis@npm:4.2.5" + checksum: 10/f8dde326432a7047b6684b96442f0e2ade2cfe8c29bf56217fb8cbbe4763997051fa9dc0f8dba4aeed2fddb794b4bc91feba913b780666b3adc28198ac7c63d4 + languageName: node + linkType: hard + "@types/tedious@npm:^4.0.14": version: 4.0.14 resolution: "@types/tedious@npm:4.0.14" @@ -14608,6 +15208,13 @@ __metadata: languageName: node linkType: hard +"@types/validator@npm:^13": + version: 13.12.2 + resolution: "@types/validator@npm:13.12.2" + checksum: 10/564f60cfe112b45e1d747245d1f80db999bbc372b2b6a1c5454441b02c3d6bffbfff4365a10c3cd7874197f14ca5779b435794c7600bdcb541da948405a3b21a + languageName: node + linkType: hard + "@types/verror@npm:^1.10.3": version: 1.10.9 resolution: "@types/verror@npm:1.10.9" @@ -15105,6 +15712,25 @@ __metadata: languageName: node linkType: hard +"@walletconnect/ethereum-provider@npm:^2.15.1": + version: 2.17.3 + resolution: "@walletconnect/ethereum-provider@npm:2.17.3" + dependencies: + "@walletconnect/jsonrpc-http-connection": "npm:1.0.8" + "@walletconnect/jsonrpc-provider": "npm:1.0.14" + "@walletconnect/jsonrpc-types": "npm:1.0.4" + "@walletconnect/jsonrpc-utils": "npm:1.0.8" + "@walletconnect/keyvaluestorage": "npm:1.1.1" + "@walletconnect/modal": "npm:2.7.0" + "@walletconnect/sign-client": "npm:2.17.3" + "@walletconnect/types": "npm:2.17.3" + "@walletconnect/universal-provider": "npm:2.17.3" + "@walletconnect/utils": "npm:2.17.3" + events: "npm:3.3.0" + checksum: 10/0896df1ae6e4f6005900341d516546e4c3c8782377e59176364d86b7eb65b51a3746d395299c68a3287e5f6b91c88aff1d23f0b52f3049b9d3e35bf4c4647db4 + languageName: node + linkType: hard + "@walletconnect/events@npm:1.0.1, @walletconnect/events@npm:^1.0.1": version: 1.0.1 resolution: "@walletconnect/events@npm:1.0.1" @@ -15137,6 +15763,18 @@ __metadata: languageName: node linkType: hard +"@walletconnect/jsonrpc-http-connection@npm:1.0.8": + version: 1.0.8 + resolution: "@walletconnect/jsonrpc-http-connection@npm:1.0.8" + dependencies: + "@walletconnect/jsonrpc-utils": "npm:^1.0.6" + "@walletconnect/safe-json": "npm:^1.0.1" + cross-fetch: "npm:^3.1.4" + events: "npm:^3.3.0" + checksum: 10/c545906243df27fdbde3c8e9005217069dd22ce0f496c59f55843ca8fcb0c1a90d2c0ac6ecb16fa110ed85c36e5486f5a74621a5ca6230667d77ee3b0ae36cc6 + languageName: node + linkType: hard + "@walletconnect/jsonrpc-http-connection@npm:^1.0.7": version: 1.0.7 resolution: "@walletconnect/jsonrpc-http-connection@npm:1.0.7" @@ -15160,6 +15798,17 @@ __metadata: languageName: node linkType: hard +"@walletconnect/jsonrpc-provider@npm:1.0.14": + version: 1.0.14 + resolution: "@walletconnect/jsonrpc-provider@npm:1.0.14" + dependencies: + "@walletconnect/jsonrpc-utils": "npm:^1.0.8" + "@walletconnect/safe-json": "npm:^1.0.2" + events: "npm:^3.3.0" + checksum: 10/c3c78f00148043b70213f5174d537b210f1fb231d96103cbf7d0101626578d3c13fe99ac080df7a0056c7128ce488b0523eda0e3d1deed75754672848b4909a5 + languageName: node + linkType: hard + "@walletconnect/jsonrpc-types@npm:1.0.3, @walletconnect/jsonrpc-types@npm:^1.0.2, @walletconnect/jsonrpc-types@npm:^1.0.3": version: 1.0.3 resolution: "@walletconnect/jsonrpc-types@npm:1.0.3" @@ -15248,6 +15897,15 @@ __metadata: languageName: node linkType: hard +"@walletconnect/modal-core@npm:2.7.0": + version: 2.7.0 + resolution: "@walletconnect/modal-core@npm:2.7.0" + dependencies: + valtio: "npm:1.11.2" + checksum: 10/1549f9ba5c98dfed2f97fbfccfcd2e342550c7ba7a85970bff224258dd397bad0a29721b90fef408dcc6cdfa65c52253476a04c16fece9b4d48792f03c3a4b4f + languageName: node + linkType: hard + "@walletconnect/modal-react-native@npm:1.1.0": version: 1.1.0 resolution: "@walletconnect/modal-react-native@npm:1.1.0" @@ -15281,6 +15939,18 @@ __metadata: languageName: node linkType: hard +"@walletconnect/modal-ui@npm:2.7.0": + version: 2.7.0 + resolution: "@walletconnect/modal-ui@npm:2.7.0" + dependencies: + "@walletconnect/modal-core": "npm:2.7.0" + lit: "npm:2.8.0" + motion: "npm:10.16.2" + qrcode: "npm:1.5.3" + checksum: 10/00d17001bde7646def34eaffef81c4a580f09fdf10902a7a938cd2a3738f8f1cbb10520c229989b64e147df9f4df8ca31bd1d904f9019acc63327b495fb5b3ed + languageName: node + linkType: hard + "@walletconnect/modal@npm:2.6.2": version: 2.6.2 resolution: "@walletconnect/modal@npm:2.6.2" @@ -15291,6 +15961,16 @@ __metadata: languageName: node linkType: hard +"@walletconnect/modal@npm:2.7.0, @walletconnect/modal@npm:^2.6.2": + version: 2.7.0 + resolution: "@walletconnect/modal@npm:2.7.0" + dependencies: + "@walletconnect/modal-core": "npm:2.7.0" + "@walletconnect/modal-ui": "npm:2.7.0" + checksum: 10/a6b78cc06479e0aa98516784ff1f81b24839777f0ec38d2f9cc85b4dc932ad6e823187bbb699f80f898e7d4b09d1232134f348eb9d12697e74e742eeaec189f2 + languageName: node + linkType: hard + "@walletconnect/react-native-compat@npm:2.11.2": version: 2.11.2 resolution: "@walletconnect/react-native-compat@npm:2.11.2" @@ -15329,7 +16009,7 @@ __metadata: languageName: node linkType: hard -"@walletconnect/relay-auth@npm:^1.0.4": +"@walletconnect/relay-auth@npm:1.0.4, @walletconnect/relay-auth@npm:^1.0.4": version: 1.0.4 resolution: "@walletconnect/relay-auth@npm:1.0.4" dependencies: @@ -15386,6 +16066,23 @@ __metadata: languageName: node linkType: hard +"@walletconnect/sign-client@npm:2.17.3": + version: 2.17.3 + resolution: "@walletconnect/sign-client@npm:2.17.3" + dependencies: + "@walletconnect/core": "npm:2.17.3" + "@walletconnect/events": "npm:1.0.1" + "@walletconnect/heartbeat": "npm:1.2.2" + "@walletconnect/jsonrpc-utils": "npm:1.0.8" + "@walletconnect/logger": "npm:2.1.2" + "@walletconnect/time": "npm:1.0.2" + "@walletconnect/types": "npm:2.17.3" + "@walletconnect/utils": "npm:2.17.3" + events: "npm:3.3.0" + checksum: 10/bcea67582113a4bcd68096a7166870ef74174187b23787ffc2166f26c605d364857d09df92c0f2a58a4de8b2e399c68e8339bc82e96482e76a6f9867b536461c + languageName: node + linkType: hard + "@walletconnect/time@npm:1.0.2, @walletconnect/time@npm:^1.0.2": version: 1.0.2 resolution: "@walletconnect/time@npm:1.0.2" @@ -15437,6 +16134,20 @@ __metadata: languageName: node linkType: hard +"@walletconnect/types@npm:2.17.3": + version: 2.17.3 + resolution: "@walletconnect/types@npm:2.17.3" + dependencies: + "@walletconnect/events": "npm:1.0.1" + "@walletconnect/heartbeat": "npm:1.2.2" + "@walletconnect/jsonrpc-types": "npm:1.0.4" + "@walletconnect/keyvaluestorage": "npm:1.1.1" + "@walletconnect/logger": "npm:2.1.2" + events: "npm:3.3.0" + checksum: 10/11209cca804db1e4f58490d19f11d02ce97360ec1cd54efcd8074ca93361caf92841551b4ba376f949e62ebc6667e325757c3e3007d19a5c31af0265ce3eeb05 + languageName: node + linkType: hard + "@walletconnect/universal-provider@npm:2.11.2": version: 2.11.2 resolution: "@walletconnect/universal-provider@npm:2.11.2" @@ -15498,6 +16209,34 @@ __metadata: languageName: node linkType: hard +"@walletconnect/utils@npm:2.17.3": + version: 2.17.3 + resolution: "@walletconnect/utils@npm:2.17.3" + dependencies: + "@ethersproject/hash": "npm:5.7.0" + "@ethersproject/transactions": "npm:5.7.0" + "@stablelib/chacha20poly1305": "npm:1.0.1" + "@stablelib/hkdf": "npm:1.0.1" + "@stablelib/random": "npm:1.0.2" + "@stablelib/sha256": "npm:1.0.1" + "@stablelib/x25519": "npm:1.0.3" + "@walletconnect/jsonrpc-utils": "npm:1.0.8" + "@walletconnect/keyvaluestorage": "npm:1.1.1" + "@walletconnect/relay-api": "npm:1.0.11" + "@walletconnect/relay-auth": "npm:1.0.4" + "@walletconnect/safe-json": "npm:1.0.2" + "@walletconnect/time": "npm:1.0.2" + "@walletconnect/types": "npm:2.17.3" + "@walletconnect/window-getters": "npm:1.0.1" + "@walletconnect/window-metadata": "npm:1.0.1" + detect-browser: "npm:5.3.0" + elliptic: "npm:6.6.1" + query-string: "npm:7.1.3" + uint8arrays: "npm:3.1.0" + checksum: 10/ba5b61ae16a105c43f8aae6f16d3dd24cd2fc2ec98be94b330ff2bc7f87175e1b85fcb344de7753acdaa2b8329f164882d6f1665b279306defd42557e0e989e0 + languageName: node + linkType: hard + "@walletconnect/utils@npm:^2.10.1": version: 2.11.0 resolution: "@walletconnect/utils@npm:2.11.0" @@ -15858,6 +16597,36 @@ __metadata: languageName: node linkType: hard +"abitype@npm:1.0.7": + version: 1.0.7 + resolution: "abitype@npm:1.0.7" + peerDependencies: + typescript: ">=5.0.4" + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + checksum: 10/6c2c3390a2f90186bf0df73f20cf257dfd9b62d1eb266de6ddf362030dcbd79cd113b4110e52f7802d7b042ea8fdb7ee2f113751b883787c2d9589d56fb4273b + languageName: node + linkType: hard + +"abitype@npm:^1.0.6": + version: 1.0.8 + resolution: "abitype@npm:1.0.8" + peerDependencies: + typescript: ">=5.0.4" + zod: ^3 >=3.22.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + checksum: 10/878e74fbac6a971953649b6216950437aa5834a604e9fa833a5b275a6967cff59857c7e43594ae906387d2fb7cad9370138dec4298eb8814815a3ffb6365902c + languageName: node + linkType: hard + "abort-controller@npm:^3.0.0": version: 3.0.0 resolution: "abort-controller@npm:3.0.0" @@ -19173,6 +19942,13 @@ __metadata: languageName: node linkType: hard +"clsx@npm:^1.2.1": + version: 1.2.1 + resolution: "clsx@npm:1.2.1" + checksum: 10/5ded6f61f15f1fa0350e691ccec43a28b12fb8e64c8e94715f2a937bc3722d4c3ed41d6e945c971fc4dcc2a7213a43323beaf2e1c28654af63ba70c9968a8643 + languageName: node + linkType: hard + "clsx@npm:^2.0.0": version: 2.1.1 resolution: "clsx@npm:2.1.1" @@ -19281,7 +20057,7 @@ __metadata: languageName: node linkType: hard -"colorette@npm:^2.0.10, colorette@npm:^2.0.14": +"colorette@npm:^2.0.10, colorette@npm:^2.0.14, colorette@npm:^2.0.7": version: 2.0.20 resolution: "colorette@npm:2.0.20" checksum: 10/0b8de48bfa5d10afc160b8eaa2b9938f34a892530b2f7d7897e0458d9535a066e3998b49da9d21161c78225b272df19ae3a64d6df28b4c9734c0e55bbd02406f @@ -19388,6 +20164,15 @@ __metadata: languageName: node linkType: hard +"compare-urls@npm:^2.0.0": + version: 2.0.0 + resolution: "compare-urls@npm:2.0.0" + dependencies: + normalize-url: "npm:^2.0.1" + checksum: 10/706a305fcbafac63e3e3dafe71283b2fbef05ed18f64636e13bf201cdca164ff16463a7004023535497828f69b822ce44c3b43fcaa0e99d8976b26b1f326595c + languageName: node + linkType: hard + "compare-version@npm:^0.1.2": version: 0.1.2 resolution: "compare-version@npm:0.1.2" @@ -19602,6 +20387,13 @@ __metadata: languageName: node linkType: hard +"cookie@npm:^1.0.1": + version: 1.0.2 + resolution: "cookie@npm:1.0.2" + checksum: 10/f5817cdc84d8977761b12549eba29435e675e65c7fef172bc31737788cd8adc83796bf8abe6d950554e7987325ad2d9ac2971c5bd8ff0c4f81c145f82e4ab1be + languageName: node + linkType: hard + "cookie@npm:~0.4.1": version: 0.4.2 resolution: "cookie@npm:0.4.2" @@ -20180,7 +20972,7 @@ __metadata: languageName: node linkType: hard -"csstype@npm:^3.0.2, csstype@npm:^3.0.7": +"csstype@npm:3.1.3, csstype@npm:^3.0.2, csstype@npm:^3.0.7": version: 3.1.3 resolution: "csstype@npm:3.1.3" checksum: 10/f593cce41ff5ade23f44e77521e3a1bcc2c64107041e1bf6c3c32adc5187d0d60983292fda326154d20b01079e24931aa5b08e4467cc488b60bb1e7f6d478ade @@ -20389,6 +21181,13 @@ __metadata: languageName: node linkType: hard +"dateformat@npm:^4.6.3": + version: 4.6.3 + resolution: "dateformat@npm:4.6.3" + checksum: 10/5c149c91bf9ce2142c89f84eee4c585f0cb1f6faf2536b1af89873f862666a28529d1ccafc44750aa01384da2197c4f76f4e149a3cc0c1cb2c46f5cc45f2bcb5 + languageName: node + linkType: hard + "dayjs@npm:^1.8.15": version: 1.11.10 resolution: "dayjs@npm:1.11.10" @@ -20810,6 +21609,13 @@ __metadata: languageName: node linkType: hard +"destr@npm:^2.0.3": + version: 2.0.3 + resolution: "destr@npm:2.0.3" + checksum: 10/dbb756baa876810ec0ca4bcb702d86cc3b480ed14f36bf5747718ed211f96bca5520b63a4109eb181ad940ee2a645677d9a63d4a0ed11a7510619dae97317201 + languageName: node + linkType: hard + "destroy@npm:1.2.0": version: 1.2.0 resolution: "destroy@npm:1.2.0" @@ -21141,6 +21947,13 @@ __metadata: languageName: node linkType: hard +"dotenv@npm:^16.0.3": + version: 16.4.7 + resolution: "dotenv@npm:16.4.7" + checksum: 10/f13bfe97db88f0df4ec505eeffb8925ec51f2d56a3d0b6d916964d8b4af494e6fb1633ba5d09089b552e77ab2a25de58d70259b2c5ed45ec148221835fc99a0c + languageName: node + linkType: hard + "dotenv@npm:^16.3.1, dotenv@npm:^16.4.4, dotenv@npm:~16.4.5": version: 16.4.5 resolution: "dotenv@npm:16.4.5" @@ -21450,6 +22263,21 @@ __metadata: languageName: node linkType: hard +"elliptic@npm:6.6.1": + version: 6.6.1 + resolution: "elliptic@npm:6.6.1" + dependencies: + bn.js: "npm:^4.11.9" + brorand: "npm:^1.1.0" + hash.js: "npm:^1.0.0" + hmac-drbg: "npm:^1.0.1" + inherits: "npm:^2.0.4" + minimalistic-assert: "npm:^1.0.1" + minimalistic-crypto-utils: "npm:^1.0.1" + checksum: 10/dc678c9febd89a219c4008ba3a9abb82237be853d9fd171cd602c8fb5ec39927e65c6b5e7a1b2a4ea82ee8e0ded72275e7932bb2da04a5790c2638b818e4e1c5 + languageName: node + linkType: hard + "elliptic@npm:^6.5.7": version: 6.5.7 resolution: "elliptic@npm:6.5.7" @@ -23368,6 +24196,15 @@ __metadata: languageName: node linkType: hard +"expo-apple-authentication@npm:6.3.0": + version: 6.3.0 + resolution: "expo-apple-authentication@npm:6.3.0" + peerDependencies: + expo: "*" + checksum: 10/8875bab17ed6393ccf9036de6541a82d67187656b14354c3845e418696215d31f937c7fb63a57b8546a1a0adb66728c770098552b212a876ced6fb1ab9423a3f + languageName: node + linkType: hard + "expo-application@npm:5.8.3, expo-application@npm:~5.8.0": version: 5.8.3 resolution: "expo-application@npm:5.8.3" @@ -23431,15 +24268,14 @@ __metadata: languageName: node linkType: hard -"expo-constants@npm:~14.4.2": - version: 14.4.2 - resolution: "expo-constants@npm:14.4.2" +"expo-constants@npm:15.4.6": + version: 15.4.6 + resolution: "expo-constants@npm:15.4.6" dependencies: - "@expo/config": "npm:~8.1.0" - uuid: "npm:^3.3.2" + "@expo/config": "npm:~8.5.0" peerDependencies: expo: "*" - checksum: 10/743504f08422f1a3232332718bfc8743c2d543aded21e7ea54902337e732abc84c525a1735291792d3e1070eb5de010e4317c40a4f471ddf9de5698befb15570 + checksum: 10/223b945cc3585e8445b20f3dfb9d95bac123c36a5dadf5774236d935f3fc3ca12d948e6761d415f07fd490c285c3bf1f780f40d78b85ad3cf6526e7e28c850b5 languageName: node linkType: hard @@ -23454,6 +24290,29 @@ __metadata: languageName: node linkType: hard +"expo-constants@npm:~16.0.0": + version: 16.0.2 + resolution: "expo-constants@npm:16.0.2" + dependencies: + "@expo/config": "npm:~9.0.0" + "@expo/env": "npm:~0.3.0" + peerDependencies: + expo: "*" + checksum: 10/f2f8b15932ab2f805544fd96c6740d2354c6409706eee2664be1703c3480c7531a709112af811dc22f05c164c06501aec20f81617675e87b5a3b66ab5b8d7611 + languageName: node + linkType: hard + +"expo-crypto@npm:12.8.1": + version: 12.8.1 + resolution: "expo-crypto@npm:12.8.1" + dependencies: + base64-js: "npm:^1.3.0" + peerDependencies: + expo: "*" + checksum: 10/a98b854aef4dce2a3432fcf6cd1a2be2a79715690019a25ac114f7333eacda1cfbe3295e9dabe200bfe7adc119ef43665b5d6b38ed4c4c1692c34d2c498b3425 + languageName: node + linkType: hard + "expo-device@npm:5.9.3": version: 5.9.3 resolution: "expo-device@npm:5.9.3" @@ -23483,7 +24342,7 @@ __metadata: languageName: node linkType: hard -"expo-font@npm:~11.10.3": +"expo-font@npm:11.10.3, expo-font@npm:~11.10.3": version: 11.10.3 resolution: "expo-font@npm:11.10.3" dependencies: @@ -23570,16 +24429,13 @@ __metadata: languageName: node linkType: hard -"expo-linking@npm:^5.0.2": - version: 5.0.2 - resolution: "expo-linking@npm:5.0.2" +"expo-linking@npm:^6.2.2": + version: 6.3.1 + resolution: "expo-linking@npm:6.3.1" dependencies: - "@types/qs": "npm:^6.9.7" - expo-constants: "npm:~14.4.2" + expo-constants: "npm:~16.0.0" invariant: "npm:^2.2.4" - qs: "npm:^6.11.0" - url-parse: "npm:^1.5.9" - checksum: 10/4e4acd8681d619197157cc590a62398cb887b76073b06125ff1a737bca24ea1cbf32b439a4e67cdfe80e10aa007943b90f1a3b6d87d9be20fdb00c3e9b170a74 + checksum: 10/07ee4417ae6e58351797b805bd88215ceb6f89ec16c99e305db6d826925da1d1620e3baaa733a5c8848663dc2b3c39b6d375b381cf590a603a98eb671fef105d languageName: node linkType: hard @@ -23728,13 +24584,25 @@ __metadata: languageName: node linkType: hard -"expo-status-bar@npm:~1.6.0": +"expo-status-bar@npm:1.6.0": version: 1.6.0 resolution: "expo-status-bar@npm:1.6.0" checksum: 10/ea390e22bba71d2fabfd44de6d9c1c54d8fc08b483a2eb7545ba2ac1d593601dfdecdccae47db9a27379636be9016121fb237d88798ca6ac8b572249b6faa672 languageName: node linkType: hard +"expo-web-browser@npm:12.8.2": + version: 12.8.2 + resolution: "expo-web-browser@npm:12.8.2" + dependencies: + compare-urls: "npm:^2.0.0" + url: "npm:^0.11.0" + peerDependencies: + expo: "*" + checksum: 10/0ece97439bd77c35726af71abf4040b146565097536d09d21704d1eef65e710f6ae7120917270f544df7e6b40d4d52d26883203dcc155581f505a24b36797712 + languageName: node + linkType: hard + "expo@npm:50.0.20": version: 50.0.20 resolution: "expo@npm:50.0.20" @@ -23911,6 +24779,13 @@ __metadata: languageName: node linkType: hard +"fast-copy@npm:^3.0.0": + version: 3.0.2 + resolution: "fast-copy@npm:3.0.2" + checksum: 10/97e1022e2aaa27acf4a986d679310bfd66bfb87fe8da9dd33b698e3e50189484001cf1eeb9670e19b59d9d299828ed86c8da354c954f125995ab2a6331c5f290 + languageName: node + linkType: hard + "fast-deep-equal@npm:3.1.3, fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": version: 3.1.3 resolution: "fast-deep-equal@npm:3.1.3" @@ -23959,6 +24834,13 @@ __metadata: languageName: node linkType: hard +"fast-password-entropy@npm:^1.1.1": + version: 1.1.1 + resolution: "fast-password-entropy@npm:1.1.1" + checksum: 10/170f626f36fb9f34229e92ead2eb48f545a846c28e274d392edf09d48b665a0acf668225288872a5475f962484aae9621a2c69360cf89f9c67b3155adf7ca04f + languageName: node + linkType: hard + "fast-redact@npm:^3.0.0": version: 3.3.0 resolution: "fast-redact@npm:3.3.0" @@ -24114,6 +24996,13 @@ __metadata: languageName: node linkType: hard +"fetch-retry@npm:^5.0.6": + version: 5.0.6 + resolution: "fetch-retry@npm:5.0.6" + checksum: 10/9d64b37f9d179fecf486725ada210d169375803b731304a9500754e094a2a6aa81630d946adbb313d7f9d54457ad0d17c3ed5c115034961a719e8a65faa8b77c + languageName: node + linkType: hard + "figures@npm:^3.0.0": version: 3.2.0 resolution: "figures@npm:3.2.0" @@ -25526,6 +26415,13 @@ __metadata: languageName: node linkType: hard +"help-me@npm:^5.0.0": + version: 5.0.0 + resolution: "help-me@npm:5.0.0" + checksum: 10/5f99bd91dae93d02867175c3856c561d7e3a24f16999b08f5fc79689044b938d7ed58457f4d8c8744c01403e6e0470b7896baa344d112b2355842fd935a75d69 + languageName: node + linkType: hard + "hermes-estree@npm:0.15.0": version: 0.15.0 resolution: "hermes-estree@npm:0.15.0" @@ -27106,6 +28002,15 @@ __metadata: languageName: node linkType: hard +"isows@npm:1.0.6": + version: 1.0.6 + resolution: "isows@npm:1.0.6" + peerDependencies: + ws: "*" + checksum: 10/ab9e85b50bcc3d70aa5ec875aa2746c5daf9321cb376ed4e5434d3c2643c5d62b1f466d93a05cd2ad0ead5297224922748c31707cb4fbd68f5d05d0479dce99c + languageName: node + linkType: hard + "isstream@npm:~0.1.2": version: 0.1.2 resolution: "isstream@npm:0.1.2" @@ -27865,6 +28770,13 @@ __metadata: languageName: node linkType: hard +"jose@npm:^4.15.5": + version: 4.15.9 + resolution: "jose@npm:4.15.9" + checksum: 10/256234b6f85cdc080b1331f2d475bd58c8ccf459cb20f70ac5e4200b271bce10002b1c2f8e5b96dd975d83065ae5a586d52cdf89d28471d56de5d297992f9905 + languageName: node + linkType: hard + "jose@npm:^5.4.1": version: 5.9.6 resolution: "jose@npm:5.9.6" @@ -27887,6 +28799,13 @@ __metadata: languageName: node linkType: hard +"joycon@npm:^3.1.1": + version: 3.1.1 + resolution: "joycon@npm:3.1.1" + checksum: 10/4b36e3479144ec196425f46b3618f8a96ce7e1b658f091a309cd4906215f5b7a402d7df331a3e0a09681381a658d0c5f039cb3cf6907e0a1e17ed847f5d37775 + languageName: node + linkType: hard + "jpeg-js@npm:^0.4.2": version: 0.4.4 resolution: "jpeg-js@npm:0.4.4" @@ -27941,6 +28860,13 @@ __metadata: languageName: node linkType: hard +"js-cookie@npm:^3.0.5": + version: 3.0.5 + resolution: "js-cookie@npm:3.0.5" + checksum: 10/366494b1630b9fb8abaef3659748db5dfd52c58c6fc3459b9f0a03b492593bc1b01c6dfcc066b46f6413c28edb3a00cc68fb61ea8cdf6991bedf1f100f8a389d + languageName: node + linkType: hard + "js-md5@npm:^0.8.3": version: 0.8.3 resolution: "js-md5@npm:0.8.3" @@ -28407,7 +29333,7 @@ __metadata: languageName: node linkType: hard -"keccak@npm:^3.0.0, keccak@npm:^3.0.1, keccak@npm:^3.0.2": +"keccak@npm:^3.0.0, keccak@npm:^3.0.1, keccak@npm:^3.0.2, keccak@npm:^3.0.3": version: 3.0.4 resolution: "keccak@npm:3.0.4" dependencies: @@ -28625,6 +29551,13 @@ __metadata: languageName: node linkType: hard +"libphonenumber-js@npm:^1.10.31, libphonenumber-js@npm:^1.10.44": + version: 1.11.18 + resolution: "libphonenumber-js@npm:1.11.18" + checksum: 10/102ecd0b93e392aca14330801c4e9da60008ba04f9ea1db7a0e1bdf46d6b4279fb31421ae38b0ca74bb37fe5a194004c4bf375d6cd5c953cdbb30bb01cec5e3f + languageName: node + linkType: hard + "lie@npm:3.1.1": version: 3.1.1 resolution: "lie@npm:3.1.1" @@ -29051,6 +29984,13 @@ __metadata: languageName: node linkType: hard +"lokijs@npm:^1.5.12": + version: 1.5.12 + resolution: "lokijs@npm:1.5.12" + checksum: 10/08b11b257210901b1ee293a4573a0e0dbfd37c49161db69950415b668546ea01e983c9b370d8b847933546ef188effa87df2d5eacb2a0b6fc5b739cbcf4a2b16 + languageName: node + linkType: hard + "long@npm:*, long@npm:^5.2.1": version: 5.2.3 resolution: "long@npm:5.2.3" @@ -29328,7 +30268,7 @@ __metadata: languageName: node linkType: hard -"md5@npm:^2.2.1": +"md5@npm:^2.2.1, md5@npm:^2.3.0": version: 2.3.0 resolution: "md5@npm:2.3.0" dependencies: @@ -30888,6 +31828,13 @@ __metadata: languageName: node linkType: hard +"node-fetch-native@npm:^1.6.4": + version: 1.6.4 + resolution: "node-fetch-native@npm:1.6.4" + checksum: 10/39c4c6d0c2a4bed1444943e1647ad0d79eb6638cf159bc37dffeafd22cffcf6a998e006aa1f3dd1d9d2258db7d78dee96b44bee4ba0bbaf0440ed348794f2543 + languageName: node + linkType: hard + "node-fetch@npm:2.6.7": version: 2.6.7 resolution: "node-fetch@npm:2.6.7" @@ -31116,6 +32063,17 @@ __metadata: languageName: node linkType: hard +"normalize-url@npm:^2.0.1": + version: 2.0.1 + resolution: "normalize-url@npm:2.0.1" + dependencies: + prepend-http: "npm:^2.0.0" + query-string: "npm:^5.0.1" + sort-keys: "npm:^2.0.0" + checksum: 10/30e337ee03fc7f360c7d2b966438657fabd2628925cc58bffc893982fe4d2c59b397ae664fa2c319cd83565af73eee88906e80bc5eec91bc32b601920e770d75 + languageName: node + linkType: hard + "normalize-url@npm:^6.0.1": version: 6.1.0 resolution: "normalize-url@npm:6.1.0" @@ -31380,6 +32338,17 @@ __metadata: languageName: node linkType: hard +"ofetch@npm:^1.3.4": + version: 1.4.1 + resolution: "ofetch@npm:1.4.1" + dependencies: + destr: "npm:^2.0.3" + node-fetch-native: "npm:^1.6.4" + ufo: "npm:^1.5.4" + checksum: 10/329ecd5595eff6da090c728e66f4223ad7ba5c2c309446f3707245c1b213da47dfd1eb1740f26b3da9e31ed7b7a903733bdaae85187b714514da865a0c5a4a9c + languageName: node + linkType: hard + "omggif@npm:^1.0.10, omggif@npm:^1.0.9": version: 1.0.10 resolution: "omggif@npm:1.0.10" @@ -31394,6 +32363,13 @@ __metadata: languageName: node linkType: hard +"on-exit-leak-free@npm:^2.1.0": + version: 2.1.2 + resolution: "on-exit-leak-free@npm:2.1.2" + checksum: 10/f7b4b7200026a08f6e4a17ba6d72e6c5cbb41789ed9cf7deaf9d9e322872c7dc5a7898549a894651ee0ee9ae635d34a678115bf8acdfba8ebd2ba2af688b563c + languageName: node + linkType: hard + "on-finished@npm:2.4.1": version: 2.4.1 resolution: "on-finished@npm:2.4.1" @@ -31563,6 +32539,26 @@ __metadata: languageName: node linkType: hard +"ox@npm:0.6.0": + version: 0.6.0 + resolution: "ox@npm:0.6.0" + dependencies: + "@adraffy/ens-normalize": "npm:^1.10.1" + "@noble/curves": "npm:^1.6.0" + "@noble/hashes": "npm:^1.5.0" + "@scure/bip32": "npm:^1.5.0" + "@scure/bip39": "npm:^1.4.0" + abitype: "npm:^1.0.6" + eventemitter3: "npm:5.0.1" + peerDependencies: + typescript: ">=5.4.0" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/b089b2d09035def8d3f6d17ab1dd792fd7f1a4d8e008aa96bc50a8cef24ddb8e608ec828f4d83cf959b080a7c854921449e4d061f45f6dee944f48bd0971e60f + languageName: node + linkType: hard + "p-cancelable@npm:^2.0.0": version: 2.1.1 resolution: "p-cancelable@npm:2.1.1" @@ -32179,6 +33175,16 @@ __metadata: languageName: node linkType: hard +"pino-abstract-transport@npm:^1.0.0": + version: 1.2.0 + resolution: "pino-abstract-transport@npm:1.2.0" + dependencies: + readable-stream: "npm:^4.0.0" + split2: "npm:^4.0.0" + checksum: 10/6ec1d19a7ff3347fd21576f744c31c3e38ca4463ae638818408f43698c936f96be6a0bc750af5f7c1ae81873183bfcb062b7a0d12dc159a1813ea900c388c693 + languageName: node + linkType: hard + "pino-abstract-transport@npm:v0.5.0": version: 0.5.0 resolution: "pino-abstract-transport@npm:0.5.0" @@ -32189,6 +33195,30 @@ __metadata: languageName: node linkType: hard +"pino-pretty@npm:^10.0.0": + version: 10.3.1 + resolution: "pino-pretty@npm:10.3.1" + dependencies: + colorette: "npm:^2.0.7" + dateformat: "npm:^4.6.3" + fast-copy: "npm:^3.0.0" + fast-safe-stringify: "npm:^2.1.1" + help-me: "npm:^5.0.0" + joycon: "npm:^3.1.1" + minimist: "npm:^1.2.6" + on-exit-leak-free: "npm:^2.1.0" + pino-abstract-transport: "npm:^1.0.0" + pump: "npm:^3.0.0" + readable-stream: "npm:^4.0.0" + secure-json-parse: "npm:^2.4.0" + sonic-boom: "npm:^3.0.0" + strip-json-comments: "npm:^3.1.1" + bin: + pino-pretty: bin.js + checksum: 10/4284f125f7e8a5a10e856c8fd591ba34c30c0a0071a0b265a9eda43c3e447ba11d40b06cc67108675586358a5d1213a6ac3a92f6abd2896abfbab9a5b4c17072 + languageName: node + linkType: hard + "pino-std-serializers@npm:^4.0.0": version: 4.0.0 resolution: "pino-std-serializers@npm:4.0.0" @@ -32717,6 +33747,17 @@ __metadata: languageName: node linkType: hard +"postcss@npm:8.4.38": + version: 8.4.38 + resolution: "postcss@npm:8.4.38" + dependencies: + nanoid: "npm:^3.3.7" + picocolors: "npm:^1.0.0" + source-map-js: "npm:^1.2.0" + checksum: 10/6e44a7ed835ffa9a2b096e8d3e5dfc6bcf331a25c48aeb862dd54e3aaecadf814fa22be224fd308f87d08adf2299164f88c5fd5ab1c4ef6cbd693ceb295377f4 + languageName: node + linkType: hard + "postcss@npm:^8.3.5, postcss@npm:^8.4.21": version: 8.4.32 resolution: "postcss@npm:8.4.32" @@ -32806,6 +33847,13 @@ __metadata: languageName: node linkType: hard +"preact@npm:^10.16.0": + version: 10.25.4 + resolution: "preact@npm:10.25.4" + checksum: 10/8b377438912965b45786d1dbfdd532157294a79bebc611b242d708317574403554ab37e34c613a3e9e862685c04695343f1426a38e12258e1e9ebafc0d7e4c5d + languageName: node + linkType: hard + "preact@npm:^10.25.1": version: 10.25.2 resolution: "preact@npm:10.25.2" @@ -32842,6 +33890,13 @@ __metadata: languageName: node linkType: hard +"prepend-http@npm:^2.0.0": + version: 2.0.0 + resolution: "prepend-http@npm:2.0.0" + checksum: 10/7694a9525405447662c1ffd352fcb41b6410c705b739b6f4e3a3e21cf5fdede8377890088e8934436b8b17ba55365a615f153960f30877bf0d0392f9e93503ea + languageName: node + linkType: hard + "prettier-linter-helpers@npm:^1.0.0": version: 1.0.0 resolution: "prettier-linter-helpers@npm:1.0.0" @@ -33017,9 +34072,9 @@ __metadata: languageName: node linkType: hard -"protobufjs@npm:^6.11.2, protobufjs@npm:~6.11.2": - version: 6.11.4 - resolution: "protobufjs@npm:6.11.4" +"protobufjs@npm:6.11.2": + version: 6.11.2 + resolution: "protobufjs@npm:6.11.2" dependencies: "@protobufjs/aspromise": "npm:^1.1.2" "@protobufjs/base64": "npm:^1.1.2" @@ -33037,7 +34092,7 @@ __metadata: bin: pbjs: bin/pbjs pbts: bin/pbts - checksum: 10/6b7fd7540d74350d65c38f69f398c9995ae019da070e79d9cd464a458c6d19b40b07c9a026be4e10704c824a344b603307745863310c50026ebd661ce4da0663 + checksum: 10/86c35e561a44251137f167a1fd3225072c7325aa72e483d8530372770a6ba2d8ab07339c1d9f33e304253702914a7625c3dd96fe852d2238f6eb8851ea46e1cf languageName: node linkType: hard @@ -33213,6 +34268,19 @@ __metadata: languageName: node linkType: hard +"qrcode@npm:^1.5.1, qrcode@npm:^1.5.4": + version: 1.5.4 + resolution: "qrcode@npm:1.5.4" + dependencies: + dijkstrajs: "npm:^1.0.1" + pngjs: "npm:^5.0.0" + yargs: "npm:^15.3.1" + bin: + qrcode: bin/qrcode + checksum: 10/9a1b61760e4ea334545a0f54bbc11c537aba0a17cf52cab9fa1b07f8a1337eed0bc6f7fde41b197f2c82c249bc48728983bfaf861bb7ecb29dc597b2ae33c424 + languageName: node + linkType: hard + "qs@npm:6.13.0, qs@npm:^6.12.3": version: 6.13.0 resolution: "qs@npm:6.13.0" @@ -33222,7 +34290,7 @@ __metadata: languageName: node linkType: hard -"qs@npm:^6.11.0, qs@npm:^6.11.2, qs@npm:^6.5.2, qs@npm:^6.9.4": +"qs@npm:^6.11.2, qs@npm:^6.5.2, qs@npm:^6.9.4": version: 6.11.2 resolution: "qs@npm:6.11.2" dependencies: @@ -33468,6 +34536,18 @@ __metadata: languageName: node linkType: hard +"react-device-detect@npm:^2.2.2": + version: 2.2.3 + resolution: "react-device-detect@npm:2.2.3" + dependencies: + ua-parser-js: "npm:^1.0.33" + peerDependencies: + react: ">= 0.14.0" + react-dom: ">= 0.14.0" + checksum: 10/7152e2b216b3bb6fd75c7859d3441b89658695c629a13c5d374f076756705650be585d5c4dc19d9d34908ef1b61f19b52f1055d74dd7104b77d1b6f897ee09e0 + languageName: node + linkType: hard + "react-devtools-core@npm:^4.27.7": version: 4.28.5 resolution: "react-devtools-core@npm:4.28.5" @@ -33987,6 +35067,17 @@ __metadata: languageName: node linkType: hard +"react-native-passkeys@npm:^0.3.0": + version: 0.3.1 + resolution: "react-native-passkeys@npm:0.3.1" + peerDependencies: + expo: "*" + react: "*" + react-native: "*" + checksum: 10/9361867994567b31abe92814c501cdf6410566efe97f6780f3e6e0a10bb251c593cea9d58939d4f2dd6bb7352ff31ac69e099c30b7829949a6ffc5c9bd071358 + languageName: node + linkType: hard + "react-native-permissions@npm:^4.1.5": version: 4.1.5 resolution: "react-native-permissions@npm:4.1.5" @@ -34012,6 +35103,45 @@ __metadata: languageName: node linkType: hard +"react-native-purchases-ui@npm:^8.5.0": + version: 8.5.0 + resolution: "react-native-purchases-ui@npm:8.5.0" + dependencies: + "@revenuecat/purchases-typescript-internal": "npm:13.14.0" + react-native-purchases: "npm:8.5.0" + peerDependencies: + react: "*" + react-native: "*" + checksum: 10/ee451ce0b0dec85df77082d27cd6dd6e0a8fe121f22a03864570369a6077cf1d5cb8f7fb7061f9c1b674507e5a85f07ce4525c0290444b98832ac4b32017af43 + languageName: node + linkType: hard + +"react-native-purchases@npm:8.5.0, react-native-purchases@npm:^8.5.0": + version: 8.5.0 + resolution: "react-native-purchases@npm:8.5.0" + dependencies: + "@revenuecat/purchases-typescript-internal": "npm:13.14.0" + peerDependencies: + react: ">= 16.6.3" + react-native: "*" + checksum: 10/6cffa6160a135007b29f7f7a3b83b51fadc6db1700d42a2dbb009f29374022fc08e12b25543b50d09624cbe0ce2d588a6542f290302d858264a4b9ea42f41474 + languageName: node + linkType: hard + +"react-native-qrcode-styled@npm:^0.3.3": + version: 0.3.3 + resolution: "react-native-qrcode-styled@npm:0.3.3" + dependencies: + qrcode: "npm:^1.5.4" + react-fast-compare: "npm:^3.2.2" + peerDependencies: + react: "*" + react-native: "*" + react-native-svg: "*" + checksum: 10/d6965e2a24975c9dd93d2ad1deade64c21d1b1b29d8a0051e7f2aa2f132c661deb8a8b4aae5539de76967501dda6d02884a47d31bd44844415da5ead5b169456 + languageName: node + linkType: hard + "react-native-randombytes@npm:^3.6.1": version: 3.6.1 resolution: "react-native-randombytes@npm:3.6.1" @@ -34590,6 +35720,36 @@ __metadata: languageName: node linkType: hard +"react-router-dom@npm:^7.1.1": + version: 7.1.1 + resolution: "react-router-dom@npm:7.1.1" + dependencies: + react-router: "npm:7.1.1" + peerDependencies: + react: ">=18" + react-dom: ">=18" + checksum: 10/d7b978959f89051cf6705cdc0907d92167e39f2835b20b78508cc69e46ebecdbb0b7b95c4d2f954b60c01cdfc70ffc842ee261c0b7b22507a51990e4cebc41ee + languageName: node + linkType: hard + +"react-router@npm:7.1.1": + version: 7.1.1 + resolution: "react-router@npm:7.1.1" + dependencies: + "@types/cookie": "npm:^0.6.0" + cookie: "npm:^1.0.1" + set-cookie-parser: "npm:^2.6.0" + turbo-stream: "npm:2.4.0" + peerDependencies: + react: ">=18" + react-dom: ">=18" + peerDependenciesMeta: + react-dom: + optional: true + checksum: 10/f12e229d79bd6de561e697b64556959361365610450c12bfd89116fccca8428728d7c372a096eff570a917ef02473ef4f5145beb6a2881d6935f69fe25bebcfd + languageName: node + linkType: hard + "react-shallow-renderer@npm:^16.15.0": version: 16.15.0 resolution: "react-shallow-renderer@npm:16.15.0" @@ -34725,6 +35885,19 @@ __metadata: languageName: node linkType: hard +"readable-stream@npm:^4.0.0": + version: 4.7.0 + resolution: "readable-stream@npm:4.7.0" + dependencies: + abort-controller: "npm:^3.0.0" + buffer: "npm:^6.0.3" + events: "npm:^3.3.0" + process: "npm:^0.11.10" + string_decoder: "npm:^1.3.0" + checksum: 10/bdf096c8ff59452ce5d08f13da9597f9fcfe400b4facfaa88e74ec057e5ad1fdfa140ffe28e5ed806cf4d2055f0b812806e962bca91dce31bc4cef08e53be3a4 + languageName: node + linkType: hard + "readable-stream@npm:~1.0.26, readable-stream@npm:~1.0.26-4": version: 1.0.34 resolution: "readable-stream@npm:1.0.34" @@ -35780,6 +36953,20 @@ __metadata: languageName: node linkType: hard +"secure-json-parse@npm:^2.4.0": + version: 2.7.0 + resolution: "secure-json-parse@npm:2.7.0" + checksum: 10/974386587060b6fc5b1ac06481b2f9dbbb0d63c860cc73dc7533f27835fdb67b0ef08762dbfef25625c15bc0a0c366899e00076cb0d556af06b71e22f1dede4c + languageName: node + linkType: hard + +"secure-password-utilities@npm:^0.2.1": + version: 0.2.1 + resolution: "secure-password-utilities@npm:0.2.1" + checksum: 10/734bcfdce8aa7c6e03c0445617312fedfe92f5f5a999c05f420d49d9fdfd199e2dcf4c91fd0ac8d45a27ec04918d5f3d96d2550a97aada633f66d2e1567a1c52 + languageName: node + linkType: hard + "select-hose@npm:^2.0.0": version: 2.0.0 resolution: "select-hose@npm:2.0.0" @@ -35853,7 +37040,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.5.1, semver@npm:^7.6.3": +"semver@npm:^7.5.1, semver@npm:^7.6.0, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -35994,6 +37181,13 @@ __metadata: languageName: node linkType: hard +"set-cookie-parser@npm:^2.6.0": + version: 2.7.1 + resolution: "set-cookie-parser@npm:2.7.1" + checksum: 10/c92b1130032693342bca13ea1b1bc93967ab37deec4387fcd8c2a843c0ef2fd9a9f3df25aea5bb3976cd05a91c2cf4632dd6164d6e1814208fb7d7e14edd42b4 + languageName: node + linkType: hard + "set-function-length@npm:^1.1.1": version: 1.1.1 resolution: "set-function-length@npm:1.1.1" @@ -36404,7 +37598,7 @@ __metadata: languageName: node linkType: hard -"socket.io-client@npm:*, socket.io-client@npm:^4.5.4": +"socket.io-client@npm:*": version: 4.7.2 resolution: "socket.io-client@npm:4.7.2" dependencies: @@ -36494,6 +37688,15 @@ __metadata: languageName: node linkType: hard +"sonic-boom@npm:^3.0.0": + version: 3.8.1 + resolution: "sonic-boom@npm:3.8.1" + dependencies: + atomic-sleep: "npm:^1.0.0" + checksum: 10/e03c9611e43fa81132cd2ce0fe4eb7fbcf19db267e9dec20dc6c586f82465c9c906e91a02f72150c740463ad9335536ea2131850307aaa6686d1fb5d4cc4be3e + languageName: node + linkType: hard + "sonner@npm:^0.3.5": version: 0.3.5 resolution: "sonner@npm:0.3.5" @@ -36532,6 +37735,15 @@ __metadata: languageName: node linkType: hard +"sort-keys@npm:^2.0.0": + version: 2.0.0 + resolution: "sort-keys@npm:2.0.0" + dependencies: + is-plain-obj: "npm:^1.0.0" + checksum: 10/255f9fb393ef60a3db508e0cc5b18ef401127dbb2376b205ae27d168e245fc0d6b35267dde98fab6410dde684c9321f7fc8bf71f2b051761973231617753380d + languageName: node + linkType: hard + "source-list-map@npm:^2.0.0, source-list-map@npm:^2.0.1": version: 2.0.1 resolution: "source-list-map@npm:2.0.1" @@ -36569,6 +37781,13 @@ __metadata: languageName: node linkType: hard +"source-map-js@npm:^1.2.0": + version: 1.2.1 + resolution: "source-map-js@npm:1.2.1" + checksum: 10/ff9d8c8bf096d534a5b7707e0382ef827b4dd360a577d3f34d2b9f48e12c9d230b5747974ee7c607f0df65113732711bb701fe9ece3c7edbd43cb2294d707df3 + languageName: node + linkType: hard + "source-map-loader@npm:^3.0.1": version: 3.0.2 resolution: "source-map-loader@npm:3.0.2" @@ -37109,7 +38328,7 @@ __metadata: languageName: node linkType: hard -"string_decoder@npm:^1.1.1": +"string_decoder@npm:^1.1.1, string_decoder@npm:^1.3.0": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" dependencies: @@ -37293,6 +38512,26 @@ __metadata: languageName: node linkType: hard +"styled-components@npm:^6.1.13": + version: 6.1.14 + resolution: "styled-components@npm:6.1.14" + dependencies: + "@emotion/is-prop-valid": "npm:1.2.2" + "@emotion/unitless": "npm:0.8.1" + "@types/stylis": "npm:4.2.5" + css-to-react-native: "npm:3.2.0" + csstype: "npm:3.1.3" + postcss: "npm:8.4.38" + shallowequal: "npm:1.1.0" + stylis: "npm:4.3.2" + tslib: "npm:2.6.2" + peerDependencies: + react: ">= 16.8.0" + react-dom: ">= 16.8.0" + checksum: 10/de26960b8e2b8d9430e8a02a22a7fa1ae764d914064525008257fb5d469cbddb4ef9b8b5b5e4baaabd236bd77c84fdad9a8d5f0d2fd05ff39ff55d80a71ff9de + languageName: node + linkType: hard + "stylehacks@npm:^5.1.1": version: 5.1.1 resolution: "stylehacks@npm:5.1.1" @@ -37319,6 +38558,20 @@ __metadata: languageName: node linkType: hard +"stylis@npm:4.3.2": + version: 4.3.2 + resolution: "stylis@npm:4.3.2" + checksum: 10/4d3e3cb5cbfc7abdf14e424c8631a15fd15cbf0357ffc641c319587e00c2d1036b1a71cb88b42411bc3ce10d7730ad3fb9789b034d11365e8a19d23f56486c77 + languageName: node + linkType: hard + +"stylis@npm:^4.3.4": + version: 4.3.5 + resolution: "stylis@npm:4.3.5" + checksum: 10/4f5901cf7f0cd2cd5a284127a638c267325cf2cfd2a00c86bdc7aa85e370fa4029168ad453d77b67023f80f7e42e13ad6bc6c355391ed8109979ff194f6c8009 + languageName: node + linkType: hard + "sucrase@npm:3.34.0": version: 3.34.0 resolution: "sucrase@npm:3.34.0" @@ -37337,24 +38590,6 @@ __metadata: languageName: node linkType: hard -"sucrase@npm:^3.20.0": - version: 3.35.0 - resolution: "sucrase@npm:3.35.0" - dependencies: - "@jridgewell/gen-mapping": "npm:^0.3.2" - commander: "npm:^4.0.0" - glob: "npm:^10.3.10" - lines-and-columns: "npm:^1.1.6" - mz: "npm:^2.7.0" - pirates: "npm:^4.0.1" - ts-interface-checker: "npm:^0.1.9" - bin: - sucrase: bin/sucrase - sucrase-node: bin/sucrase-node - checksum: 10/bc601558a62826f1c32287d4fdfa4f2c09fe0fec4c4d39d0e257fd9116d7d6227a18309721d4185ec84c9dc1af0d5ec0e05a42a337fbb74fc293e068549aacbe - languageName: node - linkType: hard - "sudo-prompt@npm:9.1.1": version: 9.1.1 resolution: "sudo-prompt@npm:9.1.1" @@ -38063,7 +39298,7 @@ __metadata: languageName: node linkType: hard -"tinycolor2@npm:^1.4.1": +"tinycolor2@npm:^1.4.1, tinycolor2@npm:^1.6.0": version: 1.6.0 resolution: "tinycolor2@npm:1.6.0" checksum: 10/066c3acf4f82b81c58a0d3ab85f49407efe95ba87afc3c7a16b1d77625193dfbe10dd46c26d0a263c1137361dd5a6a68bff2fb71def5fb9b9aec940fb030bcd4 @@ -38385,6 +39620,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:2.6.2, tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.6.2": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 10/bd26c22d36736513980091a1e356378e8b662ded04204453d353a7f34a4c21ed0afc59b5f90719d4ba756e581a162ecbf93118dc9c6be5acf70aa309188166ca + languageName: node + linkType: hard + "tslib@npm:2.7.0": version: 2.7.0 resolution: "tslib@npm:2.7.0" @@ -38392,13 +39634,6 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.0.1, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.6.2": - version: 2.6.2 - resolution: "tslib@npm:2.6.2" - checksum: 10/bd26c22d36736513980091a1e356378e8b662ded04204453d353a7f34a4c21ed0afc59b5f90719d4ba756e581a162ecbf93118dc9c6be5acf70aa309188166ca - languageName: node - linkType: hard - "tslib@npm:^2.6.1": version: 2.6.3 resolution: "tslib@npm:2.6.3" @@ -38406,6 +39641,13 @@ __metadata: languageName: node linkType: hard +"tslib@npm:^2.8.0": + version: 2.8.1 + resolution: "tslib@npm:2.8.1" + checksum: 10/3e2e043d5c2316461cb54e5c7fe02c30ef6dccb3384717ca22ae5c6b5bc95232a6241df19c622d9c73b809bea33b187f6dbc73030963e29950c2141bc32a79f7 + languageName: node + linkType: hard + "tsutils@npm:^3.21.0": version: 3.21.0 resolution: "tsutils@npm:3.21.0" @@ -38426,6 +39668,13 @@ __metadata: languageName: node linkType: hard +"turbo-stream@npm:2.4.0": + version: 2.4.0 + resolution: "turbo-stream@npm:2.4.0" + checksum: 10/7079bbc82b58340f783144cd669cc7e598288523103a8d68bb8a4c6bb28c64eccb71d389b33aab07788d3a9030638b795709e15cb8486f722b1cdac59cb58afc + languageName: node + linkType: hard + "tweetnacl-util@npm:^0.15.0, tweetnacl-util@npm:^0.15.1": version: 0.15.1 resolution: "tweetnacl-util@npm:0.15.1" @@ -38661,6 +39910,15 @@ __metadata: languageName: node linkType: hard +"ua-parser-js@npm:^1.0.33": + version: 1.0.40 + resolution: "ua-parser-js@npm:1.0.40" + bin: + ua-parser-js: script/cli.js + checksum: 10/7fced5f74ed570c83addffd4d367888d90c58803ff4bdd4a7b04b3f01d293263b8605e92ac560eb1c6a201ef3b11fcc46f3dbcbe764fbe54974924d542bc0135 + languageName: node + linkType: hard + "ua-parser-js@npm:^1.0.35": version: 1.0.37 resolution: "ua-parser-js@npm:1.0.37" @@ -38682,6 +39940,13 @@ __metadata: languageName: node linkType: hard +"ufo@npm:^1.5.4": + version: 1.5.4 + resolution: "ufo@npm:1.5.4" + checksum: 10/a885ed421e656aea6ca64e9727b8118a9488715460b6f1a0f0427118adfe2f2830fe7c1d5bd9c5c754a332e6807516551cd663ea67ce9ed6a4e3edc739916335 + languageName: node + linkType: hard + "uint8array-tools@npm:^0.0.8": version: 0.0.8 resolution: "uint8array-tools@npm:0.0.8" @@ -39084,7 +40349,7 @@ __metadata: languageName: node linkType: hard -"url-parse@npm:^1.5.10, url-parse@npm:^1.5.3, url-parse@npm:^1.5.9": +"url-parse@npm:^1.5.10, url-parse@npm:^1.5.3": version: 1.5.10 resolution: "url-parse@npm:1.5.10" dependencies: @@ -39275,6 +40540,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:>=8 <10, uuid@npm:^9.0.0": + version: 9.0.1 + resolution: "uuid@npm:9.0.1" + bin: + uuid: dist/bin/uuid + checksum: 10/9d0b6adb72b736e36f2b1b53da0d559125ba3e39d913b6072f6f033e0c87835b414f0836b45bcfaf2bdf698f92297fea1c3cc19b0b258bc182c9c43cc0fab9f2 + languageName: node + linkType: hard + "uuid@npm:^3.0.0, uuid@npm:^3.3.2": version: 3.4.0 resolution: "uuid@npm:3.4.0" @@ -39302,15 +40576,6 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^9.0.0": - version: 9.0.1 - resolution: "uuid@npm:9.0.1" - bin: - uuid: dist/bin/uuid - checksum: 10/9d0b6adb72b736e36f2b1b53da0d559125ba3e39d913b6072f6f033e0c87835b414f0836b45bcfaf2bdf698f92297fea1c3cc19b0b258bc182c9c43cc0fab9f2 - languageName: node - linkType: hard - "v8-to-istanbul@npm:^9.0.1": version: 9.2.0 resolution: "v8-to-istanbul@npm:9.2.0" @@ -39374,6 +40639,13 @@ __metadata: languageName: node linkType: hard +"validator@npm:^13.12.0": + version: 13.12.0 + resolution: "validator@npm:13.12.0" + checksum: 10/db6eb0725e2b67d60d30073ae8573982713b5903195d031dc3c7db7e82df8b74e8c13baef8e2106d146d979599fd61a06cde1fec5c148e4abd53d52817ff0fd9 + languageName: node + linkType: hard + "validator@npm:^13.7.0": version: 13.11.0 resolution: "validator@npm:13.11.0" @@ -39489,6 +40761,28 @@ __metadata: languageName: node linkType: hard +"viem@npm:^2.21.9": + version: 2.22.8 + resolution: "viem@npm:2.22.8" + dependencies: + "@noble/curves": "npm:1.7.0" + "@noble/hashes": "npm:1.6.1" + "@scure/bip32": "npm:1.6.0" + "@scure/bip39": "npm:1.5.0" + abitype: "npm:1.0.7" + isows: "npm:1.0.6" + ox: "npm:0.6.0" + webauthn-p256: "npm:0.0.10" + ws: "npm:8.18.0" + peerDependencies: + typescript: ">=5.0.4" + peerDependenciesMeta: + typescript: + optional: true + checksum: 10/04e3c8d1acdad0fc9a1fa5c50ff5b37081502fda5a00fedb457fb70b887dd16bbfea06984ecf1a360de446ec1bef2996bcc0c9415c1f76cc0fd0c333677e2369 + languageName: node + linkType: hard + "viem@npm:^2.9.2": version: 2.9.2 resolution: "viem@npm:2.9.2" @@ -39627,6 +40921,16 @@ __metadata: languageName: node linkType: hard +"web3-core-helpers@npm:1.10.4, web3-core-helpers@npm:^1.8.0": + version: 1.10.4 + resolution: "web3-core-helpers@npm:1.10.4" + dependencies: + web3-eth-iban: "npm:1.10.4" + web3-utils: "npm:1.10.4" + checksum: 10/9c22942827bed0e46ae491a0bee3cd60cea636f9b0408b11bb341b0370e58a94358025657405142c2a24f3912a8f947e6e977d594d9ba66e11dedce3c5c4a7f4 + languageName: node + linkType: hard + "web3-core-method@npm:1.10.3": version: 1.10.3 resolution: "web3-core-method@npm:1.10.3" @@ -39640,6 +40944,19 @@ __metadata: languageName: node linkType: hard +"web3-core-method@npm:1.10.4": + version: 1.10.4 + resolution: "web3-core-method@npm:1.10.4" + dependencies: + "@ethersproject/transactions": "npm:^5.6.2" + web3-core-helpers: "npm:1.10.4" + web3-core-promievent: "npm:1.10.4" + web3-core-subscriptions: "npm:1.10.4" + web3-utils: "npm:1.10.4" + checksum: 10/d942beba3999c084333f5c808ada2a90930d55d148d5f8cc51a2135f8ab3f101fa5ce0d732a60830e8cad2af844bbed6cf0b6250863003adafb08c7ffa9fbd5f + languageName: node + linkType: hard + "web3-core-promievent@npm:1.10.3": version: 1.10.3 resolution: "web3-core-promievent@npm:1.10.3" @@ -39649,6 +40966,15 @@ __metadata: languageName: node linkType: hard +"web3-core-promievent@npm:1.10.4": + version: 1.10.4 + resolution: "web3-core-promievent@npm:1.10.4" + dependencies: + eventemitter3: "npm:4.0.4" + checksum: 10/a792c74aa5c91dc63fb493af04628ecfa08b9e6ceea402dfe53f718b019c41d63a0200bf3045dd23ec3c42b8d7474ac96eb4cb4456060becc551c2cacbd02bb1 + languageName: node + linkType: hard + "web3-core-requestmanager@npm:1.10.3": version: 1.10.3 resolution: "web3-core-requestmanager@npm:1.10.3" @@ -39662,6 +40988,19 @@ __metadata: languageName: node linkType: hard +"web3-core-requestmanager@npm:1.10.4": + version: 1.10.4 + resolution: "web3-core-requestmanager@npm:1.10.4" + dependencies: + util: "npm:^0.12.5" + web3-core-helpers: "npm:1.10.4" + web3-providers-http: "npm:1.10.4" + web3-providers-ipc: "npm:1.10.4" + web3-providers-ws: "npm:1.10.4" + checksum: 10/c26bf616cc156b2198bf634084978d66cf384cf2b174324b6ada071a8c9e9be7855d72c09453308d1a46b50874c18ff9b75193f8736c2b285cdc32209391880c + languageName: node + linkType: hard + "web3-core-subscriptions@npm:1.10.3": version: 1.10.3 resolution: "web3-core-subscriptions@npm:1.10.3" @@ -39672,6 +41011,16 @@ __metadata: languageName: node linkType: hard +"web3-core-subscriptions@npm:1.10.4": + version: 1.10.4 + resolution: "web3-core-subscriptions@npm:1.10.4" + dependencies: + eventemitter3: "npm:4.0.4" + web3-core-helpers: "npm:1.10.4" + checksum: 10/b1652988c0925ab1d5c27e67a816ec6bcb32f37f59c7314e1f02552233fbc486a0de579aeb660d77d82452b63e9feaa98317ec7897cd7aeb140595c8e176d0eb + languageName: node + linkType: hard + "web3-core@npm:1.10.3": version: 1.10.3 resolution: "web3-core@npm:1.10.3" @@ -39687,6 +41036,21 @@ __metadata: languageName: node linkType: hard +"web3-core@npm:^1.8.0": + version: 1.10.4 + resolution: "web3-core@npm:1.10.4" + dependencies: + "@types/bn.js": "npm:^5.1.1" + "@types/node": "npm:^12.12.6" + bignumber.js: "npm:^9.0.0" + web3-core-helpers: "npm:1.10.4" + web3-core-method: "npm:1.10.4" + web3-core-requestmanager: "npm:1.10.4" + web3-utils: "npm:1.10.4" + checksum: 10/138c5abff27a48d16584fdbe56b940f9efe7cd2463d768f42c5fcdfc97d0dc4fc41e09ff1ffb8c8ff79b22a69e9efbf5af27c4b6a0d888c351202f03a8b01b8e + languageName: node + linkType: hard + "web3-eth-abi@npm:1.10.3": version: 1.10.3 resolution: "web3-eth-abi@npm:1.10.3" @@ -39757,6 +41121,16 @@ __metadata: languageName: node linkType: hard +"web3-eth-iban@npm:1.10.4": + version: 1.10.4 + resolution: "web3-eth-iban@npm:1.10.4" + dependencies: + bn.js: "npm:^5.2.1" + web3-utils: "npm:1.10.4" + checksum: 10/b5e33aaf3d41608ed59ea98c703271eefcd30aea15163cda4bc8713f9716eb40b816e8047022ebf71391250983acfe58e65551461109a53e266f4b824c4a0678 + languageName: node + linkType: hard + "web3-eth-personal@npm:1.10.3": version: 1.10.3 resolution: "web3-eth-personal@npm:1.10.3" @@ -39814,6 +41188,18 @@ __metadata: languageName: node linkType: hard +"web3-providers-http@npm:1.10.4": + version: 1.10.4 + resolution: "web3-providers-http@npm:1.10.4" + dependencies: + abortcontroller-polyfill: "npm:^1.7.5" + cross-fetch: "npm:^4.0.0" + es6-promise: "npm:^4.2.8" + web3-core-helpers: "npm:1.10.4" + checksum: 10/2ff27d45cc7c7b1e8f07a7917fe1502fef59e211b2ee97851369f9b6dab99ce81b0bef50f9ecf36286137fc41f1230f04b55b090d30f870fbc5ef1972d165b5f + languageName: node + linkType: hard + "web3-providers-ipc@npm:1.10.3": version: 1.10.3 resolution: "web3-providers-ipc@npm:1.10.3" @@ -39824,6 +41210,16 @@ __metadata: languageName: node linkType: hard +"web3-providers-ipc@npm:1.10.4": + version: 1.10.4 + resolution: "web3-providers-ipc@npm:1.10.4" + dependencies: + oboe: "npm:2.1.5" + web3-core-helpers: "npm:1.10.4" + checksum: 10/cd33a954f59ba3a9ca466dca0d6563f46c56879dc249d885b8edfee077f9f58ccf591ba06855e1d69baba52a8719c03684b0ba7b33d836bfdd4c6166e289c0d4 + languageName: node + linkType: hard + "web3-providers-ws@npm:1.10.3": version: 1.10.3 resolution: "web3-providers-ws@npm:1.10.3" @@ -39835,6 +41231,17 @@ __metadata: languageName: node linkType: hard +"web3-providers-ws@npm:1.10.4": + version: 1.10.4 + resolution: "web3-providers-ws@npm:1.10.4" + dependencies: + eventemitter3: "npm:4.0.4" + web3-core-helpers: "npm:1.10.4" + websocket: "npm:^1.0.32" + checksum: 10/98cb76473ae1060e21ff474768a04c6dcd91724f24a1fac2d4a5f186a35bd2f119605fbb28423dfe5be33755b1e5808b10514ddaf326b57573b447efc84ef730 + languageName: node + linkType: hard + "web3-shh@npm:1.10.3": version: 1.10.3 resolution: "web3-shh@npm:1.10.3" @@ -39863,6 +41270,22 @@ __metadata: languageName: node linkType: hard +"web3-utils@npm:1.10.4": + version: 1.10.4 + resolution: "web3-utils@npm:1.10.4" + dependencies: + "@ethereumjs/util": "npm:^8.1.0" + bn.js: "npm:^5.2.1" + ethereum-bloom-filters: "npm:^1.0.6" + ethereum-cryptography: "npm:^2.1.2" + ethjs-unit: "npm:0.1.6" + number-to-bn: "npm:1.7.0" + randombytes: "npm:^2.1.0" + utf8: "npm:3.0.0" + checksum: 10/3e586b638cdae9fa45b7698e8a511ae2cbf60e219a900351ae38d384beaaf67424ac6e1d9c5098c3fb8f2ff3cc65a70d977a20bdce3dad542cb50deb666ea2a3 + languageName: node + linkType: hard + "web3@npm:^1.7.3": version: 1.10.3 resolution: "web3@npm:1.10.3" @@ -39878,6 +41301,16 @@ __metadata: languageName: node linkType: hard +"webauthn-p256@npm:0.0.10": + version: 0.0.10 + resolution: "webauthn-p256@npm:0.0.10" + dependencies: + "@noble/curves": "npm:^1.4.0" + "@noble/hashes": "npm:^1.4.0" + checksum: 10/dde2b6313b6a0f20996f7ee90181258fc7685bfff401df7d904578da75b374f25d5b9c1189cd2fcec30625b1f276b393188d156d49783f0611623cd713bb5b09 + languageName: node + linkType: hard + "webcrypto-core@npm:^1.8.0": version: 1.8.0 resolution: "webcrypto-core@npm:1.8.0" @@ -40564,6 +41997,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:8.18.0": + version: 8.18.0 + resolution: "ws@npm:8.18.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 10/70dfe53f23ff4368d46e4c0b1d4ca734db2c4149c6f68bc62cb16fc21f753c47b35fcc6e582f3bdfba0eaeb1c488cddab3c2255755a5c3eecb251431e42b3ff6 + languageName: node + linkType: hard + "ws@npm:8.5.0": version: 8.5.0 resolution: "ws@npm:8.5.0" @@ -41035,6 +42483,13 @@ __metadata: languageName: node linkType: hard +"zod@npm:^3.21.4, zod@npm:^3.22.4": + version: 3.24.1 + resolution: "zod@npm:3.24.1" + checksum: 10/54e25956495dec22acb9399c168c6ba657ff279801a7fcd0530c414d867f1dcca279335e160af9b138dd70c332e17d548be4bc4d2f7eaf627dead50d914fec27 + languageName: node + linkType: hard + "zustand@npm:4.4.1": version: 4.4.1 resolution: "zustand@npm:4.4.1" @@ -41094,3 +42549,24 @@ __metadata: checksum: 10/481b8210187b69678074a1ca51107654c2379688e90407bfcb7961e0803a259742bfd0d77171c3f07e290896ad55fe9659b3863f30d34cb2572650ead1249f25 languageName: node linkType: hard + +"zustand@npm:^5.0.1": + version: 5.0.3 + resolution: "zustand@npm:5.0.3" + peerDependencies: + "@types/react": ">=18.0.0" + immer: ">=9.0.6" + react: ">=18.0.0" + use-sync-external-store: ">=1.2.0" + peerDependenciesMeta: + "@types/react": + optional: true + immer: + optional: true + react: + optional: true + use-sync-external-store: + optional: true + checksum: 10/35728fdaa68291ea3e469524316dda4fe1d8cc22d8be3df309ca99bda0dbc7e66a1c502f66c26f76abfb4bd49a6e1368160353eb3cb173c24042a5f252075462 + languageName: node + linkType: hard